Quellcode durchsuchen

Merge branch 'dev/2024/0405/add-share-module'

gaohp vor 11 Monaten
Ursprung
Commit
3f93aecdb1
71 geänderte Dateien mit 3752 neuen und 95 gelöschten Zeilen
  1. 6 0
      feifan-module-distri/feifan-module-distri-api/src/main/java/cn/newfeifan/mall/module/distri/enums/ErrorCodeConstants.java
  2. 95 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integral/IntegralController.java
  3. 34 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integral/vo/IntegralPageReqVO.java
  4. 40 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integral/vo/IntegralRespVO.java
  5. 27 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integral/vo/IntegralSaveReqVO.java
  6. 95 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ordercalc/OrderCalcController.java
  7. 49 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ordercalc/vo/OrderCalcPageReqVO.java
  8. 60 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ordercalc/vo/OrderCalcRespVO.java
  9. 42 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ordercalc/vo/OrderCalcSaveReqVO.java
  10. 95 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/orderpercentage/OrderPercentageController.java
  11. 40 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/orderpercentage/vo/OrderPercentagePageReqVO.java
  12. 48 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/orderpercentage/vo/OrderPercentageRespVO.java
  13. 33 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/orderpercentage/vo/OrderPercentageSaveReqVO.java
  14. 95 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionbrothers/PartitionBrothersController.java
  15. 40 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionbrothers/vo/PartitionBrothersPageReqVO.java
  16. 48 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionbrothers/vo/PartitionBrothersRespVO.java
  17. 34 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionbrothers/vo/PartitionBrothersSaveReqVO.java
  18. 95 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionson/PartitionSonController.java
  19. 40 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionson/vo/PartitionSonPageReqVO.java
  20. 48 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionson/vo/PartitionSonRespVO.java
  21. 34 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionson/vo/PartitionSonSaveReqVO.java
  22. 9 6
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/sharepath/vo/SharePathPageReqVO.java
  23. 16 12
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/sharepath/vo/SharePathRespVO.java
  24. 8 5
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/sharepath/vo/SharePathSaveReqVO.java
  25. 3 3
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/socialstatus/vo/SocialStatusPageReqVO.java
  26. 4 4
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/socialstatus/vo/SocialStatusRespVO.java
  27. 2 2
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/socialstatus/vo/SocialStatusSaveReqVO.java
  28. 15 12
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/user/vo/UserPageReqVO.java
  29. 23 19
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/user/vo/UserRespVO.java
  30. 17 10
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/user/vo/UserSaveReqVO.java
  31. 47 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/integral/IntegralDO.java
  32. 67 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/ordercalc/OrderCalcDO.java
  33. 55 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/orderpercentage/OrderPercentageDO.java
  34. 55 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/partitionbrothers/PartitionBrothersDO.java
  35. 55 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/partitionson/PartitionSonDO.java
  36. 9 5
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/sharepath/SharePathDO.java
  37. 2 2
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/socialstatus/SocialStatusDO.java
  38. 13 9
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/user/UserDO.java
  39. 30 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/integral/IntegralMapper.java
  40. 35 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/ordercalc/OrderCalcMapper.java
  41. 32 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/orderpercentage/OrderPercentageMapper.java
  42. 32 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/partitionbrothers/PartitionBrothersMapper.java
  43. 32 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/partitionson/PartitionSonMapper.java
  44. 3 2
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/sharepath/SharePathMapper.java
  45. 1 1
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/socialstatus/SocialStatusMapper.java
  46. 6 3
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/user/UserMapper.java
  47. 55 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integral/IntegralService.java
  48. 74 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integral/IntegralServiceImpl.java
  49. 55 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/ordercalc/OrderCalcService.java
  50. 74 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/ordercalc/OrderCalcServiceImpl.java
  51. 55 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/orderpercentage/OrderPercentageService.java
  52. 74 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/orderpercentage/OrderPercentageServiceImpl.java
  53. 55 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/partitionbrothers/PartitionBrothersService.java
  54. 74 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/partitionbrothers/PartitionBrothersServiceImpl.java
  55. 55 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/partitionson/PartitionSonService.java
  56. 74 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/partitionson/PartitionSonServiceImpl.java
  57. 12 0
      feifan-module-distri/feifan-module-distri-biz/src/main/resources/mapper/integral/IntegralMapper.xml
  58. 12 0
      feifan-module-distri/feifan-module-distri-biz/src/main/resources/mapper/ordercalc/OrderCalcMapper.xml
  59. 12 0
      feifan-module-distri/feifan-module-distri-biz/src/main/resources/mapper/orderpercentage/OrderPercentageMapper.xml
  60. 12 0
      feifan-module-distri/feifan-module-distri-biz/src/main/resources/mapper/partitionbrothers/PartitionBrothersMapper.xml
  61. 12 0
      feifan-module-distri/feifan-module-distri-biz/src/main/resources/mapper/partitionson/PartitionSonMapper.xml
  62. 20 0
      feifan-module-distri/feifan-module-distri-biz/src/main/resources/mapper/user/UserMapper.xml
  63. 146 0
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/integral/IntegralServiceImplTest.java
  64. 166 0
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/ordercalc/OrderCalcServiceImplTest.java
  65. 154 0
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/orderpercentage/OrderPercentageServiceImplTest.java
  66. 154 0
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/partitionbrothers/PartitionBrothersServiceImplTest.java
  67. 154 0
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/partitionson/PartitionSonServiceImplTest.java
  68. 146 0
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/sharepath/SharePathServiceImplTest.java
  69. 142 0
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/socialstatus/SocialStatusServiceImplTest.java
  70. 134 0
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/source/SourceServiceImplTest.java
  71. 162 0
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/user/UserServiceImplTest.java

+ 6 - 0
feifan-module-distri/feifan-module-distri-api/src/main/java/cn/newfeifan/mall/module/distri/enums/ErrorCodeConstants.java

@@ -7,6 +7,12 @@ public interface ErrorCodeConstants {
     ErrorCode SHARE_PATH_NOT_EXISTS = new ErrorCode(1_002_030_000 , "分销路径不存在");
     ErrorCode SOCIAL_STATUS_NOT_EXISTS = new ErrorCode(1_002_030_001, "身价不存在");
     ErrorCode SOURCE_NOT_EXISTS = new ErrorCode(1_002_030_002, "分销来源不存在");
+    ErrorCode INTEGRAL_NOT_EXISTS = new ErrorCode(1_002_030_002, "积分表不存在");
+    ErrorCode ORDER_CALC_NOT_EXISTS = new ErrorCode(1_002_030_002, "计算不存在");
+    ErrorCode ORDER_PERCENTAGE_NOT_EXISTS = new ErrorCode(1_002_030_002, "订单计算不存在");
+    ErrorCode PARTITION_BROTHERS_NOT_EXISTS = new ErrorCode(1_002_030_002, "兄弟分区不存在");
+    ErrorCode PARTITION_SON_NOT_EXISTS = new ErrorCode(1_002_030_002, "儿子分区不存在");
     ErrorCode USER_NOT_EXISTS = new ErrorCode(1_002_030_003, "分销用户不存在");
+    ErrorCode IS_EXISTS = new ErrorCode(1_002_030_003, "当前推销人已经存在上级");
 
 }

+ 95 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integral/IntegralController.java

@@ -0,0 +1,95 @@
+package cn.newfeifan.mall.module.distri.controller.admin.integral;
+
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.constraints.*;
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.CommonResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
+
+import cn.newfeifan.mall.framework.excel.core.util.ExcelUtils;
+
+import cn.newfeifan.mall.framework.operatelog.core.annotations.OperateLog;
+import static cn.newfeifan.mall.framework.operatelog.core.enums.OperateTypeEnum.*;
+
+import cn.newfeifan.mall.module.distri.controller.admin.integral.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.integral.IntegralDO;
+import cn.newfeifan.mall.module.distri.service.integral.IntegralService;
+
+@Tag(name = "管理后台 - 推荐用户积分")
+@RestController
+@RequestMapping("/distri/integral")
+@Validated
+public class IntegralController {
+
+    @Resource
+    private IntegralService integralService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建推荐用户积分")
+    @PreAuthorize("@ss.hasPermission('distri:integral:create')")
+    public CommonResult<Long> createIntegral(@Valid @RequestBody IntegralSaveReqVO createReqVO) {
+        return success(integralService.createIntegral(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新推荐用户积分")
+    @PreAuthorize("@ss.hasPermission('distri:integral:update')")
+    public CommonResult<Boolean> updateIntegral(@Valid @RequestBody IntegralSaveReqVO updateReqVO) {
+        integralService.updateIntegral(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除推荐用户积分")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('distri:integral:delete')")
+    public CommonResult<Boolean> deleteIntegral(@RequestParam("id") Long id) {
+        integralService.deleteIntegral(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得推荐用户积分")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('distri:integral:query')")
+    public CommonResult<IntegralRespVO> getIntegral(@RequestParam("id") Long id) {
+        IntegralDO integral = integralService.getIntegral(id);
+        return success(BeanUtils.toBean(integral, IntegralRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得推荐用户积分分页")
+    @PreAuthorize("@ss.hasPermission('distri:integral:query')")
+    public CommonResult<PageResult<IntegralRespVO>> getIntegralPage(@Valid IntegralPageReqVO pageReqVO) {
+        PageResult<IntegralDO> pageResult = integralService.getIntegralPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, IntegralRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出推荐用户积分 Excel")
+    @PreAuthorize("@ss.hasPermission('distri:integral:export')")
+    @OperateLog(type = EXPORT)
+    public void exportIntegralExcel(@Valid IntegralPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<IntegralDO> list = integralService.getIntegralPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "推荐用户积分.xls", "数据", IntegralRespVO.class,
+                        BeanUtils.toBean(list, IntegralRespVO.class));
+    }
+
+}

+ 34 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integral/vo/IntegralPageReqVO.java

@@ -0,0 +1,34 @@
+package cn.newfeifan.mall.module.distri.controller.admin.integral.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 推荐用户积分分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class IntegralPageReqVO extends PageParam {
+
+    @Schema(description = "用户ID", example = "19778")
+    private Long userId;
+
+    @Schema(description = "当前积分")
+    private Integer currentQuota;
+
+    @Schema(description = "冻结积分")
+    private Integer freezeQuota;
+
+    @Schema(description = "用户类型", example = "17348")
+    private Long categoryId;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 40 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integral/vo/IntegralRespVO.java

@@ -0,0 +1,40 @@
+package cn.newfeifan.mall.module.distri.controller.admin.integral.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import java.util.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 推荐用户积分 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class IntegralRespVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "19201")
+    @ExcelProperty("用户编号")
+    private Long id;
+
+    @Schema(description = "用户ID", example = "19778")
+    @ExcelProperty("用户ID")
+    private Long userId;
+
+    @Schema(description = "当前积分")
+    @ExcelProperty("当前积分")
+    private Integer currentQuota;
+
+    @Schema(description = "冻结积分")
+    @ExcelProperty("冻结积分")
+    private Integer freezeQuota;
+
+    @Schema(description = "用户类型", example = "17348")
+    @ExcelProperty("用户类型")
+    private Long categoryId;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 27 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integral/vo/IntegralSaveReqVO.java

@@ -0,0 +1,27 @@
+package cn.newfeifan.mall.module.distri.controller.admin.integral.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 推荐用户积分新增/修改 Request VO")
+@Data
+public class IntegralSaveReqVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "19201")
+    private Long id;
+
+    @Schema(description = "用户ID", example = "19778")
+    private Long userId;
+
+    @Schema(description = "当前积分")
+    private Integer currentQuota;
+
+    @Schema(description = "冻结积分")
+    private Integer freezeQuota;
+
+    @Schema(description = "用户类型", example = "17348")
+    private Long categoryId;
+
+}

+ 95 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ordercalc/OrderCalcController.java

@@ -0,0 +1,95 @@
+package cn.newfeifan.mall.module.distri.controller.admin.ordercalc;
+
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.constraints.*;
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.CommonResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
+
+import cn.newfeifan.mall.framework.excel.core.util.ExcelUtils;
+
+import cn.newfeifan.mall.framework.operatelog.core.annotations.OperateLog;
+import static cn.newfeifan.mall.framework.operatelog.core.enums.OperateTypeEnum.*;
+
+import cn.newfeifan.mall.module.distri.controller.admin.ordercalc.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.ordercalc.OrderCalcDO;
+import cn.newfeifan.mall.module.distri.service.ordercalc.OrderCalcService;
+
+@Tag(name = "管理后台 - 订单产生数据计算")
+@RestController
+@RequestMapping("/distri/order-calc")
+@Validated
+public class OrderCalcController {
+
+    @Resource
+    private OrderCalcService orderCalcService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建订单产生数据计算")
+    @PreAuthorize("@ss.hasPermission('distri:order-calc:create')")
+    public CommonResult<Long> createOrderCalc(@Valid @RequestBody OrderCalcSaveReqVO createReqVO) {
+        return success(orderCalcService.createOrderCalc(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新订单产生数据计算")
+    @PreAuthorize("@ss.hasPermission('distri:order-calc:update')")
+    public CommonResult<Boolean> updateOrderCalc(@Valid @RequestBody OrderCalcSaveReqVO updateReqVO) {
+        orderCalcService.updateOrderCalc(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除订单产生数据计算")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('distri:order-calc:delete')")
+    public CommonResult<Boolean> deleteOrderCalc(@RequestParam("id") Long id) {
+        orderCalcService.deleteOrderCalc(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得订单产生数据计算")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('distri:order-calc:query')")
+    public CommonResult<OrderCalcRespVO> getOrderCalc(@RequestParam("id") Long id) {
+        OrderCalcDO orderCalc = orderCalcService.getOrderCalc(id);
+        return success(BeanUtils.toBean(orderCalc, OrderCalcRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得订单产生数据计算分页")
+    @PreAuthorize("@ss.hasPermission('distri:order-calc:query')")
+    public CommonResult<PageResult<OrderCalcRespVO>> getOrderCalcPage(@Valid OrderCalcPageReqVO pageReqVO) {
+        PageResult<OrderCalcDO> pageResult = orderCalcService.getOrderCalcPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, OrderCalcRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出订单产生数据计算 Excel")
+    @PreAuthorize("@ss.hasPermission('distri:order-calc:export')")
+    @OperateLog(type = EXPORT)
+    public void exportOrderCalcExcel(@Valid OrderCalcPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<OrderCalcDO> list = orderCalcService.getOrderCalcPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "订单产生数据计算.xls", "数据", OrderCalcRespVO.class,
+                        BeanUtils.toBean(list, OrderCalcRespVO.class));
+    }
+
+}

+ 49 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ordercalc/vo/OrderCalcPageReqVO.java

@@ -0,0 +1,49 @@
+package cn.newfeifan.mall.module.distri.controller.admin.ordercalc.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 订单产生数据计算分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class OrderCalcPageReqVO extends PageParam {
+
+    @Schema(description = "订单编号")
+    private String orderNo;
+
+    @Schema(description = "用户ID", example = "28565")
+    private Long userId;
+
+    @Schema(description = "售价", example = "10413")
+    private Integer price;
+
+    @Schema(description = "成本")
+    private Integer cost;
+
+    @Schema(description = "毛利 = 成本 * 0.38... (推广费用)")
+    private Integer grossProfit;
+
+    @Schema(description = "推广-用户额度")
+    private Integer grossProfitUserQuota;
+
+    @Schema(description = "推广-推荐人额度")
+    private Integer grossProfitAncestorQuota;
+
+    @Schema(description = "推广-合赢奖额度(浮动)")
+    private Integer grossProfitBonusQuota;
+
+    @Schema(description = "推广-平台分成额度(浮动)")
+    private Integer grossProfitPlatformQuota;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 60 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ordercalc/vo/OrderCalcRespVO.java

@@ -0,0 +1,60 @@
+package cn.newfeifan.mall.module.distri.controller.admin.ordercalc.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import java.util.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 订单产生数据计算 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class OrderCalcRespVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4925")
+    @ExcelProperty("用户编号")
+    private Long id;
+
+    @Schema(description = "订单编号")
+    @ExcelProperty("订单编号")
+    private String orderNo;
+
+    @Schema(description = "用户ID", example = "28565")
+    @ExcelProperty("用户ID")
+    private Long userId;
+
+    @Schema(description = "售价", example = "10413")
+    @ExcelProperty("售价")
+    private Integer price;
+
+    @Schema(description = "成本")
+    @ExcelProperty("成本")
+    private Integer cost;
+
+    @Schema(description = "毛利 = 成本 * 0.38... (推广费用)")
+    @ExcelProperty("毛利 = 成本 * 0.38... (推广费用)")
+    private Integer grossProfit;
+
+    @Schema(description = "推广-用户额度")
+    @ExcelProperty("推广-用户额度")
+    private Integer grossProfitUserQuota;
+
+    @Schema(description = "推广-推荐人额度")
+    @ExcelProperty("推广-推荐人额度")
+    private Integer grossProfitAncestorQuota;
+
+    @Schema(description = "推广-合赢奖额度(浮动)")
+    @ExcelProperty("推广-合赢奖额度(浮动)")
+    private Integer grossProfitBonusQuota;
+
+    @Schema(description = "推广-平台分成额度(浮动)")
+    @ExcelProperty("推广-平台分成额度(浮动)")
+    private Integer grossProfitPlatformQuota;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 42 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ordercalc/vo/OrderCalcSaveReqVO.java

@@ -0,0 +1,42 @@
+package cn.newfeifan.mall.module.distri.controller.admin.ordercalc.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 订单产生数据计算新增/修改 Request VO")
+@Data
+public class OrderCalcSaveReqVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4925")
+    private Long id;
+
+    @Schema(description = "订单编号")
+    private String orderNo;
+
+    @Schema(description = "用户ID", example = "28565")
+    private Long userId;
+
+    @Schema(description = "售价", example = "10413")
+    private Integer price;
+
+    @Schema(description = "成本")
+    private Integer cost;
+
+    @Schema(description = "毛利 = 成本 * 0.38... (推广费用)")
+    private Integer grossProfit;
+
+    @Schema(description = "推广-用户额度")
+    private Integer grossProfitUserQuota;
+
+    @Schema(description = "推广-推荐人额度")
+    private Integer grossProfitAncestorQuota;
+
+    @Schema(description = "推广-合赢奖额度(浮动)")
+    private Integer grossProfitBonusQuota;
+
+    @Schema(description = "推广-平台分成额度(浮动)")
+    private Integer grossProfitPlatformQuota;
+
+}

+ 95 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/orderpercentage/OrderPercentageController.java

@@ -0,0 +1,95 @@
+package cn.newfeifan.mall.module.distri.controller.admin.orderpercentage;
+
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.constraints.*;
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.CommonResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
+
+import cn.newfeifan.mall.framework.excel.core.util.ExcelUtils;
+
+import cn.newfeifan.mall.framework.operatelog.core.annotations.OperateLog;
+import static cn.newfeifan.mall.framework.operatelog.core.enums.OperateTypeEnum.*;
+
+import cn.newfeifan.mall.module.distri.controller.admin.orderpercentage.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.orderpercentage.OrderPercentageDO;
+import cn.newfeifan.mall.module.distri.service.orderpercentage.OrderPercentageService;
+
+@Tag(name = "管理后台 - 积分相关计算浮动百分比设置")
+@RestController
+@RequestMapping("/distri/order-percentage")
+@Validated
+public class OrderPercentageController {
+
+    @Resource
+    private OrderPercentageService orderPercentageService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建积分相关计算浮动百分比设置")
+    @PreAuthorize("@ss.hasPermission('distri:order-percentage:create')")
+    public CommonResult<Long> createOrderPercentage(@Valid @RequestBody OrderPercentageSaveReqVO createReqVO) {
+        return success(orderPercentageService.createOrderPercentage(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新积分相关计算浮动百分比设置")
+    @PreAuthorize("@ss.hasPermission('distri:order-percentage:update')")
+    public CommonResult<Boolean> updateOrderPercentage(@Valid @RequestBody OrderPercentageSaveReqVO updateReqVO) {
+        orderPercentageService.updateOrderPercentage(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除积分相关计算浮动百分比设置")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('distri:order-percentage:delete')")
+    public CommonResult<Boolean> deleteOrderPercentage(@RequestParam("id") Long id) {
+        orderPercentageService.deleteOrderPercentage(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得积分相关计算浮动百分比设置")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('distri:order-percentage:query')")
+    public CommonResult<OrderPercentageRespVO> getOrderPercentage(@RequestParam("id") Long id) {
+        OrderPercentageDO orderPercentage = orderPercentageService.getOrderPercentage(id);
+        return success(BeanUtils.toBean(orderPercentage, OrderPercentageRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得积分相关计算浮动百分比设置分页")
+    @PreAuthorize("@ss.hasPermission('distri:order-percentage:query')")
+    public CommonResult<PageResult<OrderPercentageRespVO>> getOrderPercentagePage(@Valid OrderPercentagePageReqVO pageReqVO) {
+        PageResult<OrderPercentageDO> pageResult = orderPercentageService.getOrderPercentagePage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, OrderPercentageRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出积分相关计算浮动百分比设置 Excel")
+    @PreAuthorize("@ss.hasPermission('distri:order-percentage:export')")
+    @OperateLog(type = EXPORT)
+    public void exportOrderPercentageExcel(@Valid OrderPercentagePageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<OrderPercentageDO> list = orderPercentageService.getOrderPercentagePage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "积分相关计算浮动百分比设置.xls", "数据", OrderPercentageRespVO.class,
+                        BeanUtils.toBean(list, OrderPercentageRespVO.class));
+    }
+
+}

+ 40 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/orderpercentage/vo/OrderPercentagePageReqVO.java

@@ -0,0 +1,40 @@
+package cn.newfeifan.mall.module.distri.controller.admin.orderpercentage.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 积分相关计算浮动百分比设置分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class OrderPercentagePageReqVO extends PageParam {
+
+    @Schema(description = "毛利 = 成本 * 0.38... (推广费用)")
+    private Integer grossProfitPerc;
+
+    @Schema(description = "推广-用户额度 百分比")
+    private Integer grossProfitUserQuotaPerc;
+
+    @Schema(description = "推广-推荐人额度 百分比")
+    private Integer grossProfitAncestorQuotaPerc;
+
+    @Schema(description = "推广-合赢奖额度(浮动) 百分比")
+    private Integer grossProfitBonusQuotaPerc;
+
+    @Schema(description = "推广-平台分成额度(浮动) 百分比")
+    private Integer grossProfitPlatformQuotaPerc;
+
+    @Schema(description = "分成百分比")
+    private Integer divideIntoPerc;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 48 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/orderpercentage/vo/OrderPercentageRespVO.java

@@ -0,0 +1,48 @@
+package cn.newfeifan.mall.module.distri.controller.admin.orderpercentage.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import java.util.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 积分相关计算浮动百分比设置 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class OrderPercentageRespVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2203")
+    @ExcelProperty("用户编号")
+    private Long id;
+
+    @Schema(description = "毛利 = 成本 * 0.38... (推广费用)")
+    @ExcelProperty("毛利 = 成本 * 0.38... (推广费用)")
+    private Integer grossProfitPerc;
+
+    @Schema(description = "推广-用户额度 百分比")
+    @ExcelProperty("推广-用户额度 百分比")
+    private Integer grossProfitUserQuotaPerc;
+
+    @Schema(description = "推广-推荐人额度 百分比")
+    @ExcelProperty("推广-推荐人额度 百分比")
+    private Integer grossProfitAncestorQuotaPerc;
+
+    @Schema(description = "推广-合赢奖额度(浮动) 百分比")
+    @ExcelProperty("推广-合赢奖额度(浮动) 百分比")
+    private Integer grossProfitBonusQuotaPerc;
+
+    @Schema(description = "推广-平台分成额度(浮动) 百分比")
+    @ExcelProperty("推广-平台分成额度(浮动) 百分比")
+    private Integer grossProfitPlatformQuotaPerc;
+
+    @Schema(description = "分成百分比")
+    @ExcelProperty("分成百分比")
+    private Integer divideIntoPerc;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 33 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/orderpercentage/vo/OrderPercentageSaveReqVO.java

@@ -0,0 +1,33 @@
+package cn.newfeifan.mall.module.distri.controller.admin.orderpercentage.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 积分相关计算浮动百分比设置新增/修改 Request VO")
+@Data
+public class OrderPercentageSaveReqVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2203")
+    private Long id;
+
+    @Schema(description = "毛利 = 成本 * 0.38... (推广费用)")
+    private Integer grossProfitPerc;
+
+    @Schema(description = "推广-用户额度 百分比")
+    private Integer grossProfitUserQuotaPerc;
+
+    @Schema(description = "推广-推荐人额度 百分比")
+    private Integer grossProfitAncestorQuotaPerc;
+
+    @Schema(description = "推广-合赢奖额度(浮动) 百分比")
+    private Integer grossProfitBonusQuotaPerc;
+
+    @Schema(description = "推广-平台分成额度(浮动) 百分比")
+    private Integer grossProfitPlatformQuotaPerc;
+
+    @Schema(description = "分成百分比")
+    private Integer divideIntoPerc;
+
+}

+ 95 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionbrothers/PartitionBrothersController.java

@@ -0,0 +1,95 @@
+package cn.newfeifan.mall.module.distri.controller.admin.partitionbrothers;
+
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.constraints.*;
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.CommonResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
+
+import cn.newfeifan.mall.framework.excel.core.util.ExcelUtils;
+
+import cn.newfeifan.mall.framework.operatelog.core.annotations.OperateLog;
+import static cn.newfeifan.mall.framework.operatelog.core.enums.OperateTypeEnum.*;
+
+import cn.newfeifan.mall.module.distri.controller.admin.partitionbrothers.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.partitionbrothers.PartitionBrothersDO;
+import cn.newfeifan.mall.module.distri.service.partitionbrothers.PartitionBrothersService;
+
+@Tag(name = "管理后台 - 兄弟分区")
+@RestController
+@RequestMapping("/distri/partition-brothers")
+@Validated
+public class PartitionBrothersController {
+
+    @Resource
+    private PartitionBrothersService partitionBrothersService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建兄弟分区")
+    @PreAuthorize("@ss.hasPermission('distri:partition-brothers:create')")
+    public CommonResult<Long> createPartitionBrothers(@Valid @RequestBody PartitionBrothersSaveReqVO createReqVO) {
+        return success(partitionBrothersService.createPartitionBrothers(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新兄弟分区")
+    @PreAuthorize("@ss.hasPermission('distri:partition-brothers:update')")
+    public CommonResult<Boolean> updatePartitionBrothers(@Valid @RequestBody PartitionBrothersSaveReqVO updateReqVO) {
+        partitionBrothersService.updatePartitionBrothers(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除兄弟分区")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('distri:partition-brothers:delete')")
+    public CommonResult<Boolean> deletePartitionBrothers(@RequestParam("id") Long id) {
+        partitionBrothersService.deletePartitionBrothers(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得兄弟分区")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('distri:partition-brothers:query')")
+    public CommonResult<PartitionBrothersRespVO> getPartitionBrothers(@RequestParam("id") Long id) {
+        PartitionBrothersDO partitionBrothers = partitionBrothersService.getPartitionBrothers(id);
+        return success(BeanUtils.toBean(partitionBrothers, PartitionBrothersRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得兄弟分区分页")
+    @PreAuthorize("@ss.hasPermission('distri:partition-brothers:query')")
+    public CommonResult<PageResult<PartitionBrothersRespVO>> getPartitionBrothersPage(@Valid PartitionBrothersPageReqVO pageReqVO) {
+        PageResult<PartitionBrothersDO> pageResult = partitionBrothersService.getPartitionBrothersPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, PartitionBrothersRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出兄弟分区 Excel")
+    @PreAuthorize("@ss.hasPermission('distri:partition-brothers:export')")
+    @OperateLog(type = EXPORT)
+    public void exportPartitionBrothersExcel(@Valid PartitionBrothersPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<PartitionBrothersDO> list = partitionBrothersService.getPartitionBrothersPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "兄弟分区.xls", "数据", PartitionBrothersRespVO.class,
+                        BeanUtils.toBean(list, PartitionBrothersRespVO.class));
+    }
+
+}

+ 40 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionbrothers/vo/PartitionBrothersPageReqVO.java

@@ -0,0 +1,40 @@
+package cn.newfeifan.mall.module.distri.controller.admin.partitionbrothers.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 兄弟分区分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class PartitionBrothersPageReqVO extends PageParam {
+
+    @Schema(description = "用户ID", example = "11539")
+    private Long userId;
+
+    @Schema(description = "分区编号")
+    private String partNo;
+
+    @Schema(description = "业绩", example = "24491")
+    private Integer price;
+
+    @Schema(description = "是否碰撞 0为未碰撞 1为已碰撞")
+    private Integer hasHit;
+
+    @Schema(description = "碰撞后额度")
+    private Integer afterHitQuota;
+
+    @Schema(description = "是否是大区 0为小区 1为大区")
+    private Integer size;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 48 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionbrothers/vo/PartitionBrothersRespVO.java

@@ -0,0 +1,48 @@
+package cn.newfeifan.mall.module.distri.controller.admin.partitionbrothers.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import java.util.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 兄弟分区 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class PartitionBrothersRespVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "5562")
+    @ExcelProperty("用户编号")
+    private Long id;
+
+    @Schema(description = "用户ID", example = "11539")
+    @ExcelProperty("用户ID")
+    private Long userId;
+
+    @Schema(description = "分区编号")
+    @ExcelProperty("分区编号")
+    private String partNo;
+
+    @Schema(description = "业绩", example = "24491")
+    @ExcelProperty("业绩")
+    private Integer price;
+
+    @Schema(description = "是否碰撞 0为未碰撞 1为已碰撞", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("是否碰撞 0为未碰撞 1为已碰撞")
+    private Integer hasHit;
+
+    @Schema(description = "碰撞后额度")
+    @ExcelProperty("碰撞后额度")
+    private Integer afterHitQuota;
+
+    @Schema(description = "是否是大区 0为小区 1为大区")
+    @ExcelProperty("是否是大区 0为小区 1为大区")
+    private Integer size;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 34 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionbrothers/vo/PartitionBrothersSaveReqVO.java

@@ -0,0 +1,34 @@
+package cn.newfeifan.mall.module.distri.controller.admin.partitionbrothers.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 兄弟分区新增/修改 Request VO")
+@Data
+public class PartitionBrothersSaveReqVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "5562")
+    private Long id;
+
+    @Schema(description = "用户ID", example = "11539")
+    private Long userId;
+
+    @Schema(description = "分区编号")
+    private String partNo;
+
+    @Schema(description = "业绩", example = "24491")
+    private Integer price;
+
+    @Schema(description = "是否碰撞 0为未碰撞 1为已碰撞", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "是否碰撞 0为未碰撞 1为已碰撞不能为空")
+    private Integer hasHit;
+
+    @Schema(description = "碰撞后额度")
+    private Integer afterHitQuota;
+
+    @Schema(description = "是否是大区 0为小区 1为大区")
+    private Integer size;
+
+}

+ 95 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionson/PartitionSonController.java

@@ -0,0 +1,95 @@
+package cn.newfeifan.mall.module.distri.controller.admin.partitionson;
+
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.constraints.*;
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.CommonResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
+
+import cn.newfeifan.mall.framework.excel.core.util.ExcelUtils;
+
+import cn.newfeifan.mall.framework.operatelog.core.annotations.OperateLog;
+import static cn.newfeifan.mall.framework.operatelog.core.enums.OperateTypeEnum.*;
+
+import cn.newfeifan.mall.module.distri.controller.admin.partitionson.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.partitionson.PartitionSonDO;
+import cn.newfeifan.mall.module.distri.service.partitionson.PartitionSonService;
+
+@Tag(name = "管理后台 - 后代分区")
+@RestController
+@RequestMapping("/distri/partition-son")
+@Validated
+public class PartitionSonController {
+
+    @Resource
+    private PartitionSonService partitionSonService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建后代分区")
+    @PreAuthorize("@ss.hasPermission('distri:partition-son:create')")
+    public CommonResult<Long> createPartitionSon(@Valid @RequestBody PartitionSonSaveReqVO createReqVO) {
+        return success(partitionSonService.createPartitionSon(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新后代分区")
+    @PreAuthorize("@ss.hasPermission('distri:partition-son:update')")
+    public CommonResult<Boolean> updatePartitionSon(@Valid @RequestBody PartitionSonSaveReqVO updateReqVO) {
+        partitionSonService.updatePartitionSon(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除后代分区")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('distri:partition-son:delete')")
+    public CommonResult<Boolean> deletePartitionSon(@RequestParam("id") Long id) {
+        partitionSonService.deletePartitionSon(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得后代分区")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('distri:partition-son:query')")
+    public CommonResult<PartitionSonRespVO> getPartitionSon(@RequestParam("id") Long id) {
+        PartitionSonDO partitionSon = partitionSonService.getPartitionSon(id);
+        return success(BeanUtils.toBean(partitionSon, PartitionSonRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得后代分区分页")
+    @PreAuthorize("@ss.hasPermission('distri:partition-son:query')")
+    public CommonResult<PageResult<PartitionSonRespVO>> getPartitionSonPage(@Valid PartitionSonPageReqVO pageReqVO) {
+        PageResult<PartitionSonDO> pageResult = partitionSonService.getPartitionSonPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, PartitionSonRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出后代分区 Excel")
+    @PreAuthorize("@ss.hasPermission('distri:partition-son:export')")
+    @OperateLog(type = EXPORT)
+    public void exportPartitionSonExcel(@Valid PartitionSonPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<PartitionSonDO> list = partitionSonService.getPartitionSonPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "后代分区.xls", "数据", PartitionSonRespVO.class,
+                        BeanUtils.toBean(list, PartitionSonRespVO.class));
+    }
+
+}

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

@@ -0,0 +1,40 @@
+package cn.newfeifan.mall.module.distri.controller.admin.partitionson.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 后代分区分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class PartitionSonPageReqVO extends PageParam {
+
+    @Schema(description = "用户ID", example = "19323")
+    private Long userId;
+
+    @Schema(description = "分区编号")
+    private String partNo;
+
+    @Schema(description = "业绩", example = "5813")
+    private Integer price;
+
+    @Schema(description = "是否碰撞 0为未碰撞 1为已碰撞")
+    private Integer hasHit;
+
+    @Schema(description = "碰撞后额度")
+    private Integer afterHitQuota;
+
+    @Schema(description = "是否是大区 0为小区 1为大区")
+    private Integer size;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 48 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionson/vo/PartitionSonRespVO.java

@@ -0,0 +1,48 @@
+package cn.newfeifan.mall.module.distri.controller.admin.partitionson.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import java.util.*;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 后代分区 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class PartitionSonRespVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12758")
+    @ExcelProperty("用户编号")
+    private Long id;
+
+    @Schema(description = "用户ID", example = "19323")
+    @ExcelProperty("用户ID")
+    private Long userId;
+
+    @Schema(description = "分区编号")
+    @ExcelProperty("分区编号")
+    private String partNo;
+
+    @Schema(description = "业绩", example = "5813")
+    @ExcelProperty("业绩")
+    private Integer price;
+
+    @Schema(description = "是否碰撞 0为未碰撞 1为已碰撞", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("是否碰撞 0为未碰撞 1为已碰撞")
+    private Integer hasHit;
+
+    @Schema(description = "碰撞后额度")
+    @ExcelProperty("碰撞后额度")
+    private Integer afterHitQuota;
+
+    @Schema(description = "是否是大区 0为小区 1为大区")
+    @ExcelProperty("是否是大区 0为小区 1为大区")
+    private Integer size;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 34 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionson/vo/PartitionSonSaveReqVO.java

@@ -0,0 +1,34 @@
+package cn.newfeifan.mall.module.distri.controller.admin.partitionson.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 后代分区新增/修改 Request VO")
+@Data
+public class PartitionSonSaveReqVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12758")
+    private Long id;
+
+    @Schema(description = "用户ID", example = "19323")
+    private Long userId;
+
+    @Schema(description = "分区编号")
+    private String partNo;
+
+    @Schema(description = "业绩", example = "5813")
+    private Integer price;
+
+    @Schema(description = "是否碰撞 0为未碰撞 1为已碰撞", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "是否碰撞 0为未碰撞 1为已碰撞不能为空")
+    private Integer hasHit;
+
+    @Schema(description = "碰撞后额度")
+    private Integer afterHitQuota;
+
+    @Schema(description = "是否是大区 0为小区 1为大区")
+    private Integer size;
+
+}

+ 9 - 6
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/sharepath/vo/SharePathPageReqVO.java

@@ -15,12 +15,6 @@ import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR
 @ToString(callSuper = true)
 public class SharePathPageReqVO extends PageParam {
 
-    @Schema(description = "父亲id")
-    private Long ancestor;
-
-    @Schema(description = "推销人员")
-    private Long descendant;
-
     @Schema(description = "层级")
     private Integer depth;
 
@@ -28,4 +22,13 @@ public class SharePathPageReqVO extends PageParam {
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
 
+    @Schema(description = "推荐人")
+    private Long ancestor;
+
+    @Schema(description = "直推人")
+    private Long descendant;
+
+    @Schema(description = "顺序")
+    private Integer sort;
+
 }

+ 16 - 12
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/sharepath/vo/SharePathRespVO.java

@@ -13,18 +13,6 @@ import com.alibaba.excel.annotation.*;
 @ExcelIgnoreUnannotated
 public class SharePathRespVO {
 
-    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23345")
-    @ExcelProperty("用户编号")
-    private Long id;
-
-    @Schema(description = "父亲id")
-    @ExcelProperty("父亲id")
-    private Long ancestor;
-
-    @Schema(description = "推销人员")
-    @ExcelProperty("推销人员")
-    private Long descendant;
-
     @Schema(description = "层级")
     @ExcelProperty("层级")
     private Integer depth;
@@ -33,4 +21,20 @@ public class SharePathRespVO {
     @ExcelProperty("创建时间")
     private LocalDateTime createTime;
 
+    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12537")
+    @ExcelProperty("id")
+    private Long id;
+
+    @Schema(description = "推荐人")
+    @ExcelProperty("推荐人")
+    private Long ancestor;
+
+    @Schema(description = "直推人")
+    @ExcelProperty("直推人")
+    private Long descendant;
+
+    @Schema(description = "顺序")
+    @ExcelProperty("顺序")
+    private Integer sort;
+
 }

+ 8 - 5
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/sharepath/vo/SharePathSaveReqVO.java

@@ -9,16 +9,19 @@ import javax.validation.constraints.*;
 @Data
 public class SharePathSaveReqVO {
 
-    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23345")
+    @Schema(description = "层级")
+    private Integer depth;
+
+    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12537")
     private Long id;
 
-    @Schema(description = "父亲id")
+    @Schema(description = "推荐人")
     private Long ancestor;
 
-    @Schema(description = "推")
+    @Schema(description = "推人")
     private Long descendant;
 
-    @Schema(description = "层级")
-    private Integer depth;
+    @Schema(description = "顺序")
+    private Integer sort;
 
 }

+ 3 - 3
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/socialstatus/vo/SocialStatusPageReqVO.java

@@ -21,11 +21,11 @@ public class SocialStatusPageReqVO extends PageParam {
     @Schema(description = "身价名称", example = "芋艿")
     private String name;
 
-    @Schema(description = "升级所需看点")
-    private Long kandian;
-
     @Schema(description = "创建时间")
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
 
+    @Schema(description = "升级所需点数")
+    private Long point;
+
 }

+ 4 - 4
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/socialstatus/vo/SocialStatusRespVO.java

@@ -25,12 +25,12 @@ public class SocialStatusRespVO {
     @ExcelProperty("身价名称")
     private String name;
 
-    @Schema(description = "升级所需看点")
-    @ExcelProperty("升级所需看点")
-    private Long kandian;
-
     @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
     @ExcelProperty("创建时间")
     private LocalDateTime createTime;
 
+    @Schema(description = "升级所需点数")
+    @ExcelProperty("升级所需点数")
+    private Long point;
+
 }

+ 2 - 2
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/socialstatus/vo/SocialStatusSaveReqVO.java

@@ -19,7 +19,7 @@ public class SocialStatusSaveReqVO {
     @NotEmpty(message = "身价名称不能为空")
     private String name;
 
-    @Schema(description = "升级所需点")
-    private Long kandian;
+    @Schema(description = "升级所需点")
+    private Long point;
 
 }

+ 15 - 12
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/user/vo/UserPageReqVO.java

@@ -15,29 +15,32 @@ import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR
 @ToString(callSuper = true)
 public class UserPageReqVO extends PageParam {
 
-    @Schema(description = "分销人员ID", example = "32526")
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+    @Schema(description = "团队人员ID", example = "8034")
     private Long userId;
 
-    @Schema(description = "分销人员姓名", example = "王五")
+    @Schema(description = "团队人员姓名", example = "李四")
     private String name;
 
-    @Schema(description = "分销人员手机号码")
+    @Schema(description = "团队人员手机号码")
     private String mobile;
 
-    @Schema(description = "分销人员来源")
+    @Schema(description = "团队人员来源")
     private Integer source;
 
-    @Schema(description = "分销用户当前积分")
-    private Long integral;
+    @Schema(description = "团队用户当前积分", example = "16642")
+    private Long integralId;
 
-    @Schema(description = "分销用户当前身价", example = "1")
+    @Schema(description = "团队用户当前身价(等级)", example = "1")
     private Integer socialStatus;
 
-    @Schema(description = "分销用户当前看点")
-    private Long socialStatusKandian;
+    @Schema(description = "团队用户当前点数")
+    private Long socialStatusPoint;
 
-    @Schema(description = "创建时间")
-    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
-    private LocalDateTime[] createTime;
+    @Schema(description = "用户类型", example = "20094")
+    private Long categoryId;
 
 }

+ 23 - 19
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/user/vo/UserRespVO.java

@@ -17,36 +17,40 @@ public class UserRespVO {
     @ExcelProperty("用户编号")
     private Long id;
 
-    @Schema(description = "分销人员ID", example = "32526")
-    @ExcelProperty("分销人员ID")
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    @Schema(description = "团队人员ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8034")
+    @ExcelProperty("团队人员ID")
     private Long userId;
 
-    @Schema(description = "分销人员姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
-    @ExcelProperty("分销人员姓名")
+    @Schema(description = "团队人员姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
+    @ExcelProperty("团队人员姓名")
     private String name;
 
-    @Schema(description = "分销人员手机号码")
-    @ExcelProperty("分销人员手机号码")
+    @Schema(description = "团队人员手机号码", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("团队人员手机号码")
     private String mobile;
 
-    @Schema(description = "分销人员来源")
-    @ExcelProperty("分销人员来源")
+    @Schema(description = "团队人员来源")
+    @ExcelProperty("团队人员来源")
     private Integer source;
 
-    @Schema(description = "分销用户当前积分")
-    @ExcelProperty("分销用户当前积分")
-    private Long integral;
+    @Schema(description = "团队用户当前积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "16642")
+    @ExcelProperty("团队用户当前积分")
+    private Long integralId;
 
-    @Schema(description = "分销用户当前身价", example = "1")
-    @ExcelProperty("分销用户当前身价")
+    @Schema(description = "团队用户当前身价(等级)", example = "1")
+    @ExcelProperty("团队用户当前身价(等级)")
     private Integer socialStatus;
 
-    @Schema(description = "分销用户当前看点")
-    @ExcelProperty("分销用户当前看点")
-    private Long socialStatusKandian;
+    @Schema(description = "团队用户当前点数")
+    @ExcelProperty("团队用户当前点数")
+    private Long socialStatusPoint;
 
-    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("创建时间")
-    private LocalDateTime createTime;
+    @Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "20094")
+    @ExcelProperty("用户类型")
+    private Long categoryId;
 
 }

+ 17 - 10
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/user/vo/UserSaveReqVO.java

@@ -12,26 +12,33 @@ public class UserSaveReqVO {
     @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "7136")
     private Long id;
 
-    @Schema(description = "分销人员ID", example = "32526")
+    @Schema(description = "团队人员ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8034")
+    @NotNull(message = "团队人员ID不能为空")
     private Long userId;
 
-    @Schema(description = "分销人员姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
-    @NotEmpty(message = "分销人员姓名不能为空")
+    @Schema(description = "团队人员姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
+    @NotEmpty(message = "团队人员姓名不能为空")
     private String name;
 
-    @Schema(description = "分销人员手机号码")
+    @Schema(description = "团队人员手机号码", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "团队人员手机号码不能为空")
     private String mobile;
 
-    @Schema(description = "分销人员来源")
+    @Schema(description = "团队人员来源")
     private Integer source;
 
-    @Schema(description = "分销用户当前积分")
-    private Long integral;
+    @Schema(description = "团队用户当前积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "16642")
+    @NotNull(message = "团队用户当前积分不能为空")
+    private Long integralId;
 
-    @Schema(description = "分销用户当前身价", example = "1")
+    @Schema(description = "团队用户当前身价(等级)", example = "1")
     private Integer socialStatus;
 
-    @Schema(description = "分销用户当前看点")
-    private Long socialStatusKandian;
+    @Schema(description = "团队用户当前点数")
+    private Long socialStatusPoint;
+
+    @Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "20094")
+    @NotNull(message = "用户类型不能为空")
+    private Long categoryId;
 
 }

+ 47 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/integral/IntegralDO.java

@@ -0,0 +1,47 @@
+package cn.newfeifan.mall.module.distri.dal.dataobject.integral;
+
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 推荐用户积分 DO
+ *
+ * @author 非繁人
+ */
+@TableName("distri_integral")
+@KeySequence("distri_integral_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class IntegralDO extends BaseDO {
+
+    /**
+     * 用户编号
+     */
+    @TableId
+    private Long id;
+    /**
+     * 用户ID
+     */
+    private Long userId;
+    /**
+     * 当前积分
+     */
+    private Integer currentQuota;
+    /**
+     * 冻结积分
+     */
+    private Integer freezeQuota;
+    /**
+     * 用户类型
+     */
+    private Long categoryId;
+
+}

+ 67 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/ordercalc/OrderCalcDO.java

@@ -0,0 +1,67 @@
+package cn.newfeifan.mall.module.distri.dal.dataobject.ordercalc;
+
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 订单产生数据计算 DO
+ *
+ * @author 非繁人
+ */
+@TableName("distri_order_calc")
+@KeySequence("distri_order_calc_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class OrderCalcDO extends BaseDO {
+
+    /**
+     * 用户编号
+     */
+    @TableId
+    private Long id;
+    /**
+     * 订单编号
+     */
+    private String orderNo;
+    /**
+     * 用户ID
+     */
+    private Long userId;
+    /**
+     * 售价
+     */
+    private Integer price;
+    /**
+     * 成本
+     */
+    private Integer cost;
+    /**
+     * 毛利 = 成本 * 0.38... (推广费用)
+     */
+    private Integer grossProfit;
+    /**
+     * 推广-用户额度
+     */
+    private Integer grossProfitUserQuota;
+    /**
+     * 推广-推荐人额度
+     */
+    private Integer grossProfitAncestorQuota;
+    /**
+     * 推广-合赢奖额度(浮动)
+     */
+    private Integer grossProfitBonusQuota;
+    /**
+     * 推广-平台分成额度(浮动)
+     */
+    private Integer grossProfitPlatformQuota;
+
+}

+ 55 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/orderpercentage/OrderPercentageDO.java

@@ -0,0 +1,55 @@
+package cn.newfeifan.mall.module.distri.dal.dataobject.orderpercentage;
+
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 积分相关计算浮动百分比设置 DO
+ *
+ * @author 非繁人
+ */
+@TableName("distri_order_percentage")
+@KeySequence("distri_order_percentage_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class OrderPercentageDO extends BaseDO {
+
+    /**
+     * 用户编号
+     */
+    @TableId
+    private Long id;
+    /**
+     * 毛利 = 成本 * 0.38... (推广费用)
+     */
+    private Integer grossProfitPerc;
+    /**
+     * 推广-用户额度 百分比
+     */
+    private Integer grossProfitUserQuotaPerc;
+    /**
+     * 推广-推荐人额度 百分比
+     */
+    private Integer grossProfitAncestorQuotaPerc;
+    /**
+     * 推广-合赢奖额度(浮动) 百分比
+     */
+    private Integer grossProfitBonusQuotaPerc;
+    /**
+     * 推广-平台分成额度(浮动) 百分比
+     */
+    private Integer grossProfitPlatformQuotaPerc;
+    /**
+     * 分成百分比
+     */
+    private Integer divideIntoPerc;
+
+}

+ 55 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/partitionbrothers/PartitionBrothersDO.java

@@ -0,0 +1,55 @@
+package cn.newfeifan.mall.module.distri.dal.dataobject.partitionbrothers;
+
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 兄弟分区 DO
+ *
+ * @author 非繁人
+ */
+@TableName("distri_partition_brothers")
+@KeySequence("distri_partition_brothers_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class PartitionBrothersDO extends BaseDO {
+
+    /**
+     * 用户编号
+     */
+    @TableId
+    private Long id;
+    /**
+     * 用户ID
+     */
+    private Long userId;
+    /**
+     * 分区编号
+     */
+    private String partNo;
+    /**
+     * 业绩
+     */
+    private Integer price;
+    /**
+     * 是否碰撞 0为未碰撞 1为已碰撞
+     */
+    private Integer hasHit;
+    /**
+     * 碰撞后额度
+     */
+    private Integer afterHitQuota;
+    /**
+     * 是否是大区 0为小区 1为大区
+     */
+    private Integer size;
+
+}

+ 55 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/partitionson/PartitionSonDO.java

@@ -0,0 +1,55 @@
+package cn.newfeifan.mall.module.distri.dal.dataobject.partitionson;
+
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 后代分区 DO
+ *
+ * @author 非繁人
+ */
+@TableName("distri_partition_son")
+@KeySequence("distri_partition_son_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class PartitionSonDO extends BaseDO {
+
+    /**
+     * 用户编号
+     */
+    @TableId
+    private Long id;
+    /**
+     * 用户ID
+     */
+    private Long userId;
+    /**
+     * 分区编号
+     */
+    private String partNo;
+    /**
+     * 业绩
+     */
+    private Integer price;
+    /**
+     * 是否碰撞 0为未碰撞 1为已碰撞
+     */
+    private Integer hasHit;
+    /**
+     * 碰撞后额度
+     */
+    private Integer afterHitQuota;
+    /**
+     * 是否是大区 0为小区 1为大区
+     */
+    private Integer size;
+
+}

+ 9 - 5
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/sharepath/SharePathDO.java

@@ -23,21 +23,25 @@ import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
 public class SharePathDO extends BaseDO {
 
     /**
-     * 用户编号
+     * 层级
+     */
+    private Integer depth;
+    /**
+     * id
      */
     @TableId
     private Long id;
     /**
-     * 父亲id
+     * 推荐人
      */
     private Long ancestor;
     /**
-     * 推
+     * 推人
      */
     private Long descendant;
     /**
-     * 层级
+     * 顺序
      */
-    private Integer depth;
+    private Integer sort;
 
 }

+ 2 - 2
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/socialstatus/SocialStatusDO.java

@@ -36,8 +36,8 @@ public class SocialStatusDO extends BaseDO {
      */
     private String name;
     /**
-     * 升级所需
+     * 升级所需点
      */
-    private Long kandian;
+    private Long point;
 
 }

+ 13 - 9
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/user/UserDO.java

@@ -28,32 +28,36 @@ public class UserDO extends BaseDO {
     @TableId
     private Long id;
     /**
-     * 分销人员ID
+     * 团队人员ID
      */
     private Long userId;
     /**
-     * 分销人员姓名
+     * 团队人员姓名
      */
     private String name;
     /**
-     * 分销人员手机号码
+     * 团队人员手机号码
      */
     private String mobile;
     /**
-     * 分销人员来源
+     * 团队人员来源
      */
     private Integer source;
     /**
-     * 分销用户当前积分
+     * 团队用户当前积分
      */
-    private Long integral;
+    private Long integralId;
     /**
-     * 分销用户当前身价
+     * 团队用户当前身价(等级)
      */
     private Integer socialStatus;
     /**
-     * 分销用户当前看点
+     * 团队用户当前点数
      */
-    private Long socialStatusKandian;
+    private Long socialStatusPoint;
+    /**
+     * 用户类型
+     */
+    private Long categoryId;
 
 }

+ 30 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/integral/IntegralMapper.java

@@ -0,0 +1,30 @@
+package cn.newfeifan.mall.module.distri.dal.mysql.integral;
+
+import java.util.*;
+
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.newfeifan.mall.framework.mybatis.core.mapper.BaseMapperX;
+import cn.newfeifan.mall.module.distri.dal.dataobject.integral.IntegralDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.distri.controller.admin.integral.vo.*;
+
+/**
+ * 推荐用户积分 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface IntegralMapper extends BaseMapperX<IntegralDO> {
+
+    default PageResult<IntegralDO> selectPage(IntegralPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<IntegralDO>()
+                .eqIfPresent(IntegralDO::getUserId, reqVO.getUserId())
+                .eqIfPresent(IntegralDO::getCurrentQuota, reqVO.getCurrentQuota())
+                .eqIfPresent(IntegralDO::getFreezeQuota, reqVO.getFreezeQuota())
+                .eqIfPresent(IntegralDO::getCategoryId, reqVO.getCategoryId())
+                .betweenIfPresent(IntegralDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(IntegralDO::getId));
+    }
+
+}

+ 35 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/ordercalc/OrderCalcMapper.java

@@ -0,0 +1,35 @@
+package cn.newfeifan.mall.module.distri.dal.mysql.ordercalc;
+
+import java.util.*;
+
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.newfeifan.mall.framework.mybatis.core.mapper.BaseMapperX;
+import cn.newfeifan.mall.module.distri.dal.dataobject.ordercalc.OrderCalcDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.distri.controller.admin.ordercalc.vo.*;
+
+/**
+ * 订单产生数据计算 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface OrderCalcMapper extends BaseMapperX<OrderCalcDO> {
+
+    default PageResult<OrderCalcDO> selectPage(OrderCalcPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<OrderCalcDO>()
+                .eqIfPresent(OrderCalcDO::getOrderNo, reqVO.getOrderNo())
+                .eqIfPresent(OrderCalcDO::getUserId, reqVO.getUserId())
+                .eqIfPresent(OrderCalcDO::getPrice, reqVO.getPrice())
+                .eqIfPresent(OrderCalcDO::getCost, reqVO.getCost())
+                .eqIfPresent(OrderCalcDO::getGrossProfit, reqVO.getGrossProfit())
+                .eqIfPresent(OrderCalcDO::getGrossProfitUserQuota, reqVO.getGrossProfitUserQuota())
+                .eqIfPresent(OrderCalcDO::getGrossProfitAncestorQuota, reqVO.getGrossProfitAncestorQuota())
+                .eqIfPresent(OrderCalcDO::getGrossProfitBonusQuota, reqVO.getGrossProfitBonusQuota())
+                .eqIfPresent(OrderCalcDO::getGrossProfitPlatformQuota, reqVO.getGrossProfitPlatformQuota())
+                .betweenIfPresent(OrderCalcDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(OrderCalcDO::getId));
+    }
+
+}

+ 32 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/orderpercentage/OrderPercentageMapper.java

@@ -0,0 +1,32 @@
+package cn.newfeifan.mall.module.distri.dal.mysql.orderpercentage;
+
+import java.util.*;
+
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.newfeifan.mall.framework.mybatis.core.mapper.BaseMapperX;
+import cn.newfeifan.mall.module.distri.dal.dataobject.orderpercentage.OrderPercentageDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.distri.controller.admin.orderpercentage.vo.*;
+
+/**
+ * 积分相关计算浮动百分比设置 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface OrderPercentageMapper extends BaseMapperX<OrderPercentageDO> {
+
+    default PageResult<OrderPercentageDO> selectPage(OrderPercentagePageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<OrderPercentageDO>()
+                .eqIfPresent(OrderPercentageDO::getGrossProfitPerc, reqVO.getGrossProfitPerc())
+                .eqIfPresent(OrderPercentageDO::getGrossProfitUserQuotaPerc, reqVO.getGrossProfitUserQuotaPerc())
+                .eqIfPresent(OrderPercentageDO::getGrossProfitAncestorQuotaPerc, reqVO.getGrossProfitAncestorQuotaPerc())
+                .eqIfPresent(OrderPercentageDO::getGrossProfitBonusQuotaPerc, reqVO.getGrossProfitBonusQuotaPerc())
+                .eqIfPresent(OrderPercentageDO::getGrossProfitPlatformQuotaPerc, reqVO.getGrossProfitPlatformQuotaPerc())
+                .eqIfPresent(OrderPercentageDO::getDivideIntoPerc, reqVO.getDivideIntoPerc())
+                .betweenIfPresent(OrderPercentageDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(OrderPercentageDO::getId));
+    }
+
+}

+ 32 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/partitionbrothers/PartitionBrothersMapper.java

@@ -0,0 +1,32 @@
+package cn.newfeifan.mall.module.distri.dal.mysql.partitionbrothers;
+
+import java.util.*;
+
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.newfeifan.mall.framework.mybatis.core.mapper.BaseMapperX;
+import cn.newfeifan.mall.module.distri.dal.dataobject.partitionbrothers.PartitionBrothersDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.distri.controller.admin.partitionbrothers.vo.*;
+
+/**
+ * 兄弟分区 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface PartitionBrothersMapper extends BaseMapperX<PartitionBrothersDO> {
+
+    default PageResult<PartitionBrothersDO> selectPage(PartitionBrothersPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<PartitionBrothersDO>()
+                .eqIfPresent(PartitionBrothersDO::getUserId, reqVO.getUserId())
+                .eqIfPresent(PartitionBrothersDO::getPartNo, reqVO.getPartNo())
+                .eqIfPresent(PartitionBrothersDO::getPrice, reqVO.getPrice())
+                .eqIfPresent(PartitionBrothersDO::getHasHit, reqVO.getHasHit())
+                .eqIfPresent(PartitionBrothersDO::getAfterHitQuota, reqVO.getAfterHitQuota())
+                .eqIfPresent(PartitionBrothersDO::getSize, reqVO.getSize())
+                .betweenIfPresent(PartitionBrothersDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(PartitionBrothersDO::getId));
+    }
+
+}

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

@@ -0,0 +1,32 @@
+package cn.newfeifan.mall.module.distri.dal.mysql.partitionson;
+
+import java.util.*;
+
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.newfeifan.mall.framework.mybatis.core.mapper.BaseMapperX;
+import cn.newfeifan.mall.module.distri.dal.dataobject.partitionson.PartitionSonDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.distri.controller.admin.partitionson.vo.*;
+
+/**
+ * 后代分区 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface PartitionSonMapper extends BaseMapperX<PartitionSonDO> {
+
+    default PageResult<PartitionSonDO> selectPage(PartitionSonPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<PartitionSonDO>()
+                .eqIfPresent(PartitionSonDO::getUserId, reqVO.getUserId())
+                .eqIfPresent(PartitionSonDO::getPartNo, reqVO.getPartNo())
+                .eqIfPresent(PartitionSonDO::getPrice, reqVO.getPrice())
+                .eqIfPresent(PartitionSonDO::getHasHit, reqVO.getHasHit())
+                .eqIfPresent(PartitionSonDO::getAfterHitQuota, reqVO.getAfterHitQuota())
+                .eqIfPresent(PartitionSonDO::getSize, reqVO.getSize())
+                .betweenIfPresent(PartitionSonDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(PartitionSonDO::getId));
+    }
+
+}

+ 3 - 2
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/sharepath/SharePathMapper.java

@@ -19,10 +19,11 @@ public interface SharePathMapper extends BaseMapperX<SharePathDO> {
 
     default PageResult<SharePathDO> selectPage(SharePathPageReqVO reqVO) {
         return selectPage(reqVO, new LambdaQueryWrapperX<SharePathDO>()
-                .eqIfPresent(SharePathDO::getAncestor, reqVO.getAncestor())
-                .eqIfPresent(SharePathDO::getDescendant, reqVO.getDescendant())
                 .eqIfPresent(SharePathDO::getDepth, reqVO.getDepth())
                 .betweenIfPresent(SharePathDO::getCreateTime, reqVO.getCreateTime())
+                .eqIfPresent(SharePathDO::getAncestor, reqVO.getAncestor())
+                .eqIfPresent(SharePathDO::getDescendant, reqVO.getDescendant())
+                .eqIfPresent(SharePathDO::getSort, reqVO.getSort())
                 .orderByDesc(SharePathDO::getId));
     }
 

+ 1 - 1
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/socialstatus/SocialStatusMapper.java

@@ -21,8 +21,8 @@ public interface SocialStatusMapper extends BaseMapperX<SocialStatusDO> {
         return selectPage(reqVO, new LambdaQueryWrapperX<SocialStatusDO>()
                 .eqIfPresent(SocialStatusDO::getLevel, reqVO.getLevel())
                 .likeIfPresent(SocialStatusDO::getName, reqVO.getName())
-                .eqIfPresent(SocialStatusDO::getKandian, reqVO.getKandian())
                 .betweenIfPresent(SocialStatusDO::getCreateTime, reqVO.getCreateTime())
+                .eqIfPresent(SocialStatusDO::getPoint, reqVO.getPoint())
                 .orderByDesc(SocialStatusDO::getId));
     }
 

+ 6 - 3
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/user/UserMapper.java

@@ -19,15 +19,18 @@ public interface UserMapper extends BaseMapperX<UserDO> {
 
     default PageResult<UserDO> selectPage(UserPageReqVO reqVO) {
         return selectPage(reqVO, new LambdaQueryWrapperX<UserDO>()
+                .betweenIfPresent(UserDO::getCreateTime, reqVO.getCreateTime())
                 .eqIfPresent(UserDO::getUserId, reqVO.getUserId())
                 .likeIfPresent(UserDO::getName, reqVO.getName())
                 .eqIfPresent(UserDO::getMobile, reqVO.getMobile())
                 .eqIfPresent(UserDO::getSource, reqVO.getSource())
-                .eqIfPresent(UserDO::getIntegral, reqVO.getIntegral())
+                .eqIfPresent(UserDO::getIntegralId, reqVO.getIntegralId())
                 .eqIfPresent(UserDO::getSocialStatus, reqVO.getSocialStatus())
-                .eqIfPresent(UserDO::getSocialStatusKandian, reqVO.getSocialStatusKandian())
-                .betweenIfPresent(UserDO::getCreateTime, reqVO.getCreateTime())
+                .eqIfPresent(UserDO::getSocialStatusPoint, reqVO.getSocialStatusPoint())
+                .eqIfPresent(UserDO::getCategoryId, reqVO.getCategoryId())
                 .orderByDesc(UserDO::getId));
     }
 
+    int hasParent(Long userId);
+
 }

+ 55 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integral/IntegralService.java

@@ -0,0 +1,55 @@
+package cn.newfeifan.mall.module.distri.service.integral;
+
+import java.util.*;
+import javax.validation.*;
+import cn.newfeifan.mall.module.distri.controller.admin.integral.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.integral.IntegralDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+
+/**
+ * 推荐用户积分 Service 接口
+ *
+ * @author 非繁人
+ */
+public interface IntegralService {
+
+    /**
+     * 创建推荐用户积分
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createIntegral(@Valid IntegralSaveReqVO createReqVO);
+
+    /**
+     * 更新推荐用户积分
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateIntegral(@Valid IntegralSaveReqVO updateReqVO);
+
+    /**
+     * 删除推荐用户积分
+     *
+     * @param id 编号
+     */
+    void deleteIntegral(Long id);
+
+    /**
+     * 获得推荐用户积分
+     *
+     * @param id 编号
+     * @return 推荐用户积分
+     */
+    IntegralDO getIntegral(Long id);
+
+    /**
+     * 获得推荐用户积分分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 推荐用户积分分页
+     */
+    PageResult<IntegralDO> getIntegralPage(IntegralPageReqVO pageReqVO);
+
+}

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

@@ -0,0 +1,74 @@
+package cn.newfeifan.mall.module.distri.service.integral;
+
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import cn.newfeifan.mall.module.distri.controller.admin.integral.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.integral.IntegralDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+
+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.enums.ErrorCodeConstants.*;
+
+/**
+ * 推荐用户积分 Service 实现类
+ *
+ * @author 非繁人
+ */
+@Service
+@Validated
+public class IntegralServiceImpl implements IntegralService {
+
+    @Resource
+    private IntegralMapper integralMapper;
+
+    @Override
+    public Long createIntegral(IntegralSaveReqVO createReqVO) {
+        // 插入
+        IntegralDO integral = BeanUtils.toBean(createReqVO, IntegralDO.class);
+        integralMapper.insert(integral);
+        // 返回
+        return integral.getId();
+    }
+
+    @Override
+    public void updateIntegral(IntegralSaveReqVO updateReqVO) {
+        // 校验存在
+        validateIntegralExists(updateReqVO.getId());
+        // 更新
+        IntegralDO updateObj = BeanUtils.toBean(updateReqVO, IntegralDO.class);
+        integralMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteIntegral(Long id) {
+        // 校验存在
+        validateIntegralExists(id);
+        // 删除
+        integralMapper.deleteById(id);
+    }
+
+    private void validateIntegralExists(Long id) {
+        if (integralMapper.selectById(id) == null) {
+            throw exception(INTEGRAL_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public IntegralDO getIntegral(Long id) {
+        return integralMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<IntegralDO> getIntegralPage(IntegralPageReqVO pageReqVO) {
+        return integralMapper.selectPage(pageReqVO);
+    }
+
+}

+ 55 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/ordercalc/OrderCalcService.java

@@ -0,0 +1,55 @@
+package cn.newfeifan.mall.module.distri.service.ordercalc;
+
+import java.util.*;
+import javax.validation.*;
+import cn.newfeifan.mall.module.distri.controller.admin.ordercalc.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.ordercalc.OrderCalcDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+
+/**
+ * 订单产生数据计算 Service 接口
+ *
+ * @author 非繁人
+ */
+public interface OrderCalcService {
+
+    /**
+     * 创建订单产生数据计算
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createOrderCalc(@Valid OrderCalcSaveReqVO createReqVO);
+
+    /**
+     * 更新订单产生数据计算
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateOrderCalc(@Valid OrderCalcSaveReqVO updateReqVO);
+
+    /**
+     * 删除订单产生数据计算
+     *
+     * @param id 编号
+     */
+    void deleteOrderCalc(Long id);
+
+    /**
+     * 获得订单产生数据计算
+     *
+     * @param id 编号
+     * @return 订单产生数据计算
+     */
+    OrderCalcDO getOrderCalc(Long id);
+
+    /**
+     * 获得订单产生数据计算分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 订单产生数据计算分页
+     */
+    PageResult<OrderCalcDO> getOrderCalcPage(OrderCalcPageReqVO pageReqVO);
+
+}

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

@@ -0,0 +1,74 @@
+package cn.newfeifan.mall.module.distri.service.ordercalc;
+
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import cn.newfeifan.mall.module.distri.controller.admin.ordercalc.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.ordercalc.OrderCalcDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+
+import cn.newfeifan.mall.module.distri.dal.mysql.ordercalc.OrderCalcMapper;
+
+import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
+
+/**
+ * 订单产生数据计算 Service 实现类
+ *
+ * @author 非繁人
+ */
+@Service
+@Validated
+public class OrderCalcServiceImpl implements OrderCalcService {
+
+    @Resource
+    private OrderCalcMapper orderCalcMapper;
+
+    @Override
+    public Long createOrderCalc(OrderCalcSaveReqVO createReqVO) {
+        // 插入
+        OrderCalcDO orderCalc = BeanUtils.toBean(createReqVO, OrderCalcDO.class);
+        orderCalcMapper.insert(orderCalc);
+        // 返回
+        return orderCalc.getId();
+    }
+
+    @Override
+    public void updateOrderCalc(OrderCalcSaveReqVO updateReqVO) {
+        // 校验存在
+        validateOrderCalcExists(updateReqVO.getId());
+        // 更新
+        OrderCalcDO updateObj = BeanUtils.toBean(updateReqVO, OrderCalcDO.class);
+        orderCalcMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteOrderCalc(Long id) {
+        // 校验存在
+        validateOrderCalcExists(id);
+        // 删除
+        orderCalcMapper.deleteById(id);
+    }
+
+    private void validateOrderCalcExists(Long id) {
+        if (orderCalcMapper.selectById(id) == null) {
+            throw exception(ORDER_CALC_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public OrderCalcDO getOrderCalc(Long id) {
+        return orderCalcMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<OrderCalcDO> getOrderCalcPage(OrderCalcPageReqVO pageReqVO) {
+        return orderCalcMapper.selectPage(pageReqVO);
+    }
+
+}

+ 55 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/orderpercentage/OrderPercentageService.java

@@ -0,0 +1,55 @@
+package cn.newfeifan.mall.module.distri.service.orderpercentage;
+
+import java.util.*;
+import javax.validation.*;
+import cn.newfeifan.mall.module.distri.controller.admin.orderpercentage.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.orderpercentage.OrderPercentageDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+
+/**
+ * 积分相关计算浮动百分比设置 Service 接口
+ *
+ * @author 非繁人
+ */
+public interface OrderPercentageService {
+
+    /**
+     * 创建积分相关计算浮动百分比设置
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createOrderPercentage(@Valid OrderPercentageSaveReqVO createReqVO);
+
+    /**
+     * 更新积分相关计算浮动百分比设置
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateOrderPercentage(@Valid OrderPercentageSaveReqVO updateReqVO);
+
+    /**
+     * 删除积分相关计算浮动百分比设置
+     *
+     * @param id 编号
+     */
+    void deleteOrderPercentage(Long id);
+
+    /**
+     * 获得积分相关计算浮动百分比设置
+     *
+     * @param id 编号
+     * @return 积分相关计算浮动百分比设置
+     */
+    OrderPercentageDO getOrderPercentage(Long id);
+
+    /**
+     * 获得积分相关计算浮动百分比设置分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 积分相关计算浮动百分比设置分页
+     */
+    PageResult<OrderPercentageDO> getOrderPercentagePage(OrderPercentagePageReqVO pageReqVO);
+
+}

+ 74 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/orderpercentage/OrderPercentageServiceImpl.java

@@ -0,0 +1,74 @@
+package cn.newfeifan.mall.module.distri.service.orderpercentage;
+
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import cn.newfeifan.mall.module.distri.controller.admin.orderpercentage.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.orderpercentage.OrderPercentageDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+
+import cn.newfeifan.mall.module.distri.dal.mysql.orderpercentage.OrderPercentageMapper;
+
+import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
+
+/**
+ * 积分相关计算浮动百分比设置 Service 实现类
+ *
+ * @author 非繁人
+ */
+@Service
+@Validated
+public class OrderPercentageServiceImpl implements OrderPercentageService {
+
+    @Resource
+    private OrderPercentageMapper orderPercentageMapper;
+
+    @Override
+    public Long createOrderPercentage(OrderPercentageSaveReqVO createReqVO) {
+        // 插入
+        OrderPercentageDO orderPercentage = BeanUtils.toBean(createReqVO, OrderPercentageDO.class);
+        orderPercentageMapper.insert(orderPercentage);
+        // 返回
+        return orderPercentage.getId();
+    }
+
+    @Override
+    public void updateOrderPercentage(OrderPercentageSaveReqVO updateReqVO) {
+        // 校验存在
+        validateOrderPercentageExists(updateReqVO.getId());
+        // 更新
+        OrderPercentageDO updateObj = BeanUtils.toBean(updateReqVO, OrderPercentageDO.class);
+        orderPercentageMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteOrderPercentage(Long id) {
+        // 校验存在
+        validateOrderPercentageExists(id);
+        // 删除
+        orderPercentageMapper.deleteById(id);
+    }
+
+    private void validateOrderPercentageExists(Long id) {
+        if (orderPercentageMapper.selectById(id) == null) {
+            throw exception(ORDER_PERCENTAGE_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public OrderPercentageDO getOrderPercentage(Long id) {
+        return orderPercentageMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<OrderPercentageDO> getOrderPercentagePage(OrderPercentagePageReqVO pageReqVO) {
+        return orderPercentageMapper.selectPage(pageReqVO);
+    }
+
+}

+ 55 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/partitionbrothers/PartitionBrothersService.java

@@ -0,0 +1,55 @@
+package cn.newfeifan.mall.module.distri.service.partitionbrothers;
+
+import java.util.*;
+import javax.validation.*;
+import cn.newfeifan.mall.module.distri.controller.admin.partitionbrothers.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.partitionbrothers.PartitionBrothersDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+
+/**
+ * 兄弟分区 Service 接口
+ *
+ * @author 非繁人
+ */
+public interface PartitionBrothersService {
+
+    /**
+     * 创建兄弟分区
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createPartitionBrothers(@Valid PartitionBrothersSaveReqVO createReqVO);
+
+    /**
+     * 更新兄弟分区
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updatePartitionBrothers(@Valid PartitionBrothersSaveReqVO updateReqVO);
+
+    /**
+     * 删除兄弟分区
+     *
+     * @param id 编号
+     */
+    void deletePartitionBrothers(Long id);
+
+    /**
+     * 获得兄弟分区
+     *
+     * @param id 编号
+     * @return 兄弟分区
+     */
+    PartitionBrothersDO getPartitionBrothers(Long id);
+
+    /**
+     * 获得兄弟分区分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 兄弟分区分页
+     */
+    PageResult<PartitionBrothersDO> getPartitionBrothersPage(PartitionBrothersPageReqVO pageReqVO);
+
+}

+ 74 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/partitionbrothers/PartitionBrothersServiceImpl.java

@@ -0,0 +1,74 @@
+package cn.newfeifan.mall.module.distri.service.partitionbrothers;
+
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import cn.newfeifan.mall.module.distri.controller.admin.partitionbrothers.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.partitionbrothers.PartitionBrothersDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+
+import cn.newfeifan.mall.module.distri.dal.mysql.partitionbrothers.PartitionBrothersMapper;
+
+import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
+
+/**
+ * 兄弟分区 Service 实现类
+ *
+ * @author 非繁人
+ */
+@Service
+@Validated
+public class PartitionBrothersServiceImpl implements PartitionBrothersService {
+
+    @Resource
+    private PartitionBrothersMapper partitionBrothersMapper;
+
+    @Override
+    public Long createPartitionBrothers(PartitionBrothersSaveReqVO createReqVO) {
+        // 插入
+        PartitionBrothersDO partitionBrothers = BeanUtils.toBean(createReqVO, PartitionBrothersDO.class);
+        partitionBrothersMapper.insert(partitionBrothers);
+        // 返回
+        return partitionBrothers.getId();
+    }
+
+    @Override
+    public void updatePartitionBrothers(PartitionBrothersSaveReqVO updateReqVO) {
+        // 校验存在
+        validatePartitionBrothersExists(updateReqVO.getId());
+        // 更新
+        PartitionBrothersDO updateObj = BeanUtils.toBean(updateReqVO, PartitionBrothersDO.class);
+        partitionBrothersMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deletePartitionBrothers(Long id) {
+        // 校验存在
+        validatePartitionBrothersExists(id);
+        // 删除
+        partitionBrothersMapper.deleteById(id);
+    }
+
+    private void validatePartitionBrothersExists(Long id) {
+        if (partitionBrothersMapper.selectById(id) == null) {
+            throw exception(PARTITION_BROTHERS_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public PartitionBrothersDO getPartitionBrothers(Long id) {
+        return partitionBrothersMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<PartitionBrothersDO> getPartitionBrothersPage(PartitionBrothersPageReqVO pageReqVO) {
+        return partitionBrothersMapper.selectPage(pageReqVO);
+    }
+
+}

+ 55 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/partitionson/PartitionSonService.java

@@ -0,0 +1,55 @@
+package cn.newfeifan.mall.module.distri.service.partitionson;
+
+import java.util.*;
+import javax.validation.*;
+import cn.newfeifan.mall.module.distri.controller.admin.partitionson.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.partitionson.PartitionSonDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+
+/**
+ * 后代分区 Service 接口
+ *
+ * @author 非繁人
+ */
+public interface PartitionSonService {
+
+    /**
+     * 创建后代分区
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createPartitionSon(@Valid PartitionSonSaveReqVO createReqVO);
+
+    /**
+     * 更新后代分区
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updatePartitionSon(@Valid PartitionSonSaveReqVO updateReqVO);
+
+    /**
+     * 删除后代分区
+     *
+     * @param id 编号
+     */
+    void deletePartitionSon(Long id);
+
+    /**
+     * 获得后代分区
+     *
+     * @param id 编号
+     * @return 后代分区
+     */
+    PartitionSonDO getPartitionSon(Long id);
+
+    /**
+     * 获得后代分区分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 后代分区分页
+     */
+    PageResult<PartitionSonDO> getPartitionSonPage(PartitionSonPageReqVO pageReqVO);
+
+}

+ 74 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/partitionson/PartitionSonServiceImpl.java

@@ -0,0 +1,74 @@
+package cn.newfeifan.mall.module.distri.service.partitionson;
+
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import cn.newfeifan.mall.module.distri.controller.admin.partitionson.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.partitionson.PartitionSonDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+
+import cn.newfeifan.mall.module.distri.dal.mysql.partitionson.PartitionSonMapper;
+
+import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
+
+/**
+ * 后代分区 Service 实现类
+ *
+ * @author 非繁人
+ */
+@Service
+@Validated
+public class PartitionSonServiceImpl implements PartitionSonService {
+
+    @Resource
+    private PartitionSonMapper partitionSonMapper;
+
+    @Override
+    public Long createPartitionSon(PartitionSonSaveReqVO createReqVO) {
+        // 插入
+        PartitionSonDO partitionSon = BeanUtils.toBean(createReqVO, PartitionSonDO.class);
+        partitionSonMapper.insert(partitionSon);
+        // 返回
+        return partitionSon.getId();
+    }
+
+    @Override
+    public void updatePartitionSon(PartitionSonSaveReqVO updateReqVO) {
+        // 校验存在
+        validatePartitionSonExists(updateReqVO.getId());
+        // 更新
+        PartitionSonDO updateObj = BeanUtils.toBean(updateReqVO, PartitionSonDO.class);
+        partitionSonMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deletePartitionSon(Long id) {
+        // 校验存在
+        validatePartitionSonExists(id);
+        // 删除
+        partitionSonMapper.deleteById(id);
+    }
+
+    private void validatePartitionSonExists(Long id) {
+        if (partitionSonMapper.selectById(id) == null) {
+            throw exception(PARTITION_SON_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public PartitionSonDO getPartitionSon(Long id) {
+        return partitionSonMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<PartitionSonDO> getPartitionSonPage(PartitionSonPageReqVO pageReqVO) {
+        return partitionSonMapper.selectPage(pageReqVO);
+    }
+
+}

+ 12 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/resources/mapper/integral/IntegralMapper.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.newfeifan.mall.module.distri.dal.mysql.integral.IntegralMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.zhongxing.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>

+ 12 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/resources/mapper/ordercalc/OrderCalcMapper.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.newfeifan.mall.module.distri.dal.mysql.ordercalc.OrderCalcMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.zhongxing.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>

+ 12 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/resources/mapper/orderpercentage/OrderPercentageMapper.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.newfeifan.mall.module.distri.dal.mysql.orderpercentage.OrderPercentageMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.zhongxing.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>

+ 12 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/resources/mapper/partitionbrothers/PartitionBrothersMapper.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.newfeifan.mall.module.distri.dal.mysql.partitionbrothers.PartitionBrothersMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.zhongxing.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>

+ 12 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/resources/mapper/partitionson/PartitionSonMapper.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.newfeifan.mall.module.distri.dal.mysql.partitionson.PartitionSonMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.zhongxing.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>

+ 20 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/resources/mapper/user/UserMapper.xml

@@ -8,5 +8,25 @@
         代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
         文档可见:https://www.zhongxing.cn/MyBatis/x-plugins/
      -->
+    <resultMap id="BaseResultMap" type="cn.newfeifan.mall.module.distri.dal.dataobject.user.UserDO">
+        <id column="id" property="id" />
+        <result column="user_id" property="userId" />
+        <result column="name" property="name" />
+        <result column="mobile" property="mobile" />
+        <result column="source" property="source" />
+        <result column="social_status" property="socialStatus" />
+        <result column="social_status_kandian" property="socialStatusPoint" />
+        <result column="creator" property="creator" />
+        <result column="create_time" property="createTime" />
+        <result column="update_time" property="updateTime" />
+        <result column="deleted" property="deleted" />
+    </resultMap>
+
+    <select id="hasParent" resultType="Integer" >
+       SELECT COUNT(dp) > 0 FROM distri_share_path dp WHERE dp.descendant =  #{distributorId}  AND dp.depth = 1
+    </select>
+
+
+
 
 </mapper>

+ 146 - 0
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/integral/IntegralServiceImplTest.java

@@ -0,0 +1,146 @@
+package cn.newfeifan.mall.module.distri.service.integral;
+
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.mock.mockito.MockBean;
+
+import javax.annotation.Resource;
+
+import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
+
+import cn.newfeifan.mall.module.distri.controller.admin.integral.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.integral.IntegralDO;
+import cn.newfeifan.mall.module.distri.dal.mysql.integral.IntegralMapper;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+import javax.annotation.Resource;
+import org.springframework.context.annotation.Import;
+import java.util.*;
+import java.time.LocalDateTime;
+
+import static cn.hutool.core.util.RandomUtil.*;
+import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
+import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
+import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
+import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
+import static org.junit.jupiter.api.Assertions.*;
+import static org.mockito.Mockito.*;
+
+/**
+ * {@link IntegralServiceImpl} 的单元测试类
+ *
+ * @author 非繁人
+ */
+@Import(IntegralServiceImpl.class)
+public class IntegralServiceImplTest extends BaseDbUnitTest {
+
+    @Resource
+    private IntegralServiceImpl integralService;
+
+    @Resource
+    private IntegralMapper integralMapper;
+
+    @Test
+    public void testCreateIntegral_success() {
+        // 准备参数
+        IntegralSaveReqVO createReqVO = randomPojo(IntegralSaveReqVO.class).setId(null);
+
+        // 调用
+        Long integralId = integralService.createIntegral(createReqVO);
+        // 断言
+        assertNotNull(integralId);
+        // 校验记录的属性是否正确
+        IntegralDO integral = integralMapper.selectById(integralId);
+        assertPojoEquals(createReqVO, integral, "id");
+    }
+
+    @Test
+    public void testUpdateIntegral_success() {
+        // mock 数据
+        IntegralDO dbIntegral = randomPojo(IntegralDO.class);
+        integralMapper.insert(dbIntegral);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        IntegralSaveReqVO updateReqVO = randomPojo(IntegralSaveReqVO.class, o -> {
+            o.setId(dbIntegral.getId()); // 设置更新的 ID
+        });
+
+        // 调用
+        integralService.updateIntegral(updateReqVO);
+        // 校验是否更新正确
+        IntegralDO integral = integralMapper.selectById(updateReqVO.getId()); // 获取最新的
+        assertPojoEquals(updateReqVO, integral);
+    }
+
+    @Test
+    public void testUpdateIntegral_notExists() {
+        // 准备参数
+        IntegralSaveReqVO updateReqVO = randomPojo(IntegralSaveReqVO.class);
+
+        // 调用, 并断言异常
+        assertServiceException(() -> integralService.updateIntegral(updateReqVO), INTEGRAL_NOT_EXISTS);
+    }
+
+    @Test
+    public void testDeleteIntegral_success() {
+        // mock 数据
+        IntegralDO dbIntegral = randomPojo(IntegralDO.class);
+        integralMapper.insert(dbIntegral);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        Long id = dbIntegral.getId();
+
+        // 调用
+        integralService.deleteIntegral(id);
+       // 校验数据不存在了
+       assertNull(integralMapper.selectById(id));
+    }
+
+    @Test
+    public void testDeleteIntegral_notExists() {
+        // 准备参数
+        Long id = randomLongId();
+
+        // 调用, 并断言异常
+        assertServiceException(() -> integralService.deleteIntegral(id), INTEGRAL_NOT_EXISTS);
+    }
+
+    @Test
+    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
+    public void testGetIntegralPage() {
+       // mock 数据
+       IntegralDO dbIntegral = randomPojo(IntegralDO.class, o -> { // 等会查询到
+           o.setUserId(null);
+           o.setCurrentQuota(null);
+           o.setFreezeQuota(null);
+           o.setCategoryId(null);
+           o.setCreateTime(null);
+       });
+       integralMapper.insert(dbIntegral);
+       // 测试 userId 不匹配
+       integralMapper.insert(cloneIgnoreId(dbIntegral, o -> o.setUserId(null)));
+       // 测试 currentQuota 不匹配
+       integralMapper.insert(cloneIgnoreId(dbIntegral, o -> o.setCurrentQuota(null)));
+       // 测试 freezeQuota 不匹配
+       integralMapper.insert(cloneIgnoreId(dbIntegral, o -> o.setFreezeQuota(null)));
+       // 测试 categoryId 不匹配
+       integralMapper.insert(cloneIgnoreId(dbIntegral, o -> o.setCategoryId(null)));
+       // 测试 createTime 不匹配
+       integralMapper.insert(cloneIgnoreId(dbIntegral, o -> o.setCreateTime(null)));
+       // 准备参数
+       IntegralPageReqVO reqVO = new IntegralPageReqVO();
+       reqVO.setUserId(null);
+       reqVO.setCurrentQuota(null);
+       reqVO.setFreezeQuota(null);
+       reqVO.setCategoryId(null);
+       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
+
+       // 调用
+       PageResult<IntegralDO> pageResult = integralService.getIntegralPage(reqVO);
+       // 断言
+       assertEquals(1, pageResult.getTotal());
+       assertEquals(1, pageResult.getList().size());
+       assertPojoEquals(dbIntegral, pageResult.getList().get(0));
+    }
+
+}

+ 166 - 0
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/ordercalc/OrderCalcServiceImplTest.java

@@ -0,0 +1,166 @@
+package cn.newfeifan.mall.module.distri.service.ordercalc;
+
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.mock.mockito.MockBean;
+
+import javax.annotation.Resource;
+
+import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
+
+import cn.newfeifan.mall.module.distri.controller.admin.ordercalc.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.ordercalc.OrderCalcDO;
+import cn.newfeifan.mall.module.distri.dal.mysql.ordercalc.OrderCalcMapper;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+import javax.annotation.Resource;
+import org.springframework.context.annotation.Import;
+import java.util.*;
+import java.time.LocalDateTime;
+
+import static cn.hutool.core.util.RandomUtil.*;
+import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
+import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
+import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
+import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
+import static org.junit.jupiter.api.Assertions.*;
+import static org.mockito.Mockito.*;
+
+/**
+ * {@link OrderCalcServiceImpl} 的单元测试类
+ *
+ * @author 非繁人
+ */
+@Import(OrderCalcServiceImpl.class)
+public class OrderCalcServiceImplTest extends BaseDbUnitTest {
+
+    @Resource
+    private OrderCalcServiceImpl orderCalcService;
+
+    @Resource
+    private OrderCalcMapper orderCalcMapper;
+
+    @Test
+    public void testCreateOrderCalc_success() {
+        // 准备参数
+        OrderCalcSaveReqVO createReqVO = randomPojo(OrderCalcSaveReqVO.class).setId(null);
+
+        // 调用
+        Long orderCalcId = orderCalcService.createOrderCalc(createReqVO);
+        // 断言
+        assertNotNull(orderCalcId);
+        // 校验记录的属性是否正确
+        OrderCalcDO orderCalc = orderCalcMapper.selectById(orderCalcId);
+        assertPojoEquals(createReqVO, orderCalc, "id");
+    }
+
+    @Test
+    public void testUpdateOrderCalc_success() {
+        // mock 数据
+        OrderCalcDO dbOrderCalc = randomPojo(OrderCalcDO.class);
+        orderCalcMapper.insert(dbOrderCalc);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        OrderCalcSaveReqVO updateReqVO = randomPojo(OrderCalcSaveReqVO.class, o -> {
+            o.setId(dbOrderCalc.getId()); // 设置更新的 ID
+        });
+
+        // 调用
+        orderCalcService.updateOrderCalc(updateReqVO);
+        // 校验是否更新正确
+        OrderCalcDO orderCalc = orderCalcMapper.selectById(updateReqVO.getId()); // 获取最新的
+        assertPojoEquals(updateReqVO, orderCalc);
+    }
+
+    @Test
+    public void testUpdateOrderCalc_notExists() {
+        // 准备参数
+        OrderCalcSaveReqVO updateReqVO = randomPojo(OrderCalcSaveReqVO.class);
+
+        // 调用, 并断言异常
+        assertServiceException(() -> orderCalcService.updateOrderCalc(updateReqVO), ORDER_CALC_NOT_EXISTS);
+    }
+
+    @Test
+    public void testDeleteOrderCalc_success() {
+        // mock 数据
+        OrderCalcDO dbOrderCalc = randomPojo(OrderCalcDO.class);
+        orderCalcMapper.insert(dbOrderCalc);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        Long id = dbOrderCalc.getId();
+
+        // 调用
+        orderCalcService.deleteOrderCalc(id);
+       // 校验数据不存在了
+       assertNull(orderCalcMapper.selectById(id));
+    }
+
+    @Test
+    public void testDeleteOrderCalc_notExists() {
+        // 准备参数
+        Long id = randomLongId();
+
+        // 调用, 并断言异常
+        assertServiceException(() -> orderCalcService.deleteOrderCalc(id), ORDER_CALC_NOT_EXISTS);
+    }
+
+    @Test
+    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
+    public void testGetOrderCalcPage() {
+       // mock 数据
+       OrderCalcDO dbOrderCalc = randomPojo(OrderCalcDO.class, o -> { // 等会查询到
+           o.setOrderNo(null);
+           o.setUserId(null);
+           o.setPrice(null);
+           o.setCost(null);
+           o.setGrossProfit(null);
+           o.setGrossProfitUserQuota(null);
+           o.setGrossProfitAncestorQuota(null);
+           o.setGrossProfitBonusQuota(null);
+           o.setGrossProfitPlatformQuota(null);
+           o.setCreateTime(null);
+       });
+       orderCalcMapper.insert(dbOrderCalc);
+       // 测试 orderNo 不匹配
+       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setOrderNo(null)));
+       // 测试 userId 不匹配
+       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setUserId(null)));
+       // 测试 price 不匹配
+       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setPrice(null)));
+       // 测试 cost 不匹配
+       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setCost(null)));
+       // 测试 grossProfit 不匹配
+       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setGrossProfit(null)));
+       // 测试 grossProfitUserQuota 不匹配
+       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setGrossProfitUserQuota(null)));
+       // 测试 grossProfitAncestorQuota 不匹配
+       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setGrossProfitAncestorQuota(null)));
+       // 测试 grossProfitBonusQuota 不匹配
+       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setGrossProfitBonusQuota(null)));
+       // 测试 grossProfitPlatformQuota 不匹配
+       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setGrossProfitPlatformQuota(null)));
+       // 测试 createTime 不匹配
+       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setCreateTime(null)));
+       // 准备参数
+       OrderCalcPageReqVO reqVO = new OrderCalcPageReqVO();
+       reqVO.setOrderNo(null);
+       reqVO.setUserId(null);
+       reqVO.setPrice(null);
+       reqVO.setCost(null);
+       reqVO.setGrossProfit(null);
+       reqVO.setGrossProfitUserQuota(null);
+       reqVO.setGrossProfitAncestorQuota(null);
+       reqVO.setGrossProfitBonusQuota(null);
+       reqVO.setGrossProfitPlatformQuota(null);
+       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
+
+       // 调用
+       PageResult<OrderCalcDO> pageResult = orderCalcService.getOrderCalcPage(reqVO);
+       // 断言
+       assertEquals(1, pageResult.getTotal());
+       assertEquals(1, pageResult.getList().size());
+       assertPojoEquals(dbOrderCalc, pageResult.getList().get(0));
+    }
+
+}

+ 154 - 0
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/orderpercentage/OrderPercentageServiceImplTest.java

@@ -0,0 +1,154 @@
+package cn.newfeifan.mall.module.distri.service.orderpercentage;
+
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.mock.mockito.MockBean;
+
+import javax.annotation.Resource;
+
+import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
+
+import cn.newfeifan.mall.module.distri.controller.admin.orderpercentage.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.orderpercentage.OrderPercentageDO;
+import cn.newfeifan.mall.module.distri.dal.mysql.orderpercentage.OrderPercentageMapper;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+import javax.annotation.Resource;
+import org.springframework.context.annotation.Import;
+import java.util.*;
+import java.time.LocalDateTime;
+
+import static cn.hutool.core.util.RandomUtil.*;
+import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
+import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
+import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
+import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
+import static org.junit.jupiter.api.Assertions.*;
+import static org.mockito.Mockito.*;
+
+/**
+ * {@link OrderPercentageServiceImpl} 的单元测试类
+ *
+ * @author 非繁人
+ */
+@Import(OrderPercentageServiceImpl.class)
+public class OrderPercentageServiceImplTest extends BaseDbUnitTest {
+
+    @Resource
+    private OrderPercentageServiceImpl orderPercentageService;
+
+    @Resource
+    private OrderPercentageMapper orderPercentageMapper;
+
+    @Test
+    public void testCreateOrderPercentage_success() {
+        // 准备参数
+        OrderPercentageSaveReqVO createReqVO = randomPojo(OrderPercentageSaveReqVO.class).setId(null);
+
+        // 调用
+        Long orderPercentageId = orderPercentageService.createOrderPercentage(createReqVO);
+        // 断言
+        assertNotNull(orderPercentageId);
+        // 校验记录的属性是否正确
+        OrderPercentageDO orderPercentage = orderPercentageMapper.selectById(orderPercentageId);
+        assertPojoEquals(createReqVO, orderPercentage, "id");
+    }
+
+    @Test
+    public void testUpdateOrderPercentage_success() {
+        // mock 数据
+        OrderPercentageDO dbOrderPercentage = randomPojo(OrderPercentageDO.class);
+        orderPercentageMapper.insert(dbOrderPercentage);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        OrderPercentageSaveReqVO updateReqVO = randomPojo(OrderPercentageSaveReqVO.class, o -> {
+            o.setId(dbOrderPercentage.getId()); // 设置更新的 ID
+        });
+
+        // 调用
+        orderPercentageService.updateOrderPercentage(updateReqVO);
+        // 校验是否更新正确
+        OrderPercentageDO orderPercentage = orderPercentageMapper.selectById(updateReqVO.getId()); // 获取最新的
+        assertPojoEquals(updateReqVO, orderPercentage);
+    }
+
+    @Test
+    public void testUpdateOrderPercentage_notExists() {
+        // 准备参数
+        OrderPercentageSaveReqVO updateReqVO = randomPojo(OrderPercentageSaveReqVO.class);
+
+        // 调用, 并断言异常
+        assertServiceException(() -> orderPercentageService.updateOrderPercentage(updateReqVO), ORDER_PERCENTAGE_NOT_EXISTS);
+    }
+
+    @Test
+    public void testDeleteOrderPercentage_success() {
+        // mock 数据
+        OrderPercentageDO dbOrderPercentage = randomPojo(OrderPercentageDO.class);
+        orderPercentageMapper.insert(dbOrderPercentage);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        Long id = dbOrderPercentage.getId();
+
+        // 调用
+        orderPercentageService.deleteOrderPercentage(id);
+       // 校验数据不存在了
+       assertNull(orderPercentageMapper.selectById(id));
+    }
+
+    @Test
+    public void testDeleteOrderPercentage_notExists() {
+        // 准备参数
+        Long id = randomLongId();
+
+        // 调用, 并断言异常
+        assertServiceException(() -> orderPercentageService.deleteOrderPercentage(id), ORDER_PERCENTAGE_NOT_EXISTS);
+    }
+
+    @Test
+    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
+    public void testGetOrderPercentagePage() {
+       // mock 数据
+       OrderPercentageDO dbOrderPercentage = randomPojo(OrderPercentageDO.class, o -> { // 等会查询到
+           o.setGrossProfitPerc(null);
+           o.setGrossProfitUserQuotaPerc(null);
+           o.setGrossProfitAncestorQuotaPerc(null);
+           o.setGrossProfitBonusQuotaPerc(null);
+           o.setGrossProfitPlatformQuotaPerc(null);
+           o.setDivideIntoPerc(null);
+           o.setCreateTime(null);
+       });
+       orderPercentageMapper.insert(dbOrderPercentage);
+       // 测试 grossProfitPerc 不匹配
+       orderPercentageMapper.insert(cloneIgnoreId(dbOrderPercentage, o -> o.setGrossProfitPerc(null)));
+       // 测试 grossProfitUserQuotaPerc 不匹配
+       orderPercentageMapper.insert(cloneIgnoreId(dbOrderPercentage, o -> o.setGrossProfitUserQuotaPerc(null)));
+       // 测试 grossProfitAncestorQuotaPerc 不匹配
+       orderPercentageMapper.insert(cloneIgnoreId(dbOrderPercentage, o -> o.setGrossProfitAncestorQuotaPerc(null)));
+       // 测试 grossProfitBonusQuotaPerc 不匹配
+       orderPercentageMapper.insert(cloneIgnoreId(dbOrderPercentage, o -> o.setGrossProfitBonusQuotaPerc(null)));
+       // 测试 grossProfitPlatformQuotaPerc 不匹配
+       orderPercentageMapper.insert(cloneIgnoreId(dbOrderPercentage, o -> o.setGrossProfitPlatformQuotaPerc(null)));
+       // 测试 divideIntoPerc 不匹配
+       orderPercentageMapper.insert(cloneIgnoreId(dbOrderPercentage, o -> o.setDivideIntoPerc(null)));
+       // 测试 createTime 不匹配
+       orderPercentageMapper.insert(cloneIgnoreId(dbOrderPercentage, o -> o.setCreateTime(null)));
+       // 准备参数
+       OrderPercentagePageReqVO reqVO = new OrderPercentagePageReqVO();
+       reqVO.setGrossProfitPerc(null);
+       reqVO.setGrossProfitUserQuotaPerc(null);
+       reqVO.setGrossProfitAncestorQuotaPerc(null);
+       reqVO.setGrossProfitBonusQuotaPerc(null);
+       reqVO.setGrossProfitPlatformQuotaPerc(null);
+       reqVO.setDivideIntoPerc(null);
+       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
+
+       // 调用
+       PageResult<OrderPercentageDO> pageResult = orderPercentageService.getOrderPercentagePage(reqVO);
+       // 断言
+       assertEquals(1, pageResult.getTotal());
+       assertEquals(1, pageResult.getList().size());
+       assertPojoEquals(dbOrderPercentage, pageResult.getList().get(0));
+    }
+
+}

+ 154 - 0
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/partitionbrothers/PartitionBrothersServiceImplTest.java

@@ -0,0 +1,154 @@
+package cn.newfeifan.mall.module.distri.service.partitionbrothers;
+
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.mock.mockito.MockBean;
+
+import javax.annotation.Resource;
+
+import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
+
+import cn.newfeifan.mall.module.distri.controller.admin.partitionbrothers.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.partitionbrothers.PartitionBrothersDO;
+import cn.newfeifan.mall.module.distri.dal.mysql.partitionbrothers.PartitionBrothersMapper;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+import javax.annotation.Resource;
+import org.springframework.context.annotation.Import;
+import java.util.*;
+import java.time.LocalDateTime;
+
+import static cn.hutool.core.util.RandomUtil.*;
+import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
+import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
+import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
+import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
+import static org.junit.jupiter.api.Assertions.*;
+import static org.mockito.Mockito.*;
+
+/**
+ * {@link PartitionBrothersServiceImpl} 的单元测试类
+ *
+ * @author 非繁人
+ */
+@Import(PartitionBrothersServiceImpl.class)
+public class PartitionBrothersServiceImplTest extends BaseDbUnitTest {
+
+    @Resource
+    private PartitionBrothersServiceImpl partitionBrothersService;
+
+    @Resource
+    private PartitionBrothersMapper partitionBrothersMapper;
+
+    @Test
+    public void testCreatePartitionBrothers_success() {
+        // 准备参数
+        PartitionBrothersSaveReqVO createReqVO = randomPojo(PartitionBrothersSaveReqVO.class).setId(null);
+
+        // 调用
+        Long partitionBrothersId = partitionBrothersService.createPartitionBrothers(createReqVO);
+        // 断言
+        assertNotNull(partitionBrothersId);
+        // 校验记录的属性是否正确
+        PartitionBrothersDO partitionBrothers = partitionBrothersMapper.selectById(partitionBrothersId);
+        assertPojoEquals(createReqVO, partitionBrothers, "id");
+    }
+
+    @Test
+    public void testUpdatePartitionBrothers_success() {
+        // mock 数据
+        PartitionBrothersDO dbPartitionBrothers = randomPojo(PartitionBrothersDO.class);
+        partitionBrothersMapper.insert(dbPartitionBrothers);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        PartitionBrothersSaveReqVO updateReqVO = randomPojo(PartitionBrothersSaveReqVO.class, o -> {
+            o.setId(dbPartitionBrothers.getId()); // 设置更新的 ID
+        });
+
+        // 调用
+        partitionBrothersService.updatePartitionBrothers(updateReqVO);
+        // 校验是否更新正确
+        PartitionBrothersDO partitionBrothers = partitionBrothersMapper.selectById(updateReqVO.getId()); // 获取最新的
+        assertPojoEquals(updateReqVO, partitionBrothers);
+    }
+
+    @Test
+    public void testUpdatePartitionBrothers_notExists() {
+        // 准备参数
+        PartitionBrothersSaveReqVO updateReqVO = randomPojo(PartitionBrothersSaveReqVO.class);
+
+        // 调用, 并断言异常
+        assertServiceException(() -> partitionBrothersService.updatePartitionBrothers(updateReqVO), PARTITION_BROTHERS_NOT_EXISTS);
+    }
+
+    @Test
+    public void testDeletePartitionBrothers_success() {
+        // mock 数据
+        PartitionBrothersDO dbPartitionBrothers = randomPojo(PartitionBrothersDO.class);
+        partitionBrothersMapper.insert(dbPartitionBrothers);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        Long id = dbPartitionBrothers.getId();
+
+        // 调用
+        partitionBrothersService.deletePartitionBrothers(id);
+       // 校验数据不存在了
+       assertNull(partitionBrothersMapper.selectById(id));
+    }
+
+    @Test
+    public void testDeletePartitionBrothers_notExists() {
+        // 准备参数
+        Long id = randomLongId();
+
+        // 调用, 并断言异常
+        assertServiceException(() -> partitionBrothersService.deletePartitionBrothers(id), PARTITION_BROTHERS_NOT_EXISTS);
+    }
+
+    @Test
+    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
+    public void testGetPartitionBrothersPage() {
+       // mock 数据
+       PartitionBrothersDO dbPartitionBrothers = randomPojo(PartitionBrothersDO.class, o -> { // 等会查询到
+           o.setUserId(null);
+           o.setPartNo(null);
+           o.setPrice(null);
+           o.setHasHit(null);
+           o.setAfterHitQuota(null);
+           o.setSize(null);
+           o.setCreateTime(null);
+       });
+       partitionBrothersMapper.insert(dbPartitionBrothers);
+       // 测试 userId 不匹配
+       partitionBrothersMapper.insert(cloneIgnoreId(dbPartitionBrothers, o -> o.setUserId(null)));
+       // 测试 partNo 不匹配
+       partitionBrothersMapper.insert(cloneIgnoreId(dbPartitionBrothers, o -> o.setPartNo(null)));
+       // 测试 price 不匹配
+       partitionBrothersMapper.insert(cloneIgnoreId(dbPartitionBrothers, o -> o.setPrice(null)));
+       // 测试 hasHit 不匹配
+       partitionBrothersMapper.insert(cloneIgnoreId(dbPartitionBrothers, o -> o.setHasHit(null)));
+       // 测试 afterHitQuota 不匹配
+       partitionBrothersMapper.insert(cloneIgnoreId(dbPartitionBrothers, o -> o.setAfterHitQuota(null)));
+       // 测试 size 不匹配
+       partitionBrothersMapper.insert(cloneIgnoreId(dbPartitionBrothers, o -> o.setSize(null)));
+       // 测试 createTime 不匹配
+       partitionBrothersMapper.insert(cloneIgnoreId(dbPartitionBrothers, o -> o.setCreateTime(null)));
+       // 准备参数
+       PartitionBrothersPageReqVO reqVO = new PartitionBrothersPageReqVO();
+       reqVO.setUserId(null);
+       reqVO.setPartNo(null);
+       reqVO.setPrice(null);
+       reqVO.setHasHit(null);
+       reqVO.setAfterHitQuota(null);
+       reqVO.setSize(null);
+       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
+
+       // 调用
+       PageResult<PartitionBrothersDO> pageResult = partitionBrothersService.getPartitionBrothersPage(reqVO);
+       // 断言
+       assertEquals(1, pageResult.getTotal());
+       assertEquals(1, pageResult.getList().size());
+       assertPojoEquals(dbPartitionBrothers, pageResult.getList().get(0));
+    }
+
+}

+ 154 - 0
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/partitionson/PartitionSonServiceImplTest.java

@@ -0,0 +1,154 @@
+package cn.newfeifan.mall.module.distri.service.partitionson;
+
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.mock.mockito.MockBean;
+
+import javax.annotation.Resource;
+
+import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
+
+import cn.newfeifan.mall.module.distri.controller.admin.partitionson.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.partitionson.PartitionSonDO;
+import cn.newfeifan.mall.module.distri.dal.mysql.partitionson.PartitionSonMapper;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+import javax.annotation.Resource;
+import org.springframework.context.annotation.Import;
+import java.util.*;
+import java.time.LocalDateTime;
+
+import static cn.hutool.core.util.RandomUtil.*;
+import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
+import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
+import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
+import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
+import static org.junit.jupiter.api.Assertions.*;
+import static org.mockito.Mockito.*;
+
+/**
+ * {@link PartitionSonServiceImpl} 的单元测试类
+ *
+ * @author 非繁人
+ */
+@Import(PartitionSonServiceImpl.class)
+public class PartitionSonServiceImplTest extends BaseDbUnitTest {
+
+    @Resource
+    private PartitionSonServiceImpl partitionSonService;
+
+    @Resource
+    private PartitionSonMapper partitionSonMapper;
+
+    @Test
+    public void testCreatePartitionSon_success() {
+        // 准备参数
+        PartitionSonSaveReqVO createReqVO = randomPojo(PartitionSonSaveReqVO.class).setId(null);
+
+        // 调用
+        Long partitionSonId = partitionSonService.createPartitionSon(createReqVO);
+        // 断言
+        assertNotNull(partitionSonId);
+        // 校验记录的属性是否正确
+        PartitionSonDO partitionSon = partitionSonMapper.selectById(partitionSonId);
+        assertPojoEquals(createReqVO, partitionSon, "id");
+    }
+
+    @Test
+    public void testUpdatePartitionSon_success() {
+        // mock 数据
+        PartitionSonDO dbPartitionSon = randomPojo(PartitionSonDO.class);
+        partitionSonMapper.insert(dbPartitionSon);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        PartitionSonSaveReqVO updateReqVO = randomPojo(PartitionSonSaveReqVO.class, o -> {
+            o.setId(dbPartitionSon.getId()); // 设置更新的 ID
+        });
+
+        // 调用
+        partitionSonService.updatePartitionSon(updateReqVO);
+        // 校验是否更新正确
+        PartitionSonDO partitionSon = partitionSonMapper.selectById(updateReqVO.getId()); // 获取最新的
+        assertPojoEquals(updateReqVO, partitionSon);
+    }
+
+    @Test
+    public void testUpdatePartitionSon_notExists() {
+        // 准备参数
+        PartitionSonSaveReqVO updateReqVO = randomPojo(PartitionSonSaveReqVO.class);
+
+        // 调用, 并断言异常
+        assertServiceException(() -> partitionSonService.updatePartitionSon(updateReqVO), PARTITION_SON_NOT_EXISTS);
+    }
+
+    @Test
+    public void testDeletePartitionSon_success() {
+        // mock 数据
+        PartitionSonDO dbPartitionSon = randomPojo(PartitionSonDO.class);
+        partitionSonMapper.insert(dbPartitionSon);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        Long id = dbPartitionSon.getId();
+
+        // 调用
+        partitionSonService.deletePartitionSon(id);
+       // 校验数据不存在了
+       assertNull(partitionSonMapper.selectById(id));
+    }
+
+    @Test
+    public void testDeletePartitionSon_notExists() {
+        // 准备参数
+        Long id = randomLongId();
+
+        // 调用, 并断言异常
+        assertServiceException(() -> partitionSonService.deletePartitionSon(id), PARTITION_SON_NOT_EXISTS);
+    }
+
+    @Test
+    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
+    public void testGetPartitionSonPage() {
+       // mock 数据
+       PartitionSonDO dbPartitionSon = randomPojo(PartitionSonDO.class, o -> { // 等会查询到
+           o.setUserId(null);
+           o.setPartNo(null);
+           o.setPrice(null);
+           o.setHasHit(null);
+           o.setAfterHitQuota(null);
+           o.setSize(null);
+           o.setCreateTime(null);
+       });
+       partitionSonMapper.insert(dbPartitionSon);
+       // 测试 userId 不匹配
+       partitionSonMapper.insert(cloneIgnoreId(dbPartitionSon, o -> o.setUserId(null)));
+       // 测试 partNo 不匹配
+       partitionSonMapper.insert(cloneIgnoreId(dbPartitionSon, o -> o.setPartNo(null)));
+       // 测试 price 不匹配
+       partitionSonMapper.insert(cloneIgnoreId(dbPartitionSon, o -> o.setPrice(null)));
+       // 测试 hasHit 不匹配
+       partitionSonMapper.insert(cloneIgnoreId(dbPartitionSon, o -> o.setHasHit(null)));
+       // 测试 afterHitQuota 不匹配
+       partitionSonMapper.insert(cloneIgnoreId(dbPartitionSon, o -> o.setAfterHitQuota(null)));
+       // 测试 size 不匹配
+       partitionSonMapper.insert(cloneIgnoreId(dbPartitionSon, o -> o.setSize(null)));
+       // 测试 createTime 不匹配
+       partitionSonMapper.insert(cloneIgnoreId(dbPartitionSon, o -> o.setCreateTime(null)));
+       // 准备参数
+       PartitionSonPageReqVO reqVO = new PartitionSonPageReqVO();
+       reqVO.setUserId(null);
+       reqVO.setPartNo(null);
+       reqVO.setPrice(null);
+       reqVO.setHasHit(null);
+       reqVO.setAfterHitQuota(null);
+       reqVO.setSize(null);
+       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
+
+       // 调用
+       PageResult<PartitionSonDO> pageResult = partitionSonService.getPartitionSonPage(reqVO);
+       // 断言
+       assertEquals(1, pageResult.getTotal());
+       assertEquals(1, pageResult.getList().size());
+       assertPojoEquals(dbPartitionSon, pageResult.getList().get(0));
+    }
+
+}

+ 146 - 0
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/sharepath/SharePathServiceImplTest.java

@@ -0,0 +1,146 @@
+package cn.newfeifan.mall.module.distri.service.sharepath;
+
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.mock.mockito.MockBean;
+
+import javax.annotation.Resource;
+
+import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
+
+import cn.newfeifan.mall.module.distri.controller.admin.sharepath.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.sharepath.SharePathDO;
+import cn.newfeifan.mall.module.distri.dal.mysql.sharepath.SharePathMapper;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+import javax.annotation.Resource;
+import org.springframework.context.annotation.Import;
+import java.util.*;
+import java.time.LocalDateTime;
+
+import static cn.hutool.core.util.RandomUtil.*;
+import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
+import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
+import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
+import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
+import static org.junit.jupiter.api.Assertions.*;
+import static org.mockito.Mockito.*;
+
+/**
+ * {@link SharePathServiceImpl} 的单元测试类
+ *
+ * @author 非繁人
+ */
+@Import(SharePathServiceImpl.class)
+public class SharePathServiceImplTest extends BaseDbUnitTest {
+
+    @Resource
+    private SharePathServiceImpl sharePathService;
+
+    @Resource
+    private SharePathMapper sharePathMapper;
+
+    @Test
+    public void testCreateSharePath_success() {
+        // 准备参数
+        SharePathSaveReqVO createReqVO = randomPojo(SharePathSaveReqVO.class).setId(null);
+
+        // 调用
+        Long sharePathId = sharePathService.createSharePath(createReqVO);
+        // 断言
+        assertNotNull(sharePathId);
+        // 校验记录的属性是否正确
+        SharePathDO sharePath = sharePathMapper.selectById(sharePathId);
+        assertPojoEquals(createReqVO, sharePath, "id");
+    }
+
+    @Test
+    public void testUpdateSharePath_success() {
+        // mock 数据
+        SharePathDO dbSharePath = randomPojo(SharePathDO.class);
+        sharePathMapper.insert(dbSharePath);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        SharePathSaveReqVO updateReqVO = randomPojo(SharePathSaveReqVO.class, o -> {
+            o.setId(dbSharePath.getId()); // 设置更新的 ID
+        });
+
+        // 调用
+        sharePathService.updateSharePath(updateReqVO);
+        // 校验是否更新正确
+        SharePathDO sharePath = sharePathMapper.selectById(updateReqVO.getId()); // 获取最新的
+        assertPojoEquals(updateReqVO, sharePath);
+    }
+
+    @Test
+    public void testUpdateSharePath_notExists() {
+        // 准备参数
+        SharePathSaveReqVO updateReqVO = randomPojo(SharePathSaveReqVO.class);
+
+        // 调用, 并断言异常
+        assertServiceException(() -> sharePathService.updateSharePath(updateReqVO), SHARE_PATH_NOT_EXISTS);
+    }
+
+    @Test
+    public void testDeleteSharePath_success() {
+        // mock 数据
+        SharePathDO dbSharePath = randomPojo(SharePathDO.class);
+        sharePathMapper.insert(dbSharePath);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        Long id = dbSharePath.getId();
+
+        // 调用
+        sharePathService.deleteSharePath(id);
+       // 校验数据不存在了
+       assertNull(sharePathMapper.selectById(id));
+    }
+
+    @Test
+    public void testDeleteSharePath_notExists() {
+        // 准备参数
+        Long id = randomLongId();
+
+        // 调用, 并断言异常
+        assertServiceException(() -> sharePathService.deleteSharePath(id), SHARE_PATH_NOT_EXISTS);
+    }
+
+    @Test
+    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
+    public void testGetSharePathPage() {
+       // mock 数据
+       SharePathDO dbSharePath = randomPojo(SharePathDO.class, o -> { // 等会查询到
+           o.setDepth(null);
+           o.setCreateTime(null);
+           o.setAncestor(null);
+           o.setDescendant(null);
+           o.setSort(null);
+       });
+       sharePathMapper.insert(dbSharePath);
+       // 测试 depth 不匹配
+       sharePathMapper.insert(cloneIgnoreId(dbSharePath, o -> o.setDepth(null)));
+       // 测试 createTime 不匹配
+       sharePathMapper.insert(cloneIgnoreId(dbSharePath, o -> o.setCreateTime(null)));
+       // 测试 ancestor 不匹配
+       sharePathMapper.insert(cloneIgnoreId(dbSharePath, o -> o.setAncestor(null)));
+       // 测试 descendant 不匹配
+       sharePathMapper.insert(cloneIgnoreId(dbSharePath, o -> o.setDescendant(null)));
+       // 测试 sort 不匹配
+       sharePathMapper.insert(cloneIgnoreId(dbSharePath, o -> o.setSort(null)));
+       // 准备参数
+       SharePathPageReqVO reqVO = new SharePathPageReqVO();
+       reqVO.setDepth(null);
+       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
+       reqVO.setAncestor(null);
+       reqVO.setDescendant(null);
+       reqVO.setSort(null);
+
+       // 调用
+       PageResult<SharePathDO> pageResult = sharePathService.getSharePathPage(reqVO);
+       // 断言
+       assertEquals(1, pageResult.getTotal());
+       assertEquals(1, pageResult.getList().size());
+       assertPojoEquals(dbSharePath, pageResult.getList().get(0));
+    }
+
+}

+ 142 - 0
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/socialstatus/SocialStatusServiceImplTest.java

@@ -0,0 +1,142 @@
+package cn.newfeifan.mall.module.distri.service.socialstatus;
+
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.mock.mockito.MockBean;
+
+import javax.annotation.Resource;
+
+import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
+
+import cn.newfeifan.mall.module.distri.controller.admin.socialstatus.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.socialstatus.SocialStatusDO;
+import cn.newfeifan.mall.module.distri.dal.mysql.socialstatus.SocialStatusMapper;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+import javax.annotation.Resource;
+import org.springframework.context.annotation.Import;
+import java.util.*;
+import java.time.LocalDateTime;
+
+import static cn.hutool.core.util.RandomUtil.*;
+import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
+import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
+import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
+import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
+import static org.junit.jupiter.api.Assertions.*;
+import static org.mockito.Mockito.*;
+
+/**
+ * {@link SocialStatusServiceImpl} 的单元测试类
+ *
+ * @author 非繁人
+ */
+@Import(SocialStatusServiceImpl.class)
+public class SocialStatusServiceImplTest extends BaseDbUnitTest {
+
+    @Resource
+    private SocialStatusServiceImpl socialStatusService;
+
+    @Resource
+    private SocialStatusMapper socialStatusMapper;
+
+    @Test
+    public void testCreateSocialStatus_success() {
+        // 准备参数
+        SocialStatusSaveReqVO createReqVO = randomPojo(SocialStatusSaveReqVO.class).setId(null);
+
+        // 调用
+        Long socialStatusId = socialStatusService.createSocialStatus(createReqVO);
+        // 断言
+        assertNotNull(socialStatusId);
+        // 校验记录的属性是否正确
+        SocialStatusDO socialStatus = socialStatusMapper.selectById(socialStatusId);
+        assertPojoEquals(createReqVO, socialStatus, "id");
+    }
+
+    @Test
+    public void testUpdateSocialStatus_success() {
+        // mock 数据
+        SocialStatusDO dbSocialStatus = randomPojo(SocialStatusDO.class);
+        socialStatusMapper.insert(dbSocialStatus);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        SocialStatusSaveReqVO updateReqVO = randomPojo(SocialStatusSaveReqVO.class, o -> {
+            o.setId(dbSocialStatus.getId()); // 设置更新的 ID
+        });
+
+        // 调用
+        socialStatusService.updateSocialStatus(updateReqVO);
+        // 校验是否更新正确
+        SocialStatusDO socialStatus = socialStatusMapper.selectById(updateReqVO.getId()); // 获取最新的
+        assertPojoEquals(updateReqVO, socialStatus);
+    }
+
+    @Test
+    public void testUpdateSocialStatus_notExists() {
+        // 准备参数
+        SocialStatusSaveReqVO updateReqVO = randomPojo(SocialStatusSaveReqVO.class);
+
+        // 调用, 并断言异常
+        assertServiceException(() -> socialStatusService.updateSocialStatus(updateReqVO), SOCIAL_STATUS_NOT_EXISTS);
+    }
+
+    @Test
+    public void testDeleteSocialStatus_success() {
+        // mock 数据
+        SocialStatusDO dbSocialStatus = randomPojo(SocialStatusDO.class);
+        socialStatusMapper.insert(dbSocialStatus);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        Long id = dbSocialStatus.getId();
+
+        // 调用
+        socialStatusService.deleteSocialStatus(id);
+       // 校验数据不存在了
+       assertNull(socialStatusMapper.selectById(id));
+    }
+
+    @Test
+    public void testDeleteSocialStatus_notExists() {
+        // 准备参数
+        Long id = randomLongId();
+
+        // 调用, 并断言异常
+        assertServiceException(() -> socialStatusService.deleteSocialStatus(id), SOCIAL_STATUS_NOT_EXISTS);
+    }
+
+    @Test
+    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
+    public void testGetSocialStatusPage() {
+       // mock 数据
+       SocialStatusDO dbSocialStatus = randomPojo(SocialStatusDO.class, o -> { // 等会查询到
+           o.setLevel(null);
+           o.setName(null);
+           o.setCreateTime(null);
+           o.setPoint(null);
+       });
+       socialStatusMapper.insert(dbSocialStatus);
+       // 测试 level 不匹配
+       socialStatusMapper.insert(cloneIgnoreId(dbSocialStatus, o -> o.setLevel(null)));
+       // 测试 name 不匹配
+       socialStatusMapper.insert(cloneIgnoreId(dbSocialStatus, o -> o.setName(null)));
+       // 测试 createTime 不匹配
+       socialStatusMapper.insert(cloneIgnoreId(dbSocialStatus, o -> o.setCreateTime(null)));
+       // 测试 point 不匹配
+       socialStatusMapper.insert(cloneIgnoreId(dbSocialStatus, o -> o.setPoint(null)));
+       // 准备参数
+       SocialStatusPageReqVO reqVO = new SocialStatusPageReqVO();
+       reqVO.setLevel(null);
+       reqVO.setName(null);
+       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
+       reqVO.setPoint(null);
+
+       // 调用
+       PageResult<SocialStatusDO> pageResult = socialStatusService.getSocialStatusPage(reqVO);
+       // 断言
+       assertEquals(1, pageResult.getTotal());
+       assertEquals(1, pageResult.getList().size());
+       assertPojoEquals(dbSocialStatus, pageResult.getList().get(0));
+    }
+
+}

+ 134 - 0
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/source/SourceServiceImplTest.java

@@ -0,0 +1,134 @@
+package cn.newfeifan.mall.module.distri.service.source;
+
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.mock.mockito.MockBean;
+
+import javax.annotation.Resource;
+
+import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
+
+import cn.newfeifan.mall.module.distri.controller.admin.source.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.source.SourceDO;
+import cn.newfeifan.mall.module.distri.dal.mysql.source.SourceMapper;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+import javax.annotation.Resource;
+import org.springframework.context.annotation.Import;
+import java.util.*;
+import java.time.LocalDateTime;
+
+import static cn.hutool.core.util.RandomUtil.*;
+import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
+import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
+import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
+import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
+import static org.junit.jupiter.api.Assertions.*;
+import static org.mockito.Mockito.*;
+
+/**
+ * {@link SourceServiceImpl} 的单元测试类
+ *
+ * @author 非繁人
+ */
+@Import(SourceServiceImpl.class)
+public class SourceServiceImplTest extends BaseDbUnitTest {
+
+    @Resource
+    private SourceServiceImpl sourceService;
+
+    @Resource
+    private SourceMapper sourceMapper;
+
+    @Test
+    public void testCreateSource_success() {
+        // 准备参数
+        SourceSaveReqVO createReqVO = randomPojo(SourceSaveReqVO.class).setId(null);
+
+        // 调用
+        Long sourceId = sourceService.createSource(createReqVO);
+        // 断言
+        assertNotNull(sourceId);
+        // 校验记录的属性是否正确
+        SourceDO source = sourceMapper.selectById(sourceId);
+        assertPojoEquals(createReqVO, source, "id");
+    }
+
+    @Test
+    public void testUpdateSource_success() {
+        // mock 数据
+        SourceDO dbSource = randomPojo(SourceDO.class);
+        sourceMapper.insert(dbSource);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        SourceSaveReqVO updateReqVO = randomPojo(SourceSaveReqVO.class, o -> {
+            o.setId(dbSource.getId()); // 设置更新的 ID
+        });
+
+        // 调用
+        sourceService.updateSource(updateReqVO);
+        // 校验是否更新正确
+        SourceDO source = sourceMapper.selectById(updateReqVO.getId()); // 获取最新的
+        assertPojoEquals(updateReqVO, source);
+    }
+
+    @Test
+    public void testUpdateSource_notExists() {
+        // 准备参数
+        SourceSaveReqVO updateReqVO = randomPojo(SourceSaveReqVO.class);
+
+        // 调用, 并断言异常
+        assertServiceException(() -> sourceService.updateSource(updateReqVO), SOURCE_NOT_EXISTS);
+    }
+
+    @Test
+    public void testDeleteSource_success() {
+        // mock 数据
+        SourceDO dbSource = randomPojo(SourceDO.class);
+        sourceMapper.insert(dbSource);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        Long id = dbSource.getId();
+
+        // 调用
+        sourceService.deleteSource(id);
+       // 校验数据不存在了
+       assertNull(sourceMapper.selectById(id));
+    }
+
+    @Test
+    public void testDeleteSource_notExists() {
+        // 准备参数
+        Long id = randomLongId();
+
+        // 调用, 并断言异常
+        assertServiceException(() -> sourceService.deleteSource(id), SOURCE_NOT_EXISTS);
+    }
+
+    @Test
+    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
+    public void testGetSourcePage() {
+       // mock 数据
+       SourceDO dbSource = randomPojo(SourceDO.class, o -> { // 等会查询到
+           o.setName(null);
+           o.setCreateTime(null);
+       });
+       sourceMapper.insert(dbSource);
+       // 测试 name 不匹配
+       sourceMapper.insert(cloneIgnoreId(dbSource, o -> o.setName(null)));
+       // 测试 createTime 不匹配
+       sourceMapper.insert(cloneIgnoreId(dbSource, o -> o.setCreateTime(null)));
+       // 准备参数
+       SourcePageReqVO reqVO = new SourcePageReqVO();
+       reqVO.setName(null);
+       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
+
+       // 调用
+       PageResult<SourceDO> pageResult = sourceService.getSourcePage(reqVO);
+       // 断言
+       assertEquals(1, pageResult.getTotal());
+       assertEquals(1, pageResult.getList().size());
+       assertPojoEquals(dbSource, pageResult.getList().get(0));
+    }
+
+}

+ 162 - 0
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/user/UserServiceImplTest.java

@@ -0,0 +1,162 @@
+package cn.newfeifan.mall.module.distri.service.user;
+
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.mock.mockito.MockBean;
+
+import javax.annotation.Resource;
+
+import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
+
+import cn.newfeifan.mall.module.distri.controller.admin.user.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.user.UserDO;
+import cn.newfeifan.mall.module.distri.dal.mysql.user.UserMapper;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+import javax.annotation.Resource;
+import org.springframework.context.annotation.Import;
+import java.util.*;
+import java.time.LocalDateTime;
+
+import static cn.hutool.core.util.RandomUtil.*;
+import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
+import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
+import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
+import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
+import static org.junit.jupiter.api.Assertions.*;
+import static org.mockito.Mockito.*;
+
+/**
+ * {@link UserServiceImpl} 的单元测试类
+ *
+ * @author 非繁人
+ */
+@Import(UserServiceImpl.class)
+public class UserServiceImplTest extends BaseDbUnitTest {
+
+    @Resource
+    private UserServiceImpl userService;
+
+    @Resource
+    private UserMapper userMapper;
+
+    @Test
+    public void testCreateUser_success() {
+        // 准备参数
+        UserSaveReqVO createReqVO = randomPojo(UserSaveReqVO.class).setId(null);
+
+        // 调用
+        Long userId = userService.createUser(createReqVO);
+        // 断言
+        assertNotNull(userId);
+        // 校验记录的属性是否正确
+        UserDO user = userMapper.selectById(userId);
+        assertPojoEquals(createReqVO, user, "id");
+    }
+
+    @Test
+    public void testUpdateUser_success() {
+        // mock 数据
+        UserDO dbUser = randomPojo(UserDO.class);
+        userMapper.insert(dbUser);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        UserSaveReqVO updateReqVO = randomPojo(UserSaveReqVO.class, o -> {
+            o.setId(dbUser.getId()); // 设置更新的 ID
+        });
+
+        // 调用
+        userService.updateUser(updateReqVO);
+        // 校验是否更新正确
+        UserDO user = userMapper.selectById(updateReqVO.getId()); // 获取最新的
+        assertPojoEquals(updateReqVO, user);
+    }
+
+    @Test
+    public void testUpdateUser_notExists() {
+        // 准备参数
+        UserSaveReqVO updateReqVO = randomPojo(UserSaveReqVO.class);
+
+        // 调用, 并断言异常
+        assertServiceException(() -> userService.updateUser(updateReqVO), USER_NOT_EXISTS);
+    }
+
+    @Test
+    public void testDeleteUser_success() {
+        // mock 数据
+        UserDO dbUser = randomPojo(UserDO.class);
+        userMapper.insert(dbUser);// @Sql: 先插入出一条存在的数据
+        // 准备参数
+        Long id = dbUser.getId();
+
+        // 调用
+        userService.deleteUser(id);
+       // 校验数据不存在了
+       assertNull(userMapper.selectById(id));
+    }
+
+    @Test
+    public void testDeleteUser_notExists() {
+        // 准备参数
+        Long id = randomLongId();
+
+        // 调用, 并断言异常
+        assertServiceException(() -> userService.deleteUser(id), USER_NOT_EXISTS);
+    }
+
+    @Test
+    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
+    public void testGetUserPage() {
+       // mock 数据
+       UserDO dbUser = randomPojo(UserDO.class, o -> { // 等会查询到
+           o.setCreateTime(null);
+           o.setUserId(null);
+           o.setName(null);
+           o.setMobile(null);
+           o.setSource(null);
+           o.setIntegralId(null);
+           o.setSocialStatus(null);
+           o.setSocialStatusPoint(null);
+           o.setCategoryId(null);
+       });
+       userMapper.insert(dbUser);
+       // 测试 createTime 不匹配
+       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setCreateTime(null)));
+       // 测试 userId 不匹配
+       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setUserId(null)));
+       // 测试 name 不匹配
+       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setName(null)));
+       // 测试 mobile 不匹配
+       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setMobile(null)));
+       // 测试 source 不匹配
+       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setSource(null)));
+       // 测试 integralId 不匹配
+       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setIntegralId(null)));
+       // 测试 socialStatus 不匹配
+       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setSocialStatus(null)));
+       // 测试 socialStatusPoint 不匹配
+       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setSocialStatusPoint(null)));
+       // 测试 categoryId 不匹配
+       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setCategoryId(null)));
+       // 准备参数
+       UserPageReqVO reqVO = new UserPageReqVO();
+       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
+       reqVO.setUserId(null);
+       reqVO.setName(null);
+       reqVO.setMobile(null);
+       reqVO.setSource(null);
+       reqVO.setIntegralId(null);
+       reqVO.setSocialStatus(null);
+       reqVO.setSocialStatusPoint(null);
+       reqVO.setCategoryId(null);
+
+       // 调用
+       PageResult<UserDO> pageResult = userService.getUserPage(reqVO);
+       // 断言
+       assertEquals(1, pageResult.getTotal());
+       assertEquals(1, pageResult.getList().size());
+       assertPojoEquals(dbUser, pageResult.getList().get(0));
+    }
+
+}