|
@ -87,12 +87,14 @@ public class GcEduArticleController extends WeixinBaseController {
|
|
|
@ApiParam(name = "labelCode", value = "所选群组,多个用逗号分隔", required = true) @RequestParam(value = "labelCode", required = false, defaultValue = "") String labelCode,
|
|
|
@ApiParam(name = "labelType", value = "标签类型 1 服务类型 2 健康情况 3 疾病类型 4 自定义标签", required = true) @RequestParam(value = "labelType", required = false, defaultValue = "") String labelType,
|
|
|
@ApiParam(name = "receiveCodes", value = "接收人code,多个逗号分割", required = false) @RequestParam(value = "receiveCodes", required = false, defaultValue = "") String receiveCodes,
|
|
|
@ApiParam(name = "unReceiveCodes", value = "不接收人code,多个逗号分割(如果同时存在receiveCodes和unReceiveCodes,也不会发送)", required = false) @RequestParam(value = "unReceiveCodes", required = false, defaultValue = "") String unReceiveCodes,
|
|
|
@ApiParam(name = "articleIds", value = "文章ID,多个逗号分割", required = true) @RequestParam(value = "articleIds", required = true) String articleIds,
|
|
|
@ApiParam(name = "articlePics", value = "文章封面,多个逗号分割", required = true) @RequestParam(value = "articlePics", required = true) String articlePics,
|
|
|
@ApiParam(name = "articleTitles", value = "文章标题,多个逗号分割", required = true) @RequestParam(value = "articleTitles", required = true) String articleTitles
|
|
|
) {
|
|
|
try {
|
|
|
String[] patients = receiveCodes.split(",");//接收人的code
|
|
|
String[] unPatients = unReceiveCodes.split(",");//接收人的code
|
|
|
Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
|
|
|
String[] articleIdArr = articleIds.split(",");
|
|
|
String[] articlePicArr = articlePics.split(",");
|
|
@ -101,7 +103,7 @@ public class GcEduArticleController extends WeixinBaseController {
|
|
|
return new ResultBatchModel(BaseResultModel.statusEm.opera_error.getCode(), BaseResultModel.statusEm.opera_error.getMessage() + ":文章参数长度错误");
|
|
|
}
|
|
|
//得到需要发送的患者
|
|
|
gcEduArticleService.initPatient(patientSet, patients, labelType, labelCode, teamId);
|
|
|
gcEduArticleService.initPatient(patientSet, patients,unPatients, labelType, labelCode, teamId);
|
|
|
//保存发送记录
|
|
|
List<HealthEduArticlePatient> healthEduArticlePatients = gcEduArticleService.saveArticle(patientSet, sendCode, sendName, sendMessage, teamId, articleIdArr, articlePicArr, articleTitleArr);
|
|
|
//推送微信模板消息和发送im消息
|