Commit e9208f81 by 裴大威

fix 更新群人数

parent e1126772
......@@ -142,7 +142,7 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
try{
if (BookBusinessConstants.GROUP_NUM_DTO_MAP.size() < 1) {
try {
Thread.sleep(5000);
Thread.sleep(10000);
} catch (InterruptedException e) {
log.error("[updateGroupNum] InterruptedException:{}", e);
}
......@@ -160,17 +160,24 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
Integer peopleCounts = WxGroupSDK.getPeopleCounts(value.getWxGroupId(), value.getRobotId(), value.getIp());
if (null == peopleCounts || peopleCounts < 1) {
log.info("[更新群人数] null == peopleCounts || peopleCounts < 1 entry:{}; peopleCounts:{}", entry, peopleCounts);
// 若未获取到将其移除
BookBusinessConstants.GROUP_NUM_DTO_MAP.remove(entry.getKey());
continue;
}
log.info("[更新群人数] entry:{}, peopleCounts:{}", entry, peopleCounts);
groupQrcodeDao.updateUserNumber(value.getWxGroupId(), peopleCounts);
BookBusinessConstants.GROUP_NUM_DTO_MAP.remove(entry.getKey());
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
log.error("[updateGroupNum] InterruptedException:{}", e);
}
}
} catch (Exception e) {
log.error("[updateGroupNum] : Exception:{}", e);
}
try {
Thread.sleep(5000);
Thread.sleep(10000);
} catch (InterruptedException e) {
log.error("[updateGroupNum] InterruptedException:{}", e);
}
......@@ -337,6 +344,9 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
numDTO = new AutoUpdateGroupNumDTO(weixinGroupId, robotId, ip, new Date());
} else {
numDTO.getNum().incrementAndGet();
numDTO.setRobotId(robotId);
numDTO.setIp(ip);
numDTO.setWxGroupId(weixinGroupId);
numDTO.setStartTime(new Date());
}
BookBusinessConstants.GROUP_NUM_DTO_MAP.put(weixinGroupId, numDTO);
......
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