Commit b7c10a9c by 徐高华

LOG

parent 41b57c04
...@@ -260,34 +260,47 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -260,34 +260,47 @@ public class GroupChatServiceImpl implements GroupChatService {
// 处理群通知 // 处理群通知
@Override @Override
public void handChatNotice(String params) { public void handChatNotice(String params) {
logger.info("企微群定时,企微通知"); logger.info("企微群定时,处理群通知");
List<Integer> typeList = Arrays.asList(1, 2, 3); String key = "handChatNotice";
Date endTime = new Date(); try {
Date startTime = DateUtil.addNumForMinute(endTime, -30); Object o = RedisUtil.getCache(key);
List<TabChatNotice> list = this.chatNoticeMapper.listAll(typeList, startTime, endTime); if (null != o) {
logger.info("开始群通知定时,count={}", list.size()); logger.info("有缓存,进行中");
if (CollectionUtils.isEmpty(list)) { return;
return; }
} RedisUtil.setCache(key, "1");
this.chatNoticeMapper.closeAll(typeList, startTime, endTime); List<Integer> typeList = Arrays.asList(1, 2, 3);
for (TabChatNotice item : list) { Date endTime = new Date();
try { Date startTime = DateUtil.addNumForMinute(endTime, -30);
int type = item.getType(); List<TabChatNotice> list = this.chatNoticeMapper.listAll(typeList, startTime, endTime);
String wxEnterpriseId = item.getWxEnterpriseId(); logger.info("开始群通知定时,count={}", list.size());
Long groupChatId = item.getChatId(); if (CollectionUtils.isEmpty(list)) {
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId); return;
if (type == 1) { }
this.updateGroupChatDetail(qwDTO, groupChatId, false); this.chatNoticeMapper.closeAll(typeList, startTime, endTime);
} for (TabChatNotice item : list) {
if (type == 2) { try {
this.updateChatStatus(qwDTO, groupChatId); int type = item.getType();
} String wxEnterpriseId = item.getWxEnterpriseId();
if (type == 3) { Long groupChatId = item.getChatId();
this.updateGroupChatDetail(qwDTO, groupChatId, true); WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
if (type == 1) {
this.updateGroupChatDetail(qwDTO, groupChatId, false);
}
if (type == 2) {
this.updateChatStatus(qwDTO, groupChatId);
}
if (type == 3) {
this.updateGroupChatDetail(qwDTO, groupChatId, true);
}
} catch (Exception e) {
e.printStackTrace();
} }
} catch (Exception e) {
e.printStackTrace();
} }
} catch (Exception e) {
e.printStackTrace();
} finally {
RedisUtil.delCache(key);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment