|  | @ -4550,9 +4550,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 if("1".equals(outpatient.getType())){
 | 
	
		
			
				|  |  |                     systemMessageDO.setTitle("图文复诊");
 | 
	
		
			
				|  |  |                     systemMessageDO.setType("1");
 | 
	
		
			
				|  |  |                     saveInquirySystemMessage(outpatient);
 | 
	
		
			
				|  |  |                 }else {
 | 
	
		
			
				|  |  |                     systemMessageDO.setTitle("视频复诊");
 | 
	
		
			
				|  |  |                     systemMessageDO.setTitle("视频复诊预约成功");
 | 
	
		
			
				|  |  |                     systemMessageDO.setType("2");
 | 
	
		
			
				|  |  |                     saveInquirySystemMessage(outpatient);
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             systemMessageDO.setReceiver(outpatient.getDoctor());
 | 
	
	
		
			
				|  | @ -4567,6 +4569,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |             data.put("age",IdCardUtil.getAgeForIdcard(outpatient.getIdcard()));
 | 
	
		
			
				|  |  |             data.put("gender",IdCardUtil.getSexForIdcard_new(outpatient.getIdcard()));
 | 
	
		
			
				|  |  |             data.put("question",outpatient.getDescription());
 | 
	
		
			
				|  |  |             String msg="您的视频复诊已预约成功。\n" +
 | 
	
		
			
				|  |  |                     "预计"+outpatient.getDoctorName()+"医生将于"+outpatient.getRegisterDate()+" 与您进行视频咨询。请留意系统消息或微信公众号消息。咨询开始时,医生将邀请您进行视频通话,请您关注消息提醒,及时接受医生视频邀请。";
 | 
	
		
			
				|  |  |             data.put("msg",msg);
 | 
	
		
			
				|  |  |             systemMessageDO.setData(data.toString());
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             systemMessageService.saveMessage(systemMessageDO);
 | 
	
	
		
			
				|  | @ -4578,6 +4583,39 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |         return systemMessageDO;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     public void saveInquirySystemMessage(WlyyOutpatientDO outpatient){
 | 
	
		
			
				|  |  |         SystemMessageDO systemMessageDO = new SystemMessageDO();
 | 
	
		
			
				|  |  |         String msg="";
 | 
	
		
			
				|  |  |         if("1".equals(outpatient.getType())){
 | 
	
		
			
				|  |  |             msg=outpatient.getPatientName()+",您好!您有一个图文复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
 | 
	
		
			
				|  |  |         }else {
 | 
	
		
			
				|  |  |             msg=outpatient.getPatientName()+",您好!您有一个视频复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         systemMessageDO.setTitle("线上问诊支付提醒");
 | 
	
		
			
				|  |  |         systemMessageDO.setType("11");
 | 
	
		
			
				|  |  |         systemMessageDO.setSender(outpatient.getDoctor());
 | 
	
		
			
				|  |  |         systemMessageDO.setSenderName(outpatient.getDoctorName());
 | 
	
		
			
				|  |  |         systemMessageDO.setRelationCode(outpatient.getId());
 | 
	
		
			
				|  |  |         systemMessageDO.setReceiver(outpatient.getPatient());
 | 
	
		
			
				|  |  |         systemMessageDO.setReceiverName(outpatient.getPatientName());
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         JSONObject data = new JSONObject();
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             data.put("name",outpatient.getPatientName());
 | 
	
		
			
				|  |  |             data.put("age",IdCardUtil.getAgeForIdcard(outpatient.getIdcard()));
 | 
	
		
			
				|  |  |             data.put("gender",IdCardUtil.getSexForIdcard_new(outpatient.getIdcard()));
 | 
	
		
			
				|  |  |             data.put("question",outpatient.getDescription());
 | 
	
		
			
				|  |  |             data.put("msg",msg);
 | 
	
		
			
				|  |  |             systemMessageDO.setData(data.toString());
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             systemMessageService.saveMessage(systemMessageDO);
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 指定门诊医生医生
 | 
	
		
			
				|  |  |      * @param outpatientJson
 | 
	
	
		
			
				|  | @ -5492,11 +5530,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |         if (status==2){
 | 
	
		
			
				|  |  |             /*prescriptionDao.updateCheckStatus(prescriptionId,2,reason,20);*/
 | 
	
		
			
				|  |  |             logger.info("开始====="+wlyyPrescriptionDO.getCheckStatus());
 | 
	
		
			
				|  |  |             WlyyOutpatientDO outpatientDO = outpatientDao.findById(wlyyPrescriptionDO.getOutpatientId());
 | 
	
		
			
				|  |  |             if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
 | 
	
		
			
				|  |  |                 try {
 | 
	
		
			
				|  |  |                     List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionId,1);
 | 
	
		
			
				|  |  |                     List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(prescriptionId,1);
 | 
	
		
			
				|  |  |                     WlyyOutpatientDO outpatientDO = outpatientDao.findById(wlyyPrescriptionDO.getOutpatientId());
 | 
	
		
			
				|  |  |                     DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(outpatientDO.getDoctor(), outpatientDO.getHospital());
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                     //his处方拼接开方条件
 | 
	
	
		
			
				|  | @ -5505,12 +5543,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                         //设置his药品查询条件
 | 
	
		
			
				|  |  |                         setInfoJsonParam(jsonData, doctorMappingDO, outpatientDO, wlyyPrescriptionDO, info, outpatientDO.getIcd10());
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                     for (WlyyInspectionDO ins:inspectionDOS){
 | 
	
		
			
				|  |  |                         //设置his药品查询条件
 | 
	
		
			
				|  |  |                         setInspectionParam(jsonData, doctorMappingDO, outpatientDO, wlyyPrescriptionDO, ins, outpatientDO.getIcd10());
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     sendHisDiagnosis(jsonData, outpatientDO, wlyyPrescriptionDO);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 } catch (Exception e) {
 | 
	
		
			
				|  |  |                     e.printStackTrace();
 | 
	
		
			
				|  |  |                 }
 | 
	
	
		
			
				|  | @ -5519,6 +5557,31 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |             wlyyPrescriptionDO.setCheckStatus(2);
 | 
	
		
			
				|  |  |             wlyyPrescriptionDO.setCheckReason(reason);
 | 
	
		
			
				|  |  |             wlyyPrescriptionDO.setStatus(20);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             //发送系统消息 处方支付提醒
 | 
	
		
			
				|  |  |             SystemMessageDO messageDO = new SystemMessageDO();
 | 
	
		
			
				|  |  |             messageDO.setType("6");
 | 
	
		
			
				|  |  |             messageDO.setTitle("处方支付提醒");
 | 
	
		
			
				|  |  |             messageDO.setSender(outpatientDO.getDoctor());
 | 
	
		
			
				|  |  |             messageDO.setSenderName(outpatientDO.getDoctorName());
 | 
	
		
			
				|  |  |             messageDO.setRelationCode(outpatientDO.getId());
 | 
	
		
			
				|  |  |             messageDO.setReceiver(outpatientDO.getPatient());
 | 
	
		
			
				|  |  |             messageDO.setReceiverName(outpatientDO.getPatientName());
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             try {
 | 
	
		
			
				|  |  |                 JSONObject data = new JSONObject();
 | 
	
		
			
				|  |  |                 data.put("name",outpatientDO.getPatientName());
 | 
	
		
			
				|  |  |                 data.put("age", IdCardUtil.getAgeForIdcard(outpatientDO.getIdcard()));
 | 
	
		
			
				|  |  |                 data.put("gender",IdCardUtil.getSexForIdcard_new(outpatientDO.getIdcard()));
 | 
	
		
			
				|  |  |                 data.put("question","");
 | 
	
		
			
				|  |  |                 String msg=outpatientDO.getPatientName()+",您好!医生已为您开具处方,请及时支付。如您已支付请忽略本条信息。";
 | 
	
		
			
				|  |  |                 data.put("msg",msg);
 | 
	
		
			
				|  |  |                 messageDO.setData(data.toString());
 | 
	
		
			
				|  |  |                 systemMessageService.saveMessage(messageDO);
 | 
	
		
			
				|  |  |             } catch (Exception e) {
 | 
	
		
			
				|  |  |                 e.printStackTrace();
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         }else{
 | 
	
		
			
				|  |  |             wlyyPrescriptionDO.setCheckStatus(status);
 | 
	
		
			
				|  |  |             wlyyPrescriptionDO.setCheckReason(reason);
 | 
	
	
		
			
				|  | @ -5528,6 +5591,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |         if (status==2||status==1){
 | 
	
		
			
				|  |  |             sendCheckMessage(status,wlyyPrescriptionDO,operate,operateName);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return prescriptionCheckDO;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 |