新增微信公众号规则绑定消息功能

master
星期八 5 years ago
parent 5f4630be02
commit f2e0e729d1
  1. 4
      README.md
  2. 21
      src/main/java/com/lq/cms/service/impl/WechatRuleServiceImpl.java

@ -1,6 +1,7 @@
# ssm # ssm
ssm 介绍 ssm 介绍
一个基于sping mvc+mybatis的框架。页面是采用aceAdmin+easyui. 一个基于sping mvc+mybatis的框架。页面是采用aceAdmin+easyui.
使用shiro作为安全框架,做权限控制 使用shiro作为安全框架,做权限控制
@ -9,10 +10,9 @@ ssm 软件架构
ssm 安装教程 ssm 安装教程
1. jdk1.8 1. jdk1.8
2. maven3 2. maven3
3. mysql5.1 3. mysql5.6
4. redis 4. redis
ssm 使用说明 ssm 使用说明

@ -97,6 +97,19 @@ public class WechatRuleServiceImpl extends BaseServiceImpl<WechatRule> implement
wechatKeywordDao.save(wechatKeyword); wechatKeywordDao.save(wechatKeyword);
}); });
List<Long> 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; return wechatRule;
} }
@ -122,6 +135,14 @@ public class WechatRuleServiceImpl extends BaseServiceImpl<WechatRule> implement
WechatRuleVo wechatRuleVo = new WechatRuleVo(); WechatRuleVo wechatRuleVo = new WechatRuleVo();
BeanUtil.copyNotNull(wechatRuleVo,wechatRule); BeanUtil.copyNotNull(wechatRuleVo,wechatRule);
List<WechatKeyword> wechatKeywordList = wechatKeywordDao.findByWechatRuleIdAndStatus(wechatRule.getId(),StatusTypeEnum.STATUS_ACTIVITY_YES.getValue()); List<WechatKeyword> wechatKeywordList = wechatKeywordDao.findByWechatRuleIdAndStatus(wechatRule.getId(),StatusTypeEnum.STATUS_ACTIVITY_YES.getValue());
List<WechatRuleMessage> wechatRuleMessageList = wechatRuleMessageDao.findByWechatRuleId(wechatRuleId);
if (wechatRuleMessageList!=null&&wechatRuleMessageList.size()>0){
List<Long> wechatMessageIds = new ArrayList<>();
wechatRuleMessageList.forEach((wechatRuleMessage)->{
wechatMessageIds.add(wechatRuleMessage.getWechatMessageId());
});
wechatRuleVo.setMessageIds(wechatMessageIds);
}
wechatRuleVo.setWechatKeywordList(wechatKeywordList); wechatRuleVo.setWechatKeywordList(wechatKeywordList);
return wechatRuleVo; return wechatRuleVo;
} }

Loading…
Cancel
Save