|  | @ -148,6 +148,7 @@ import java.lang.Boolean;
 | 
												
													
														
															|  | import java.lang.management.ManagementFactory;
 |  | import java.lang.management.ManagementFactory;
 | 
												
													
														
															|  | import java.math.BigDecimal;
 |  | import java.math.BigDecimal;
 | 
												
													
														
															|  | import java.net.URL;
 |  | import java.net.URL;
 | 
												
													
														
															|  | 
 |  | import java.net.URLEncoder;
 | 
												
													
														
															|  | import java.text.DecimalFormat;
 |  | import java.text.DecimalFormat;
 | 
												
													
														
															|  | import java.text.ParseException;
 |  | import java.text.ParseException;
 | 
												
													
														
															|  | import java.text.SimpleDateFormat;
 |  | import java.text.SimpleDateFormat;
 | 
												
											
												
													
														
															|  | @ -5236,6 +5237,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                 newConfig.setKeyword1( outpatientDO.getHospitalName());
 |  |                 newConfig.setKeyword1( outpatientDO.getHospitalName());
 | 
												
													
														
															|  |                 newConfig.setKeyword2(outpatientDO.getDoctorName());
 |  |                 newConfig.setKeyword2(outpatientDO.getDoctorName());
 | 
												
													
														
															|  |                 newConfig.setKeyword3( doctorDO.getFee());
 |  |                 newConfig.setKeyword3( doctorDO.getFee());
 | 
												
													
														
															|  | 
 |  |                 newConfig.setPagepath(newConfig.getPagepath() + "" + outpatientDO.getId());
 | 
												
													
														
															|  |                 //发起微信消息模板推送
 |  |                 //发起微信消息模板推送
 | 
												
													
														
															|  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 |  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 | 
												
													
														
															|  |                 logger.info("眼科微信消息模板推送 医生拒诊开始");
 |  |                 logger.info("眼科微信消息模板推送 医生拒诊开始");
 | 
												
											
												
													
														
															|  | @ -5248,6 +5250,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                 scene="jzddgcts";
 |  |                 scene="jzddgcts";
 | 
												
													
														
															|  |                 WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_outpatient_timeout_remind", scene, 1);
 |  |                 WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_outpatient_timeout_remind", scene, 1);
 | 
												
													
														
															|  |                 BeanUtils.copyProperties(config, newConfig);
 |  |                 BeanUtils.copyProperties(config, newConfig);
 | 
												
													
														
															|  | 
 |  |                 newConfig.setPagepath(newConfig.getPagepath() + "" + outpatientDO.getId());
 | 
												
													
														
															|  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 |  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 | 
												
													
														
															|  |                 logger.info("就诊等待过长提示");
 |  |                 logger.info("就诊等待过长提示");
 | 
												
													
														
															|  |             } else if ("payRemind".equalsIgnoreCase(titelType)) {
 |  |             } else if ("payRemind".equalsIgnoreCase(titelType)) {
 | 
												
											
												
													
														
															|  | @ -5273,6 +5276,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                 }
 |  |                 }
 | 
												
													
														
															|  |                 newConfig.setKeyword2(outpatientDO.getHospitalName());
 |  |                 newConfig.setKeyword2(outpatientDO.getHospitalName());
 | 
												
													
														
															|  |                 newConfig.setKeyword3(outpatientDO.getDoctorName());
 |  |                 newConfig.setKeyword3(outpatientDO.getDoctorName());
 | 
												
													
														
															|  | 
 |  |                 String path = "returnVisit/record?outpatientId="+outpatientDO.getId();
 | 
												
													
														
															|  | 
 |  |                 newConfig.setPagepath(newConfig.getPagepath()+URLEncoder.encode(path));
 | 
												
													
														
															|  |                 //发起微信消息模板推送
 |  |                 //发起微信消息模板推送
 | 
												
													
														
															|  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 |  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 | 
												
													
														
															|  |                 logger.info("眼科微信消息模板推送 就诊支付提醒开始");
 |  |                 logger.info("眼科微信消息模板推送 就诊支付提醒开始");
 | 
												
											
												
													
														
															|  | @ -5305,6 +5310,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                 }
 |  |                 }
 | 
												
													
														
															|  |                 newConfig.setKeyword2(outpatientDO.getHospitalName());
 |  |                 newConfig.setKeyword2(outpatientDO.getHospitalName());
 | 
												
													
														
															|  |                 newConfig.setKeyword3(outpatientDO.getDoctorName());
 |  |                 newConfig.setKeyword3(outpatientDO.getDoctorName());
 | 
												
													
														
															|  | 
 |  |                 String path = "returnVisit/record?outpatientId="+outpatientDO.getId();
 | 
												
													
														
															|  | 
 |  |                 newConfig.setPagepath(newConfig.getPagepath() +URLEncoder.encode(path));
 | 
												
													
														
															|  |                 //发起微信消息模板推送
 |  |                 //发起微信消息模板推送
 | 
												
													
														
															|  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 |  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 | 
												
													
														
															|  |             } else if ("doctorPick".equalsIgnoreCase(titelType)) {
 |  |             } else if ("doctorPick".equalsIgnoreCase(titelType)) {
 | 
												
											
												
													
														
															|  | @ -5331,6 +5338,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                 newConfig.setRemark(config.getRemark().replace("key1",outpatientDO.getDoctorName()));
 |  |                 newConfig.setRemark(config.getRemark().replace("key1",outpatientDO.getDoctorName()));
 | 
												
													
														
															|  |                 newConfig.setKeyword2(outpatientDO.getHospitalName());
 |  |                 newConfig.setKeyword2(outpatientDO.getHospitalName());
 | 
												
													
														
															|  |                 newConfig.setKeyword3(outpatientDO.getDoctorName());
 |  |                 newConfig.setKeyword3(outpatientDO.getDoctorName());
 | 
												
													
														
															|  | 
 |  |                 String path = "returnVisit/record?outpatientId="+outpatientDO.getId();
 | 
												
													
														
															|  | 
 |  |                 newConfig.setPagepath(newConfig.getPagepath() +URLEncoder.encode(path));
 | 
												
													
														
															|  |                 //发起微信消息模板推送
 |  |                 //发起微信消息模板推送
 | 
												
													
														
															|  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 |  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 | 
												
													
														
															|  |             }else if ("patientCancel".equalsIgnoreCase(titelType)) {
 |  |             }else if ("patientCancel".equalsIgnoreCase(titelType)) {
 | 
												
											
												
													
														
															|  | @ -5350,6 +5359,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                 newConfig.setKeyword1( outpatientDO.getHospitalName());
 |  |                 newConfig.setKeyword1( outpatientDO.getHospitalName());
 | 
												
													
														
															|  |                 newConfig.setKeyword2(outpatientDO.getDoctorName());
 |  |                 newConfig.setKeyword2(outpatientDO.getDoctorName());
 | 
												
													
														
															|  |                 newConfig.setKeyword3(outpatientDO.getFee()==null?"0":outpatientDO.getFee().toString());
 |  |                 newConfig.setKeyword3(outpatientDO.getFee()==null?"0":outpatientDO.getFee().toString());
 | 
												
													
														
															|  | 
 |  |                 String path = "returnVisit/record?outpatientId="+outpatientDO.getId();
 | 
												
													
														
															|  | 
 |  |                 newConfig.setPagepath(newConfig.getPagepath() + URLEncoder.encode(path));
 | 
												
													
														
															|  |                 //发起微信消息模板推送
 |  |                 //发起微信消息模板推送
 | 
												
													
														
															|  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 |  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 | 
												
													
														
															|  |                 logger.info("眼科微信消息模板推送");
 |  |                 logger.info("眼科微信消息模板推送");
 | 
												
											
												
													
														
															|  | @ -5362,6 +5373,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                 newConfig.setKeyword1( "处方支付");
 |  |                 newConfig.setKeyword1( "处方支付");
 | 
												
													
														
															|  |                 newConfig.setKeyword2(outpatientDO.getHospitalName());
 |  |                 newConfig.setKeyword2(outpatientDO.getHospitalName());
 | 
												
													
														
															|  |                 newConfig.setKeyword3(outpatientDO.getDoctorName());
 |  |                 newConfig.setKeyword3(outpatientDO.getDoctorName());
 | 
												
													
														
															|  | 
 |  |                 String path = "returnVisit/preChat?type=16&outpatientId="+outpatientDO.getId();
 | 
												
													
														
															|  | 
 |  |                 newConfig.setPagepath(newConfig.getPagepath()+URLEncoder.encode(path) );
 | 
												
													
														
															|  |                 //发起微信消息模板推送
 |  |                 //发起微信消息模板推送
 | 
												
													
														
															|  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 |  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 | 
												
													
														
															|  |                 logger.info("眼科微信消息模板推送 处方支付提醒开始");
 |  |                 logger.info("眼科微信消息模板推送 处方支付提醒开始");
 | 
												
											
												
													
														
															|  | @ -5383,6 +5396,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                 newConfig.setKeyword3( outpatientDO.getDoctorName());
 |  |                 newConfig.setKeyword3( outpatientDO.getDoctorName());
 | 
												
													
														
															|  |                 newConfig.setKeyword4(DateUtil.dateToStrLong(outpatientDO.getRegisterDate()));
 |  |                 newConfig.setKeyword4(DateUtil.dateToStrLong(outpatientDO.getRegisterDate()));
 | 
												
													
														
															|  |                 newConfig.setKeyword5(generalDoctorWaitingNumber(doctorDO.getId(), wxId, outpatientId));
 |  |                 newConfig.setKeyword5(generalDoctorWaitingNumber(doctorDO.getId(), wxId, outpatientId));
 | 
												
													
														
															|  | 
 |  |                 String path = "returnVisit/record?outpatientId="+outpatientDO.getId();
 | 
												
													
														
															|  | 
 |  |                 newConfig.setPagepath(newConfig.getPagepath() +URLEncoder.encode(path));
 | 
												
													
														
															|  |                 //发起微信消息模板推送
 |  |                 //发起微信消息模板推送
 | 
												
													
														
															|  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 |  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 | 
												
													
														
															|  |                 logger.info("眼科微信消息模板推送 视频问诊预约提醒开始");
 |  |                 logger.info("眼科微信消息模板推送 视频问诊预约提醒开始");
 | 
												
											
												
													
														
															|  | @ -5394,6 +5409,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                 newConfig.setFirst(config.getFirst().replaceFirst("key1", consPatientDO.getName()));
 |  |                 newConfig.setFirst(config.getFirst().replaceFirst("key1", consPatientDO.getName()));
 | 
												
													
														
															|  |                 newConfig.setKeyword2(hospitalDO.getOrgName());
 |  |                 newConfig.setKeyword2(hospitalDO.getOrgName());
 | 
												
													
														
															|  |                 newConfig.setKeyword3(consDoctorDO.getName());
 |  |                 newConfig.setKeyword3(consDoctorDO.getName());
 | 
												
													
														
															|  | 
 |  |                 String path = "fuwupingjia?consultCode="+consultTeam.getConsult();
 | 
												
													
														
															|  | 
 |  |                 newConfig.setPagepath(newConfig.getPagepath()+URLEncoder.encode(path));
 | 
												
													
														
															|  |                 //发起微信消息模板推送
 |  |                 //发起微信消息模板推送
 | 
												
													
														
															|  |                 newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
 |  |                 newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
 | 
												
													
														
															|  |                 logger.info("极光消息推送 医生拒诊开始");
 |  |                 logger.info("极光消息推送 医生拒诊开始");
 | 
												
											
												
													
														
															|  | @ -5416,7 +5433,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                 }
 |  |                 }
 | 
												
													
														
															|  |                 newConfig.setKeyword1( outpatientDO.getHospitalName());
 |  |                 newConfig.setKeyword1( outpatientDO.getHospitalName());
 | 
												
													
														
															|  |                 newConfig.setKeyword2(outpatientDO.getDoctorName());
 |  |                 newConfig.setKeyword2(outpatientDO.getDoctorName());
 | 
												
													
														
															|  |                 newConfig.setKeyword3( doctorDO.getFee());
 |  | 
 | 
												
													
														
															|  | 
 |  |                 newConfig.setKeyword3(outpatientDO.getFee()==null?"0":outpatientDO.getFee().toString());
 | 
												
													
														
															|  | 
 |  |                 String path = "returnVisit/record?outpatientId="+outpatientDO.getId();
 | 
												
													
														
															|  | 
 |  |                 newConfig.setPagepath(newConfig.getPagepath() +URLEncoder.encode(path));
 | 
												
													
														
															|  |                 //发起微信消息模板推送
 |  |                 //发起微信消息模板推送
 | 
												
													
														
															|  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 |  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 | 
												
													
														
															|  |                 logger.info("眼科微信消息模板推送 系统拒诊开始");
 |  |                 logger.info("眼科微信消息模板推送 系统拒诊开始");
 | 
												
											
												
													
														
															|  | @ -5569,6 +5588,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |             newConfig.setKeyword3(mailNo);
 |  |             newConfig.setKeyword3(mailNo);
 | 
												
													
														
															|  |             newConfig.setKeyword4(remindMsg);
 |  |             newConfig.setKeyword4(remindMsg);
 | 
												
													
														
															|  |             newConfig.setRemark(config.getRemark());
 |  |             newConfig.setRemark(config.getRemark());
 | 
												
													
														
															|  | 
 |  |             String path = "returnVisit/logistics?outpatientId="+outpatientId+"&prescriptionCode="+prescriptionId;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |             newConfig.setPagepath(newConfig.getPagepath()+ URLEncoder.encode(path));
 | 
												
													
														
															|  |             newConfig.setUrl(newConfig.getUrl().replace("key1",outpatientId).replace("key2",prescriptionId));
 |  |             newConfig.setUrl(newConfig.getUrl().replace("key1",outpatientId).replace("key2",prescriptionId));
 | 
												
													
														
															|  |             logger.info("=======setUrl========" + newConfig.getUrl());
 |  |             logger.info("=======setUrl========" + newConfig.getUrl());
 | 
												
													
														
															|  |             WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
 |  |             WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
 | 
												
											
												
													
														
															|  | @ -12062,7 +12084,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     public Map saveNatAppointment(String chargeAmount,String inspectionName,String mediaCard,String patientId,String name,String cardNo,String cardType,String mobile,
 |  |     public Map saveNatAppointment(String chargeAmount,String inspectionName,String mediaCard,String patientId,String name,String cardNo,String cardType,String mobile,
 | 
												
													
														
															|  |                                    String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushFlag,String cardNoType,String consumer,
 |  |                                    String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushFlag,String cardNoType,String consumer,
 | 
												
													
														
															|  |                                   String checkPart,String chargeFlag,String chargeCode,String icdCode,String preNo) throws Exception {
 |  | 
 | 
												
													
														
															|  | 
 |  |                                   String checkPart,String chargeFlag,String chargeCode,String icdCode,String preNo,String idnoType) throws Exception {
 | 
												
													
														
															|  |         Map returnMap = new HashMap();
 |  |         Map returnMap = new HashMap();
 | 
												
													
														
															|  |         Integer winNo = 6;
 |  |         Integer winNo = 6;
 | 
												
													
														
															|  |         if (checkPart==null||checkPart==""){
 |  |         if (checkPart==null||checkPart==""){
 | 
												
											
												
													
														
															|  | @ -12108,6 +12130,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |             jsondate.put("targetChild",secondJobName);
 |  |             jsondate.put("targetChild",secondJobName);
 | 
												
													
														
															|  |             jsondate.put("target",firstJobName);
 |  |             jsondate.put("target",firstJobName);
 | 
												
													
														
															|  |             jsondate.put("quantity",1);
 |  |             jsondate.put("quantity",1);
 | 
												
													
														
															|  | 
 |  |             jsondate.put("idno_type",idnoType);
 | 
												
													
														
															|  |             Map<String,Object> map = findRandomDoctor();
 |  |             Map<String,Object> map = findRandomDoctor();
 | 
												
													
														
															|  |             net.sf.json.JSONObject rs = new JSONObject();
 |  |             net.sf.json.JSONObject rs = new JSONObject();
 | 
												
													
														
															|  |             if (map!=null){
 |  |             if (map!=null){
 | 
												
											
												
													
														
															|  | @ -12155,6 +12178,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                     baseNatAppointmentDO.setIcdCode(icdCode);
 |  |                     baseNatAppointmentDO.setIcdCode(icdCode);
 | 
												
													
														
															|  |                     baseNatAppointmentDO.setChargeCode(chargeCode);
 |  |                     baseNatAppointmentDO.setChargeCode(chargeCode);
 | 
												
													
														
															|  |                     baseNatAppointmentDO.setWinNo(String.valueOf(winNo));
 |  |                     baseNatAppointmentDO.setWinNo(String.valueOf(winNo));
 | 
												
													
														
															|  | 
 |  |                     baseNatAppointmentDO.setIdnoType(idnoType);
 | 
												
													
														
															|  |                     baseNatAppointmentDO.setDept("3150000");
 |  |                     baseNatAppointmentDO.setDept("3150000");
 | 
												
													
														
															|  |                     baseNatAppointmentDO.setDeptName("感染疾病科");
 |  |                     baseNatAppointmentDO.setDeptName("感染疾病科");
 | 
												
													
														
															|  |                     baseNatAppointmentDO.setAmpm(pm);
 |  |                     baseNatAppointmentDO.setAmpm(pm);
 | 
												
											
												
													
														
															|  | @ -12327,6 +12351,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |             baseNatAppointmentDO.setAmpm(pm);
 |  |             baseNatAppointmentDO.setAmpm(pm);
 | 
												
													
														
															|  |             baseNatAppointmentDO.setHospitalFlag(pushFlag);
 |  |             baseNatAppointmentDO.setHospitalFlag(pushFlag);
 | 
												
													
														
															|  |             baseNatAppointmentDO.setConsumer(consumer);
 |  |             baseNatAppointmentDO.setConsumer(consumer);
 | 
												
													
														
															|  | 
 |  |             baseNatAppointmentDO.setIdnoType(idnoType);
 | 
												
													
														
															|  |             BasePatientDO basePatientDO = basePatientDao.findById(consumer);
 |  |             BasePatientDO basePatientDO = basePatientDao.findById(consumer);
 | 
												
													
														
															|  |             baseNatAppointmentDO.setConsumerName(basePatientDO.getName());
 |  |             baseNatAppointmentDO.setConsumerName(basePatientDO.getName());
 | 
												
													
														
															|  |             baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
 |  |             baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
 | 
												
											
												
													
														
															|  | @ -12456,6 +12481,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                 baseNatAppointmentDO.setName(name);
 |  |                 baseNatAppointmentDO.setName(name);
 | 
												
													
														
															|  |                 baseNatAppointmentDO.setCardNo(cardNo.trim());
 |  |                 baseNatAppointmentDO.setCardNo(cardNo.trim());
 | 
												
													
														
															|  |                 baseNatAppointmentDO.setCardType(cardType);
 |  |                 baseNatAppointmentDO.setCardType(cardType);
 | 
												
													
														
															|  | 
 |  |                 baseNatAppointmentDO.setIdnoType(idnoType);
 | 
												
													
														
															|  |                 baseNatAppointmentDO.setAddress(address);
 |  |                 baseNatAppointmentDO.setAddress(address);
 | 
												
													
														
															|  |                 baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
 |  |                 baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
 | 
												
													
														
															|  |                 baseNatAppointmentDO.setOderNum(orderNum);
 |  |                 baseNatAppointmentDO.setOderNum(orderNum);
 |