后台-赠送钻石水晶-按用户角色每月限制赠送金币数-判断加上本次预赠送数值
This commit is contained in:
@@ -169,7 +169,7 @@ public class OfficialGoldRecordService extends BaseService {
|
||||
OfficalSendTypeEnum typeEnum = OfficalSendTypeEnum.get(type);
|
||||
|
||||
if (OfficalSendTypeEnum.OFFICAL_DIAMOND.equals(typeEnum)
|
||||
&& officialGoldRoleLimitService.overLimit(adminId)){
|
||||
&& officialGoldRoleLimitService.overLimit(adminId, num)){
|
||||
throw new AdminServiceException("本月的金币打款已经封顶");
|
||||
}
|
||||
|
||||
|
@@ -42,7 +42,7 @@ public class OfficialGoldRoleLimitService {
|
||||
return config.getRoleMonthlyLimitMap().get(roleId);
|
||||
}
|
||||
|
||||
public boolean overLimit(int adminId){
|
||||
public boolean overLimit(int adminId, BigDecimal thisNum){
|
||||
OfficialGoldRoleLimitServiceConfigDto config = getConfig();
|
||||
List<AdminRefUserRoleKey> roleKeyList = adminRoleService.getRoleByAdminId(adminId);
|
||||
if (CollectionUtils.isEmpty(roleKeyList)){
|
||||
@@ -65,7 +65,13 @@ public class OfficialGoldRoleLimitService {
|
||||
Date monthEndTime = DateTimeUtil.getEndTimeOfMonth(now);
|
||||
|
||||
BigDecimal totalAmount = recordMapperExpand.getTotalAmountByAdminId(Constant.BillType.interSendDiamond.byteValue(), adminId, monthStartTime, monthEndTime);
|
||||
if (null == totalAmount || totalAmount.compareTo(minLimit) < 0){
|
||||
if (null == totalAmount){
|
||||
totalAmount = BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
totalAmount = totalAmount.add(thisNum);
|
||||
|
||||
if (totalAmount.compareTo(minLimit) <= 0){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user