| 
					
				 | 
			
			
				@ -41,6 +41,7 @@ import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.healthCare.YlzMedicailRelationDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.httplog.service.WlyyHttpLogService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.message.dao.SystemMessageDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.message.service.BaseBannerDoctorService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.message.service.BaseUserMsgService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.message.service.SystemMessageService; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -75,6 +76,7 @@ import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.rm.patient.PatientRequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.sms.service.YkyyINSMSService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.common.FileUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.common.IdCardUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.common.XMLUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.date.DateUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.wechat.dao.BasePatientWechatDao; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -269,6 +271,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private DsyyPrescriptionService dsyyPrescriptionService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private SystemMessageDao systemMessageDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @GetMapping(value = "orgInfo") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -758,6 +762,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        logger.info("his充值结束"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (businessOrderDO.getStatus()!=1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        WlyyOutpatientDO wlyyOutpatientDO = new WlyyOutpatientDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("4")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findById(businessOrderDO.getRelationCode()).orElse(null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -774,11 +779,20 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            prescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            prescriptionVO.setPayStatus(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            imService.pushPrescriptionImMessage(prescriptionVO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            SystemMessageDO systemMessageDO = new SystemMessageDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setType("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setReceiver(businessOrderDO.getDoctor()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setSender(businessOrderDO.getPatient()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode()).get(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            //发送IM消息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            hospitalSystemMessageService.sendImMessage(systemMessageDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("2")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            SystemMessageDO systemMessageDO = new SystemMessageDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setType("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setReceiver(businessOrderDO.getDoctor()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setSender(businessOrderDO.getPatient()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode()).get(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            //发送IM消息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            hospitalSystemMessageService.sendImMessage(systemMessageDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("3")){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -786,6 +800,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setType("2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setReceiver(businessOrderDO.getDoctor()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setSender(businessOrderDO.getPatient()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode()).get(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            //发送IM消息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            hospitalSystemMessageService.sendImMessage(systemMessageDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("6")){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -794,7 +809,68 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                dsyyPrescriptionService.confirmSettlement(ylzMedicalRelationDO.getRelationCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (wlyyOutpatientDO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String msg = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String sex = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String age=""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String date = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String title = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            SystemMessageDO systemMessageDO = new SystemMessageDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            if ("2".equals(wlyyOutpatientDO.getOutpatientType())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                systemMessageDO.setTitle("协同门诊接诊消息提醒"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                systemMessageDO.setType("63"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } else if ("3".equals(wlyyOutpatientDO.getOutpatientType())) {//专家咨询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                //1.图文 2.视频 3家医 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                if ("1".equals(wlyyOutpatientDO.getType())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    systemMessageDO.setTitle("图文咨询接诊消息提醒"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    systemMessageDO.setType("68"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    title = "图文咨询消息提醒"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)向您发起了图文咨询,请您及时点击回复"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                } else if ("3".equals(wlyyOutpatientDO.getType())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    systemMessageDO.setTitle("家医咨询接诊消息提醒"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    systemMessageDO.setType("65"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    systemMessageDO.setTitle("视频咨询接诊消息提醒"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    systemMessageDO.setType("67"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    title = "视频咨询接诊消息提醒"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    date = DateUtil.dateToStrLong(wlyyOutpatientDO.getRegisterDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)预约了"+date+"的视频咨询,点击查看"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } else if ("1".equals(wlyyOutpatientDO.getOutpatientType())) {//在线复诊 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                //1.图文 2.视频 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                if ("1".equals(wlyyOutpatientDO.getType())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    systemMessageDO.setTitle("图文复诊接诊消息提醒"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    systemMessageDO.setType("61"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    title = "图文复诊接诊消息提醒"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)向您发起了图文复诊,请您及时点击接诊"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    systemMessageDO.setTitle("视频复诊接诊消息提醒"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    systemMessageDO.setType("62"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    title = "视频复诊接诊消息提醒"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    date = DateUtil.dateToStrLong(wlyyOutpatientDO.getRegisterDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            net.sf.json.JSONObject data = new net.sf.json.JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            data.put("name", wlyyOutpatientDO.getPatientName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            data.put("age", IdCardUtil.getAgeForIdcard(wlyyOutpatientDO.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            data.put("gender", IdCardUtil.getSexForIdcard_new(wlyyOutpatientDO.getIdcard())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            data.put("question", wlyyOutpatientDO.getDescription()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            data.put("msg", systemMessageDO.getTitle()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setData(data.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setReceiver(wlyyOutpatientDO.getDoctor()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setReceiverName(wlyyOutpatientDO.getDoctorName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setRelationCode(wlyyOutpatientDO.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setSender(wlyyOutpatientDO.getPatient()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setSenderName(wlyyOutpatientDO.getPatientName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setRelationCode(wlyyOutpatientDO.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setIsRead("0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setDel("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDO.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            systemMessageDao.save(systemMessageDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    businessOrderService.updatePayStatus(traceNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    return "SUCCESS"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 |