瀏覽代碼

代码修改

chenweida 7 年之前
父節點
當前提交
981a478013

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcEduArticleController.java

@ -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消息

+ 6 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/service/GcEduArticleService.java

@ -36,7 +36,7 @@ public class GcEduArticleService {
     * @param labelCode
     * @param teamId
     */
    public void initPatient(Set<String> patientSet, String[] patients, String labelType, String labelCode, Long teamId) {
    public void initPatient(Set<String> patientSet, String[] patients, String[] unPatients, String labelType, String labelCode, Long teamId) {
        List params = new ArrayList();//sql参数
        StringBuffer sb = new StringBuffer();//sql
        //1 服务类型  2 健康情况 3 疾病类型 4 自定义标签
@ -75,6 +75,11 @@ public class GcEduArticleService {
            List<String> arrPatient = java.util.Arrays.asList(patients);
            patientSet.addAll(arrPatient);
        }
        if (unPatients != null && unPatients.length > 0) {
            for (String unPatient : unPatients) {
                patientSet.remove(unPatient);
            }
        }
    }
    /**