diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushArticleTask.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushArticleTask.java index edb3fa8..589920b 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushArticleTask.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/PushArticleTask.java @@ -40,7 +40,8 @@ public class PushArticleTask { private LymsPatientService lymsPatientService; @Autowired private LymsPushMessagesService lymsPushMessagesService; - + @Autowired + private LymsPcaseService lymsPcaseService;//病例 @Autowired private LymsDictService lymsDictService; @Autowired @@ -234,6 +235,8 @@ public class PushArticleTask { final List pushAttentionRecords = lymsPushAttentionRecordService.list(queryWrapper); for (LymsPushAttentionRecord pushAttentionRecord : pushAttentionRecords) { Map mapInfo =pLoginInfo(pushAttentionRecord.getPid()); + final List pcaseList = lymsPcaseService.list(new QueryWrapper().lambda().eq(LymsPcase::getPid, pushAttentionRecord.getPid())); + mapInfo.put("type", pcaseList.size()>0 ? 1 : 2);//有病例1,没有2,用于公众号跳转地址 Integer code= WeiXinUtil.SendWeChatMsg(pushAttentionRecord.getPGzopenid(),Constant.GZ_TEMPLATE_ID,map,mapInfo); if(null==code||code!=0){ //更新到 lyms_push_attention_record 记录 diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/WeiXinUtil.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/WeiXinUtil.java index d96a26f..8cb5544 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/WeiXinUtil.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/util/WeiXinUtil.java @@ -93,7 +93,12 @@ public class WeiXinUtil { miniprogram.put("appid",Constant.PAT_APP_ID); //登录数据 if(CollectionUtils.isNotEmpty(mapInfo) && null!=mapInfo.get("plogin") && null!=mapInfo.get("passwd")){ - miniprogram.put("pagepath","pages/news/news?plogin="+mapInfo.get("plogin")+"&passwd="+mapInfo.get("passwd"));// 注意,这里是支持传参的!!! + if(null==mapInfo.get("type") || 1==(int) mapInfo.get("type")) {//null是正常推送状态。 有值是亲属关注时的状态 + miniprogram.put("pagepath", "pages/news/news?plogin=" + mapInfo.get("plogin") + "&passwd=" + mapInfo.get("passwd"));// 注意,这里是支持传参的!!! + }else { + miniprogram.put("pagepath","pages/concernList/concernList?plogin="+mapInfo.get("plogin")+"&passwd="+mapInfo.get("passwd"));// 没有病例跳转地址 + } + }else { //意外情况自行登录 miniprogram.put("pagepath","pages/enroll/enroll");// 注意,这里是支持传参的!!!