|  | @ -51,6 +51,10 @@ public class PushMsgTask {
 | 
												
													
														
															|  |     private String template_doctor_change;
 |  |     private String template_doctor_change;
 | 
												
													
														
															|  |     @Value("${wechat.message.template_doctor_survey}")
 |  |     @Value("${wechat.message.template_doctor_survey}")
 | 
												
													
														
															|  |     private String template_doctor_survey;
 |  |     private String template_doctor_survey;
 | 
												
													
														
															|  | 
 |  |     @Value("${wechat.message.template_doctor_audit}")
 | 
												
													
														
															|  | 
 |  |     private String template_doctor_audit;//审核结果通知
 | 
												
													
														
															|  | 
 |  |     @Value("${wechat.message.template_doctor_service}")
 | 
												
													
														
															|  | 
 |  |     private String template_doctor_service;//服务结果通知
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     /**
 |  |     /**
 | 
												
													
														
															|  |      * 添加一条推送消息
 |  |      * 添加一条推送消息
 | 
												
											
												
													
														
															|  | @ -115,6 +119,7 @@ public class PushMsgTask {
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     @PostConstruct
 |  |     @PostConstruct
 | 
												
													
														
															|  |     private void run() {
 |  |     private void run() {
 | 
												
													
														
															|  |         new Thread(new ConsumerTask(httpUtil)).start();
 |  |         new Thread(new ConsumerTask(httpUtil)).start();
 | 
												
											
												
													
														
															|  | @ -187,8 +192,8 @@ public class PushMsgTask {
 | 
												
													
														
															|  |     /**
 |  |     /**
 | 
												
													
														
															|  |      * 发送微信模板消息
 |  |      * 发送微信模板消息
 | 
												
													
														
															|  |      *
 |  |      *
 | 
												
													
														
															|  |      * @param type 1:签约成功  2:签约失败  3:咨询回复通知  4:健康指导提醒  5:解约申请通知  6:预约挂号成功通知  7:预约取消通知 8 缴费提醒 9 健康教育  10 签约医生变更
 |  | 
 | 
												
													
														
															|  |      *             18 产检提醒和产检就诊提醒
 |  | 
 | 
												
													
														
															|  | 
 |  |      * @param type 1:签约成功  2:签约失败  3:咨询回复通知  4:健康指导提醒  5:解约申请通知  6:预约挂号成功通知  7:预约取消通知 8 缴费提醒 9 健康教育  10 签约医生变更(信息变更通知)
 | 
												
													
														
															|  | 
 |  |      *             18 产检提醒和产检就诊提醒 19:续方审核结果通知(0.不通过 1.通过 2。调整处方并通过) 20:服务结果通知 11.代办事项通知
 | 
												
													
														
															|  |      * @param json 当type==1||type==2时:{"first":"消息主题",”doctor":"医生code","doctorName":"医生名","date":"签约时间","content":"签约内容","remark":"消息备注"}
 |  |      * @param json 当type==1||type==2时:{"first":"消息主题",”doctor":"医生code","doctorName":"医生名","date":"签约时间","content":"签约内容","remark":"消息备注"}
 | 
												
													
														
															|  |      *             type==3时:{"first":"消息主题","consult":"医生咨询编号","consultcontent":"咨询内容","replycontent":"回复内容","doctorName":"医生名","remark":"消息备注"}
 |  |      *             type==3时:{"first":"消息主题","consult":"医生咨询编号","consultcontent":"咨询内容","replycontent":"回复内容","doctorName":"医生名","remark":"消息备注"}
 | 
												
													
														
															|  |      *             type==4时:{"first":"消息主题","date":"指导时间","orgName":"指导机构","doctorName":"指导医生名","content":"指导内容","remark":"消息备注"}
 |  |      *             type==4时:{"first":"消息主题","date":"指导时间","orgName":"指导机构","doctorName":"指导医生名","content":"指导内容","remark":"消息备注"}
 | 
												
											
												
													
														
															|  | @ -199,6 +204,8 @@ public class PushMsgTask {
 | 
												
													
														
															|  |      *             type==10时:{"first":"消息主题","name":"患教标题","doctorName":"医生名","date":"发送时间","remark":"消息备注"}
 |  |      *             type==10时:{"first":"消息主题","name":"患教标题","doctorName":"医生名","date":"发送时间","remark":"消息备注"}
 | 
												
													
														
															|  |      *             <p>
 |  |      *             <p>
 | 
												
													
														
															|  |      *             type==11时:{"first":"消息主题","name":"患教标题","doctorName":"医生名","date":"发送时间","remark":"消息备注"}
 |  |      *             type==11时:{"first":"消息主题","name":"患教标题","doctorName":"医生名","date":"发送时间","remark":"消息备注"}
 | 
												
													
														
															|  | 
 |  |      *             type==19时:{"first":"消息主题","keyword1":"审核结果","keyword2":"审核医生","remark":"消息备注"}
 | 
												
													
														
															|  | 
 |  |      *             type==20时:{"first":"消息主题","keyword1":"服务项目","keyword2":"操作医生","keyword3":"服务时间","remark":"消息备注"}
 | 
												
													
														
															|  |      * @return
 |  |      * @return
 | 
												
													
														
															|  |      */
 |  |      */
 | 
												
													
														
															|  | //    private boolean sendWeixinMessage(String access_token, int type, String openid, String name, JSONObject json) {
 |  | //    private boolean sendWeixinMessage(String access_token, int type, String openid, String name, JSONObject json) {
 | 
												
											
												
													
														
															|  | @ -279,9 +286,9 @@ public class PushMsgTask {
 | 
												
													
														
															|  |                 m.put("keyword3", keyword3);
 |  |                 m.put("keyword3", keyword3);
 | 
												
													
														
															|  |             } else if (type == 1 || type == 2) {
 |  |             } else if (type == 1 || type == 2) {
 | 
												
													
														
															|  |                 if (type == 1) {
 |  |                 if (type == 1) {
 | 
												
													
														
															|  |                     temp_id =template_sign_success;
 |  | 
 | 
												
													
														
															|  | 
 |  |                     temp_id = template_sign_success;
 | 
												
													
														
															|  |                 } else {
 |  |                 } else {
 | 
												
													
														
															|  |                     temp_id =template_sign_failed;
 |  | 
 | 
												
													
														
															|  | 
 |  |                     temp_id = template_sign_failed;
 | 
												
													
														
															|  |                 }
 |  |                 }
 | 
												
													
														
															|  |                 String isRenew = "0";
 |  |                 String isRenew = "0";
 | 
												
													
														
															|  |                 if (json.has("isRenew")) {
 |  |                 if (json.has("isRenew")) {
 | 
												
											
												
													
														
															|  | @ -367,7 +374,7 @@ public class PushMsgTask {
 | 
												
													
														
															|  |                 m.put("keyword4", keyword4);
 |  |                 m.put("keyword4", keyword4);
 | 
												
													
														
															|  |             } else if (type == 6) {
 |  |             } else if (type == 6) {
 | 
												
													
														
															|  |                 temp.setUrl(url + "wdyy/html/detail-appointment.html?openid=" + openid + "&orgCode=" + json.get("orgCode") + "&id=" + json.getString("id") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
 |  |                 temp.setUrl(url + "wdyy/html/detail-appointment.html?openid=" + openid + "&orgCode=" + json.get("orgCode") + "&id=" + json.getString("id") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
 | 
												
													
														
															|  |                 temp_id =template_appoint_success;
 |  | 
 | 
												
													
														
															|  | 
 |  |                 temp_id = template_appoint_success;
 | 
												
													
														
															|  |                 temp.setTemplate_id(temp_id);
 |  |                 temp.setTemplate_id(temp_id);
 | 
												
													
														
															|  |                 WechatTemplateData keyword1 = new WechatTemplateData();
 |  |                 WechatTemplateData keyword1 = new WechatTemplateData();
 | 
												
													
														
															|  |                 keyword1.setColor("#000000");
 |  |                 keyword1.setColor("#000000");
 | 
												
											
												
													
														
															|  | @ -387,7 +394,7 @@ public class PushMsgTask {
 | 
												
													
														
															|  |                 m.put("planstarttime", keyword4);
 |  |                 m.put("planstarttime", keyword4);
 | 
												
													
														
															|  |             } else if (type == 7) {
 |  |             } else if (type == 7) {
 | 
												
													
														
															|  |                 temp.setUrl(url + "wdyy/html/my-appointment.html?openid=" + openid + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
 |  |                 temp.setUrl(url + "wdyy/html/my-appointment.html?openid=" + openid + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
 | 
												
													
														
															|  |                 temp_id =template_appoint_failed;
 |  | 
 | 
												
													
														
															|  | 
 |  |                 temp_id = template_appoint_failed;
 | 
												
													
														
															|  |                 temp.setTemplate_id(temp_id);
 |  |                 temp.setTemplate_id(temp_id);
 | 
												
													
														
															|  |                 WechatTemplateData keyword1 = new WechatTemplateData();
 |  |                 WechatTemplateData keyword1 = new WechatTemplateData();
 | 
												
													
														
															|  |                 keyword1.setColor("#000000");
 |  |                 keyword1.setColor("#000000");
 | 
												
											
												
													
														
															|  | @ -450,7 +457,11 @@ public class PushMsgTask {
 | 
												
													
														
															|  |                 keyword5.setValue(json.getString("remark"));
 |  |                 keyword5.setValue(json.getString("remark"));
 | 
												
													
														
															|  |                 m.put("remark", keyword5);
 |  |                 m.put("remark", keyword5);
 | 
												
													
														
															|  |             } else if (type == 10) {
 |  |             } else if (type == 10) {
 | 
												
													
														
															|  |                 temp.setUrl(url + "qygl/html/signing-doctors.html?openid=" + openid + "&state=" + openid + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
 |  | 
 | 
												
													
														
															|  | 
 |  |                 if (json.has("url")) {
 | 
												
													
														
															|  | 
 |  |                     temp.setUrl(url + json.getString("url"));
 | 
												
													
														
															|  | 
 |  |                 }else {
 | 
												
													
														
															|  | 
 |  |                     temp.setUrl(url + "qygl/html/signing-doctors.html?openid=" + openid + "&state=" + openid + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
 | 
												
													
														
															|  | 
 |  |                 }
 | 
												
													
														
															|  |                 temp.setTemplate_id(template_doctor_change);
 |  |                 temp.setTemplate_id(template_doctor_change);
 | 
												
													
														
															|  |                 WechatTemplateData keyword1 = new WechatTemplateData();
 |  |                 WechatTemplateData keyword1 = new WechatTemplateData();
 | 
												
													
														
															|  |                 keyword1.setColor("#000000");
 |  |                 keyword1.setColor("#000000");
 | 
												
											
												
													
														
															|  | @ -467,10 +478,13 @@ public class PushMsgTask {
 | 
												
													
														
															|  |                 keyword3.setValue(json.getString("keyword3"));
 |  |                 keyword3.setValue(json.getString("keyword3"));
 | 
												
													
														
															|  |                 m.put("keyword3", keyword3);
 |  |                 m.put("keyword3", keyword3);
 | 
												
													
														
															|  |             } else if (type == 11) {
 |  |             } else if (type == 11) {
 | 
												
													
														
															|  |                 String xinurl = url + "survey/html/survey_info.html?openid=" + openid + "&state=" + openid + "&survey_id=" + json.getString("survey_id") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented");
 |  | 
 | 
												
													
														
															|  | 
 |  |                 if (json.has("url")) {
 | 
												
													
														
															|  | 
 |  |                     temp.setUrl(url + json.getString("url"));
 | 
												
													
														
															|  | 
 |  |                 } else {
 | 
												
													
														
															|  | 
 |  |                     String xinurl = url + "survey/html/survey_info.html?openid=" + openid + "&state=" + openid + "&survey_id=" + json.getString("survey_id") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented");
 | 
												
													
														
															|  | //                temp.setUrl(url + "survey/html/survey_info.html?openid=" + openid + "&state=" + openid + "&survey_id=" + json.getString("survey_id") + "&toUser=" + json.getString("toUser") + "&toName=" + name);
 |  | //                temp.setUrl(url + "survey/html/survey_info.html?openid=" + openid + "&state=" + openid + "&survey_id=" + json.getString("survey_id") + "&toUser=" + json.getString("toUser") + "&toName=" + name);
 | 
												
													
														
															|  |                 temp.setUrl(xinurl);
 |  | 
 | 
												
													
														
															|  | //                temp.setTemplate_id("fgYiMntj1amEkE8_GLUPmAIyssUAroJrNSHqvydt-PQ");
 |  | 
 | 
												
													
														
															|  | 
 |  |                     temp.setUrl(xinurl);
 | 
												
													
														
															|  | 
 |  |                 }
 | 
												
													
														
															|  |                 temp.setTemplate_id(template_doctor_survey);
 |  |                 temp.setTemplate_id(template_doctor_survey);
 | 
												
													
														
															|  |                 WechatTemplateData keyword1 = new WechatTemplateData();
 |  |                 WechatTemplateData keyword1 = new WechatTemplateData();
 | 
												
													
														
															|  |                 keyword1.setColor("#000000");
 |  |                 keyword1.setColor("#000000");
 | 
												
											
												
													
														
															|  | @ -482,8 +496,6 @@ public class PushMsgTask {
 | 
												
													
														
															|  |                 keyword2.setValue(json.getString("keyword2"));
 |  |                 keyword2.setValue(json.getString("keyword2"));
 | 
												
													
														
															|  |                 m.put("keyword2", keyword2);
 |  |                 m.put("keyword2", keyword2);
 | 
												
													
														
															|  |                 logger.info("type=====>openId " + openid);
 |  |                 logger.info("type=====>openId " + openid);
 | 
												
													
														
															|  |                 System.out.println("url=======type =11 =====================>" + xinurl);
 |  | 
 | 
												
													
														
															|  |                 logger.error("url=======type =11 =====================>" + xinurl);
 |  | 
 | 
												
													
														
															|  |             } else if (type == 12) {
 |  |             } else if (type == 12) {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |                 temp.setUrl(url + "jtgx/html/application-msg-list.html?openid=" + openid + "&member=" + json.getString("member") + "&toUser=" + json.getString("member") + "&toName=" + name);
 |  |                 temp.setUrl(url + "jtgx/html/application-msg-list.html?openid=" + openid + "&member=" + json.getString("member") + "&toUser=" + json.getString("member") + "&toName=" + name);
 | 
												
											
												
													
														
															|  | @ -584,6 +596,32 @@ public class PushMsgTask {
 | 
												
													
														
															|  |                 keyword2.setColor("#000000");
 |  |                 keyword2.setColor("#000000");
 | 
												
													
														
															|  |                 keyword2.setValue(json.getString("keyword2"));
 |  |                 keyword2.setValue(json.getString("keyword2"));
 | 
												
													
														
															|  |                 m.put("keyword2", keyword2);
 |  |                 m.put("keyword2", keyword2);
 | 
												
													
														
															|  | 
 |  |             } else if (type == 19) {
 | 
												
													
														
															|  | 
 |  |                 temp.setUrl(url + json.getString("url"));
 | 
												
													
														
															|  | 
 |  |                 temp.setTemplate_id(template_doctor_audit);
 | 
												
													
														
															|  | 
 |  |                 WechatTemplateData keyword1 = new WechatTemplateData();
 | 
												
													
														
															|  | 
 |  |                 keyword1.setColor("#000000");
 | 
												
													
														
															|  | 
 |  |                 keyword1.setValue(json.getString("keyword1"));
 | 
												
													
														
															|  | 
 |  |                 m.put("keyword1", keyword1);
 | 
												
													
														
															|  | 
 |  |                 WechatTemplateData keyword2 = new WechatTemplateData();
 | 
												
													
														
															|  | 
 |  |                 keyword2.setColor("#000000");
 | 
												
													
														
															|  | 
 |  |                 keyword2.setValue(json.getString("keyword2"));
 | 
												
													
														
															|  | 
 |  |                 m.put("keyword2", keyword2);
 | 
												
													
														
															|  | 
 |  |             } else if (type == 20) {
 | 
												
													
														
															|  | 
 |  |                 temp.setUrl(url + json.getString("url"));
 | 
												
													
														
															|  | 
 |  |                 temp.setTemplate_id(template_doctor_service);
 | 
												
													
														
															|  | 
 |  |                 WechatTemplateData keyword1 = new WechatTemplateData();
 | 
												
													
														
															|  | 
 |  |                 keyword1.setColor("#000000");
 | 
												
													
														
															|  | 
 |  |                 keyword1.setValue(json.getString("keyword1"));
 | 
												
													
														
															|  | 
 |  |                 m.put("keyword1", keyword1);
 | 
												
													
														
															|  | 
 |  |                 WechatTemplateData keyword2 = new WechatTemplateData();
 | 
												
													
														
															|  | 
 |  |                 keyword2.setColor("#000000");
 | 
												
													
														
															|  | 
 |  |                 keyword2.setValue(json.getString("keyword2"));
 | 
												
													
														
															|  | 
 |  |                 m.put("keyword2", keyword2);
 | 
												
													
														
															|  | 
 |  |                 WechatTemplateData keyword3 = new WechatTemplateData();
 | 
												
													
														
															|  | 
 |  |                 keyword3.setColor("#000000");
 | 
												
													
														
															|  | 
 |  |                 keyword3.setValue(json.getString("keyword3"));
 | 
												
													
														
															|  | 
 |  |                 m.put("keyword3", keyword3);
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |             temp.setData(m);
 |  |             temp.setData(m);
 |