Commit b7c10a9c by 徐高华

LOG

parent 41b57c04
......@@ -260,34 +260,47 @@ public class GroupChatServiceImpl implements GroupChatService {
// 处理群通知
@Override
public void handChatNotice(String params) {
logger.info("企微群定时,企微通知");
List<Integer> typeList = Arrays.asList(1, 2, 3);
Date endTime = new Date();
Date startTime = DateUtil.addNumForMinute(endTime, -30);
List<TabChatNotice> list = this.chatNoticeMapper.listAll(typeList, startTime, endTime);
logger.info("开始群通知定时,count={}", list.size());
if (CollectionUtils.isEmpty(list)) {
return;
}
this.chatNoticeMapper.closeAll(typeList, startTime, endTime);
for (TabChatNotice item : list) {
try {
int type = item.getType();
String wxEnterpriseId = item.getWxEnterpriseId();
Long groupChatId = item.getChatId();
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);
logger.info("企微群定时,处理群通知");
String key = "handChatNotice";
try {
Object o = RedisUtil.getCache(key);
if (null != o) {
logger.info("有缓存,进行中");
return;
}
RedisUtil.setCache(key, "1");
List<Integer> typeList = Arrays.asList(1, 2, 3);
Date endTime = new Date();
Date startTime = DateUtil.addNumForMinute(endTime, -30);
List<TabChatNotice> list = this.chatNoticeMapper.listAll(typeList, startTime, endTime);
logger.info("开始群通知定时,count={}", list.size());
if (CollectionUtils.isEmpty(list)) {
return;
}
this.chatNoticeMapper.closeAll(typeList, startTime, endTime);
for (TabChatNotice item : list) {
try {
int type = item.getType();
String wxEnterpriseId = item.getWxEnterpriseId();
Long groupChatId = item.getChatId();
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