Jelajahi Sumber

首次提交

Yangzw 2 bulan lalu
induk
melakukan
946ec67e21
15 mengubah file dengan 131 tambahan dan 381 penghapusan
  1. 0 3
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitioncrash/vo/PartitionCrashPageReqVO.java
  2. 0 3
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitioncrash/vo/PartitionCrashRespVO.java
  3. 0 2
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitioncrash/vo/PartitionCrashSaveReqVO.java
  4. 1 3
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionson/vo/PartitionSonPageReqVO.java
  5. 0 1
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/partitioncrash/PartitionCrashDO.java
  6. 0 1
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/partitioncrash/PartitionCrashMapper.java
  7. 1 2
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/partitionson/PartitionSonMapper.java
  8. 67 217
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/partitioncrash/PartitionCrashServiceImpl.java
  9. 2 2
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/sharepath/builder/TreeBuilder.java
  10. 0 1
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/shopsettlement/ShopSettlementServiceImpl.java
  11. 38 48
      feifan-module-distri/feifan-module-distri-biz/src/main/resources/mapper/sharepath/SharePathMapper.xml
  12. 4 21
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spu/vo/ProductSpuSaveReqVO.java
  13. 0 7
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/sku/ProductSkuService.java
  14. 0 17
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spu/ProductSpuService.java
  15. 18 53
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spu/ProductSpuServiceImpl.java

+ 0 - 3
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitioncrash/vo/PartitionCrashPageReqVO.java

@@ -38,9 +38,6 @@ public class PartitionCrashPageReqVO extends PageParam {
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
 
-    @Schema(description = "用户昵称", example = "赵六")
-    private String nickName;
-
     @Schema(description = "当日日期")
     @NotNull(message = "日期不能为空")
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)

+ 0 - 3
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitioncrash/vo/PartitionCrashRespVO.java

@@ -40,7 +40,4 @@ public class PartitionCrashRespVO {
     @Schema(description = "用户名称", example = "王五")
     @ExcelProperty("用户名称")
     private String userName;
-    @Schema(description = "用户昵称", example = "赵六")
-    @ExcelProperty("用户昵称")
-    private String nickName;
 }

+ 0 - 2
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitioncrash/vo/PartitionCrashSaveReqVO.java

@@ -29,6 +29,4 @@ public class PartitionCrashSaveReqVO {
     @Schema(description = "碰撞后额度")
     private Long afterHitQuota;
 
-    @Schema(description = "用户昵称", example = "赵六")
-    private String nickName;
 }

+ 1 - 3
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionson/vo/PartitionSonPageReqVO.java

@@ -35,11 +35,9 @@ public class PartitionSonPageReqVO extends PageParam {
     @Schema(description = "创建时间")
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
-    @Schema(description = "用户名称", example = "非繁人")
-    private String name;
 
     @Schema(description = "用户昵称", example = "李四")
-    private String nickName;
+    private String userName;
 
 
 }

+ 0 - 1
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/partitioncrash/PartitionCrashDO.java

@@ -48,5 +48,4 @@ public class PartitionCrashDO extends BaseDO {
      * 用户名称
      */
     private String userName;
-    private String nickName;
 }

+ 0 - 1
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/partitioncrash/PartitionCrashMapper.java

@@ -27,7 +27,6 @@ public interface PartitionCrashMapper extends BaseMapperX<PartitionCrashDO> {
                 .eqIfPresent(PartitionCrashDO::getAfterHitQuota, reqVO.getAfterHitQuota())
                 .betweenIfPresent(PartitionCrashDO::getCreateTime, LocalDateTimeTool.startTime(reqVO.getEveryday()), LocalDateTimeTool.endTime(reqVO.getEveryday()))
                 .likeIfPresent(PartitionCrashDO::getUserName, reqVO.getUserName())
-                .likeIfPresent(PartitionCrashDO::getNickName, reqVO.getNickName())
                 .orderByDesc(PartitionCrashDO::getBrotherPrice)
                 .orderByDesc(PartitionCrashDO::getSonPrice);
         if (reqVO.getIsSelectCrash() != null && reqVO.getIsSelectCrash()) {

+ 1 - 2
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/partitionson/PartitionSonMapper.java

@@ -26,8 +26,7 @@ public interface PartitionSonMapper extends BaseMapperX<PartitionSonDO> {
                 .eqIfPresent(PartitionSonDO::getAfterHitQuota, reqVO.getAfterHitQuota())
                 .eqIfPresent(PartitionSonDO::getSize, reqVO.getSize())
                 .betweenIfPresent(PartitionSonDO::getCreateTime, reqVO.getCreateTime())
-                .likeIfPresent(PartitionSonDO::getName, reqVO.getName())
-                .likeIfPresent(PartitionSonDO::getNickName, reqVO.getNickName())
+                .likeIfPresent(PartitionSonDO::getUserName, reqVO.getUserName())
                 .orderByDesc(PartitionSonDO::getId));
     }
 

+ 67 - 217
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/partitioncrash/PartitionCrashServiceImpl.java

@@ -12,9 +12,12 @@ import cn.newfeifan.mall.module.distri.dal.dataobject.ordercalc.OrderCalcDO;
 import cn.newfeifan.mall.module.distri.dal.dataobject.orderpercentage.OrderPercentageDO;
 import cn.newfeifan.mall.module.distri.dal.dataobject.ptprofit.PtProfitDO;
 import cn.newfeifan.mall.module.distri.dal.dataobject.ptprofitdailystatisticslog.PtProfitDailyStatisticsLogDO;
+import cn.newfeifan.mall.module.distri.dal.dataobject.sharepath.SharePathDO;
 import cn.newfeifan.mall.module.distri.dal.mysql.ptprofit.PtProfitMapper;
 import cn.newfeifan.mall.module.distri.dal.mysql.ptprofitdailystatisticslog.PtProfitDailyStatisticsLogMapper;
 import cn.newfeifan.mall.module.distri.enums.CaclEnum;
+import cn.newfeifan.mall.module.distri.enums.IntegralEnum;
+import cn.newfeifan.mall.module.distri.enums.ProfitTypeEnum;
 import cn.newfeifan.mall.module.distri.service.dailyawardrecords.DailyAwardRecordsService;
 import cn.newfeifan.mall.module.distri.service.duser.DuserService;
 import cn.newfeifan.mall.module.distri.service.integral.IntegralService;
@@ -159,88 +162,74 @@ public class PartitionCrashServiceImpl implements PartitionCrashService {
         }
         //记录所有用户的id和积分
         List<HashMap<Long, Long>> afterCrashMap = new ArrayList<>();
-        // 获取当前合赢奖百分比
+        // 获取当前团队奖百分比
         OrderPercentageDO orderPercentageDO = orderPercentageService.queryStatus();
 
-        // 获取当前所有用户的父亲
-        Map<Long, Long> sonAndParent = new HashMap<>();
-        List<Long> userIds = duserDOS.stream().map(DuserDO::getUserId).collect(Collectors.toList());
-
-        userIds.forEach(k -> {
-            Long parent = sharePathService.queryParentBySonUserId(k);
-            sonAndParent.put(k, parent);
-        });
-
         List<PartitionSonSaveReqVO> partitionSonSaveReqVOS = new ArrayList<>();
         List<PartitionBrothersSaveReqVO> partitionBrothersSaveReqVOS = new ArrayList<>();
         List<PartitionCrashSaveReqVO> partitionCrashSaveReqVOS = new ArrayList<>();
 
-        // 本来在下面,搬上来,因为游客收益要扣减
-        IntegralDO ptIntegralDO = integralService.selectByUser(PT_ID);
+        // 平台钱包
+        PtProfitDO ptProfit = ptProfitMapper.selectList().get(0);
 
         duserDOS.forEach(k -> {
 
             // 获取当前用户的钱包
             IntegralDO integralDO = integralService.selectByUser(k.getUserId());
-            // 获取当前用户信息
-            MemberUserDO user = memberUserService.getUser(k.getUserId());
+            // 获取用户关系网
+            SharePathDO sharePathDO = sharePathService.getSharePathByDescendant(k.getUserId());
 
-            // 获取当前父亲的钱包
-            Long parent = sonAndParent.get(k.getUserId());
-            IntegralDO parentIntegralDo = integralService.selectByUser(parent);
-            if (parentIntegralDo != null) {
+            // 获取当前用户的钱包
+            if (integralDO != null) {
 
                 // 创建一个分区编号
                 String todayNo = crashTodayNo(k.getUserId());
 
-                PartitionSonSaveReqVO.PartitionSonSaveReqVOBuilder sonBuilder = PartitionSonSaveReqVO.builder();
-                PartitionBrothersSaveReqVO.PartitionBrothersSaveReqVOBuilder brotherBuilder = PartitionBrothersSaveReqVO.builder();
+                PartitionSonSaveReqVO.PartitionSonSaveReqVOBuilder leftBuilder = PartitionSonSaveReqVO.builder();
+                PartitionBrothersSaveReqVO.PartitionBrothersSaveReqVOBuilder rightBuilder = PartitionBrothersSaveReqVO.builder();
                 PartitionCrashSaveReqVO.PartitionCrashSaveReqVOBuilder crashSaveReqVOBuilder = PartitionCrashSaveReqVO.builder();
-                sonBuilder.partNo(todayNo);
-                sonBuilder.userId(k.getUserId());
-                sonBuilder.name(k.getName());
-                sonBuilder.nickName(k.getNickName());
-                sonBuilder.hasHit(1);
+                leftBuilder.partNo(todayNo);
+                leftBuilder.userId(k.getUserId());
+                leftBuilder.userName(k.getUserName());
+                leftBuilder.hasHit(1);
 
-                brotherBuilder.partNo(todayNo);
-                brotherBuilder.userId(k.getUserId());
-                brotherBuilder.name(k.getName());
-                brotherBuilder.nickName(k.getNickName());
-                brotherBuilder.hasHit(1);
+                rightBuilder.partNo(todayNo);
+                rightBuilder.userId(k.getUserId());
+                rightBuilder.userName(k.getUserName());
+                rightBuilder.hasHit(1);
 
 
                 crashSaveReqVOBuilder.partNo(todayNo);
                 crashSaveReqVOBuilder.userId(k.getUserId());
-                crashSaveReqVOBuilder.nickName(k.getNickName());
-                crashSaveReqVOBuilder.userName(k.getName());
+                crashSaveReqVOBuilder.userName(k.getUserName());
 
-                // 获取当前用户的后代分区 , 并且该分区存在有下单的用户
-                List<OrderCalcDO> sonOrderCalcDOS = sharePathService.selectSons(k.getUserId(), userId);
-                if (sonOrderCalcDOS.isEmpty()) {
+                // 获取当前用户的左边分区 , 并且该分区存在有下单的用户
+                List<OrderCalcDO> leftOrderCalcDOS = sharePathService.selectArea(sharePathDO.getLeftChildId(), userId);
+                if (leftOrderCalcDOS.isEmpty()) {
                     // 插入空数据
-                    sonBuilder = addSonEmpty(sonBuilder, k);
+                    leftBuilder = addSonEmpty(leftBuilder, k);
                     crashSaveReqVOBuilder.sonPrice(0L);
                 }
-                // 合计儿子分支额度
+                // 合计左边分支额度
                 double grossProfitBonusQuotaPerc = Double.parseDouble(orderPercentageDO.getGrossProfitBonusQuotaPerc());
-                Long sonSumPrice = (long) (sonOrderCalcDOS.stream().mapToLong(OrderCalcDO::getGrossProfit).sum() * grossProfitBonusQuotaPerc);
-                sonBuilder.price(sonSumPrice);
+                Long sonSumPrice = (long) (leftOrderCalcDOS.stream().mapToLong(OrderCalcDO::getGrossProfit).sum() * grossProfitBonusQuotaPerc);
+                leftBuilder.price(sonSumPrice);
 
-                // 获取当前用户的兄弟分区
-                List<OrderCalcDO> brothersOrderCalcDOS = sharePathService.selectBrothers(k.getUserId(), userId, user);
-                if (brothersOrderCalcDOS.isEmpty()) {
+                // 获取当前用户的右边分区
+                List<OrderCalcDO> rightOrderCalcDOS = sharePathService.selectArea(sharePathDO.getRightChildId(), userId);
+                if (rightOrderCalcDOS.isEmpty()) {
                     // 插入空数据
-                    brotherBuilder = addBrotherEmpty(brotherBuilder, k);
+                    rightBuilder = addBrotherEmpty(rightBuilder, k);
                     crashSaveReqVOBuilder.brotherPrice(0L);
                 }
 
                 // 合并兄弟分支额度
-                Long brotherSumPrice = (long) (brothersOrderCalcDOS.stream().mapToLong(OrderCalcDO::getGrossProfit).sum() * grossProfitBonusQuotaPerc);
-                brotherBuilder.price(brotherSumPrice);
+                Long brotherSumPrice = (long) (rightOrderCalcDOS.stream().mapToLong(OrderCalcDO::getGrossProfit).sum() * grossProfitBonusQuotaPerc);
+                rightBuilder.price(brotherSumPrice);
 
 
                 // 判断,昨天是否有存余的分支
-                PartitionCrashDO yesterdayCrash = crashYesterdayNo(k.getUserId(),1);
+                PartitionCrashDO yesterdayCrash = crashYesterdayNo(k.getUserId(), 1);
                 // 如果不为空, 则判断增加到哪个分支中
                 if (yesterdayCrash != null) {
                     if (yesterdayCrash.getSonPrice() >= yesterdayCrash.getBrotherPrice()) {
@@ -254,142 +243,77 @@ public class PartitionCrashServiceImpl implements PartitionCrashService {
                 Long smallQuota = 0L;
                 // 碰撞计算
                 if (sonSumPrice >= brotherSumPrice) {
-                    sonBuilder.size(1);
-                    brotherBuilder.size(0);
+                    leftBuilder.size(1);
+                    rightBuilder.size(0);
                     afterCrash = sonSumPrice - brotherSumPrice;
                     smallQuota = brotherSumPrice;
 
                 } else {
-                    sonBuilder.size(0);
-                    brotherBuilder.size(1);
+                    leftBuilder.size(0);
+                    rightBuilder.size(1);
                     afterCrash = brotherSumPrice - sonSumPrice;
                     smallQuota = sonSumPrice;
                 }
 
-
                 crashSaveReqVOBuilder.brotherPrice(brotherSumPrice);
                 crashSaveReqVOBuilder.sonPrice(sonSumPrice);
                 crashSaveReqVOBuilder.afterHitQuota(afterCrash);
 
                 // 积分添加 添加的时候, 需要注意当前用户是否有足够的积分可以获取
                 // 碰撞后的额度的
-                Long highQuota = integralDO.getHighQuota() + new BigDecimal(orderPercentageDO.getBaseMaxQuota()).longValue();       //加上基础的最大额度值
-                Long parentHighQuota = parentIntegralDo.getHighQuota() + new BigDecimal(orderPercentageDO.getBaseMaxQuota()).longValue();
+                Long highQuota = integralDO.getHighQuota();
 
                 BigDecimal smallBigDecimal = new BigDecimal(String.valueOf(smallQuota));
-                BigDecimal multiply = smallBigDecimal.divide(new BigDecimal("2.0"), 4, RoundingMode.DOWN);
-                //直推人的本次添加积分
+
+                // 获取计算后积分, Long为userId, Integer为碰撞后额度
+                HashMap<Long, Long> map = new HashMap<>();
+
+                //直推人的的本次添加积分
                 Long amount = 0L;
                 //平台需要补回的收益(也可以理解为用户溢出)
-                Long ptReplenish = multiply.longValue();
-
+                Long ptReplenish = smallBigDecimal.longValue();
                 //直推人
-                if (multiply.longValue() != 0) {
+                if (smallBigDecimal.longValue() != 0) {
                     if (highQuota.compareTo(0L) > 0) {
-
-                        if (highQuota.compareTo(multiply.longValue()) > 0) {
-                            amount = multiply.longValue();
+                        if (highQuota.compareTo(smallBigDecimal.longValue()) > 0) {
+                            amount = smallBigDecimal.longValue();
                             ptReplenish = 0L;
                         } else {
                             amount = highQuota;
-                            ptReplenish = multiply.longValue() - highQuota;
+                            ptReplenish = smallBigDecimal.longValue() - highQuota;
                         }
                         addHighQuota(userHighQuotaMap, integralDO.getUserId(), amount);
                     }
-                    integralDO.setFreezeQuota(integralDO.getFreezeQuota() + amount);
+                    // 减去最高额度
                     integralDO.setHighQuota(integralDO.getHighQuota() - amount);
-
+                    integralDO.setFreezeQuota(integralDO.getFreezeQuota() + amount);
 
                     integralDO.setAccumulatedQuota(integralDO.getAccumulatedQuota() + amount);
                     // 碰撞后的额度添加到日志中 增加日志模块
                     integralService.updateIntegral(BeanUtils.toBean(integralDO, IntegralSaveReqVO.class));
-                    Long logId = ptProfitLogService.addMessageFreeze(integralDO.getUserId(), integralDO.getUserId(), CaclEnum.SMALL_QUOTA_CRASH, amount,
-                            integralDO.getFreezeQuota(), JsonUtils.toJsonString(orderPercentageDO), ptReplenish, -amount, highQuota - amount);
-
-                    //记录每日用户有合赢将的记录,后面用来结算的
-                    dailyAwardRecordsService.addDailyAwardRecords(integralDO.getUserId(), integralDO.getUserId(), amount, logId, ptReplenish);
-                }
-                if (!ptReplenish.equals(0L)) {
-                    calcIntegral(ptReplenish, integralDO.getUserId(), JsonUtils.toJsonString(orderPercentageDO));
-                }
 
-                // 获取计算后积分, Long为userId, Integer为碰撞后额度
-                HashMap<Long, Long> map = new HashMap<>();
+                    ptProfit.setPtGrossAdd(ptProfit.getPtGrossAdd() - amount);
+                    ptProfit.setPtTotalAdd(ptProfit.getPtTotalAdd() - amount);
 
-                // 当用户为游客的时候上级不参与合赢奖
-                if (!user.getVisitor()) {
-                    //直推人的上级的本次添加积分
-                    Long parentAmount = 0L;
-                    //平台需要补回的收益(也可以理解为用户溢出)
-                    Long parentPtReplenish = multiply.longValue();
-                    //直推人的父级
-                    if (multiply.longValue() != 0) {
-                        if (parentHighQuota.compareTo(0L) > 0) {
-                            if (parentHighQuota.compareTo(multiply.longValue()) > 0) {
-                                parentAmount = multiply.longValue();
-                                parentPtReplenish = 0L;
-                            } else {
-                                parentAmount = highQuota;
-                                parentPtReplenish = multiply.longValue() - highQuota;
-                            }
-                            addHighQuota(userHighQuotaMap, parentIntegralDo.getUserId(), parentAmount);
-                        }
-                        // 减去最高额度
-                        parentIntegralDo.setHighQuota(parentIntegralDo.getHighQuota() - parentAmount);
-                        parentIntegralDo.setFreezeQuota(parentIntegralDo.getFreezeQuota() + parentAmount);
-
-                        parentIntegralDo.setAccumulatedQuota(parentIntegralDo.getAccumulatedQuota() + parentAmount);
-                        // 碰撞后的额度添加到日志中 增加日志模块
-                        integralService.updateIntegral(BeanUtils.toBean(parentIntegralDo, IntegralSaveReqVO.class));
-                        Long logId = ptProfitLogService.addMessageFreeze(parentIntegralDo.getUserId(), integralDO.getUserId(), CaclEnum.SMALL_QUOTA_CRASH, parentAmount,
-                                parentIntegralDo.getFreezeQuota(), JsonUtils.toJsonString(orderPercentageDO), parentPtReplenish, -parentAmount, parentHighQuota - parentAmount);
-
-                        //记录每日用户有合赢将的记录,后面用来结算的
-                        dailyAwardRecordsService.addDailyAwardRecords(parentIntegralDo.getUserId(), integralDO.getUserId(), parentAmount, logId, parentPtReplenish);
-                    }
+                    Long logId = ptProfitLogService.createPtProfitLog(integralDO.getUserId(), amount, ptProfit.getPtGrossAdd(),
+                            JsonUtils.toJsonString(orderPercentageDO), IntegralEnum.TEAM_BONUS, ProfitTypeEnum.PT_PROFIT.getType());
 
-                    if (!parentPtReplenish.equals(0L)) {
-                        calcIntegral(parentPtReplenish, parentIntegralDo.getUserId(), JsonUtils.toJsonString(orderPercentageDO));
-                    }
+                    //记录每日用户有团队奖的记录,后面用来结算的
+                    dailyAwardRecordsService.addDailyAwardRecords(sharePathDO.getUserId(), integralDO.getUserId(), amount, logId, ptReplenish);
 
-                    if (!parentIntegralDo.getUserId().equals(PT_ID)) {
-                        map.put(parentIntegralDo.getUserId(), parentAmount);
-                    }
-                } else if (multiply.longValue() != 0) {
-                    // 如果当前用户是游客,将上级推荐将加入到游客收益中,不算入到翁总的合赢奖
-                    Long visitorEarnings = multiply.longValue();        //单笔收益
-
-                    // 获取平台的游客收益
-                    PtProfitDO ptProfit = ptProfitService.getPtProfit();
-                    ptProfit.setVisitorEarnings(ptProfit.getVisitorEarnings() + visitorEarnings);
-                    ptProfit.setPtGrossAdd(ptProfit.getPtGrossAdd() - visitorEarnings);
-                    ptProfitService.updatePtProfit(BeanUtils.toBean(ptProfit, PtProfitSaveReqVO.class));
-                    ptIntegralDO.setCurrentQuota(ptIntegralDO.getCurrentQuota() - visitorEarnings);
-
-                    ptProfitLogService.addMessage(parent, CaclEnum.AFTER_CRASH_CALC_PT_TOTAL_QUOTA
-                            , -visitorEarnings, ptProfit.getPtTotalAdd() - visitorEarnings, JsonUtils.toJsonString(orderPercentageDO), null, null, null);
-                    ptProfitLogService.addMessage(parent, CaclEnum.AFTER_CRASH_CALC_PT_TOTAL_GROSS_QUOTA
-                            , -visitorEarnings, ptProfit.getPtGrossAdd(), JsonUtils.toJsonString(orderPercentageDO), null, null, null);
-
-                    // 记录平台游客收益log
-                    ptProfitLogService.addMessage(k.getUserId(), null ,CaclEnum.SMALL_QUOTA_CRASH_SETTLE, visitorEarnings, ptProfit.getVisitorEarnings()
-                    , null, null, JsonUtils.toJsonString(orderPercentageDO),null, null);
+                    log.info("{}-用户获得了团队奖: ¥{}", integralDO.getUserName(), amount);
                 }
 
-                // 如果为当前用户为平台,则不需要存入这个地方
-                if (!k.getUserId().equals(PT_ID)) {
-                    map.put(k.getUserId(), amount);
+                if (!sharePathDO.getUserId().equals(PT_ID)) {
+                    map.put(sharePathDO.getUserId(), amount);
                 }
 
                 afterCrashMap.add(map);
 
-                log.info(k.getNickName() + "用户合赢奖已经计算: 该用户合赢奖为: \t" +
-                        "兄弟分区为: " + brotherBuilder.build() + "\t" +
-                        "后代分区为: " + sonBuilder.build() + "\t" +
-                        "碰撞分区为: " + crashSaveReqVOBuilder.build() + "\t");
+                log.info("{}用户合赢奖已经计算: 该用户合赢奖为: \t兄弟分区为: {}\t后代分区为: {}\t碰撞分区为: {}\t", k.getUserName(), rightBuilder.build(), leftBuilder.build(), crashSaveReqVOBuilder.build());
 
-                partitionSonSaveReqVOS.add(sonBuilder.build());
-                partitionBrothersSaveReqVOS.add(brotherBuilder.build());
+                partitionSonSaveReqVOS.add(leftBuilder.build());
+                partitionBrothersSaveReqVOS.add(rightBuilder.build());
                 partitionCrashSaveReqVOS.add(crashSaveReqVOBuilder.build());
 
 
@@ -401,79 +325,7 @@ public class PartitionCrashServiceImpl implements PartitionCrashService {
         saveBatch(partitionCrashSaveReqVOS);
 
         // 计算平台积分
-        // 获取当前平台的额度
-        PtProfitDO ptProfit = ptProfitService.getPtProfit();
-
-        // 遍历hashMap
-        for (HashMap<Long, Long> longIntegerHashMap : afterCrashMap) {
-            for (Map.Entry<Long, Long> entry : longIntegerHashMap.entrySet()) {
-                //暂时不设限制扣减
-//                if (ptProfit.getPtGrossAdd() <= 0) {
-//                    break;
-//                }
-
-                if (entry.getValue() == 0) {
-                    continue;
-                }
-
-                // 获取当前用户的钱包
-                IntegralDO integralDO = integralService.selectByUser(entry.getKey());
-                // 获取当前父亲的钱包
-                Long highQuota = integralDO.getHighQuota() + new BigDecimal(orderPercentageDO.getBaseMaxQuota()).longValue();       //加上基础的最大额度值
-
-                for (Long key : userHighQuotaMap.keySet()) {
-                    if (key.equals(entry.getKey())) {
-                        if (userHighQuotaMap.get(key) > 0L) {
-                            highQuota = highQuota + entry.getValue();
-                            userHighQuotaMap.put(key, userHighQuotaMap.get(key) - entry.getValue());
-                            break;
-                        }
-                    }
-                }
-
-
-                //amount用于记录本次添加的值
-                Long amount = 0L;
-                //平台需要补回的收益
-//                Long ptReplenish = entry.getValue();
-
-                //如果直推人的可获取额度大于0,则能够获取
-                if (highQuota.compareTo(0L) > 0) {
-                    if (highQuota.compareTo(entry.getValue()) > 0) {
-                        //如果最大额度 > 直推人可获取额度,则直接获取
-                        amount = entry.getValue();
-                        //平台没有需要补回的收益
-//                        ptReplenish = 0L;
-                    } else {
-                        //如果最大额度 < 直推人可获取额度,则获取自己的最大额度
-                        amount = highQuota;
-                        //用户本次没有拿到的直推奖
-//                        ptReplenish = entry.getValue() - highQuota;
-                    }
-
-                    integralService.updateIntegral(BeanUtils.toBean(integralDO, IntegralSaveReqVO.class));
-
-
-                    // 扣除平台收益
-                    log.info("扣除平台收益[合赢奖] " + "用户: " + entry.getKey() + "额度: " + amount);
-                    ptProfit.setPtGrossAdd(ptProfit.getPtGrossAdd() - amount);
-                    ptIntegralDO.setCurrentQuota(ptIntegralDO.getCurrentQuota() - amount);
-                    // 平台扣除积分
-                    ptProfit.setPtTotalAdd(ptProfit.getPtTotalAdd() - amount);
-                    // 碰撞后的额度添加到日志中 增加日志模块
-                    ptProfitLogService.addMessage(entry.getKey(), CaclEnum.AFTER_CRASH_CALC_PT_TOTAL_QUOTA
-                            , -entry.getValue(), ptProfit.getPtTotalAdd(), JsonUtils.toJsonString(orderPercentageDO), null, null, null);
-                    ptProfitLogService.addMessage(entry.getKey(), CaclEnum.AFTER_CRASH_CALC_PT_TOTAL_GROSS_QUOTA
-                            , -entry.getValue(), ptProfit.getPtGrossAdd(), JsonUtils.toJsonString(orderPercentageDO), null, null, null);
-                }
-            }
-        }
-
-        integralService.updateIntegral(BeanUtils.toBean(ptIntegralDO, IntegralSaveReqVO.class));
-        ptProfitService.updatePtProfit(PtProfitSaveReqVO.builder().id(ptProfit.getId())
-                .ptAdd(ptProfit.getPtAdd())
-                .ptGrossAdd(ptProfit.getPtGrossAdd())
-                .ptTotalAdd(ptProfit.getPtTotalAdd()).build());
+        ptProfitService.updatePtProfit(BeanUtils.toBean(ptProfit, PtProfitSaveReqVO.class));
 
         // 计算平台当日的碰撞支出
         Long sum = 0L;
@@ -544,8 +396,7 @@ public class PartitionCrashServiceImpl implements PartitionCrashService {
 
     private PartitionBrothersSaveReqVO.PartitionBrothersSaveReqVOBuilder addBrotherEmpty(PartitionBrothersSaveReqVO.PartitionBrothersSaveReqVOBuilder brotherBuilder, DuserDO duserDO) {
 
-        return brotherBuilder.name(duserDO.getName())
-                .nickName(duserDO.getNickName())
+        return brotherBuilder.userName(duserDO.getUserName())
                 .size(0)
                 .price(0L)
                 .afterHitQuota(0L)
@@ -555,8 +406,7 @@ public class PartitionCrashServiceImpl implements PartitionCrashService {
     private PartitionSonSaveReqVO.PartitionSonSaveReqVOBuilder addSonEmpty(
             PartitionSonSaveReqVO.PartitionSonSaveReqVOBuilder sonBuilder,
             DuserDO duserDO) {
-        return sonBuilder.name(duserDO.getName())
-                .nickName(duserDO.getNickName())
+        return sonBuilder.userName(duserDO.getUserName())
                 .size(0)
                 .price(0L)
                 .afterHitQuota(0L)

+ 2 - 2
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/sharepath/builder/TreeBuilder.java

@@ -17,7 +17,7 @@ public class TreeBuilder {
     public TreeNode buildTree(List<SharePathDO> paths) {
         // 初始化childrenMap
         for (SharePathDO path : paths) {
-            childrenMap.computeIfAbsent(path.getAncestor(), k -> new ArrayList<>()).add(path);
+            childrenMap.computeIfAbsent(path.getReferrerId(), k -> new ArrayList<>()).add(path);
         }
 
         // 假设根节点的ancestor为null或特定值,这里以null为例
@@ -34,7 +34,7 @@ public class TreeBuilder {
         List<TreeNode> childNodes = new ArrayList<>();
 
         for (SharePathDO child : children) {
-            TreeNode childNode = buildTreeNode(child.getDescendant());
+            TreeNode childNode = buildTreeNode(child.getUserId());
             if (childNode != null) {
                 childNodes.add(childNode);
             }

+ 0 - 1
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/shopsettlement/ShopSettlementServiceImpl.java

@@ -256,7 +256,6 @@ public class ShopSettlementServiceImpl implements ShopSettlementService {
                                 .profitStatus(ORDER_SETTLEMENT.getType())
                                 .orderId(order.getId())
                                 .orderNo(order.getNo())
-                                .userId(order.getUserId())
                                 .build();
                         ptProfitLogService.createPtProfitLog(ptProfitLog);
                     }

+ 38 - 48
feifan-module-distri/feifan-module-distri-biz/src/main/resources/mapper/sharepath/SharePathMapper.xml

@@ -96,58 +96,48 @@
           AND a.sort &gt; b.sort
     </select>
 
-
-    <resultMap id="TreeNodeMap" type="cn.newfeifan.mall.module.distri.controller.admin.sharepath.vo.TreeNode">
-        <id property="id" column="descendant"/>
-        <result property="name" column="desc_name"/>
-        <collection property="children" ofType="cn.newfeifan.mall.module.distri.controller.admin.sharepath.vo.TreeNode"
-                    column="descendant" select="selectDescendants" />
-
-    </resultMap>
-
-
-    <select id="selectDescendants"
-            resultMap="TreeNodeMap">
-
-
-        WITH RECURSIVE SubPath AS (
-            SELECT
-                descendant,
-                desc_name,
-                depth,
-                1 AS current_depth
-            FROM
-                distri_share_path
-            WHERE
-                ancestor = #{ancestor}
-              AND depth = 1
-            UNION ALL
-            SELECT
-                d.descendant,
-                d.desc_name,
-                d.depth,
-                sp.current_depth + 1
-            FROM
-                distri_share_path d
-                    JOIN
-                SubPath sp ON sp.descendant = d.ancestor
-            WHERE
-                sp.current_depth <![CDATA[<]]> #{maxDepth}
-        )
-        SELECT
-            descendant,
-            desc_name,
-            depth
-        FROM
-            SubPath
-        WHERE
-            current_depth <![CDATA[<=]]> #{maxDepth};
-
-    </select>
     <select id="selectListByVisitor"
             resultType="cn.newfeifan.mall.module.distri.dal.dataobject.sharepath.SharePathDO">
         select path.* from distri_share_path path
                     left join member_user user on user.id = path.descendant
                     where depth = 1 and ancestor = #{ancestor} and user.visitor = #{visitor} and path.deleted = 0
     </select>
+    <select id="selectListByUserId"
+            resultType="cn.newfeifan.mall.module.distri.dal.dataobject.sharepath.SharePathDO">
+        WITH RECURSIVE user_hierarchy AS (
+        -- 初始查询,获取目标用户及其直接左右区用户
+        SELECT user_id, user_name, left_child_id, right_child_id,parent_id, depth, referrer_id,phone
+        FROM distri_share_path
+        WHERE user_id = #{userId}
+        UNION ALL
+        -- 递归部分,获取左右区用户的下级用户,处理NULL值
+        SELECT u.user_id, u.user_name, u.left_child_id, u.right_child_id, u.parent_id, u.depth, u.referrer_id, u.phone
+        FROM distri_share_path u
+        INNER JOIN user_hierarchy uh ON (
+        (u.user_id = uh.left_child_id AND uh.left_child_id IS NOT NULL) OR
+        (u.user_id = uh.right_child_id AND uh.right_child_id IS NOT NULL)
+        ) where u.depth &lt;= #{maxDepth}
+        )
+        SELECT * FROM user_hierarchy;
+    </select>
+    <select id="selectListPage"
+            resultType="cn.newfeifan.mall.module.distri.dal.dataobject.sharepath.SharePathDO">
+        WITH RECURSIVE user_hierarchy AS (
+        -- 初始查询,获取目标用户及其直接左右区用户
+        SELECT user_id, user_name, left_child_id, right_child_id,parent_id, depth, referrer_id,phone
+        FROM distri_share_path
+        WHERE user_id = #{userId}
+        UNION ALL
+        -- 递归部分,获取左右区用户的下级用户,处理NULL值
+        SELECT u.user_id, u.user_name, u.left_child_id, u.right_child_id, u.parent_id, u.depth, u.referrer_id, u.phone
+        FROM distri_share_path u
+        INNER JOIN user_hierarchy uh ON (
+        (u.user_id = uh.left_child_id AND uh.left_child_id IS NOT NULL) OR
+        (u.user_id = uh.right_child_id AND uh.right_child_id IS NOT NULL)
+        )
+        )
+        SELECT * FROM user_hierarchy
+        ORDER BY depth  -- 根据深度排序,确保层次结构正确
+        LIMIT #{pageSize} OFFSET #{pageNo};
+    </select>
 </mapper>

+ 4 - 21
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spu/vo/ProductSpuSaveReqVO.java

@@ -36,6 +36,10 @@ public class ProductSpuSaveReqVO {
     @NotNull(message = "商品分类不能为空")
     private Long categoryId;
 
+    @Schema(description = "商品分区编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @NotNull(message = "商品分区不能为空")
+    private Long areaId;
+
     @Schema(description = "商品品牌编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
     private Long brandId;
 
@@ -66,16 +70,6 @@ public class ProductSpuSaveReqVO {
     @Schema(description = "物流配置模板编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "111")
     private Long deliveryTemplateId;
 
-    // ========== 营销相关字段 =========
-
-    @Schema(description = "赠送积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "111")
-    @NotNull(message = "商品赠送积分不能为空")
-    private Integer giveIntegral;
-
-    @Schema(description = "分销类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
-    @NotNull(message = "商品分销类型不能为空")
-    private Boolean subCommissionType;
-
     // ========== 统计相关字段 =========
 
     @Schema(description = "虚拟销量", example = "66")
@@ -106,20 +100,9 @@ public class ProductSpuSaveReqVO {
     @Schema(description = "商户id", example = "8240")
     private Long merchantId;
 
-    @Schema(description = "商品支付类别", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
-    @NotNull(message = "商品支付类别不能为空")
-    private Integer spuPayType;
-
     @Schema(description = "推广费, 单位: 分,值为sku中最大的推广费")
     private Integer promotionFee;
 
-    @Schema(description = "高精度价格", example = "9255")
-    private BigDecimal highPrecisionPrice;
-
-    @Schema(description = "高精度", requiredMode = Schema.RequiredMode.REQUIRED)
-    @NotNull(message = "高精度不能为空")
-    private Boolean highPrecision;
-
     @Schema(description = "商品申请id", example = "26655")
     private Long spuApplyId;
 

+ 0 - 7
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/sku/ProductSkuService.java

@@ -14,13 +14,6 @@ import java.util.List;
  */
 public interface ProductSkuService {
 
-    /**
-     * 删除商品 SKU
-     *
-     * @param id 编号
-     */
-    void deleteSku(Long id);
-
     /**
      * 获得商品 SKU 信息
      *

+ 0 - 17
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spu/ProductSpuService.java

@@ -75,14 +75,6 @@ public interface ProductSpuService {
      */
     PageResult<ProductSpuDO> getSpuPage(ProductSpuPageReqVO pageReqVO);
 
-    /**
-     * 获得商品 SPU 分页,提供给用户 App 使用
-     *
-     * @param pageReqVO 分页查询
-     * @return 商品 SPU 分页
-     */
-    PageResult<ProductSpuDO> getSpuPage(AppProductSpuPageReqVO pageReqVO);
-
     /**
      * 更新商品 SPU 库存(增量)
      *
@@ -132,15 +124,6 @@ public interface ProductSpuService {
      */
     List<ProductSpuDO> validateSpuList(Collection<Long> ids);
 
-    /**
-     * 更新商品 SPU 浏览量
-     *
-     * @param id        商品 SPU 编号
-     * @param incrCount 增加的数量
-     */
-    @Async
-    void updateBrowseCount(Long id, int incrCount);
-
     PageResult<ProductSpuRespVO> getFavoriteByUser(ProductSpuPageReqVO pageVO);
 
     /**

+ 18 - 53
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spu/ProductSpuServiceImpl.java

@@ -2,14 +2,10 @@ package cn.newfeifan.mall.module.product.service.spu;
 
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.ObjectUtil;
-import cn.newfeifan.mall.framework.common.enums.CommonStatusEnum;
 import cn.newfeifan.mall.framework.common.pojo.PageResult;
 import cn.newfeifan.mall.framework.common.util.collection.CollectionUtils;
 import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
-import cn.newfeifan.mall.module.product.controller.admin.category.vo.ProductCategoryListReqVO;
 import cn.newfeifan.mall.module.product.controller.admin.spu.vo.*;
-import cn.newfeifan.mall.module.product.controller.app.spu.vo.AppProductSpuPageReqVO;
-import cn.newfeifan.mall.module.product.dal.dataobject.category.ProductCategoryDO;
 import cn.newfeifan.mall.module.product.dal.dataobject.spu.ProductSpuDO;
 import cn.newfeifan.mall.module.product.dal.dataobject.spuapply.SpuApplyDO;
 import cn.newfeifan.mall.module.product.dal.mysql.spu.ProductSpuMapper;
@@ -108,8 +104,8 @@ public class ProductSpuServiceImpl implements ProductSpuService {
             productSkuSaveReqVO.setMerchantId(updateReqVO.getMerchantId());
 
             Integer skuPromotionFee = productSkuSaveReqVO.getPromotionFee();
-            if(skuPromotionFee>maxPromotionFee)
-                maxPromotionFee=skuPromotionFee;
+            if (skuPromotionFee > maxPromotionFee)
+                maxPromotionFee = skuPromotionFee;
         }
 
         updateObj.setPromotionFee(maxPromotionFee);
@@ -126,18 +122,12 @@ public class ProductSpuServiceImpl implements ProductSpuService {
      * @param skus 商品 SKU 数组
      */
     private void initSpuFromSkus(ProductSpuDO spu, List<ProductSkuSaveReqVO> skus) {
-        //是否是高精度商品
-        if(!spu.getHighPrecision()){
-            // sku 单价最低的商品的价格
-            spu.setPrice(getMinValue(skus, ProductSkuSaveReqVO::getPrice));
-            // sku 单价最低的商品的市场价格
-            spu.setMarketPrice(getMinValue(skus, ProductSkuSaveReqVO::getMarketPrice));
-            // sku 单价最低的商品的成本价格
-            spu.setCostPrice(getMinValue(skus, ProductSkuSaveReqVO::getCostPrice));
-        }else{
-            // sku 单价最低的商品的价格
-            spu.setHighPrecisionPrice(getMinValue(skus, ProductSkuSaveReqVO::getHighPrecisionPrice));
-        }
+        // sku 单价最低的商品的价格
+        spu.setPrice(getMinValue(skus, ProductSkuSaveReqVO::getPrice));
+        // sku 单价最低的商品的市场价格
+        spu.setMarketPrice(getMinValue(skus, ProductSkuSaveReqVO::getMarketPrice));
+        // sku 单价最低的商品的成本价格
+        spu.setCostPrice(getMinValue(skus, ProductSkuSaveReqVO::getCostPrice));
 
         // skus 库存总数
         spu.setStock(getSumValue(skus, ProductSkuSaveReqVO::getStock, Integer::sum));
@@ -183,15 +173,10 @@ public class ProductSpuServiceImpl implements ProductSpuService {
         return list;
     }
 
-    @Override
-    public void updateBrowseCount(Long id, int incrCount) {
-        productSpuMapper.updateBrowseCount(id , incrCount);
-    }
-
     @Override
     public PageResult<ProductSpuRespVO> getFavoriteByUser(ProductSpuPageReqVO reqVO) {
         List<Long> spuIds = favoriteService.getSpuByUserId(reqVO.getUserId());
-        if(spuIds == null || spuIds.isEmpty()){
+        if (spuIds == null || spuIds.isEmpty()) {
             return PageResult.empty();
         }
         PageResult<ProductSpuDO> productSpuDOPageResult = productSpuMapper.selectPage(reqVO, spuIds);
@@ -256,26 +241,6 @@ public class ProductSpuServiceImpl implements ProductSpuService {
         return productSpuMapper.selectPage(pageReqVO);
     }
 
-    @Override
-    public PageResult<ProductSpuDO> getSpuPage(AppProductSpuPageReqVO pageReqVO) {
-        // 查找时,如果查找某个分类编号,则包含它的子分类。因为顶级分类不包含商品
-        Set<Long> categoryIds = new HashSet<>();
-        if (pageReqVO.getCategoryId() != null && pageReqVO.getCategoryId() > 0) {
-            categoryIds.add(pageReqVO.getCategoryId());
-            List<ProductCategoryDO> categoryChildren = categoryService.getCategoryList(new ProductCategoryListReqVO()
-                    .setStatus(CommonStatusEnum.ENABLE.getStatus()).setParentId(pageReqVO.getCategoryId()));
-            categoryIds.addAll(convertList(categoryChildren, ProductCategoryDO::getId));
-        }
-        if (CollUtil.isNotEmpty(pageReqVO.getCategoryIds())) {
-            categoryIds.addAll(pageReqVO.getCategoryIds());
-            List<ProductCategoryDO> categoryChildren = categoryService.getCategoryList(new ProductCategoryListReqVO()
-                    .setStatus(CommonStatusEnum.ENABLE.getStatus()).setParentIds(pageReqVO.getCategoryIds()));
-            categoryIds.addAll(convertList(categoryChildren, ProductCategoryDO::getId));
-        }
-        // 分页查询
-        return productSpuMapper.selectPage(pageReqVO, categoryIds);
-    }
-
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void updateSpuStock(Map<Long, Integer> stockIncrCounts) {
@@ -298,23 +263,23 @@ public class ProductSpuServiceImpl implements ProductSpuService {
     public Map<Integer, Long> getTabsCount(ProductSpuPageReqVO pageVO) {
         Map<Integer, Long> counts = Maps.newLinkedHashMapWithExpectedSize(5);
         counts.put(ProductSpuPageReqVO.APPLY_SPU,
-                spuApplyMapper.selectCount(0,pageVO));
+                spuApplyMapper.selectCount(0, pageVO));
 
         // 查询销售中的商品数量
         counts.put(ProductSpuPageReqVO.FOR_SALE,
-                spuApplyMapper.selectCount(SpuApplyDO::getStatus, ProductSpuStatusEnum.ENABLE.getStatus(),pageVO));
+                spuApplyMapper.selectCount(SpuApplyDO::getStatus, ProductSpuStatusEnum.ENABLE.getStatus(), pageVO));
         // 查询仓库中的商品数量
         counts.put(ProductSpuPageReqVO.IN_WAREHOUSE,
-                spuApplyMapper.selectCount(SpuApplyDO::getStatus, ProductSpuStatusEnum.DISABLE.getStatus(),pageVO));
+                spuApplyMapper.selectCount(SpuApplyDO::getStatus, ProductSpuStatusEnum.DISABLE.getStatus(), pageVO));
         // 查询售空的商品数量
         counts.put(ProductSpuPageReqVO.SOLD_OUT,
-                spuApplyMapper.selectCount(SpuApplyDO::getStock, 0,pageVO));
+                spuApplyMapper.selectCount(SpuApplyDO::getStock, 0, pageVO));
         // 查询触发警戒库存的商品数量
         counts.put(ProductSpuPageReqVO.ALERT_STOCK,
                 spuApplyMapper.selectCount(pageVO));
         // 查询回收站中的商品数量
         counts.put(ProductSpuPageReqVO.RECYCLE_BIN,
-                spuApplyMapper.selectCount(SpuApplyDO::getStatus, ProductSpuStatusEnum.RECYCLE.getStatus(),pageVO));
+                spuApplyMapper.selectCount(SpuApplyDO::getStatus, ProductSpuStatusEnum.RECYCLE.getStatus(), pageVO));
         return counts;
     }
 
@@ -324,19 +289,19 @@ public class ProductSpuServiceImpl implements ProductSpuService {
 
         // 查询销售中的商品数量
         counts.put(ProductSpuPageReqVO.FOR_SALE,
-                productSpuMapper.selectCountByMerId(merId,ProductSpuDO::getStatus, ProductSpuStatusEnum.ENABLE.getStatus()));
+                productSpuMapper.selectCountByMerId(merId, ProductSpuDO::getStatus, ProductSpuStatusEnum.ENABLE.getStatus()));
         // 查询仓库中的商品数量
         counts.put(ProductSpuPageReqVO.IN_WAREHOUSE,
-                productSpuMapper.selectCountByMerId(merId,ProductSpuDO::getStatus, ProductSpuStatusEnum.DISABLE.getStatus()));
+                productSpuMapper.selectCountByMerId(merId, ProductSpuDO::getStatus, ProductSpuStatusEnum.DISABLE.getStatus()));
         // 查询售空的商品数量
         counts.put(ProductSpuPageReqVO.SOLD_OUT,
-                productSpuMapper.selectCountByMerId(merId,ProductSpuDO::getStock, 0));
+                productSpuMapper.selectCountByMerId(merId, ProductSpuDO::getStock, 0));
         // 查询触发警戒库存的商品数量
         counts.put(ProductSpuPageReqVO.ALERT_STOCK,
                 productSpuMapper.selectCountByMerId(merId));
         // 查询回收站中的商品数量
         counts.put(ProductSpuPageReqVO.RECYCLE_BIN,
-                productSpuMapper.selectCountByMerId(merId,ProductSpuDO::getStatus, ProductSpuStatusEnum.RECYCLE.getStatus()));
+                productSpuMapper.selectCountByMerId(merId, ProductSpuDO::getStatus, ProductSpuStatusEnum.RECYCLE.getStatus()));
         return counts;
     }