Quellcode durchsuchen

Merge branch 'dev' of suhaiwen/wlyy2.0 into dev

wangzhinan vor 4 Jahren
Ursprung
Commit
ce271bba65

+ 79 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -66,6 +66,7 @@ import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.LatitudeUtils;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.WebserviceUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
@ -4671,13 +4672,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public void saveInquirySystemMessage(WlyyOutpatientDO outpatient){
        SystemMessageDO systemMessageDO = new SystemMessageDO();
        String msg="";
        String type="";
        if("1".equals(outpatient.getType())){
            type="9";
            msg=outpatient.getPatientName()+",您好!您有一个图文复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
        }else {
            type="16";
            msg=outpatient.getPatientName()+",您好!您有一个视频复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
        }
        systemMessageDO.setTitle("线上问诊支付提醒");
        systemMessageDO.setTitle("支付提醒");
        systemMessageDO.setType("11");
        systemMessageDO.setSender(outpatient.getDoctor());
        systemMessageDO.setSenderName(outpatient.getDoctorName());
@ -4692,6 +4696,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            data.put("gender",IdCardUtil.getSexForIdcard_new(outpatient.getIdcard()));
            data.put("question",outpatient.getDescription());
            data.put("msg",msg);
            data.put("type",type);
            systemMessageDO.setData(data.toString());
            systemMessageService.saveMessage(systemMessageDO);
@ -5667,7 +5672,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            messageDO.setTitle("处方支付提醒");
            messageDO.setSender(outpatientDO.getDoctor());
            messageDO.setSenderName(outpatientDO.getDoctorName());
            messageDO.setRelationCode(outpatientDO.getId());
            messageDO.setRelationCode(outpatientDO.getId()+","+wlyyPrescriptionDO.getId());
            messageDO.setReceiver(outpatientDO.getPatient());
            messageDO.setReceiverName(outpatientDO.getPatientName());
@ -6243,4 +6248,76 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
//
//        return PageEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find,list,page,pagesize,count);
//    }
    /**
     * 查询患者所有处方信息
     * @param page
     * @param size
     * @return
     */
    public PageEnvelop findPatientAllPrescription(String keyName,String status,Integer page, Integer size) {
        String uid = userAgent.getUID();
        StringBuffer sql = new StringBuffer("select a.* from wlyy_prescription a,wlyy_prescription_info b where a.patient_code ='");
        StringBuffer countSql = new StringBuffer("select COUNT(a.id) count from wlyy_prescription a,wlyy_prescription_info b  where a.patient_code ='");
        sql.append(uid).append("' and a.status >= 0 AND a.id = b.prescription_id");
        countSql.append(uid).append("' and a.status >= 0 AND a.id = b.prescription_id ");
        if (StringUtils.isNotEmpty(keyName)){
            sql.append(" AND (" +
                    " a.doctor_name LIKE '%"+keyName+"%' " +
                    " OR a.dept_name LIKE'%"+keyName+"%' " +
                    " OR a.hospital_name LIKE '%"+keyName+"%' " +
                    " OR b.drug_name LIKE '%"+keyName+"%' " +
                    " OR a.real_order LIKE '%"+keyName+"%' " +
                    ")");
            countSql.append(" AND (" +
                    " a.doctor_name LIKE '%"+keyName+"%' " +
                    " OR a.dept_name LIKE'%"+keyName+"%' " +
                    " OR a.hospital_name LIKE '%"+keyName+"%' " +
                    " OR b.drug_name LIKE '%"+keyName+"%' " +
                    " OR a.real_order LIKE '%"+keyName+"%' " +
                    ")");
        }
        if (StringUtils.isNotEmpty(status)){
            sql.append(" AND a.`status`=").append(status);
            countSql.append(" AND a.`status`=").append(status);
        }
        sql.append(" order by a.prescribe_time limit ").append((page-1)*size).append(",").append(size);
        List<WlyyPrescriptionDO> list = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper<>(WlyyPrescriptionDO.class));
        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(countSql.toString());
        long count = Long.parseLong(mapList.get(0).get("count").toString());
        logger.info("sql="+sql.toString());
        logger.info("countSql="+countSql.toString());
        return PageEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find,list,page,size,count);
    }
    /**
     * 查询取药地址
     * @param outpatientId
     * @param longitude
     * @param dimension
     * @return
     */
    public MixEnvelop findDrugAddress(String outpatientId, String longitude, String dimension) {
        String sql="SELECT\n" +
                "\ta.*\n" +
                "FROM\n" +
                "\tbase_org a\n" +
                "LEFT JOIN (\n" +
                "\tSELECT\n" +
                "\t\tc.*\n" +
                "\tFROM\n" +
                "\t\twlyy_prescription_expressage c\n" +
                "\tWHERE\n" +
                " c.outpatient_id = '"+outpatientId+"'" +
                " ) d ON a.`code` = d.hospital_code";
        BaseOrgDO baseOrgDO = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(BaseOrgDO.class)).get(0);
        Map<String, String> rs = new HashMap<>();
        rs.put("hospital",baseOrgDO.getName());
        rs.put("address",baseOrgDO.getAddress());
        String distance = LatitudeUtils.getDistance(longitude, dimension, baseOrgDO.getLongitude(), baseOrgDO.getLatitude());
        rs.put("distance",distance);
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,rs);
    }
}

+ 0 - 71
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java

@ -529,76 +529,5 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        return array;
    }
    /**
     * 查询患者所有处方信息
     * @param page
     * @param size
     * @return
     */
    public PageEnvelop findPatientAllPrescription(String keyName,String status,Integer page, Integer size) {
        String uid = userAgent.getUID();
        StringBuffer sql = new StringBuffer("select a.* from wlyy_prescription a,wlyy_prescription_info b where a.patient_code ='");
        StringBuffer countSql = new StringBuffer("select COUNT(a.id) count from wlyy_prescription a,wlyy_prescription_info b  where a.patient_code ='");
        sql.append(uid).append("' and a.status >= 0 AND a.id = b.prescription_id");
        countSql.append(uid).append("' and a.status >= 0 AND a.id = b.prescription_id ");
        if (StringUtils.isNotEmpty(keyName)){
            sql.append(" AND (" +
                    " a.doctor_name LIKE '%"+keyName+"%' " +
                    " OR a.dept_name LIKE'%"+keyName+"%' " +
                    " OR a.hospital_name LIKE '%"+keyName+"%' " +
                    " OR b.drug_name LIKE '%"+keyName+"%' " +
                    " OR a.real_order LIKE '%"+keyName+"%' " +
                    ")");
            countSql.append(" AND (" +
                    " a.doctor_name LIKE '%"+keyName+"%' " +
                    " OR a.dept_name LIKE'%"+keyName+"%' " +
                    " OR a.hospital_name LIKE '%"+keyName+"%' " +
                    " OR b.drug_name LIKE '%"+keyName+"%' " +
                    " OR a.real_order LIKE '%"+keyName+"%' " +
                    ")");
        }
        if (StringUtils.isNotEmpty(status)){
            sql.append(" AND a.`status`=").append(status);
            countSql.append(" AND a.`status`=").append(status);
        }
        sql.append(" order by a.prescribe_time limit ").append((page-1)*size).append(",").append(size);
        List<WlyyPrescriptionDO> list = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper<>(WlyyPrescriptionDO.class));
        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(countSql.toString());
        long count = Long.parseLong(mapList.get(0).get("count").toString());
        logger.info("sql="+sql.toString());
        logger.info("countSql="+countSql.toString());
        return PageEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find,list,page,size,count);
    }
    /**
     * 查询取药地址
     * @param outpatientId
     * @param longitude
     * @param dimension
     * @return
     */
    public MixEnvelop findDrugAddress(String outpatientId, String longitude, String dimension) {
        String sql="SELECT\n" +
                "\ta.*\n" +
                "FROM\n" +
                "\tbase_org a\n" +
                "LEFT JOIN (\n" +
                "\tSELECT\n" +
                "\t\tc.*\n" +
                "\tFROM\n" +
                "\t\twlyy_prescription_expressage c\n" +
                "\tWHERE\n" +
                " c.outpatient_id = '"+outpatientId+"'" +
                " ) d ON a.`code` = d.hospital_code";
        BaseOrgDO baseOrgDO = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(BaseOrgDO.class)).get(0);
        Map<String, String> rs = new HashMap<>();
        rs.put("hospital",baseOrgDO.getName());
        rs.put("address",baseOrgDO.getAddress());
        String distance = LatitudeUtils.getDistance(longitude, dimension, baseOrgDO.getLongitude(), baseOrgDO.getLatitude());
        rs.put("distance",distance);
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,rs);
    }
}

+ 5 - 0
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -1355,6 +1355,7 @@ public class ImService {
		messageDO.setTitle("服务评价");
		messageDO.setSender(doctor.getId());
		messageDO.setSenderName(doctor.getName());
		messageDO.setRelationCode(consult);
		messageDO.setReceiver(patient.getId());
		messageDO.setReceiverName(patient.getName());
@ -1368,18 +1369,22 @@ public class ImService {
		if (cons.getType()!=null&&1==cons.getType()){
			String msg =patient.getName()+ ",您好!您有1条图文咨询已结束,请及时对咨询医生进行评价。";
			data.put("msg",msg);
			data.put("type","1");
		}
		if (cons.getType()!=null&&9==cons.getType()){
			String msg=patient.getName()+ ",您好!您有1条图文复诊已结束,请及时对咨询医生进行评价。";
			data.put("msg",msg);
			data.put("type","9");
		}
		if (cons.getType()!=null&&16==cons.getType()){
			String msg=patient.getName()+ ",您好!您有1条视频复诊已结束,请及时对咨询医生进行评价。";
			data.put("msg",msg);
			data.put("type","16");
		}
		if (cons.getType()!=null&&17==cons.getType()){
			String msg=patient.getName()+ ",您好!您有1条视频咨询已结束,请及时对咨询医生进行评价。";
			data.put("msg",msg);
			data.put("type","17");
		}
		messageDO.setData(data.toString());
		try {

+ 3 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -412,11 +412,11 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			//线上问诊支付提醒
			if (type==17||type==1){
				SystemMessageDO systemMessageDO = new SystemMessageDO();
				systemMessageDO.setTitle("线上问诊支付提醒");
				systemMessageDO.setTitle("支付提醒");
				systemMessageDO.setType("11");
				systemMessageDO.setSender(re.getString("doctor"));
				systemMessageDO.setSenderName(re.getString("doctorName"));
				systemMessageDO.setRelationCode(re.getString("sessiond_id"));
				systemMessageDO.setRelationCode(re.getString("consult"));
				systemMessageDO.setReceiver(re.getString("patient"));
				systemMessageDO.setReceiverName(re.getString("patientName"));
@ -425,6 +425,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
				data.put("age", IdCardUtil.getAgeForIdcard(re.getString("patient_idcard")));
				data.put("gender",IdCardUtil.getSexForIdcard_new(re.getString("patient_idcard")));
				data.put("question",symptoms);
                data.put("type",type);
				String msg= "";
				if (type==17){
					msg=re.getString("patientName")+",您好!您有一个视频咨询订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";

+ 34 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -1575,4 +1575,38 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findPatientAllPrescription)
    @ApiOperation(value = "查询患者所有处方信息", notes = "查询患者所有处方信息")
    public PageEnvelop findPatientAllPrescription(@ApiParam(name = "keyName", value = "搜索关键字")
                                                  @RequestParam(value = "keyName", required = false)String keyName,
                                                  @ApiParam(name = "status", value = "状态")
                                                  @RequestParam(value = "status", required = false)String status,
                                                  @ApiParam(name = "page", value = "第几页")
                                                  @RequestParam(value = "page",required = false) Integer page,
                                                  @ApiParam(name = "size", value = "页面大小")
                                                  @RequestParam(value = "size",required = false) Integer size)throws Exception {
        try {
            return prescriptionService.findPatientAllPrescription(keyName,status,page,size);
        } catch (Exception e) {
            return PageEnvelop.getError(e.getMessage(),-1);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDrugAddress)
    @ApiOperation(value = "查看取药地址", notes = "查看取药地址")
    public MixEnvelop findDrugAddress(@ApiParam(name = "outpatientId", value = "关联门诊code")
                                      @RequestParam(value = "outpatientId", required = true)String outpatientId,
                                      @ApiParam(name = "longitude", value = "经度")
                                      @RequestParam(value = "longitude",required = true) String longitude,
                                      @ApiParam(name = "dimension", value = "维度")
                                      @RequestParam(value = "dimension",required = true) String dimension)throws Exception {
        try {
            return prescriptionService.findDrugAddress(outpatientId,longitude,dimension);
        } catch (Exception e) {
            return MixEnvelop.getError(e.getMessage());
        }
    }
}

+ 0 - 36
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/YkyyPrescriptionEndpoint.java

@ -237,42 +237,6 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findPatientAllPrescription)
    @ApiOperation(value = "查询患者所有处方信息", notes = "查询患者所有处方信息")
    public PageEnvelop findPatientAllPrescription(@ApiParam(name = "keyName", value = "搜索关键字")
                                                      @RequestParam(value = "keyName", required = false)String keyName,
                                                  @ApiParam(name = "status", value = "状态")
                                                      @RequestParam(value = "status", required = false)String status,
                                                  @ApiParam(name = "page", value = "第几页")
                                                      @RequestParam(value = "page",required = false) Integer page,
                                                  @ApiParam(name = "size", value = "页面大小")
                                                      @RequestParam(value = "size",required = false) Integer size)throws Exception {
        try {
            return prescriptionService.findPatientAllPrescription(keyName,status,page,size);
        } catch (Exception e) {
            return PageEnvelop.getError(e.getMessage(),-1);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDrugAddress)
    @ApiOperation(value = "查看取药地址", notes = "查看取药地址")
    public MixEnvelop findDrugAddress(@ApiParam(name = "outpatientId", value = "关联门诊code")
                                                  @RequestParam(value = "outpatientId", required = true)String outpatientId,
                                                  @ApiParam(name = "longitude", value = "经度")
                                                  @RequestParam(value = "longitude",required = true) String longitude,
                                                  @ApiParam(name = "dimension", value = "维度")
                                                  @RequestParam(value = "dimension",required = true) String dimension)throws Exception {
        try {
            return prescriptionService.findDrugAddress(outpatientId,longitude,dimension);
        } catch (Exception e) {
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getICD10)
    @ApiOperation(value = "获取ICD10诊断编码", notes = "获取ICD10诊断编码")
    public ListEnvelop getICD10(@ApiParam(name = "pyKey", value = "拼音关键字")