Browse Source

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

更新个人积分的显示
Yangzw 9 months ago
parent
commit
f3c7c31d29

+ 12 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofitlog/vo/PtProfitLogPageReqVO.java

@@ -39,4 +39,16 @@ public class PtProfitLogPageReqVO extends PageParam {
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
 
+    @Schema(description = "最大可用积分变化值")
+    private Long maxAvailablePointsAmount;
+
+    @Schema(description = "最大可用积分额度")
+    private Long afterMaxAvailablePointsAmount;
+
+    @Schema(description = "合赢奖超出额度")
+    private Long accumulatedQuotaAmount;
+
+    @Schema(description = "直推奖超出额度")
+    private Long ancestorQuotaAmount;
+
 }

+ 16 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofitlog/vo/PtProfitLogRespVO.java

@@ -48,4 +48,20 @@ public class PtProfitLogRespVO {
     @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
     @ExcelProperty("创建时间")
     private LocalDateTime createTime;
+
+    @Schema(description = "最大可用积分变化值")
+    @ExcelProperty("最大可用积分变化值")
+    private Long maxAvailablePointsAmount;
+
+    @Schema(description = "最大可用积分额度")
+    @ExcelProperty("最大可用积分额度")
+    private Long afterMaxAvailablePointsAmount;
+
+    @Schema(description = "合赢奖超出额度")
+    @ExcelProperty("合赢奖超出额度")
+    private Long accumulatedQuotaAmount;
+
+    @Schema(description = "直推奖超出额度")
+    @ExcelProperty("直推奖超出额度")
+    private Long ancestorQuotaAmount;
 }

+ 12 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofitlog/vo/PtProfitLogSaveReqVO.java

@@ -41,4 +41,16 @@ public class PtProfitLogSaveReqVO {
     @Schema(description = "变动后冻结积分钱包的余额")
     private Long afterFreezeAmount;
 
+    @Schema(description = "最大可用积分变化值")
+    private Long maxAvailablePointsAmount;
+
+    @Schema(description = "最大可用积分额度")
+    private Long afterMaxAvailablePointsAmount;
+
+    @Schema(description = "合赢奖超出额度")
+    private Long accumulatedQuotaAmount;
+
+    @Schema(description = "直推奖超出额度")
+    private Long ancestorQuotaAmount;
+
 }

+ 17 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/ptprofitlog/PtProfitLogDO.java

@@ -61,5 +61,22 @@ public class PtProfitLogDO extends BaseDO {
      */
     private Long afterFreezeAmount;
 
+    /**
+     * 最大可用积分变化值
+     */
+    private Long maxAvailablePointsAmount;
+    /**
+     * 最大可用积分额度
+     */
+    private Long afterMaxAvailablePointsAmount;
+    /**
+     * 合赢奖超出额度
+     */
+    private Long accumulatedQuotaAmount;
+    /**
+     * 直推奖超出额度
+     */
+    private Long ancestorQuotaAmount;
+
 
 }

+ 28 - 7
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/ptprofitlog/PtProfitLogMapper.java

@@ -8,6 +8,12 @@ import cn.newfeifan.mall.module.distri.dal.dataobject.ptprofitlog.PtProfitLogDO;
 import org.apache.ibatis.annotations.Mapper;
 import cn.newfeifan.mall.module.distri.controller.admin.ptprofitlog.vo.*;
 
+import java.util.Arrays;
+import java.util.List;
+
+import static cn.newfeifan.mall.module.distri.constant.DistriConstants.PT_ID;
+import static cn.newfeifan.mall.module.distri.enums.CaclEnum.*;
+
 /**
  * 平台利润记录 Mapper
  *
@@ -17,15 +23,30 @@ import cn.newfeifan.mall.module.distri.controller.admin.ptprofitlog.vo.*;
 public interface PtProfitLogMapper extends BaseMapperX<PtProfitLogDO> {
 
     default PageResult<PtProfitLogDO> selectPage(PtProfitLogPageReqVO reqVO) {
+        //用户只能查看这些类型
+        List<Integer> profitStatus = Arrays.asList(
+                RECOMMENDED_PERSON_QUOTA.getType(),
+                DIRECT_REFERRAL_QUOTA.getType(),
+                HIGH_QUOTA.getType(),
+                ORDER_PAY_INTEGRAL.getType(),
+                FREEZE_CHANGE_INTEGRAL.getType()
+        );
+
+        if(reqVO.getUserId().equals(PT_ID)){
+            profitStatus = Arrays.asList(
+                    PLATFORM_TOTAL_ADD.getType(),
+                    PLATFORM_SERVICE_FEE.getType(),
+                    PLATFORM_REVENUE.getType(),
+                    AFTER_CRASH_CALC_PT_TOTAL_QUOTA.getType(),
+                    AFTER_CRASH_CALC_PT_TOTAL_GROSS_QUOTA.getType(),
+                    GROSS_PROFIT_BONUS_QUOTA_PERC_EXCEED_MAXIMUM_LIMIT.getType(),
+                    GROSS_PROFIT_ANCESTOR_QUOTA_PERC_EXCEED_MAXIMUM_LIMIT.getType()
+            );
+        }
+
         return selectPage(reqVO, new LambdaQueryWrapperX<PtProfitLogDO>()
-                .eqIfPresent(PtProfitLogDO::getAmount, reqVO.getAmount())
-                .eqIfPresent(PtProfitLogDO::getAfterAmount, reqVO.getAfterAmount())
-                .eqIfPresent(PtProfitLogDO::getPercentTemplate, reqVO.getPercentTemplate())
-                .betweenIfPresent(PtProfitLogDO::getCreateTime, reqVO.getCreateTime())
-                .eqIfPresent(PtProfitLogDO::getProfitStatus, reqVO.getProfitStatus())
                 .eqIfPresent(PtProfitLogDO::getUserId, reqVO.getUserId())
-                .eqIfPresent(PtProfitLogDO::getOrderId, reqVO.getOrderId())
-                .eqIfPresent(PtProfitLogDO::getOrderNo, reqVO.getOrderNo())
+                .in(PtProfitLogDO::getProfitStatus, profitStatus)
                 .orderByDesc(PtProfitLogDO::getCreateTime)
         );
     }

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

@@ -336,7 +336,17 @@ public class OrderCalcServiceImpl implements OrderCalcService {
             // 直推人记录
             PtProfitLogSaveReqVO ztrLog = PtProfitLogSaveReqVO.builder().orderId(k.getOrderId()).profitStatus(CaclEnum.DIRECT_REFERRAL_QUOTA.getType()).orderNo(k.getNo()).userId(sharePath.getDescendant()).amount(descendantQuotaInt).afterAmount(integralDO.getCurrentQuota() + descendantQuotaInt).percentTemplate(percentTemplate).build();
             // 直推人冻结积分转化成可用记录
-            PtProfitLogSaveReqVO freezeLog = PtProfitLogSaveReqVO.builder().orderId(k.getOrderId()).profitStatus(CaclEnum.FREEZE_CHANGE_INTEGRAL.getType()).orderNo(k.getNo()).userId(sharePath.getDescendant()).freezeAmount(descendantQuotaInt).afterFreezeAmount(integralDO.getCurrentQuota() - descendantQuotaInt).percentTemplate(percentTemplate).build();
+            PtProfitLogSaveReqVO freezeLog = PtProfitLogSaveReqVO.builder()
+                    .orderId(k.getOrderId())
+                    .profitStatus(CaclEnum.FREEZE_CHANGE_INTEGRAL.getType())
+                    .orderNo(k.getNo())
+                    .userId(sharePath.getDescendant())
+                    .freezeAmount(descendantQuotaInt)
+                    .afterFreezeAmount(integralDO.getFreezeQuota() - descendantQuotaInt)
+                    .percentTemplate(percentTemplate)
+                    .amount(descendantQuotaInt)
+                    .afterAmount(integralDO.getCurrentQuota() + descendantQuotaInt)
+                    .build();
 
             PtProfitLogSaveReqVO highQuotaLog = PtProfitLogSaveReqVO.builder().orderId(k.getOrderId()).profitStatus(CaclEnum.HIGH_QUOTA.getType()).orderNo(k.getNo()).userId(sharePath.getDescendant()).amount(highQuotaInt).afterAmount(integralDO.getHighQuota() + highQuotaInt).percentTemplate(percentTemplate).build();