|
@ -1,7 +1,9 @@
|
|
|
package com.yihu.wlyy.service.app.prescription;
|
|
|
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
import com.yihu.wlyy.entity.wechat.WechatTemplateConfig;
|
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
|
import com.yihu.wlyy.repository.wechat.WechatTemplateConfigDao;
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
import com.yihu.wlyy.task.PushMsgTask;
|
|
|
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
|
|
@ -29,6 +31,8 @@ public class PrescriptionNoticesService extends BaseService {
|
|
|
private WeiXinAccessTokenUtils weiXinAccessTokenUtils;
|
|
|
@Autowired
|
|
|
private WeiXinOpenIdUtils weiXinOpenIdUtils;
|
|
|
@Autowired
|
|
|
private WechatTemplateConfigDao templateConfigDao;
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(PrescriptionNoticesService.class);
|
|
|
|
|
|
|
|
@ -64,9 +68,16 @@ public class PrescriptionNoticesService extends BaseService {
|
|
|
if (type == 1) {
|
|
|
switch (status) {
|
|
|
case 0:
|
|
|
first = name + "您好,你的续方申请医生已审核。";
|
|
|
WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_doctor_audit","xfbtg");
|
|
|
first = templateConfig.getFirst();
|
|
|
first = first.replace("key1",(name==null?"":name));
|
|
|
remark = templateConfig.getRemark();
|
|
|
String keyword1 = templateConfig.getKeyword1();
|
|
|
|
|
|
/*first = name + "您好,你的续方申请医生已审核。";
|
|
|
remark = "您可点击消息查看详情,修改续方信息后重新提交。";
|
|
|
sendJson.put("keyword1", "审核不通过");
|
|
|
sendJson.put("keyword1", "审核不通过");*/
|
|
|
sendJson.put("keyword1", keyword1);
|
|
|
sendJson.put("keyword2", doctName);
|
|
|
sendJson.put("first", first);
|
|
|
sendJson.put("remark", remark);
|
|
@ -90,9 +101,16 @@ public class PrescriptionNoticesService extends BaseService {
|
|
|
}
|
|
|
break;
|
|
|
case 1:
|
|
|
first = name + "您好,你的续方申请医生已审核。";
|
|
|
templateConfig = templateConfigDao.findByScene("template_doctor_audit","xftg");
|
|
|
first = templateConfig.getFirst();
|
|
|
first = first.replace("key1",(name==null?"":name));
|
|
|
remark = templateConfig.getRemark();
|
|
|
String keyword = templateConfig.getKeyword1();
|
|
|
|
|
|
/*first = name + "您好,你的续方申请医生已审核。";
|
|
|
remark = "您可点击消息查看详情并完成支付。";
|
|
|
sendJson.put("keyword1", "审核通过");
|
|
|
sendJson.put("keyword1", "审核通过");*/
|
|
|
sendJson.put("keyword1", keyword);
|
|
|
sendJson.put("keyword2", doctName);
|
|
|
sendJson.put("first", first);
|
|
|
sendJson.put("remark", remark);
|
|
@ -116,9 +134,16 @@ public class PrescriptionNoticesService extends BaseService {
|
|
|
}
|
|
|
break;
|
|
|
case 2:
|
|
|
first = name + "您好,您的续方申请医生已修改处方清单并审核。";
|
|
|
templateConfig = templateConfigDao.findByScene("template_doctor_audit","tztg");
|
|
|
first = templateConfig.getFirst();
|
|
|
first = first.replace("key1",(name==null?"":name));
|
|
|
remark = templateConfig.getRemark();
|
|
|
String keyword2 = templateConfig.getKeyword1();
|
|
|
|
|
|
/*first = name + "您好,您的续方申请医生已修改处方清单并审核。";
|
|
|
remark = "您可点击消息查看详情并完成支付。";
|
|
|
sendJson.put("keyword1", "审核通过");
|
|
|
sendJson.put("keyword1", "审核通过");*/
|
|
|
sendJson.put("keyword1", keyword2);
|
|
|
sendJson.put("keyword2", doctName);
|
|
|
sendJson.put("first", first);
|
|
|
sendJson.put("remark", remark);
|
|
@ -143,9 +168,15 @@ public class PrescriptionNoticesService extends BaseService {
|
|
|
break;
|
|
|
}
|
|
|
} else if (type == 2) {
|
|
|
first = name + "您好,您的续方订单已完成配药,请尽快致社区医院取药。";
|
|
|
WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_doctor_survey","xfqy");
|
|
|
first = templateConfig.getFirst();
|
|
|
first = first.replace("key1",(name==null?"":name));
|
|
|
String keyword1 = templateConfig.getKeyword1();
|
|
|
|
|
|
// first = name + "您好,您的续方订单已完成配药,请尽快致社区医院取药。";
|
|
|
remark = "";
|
|
|
sendJson.put("keyword1", "续方订单取药");
|
|
|
sendJson.put("keyword1", keyword1);
|
|
|
// sendJson.put("keyword1", "续方订单取药");
|
|
|
sendJson.put("keyword2", dateFormat.format(new Date()));
|
|
|
sendJson.put("first", first);
|
|
|
sendJson.put("remark", remark);
|
|
@ -169,11 +200,17 @@ public class PrescriptionNoticesService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
if (type == 3) {
|
|
|
first = name + "您好,您的续方订单配送员" + doctName + "已顺利取药,续方状态变更为配送中。";
|
|
|
remark = "您可点击消息查看详情。";
|
|
|
WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_doctor_change","xfqy");
|
|
|
first = templateConfig.getFirst();
|
|
|
remark = templateConfig.getRemark();
|
|
|
first = first.replace("key1",(name==null?"":name)).replace("key2",(doctName==null?"":doctName));
|
|
|
String keyword3 = templateConfig.getKeyword3();
|
|
|
|
|
|
/* first = name + "您好,您的续方订单配送员" + doctName + "已顺利取药,续方状态变更为配送中。";
|
|
|
remark = "您可点击消息查看详情。";*/
|
|
|
sendJson.put("keyword1", doctName);
|
|
|
sendJson.put("keyword2", dateFormat.format(new Date()));
|
|
|
sendJson.put("keyword3", "续方状态");
|
|
|
sendJson.put("keyword3", keyword3);
|
|
|
sendJson.put("first", first);
|
|
|
sendJson.put("remark", remark);
|
|
|
sendJson.put("url", url);//带参数的模板跳转链接
|
|
@ -196,9 +233,16 @@ public class PrescriptionNoticesService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
if (type == 4) {
|
|
|
first = name + ",您好!您的续方订单已成功配送。";
|
|
|
remark = "感谢您的使用。";
|
|
|
sendJson.put("keyword1", "续方申请");
|
|
|
WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_doctor_service","xfwc");
|
|
|
first = templateConfig.getFirst();
|
|
|
remark = templateConfig.getRemark();
|
|
|
first = first.replace("key1",(name==null?"":name));
|
|
|
String keyword1 = templateConfig.getKeyword1();
|
|
|
|
|
|
// first = name + ",您好!您的续方订单已成功配送。";
|
|
|
// remark = "感谢您的使用。";
|
|
|
// sendJson.put("keyword1", "续方申请");
|
|
|
sendJson.put("keyword1", keyword1);
|
|
|
sendJson.put("keyword2", doctName);//审核医生姓名 开处方的医生(团队长?)
|
|
|
sendJson.put("keyword3", ordenTime);//订单完成时间
|
|
|
sendJson.put("first", first);
|