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; }