|
@ -1,6 +1,7 @@
|
|
|
package com.yihu.wlyy.web.third.template;
|
|
|
|
|
|
import com.yihu.wlyy.aop.ObserverRequired;
|
|
|
import com.yihu.wlyy.task.PushMsgTask;
|
|
|
import com.yihu.wlyy.web.BaseController;
|
|
|
import com.yihu.wlyy.wechat.util.WeiXinTempMsgSendUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
@ -24,6 +25,8 @@ public class ThirdTemplateController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private WeiXinTempMsgSendUtils tempMsgSendUtils;
|
|
|
@Autowired
|
|
|
private PushMsgTask pushMsgTask;
|
|
|
@Value("${wechat.message.template_doctor_survey}")
|
|
|
private String template_doctor_survey;
|
|
|
|
|
@ -60,10 +63,35 @@ public class ThirdTemplateController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 医生端发送系统消息
|
|
|
* @param receiver 接受者
|
|
|
* @param title 标题
|
|
|
* @param content 内容
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/sendMessage", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "医生端发送系统消息")
|
|
|
@ResponseBody
|
|
|
@ObserverRequired
|
|
|
public String saveFeedback(
|
|
|
@RequestParam String receiver,
|
|
|
@RequestParam String title,
|
|
|
@RequestParam String type,
|
|
|
@RequestParam String content) {
|
|
|
try {
|
|
|
pushMsgTask.put(receiver, type, title, content, "");
|
|
|
return write(200, "发送成功!");
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return invalidUserException(e, -1, "发送失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据第三方type 匹配对应模板ID
|
|
|
*
|
|
|
* @param type 1.代办事项
|
|
|
* @param type 1.代办事项 2.处理结果通知(模板未定)
|
|
|
* @return
|
|
|
*/
|
|
|
private String getTemplateId(String type) throws Exception {
|
|
@ -72,6 +100,9 @@ public class ThirdTemplateController extends BaseController {
|
|
|
case "1":
|
|
|
templateId = template_doctor_survey;
|
|
|
break;
|
|
|
case "2":
|
|
|
templateId = "";
|
|
|
break;
|
|
|
default:
|
|
|
templateId = template_doctor_survey;
|
|
|
break;
|