|
|
@@ -81,16 +81,20 @@ public class QwContactWayServiceImpl implements IQwContactWayService
|
|
|
{
|
|
|
QwContactWay qwContactWay = qwContactWayMapper.selectQwContactWayById(id);
|
|
|
|
|
|
- String userLimitJson = qwContactWay.getUserLimitJson();
|
|
|
- List<QwContactWayUser> wayUserList = JSON.parseArray(userLimitJson, QwContactWayUser.class);
|
|
|
- for (QwContactWayUser wayUsers: wayUserList){
|
|
|
- String wayLimit = "qwContactWayLimit:" + qwContactWay.getCorpId() + ":" + wayUsers.getUserId();
|
|
|
- Long num = Long.valueOf(Objects.requireNonNull(redisTemplate.opsForValue().get(wayLimit)));
|
|
|
- wayUsers.setDayCount(num);
|
|
|
+ if (qwContactWay.getIsUserLimit() == 1) {
|
|
|
+ String userLimitJson = qwContactWay.getUserLimitJson();
|
|
|
+ List<QwContactWayUser> wayUserList = JSON.parseArray(userLimitJson, QwContactWayUser.class);
|
|
|
+ for (QwContactWayUser wayUsers : wayUserList) {
|
|
|
+ String wayLimit = "qwContactWayLimit:" + qwContactWay.getCorpId() + ":" + wayUsers.getUserId();
|
|
|
+ String value = redisTemplate.opsForValue().get(wayLimit);
|
|
|
+ if (value != null) {
|
|
|
+ wayUsers.setDayCount(Long.valueOf(value));
|
|
|
+ } else {
|
|
|
+ wayUsers.setDayCount(0L); // 或其他默认值
|
|
|
+ }
|
|
|
+ }
|
|
|
+ qwContactWay.setUserLimitJson(JSON.toJSONString(wayUserList));
|
|
|
}
|
|
|
-
|
|
|
- qwContactWay.setUserLimitJson(JSON.toJSONString(wayUserList));
|
|
|
-
|
|
|
return qwContactWay;
|
|
|
}
|
|
|
|