## 拓展收益烧伤拆分两条数据处理;

This commit is contained in:
cabbage 2025-07-24 11:48:08 +08:00
parent 6b2dcbac8c
commit 9c279b788e
4 changed files with 20 additions and 17 deletions

View File

@ -978,7 +978,6 @@ public class BonusSettleFirstPurchaseHandle extends BonusSettleHandle {
BigDecimal maxIncome = ComputeUtil.computeBonusMultiply(cuMemberBonusExpand.getCalAchieve(), gradeExpandRatio);
// actualIncome = 业绩 * 等级扩展比例
BigDecimal actualIncome = ComputeUtil.computeBonusMultiply(cuMemberBonusExpand.getCalAchieve(), countryExpandRatio);
// log.info("首购. maxIncome: {}, gradeExpandRatio: {}; actualIncome: {}, countryExpandRatio: {}", maxIncome, gradeExpandRatio, actualIncome, countryExpandRatio);
// K值设置
if (riskControlMap.containsKey(cuMemberBonus.getPkMember())) {

View File

@ -382,7 +382,7 @@ public class BonusSettleNewExpandHandle extends BonusSettleHandle {
packageCuMemberBonusExpand(cuMemberBonusExpand, cuMemberBonus, bdGrade.getExpandCapping(), realIncome, realIncome);
CuMemberBonusExpand fireCuMemberBonusExpand = BeanUtil.copyProperties(cuMemberBonusExpand, CuMemberBonusExpand.class);
BigDecimal fireIncome = ComputeUtil.computeSubtract(maxIncome, realIncome);
BigDecimal fireIncome = ComputeUtil.computeSubtract(actualIncome, realIncome);
if (EBonusIncomeStatus.NORMAL.getValue() == fireCuMemberBonusExpand.getIncomeStatus()) {
// V3 V4 没有烧伤改为延缓发放
if (EGrade.VIP.getValue() == bdGrade.getGradeValue()

View File

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.constant.CacheConstants;
import com.hzs.common.core.enums.EBonusItems;
import com.hzs.common.core.enums.EYesNo;
import com.hzs.common.core.service.RedisService;
import com.hzs.common.core.utils.ComputeUtil;
import com.hzs.common.core.utils.StringUtils;
@ -32,18 +33,21 @@ public class BdBonusItemsServiceImpl extends ServiceImpl<BdBonusItemsMapper, BdB
public boolean generate(BdBonusItems bonusItems) {
Integer pkCountry = SecurityUtils.getPkCountry();
for (EBonusItems value : EBonusItems.values()) {
bonusItems.setBonusName(value.getLabel());
bonusItems.setBonusValue(value.getValue());
bonusItems.setPkCountry(pkCountry);
bonusItems.setPkCreator(SecurityUtils.getUserId());
bonusItems.setCreationTime(new Date());
LambdaQueryWrapper<BdBonusItems> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BdBonusItems::getBonusValue, value.getValue());
queryWrapper.eq(BdBonusItems::getPkCountry, pkCountry);
BdBonusItems items = baseMapper.selectOne(queryWrapper);
if (StringUtils.isNull(items)) {
baseMapper.insert(bonusItems);
redisService.deleteObject(CacheConstants.BD_BONUS_ITEMS + SecurityUtils.getPkCountry());
if (EYesNo.YES.getIntValue() == value.getEnable()) {
// 只创建启用的奖项
bonusItems.setBonusName(value.getLabel());
bonusItems.setBonusValue(value.getValue());
bonusItems.setPkCountry(pkCountry);
bonusItems.setPkCreator(SecurityUtils.getUserId());
bonusItems.setCreationTime(new Date());
LambdaQueryWrapper<BdBonusItems> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BdBonusItems::getBonusValue, value.getValue());
queryWrapper.eq(BdBonusItems::getPkCountry, pkCountry);
BdBonusItems items = baseMapper.selectOne(queryWrapper);
if (StringUtils.isNull(items)) {
baseMapper.insert(bonusItems);
redisService.deleteObject(CacheConstants.BD_BONUS_ITEMS + SecurityUtils.getPkCountry());
}
}
}
return true;

View File

@ -35,7 +35,7 @@ public enum EBonusItems {
/**
* 分红收益
*/
DIVIDEND_INCOME(6, "分红收益", 0),
DIVIDEND_INCOME(6, "分红收益", 1),
/**
* 服务补贴
*/
@ -111,12 +111,12 @@ public enum EBonusItems {
/**
* 见点收益
*/
REPURCHASE_POINT_INCOME(25, "见点收益", 0),
REPURCHASE_POINT_INCOME(26, "见点收益", 0),
/**
* 区域收益
*/
REPURCHASE_AREA_INCOME(25, "区域收益", 0),
REPURCHASE_AREA_INCOME(27, "区域收益", 0),
;