Browse Source

Merge branch 'dev/2024/0719/update-admin-Y' of feifan/mall-backend-admin into master

之前峰值的累加没有加到用户去,现在补加
Yangzw 8 months ago
parent
commit
ba0d2c5701

+ 1 - 2
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integral/IntegralServiceImpl.java

@@ -31,8 +31,7 @@ import cn.newfeifan.mall.module.distri.dal.mysql.integral.IntegralMapper;
 
 import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static cn.newfeifan.mall.module.distri.constant.DistriConstants.PT_ID;
-import static cn.newfeifan.mall.module.distri.enums.CaclEnum.DIRECT_REFERRAL_QUOTA;
-import static cn.newfeifan.mall.module.distri.enums.CaclEnum.MANUAL_RETURN_INTEGRAL;
+import static cn.newfeifan.mall.module.distri.enums.CaclEnum.*;
 import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
 
 /**

+ 12 - 11
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/ordercalc/OrderCalcServiceImpl.java

@@ -460,7 +460,7 @@ public class OrderCalcServiceImpl implements OrderCalcService {
                 }
             }
             changeUserWallet(integralDO, integralDOAncestor, ptIntegral, amount,
-                    descendantQuotaInt, highQuotaInt, grossProfitAfterBonusInt, platformQuotaInt);
+                    descendantQuotaInt, highQuotaInt, grossProfitAfterBonusInt, platformQuotaInt, ptReplenish);
 
             // ========== 修改平台信息 =================
             // 每个订单计算的过程
@@ -633,22 +633,23 @@ public class OrderCalcServiceImpl implements OrderCalcService {
     /**
      * 修改用户钱包
      *
-     * @param integralDO 当前用户钱包
+     * @param integralDO         当前用户钱包
      * @param integralDOAncestor 推荐人钱包
-     * @param pt pt钱包
-     * @param ancestorQuota 推荐人额度
-     * @param descendantQuota 直推人额度
-     * @param highQuota 最大可用额度
-     * @param ptA pt收益
-     * @param ptB pt服务费
+     * @param pt                 pt钱包
+     * @param ancestorQuota      推荐人额度
+     * @param descendantQuota    直推人额度
+     * @param highQuota          最大可用额度
+     * @param ptA                pt收益
+     * @param ptB                pt服务费
+     * @param ptReplenish        超出没有获取到的积分
      */
     private void changeUserWallet(IntegralDO integralDO, IntegralDO integralDOAncestor, IntegralDO pt,
-                                  Long ancestorQuota, Long descendantQuota, Long highQuota, Long ptA, Long ptB) {
+                                  Long ancestorQuota, Long descendantQuota, Long highQuota, Long ptA, Long ptB, Long ptReplenish) {
         // 修改用户钱包
         // 增加直推人额度
         integralDO.setHighQuota(integralDO.getHighQuota() + highQuota);
         //增加累计峰值
-        integralDO.setHighQuota(integralDO.getHighQuotaTotal() + highQuota);
+        integralDO.setHighQuotaTotal(integralDO.getHighQuotaTotal() + highQuota);
         integralDO.setFreezeHighQuota(integralDO.getFreezeHighQuota() - highQuota);
         // todo 增加累计额度
 
@@ -659,7 +660,7 @@ public class OrderCalcServiceImpl implements OrderCalcService {
         // 减少推荐人的可获取额度
         integralDOAncestor.setHighQuota(integralDOAncestor.getHighQuota() - ancestorQuota);
         integralDOAncestor.setAncestorQuota(integralDOAncestor.getAncestorQuota() + ancestorQuota);
-        integralDOAncestor.setFreezeQuota(integralDOAncestor.getFreezeQuota() - ancestorQuota);
+        integralDOAncestor.setFreezeQuota(integralDOAncestor.getFreezeQuota() - ancestorQuota - ptReplenish);
         integralService.updateIntegral(BeanUtils.toBean(integralDOAncestor, IntegralSaveReqVO.class));
 
         // 增加平台额度