From f2e0e729d15d81565a905690a111a4f89a61a62a Mon Sep 17 00:00:00 2001 From: qi Date: Mon, 1 Jul 2019 21:35:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BE=AE=E4=BF=A1=E5=85=AC?= =?UTF-8?q?=E4=BC=97=E5=8F=B7=E8=A7=84=E5=88=99=E7=BB=91=E5=AE=9A=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- .../service/impl/WechatRuleServiceImpl.java | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bda549c..cf97ef6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # ssm ssm 介绍 + 一个基于sping mvc+mybatis的框架。页面是采用aceAdmin+easyui. 使用shiro作为安全框架,做权限控制 @@ -9,10 +10,9 @@ ssm 软件架构 ssm 安装教程 - 1. jdk1.8 2. maven3 -3. mysql5.1 +3. mysql5.6 4. redis ssm 使用说明 diff --git a/src/main/java/com/lq/cms/service/impl/WechatRuleServiceImpl.java b/src/main/java/com/lq/cms/service/impl/WechatRuleServiceImpl.java index 11f568a..5927ffe 100644 --- a/src/main/java/com/lq/cms/service/impl/WechatRuleServiceImpl.java +++ b/src/main/java/com/lq/cms/service/impl/WechatRuleServiceImpl.java @@ -97,6 +97,19 @@ public class WechatRuleServiceImpl extends BaseServiceImpl implement wechatKeywordDao.save(wechatKeyword); }); + List messageIds = wechatRuleVo.getMessageIds(); + messageIds.forEach((messageId)->{ + WechatRuleMessage wechatRuleMessage = wechatRuleMessageDao.getByRuleIdAndMessageId(wechatRule.getId(),messageId); + if (wechatRuleMessage==null){ + wechatRuleMessage = new WechatRuleMessage(); + wechatRuleMessage.setCreateTime(new Date()); + wechatRuleMessage.setWechatMessageId(messageId); + wechatRuleMessage.setWechatRuleId(wechatRule.getId()); + wechatRuleMessage.setStatus(StatusTypeEnum.STATUS_ACTIVITY_YES.getValue()); + wechatRuleMessageDao.save(wechatRuleMessage); + } + }); + return wechatRule; } @@ -122,6 +135,14 @@ public class WechatRuleServiceImpl extends BaseServiceImpl implement WechatRuleVo wechatRuleVo = new WechatRuleVo(); BeanUtil.copyNotNull(wechatRuleVo,wechatRule); List wechatKeywordList = wechatKeywordDao.findByWechatRuleIdAndStatus(wechatRule.getId(),StatusTypeEnum.STATUS_ACTIVITY_YES.getValue()); + List wechatRuleMessageList = wechatRuleMessageDao.findByWechatRuleId(wechatRuleId); + if (wechatRuleMessageList!=null&&wechatRuleMessageList.size()>0){ + List wechatMessageIds = new ArrayList<>(); + wechatRuleMessageList.forEach((wechatRuleMessage)->{ + wechatMessageIds.add(wechatRuleMessage.getWechatMessageId()); + }); + wechatRuleVo.setMessageIds(wechatMessageIds); + } wechatRuleVo.setWechatKeywordList(wechatKeywordList); return wechatRuleVo; }