Commit 9d807954 by 裴大威

Merge branch 'hotfix-dw-wxgroup' into 'master'

fix 更新群人数

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