独联体-薪资操作fixed

This commit is contained in:
2025-09-19 10:32:31 +08:00
parent 5d2608bdfe
commit 154fb35ea3

View File

@@ -35,7 +35,6 @@ import com.accompany.core.util.I18NMessageSourceUtil;
import com.accompany.payment.service.RechargeUserService; import com.accompany.payment.service.RechargeUserService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RBucket;
import org.redisson.api.RMap; import org.redisson.api.RMap;
import org.redisson.api.RedissonClient; import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -53,9 +52,9 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import static com.accompany.common.constant.Constant.ClanMode.GUILD_POLICY2; import static com.accompany.common.constant.Constant.ClanMode.GUILD_POLICY2;
import static com.accompany.common.constant.Constant.GLOBAL_CODE;
import static com.accompany.common.redis.RedisKey.guild_usd_to_recharge_num; import static com.accompany.common.redis.RedisKey.guild_usd_to_recharge_num;
import static com.accompany.common.redis.RedisKey.guild_usd_withdraw_num; import static com.accompany.common.redis.RedisKey.guild_usd_withdraw_num;
import static com.accompany.common.constant.Constant.GLOBAL_CODE;
@Service @Service
public class GuildUsdOperateService { public class GuildUsdOperateService {
@@ -206,7 +205,7 @@ public class GuildUsdOperateService {
String cycleDate = zonedDateTime.with(DayOfWeek.MONDAY).format(DateTimeUtil.dateFormatter); String cycleDate = zonedDateTime.with(DayOfWeek.MONDAY).format(DateTimeUtil.dateFormatter);
RMap<Long, Integer> usdToRechargeMap = usdToRechargeNum(cycleDate, partitionInfo.getId()); RMap<Long, Integer> usdToRechargeMap = usdToRechargeNum(cycleDate, partitionInfo.getId());
Integer toRechargeNum = usdToRechargeMap.get(uid); Integer toRechargeNum = usdToRechargeMap.get(uid);
if (toRechargeNum != null && toRechargeNum > limitToRechargeNum) { if (toRechargeNum != null && toRechargeNum >= limitToRechargeNum) {
throw new ServiceException(BusiStatus.GUILD_USD_OPT_LIMIT); throw new ServiceException(BusiStatus.GUILD_USD_OPT_LIMIT);
} }
usdToRechargeMap.addAndGet(uid, 1); usdToRechargeMap.addAndGet(uid, 1);
@@ -218,8 +217,8 @@ public class GuildUsdOperateService {
ZonedDateTime zonedDateTime = DateTimeUtil.convertWithZoneId(now, partitionInfo.getZoneId()); ZonedDateTime zonedDateTime = DateTimeUtil.convertWithZoneId(now, partitionInfo.getZoneId());
String cycleDate = zonedDateTime.with(DayOfWeek.MONDAY).format(DateTimeUtil.dateFormatter); String cycleDate = zonedDateTime.with(DayOfWeek.MONDAY).format(DateTimeUtil.dateFormatter);
RMap<Long, Integer> withdrawNumMap = withdrawNum(cycleDate, partitionInfo.getId()); RMap<Long, Integer> withdrawNumMap = withdrawNum(cycleDate, partitionInfo.getId());
Integer withdrawNum = withdrawNumMap.addAndGet(uid, 1); Integer withdrawNum = withdrawNumMap.get(uid);
if (withdrawNum > limitWithdrawNum) { if (withdrawNum != null && withdrawNum >= limitWithdrawNum) {
throw new ServiceException(BusiStatus.GUILD_USD_OPT_LIMIT); throw new ServiceException(BusiStatus.GUILD_USD_OPT_LIMIT);
} }
withdrawNumMap.addAndGet(uid, 1); withdrawNumMap.addAndGet(uid, 1);