|  | @ -148,6 +148,7 @@ import java.lang.Boolean;
 | 
	
		
			
				|  |  | import java.lang.management.ManagementFactory;
 | 
	
		
			
				|  |  | import java.math.BigDecimal;
 | 
	
		
			
				|  |  | import java.net.URL;
 | 
	
		
			
				|  |  | import java.net.URLEncoder;
 | 
	
		
			
				|  |  | import java.text.DecimalFormat;
 | 
	
		
			
				|  |  | import java.text.ParseException;
 | 
	
		
			
				|  |  | import java.text.SimpleDateFormat;
 | 
	
	
		
			
				|  | @ -3862,7 +3863,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                     statuss += " ";
 | 
	
		
			
				|  |  |                 }*/
 | 
	
		
			
				|  |  |                 String odry = "";
 | 
	
		
			
				|  |  |                 String orderCategory ="";
 | 
	
		
			
				|  |  |                 String orderCategory = "";
 | 
	
		
			
				|  |  |                 String odte = "";
 | 
	
		
			
				|  |  |                 String status ="";
 | 
	
		
			
				|  |  |                 String pay = "";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 if (m.get("orderCategory")==null){
 | 
	
		
			
				|  |  |                     odry = null;
 | 
	
		
			
				|  |  |                 }else {
 | 
	
	
		
			
				|  | @ -3870,27 +3875,31 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                     if (orderCategory.equals("1")) {
 | 
	
		
			
				|  |  |                         odry += "专家咨询";
 | 
	
		
			
				|  |  |                     }else if (orderCategory.equals("2")) {
 | 
	
		
			
				|  |  |                         odry += "图文诊室";
 | 
	
		
			
				|  |  |                         odry += "复诊";
 | 
	
		
			
				|  |  |                     }else if (orderCategory.equals("3")) {
 | 
	
		
			
				|  |  |                         odry += "视频诊室";
 | 
	
		
			
				|  |  |                     }else if (orderCategory.equals("4")) {
 | 
	
		
			
				|  |  |                         odry += "处方";
 | 
	
		
			
				|  |  |                         odte += "处方";
 | 
	
		
			
				|  |  |                     }else if (orderCategory.equals("5")) {
 | 
	
		
			
				|  |  |                         if (m.get("orderType") != null) {
 | 
	
		
			
				|  |  |                             String ort = m.get("orderType").toString();
 | 
	
		
			
				|  |  |                             if (ort.equalsIgnoreCase("10")) {
 | 
	
		
			
				|  |  |                                 odry += "就诊卡号充值";
 | 
	
		
			
				|  |  |                             }else if(ort.equalsIgnoreCase("11")) {
 | 
	
		
			
				|  |  |                                 odry += "门诊卡号充值";
 | 
	
		
			
				|  |  |                             }
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                         odry += "就诊卡充值";
 | 
	
		
			
				|  |  |                         odte += "就诊卡充值";
 | 
	
		
			
				|  |  |                     }else {
 | 
	
		
			
				|  |  |                         odry += " ";
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 String status ="";
 | 
	
		
			
				|  |  |                 if(m.get("orderType") == null) {
 | 
	
		
			
				|  |  |                     odte = null;
 | 
	
		
			
				|  |  |                 }else{
 | 
	
		
			
				|  |  |                     String orderType =  m.get("orderType").toString();
 | 
	
		
			
				|  |  |                     if (orderType.equalsIgnoreCase("1")) {
 | 
	
		
			
				|  |  |                         odte += "图文";
 | 
	
		
			
				|  |  |                     }else if (orderType.equalsIgnoreCase("3")) {
 | 
	
		
			
				|  |  |                         odte += "视频";
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 if (m.get("status") == null) {
 | 
	
		
			
				|  |  |                     status = null;
 | 
	
		
			
				|  |  |                 }else {
 | 
	
	
		
			
				|  | @ -3914,18 +3923,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 String odte = "";
 | 
	
		
			
				|  |  |                 if(m.get("orderType") == null) {
 | 
	
		
			
				|  |  |                     odte = null;
 | 
	
		
			
				|  |  |                 }else{
 | 
	
		
			
				|  |  |                     String orderType =  m.get("orderType").toString();
 | 
	
		
			
				|  |  |                     if (orderType.equalsIgnoreCase("1")) {
 | 
	
		
			
				|  |  |                         odte += "图文咨询";
 | 
	
		
			
				|  |  |                     }else if (orderType.equalsIgnoreCase("3")) {
 | 
	
		
			
				|  |  |                         odte += "视频咨询";
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 String pay = "";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 if (m.get("payPrice") == null) {
 | 
	
		
			
				|  |  |                     pay = null;
 | 
	
		
			
				|  |  |                 }else{
 | 
	
	
		
			
				|  | @ -3939,7 +3938,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                     time = m.get("payTime").toString();
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 addCell(ws, i, 0, m.get("id")!=null?m.get("id").toString():n);
 | 
	
		
			
				|  |  |                 addCell(ws, i, 1, time!=null?time:n);
 | 
	
		
			
				|  |  |                 addCell(ws, i, 2, (String) m.get("orderNo")!=null?(String) m.get("orderNo"):n);
 | 
	
	
		
			
				|  | @ -5239,6 +5237,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 newConfig.setKeyword1( outpatientDO.getHospitalName());
 | 
	
		
			
				|  |  |                 newConfig.setKeyword2(outpatientDO.getDoctorName());
 | 
	
		
			
				|  |  |                 newConfig.setKeyword3( doctorDO.getFee());
 | 
	
		
			
				|  |  |                 newConfig.setPagepath(newConfig.getPagepath() + "" + outpatientDO.getId());
 | 
	
		
			
				|  |  |                 //发起微信消息模板推送
 | 
	
		
			
				|  |  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 | 
	
		
			
				|  |  |                 logger.info("眼科微信消息模板推送 医生拒诊开始");
 | 
	
	
		
			
				|  | @ -5251,6 +5250,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 scene="jzddgcts";
 | 
	
		
			
				|  |  |                 WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_outpatient_timeout_remind", scene, 1);
 | 
	
		
			
				|  |  |                 BeanUtils.copyProperties(config, newConfig);
 | 
	
		
			
				|  |  |                 newConfig.setPagepath(newConfig.getPagepath() + "" + outpatientDO.getId());
 | 
	
		
			
				|  |  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 | 
	
		
			
				|  |  |                 logger.info("就诊等待过长提示");
 | 
	
		
			
				|  |  |             } else if ("payRemind".equalsIgnoreCase(titelType)) {
 | 
	
	
		
			
				|  | @ -5276,6 +5276,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 newConfig.setKeyword2(outpatientDO.getHospitalName());
 | 
	
		
			
				|  |  |                 newConfig.setKeyword3(outpatientDO.getDoctorName());
 | 
	
		
			
				|  |  |                 String path = "returnVisit/record?outpatientId="+outpatientDO.getId();
 | 
	
		
			
				|  |  |                 newConfig.setPagepath(newConfig.getPagepath()+URLEncoder.encode(path));
 | 
	
		
			
				|  |  |                 //发起微信消息模板推送
 | 
	
		
			
				|  |  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 | 
	
		
			
				|  |  |                 logger.info("眼科微信消息模板推送 就诊支付提醒开始");
 | 
	
	
		
			
				|  | @ -5308,6 +5310,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 newConfig.setKeyword2(outpatientDO.getHospitalName());
 | 
	
		
			
				|  |  |                 newConfig.setKeyword3(outpatientDO.getDoctorName());
 | 
	
		
			
				|  |  |                 String path = "returnVisit/record?outpatientId="+outpatientDO.getId();
 | 
	
		
			
				|  |  |                 newConfig.setPagepath(newConfig.getPagepath() +URLEncoder.encode(path));
 | 
	
		
			
				|  |  |                 //发起微信消息模板推送
 | 
	
		
			
				|  |  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 | 
	
		
			
				|  |  |             } else if ("doctorPick".equalsIgnoreCase(titelType)) {
 | 
	
	
		
			
				|  | @ -5334,6 +5338,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 newConfig.setRemark(config.getRemark().replace("key1",outpatientDO.getDoctorName()));
 | 
	
		
			
				|  |  |                 newConfig.setKeyword2(outpatientDO.getHospitalName());
 | 
	
		
			
				|  |  |                 newConfig.setKeyword3(outpatientDO.getDoctorName());
 | 
	
		
			
				|  |  |                 String path = "returnVisit/record?outpatientId="+outpatientDO.getId();
 | 
	
		
			
				|  |  |                 newConfig.setPagepath(newConfig.getPagepath() +URLEncoder.encode(path));
 | 
	
		
			
				|  |  |                 //发起微信消息模板推送
 | 
	
		
			
				|  |  |                 newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
 | 
	
		
			
				|  |  |             }else if ("patientCancel".equalsIgnoreCase(titelType)) {
 | 
	
	
		
			
				|  | @ -5353,6 +5359,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 newConfig.setKeyword1( outpatientDO.getHospitalName());
 | 
	
		
			
				|  |  |                 newConfig.setKeyword2(outpatientDO.getDoctorName());
 | 
	
		
			
				|  |  |                 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());
 | 
	
		
			
				|  |  |                 logger.info("眼科微信消息模板推送");
 | 
	
	
		
			
				|  | @ -5365,6 +5373,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 newConfig.setKeyword1( "处方支付");
 | 
	
		
			
				|  |  |                 newConfig.setKeyword2(outpatientDO.getHospitalName());
 | 
	
		
			
				|  |  |                 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());
 | 
	
		
			
				|  |  |                 logger.info("眼科微信消息模板推送 处方支付提醒开始");
 | 
	
	
		
			
				|  | @ -5386,6 +5396,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 newConfig.setKeyword3( outpatientDO.getDoctorName());
 | 
	
		
			
				|  |  |                 newConfig.setKeyword4(DateUtil.dateToStrLong(outpatientDO.getRegisterDate()));
 | 
	
		
			
				|  |  |                 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());
 | 
	
		
			
				|  |  |                 logger.info("眼科微信消息模板推送 视频问诊预约提醒开始");
 | 
	
	
		
			
				|  | @ -5397,6 +5409,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 newConfig.setFirst(config.getFirst().replaceFirst("key1", consPatientDO.getName()));
 | 
	
		
			
				|  |  |                 newConfig.setKeyword2(hospitalDO.getOrgName());
 | 
	
		
			
				|  |  |                 newConfig.setKeyword3(consDoctorDO.getName());
 | 
	
		
			
				|  |  |                 String path = "fuwupingjia?consultCode="+consultTeam.getConsult();
 | 
	
		
			
				|  |  |                 newConfig.setPagepath(newConfig.getPagepath()+URLEncoder.encode(path));
 | 
	
		
			
				|  |  |                 //发起微信消息模板推送
 | 
	
		
			
				|  |  |                 newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
 | 
	
		
			
				|  |  |                 logger.info("极光消息推送 医生拒诊开始");
 | 
	
	
		
			
				|  | @ -5419,7 +5433,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 newConfig.setKeyword1( outpatientDO.getHospitalName());
 | 
	
		
			
				|  |  |                 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());
 | 
	
		
			
				|  |  |                 logger.info("眼科微信消息模板推送 系统拒诊开始");
 | 
	
	
		
			
				|  | @ -5572,6 +5588,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |             newConfig.setKeyword3(mailNo);
 | 
	
		
			
				|  |  |             newConfig.setKeyword4(remindMsg);
 | 
	
		
			
				|  |  |             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));
 | 
	
		
			
				|  |  |             logger.info("=======setUrl========" + newConfig.getUrl());
 | 
	
		
			
				|  |  |             WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
 | 
	
	
		
			
				|  | @ -12065,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,
 | 
	
		
			
				|  |  |                                    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();
 | 
	
		
			
				|  |  |         Integer winNo = 6;
 | 
	
		
			
				|  |  |         if (checkPart==null||checkPart==""){
 | 
	
	
		
			
				|  | @ -12111,6 +12130,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |             jsondate.put("targetChild",secondJobName);
 | 
	
		
			
				|  |  |             jsondate.put("target",firstJobName);
 | 
	
		
			
				|  |  |             jsondate.put("quantity",1);
 | 
	
		
			
				|  |  |             jsondate.put("idno_type",idnoType);
 | 
	
		
			
				|  |  |             Map<String,Object> map = findRandomDoctor();
 | 
	
		
			
				|  |  |             net.sf.json.JSONObject rs = new JSONObject();
 | 
	
		
			
				|  |  |             if (map!=null){
 | 
	
	
		
			
				|  | @ -12158,6 +12178,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                     baseNatAppointmentDO.setIcdCode(icdCode);
 | 
	
		
			
				|  |  |                     baseNatAppointmentDO.setChargeCode(chargeCode);
 | 
	
		
			
				|  |  |                     baseNatAppointmentDO.setWinNo(String.valueOf(winNo));
 | 
	
		
			
				|  |  |                     baseNatAppointmentDO.setIdnoType(idnoType);
 | 
	
		
			
				|  |  |                     baseNatAppointmentDO.setDept("3150000");
 | 
	
		
			
				|  |  |                     baseNatAppointmentDO.setDeptName("感染疾病科");
 | 
	
		
			
				|  |  |                     baseNatAppointmentDO.setAmpm(pm);
 | 
	
	
		
			
				|  | @ -12330,6 +12351,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |             baseNatAppointmentDO.setAmpm(pm);
 | 
	
		
			
				|  |  |             baseNatAppointmentDO.setHospitalFlag(pushFlag);
 | 
	
		
			
				|  |  |             baseNatAppointmentDO.setConsumer(consumer);
 | 
	
		
			
				|  |  |             baseNatAppointmentDO.setIdnoType(idnoType);
 | 
	
		
			
				|  |  |             BasePatientDO basePatientDO = basePatientDao.findById(consumer);
 | 
	
		
			
				|  |  |             baseNatAppointmentDO.setConsumerName(basePatientDO.getName());
 | 
	
		
			
				|  |  |             baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
 | 
	
	
		
			
				|  | @ -12459,6 +12481,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 baseNatAppointmentDO.setName(name);
 | 
	
		
			
				|  |  |                 baseNatAppointmentDO.setCardNo(cardNo.trim());
 | 
	
		
			
				|  |  |                 baseNatAppointmentDO.setCardType(cardType);
 | 
	
		
			
				|  |  |                 baseNatAppointmentDO.setIdnoType(idnoType);
 | 
	
		
			
				|  |  |                 baseNatAppointmentDO.setAddress(address);
 | 
	
		
			
				|  |  |                 baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
 | 
	
		
			
				|  |  |                 baseNatAppointmentDO.setOderNum(orderNum);
 |