|
@ -9,6 +9,7 @@ import com.yihu.wlyy.repository.patient.PatientDao;
|
|
|
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
import com.yihu.wlyy.task.PushMsgTask;
|
|
|
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
|
|
|
import com.ylzinfo.onepay.sdk.utils.StringUtil;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -28,12 +29,13 @@ public class PrescriptionNoticesService extends BaseService {
|
|
|
private DoctorDao doctorDao;
|
|
|
@Autowired
|
|
|
private PatientDao patientDao;
|
|
|
@Autowired
|
|
|
private WeiXinAccessTokenUtils weiXinAccessTokenUtils;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 发送续方相关模板消息
|
|
|
*
|
|
|
* @param accessToken
|
|
|
* @param openId 要发送对象居民的微信openID
|
|
|
* @param name 要发送对象居民姓名
|
|
|
* @param doctName 相关医生姓名(type=1审核医生、type=2 null、type=3配送健管师、type=4审核医生)
|
|
@ -42,7 +44,7 @@ public class PrescriptionNoticesService extends BaseService {
|
|
|
* @param status 续方通知状态 0不通过 1通过 2调整处方 其余状态均为0
|
|
|
* @param url 带参数的模板跳转链接
|
|
|
*/
|
|
|
public void sendMessages(String accessToken, String openId, String name, String doctName, String ordenTime, int type, int status, String url) throws Exception {
|
|
|
public void sendMessages( String openId, String name, String doctName, String ordenTime, int type, int status, String url) throws Exception {
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
JSONObject sendJson = new JSONObject();
|
|
@ -59,7 +61,7 @@ public class PrescriptionNoticesService extends BaseService {
|
|
|
sendJson.put("first", first);
|
|
|
sendJson.put("remark", remark);
|
|
|
sendJson.put("url", url);//带参数的模板跳转链接
|
|
|
pushMsgTask.putWxMsg(accessToken, 19, openId, name, sendJson);
|
|
|
pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 19, openId, name, sendJson);
|
|
|
break;
|
|
|
case 1:
|
|
|
first = name + "您好,你的续方申请医生已审核。";
|
|
@ -69,7 +71,7 @@ public class PrescriptionNoticesService extends BaseService {
|
|
|
sendJson.put("first", first);
|
|
|
sendJson.put("remark", remark);
|
|
|
sendJson.put("url", url);//带参数的模板跳转链接
|
|
|
pushMsgTask.putWxMsg(accessToken, 19, openId, name, sendJson);
|
|
|
pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 19, openId, name, sendJson);
|
|
|
break;
|
|
|
case 2:
|
|
|
first = name + "您好,您的续方申请医生已修改处方清单并审核。";
|
|
@ -79,7 +81,7 @@ public class PrescriptionNoticesService extends BaseService {
|
|
|
sendJson.put("first", first);
|
|
|
sendJson.put("remark", remark);
|
|
|
sendJson.put("url", url);//带参数的模板跳转链接
|
|
|
pushMsgTask.putWxMsg(accessToken, 19, openId, name, sendJson);
|
|
|
pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 19, openId, name, sendJson);
|
|
|
break;
|
|
|
}
|
|
|
} else if (type == 2) {
|
|
@ -90,7 +92,7 @@ public class PrescriptionNoticesService extends BaseService {
|
|
|
sendJson.put("first", first);
|
|
|
sendJson.put("remark", remark);
|
|
|
sendJson.put("url", url);//带参数的模板跳转链接
|
|
|
pushMsgTask.putWxMsg(accessToken, 11, openId, name, sendJson);
|
|
|
pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 11, openId, name, sendJson);
|
|
|
}
|
|
|
if (type == 3) {
|
|
|
first = name + "您好,您的续方订单配送员" + doctName + "已顺利取药,续方状态变更为配送中。";
|
|
@ -101,7 +103,7 @@ public class PrescriptionNoticesService extends BaseService {
|
|
|
sendJson.put("first", first);
|
|
|
sendJson.put("remark", remark);
|
|
|
sendJson.put("url", url);//带参数的模板跳转链接
|
|
|
pushMsgTask.putWxMsg(accessToken, 10, openId, name, sendJson);
|
|
|
pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 10, openId, name, sendJson);
|
|
|
}
|
|
|
if (type == 4) {
|
|
|
first = name + ",您好!您的续方订单已成功配送。";
|
|
@ -112,7 +114,7 @@ public class PrescriptionNoticesService extends BaseService {
|
|
|
sendJson.put("first", first);
|
|
|
sendJson.put("remark", remark);
|
|
|
sendJson.put("url", url);//带参数的模板跳转链接
|
|
|
pushMsgTask.putWxMsg(accessToken, 20, openId, name, sendJson);
|
|
|
pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 20, openId, name, sendJson);
|
|
|
}
|
|
|
|
|
|
|