|  | @ -76,10 +76,12 @@ import com.yihu.jw.util.common.IdCardUtil;
 | 
												
													
														
															|  | import com.yihu.jw.util.common.LatitudeUtils;
 |  | import com.yihu.jw.util.common.LatitudeUtils;
 | 
												
													
														
															|  | import com.yihu.jw.util.date.DateUtil;
 |  | import com.yihu.jw.util.date.DateUtil;
 | 
												
													
														
															|  | import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
 |  | import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
 | 
												
													
														
															|  | 
 |  | import com.yihu.jw.utils.AdminException;
 | 
												
													
														
															|  | import com.yihu.jw.utils.Pkis.PKIService_PortType;
 |  | import com.yihu.jw.utils.Pkis.PKIService_PortType;
 | 
												
													
														
															|  | import com.yihu.jw.utils.Pkis.PKIService_ServiceLocator;
 |  | import com.yihu.jw.utils.Pkis.PKIService_ServiceLocator;
 | 
												
													
														
															|  | import com.yihu.jw.utils.WebserviceUtil;
 |  | import com.yihu.jw.utils.WebserviceUtil;
 | 
												
													
														
															|  | import com.yihu.jw.utils.hibernate.HibenateUtils;
 |  | import com.yihu.jw.utils.hibernate.HibenateUtils;
 | 
												
													
														
															|  | 
 |  | import com.yihu.jw.utils.sfutils.MyErrorCode;
 | 
												
													
														
															|  | import com.yihu.jw.wechat.dao.BasePatientWechatDao;
 |  | import com.yihu.jw.wechat.dao.BasePatientWechatDao;
 | 
												
													
														
															|  | import com.yihu.jw.wechat.dao.WechatDao;
 |  | import com.yihu.jw.wechat.dao.WechatDao;
 | 
												
													
														
															|  | import com.yihu.jw.wechat.dao.WxPushLogDao;
 |  | import com.yihu.jw.wechat.dao.WxPushLogDao;
 | 
												
											
												
													
														
															|  | @ -281,14 +283,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |      * @return
 |  |      * @return
 | 
												
													
														
															|  |      * @throws Exception
 |  |      * @throws Exception
 | 
												
													
														
															|  |      */
 |  |      */
 | 
												
													
														
															|  |     public List<WlyyOutpatientVO> findOutpatientList(String patient, String startTime, String endTime, boolean demoFlag) throws Exception {
 |  | 
 | 
												
													
														
															|  | 
 |  |     public List<WlyyOutpatientVO> findOutpatientList(String patient, String startTime, String endTime, boolean demoFlag,String ksdm) throws Exception {
 | 
												
													
														
															|  |         logger.info("findOutpatientList patient:" + patient);
 |  |         logger.info("findOutpatientList patient:" + patient);
 | 
												
													
														
															|  |         String patNo = patientMappingService.findHisPatNoByPatient(patient);
 |  |         String patNo = patientMappingService.findHisPatNoByPatient(patient);
 | 
												
													
														
															|  |         if (StringUtils.isBlank(patNo)) {
 |  |         if (StringUtils.isBlank(patNo)) {
 | 
												
													
														
															|  |             return null;
 |  |             return null;
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         logger.info("findOutpatientList patNo " + patNo);
 |  |         logger.info("findOutpatientList patNo " + patNo);
 | 
												
													
														
															|  |         return entranceService.BS30025(patNo, null, startTime, endTime, demoFlag);
 |  | 
 | 
												
													
														
															|  | 
 |  |         return entranceService.BS30025(patNo, null, startTime, endTime, demoFlag,ksdm);
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     /**
 |  |     /**
 | 
												
											
												
													
														
															|  | @ -305,7 +307,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |             return null;
 |  |             return null;
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         logger.info("findOutpatientList patNo:" + patNo);
 |  |         logger.info("findOutpatientList patNo:" + patNo);
 | 
												
													
														
															|  |         List<WlyyOutpatientVO> list = entranceService.BS30025(patNo, conNo, null, null, demoFlag);
 |  | 
 | 
												
													
														
															|  | 
 |  |         List<WlyyOutpatientVO> list = entranceService.BS30025(patNo, conNo, null, null, demoFlag,null);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         if (list != null && list.size() > 0) {
 |  |         if (list != null && list.size() > 0) {
 | 
												
													
														
															|  |             WlyyOutpatientVO outpatientVO = list.get(0);
 |  |             WlyyOutpatientVO outpatientVO = list.get(0);
 | 
												
											
												
													
														
															|  | @ -794,6 +796,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |      * @return
 |  |      * @return
 | 
												
													
														
															|  |      * @throws Exception
 |  |      * @throws Exception
 | 
												
													
														
															|  |      */
 |  |      */
 | 
												
													
														
															|  | 
 |  |     @Transactional
 | 
												
													
														
															|  |     public WlyyOutpatientDO appointmentRevisit(String outpatientJson, String expressageJson, String registerJson, String chargeType) throws Exception {
 |  |     public WlyyOutpatientDO appointmentRevisit(String outpatientJson, String expressageJson, String registerJson, String chargeType) throws Exception {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         //1.保存就诊实体
 |  |         //1.保存就诊实体
 | 
												
											
												
													
														
															|  | @ -812,7 +815,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |         if (outpatientDO.getRegisterDate() == null) {
 |  |         if (outpatientDO.getRegisterDate() == null) {
 | 
												
													
														
															|  |             outpatientDO.setRegisterDate(new Date());
 |  |             outpatientDO.setRegisterDate(new Date());
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |         WlyyPrescriptionExpressageDO previous = checkOutPatientPre(outpatientDO.getPatient());
 | 
												
													
														
															|  | 
 |  |         //2.物流信息
 | 
												
													
														
															|  | 
 |  |         WlyyPrescriptionExpressageDO expressageDO = objectMapper.readValue(expressageJson, WlyyPrescriptionExpressageDO.class);
 | 
												
													
														
															|  | 
 |  |         if (null!=previous.getId()&&previous.getOneselfPickupFlg()!=expressageDO.getOneselfPickupFlg()){
 | 
												
													
														
															|  | 
 |  |             throw new AdminException(MyErrorCode.take_control);
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  |         WlyyOutpatientDO outpatient = outpatientDao.save(outpatientDO);
 |  |         WlyyOutpatientDO outpatient = outpatientDao.save(outpatientDO);
 | 
												
													
														
															|  |         WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("WX_MONEY");
 |  |         WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("WX_MONEY");
 | 
												
													
														
															|  |         Double price = 0.0;
 |  |         Double price = 0.0;
 | 
												
											
												
													
														
															|  | @ -843,19 +851,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |         } catch (Exception e) {
 |  |         } catch (Exception e) {
 | 
												
													
														
															|  |             throw new RuntimeException("号源已经被预约,请选择其他号源");
 |  |             throw new RuntimeException("号源已经被预约,请选择其他号源");
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         WlyyPrescriptionExpressageDO previous = checkOutPatientPre(outpatientDO.getPatient());
 |  | 
 | 
												
													
														
															|  |         //2.物流信息
 |  | 
 | 
												
													
														
															|  |         WlyyPrescriptionExpressageDO expressageDO = objectMapper.readValue(expressageJson, WlyyPrescriptionExpressageDO.class);
 |  | 
 | 
												
													
														
															|  |       /*  if (null!=previous&&previous.getOneselfPickupFlg()!=expressageDO.getOneselfPickupFlg()){
 |  | 
 | 
												
													
														
															|  |             outpatientDao.delete(outpatient.getId());
 |  | 
 | 
												
													
														
															|  |             businessOrderDao.delete(businessOrderDO.getId());
 |  | 
 | 
												
													
														
															|  |             throw new Exception("您今日发起过复诊,不允许更改取药方式");
 |  | 
 | 
												
													
														
															|  |         }*/
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         if (0==expressageDO.getOneselfPickupFlg()){
 |  |         if (0==expressageDO.getOneselfPickupFlg()){
 | 
												
													
														
															|  |             /*if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
 |  | 
 | 
												
													
														
															|  | 
 |  |             if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
 | 
												
													
														
															|  |                 String drugCode= expressageDO.getHospitalCode()==null?"5550":expressageDO.getHospitalCode();
 |  |                 String drugCode= expressageDO.getHospitalCode()==null?"5550":expressageDO.getHospitalCode();
 | 
												
													
														
															|  |                 expressageDO.setHospitalCode(drugCode);
 |  |                 expressageDO.setHospitalCode(drugCode);
 | 
												
													
														
															|  |             }*/
 |  | 
 | 
												
													
														
															|  | 
 |  |             }
 | 
												
													
														
															|  |             System.out.println("进入物流信息");
 |  |             System.out.println("进入物流信息");
 | 
												
													
														
															|  |             expressageDO.setDel(1);
 |  |             expressageDO.setDel(1);
 | 
												
													
														
															|  |             expressageDO.setCreateTime(new Date());
 |  |             expressageDO.setCreateTime(new Date());
 | 
												
											
												
													
														
															|  | @ -3664,7 +3665,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |         } else if("outPatientTimeOutRemind".equalsIgnoreCase(titelType)) {
 |  |         } else if("outPatientTimeOutRemind".equalsIgnoreCase(titelType)) {
 | 
												
													
														
															|  |             contentMsg = "您邀请的医师暂无应答,您可以选择继续等待或者取消邀请。";
 |  |             contentMsg = "您邀请的医师暂无应答,您可以选择继续等待或者取消邀请。";
 | 
												
													
														
															|  |             first = outpatientDO.getPatientName() + ",您好!";
 |  |             first = outpatientDO.getPatientName() + ",您好!";
 | 
												
													
														
															|  |             msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId=    "+outpatientId;
 |  | 
 | 
												
													
														
															|  | 
 |  |             logger.info("outPatientTimeOutRemind:outpatientId="+outpatientId+"contentMsg"+contentMsg);
 | 
												
													
														
															|  | 
 |  |             msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
 | 
												
													
														
															|  |         } else if ("payRemind".equalsIgnoreCase(titelType)) {
 |  |         } else if ("payRemind".equalsIgnoreCase(titelType)) {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |             if ("9".equals(type)) {
 |  |             if ("9".equals(type)) {
 | 
												
											
												
													
														
															|  | @ -3694,7 +3696,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |             first = outpatientDO.getPatientName() + ",您好! 医生已为您开具处方,请及时支付。";
 |  |             first = outpatientDO.getPatientName() + ",您好! 医生已为您开具处方,请及时支付。";
 | 
												
													
														
															|  |             contentMsg = "医生已为您开具处方,请及时支付。";
 |  |             contentMsg = "医生已为您开具处方,请及时支付。";
 | 
												
													
														
															|  |             remark = "点击完成支付,如您已支付请忽略本条信息";
 |  |             remark = "点击完成支付,如您已支付请忽略本条信息";
 | 
												
													
														
															|  |             msgUrl="/ims-wx/index.html#/returnVisit/prescriptionDetail?outpatientId="+outpatientId;
 |  | 
 | 
												
													
														
															|  | 
 |  |             msgUrl="/ims-wx/index.html#/returnVisit/prescriptionDetail?outpatientId="+outpatientId+"&id="+remindMsg;
 | 
												
													
														
															|  |             logger.info("处方支付微信消息模板推送开始");
 |  |             logger.info("处方支付微信消息模板推送开始");
 | 
												
													
														
															|  |         } else if ("msgRemind".equalsIgnoreCase(titelType)) {
 |  |         } else if ("msgRemind".equalsIgnoreCase(titelType)) {
 | 
												
													
														
															|  |             first = outpatientDO.getPatientName() + ",您好!";
 |  |             first = outpatientDO.getPatientName() + ",您好!";
 | 
												
											
												
													
														
															|  | @ -3999,6 +4001,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |             logger.info("XZZX_Msg_" + titelType + "=" + responseMsg);
 |  |             logger.info("XZZX_Msg_" + titelType + "=" + responseMsg);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         } else if ("xm_zsyy_wx".equalsIgnoreCase(wxId)) {
 |  |         } else if ("xm_zsyy_wx".equalsIgnoreCase(wxId)) {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |             String responseMsg="";
 |  |             String responseMsg="";
 | 
												
													
														
															|  |             String prefix="https://hlwyy.xmzsh.com";
 |  |             String prefix="https://hlwyy.xmzsh.com";
 | 
												
													
														
															|  |             if(StringUtils.isNotEmpty(outpatientId)){
 |  |             if(StringUtils.isNotEmpty(outpatientId)){
 | 
												
											
												
													
														
															|  | @ -4011,6 +4014,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                         contentMsg,
 |  |                         contentMsg,
 | 
												
													
														
															|  |                         remark
 |  |                         remark
 | 
												
													
														
															|  |                 );
 |  |                 );
 | 
												
													
														
															|  | 
 |  |                 System.out.println("结束发送模板消息");
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
													
														
															|  |             if (consultTeam!=null&&consPatientDO!=null){
 |  |             if (consultTeam!=null&&consPatientDO!=null){
 | 
												
													
														
															|  |                 responseMsg = entranceService.ehospitalNotice(
 |  |                 responseMsg = entranceService.ehospitalNotice(
 | 
												
											
												
													
														
															|  | @ -7215,7 +7219,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |             if ("xm_ykyy_wx".equalsIgnoreCase(wxId)) {
 |  |             if ("xm_ykyy_wx".equalsIgnoreCase(wxId)) {
 | 
												
													
														
															|  |                 ykyyService.pushNotificationToYktPatient(patient.getYktId(), messageDO.getTitle(), data.get("msg").toString());
 |  |                 ykyyService.pushNotificationToYktPatient(patient.getYktId(), messageDO.getTitle(), data.get("msg").toString());
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
													
														
															|  |             sendWxTemplateMsg(wxId, outpatientDO.getId(), null,"", "prescriptionPayRemind", "");
 |  | 
 | 
												
													
														
															|  | 
 |  |             sendWxTemplateMsg(wxId, outpatientDO.getId(), null,"", "prescriptionPayRemind", wlyyPrescriptionDO.getId());
 | 
												
													
														
															|  |         } else {
 |  |         } else {
 | 
												
													
														
															|  |             wlyyPrescriptionDO.setId(prescriptionId);
 |  |             wlyyPrescriptionDO.setId(prescriptionId);
 | 
												
													
														
															|  |             wlyyPrescriptionDO.setCheckStatus(status);
 |  |             wlyyPrescriptionDO.setCheckStatus(status);
 | 
												
											
												
													
														
															|  | @ -8229,7 +8233,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |      * @throws Exception
 |  |      * @throws Exception
 | 
												
													
														
															|  |      */
 |  |      */
 | 
												
													
														
															|  |     public void SOF_SignDataWithExtraInfoEmr(WlyyPrescriptionEmrDO prescriptionEmrDO) throws Exception {
 |  |     public void SOF_SignDataWithExtraInfoEmr(WlyyPrescriptionEmrDO prescriptionEmrDO) throws Exception {
 | 
												
													
														
															|  |         WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionEmrDO.getId());
 |  | 
 | 
												
													
														
															|  | 
 |  |         WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionEmrDO.getPrescriptionId());
 | 
												
													
														
															|  |         DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(prescriptionDO.getDoctor());
 |  |         DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(prescriptionDO.getDoctor());
 | 
												
													
														
															|  |         BaseDoctorDO doctorDO = baseDoctorDao.findById(prescriptionDO.getDoctor());
 |  |         BaseDoctorDO doctorDO = baseDoctorDao.findById(prescriptionDO.getDoctor());
 | 
												
													
														
															|  |         BasePatientDO patientDO = basePatientDao.findById(prescriptionDO.getPatientCode());
 |  |         BasePatientDO patientDO = basePatientDao.findById(prescriptionDO.getPatientCode());
 |