Browse Source

增加营销模块, 增加添加新注册人员跟平台绑定的消息队列

gaohp 11 months ago
parent
commit
d8665f0a5a
100 changed files with 5315 additions and 0 deletions
  1. 61 0
      feifan-framework/feifan-common/src/main/java/cn/newfeifan/mall/framework/common/mq/message/order/DistriOrderMessage.java
  2. 38 0
      feifan-module-distri/feifan-module-distri-api/.gitignore
  3. 30 0
      feifan-module-distri/feifan-module-distri-api/pom.xml
  4. 10 0
      feifan-module-distri/feifan-module-distri-api/src/main/java/cn/newfeifan/mall/module/distri/constant/DistriConstants.java
  5. 24 0
      feifan-module-distri/feifan-module-distri-api/src/main/java/cn/newfeifan/mall/module/distri/enums/ErrorCodeConstants.java
  6. 121 0
      feifan-module-distri/feifan-module-distri-biz/pom.xml
  7. 95 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/duser/DuserController.java
  8. 46 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/duser/vo/DuserPageReqVO.java
  9. 56 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/duser/vo/DuserRespVO.java
  10. 48 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/duser/vo/DuserSaveReqVO.java
  11. 95 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integral/IntegralController.java
  12. 34 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integral/vo/IntegralPageReqVO.java
  13. 40 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integral/vo/IntegralRespVO.java
  14. 31 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integral/vo/IntegralSaveReqVO.java
  15. 95 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ordercalc/OrderCalcController.java
  16. 53 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ordercalc/vo/OrderCalcPageReqVO.java
  17. 62 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ordercalc/vo/OrderCalcRespVO.java
  18. 48 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ordercalc/vo/OrderCalcSaveReqVO.java
  19. 95 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/orderpercentage/OrderPercentageController.java
  20. 37 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/orderpercentage/vo/OrderPercentageDoubleSaveReqVO.java
  21. 41 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/orderpercentage/vo/OrderPercentagePageReqVO.java
  22. 49 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/orderpercentage/vo/OrderPercentageRespVO.java
  23. 39 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/orderpercentage/vo/OrderPercentageSaveReqVO.java
  24. 95 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionbrothers/PartitionBrothersController.java
  25. 40 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionbrothers/vo/PartitionBrothersPageReqVO.java
  26. 48 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionbrothers/vo/PartitionBrothersRespVO.java
  27. 34 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionbrothers/vo/PartitionBrothersSaveReqVO.java
  28. 95 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitioncrash/PartitionCrashController.java
  29. 37 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitioncrash/vo/PartitionCrashPageReqVO.java
  30. 44 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitioncrash/vo/PartitionCrashRespVO.java
  31. 30 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitioncrash/vo/PartitionCrashSaveReqVO.java
  32. 95 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionson/PartitionSonController.java
  33. 40 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionson/vo/PartitionSonPageReqVO.java
  34. 48 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionson/vo/PartitionSonRespVO.java
  35. 34 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/partitionson/vo/PartitionSonSaveReqVO.java
  36. 95 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofit/PtProfitController.java
  37. 31 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofit/vo/PtProfitPageReqVO.java
  38. 36 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofit/vo/PtProfitRespVO.java
  39. 28 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofit/vo/PtProfitSaveReqVO.java
  40. 95 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofitlog/PtProfitLogController.java
  41. 40 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofitlog/vo/PtProfitLogPageReqVO.java
  42. 47 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofitlog/vo/PtProfitLogRespVO.java
  43. 37 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofitlog/vo/PtProfitLogSaveReqVO.java
  44. 117 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/sharepath/SharePathController.java
  45. 34 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/sharepath/vo/SharePathPageReqVO.java
  46. 40 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/sharepath/vo/SharePathRespVO.java
  47. 34 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/sharepath/vo/SharePathSaveReqVO.java
  48. 18 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/sharepath/vo/SharePathtransFerenceRelaReqVO.java
  49. 18 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/sharepath/vo/TreeNode.java
  50. 95 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/socialstatus/SocialStatusController.java
  51. 31 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/socialstatus/vo/SocialStatusPageReqVO.java
  52. 36 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/socialstatus/vo/SocialStatusRespVO.java
  53. 31 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/socialstatus/vo/SocialStatusSaveReqVO.java
  54. 95 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/source/SourceController.java
  55. 25 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/source/vo/SourcePageReqVO.java
  56. 28 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/source/vo/SourceRespVO.java
  57. 19 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/source/vo/SourceSaveReqVO.java
  58. 63 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/duser/DuserDO.java
  59. 47 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/integral/IntegralDO.java
  60. 68 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/ordercalc/OrderCalcDO.java
  61. 57 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/orderpercentage/OrderPercentageDO.java
  62. 55 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/partitionbrothers/PartitionBrothersDO.java
  63. 51 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/partitioncrash/PartitionCrashDO.java
  64. 55 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/partitionson/PartitionSonDO.java
  65. 43 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/ptprofit/PtProfitDO.java
  66. 57 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/ptprofitlog/PtProfitLogDO.java
  67. 47 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/sharepath/SharePathDO.java
  68. 46 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/socialstatus/SocialStatusDO.java
  69. 35 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/source/SourceDO.java
  70. 34 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/duser/DuserMapper.java
  71. 30 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/integral/IntegralMapper.java
  72. 36 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/ordercalc/OrderCalcMapper.java
  73. 33 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/orderpercentage/OrderPercentageMapper.java
  74. 32 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/partitionbrothers/PartitionBrothersMapper.java
  75. 31 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/partitioncrash/PartitionCrashMapper.java
  76. 32 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/partitionson/PartitionSonMapper.java
  77. 29 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/ptprofit/PtProfitMapper.java
  78. 31 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/ptprofitlog/PtProfitLogMapper.java
  79. 41 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/sharepath/SharePathMapper.java
  80. 29 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/socialstatus/SocialStatusMapper.java
  81. 27 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/source/SourceMapper.java
  82. 36 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/mq/consumer/sharePath/AddSharePathConsumer.java
  83. 59 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/duser/DuserService.java
  84. 135 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/duser/DuserServiceImpl.java
  85. 63 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integral/IntegralService.java
  86. 83 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integral/IntegralServiceImpl.java
  87. 64 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/ordercalc/OrderCalcService.java
  88. 197 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/ordercalc/OrderCalcServiceImpl.java
  89. 62 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/orderpercentage/OrderPercentageService.java
  90. 110 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/orderpercentage/OrderPercentageServiceImpl.java
  91. 14 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/orderpercentage/handle/OrderPercentCheckHandler.java
  92. 24 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/orderpercentage/handle/OrderPercentHandler.java
  93. 55 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/partitionbrothers/PartitionBrothersService.java
  94. 74 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/partitionbrothers/PartitionBrothersServiceImpl.java
  95. 55 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/partitioncrash/PartitionCrashService.java
  96. 74 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/partitioncrash/PartitionCrashServiceImpl.java
  97. 55 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/partitionson/PartitionSonService.java
  98. 74 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/partitionson/PartitionSonServiceImpl.java
  99. 63 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/ptprofit/PtProfitService.java
  100. 91 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/ptprofit/PtProfitServiceImpl.java

+ 61 - 0
feifan-framework/feifan-common/src/main/java/cn/newfeifan/mall/framework/common/mq/message/order/DistriOrderMessage.java

@@ -0,0 +1,61 @@
+package cn.newfeifan.mall.framework.common.mq.message.order;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class DistriOrderMessage {
+
+
+    /**
+     * 总价
+     */
+    private Integer totalPrice;
+
+    /**
+     * 单价
+     */
+    private Integer price;
+
+    /**
+     * 购买数量
+     */
+    private Integer productCount;
+
+
+    /**
+     * 成本价
+     */
+    private Integer costPrice;
+
+
+    /**
+     * 订单编号
+     */
+    private String no;
+
+    /**
+     * 下单用户
+     */
+    private Long userId;
+
+    /**
+     * 店铺ID
+     */
+    private Long shopId;
+
+    /**
+     * 商户ID
+     */
+    private Long merchantId;
+    /**
+     * 订单ID
+     */
+    private Long orderId;
+
+}

+ 38 - 0
feifan-module-distri/feifan-module-distri-api/.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 30 - 0
feifan-module-distri/feifan-module-distri-api/pom.xml

@@ -0,0 +1,30 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>cn.newfeifan.zx</groupId>
+        <artifactId>feifan-module-distri</artifactId>
+        <version>${revision}</version>
+    </parent>
+    <name>${project.artifactId}</name> <!-- 3. 新增 name 为 ${project.artifactId} -->
+    <artifactId>feifan-module-distri-api</artifactId>
+    <packaging>jar</packaging>
+
+    <url>http://maven.apache.org</url>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+
+
+    <description> <!-- 4. 新增 description 为该模块的描述 -->
+        营销模块 模块,主要实现 身价, 积分, 分销计算等功能。
+    </description>
+    <dependencies>  <!-- 5. 新增 yudao-common 依赖 -->
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-common</artifactId>
+        </dependency>
+    </dependencies>
+</project>

+ 10 - 0
feifan-module-distri/feifan-module-distri-api/src/main/java/cn/newfeifan/mall/module/distri/constant/DistriConstants.java

@@ -0,0 +1,10 @@
+package cn.newfeifan.mall.module.distri.constant;
+
+import cn.newfeifan.mall.framework.common.exception.ErrorCode;
+
+public class DistriConstants {
+    // ========== 分销信息商户信息 1-002-029-000 ==========
+    public static final Integer PERCENT = 10000;
+    public static final Double ONE_HUNDRED = 1d;
+
+}

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

@@ -0,0 +1,24 @@
+package cn.newfeifan.mall.module.distri.enums;
+
+import cn.newfeifan.mall.framework.common.exception.ErrorCode;
+
+public interface ErrorCodeConstants {
+    // ========== 分销信息商户信息 1-002-029-000 ==========
+    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_003, "积分表不存在");
+    ErrorCode ORDER_CALC_NOT_EXISTS = new ErrorCode(1_002_030_004, "计算不存在");
+    ErrorCode ORDER_PERCENTAGE_NOT_EXISTS = new ErrorCode(1_002_030_005, "订单计算不存在");
+    ErrorCode PARTITION_BROTHERS_NOT_EXISTS = new ErrorCode(1_002_030_006, "兄弟分区不存在");
+    ErrorCode PARTITION_SON_NOT_EXISTS = new ErrorCode(1_002_030_007, "儿子分区不存在");
+    ErrorCode USER_NOT_EXISTS = new ErrorCode(1_002_030_008, "分销用户不存在");
+    ErrorCode DUSER_NOT_EXISTS = new ErrorCode(1_002_030_009, "分销用户不存在");
+    ErrorCode IS_EXISTS = new ErrorCode(1_002_030_010, "当前推销人已经存在上级");
+    ErrorCode PARTITION_CRASH_NOT_EXISTS = new ErrorCode(1_002_030_011, "碰撞分区不存在");
+    ErrorCode PT_PROFIT_NOT_EXISTS = new ErrorCode(1_002_030_012, "平台利润不存在");
+    ErrorCode PT_PROFIT_LOG_NOT_EXISTS = new ErrorCode(1_002_030_013, "平台利润日志表不存在");
+    ErrorCode PERCENT_LARGE_ONE_HUNDRED = new ErrorCode(1_002_030_014, "百分比总和超过100");
+    ErrorCode HAS_PARENT = new ErrorCode(1_002_030_015, "该直推人已经有推荐人, 故不能增加");
+
+}

+ 121 - 0
feifan-module-distri/feifan-module-distri-biz/pom.xml

@@ -0,0 +1,121 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>cn.newfeifan.zx</groupId>
+        <artifactId>feifan-module-distri</artifactId>
+        <version>${revision}</version>
+    </parent>
+    <name>${project.artifactId}</name>
+    <artifactId>feifan-module-distri-biz</artifactId>
+    <packaging>jar</packaging>
+
+
+    <url>http://maven.apache.org</url>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+
+
+    <description>
+        营销模块 模块,主要实现 身价, 积分, 分销计算等功能。
+    </description>
+    <dependencies>
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-module-distri-api</artifactId>
+            <version>${revision}</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-module-system-api</artifactId>
+            <version>${revision}</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-module-infra-api</artifactId>
+            <version>${revision}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-module-system-biz</artifactId>
+            <version>${revision}</version>
+        </dependency>
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-module-member-biz</artifactId>
+            <version>${revision}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-module-product-biz</artifactId>
+            <version>${revision}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-module-trade-biz</artifactId>
+            <version>${revision}</version>
+        </dependency>
+
+        <!-- 业务组件 -->
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-biz-operatelog</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-biz-tenant</artifactId>
+        </dependency>
+
+        <!-- Web 相关 -->
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-security</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-validation</artifactId>
+        </dependency>
+
+        <!-- DB 相关 -->
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-mybatis</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-redis</artifactId>
+        </dependency>
+
+        <!-- 消息队列相关 -->
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-mq</artifactId>
+        </dependency>
+
+        <!-- Test 测试相关 -->
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- 工具类相关 -->
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-excel</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.newfeifan.zx</groupId>
+            <artifactId>feifan-spring-boot-starter-biz-ip</artifactId>
+        </dependency>
+    </dependencies>
+</project>

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

@@ -0,0 +1,95 @@
+package cn.newfeifan.mall.module.distri.controller.admin.duser;
+
+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.duser.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.duser.DuserDO;
+import cn.newfeifan.mall.module.distri.service.duser.DuserService;
+
+@Tag(name = "管理后台 - 推荐用户")
+@RestController
+@RequestMapping("/distri/duser")
+@Validated
+public class DuserController {
+
+    @Resource
+    private DuserService duserService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建推荐用户")
+    @PreAuthorize("@ss.hasPermission('distri:duser:create')")
+    public CommonResult<Long> createDuser(@Valid @RequestBody DuserSaveReqVO createReqVO) {
+        return success(duserService.createDuser(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新推荐用户")
+    @PreAuthorize("@ss.hasPermission('distri:duser:update')")
+    public CommonResult<Boolean> updateDuser(@Valid @RequestBody DuserSaveReqVO updateReqVO) {
+        duserService.updateDuser(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除推荐用户")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('distri:duser:delete')")
+    public CommonResult<Boolean> deleteDuser(@RequestParam("id") Long id) {
+        duserService.deleteDuser(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得推荐用户")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('distri:duser:query')")
+    public CommonResult<DuserRespVO> getDuser(@RequestParam("id") Long id) {
+        DuserDO duser = duserService.getDuser(id);
+        return success(BeanUtils.toBean(duser, DuserRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得推荐用户分页")
+    @PreAuthorize("@ss.hasPermission('distri:duser:query')")
+    public CommonResult<PageResult<DuserRespVO>> getDuserPage(@Valid DuserPageReqVO pageReqVO) {
+        PageResult<DuserDO> pageResult = duserService.getDuserPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, DuserRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出推荐用户 Excel")
+    @PreAuthorize("@ss.hasPermission('distri:duser:export')")
+    @OperateLog(type = EXPORT)
+    public void exportDuserExcel(@Valid DuserPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<DuserDO> list = duserService.getDuserPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "推荐用户.xls", "数据", DuserRespVO.class,
+                        BeanUtils.toBean(list, DuserRespVO.class));
+    }
+
+}

+ 46 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/duser/vo/DuserPageReqVO.java

@@ -0,0 +1,46 @@
+package cn.newfeifan.mall.module.distri.controller.admin.duser.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 DuserPageReqVO extends PageParam {
+
+    @Schema(description = "团队人员ID", example = "17459")
+    private Long userId;
+
+    @Schema(description = "团队人员姓名", example = "李四")
+    private String name;
+
+    @Schema(description = "团队人员手机号码")
+    private String mobile;
+
+    @Schema(description = "团队人员来源")
+    private Integer source;
+
+    @Schema(description = "团队用户当前积分", example = "11037")
+    private Long integralId;
+
+    @Schema(description = "团队用户当前身价(等级)", example = "2")
+    private Integer socialStatus;
+
+    @Schema(description = "团队用户当前点数")
+    private Long socialStatusPoint;
+
+    @Schema(description = "用户类型", example = "3773")
+    private Long categoryId;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 56 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/duser/vo/DuserRespVO.java

@@ -0,0 +1,56 @@
+package cn.newfeifan.mall.module.distri.controller.admin.duser.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 DuserRespVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23853")
+    @ExcelProperty("用户编号")
+    private Long id;
+
+    @Schema(description = "团队人员ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17459")
+    @ExcelProperty("团队人员ID")
+    private Long userId;
+
+    @Schema(description = "团队人员姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
+    @ExcelProperty("团队人员姓名")
+    private String name;
+
+    @Schema(description = "团队人员手机号码", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("团队人员手机号码")
+    private String mobile;
+
+    @Schema(description = "团队人员来源")
+    @ExcelProperty("团队人员来源")
+    private Integer source;
+
+    @Schema(description = "团队用户当前积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "11037")
+    @ExcelProperty("团队用户当前积分")
+    private Long integralId;
+
+    @Schema(description = "团队用户当前身价(等级)", example = "2")
+    @ExcelProperty("团队用户当前身价(等级)")
+    private Integer socialStatus;
+
+    @Schema(description = "团队用户当前点数")
+    @ExcelProperty("团队用户当前点数")
+    private Long socialStatusPoint;
+
+    @Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "3773")
+    @ExcelProperty("用户类型")
+    private Long categoryId;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

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

@@ -0,0 +1,48 @@
+package cn.newfeifan.mall.module.distri.controller.admin.duser.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 推荐用户新增/修改 Request VO")
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class DuserSaveReqVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23853")
+    private Long id;
+
+    @Schema(description = "团队人员ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17459")
+    @NotNull(message = "团队人员ID不能为空")
+    private Long userId;
+
+    @Schema(description = "团队人员姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
+    @NotEmpty(message = "团队人员姓名不能为空")
+    private String name;
+
+    @Schema(description = "团队人员手机号码", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotEmpty(message = "团队人员手机号码不能为空")
+    private String mobile;
+
+    @Schema(description = "团队人员来源")
+    private Long source;
+
+    @Schema(description = "团队用户当前积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "11037")
+    @NotNull(message = "团队用户当前积分不能为空")
+    private Long integralId;
+
+    @Schema(description = "团队用户当前身价(等级)", example = "2")
+    private Long socialStatus;
+
+    @Schema(description = "团队用户当前点数")
+    private Long socialStatusPoint;
+
+    @Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "3773")
+    @NotNull(message = "用户类型不能为空")
+    private Long categoryId;
+
+}

+ 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;
+
+}

+ 31 - 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,31 @@
+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
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+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));
+    }
+
+}

+ 53 - 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,53 @@
+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;
+
+
+    @Schema(description = "计算百分比模板")
+    private String percentTemplate;
+
+}

+ 62 - 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,62 @@
+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;
+    @Schema(description = "计算百分比模板")
+    private String percentTemplate;
+
+}

+ 48 - 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,48 @@
+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
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+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;
+    @Schema(description = "计算百分比模板")
+    private String percentTemplate;
+
+}

+ 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 OrderPercentageDoubleSaveReqVO createReqVO) {
+        return success(orderPercentageService.createOrderPercentage(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新积分相关计算浮动百分比设置")
+    @PreAuthorize("@ss.hasPermission('distri:order-percentage:update')")
+    public CommonResult<Boolean> updateOrderPercentage(@Valid @RequestBody OrderPercentageDoubleSaveReqVO 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));
+    }
+
+}

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

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

+ 41 - 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,41 @@
+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;
+    @Schema(description = "是否启用 0关闭 1启动", example = "2")
+    private Integer status;
+}

+ 49 - 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,49 @@
+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;
+    @Schema(description = "是否启用 0关闭 1启动", example = "2")
+    private Integer status;
+}

+ 39 - 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,39 @@
+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;
+    @Schema(description = "是否启用 0关闭 1启动", example = "2")
+    private Integer status;
+
+
+
+
+
+}

+ 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/partitioncrash/PartitionCrashController.java

@@ -0,0 +1,95 @@
+package cn.newfeifan.mall.module.distri.controller.admin.partitioncrash;
+
+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.partitioncrash.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.partitioncrash.PartitionCrashDO;
+import cn.newfeifan.mall.module.distri.service.partitioncrash.PartitionCrashService;
+
+@Tag(name = "管理后台 - 分区碰撞")
+@RestController
+@RequestMapping("/distri/partition-crash")
+@Validated
+public class PartitionCrashController {
+
+    @Resource
+    private PartitionCrashService partitionCrashService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建分区碰撞")
+    @PreAuthorize("@ss.hasPermission('distri:partition-crash:create')")
+    public CommonResult<Long> createPartitionCrash(@Valid @RequestBody PartitionCrashSaveReqVO createReqVO) {
+        return success(partitionCrashService.createPartitionCrash(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新分区碰撞")
+    @PreAuthorize("@ss.hasPermission('distri:partition-crash:update')")
+    public CommonResult<Boolean> updatePartitionCrash(@Valid @RequestBody PartitionCrashSaveReqVO updateReqVO) {
+        partitionCrashService.updatePartitionCrash(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除分区碰撞")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('distri:partition-crash:delete')")
+    public CommonResult<Boolean> deletePartitionCrash(@RequestParam("id") Long id) {
+        partitionCrashService.deletePartitionCrash(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得分区碰撞")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('distri:partition-crash:query')")
+    public CommonResult<PartitionCrashRespVO> getPartitionCrash(@RequestParam("id") Long id) {
+        PartitionCrashDO partitionCrash = partitionCrashService.getPartitionCrash(id);
+        return success(BeanUtils.toBean(partitionCrash, PartitionCrashRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得分区碰撞分页")
+    @PreAuthorize("@ss.hasPermission('distri:partition-crash:query')")
+    public CommonResult<PageResult<PartitionCrashRespVO>> getPartitionCrashPage(@Valid PartitionCrashPageReqVO pageReqVO) {
+        PageResult<PartitionCrashDO> pageResult = partitionCrashService.getPartitionCrashPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, PartitionCrashRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出分区碰撞 Excel")
+    @PreAuthorize("@ss.hasPermission('distri:partition-crash:export')")
+    @OperateLog(type = EXPORT)
+    public void exportPartitionCrashExcel(@Valid PartitionCrashPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<PartitionCrashDO> list = partitionCrashService.getPartitionCrashPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "分区碰撞.xls", "数据", PartitionCrashRespVO.class,
+                        BeanUtils.toBean(list, PartitionCrashRespVO.class));
+    }
+
+}

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

@@ -0,0 +1,37 @@
+package cn.newfeifan.mall.module.distri.controller.admin.partitioncrash.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 PartitionCrashPageReqVO extends PageParam {
+
+    @Schema(description = "用户ID", example = "15393")
+    private Long userId;
+
+    @Schema(description = "分区编号")
+    private String partNo;
+
+    @Schema(description = "兄弟分区额度", example = "12349")
+    private Integer brotherPrice;
+
+    @Schema(description = "子分区额度", example = "30462")
+    private Integer sonPrice;
+
+    @Schema(description = "碰撞后额度")
+    private Integer afterHitQuota;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

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

@@ -0,0 +1,44 @@
+package cn.newfeifan.mall.module.distri.controller.admin.partitioncrash.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 PartitionCrashRespVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15914")
+    @ExcelProperty("用户编号")
+    private Long id;
+
+    @Schema(description = "用户ID", example = "15393")
+    @ExcelProperty("用户ID")
+    private Long userId;
+
+    @Schema(description = "分区编号")
+    @ExcelProperty("分区编号")
+    private String partNo;
+
+    @Schema(description = "兄弟分区额度", example = "12349")
+    @ExcelProperty("兄弟分区额度")
+    private Integer brotherPrice;
+
+    @Schema(description = "子分区额度", example = "30462")
+    @ExcelProperty("子分区额度")
+    private Integer sonPrice;
+
+    @Schema(description = "碰撞后额度")
+    @ExcelProperty("碰撞后额度")
+    private Integer afterHitQuota;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

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

@@ -0,0 +1,30 @@
+package cn.newfeifan.mall.module.distri.controller.admin.partitioncrash.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 PartitionCrashSaveReqVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15914")
+    private Long id;
+
+    @Schema(description = "用户ID", example = "15393")
+    private Long userId;
+
+    @Schema(description = "分区编号")
+    private String partNo;
+
+    @Schema(description = "兄弟分区额度", example = "12349")
+    private Integer brotherPrice;
+
+    @Schema(description = "子分区额度", example = "30462")
+    private Integer sonPrice;
+
+    @Schema(description = "碰撞后额度")
+    private Integer afterHitQuota;
+
+}

+ 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;
+
+}

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

@@ -0,0 +1,95 @@
+package cn.newfeifan.mall.module.distri.controller.admin.ptprofit;
+
+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.ptprofit.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.ptprofit.PtProfitDO;
+import cn.newfeifan.mall.module.distri.service.ptprofit.PtProfitService;
+
+@Tag(name = "管理后台 - 平台利润")
+@RestController
+@RequestMapping("/distri/pt-profit")
+@Validated
+public class PtProfitController {
+
+    @Resource
+    private PtProfitService ptProfitService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建平台利润")
+    @PreAuthorize("@ss.hasPermission('distri:pt-profit:create')")
+    public CommonResult<Long> createPtProfit(@Valid @RequestBody PtProfitSaveReqVO createReqVO) {
+        return success(ptProfitService.createPtProfit(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新平台利润")
+    @PreAuthorize("@ss.hasPermission('distri:pt-profit:update')")
+    public CommonResult<Boolean> updatePtProfit(@Valid @RequestBody PtProfitSaveReqVO updateReqVO) {
+        ptProfitService.updatePtProfit(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除平台利润")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('distri:pt-profit:delete')")
+    public CommonResult<Boolean> deletePtProfit(@RequestParam("id") Long id) {
+        ptProfitService.deletePtProfit(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得平台利润")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('distri:pt-profit:query')")
+    public CommonResult<PtProfitRespVO> getPtProfit(@RequestParam("id") Long id) {
+        PtProfitDO ptProfit = ptProfitService.getPtProfit(id);
+        return success(BeanUtils.toBean(ptProfit, PtProfitRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得平台利润分页")
+    @PreAuthorize("@ss.hasPermission('distri:pt-profit:query')")
+    public CommonResult<PageResult<PtProfitRespVO>> getPtProfitPage(@Valid PtProfitPageReqVO pageReqVO) {
+        PageResult<PtProfitDO> pageResult = ptProfitService.getPtProfitPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, PtProfitRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出平台利润 Excel")
+    @PreAuthorize("@ss.hasPermission('distri:pt-profit:export')")
+    @OperateLog(type = EXPORT)
+    public void exportPtProfitExcel(@Valid PtProfitPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<PtProfitDO> list = ptProfitService.getPtProfitPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "平台利润.xls", "数据", PtProfitRespVO.class,
+                        BeanUtils.toBean(list, PtProfitRespVO.class));
+    }
+
+}

+ 31 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofit/vo/PtProfitPageReqVO.java

@@ -0,0 +1,31 @@
+package cn.newfeifan.mall.module.distri.controller.admin.ptprofit.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 PtProfitPageReqVO extends PageParam {
+
+    @Schema(description = "平台服务费(毛利下的百分比收益)")
+    private Integer ptAdd;
+
+    @Schema(description = "平台收益(0.3888 之外的收益)")
+    private Integer ptGrossAdd;
+
+    @Schema(description = "平台总收益")
+    private Integer ptTotalAdd;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 36 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofit/vo/PtProfitRespVO.java

@@ -0,0 +1,36 @@
+package cn.newfeifan.mall.module.distri.controller.admin.ptprofit.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 PtProfitRespVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "24754")
+    @ExcelProperty("用户编号")
+    private Long id;
+
+    @Schema(description = "平台服务费(毛利下的百分比收益)")
+    @ExcelProperty("平台服务费(毛利下的百分比收益)")
+    private Integer ptAdd;
+
+    @Schema(description = "平台收益(0.3888 之外的收益)")
+    @ExcelProperty("平台收益(0.3888 之外的收益)")
+    private Integer ptGrossAdd;
+
+    @Schema(description = "平台总收益")
+    @ExcelProperty("平台总收益")
+    private Integer ptTotalAdd;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 28 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofit/vo/PtProfitSaveReqVO.java

@@ -0,0 +1,28 @@
+package cn.newfeifan.mall.module.distri.controller.admin.ptprofit.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 平台利润新增/修改 Request VO")
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class PtProfitSaveReqVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "24754")
+    private Long id;
+
+    @Schema(description = "平台收益(0.3888 之外的收益)")
+    private Integer ptAdd;
+
+    @Schema(description = "平台服务费(毛利下的百分比收益)")
+    private Integer ptGrossAdd;
+
+    @Schema(description = "平台总收益")
+    private Integer ptTotalAdd;
+
+}

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

@@ -0,0 +1,95 @@
+package cn.newfeifan.mall.module.distri.controller.admin.ptprofitlog;
+
+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.ptprofitlog.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.ptprofitlog.PtProfitLogDO;
+import cn.newfeifan.mall.module.distri.service.ptprofitlog.PtProfitLogService;
+
+@Tag(name = "管理后台 - 平台利润记录")
+@RestController
+@RequestMapping("/distri/pt-profit-log")
+@Validated
+public class PtProfitLogController {
+
+    @Resource
+    private PtProfitLogService ptProfitLogService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建平台利润记录")
+    @PreAuthorize("@ss.hasPermission('distri:pt-profit-log:create')")
+    public CommonResult<Long> createPtProfitLog(@Valid @RequestBody PtProfitLogSaveReqVO createReqVO) {
+        return success(ptProfitLogService.createPtProfitLog(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新平台利润记录")
+    @PreAuthorize("@ss.hasPermission('distri:pt-profit-log:update')")
+    public CommonResult<Boolean> updatePtProfitLog(@Valid @RequestBody PtProfitLogSaveReqVO updateReqVO) {
+        ptProfitLogService.updatePtProfitLog(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除平台利润记录")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('distri:pt-profit-log:delete')")
+    public CommonResult<Boolean> deletePtProfitLog(@RequestParam("id") Long id) {
+        ptProfitLogService.deletePtProfitLog(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得平台利润记录")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('distri:pt-profit-log:query')")
+    public CommonResult<PtProfitLogRespVO> getPtProfitLog(@RequestParam("id") Long id) {
+        PtProfitLogDO ptProfitLog = ptProfitLogService.getPtProfitLog(id);
+        return success(BeanUtils.toBean(ptProfitLog, PtProfitLogRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得平台利润记录分页")
+    @PreAuthorize("@ss.hasPermission('distri:pt-profit-log:query')")
+    public CommonResult<PageResult<PtProfitLogRespVO>> getPtProfitLogPage(@Valid PtProfitLogPageReqVO pageReqVO) {
+        PageResult<PtProfitLogDO> pageResult = ptProfitLogService.getPtProfitLogPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, PtProfitLogRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出平台利润记录 Excel")
+    @PreAuthorize("@ss.hasPermission('distri:pt-profit-log:export')")
+    @OperateLog(type = EXPORT)
+    public void exportPtProfitLogExcel(@Valid PtProfitLogPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<PtProfitLogDO> list = ptProfitLogService.getPtProfitLogPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "平台利润记录.xls", "数据", PtProfitLogRespVO.class,
+                        BeanUtils.toBean(list, PtProfitLogRespVO.class));
+    }
+
+}

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

@@ -0,0 +1,40 @@
+package cn.newfeifan.mall.module.distri.controller.admin.ptprofitlog.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 PtProfitLogPageReqVO extends PageParam {
+
+    @Schema(description = "增加金额")
+    private Integer amount;
+
+    @Schema(description = "增加后金额")
+    private Integer afterAmount;
+
+    @Schema(description = "收益类型 1:平台服务器费 2:平台收益 3用户下单返回毛利额度 4直推人额度 5合赢奖", example = "2")
+    private Integer profitStatus;
+
+    @Schema(description = "用户ID , 只有收益类型为 3,4才有值", example = "6982")
+    private Long userId;
+
+    @Schema(description = "订单号", example = "15682")
+    private Long orderId;
+
+    @Schema(description = "计算百分比模板")
+    private String percentTemplate;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

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

@@ -0,0 +1,47 @@
+package cn.newfeifan.mall.module.distri.controller.admin.ptprofitlog.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 PtProfitLogRespVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12046")
+    @ExcelProperty("用户编号")
+    private Long id;
+
+    @Schema(description = "增加金额")
+    @ExcelProperty("增加金额")
+    private Integer amount;
+
+    @Schema(description = "增加后金额")
+    @ExcelProperty("增加后金额")
+    private Integer afterAmount;
+
+    @Schema(description = "收益类型 1:平台服务器费 2:平台收益 3用户下单返回毛利额度 4直推人额度 5合赢奖", example = "2")
+    @ExcelProperty("收益类型 1:平台服务器费 2:平台收益")
+    private Integer profitStatus;
+
+    @Schema(description = "用户ID , 只有收益类型为 3,4才有值", example = "6982")
+    private Long userId;
+
+    @Schema(description = "订单号", example = "15682")
+    @ExcelProperty("订单号")
+    private Long orderId;
+
+    @Schema(description = "计算百分比模板")
+    @ExcelProperty("计算百分比模板")
+    private String percentTemplate;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

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

@@ -0,0 +1,37 @@
+package cn.newfeifan.mall.module.distri.controller.admin.ptprofitlog.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 平台利润记录新增/修改 Request VO")
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class PtProfitLogSaveReqVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12046")
+    private Long id;
+
+    @Schema(description = "增加金额")
+    private Integer amount;
+
+    @Schema(description = "增加后金额")
+    private Integer afterAmount;
+
+    @Schema(description = "收益类型 1:平台服务器费 2:平台收益 3用户下单返回毛利额度 4直推人额度 5合赢奖", example = "2")
+    private Integer profitStatus;
+
+    @Schema(description = "用户ID , 只有收益类型为 3,4才有值", example = "6982")
+    private Long userId;
+
+    @Schema(description = "订单号", example = "15682")
+    private Long orderId;
+
+    @Schema(description = "计算百分比模板")
+    private String percentTemplate;
+
+}

+ 117 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/sharepath/SharePathController.java

@@ -0,0 +1,117 @@
+package cn.newfeifan.mall.module.distri.controller.admin.sharepath;
+
+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.sharepath.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.sharepath.SharePathDO;
+import cn.newfeifan.mall.module.distri.service.sharepath.SharePathService;
+
+@Tag(name = "管理后台 - 分销用户关系")
+@RestController
+@RequestMapping("/distri/share-path")
+@Validated
+public class SharePathController {
+
+    @Resource
+    private SharePathService sharePathService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建分销用户关系")
+    @PreAuthorize("@ss.hasPermission('distri:share-path:create')")
+    public CommonResult<Boolean> createSharePath(@Valid @RequestBody SharePathSaveReqVO createReqVO) {
+        sharePathService.createSharePathByUserId(createReqVO);
+        return success(true);
+    }
+
+    @GetMapping("/getTree")
+    @Operation(summary = "获取分销人员关系树")
+    @PreAuthorize("@ss.hasPermission('distri:share-path:query')")
+    public CommonResult<SharePathRespVO> getTree() {
+        TreeNode sharePath = sharePathService.getTree();
+        return success(BeanUtils.toBean(sharePath, SharePathRespVO.class));
+    }
+
+    @PutMapping("/transference_rela")
+    @Operation(summary = "转让分销关系")
+    @PreAuthorize("@ss.hasPermission('distri:share-path:update')")
+    public CommonResult<Boolean> transferenceRela(SharePathtransFerenceRelaReqVO sharePathtransFerenceRelaReqVO) {
+        sharePathService.transferenceRela(sharePathtransFerenceRelaReqVO);
+        return success(true);
+    }
+
+
+    @PutMapping("/update")
+    @Operation(summary = "更新分销用户关系")
+    @PreAuthorize("@ss.hasPermission('distri:share-path:update')")
+    public CommonResult<Boolean> updateSharePath(@Valid @RequestBody SharePathSaveReqVO updateReqVO) {
+        sharePathService.updateSharePath(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除分销用户关系")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('distri:share-path:delete')")
+    public CommonResult<Boolean> deleteSharePath(@RequestParam("id") Long id) {
+        sharePathService.deleteSharePath(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得分销用户关系")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('distri:share-path:query')")
+    public CommonResult<SharePathRespVO> getSharePath(@RequestParam("id") Long id) {
+        SharePathDO sharePath = sharePathService.getSharePath(id);
+        return success(BeanUtils.toBean(sharePath, SharePathRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得分销用户关系分页")
+    @PreAuthorize("@ss.hasPermission('distri:share-path:query')")
+    public CommonResult<PageResult<SharePathRespVO>> getSharePathPage(@Valid SharePathPageReqVO pageReqVO) {
+        PageResult<SharePathDO> pageResult = sharePathService.getSharePathPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, SharePathRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出分销用户关系 Excel")
+    @PreAuthorize("@ss.hasPermission('distri:share-path:export')")
+    @OperateLog(type = EXPORT)
+    public void exportSharePathExcel(@Valid SharePathPageReqVO pageReqVO,
+                                     HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<SharePathDO> list = sharePathService.getSharePathPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "分销用户关系.xls", "数据", SharePathRespVO.class,
+                BeanUtils.toBean(list, SharePathRespVO.class));
+    }
+
+}

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

@@ -0,0 +1,34 @@
+package cn.newfeifan.mall.module.distri.controller.admin.sharepath.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 SharePathPageReqVO extends PageParam {
+
+    @Schema(description = "层级")
+    private Integer depth;
+
+    @Schema(description = "创建时间")
+    @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;
+
+}

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

@@ -0,0 +1,40 @@
+package cn.newfeifan.mall.module.distri.controller.admin.sharepath.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 SharePathRespVO {
+
+    @Schema(description = "层级")
+    @ExcelProperty("层级")
+    private Integer depth;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @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;
+
+}

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

@@ -0,0 +1,34 @@
+package cn.newfeifan.mall.module.distri.controller.admin.sharepath.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 分销用户关系新增/修改 Request VO")
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class SharePathSaveReqVO {
+
+    @Schema(description = "层级")
+    private Integer depth;
+
+    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12537")
+    private Long id;
+
+    @Schema(description = "推荐人")
+    private Long ancestor;
+
+    @Schema(description = "直推人")
+    private Long descendant;
+
+    @Schema(description = "顺序")
+    private Integer sort;
+
+    @Schema(description = "链接来源")
+    private Long source;
+
+}

+ 18 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/sharepath/vo/SharePathtransFerenceRelaReqVO.java

@@ -0,0 +1,18 @@
+package cn.newfeifan.mall.module.distri.controller.admin.sharepath.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 分销用户关系转让 Request VO")
+@Data
+public class SharePathtransFerenceRelaReqVO {
+
+
+    @Schema(description = "转让人")
+    private Long ancestor;
+
+    @Schema(description = "被转让人")
+    private Long descendant;
+
+
+}

+ 18 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/sharepath/vo/TreeNode.java

@@ -0,0 +1,18 @@
+package cn.newfeifan.mall.module.distri.controller.admin.sharepath.vo;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class TreeNode {
+    private String name; // 节点名称
+    private Integer value; // 节点值,某些节点可能没有值
+    private List<TreeNode> children; // 子节点列表
+}

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

@@ -0,0 +1,95 @@
+package cn.newfeifan.mall.module.distri.controller.admin.socialstatus;
+
+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.socialstatus.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.socialstatus.SocialStatusDO;
+import cn.newfeifan.mall.module.distri.service.socialstatus.SocialStatusService;
+
+@Tag(name = "管理后台 - 分销用户身价")
+@RestController
+@RequestMapping("/distri/social-status")
+@Validated
+public class SocialStatusController {
+
+    @Resource
+    private SocialStatusService socialStatusService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建分销用户身价")
+    @PreAuthorize("@ss.hasPermission('distri:social-status:create')")
+    public CommonResult<Long> createSocialStatus(@Valid @RequestBody SocialStatusSaveReqVO createReqVO) {
+        return success(socialStatusService.createSocialStatus(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新分销用户身价")
+    @PreAuthorize("@ss.hasPermission('distri:social-status:update')")
+    public CommonResult<Boolean> updateSocialStatus(@Valid @RequestBody SocialStatusSaveReqVO updateReqVO) {
+        socialStatusService.updateSocialStatus(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除分销用户身价")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('distri:social-status:delete')")
+    public CommonResult<Boolean> deleteSocialStatus(@RequestParam("id") Long id) {
+        socialStatusService.deleteSocialStatus(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得分销用户身价")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('distri:social-status:query')")
+    public CommonResult<SocialStatusRespVO> getSocialStatus(@RequestParam("id") Long id) {
+        SocialStatusDO socialStatus = socialStatusService.getSocialStatus(id);
+        return success(BeanUtils.toBean(socialStatus, SocialStatusRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得分销用户身价分页")
+    @PreAuthorize("@ss.hasPermission('distri:social-status:query')")
+    public CommonResult<PageResult<SocialStatusRespVO>> getSocialStatusPage(@Valid SocialStatusPageReqVO pageReqVO) {
+        PageResult<SocialStatusDO> pageResult = socialStatusService.getSocialStatusPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, SocialStatusRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出分销用户身价 Excel")
+    @PreAuthorize("@ss.hasPermission('distri:social-status:export')")
+    @OperateLog(type = EXPORT)
+    public void exportSocialStatusExcel(@Valid SocialStatusPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<SocialStatusDO> list = socialStatusService.getSocialStatusPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "分销用户身价.xls", "数据", SocialStatusRespVO.class,
+                        BeanUtils.toBean(list, SocialStatusRespVO.class));
+    }
+
+}

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

@@ -0,0 +1,31 @@
+package cn.newfeifan.mall.module.distri.controller.admin.socialstatus.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 SocialStatusPageReqVO extends PageParam {
+
+    @Schema(description = "身价等级")
+    private String level;
+
+    @Schema(description = "身价名称", example = "芋艿")
+    private String name;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+    @Schema(description = "升级所需点数")
+    private Long point;
+
+}

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

@@ -0,0 +1,36 @@
+package cn.newfeifan.mall.module.distri.controller.admin.socialstatus.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 SocialStatusRespVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "19722")
+    @ExcelProperty("用户编号")
+    private Long id;
+
+    @Schema(description = "身价等级")
+    @ExcelProperty("身价等级")
+    private String level;
+
+    @Schema(description = "身价名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
+    @ExcelProperty("身价名称")
+    private String name;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    @Schema(description = "升级所需点数")
+    @ExcelProperty("升级所需点数")
+    private Long point;
+
+}

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

@@ -0,0 +1,31 @@
+package cn.newfeifan.mall.module.distri.controller.admin.socialstatus.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+
+import java.util.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 分销用户身价新增/修改 Request VO")
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SocialStatusSaveReqVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "19722")
+    private Long id;
+
+    @Schema(description = "身价等级")
+    private String level;
+
+    @Schema(description = "身价名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
+    @NotEmpty(message = "身价名称不能为空")
+    private String name;
+
+    @Schema(description = "升级所需点数")
+    private Long point;
+
+
+
+}

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

@@ -0,0 +1,95 @@
+package cn.newfeifan.mall.module.distri.controller.admin.source;
+
+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.source.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.source.SourceDO;
+import cn.newfeifan.mall.module.distri.service.source.SourceService;
+
+@Tag(name = "管理后台 - 分销来源")
+@RestController
+@RequestMapping("/distri/source")
+@Validated
+public class SourceController {
+
+    @Resource
+    private SourceService sourceService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建分销来源")
+    @PreAuthorize("@ss.hasPermission('distri:source:create')")
+    public CommonResult<Long> createSource(@Valid @RequestBody SourceSaveReqVO createReqVO) {
+        return success(sourceService.createSource(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新分销来源")
+    @PreAuthorize("@ss.hasPermission('distri:source:update')")
+    public CommonResult<Boolean> updateSource(@Valid @RequestBody SourceSaveReqVO updateReqVO) {
+        sourceService.updateSource(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除分销来源")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('distri:source:delete')")
+    public CommonResult<Boolean> deleteSource(@RequestParam("id") Long id) {
+        sourceService.deleteSource(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得分销来源")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('distri:source:query')")
+    public CommonResult<SourceRespVO> getSource(@RequestParam("id") Long id) {
+        SourceDO source = sourceService.getSource(id);
+        return success(BeanUtils.toBean(source, SourceRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得分销来源分页")
+    @PreAuthorize("@ss.hasPermission('distri:source:query')")
+    public CommonResult<PageResult<SourceRespVO>> getSourcePage(@Valid SourcePageReqVO pageReqVO) {
+        PageResult<SourceDO> pageResult = sourceService.getSourcePage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, SourceRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出分销来源 Excel")
+    @PreAuthorize("@ss.hasPermission('distri:source:export')")
+    @OperateLog(type = EXPORT)
+    public void exportSourceExcel(@Valid SourcePageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<SourceDO> list = sourceService.getSourcePage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "分销来源.xls", "数据", SourceRespVO.class,
+                        BeanUtils.toBean(list, SourceRespVO.class));
+    }
+
+}

+ 25 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/source/vo/SourcePageReqVO.java

@@ -0,0 +1,25 @@
+package cn.newfeifan.mall.module.distri.controller.admin.source.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 SourcePageReqVO extends PageParam {
+
+    @Schema(description = "来源名称", example = "张三")
+    private String name;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 28 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/source/vo/SourceRespVO.java

@@ -0,0 +1,28 @@
+package cn.newfeifan.mall.module.distri.controller.admin.source.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 SourceRespVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12844")
+    @ExcelProperty("用户编号")
+    private Long id;
+
+    @Schema(description = "来源名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
+    @ExcelProperty("来源名称")
+    private String name;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 19 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/source/vo/SourceSaveReqVO.java

@@ -0,0 +1,19 @@
+package cn.newfeifan.mall.module.distri.controller.admin.source.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 SourceSaveReqVO {
+
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12844")
+    private Long id;
+
+    @Schema(description = "来源名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
+    @NotEmpty(message = "来源名称不能为空")
+    private String name;
+
+}

+ 63 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/duser/DuserDO.java

@@ -0,0 +1,63 @@
+package cn.newfeifan.mall.module.distri.dal.dataobject.duser;
+
+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_duser")
+@KeySequence("distri_duser_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class DuserDO extends BaseDO {
+
+    /**
+     * 用户编号
+     */
+    @TableId
+    private Long id;
+    /**
+     * 团队人员ID
+     */
+    private Long userId;
+    /**
+     * 团队人员姓名
+     */
+    private String name;
+    /**
+     * 团队人员手机号码
+     */
+    private String mobile;
+    /**
+     * 团队人员来源
+     */
+    private Integer source;
+    /**
+     * 团队用户当前积分
+     */
+    private Long integralId;
+    /**
+     * 团队用户当前身价(等级)
+     */
+    private Integer socialStatus;
+    /**
+     * 团队用户当前点数
+     */
+    private Long socialStatusPoint;
+    /**
+     * 用户类型
+     */
+    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;
+
+}

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

@@ -0,0 +1,68 @@
+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;
+    private String percentTemplate;
+
+}

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

@@ -0,0 +1,57 @@
+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;
+
+    private Integer status;
+
+}

+ 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;
+
+}

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

@@ -0,0 +1,51 @@
+package cn.newfeifan.mall.module.distri.dal.dataobject.partitioncrash;
+
+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_crash")
+@KeySequence("distri_partition_crash_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class PartitionCrashDO extends BaseDO {
+
+    /**
+     * 用户编号
+     */
+    @TableId
+    private Long id;
+    /**
+     * 用户ID
+     */
+    private Long userId;
+    /**
+     * 分区编号
+     */
+    private String partNo;
+    /**
+     * 兄弟分区额度
+     */
+    private Integer brotherPrice;
+    /**
+     * 子分区额度
+     */
+    private Integer sonPrice;
+    /**
+     * 碰撞后额度
+     */
+    private Integer afterHitQuota;
+
+}

+ 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;
+
+}

+ 43 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/ptprofit/PtProfitDO.java

@@ -0,0 +1,43 @@
+package cn.newfeifan.mall.module.distri.dal.dataobject.ptprofit;
+
+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_pt_profit")
+@KeySequence("distri_pt_profit_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class PtProfitDO extends BaseDO {
+
+    /**
+     * 用户编号
+     */
+    @TableId
+    private Long id;
+    /**
+     * 平台服务费(毛利下的百分比收益)
+     */
+    private Integer ptAdd;
+    /**
+     * 平台收益(0.3888 之外的收益)
+     */
+    private Integer ptGrossAdd;
+    /**
+     * 平台总收益
+     */
+    private Integer ptTotalAdd;
+
+}

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

@@ -0,0 +1,57 @@
+package cn.newfeifan.mall.module.distri.dal.dataobject.ptprofitlog;
+
+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_pt_profit_log")
+@KeySequence("distri_pt_profit_log_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class PtProfitLogDO extends BaseDO {
+
+    /**
+     * 用户编号
+     */
+    @TableId
+    private Long id;
+    /**
+     * 增加金额
+     */
+    private Integer amount;
+    /**
+     * 增加后金额
+     */
+    private Integer afterAmount;
+    /**
+     * 收益类型 1:平台服务器费 2:平台收益 3用户下单返回毛利额度 4直推人额度 5合赢奖
+     */
+    private Integer profitStatus;
+    /**
+     * 用户ID , 只有收益类型为 3,4才有值
+     */
+    private Long userId;
+
+    /**
+     * 订单号
+     */
+    private Long orderId;
+    /**
+     * 计算百分比模板
+     */
+    private String percentTemplate;
+
+
+}

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

@@ -0,0 +1,47 @@
+package cn.newfeifan.mall.module.distri.dal.dataobject.sharepath;
+
+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_share_path")
+@KeySequence("distri_share_path_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SharePathDO extends BaseDO {
+
+    /**
+     * 层级
+     */
+    private Integer depth;
+    /**
+     * id
+     */
+    @TableId
+    private Long id;
+    /**
+     * 推荐人
+     */
+    private Long ancestor;
+    /**
+     * 直推人
+     */
+    private Long descendant;
+    /**
+     * 顺序
+     */
+    private Integer sort;
+
+}

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

@@ -0,0 +1,46 @@
+package cn.newfeifan.mall.module.distri.dal.dataobject.socialstatus;
+
+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_social_status")
+@KeySequence("distri_social_status_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SocialStatusDO extends BaseDO {
+
+    /**
+     * 用户编号
+     */
+    @TableId
+    private Long id;
+    /**
+     * 身价等级
+     */
+    private String level;
+    /**
+     * 身价名称
+     */
+    private String name;
+    /**
+     * 升级所需点数
+     */
+    private Long point;
+
+
+}

+ 35 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/source/SourceDO.java

@@ -0,0 +1,35 @@
+package cn.newfeifan.mall.module.distri.dal.dataobject.source;
+
+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_source")
+@KeySequence("distri_source_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SourceDO extends BaseDO {
+
+    /**
+     * 用户编号
+     */
+    @TableId
+    private Long id;
+    /**
+     * 来源名称
+     */
+    private String name;
+
+}

+ 34 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/duser/DuserMapper.java

@@ -0,0 +1,34 @@
+package cn.newfeifan.mall.module.distri.dal.mysql.duser;
+
+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.duser.DuserDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.distri.controller.admin.duser.vo.*;
+
+/**
+ * 推荐用户 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface DuserMapper extends BaseMapperX<DuserDO> {
+
+    default PageResult<DuserDO> selectPage(DuserPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<DuserDO>()
+                .eqIfPresent(DuserDO::getUserId, reqVO.getUserId())
+                .likeIfPresent(DuserDO::getName, reqVO.getName())
+                .eqIfPresent(DuserDO::getMobile, reqVO.getMobile())
+                .eqIfPresent(DuserDO::getSource, reqVO.getSource())
+                .eqIfPresent(DuserDO::getIntegralId, reqVO.getIntegralId())
+                .eqIfPresent(DuserDO::getSocialStatus, reqVO.getSocialStatus())
+                .eqIfPresent(DuserDO::getSocialStatusPoint, reqVO.getSocialStatusPoint())
+                .eqIfPresent(DuserDO::getCategoryId, reqVO.getCategoryId())
+                .betweenIfPresent(DuserDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(DuserDO::getId));
+    }
+    int hasParent(Long userId);
+}

+ 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));
+    }
+
+}

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

@@ -0,0 +1,36 @@
+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())
+                .betweenIfPresent(OrderCalcDO::getCreateTime, reqVO.getCreateTime())
+                .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())
+                .eqIfPresent(OrderCalcDO::getPercentTemplate, reqVO.getPercentTemplate())
+                .orderByDesc(OrderCalcDO::getId));
+    }
+
+}

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

@@ -0,0 +1,33 @@
+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::getStatus, reqVO.getStatus())
+                .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));
+    }
+
+}

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

@@ -0,0 +1,31 @@
+package cn.newfeifan.mall.module.distri.dal.mysql.partitioncrash;
+
+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.partitioncrash.PartitionCrashDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.distri.controller.admin.partitioncrash.vo.*;
+
+/**
+ * 分区碰撞 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface PartitionCrashMapper extends BaseMapperX<PartitionCrashDO> {
+
+    default PageResult<PartitionCrashDO> selectPage(PartitionCrashPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<PartitionCrashDO>()
+                .eqIfPresent(PartitionCrashDO::getUserId, reqVO.getUserId())
+                .eqIfPresent(PartitionCrashDO::getPartNo, reqVO.getPartNo())
+                .eqIfPresent(PartitionCrashDO::getBrotherPrice, reqVO.getBrotherPrice())
+                .eqIfPresent(PartitionCrashDO::getSonPrice, reqVO.getSonPrice())
+                .eqIfPresent(PartitionCrashDO::getAfterHitQuota, reqVO.getAfterHitQuota())
+                .betweenIfPresent(PartitionCrashDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(PartitionCrashDO::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));
+    }
+
+}

+ 29 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/ptprofit/PtProfitMapper.java

@@ -0,0 +1,29 @@
+package cn.newfeifan.mall.module.distri.dal.mysql.ptprofit;
+
+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.ptprofit.PtProfitDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.distri.controller.admin.ptprofit.vo.*;
+
+/**
+ * 平台利润 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface PtProfitMapper extends BaseMapperX<PtProfitDO> {
+
+    default PageResult<PtProfitDO> selectPage(PtProfitPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<PtProfitDO>()
+                .eqIfPresent(PtProfitDO::getPtAdd, reqVO.getPtAdd())
+                .eqIfPresent(PtProfitDO::getPtGrossAdd, reqVO.getPtGrossAdd())
+                .eqIfPresent(PtProfitDO::getPtTotalAdd, reqVO.getPtTotalAdd())
+                .betweenIfPresent(PtProfitDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(PtProfitDO::getId));
+    }
+
+}

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

@@ -0,0 +1,31 @@
+package cn.newfeifan.mall.module.distri.dal.mysql.ptprofitlog;
+
+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.ptprofitlog.PtProfitLogDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.distri.controller.admin.ptprofitlog.vo.*;
+
+/**
+ * 平台利润记录 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface PtProfitLogMapper extends BaseMapperX<PtProfitLogDO> {
+
+    default PageResult<PtProfitLogDO> selectPage(PtProfitLogPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<PtProfitLogDO>()
+                .eqIfPresent(PtProfitLogDO::getAmount, reqVO.getAmount())
+                .eqIfPresent(PtProfitLogDO::getAfterAmount, reqVO.getAfterAmount())
+                .eqIfPresent(PtProfitLogDO::getOrderId, reqVO.getOrderId())
+                .eqIfPresent(PtProfitLogDO::getPercentTemplate, reqVO.getPercentTemplate())
+                .betweenIfPresent(PtProfitLogDO::getCreateTime, reqVO.getCreateTime())
+                .eqIfPresent(PtProfitLogDO::getProfitStatus, reqVO.getProfitStatus())
+                .eqIfPresent(PtProfitLogDO::getUserId, reqVO.getUserId())
+                .orderByDesc(PtProfitLogDO::getId));
+    }
+}

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

@@ -0,0 +1,41 @@
+package cn.newfeifan.mall.module.distri.dal.mysql.sharepath;
+
+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.sharepath.SharePathDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.distri.controller.admin.sharepath.vo.*;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 分销用户关系 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface SharePathMapper extends BaseMapperX<SharePathDO> {
+
+    default PageResult<SharePathDO> selectPage(SharePathPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<SharePathDO>()
+                .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));
+    }
+
+    void addNode(@Param("parentId") Long parentId, @Param("newDescendantId") Long newDescendantId);
+
+
+    int getMaxSortByParentId(@Param("parentId") Long parentId);
+
+    // 删除节点及其子节点的旧祖先关系
+    void deleteOldAncestors(@Param("nodeId") Long nodeId);
+
+    // 添加节点及其子节点的新祖先关系
+    void addNewAncestors(@Param("nodeId") Long nodeId, @Param("newParentId") Long newParentId);
+}

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

@@ -0,0 +1,29 @@
+package cn.newfeifan.mall.module.distri.dal.mysql.socialstatus;
+
+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.socialstatus.SocialStatusDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.distri.controller.admin.socialstatus.vo.*;
+
+/**
+ * 分销用户身价 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface SocialStatusMapper extends BaseMapperX<SocialStatusDO> {
+
+    default PageResult<SocialStatusDO> selectPage(SocialStatusPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<SocialStatusDO>()
+                .eqIfPresent(SocialStatusDO::getLevel, reqVO.getLevel())
+                .likeIfPresent(SocialStatusDO::getName, reqVO.getName())
+                .betweenIfPresent(SocialStatusDO::getCreateTime, reqVO.getCreateTime())
+                .eqIfPresent(SocialStatusDO::getPoint, reqVO.getPoint())
+                .orderByDesc(SocialStatusDO::getId));
+    }
+
+}

+ 27 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/source/SourceMapper.java

@@ -0,0 +1,27 @@
+package cn.newfeifan.mall.module.distri.dal.mysql.source;
+
+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.source.SourceDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.distri.controller.admin.source.vo.*;
+
+/**
+ * 分销来源 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface SourceMapper extends BaseMapperX<SourceDO> {
+
+    default PageResult<SourceDO> selectPage(SourcePageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<SourceDO>()
+                .likeIfPresent(SourceDO::getName, reqVO.getName())
+                .betweenIfPresent(SourceDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(SourceDO::getId));
+    }
+
+}

+ 36 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/mq/consumer/sharePath/AddSharePathConsumer.java

@@ -0,0 +1,36 @@
+package cn.newfeifan.mall.module.distri.mq.consumer.sharePath;
+
+import cn.newfeifan.mall.module.distri.controller.admin.sharepath.vo.SharePathSaveReqVO;
+import cn.newfeifan.mall.module.distri.service.sharepath.SharePathService;
+import cn.newfeifan.mall.module.member.message.share.SharePathCreateMessage;
+import cn.newfeifan.mall.module.member.message.user.MemberUserCreateMessage;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.context.event.EventListener;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+
+/**
+ * 用户注册时,发送优惠劵的消费者,基 {@link MemberUserCreateMessage} 消息
+ *
+ * @author owen
+ */
+@Component
+@Slf4j
+public class AddSharePathConsumer {
+
+    @Resource
+    private SharePathService sharePathService;
+
+    @EventListener
+    @Async // Spring Event 默认在 Producer 发送的线程,通过 @Async 实现异步
+    public void onMessage(SharePathCreateMessage message) {
+        log.info("[onMessage][消息内容({})]", message);
+        SharePathSaveReqVO saveReqVO = SharePathSaveReqVO.builder()
+                .ancestor(1L)
+                .descendant(message.getUserId()).build();
+        sharePathService.createSharePathByUserId(saveReqVO);
+    }
+
+}

+ 59 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/duser/DuserService.java

@@ -0,0 +1,59 @@
+package cn.newfeifan.mall.module.distri.service.duser;
+
+import java.util.*;
+import javax.validation.*;
+import cn.newfeifan.mall.module.distri.controller.admin.duser.vo.*;
+import cn.newfeifan.mall.module.distri.controller.admin.sharepath.vo.SharePathSaveReqVO;
+import cn.newfeifan.mall.module.distri.dal.dataobject.duser.DuserDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+
+/**
+ * 推荐用户 Service 接口
+ *
+ * @author 非繁人
+ */
+public interface DuserService {
+
+    /**
+     * 创建推荐用户
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createDuser(@Valid DuserSaveReqVO createReqVO);
+
+    /**
+     * 更新推荐用户
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateDuser(@Valid DuserSaveReqVO updateReqVO);
+
+    /**
+     * 删除推荐用户
+     *
+     * @param id 编号
+     */
+    void deleteDuser(Long id);
+
+    /**
+     * 获得推荐用户
+     *
+     * @param id 编号
+     * @return 推荐用户
+     */
+    DuserDO getDuser(Long id);
+
+    /**
+     * 获得推荐用户分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 推荐用户分页
+     */
+    PageResult<DuserDO> getDuserPage(DuserPageReqVO pageReqVO);
+
+
+    void hasUserAndCreat(SharePathSaveReqVO saveReqVO);
+
+}

+ 135 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/duser/DuserServiceImpl.java

@@ -0,0 +1,135 @@
+package cn.newfeifan.mall.module.distri.service.duser;
+
+import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.newfeifan.mall.module.distri.controller.admin.integral.vo.IntegralSaveReqVO;
+import cn.newfeifan.mall.module.distri.controller.admin.sharepath.vo.SharePathSaveReqVO;
+import cn.newfeifan.mall.module.distri.controller.admin.socialstatus.vo.SocialStatusSaveReqVO;
+import cn.newfeifan.mall.module.distri.dal.dataobject.integral.IntegralDO;
+import cn.newfeifan.mall.module.distri.dal.dataobject.socialstatus.SocialStatusDO;
+import cn.newfeifan.mall.module.distri.service.integral.IntegralService;
+import cn.newfeifan.mall.module.distri.service.socialstatus.SocialStatusService;
+import cn.newfeifan.mall.module.member.dal.dataobject.user.MemberUserDO;
+import cn.newfeifan.mall.module.member.service.user.MemberUserService;
+import cn.newfeifan.mall.module.system.service.member.MemberService;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+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.duser.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.duser.DuserDO;
+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.duser.DuserMapper;
+
+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 DuserServiceImpl implements DuserService {
+
+    @Resource
+    private DuserMapper duserMapper;
+
+    @Resource
+    private MemberUserService memberUserService;
+
+
+    @Override
+    public Long createDuser(DuserSaveReqVO createReqVO) {
+        // 插入
+        DuserDO duser = BeanUtils.toBean(createReqVO, DuserDO.class);
+        duserMapper.insert(duser);
+        // 返回
+        return duser.getId();
+    }
+
+    @Override
+    public void updateDuser(DuserSaveReqVO updateReqVO) {
+        // 校验存在
+        validateDuserExists(updateReqVO.getId());
+        // 更新
+        DuserDO updateObj = BeanUtils.toBean(updateReqVO, DuserDO.class);
+        duserMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteDuser(Long id) {
+        // 校验存在
+        validateDuserExists(id);
+        // 删除
+        duserMapper.deleteById(id);
+    }
+
+    private void validateDuserExists(Long id) {
+        if (duserMapper.selectById(id) == null) {
+            throw exception(DUSER_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public DuserDO getDuser(Long id) {
+        return duserMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<DuserDO> getDuserPage(DuserPageReqVO pageReqVO) {
+        return duserMapper.selectPage(pageReqVO);
+    }
+
+    @Resource
+    private IntegralService integralService;
+
+    @Resource
+    private SocialStatusService socialStatusService;
+
+    @Override
+    public void hasUserAndCreat(SharePathSaveReqVO saveReqVO) {
+        checkAndCreat(saveReqVO.getDescendant());
+        checkAndCreat(saveReqVO.getAncestor());
+    }
+
+    private void checkAndCreat(Long userId) {
+        DuserDO duserDO = duserMapper.selectOne(new LambdaQueryWrapperX<DuserDO>().eqIfPresent(DuserDO::getUserId, userId));
+        MemberUserDO user = memberUserService.getUser(userId);
+        // 判断是否有钱包
+        IntegralDO integralDO = integralService.selectByUser(userId);
+        if (integralDO == null) {
+            // 创建一个钱包
+            IntegralSaveReqVO integralSaveReqVO = IntegralSaveReqVO.builder()
+                    .currentQuota(0)
+                    .freezeQuota(0)
+                    .categoryId(3L)
+                    .userId(userId).build();
+            Long integralId = integralService.createIntegral(integralSaveReqVO);
+            integralDO = new IntegralDO().setId(integralId);
+        }
+        if (duserDO == null) {
+            // 创建一个新的营销用户
+            DuserSaveReqVO duserSaveReqVO = DuserSaveReqVO.builder()
+                    .userId(userId)
+                    .mobile(user.getMobile())
+                    .name(user.getName())
+                    .integralId(integralDO.getId())
+                    .source(userId)
+                    .socialStatus(1L)
+                    .socialStatusPoint(0L)
+                    .build();
+            duserMapper.insert(BeanUtils.toBean(duserSaveReqVO, DuserDO.class));
+        }
+    }
+
+}

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

@@ -0,0 +1,63 @@
+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);
+
+    /**
+     * 根据用户ID查询是否有钱包
+     * @param descendant
+     * @return
+     */
+    IntegralDO selectByUser(Long descendant);
+
+
+}

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

@@ -0,0 +1,83 @@
+package cn.newfeifan.mall.module.distri.service.integral;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+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);
+    }
+
+    @Override
+    public IntegralDO selectByUser(Long descendant) {
+        return integralMapper.selectOne(new LambdaQueryWrapper<IntegralDO>().eq(IntegralDO::getUserId, descendant));
+    }
+
+}

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

@@ -0,0 +1,64 @@
+package cn.newfeifan.mall.module.distri.service.ordercalc;
+
+import java.util.*;
+import javax.validation.*;
+
+import cn.newfeifan.mall.framework.common.mq.message.order.DistriOrderMessage;
+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);
+
+    /**
+     * 计算订单信息
+     * @param tradeOrderDO
+     */
+    void calc(List<DistriOrderMessage> tradeOrderDO);
+
+
+}

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

@@ -0,0 +1,197 @@
+package cn.newfeifan.mall.module.distri.service.ordercalc;
+
+import cn.newfeifan.mall.framework.common.mq.message.order.DistriOrderMessage;
+import cn.newfeifan.mall.framework.common.util.json.JsonUtils;
+import cn.newfeifan.mall.module.distri.controller.admin.ptprofit.vo.PtProfitSaveReqVO;
+import cn.newfeifan.mall.module.distri.controller.admin.ptprofitlog.vo.PtProfitLogSaveReqVO;
+import cn.newfeifan.mall.module.distri.dal.dataobject.orderpercentage.OrderPercentageDO;
+import cn.newfeifan.mall.module.distri.dal.dataobject.ptprofit.PtProfitDO;
+import cn.newfeifan.mall.module.distri.service.orderpercentage.OrderPercentageService;
+import cn.newfeifan.mall.module.distri.service.ptprofit.PtProfitService;
+import cn.newfeifan.mall.module.distri.service.ptprofitlog.PtProfitLogService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+import org.springframework.validation.annotation.Validated;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
+
+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.constant.DistriConstants.PERCENT;
+import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
+
+/**
+ * 订单产生数据计算 Service 实现类
+ *
+ * @author 非繁人
+ */
+@Service
+@Validated
+public class OrderCalcServiceImpl implements OrderCalcService {
+
+    @Resource
+    private OrderCalcMapper orderCalcMapper;
+
+    @Resource
+    private PtProfitService ptProfitService;
+
+    @Resource
+    private PtProfitLogService ptProfitLogService;
+
+
+    @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);
+    }
+
+    @Resource
+    private OrderPercentageService orderPercentageService;
+
+    @Override
+    public void calc(List<DistriOrderMessage> tradeOrderDO) {
+
+        // 获取到当前订单的所有人
+        List<Long> userId = tradeOrderDO.stream().map(DistriOrderMessage::getUserId).collect(Collectors.toList());
+
+
+        OrderPercentageDO orderPercentageDO = orderPercentageService.queryStatus();
+        // 当前计算百分比模板
+        String percentTemplate = JsonUtils.toJsonString(orderPercentageDO);
+
+
+        // 每个订单收益
+        List<OrderCalcSaveReqVO> saveList = new ArrayList<>();
+        // 平台收益
+        List<PtProfitSaveReqVO> ptProfitSaveReqVOS = new ArrayList<>();
+        // 平台收益日志
+        List<PtProfitLogSaveReqVO> ptProfitLogSaveReqVOS = new ArrayList<>();
+
+        PtProfitDO ptProfitDO = ptProfitService.getPtProfit();
+
+        tradeOrderDO.forEach(k -> {
+
+            // 计算利润: (价格 - 成本价格) * 产品数量
+            Integer profit = (k.getPrice() - k.getCostPrice()) * k.getProductCount();
+            // 计算毛利: 利润 * 0.38
+            Integer grossProfit = profit * orderPercentageDO.getGrossProfitPerc();
+            // 计算用户额度: 利润 * 0.38
+            Integer userProfit = grossProfit * orderPercentageDO.getGrossProfitUserQuotaPerc();
+            // 计算直推人额度: 利润 * 0.38
+            Integer ancestorQuota = grossProfit * orderPercentageDO.getGrossProfitAncestorQuotaPerc();
+            // 计算合赢奖: 利润 * 0.38
+            Integer bonusQuota = grossProfit * orderPercentageDO.getGrossProfitBonusQuotaPerc();
+            // 计算平台收益: 利润 * 0.38
+            Integer platformQuota = grossProfit * orderPercentageDO.getGrossProfitPlatformQuotaPerc();
+
+
+            // 计算
+            OrderCalcSaveReqVO orderCalcSaveReqVO = OrderCalcSaveReqVO.builder()
+                    .userId(k.getUserId())
+                    .orderNo(k.getNo())
+                    .cost(k.getCostPrice())
+                    .price(k.getPrice())
+                    .grossProfit(grossProfit)
+                    .grossProfitUserQuota(userProfit)
+                    .grossProfitAncestorQuota(ancestorQuota)
+                    .grossProfitBonusQuota(bonusQuota)
+                    .grossProfitPlatformQuota(platformQuota)
+                    .percentTemplate(percentTemplate)
+                    .build();
+            saveList.add(orderCalcSaveReqVO);
+
+            // 每个订单计算的过程
+            // 增加平台收益
+            // 平台服务费
+            Integer ptGrossAdd = ptProfitDO.getPtGrossAdd() + platformQuota;
+            // 平台收益
+            Integer ptAdd = ptProfitDO.getPtAdd() + grossProfit * (10000 - orderPercentageDO.getGrossProfitBonusQuotaPerc());
+            // 平台总收益
+            Integer ptTotal = ptProfitDO.getPtTotalAdd() + ptGrossAdd + ptAdd;
+
+            PtProfitSaveReqVO ptProfitSaveReqVO = PtProfitSaveReqVO.builder()
+                    .ptAdd(ptAdd)
+                    .ptGrossAdd(ptGrossAdd)
+                    .ptTotalAdd(ptTotal).build();
+            ptProfitSaveReqVOS.add(ptProfitSaveReqVO);
+
+            // 平台记录
+            PtProfitLogSaveReqVO ptGrossAddLog = PtProfitLogSaveReqVO.builder()
+                    .orderId(k.getOrderId())
+                    .profitStatus(1)
+                    .amount(platformQuota)
+                    .afterAmount(ptProfitSaveReqVO.getPtGrossAdd())
+                    .percentTemplate(percentTemplate).build();
+
+            PtProfitLogSaveReqVO ptAddLog = PtProfitLogSaveReqVO.builder()
+                    .orderId(k.getOrderId())
+                    .profitStatus(2)
+                    .amount(grossProfit * (PERCENT - orderPercentageDO.getGrossProfitBonusQuotaPerc()))
+                    .afterAmount(ptProfitSaveReqVO.getPtAdd())
+                    .percentTemplate(percentTemplate).build();
+            ptProfitLogSaveReqVOS.add(ptGrossAddLog);
+            ptProfitLogSaveReqVOS.add(ptAddLog);
+
+
+        });
+
+        // 将信息存储到数据库中
+        orderCalcMapper.insertBatch(BeanUtils.toBean(saveList, OrderCalcDO.class));
+        ptProfitService.saveBatch(ptProfitSaveReqVOS);
+        ptProfitLogService.saveBatch(ptProfitLogSaveReqVOS);
+
+
+        // todo 计算当天用户的碰撞
+
+
+    }
+
+}

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

@@ -0,0 +1,62 @@
+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 OrderPercentageDoubleSaveReqVO createReqVO);
+
+    /**
+     * 更新积分相关计算浮动百分比设置
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateOrderPercentage(@Valid OrderPercentageDoubleSaveReqVO updateReqVO);
+
+    /**
+     * 删除积分相关计算浮动百分比设置
+     *
+     * @param id 编号
+     */
+    void deleteOrderPercentage(Long id);
+
+    /**
+     * 获得积分相关计算浮动百分比设置
+     *
+     * @param id 编号
+     * @return 积分相关计算浮动百分比设置
+     */
+    OrderPercentageDO getOrderPercentage(Long id);
+
+    /**
+     * 获得积分相关计算浮动百分比设置分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 积分相关计算浮动百分比设置分页
+     */
+    PageResult<OrderPercentageDO> getOrderPercentagePage(OrderPercentagePageReqVO pageReqVO);
+
+    /**
+     * 查找默认计算参数
+     * @return
+     */
+    OrderPercentageDO queryStatus();
+
+
+}

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

@@ -0,0 +1,110 @@
+package cn.newfeifan.mall.module.distri.service.orderpercentage;
+
+import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+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.constant.DistriConstants.ONE_HUNDRED;
+import static cn.newfeifan.mall.module.distri.constant.DistriConstants.PERCENT;
+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(OrderPercentageDoubleSaveReqVO createReqVO) {
+        OrderPercentageSaveReqVO orderPercentageSaveReqVO = new OrderPercentageSaveReqVO();
+        orderPercentageSaveReqVO.setDivideIntoPerc((int) (createReqVO.getDivideIntoPerc() * PERCENT));
+        orderPercentageSaveReqVO.setGrossProfitPerc((int) (createReqVO.getGrossProfitPerc() * PERCENT));
+        orderPercentageSaveReqVO.setGrossProfitAncestorQuotaPerc((int) (createReqVO.getGrossProfitAncestorQuotaPerc() * PERCENT));
+        orderPercentageSaveReqVO.setGrossProfitBonusQuotaPerc((int) (createReqVO.getGrossProfitBonusQuotaPerc() * PERCENT));
+        orderPercentageSaveReqVO.setGrossProfitPlatformQuotaPerc((int) (createReqVO.getGrossProfitPlatformQuotaPerc() * PERCENT));
+        orderPercentageSaveReqVO.setGrossProfitUserQuotaPerc((int) (createReqVO.getGrossProfitUserQuotaPerc() * PERCENT));
+        if (checkPercent(createReqVO)){
+            throw  exception(PERCENT_LARGE_ONE_HUNDRED);
+        }
+        // 插入
+        OrderPercentageDO orderPercentage = BeanUtils.toBean(orderPercentageSaveReqVO, OrderPercentageDO.class);
+        orderPercentageMapper.insert(orderPercentage);
+        // 返回
+        return orderPercentage.getId();
+    }
+
+    public boolean checkPercent(OrderPercentageDoubleSaveReqVO createReqVO){
+        // 判断是否等于1
+        Double total =  createReqVO.getGrossProfitUserQuotaPerc()+createReqVO.getGrossProfitAncestorQuotaPerc()+createReqVO.getGrossProfitPlatformQuotaPerc()
+                +createReqVO.getGrossProfitBonusQuotaPerc();
+        return total > ONE_HUNDRED;
+    }
+
+
+    @Override
+    public void updateOrderPercentage(OrderPercentageDoubleSaveReqVO 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);
+    }
+
+    @Override
+    public OrderPercentageDO queryStatus() {
+        List<OrderPercentageDO> orderPercentageDOS = orderPercentageMapper.selectList(new LambdaQueryWrapperX<OrderPercentageDO>()
+                .eqIfPresent(OrderPercentageDO::getStatus, 1));
+
+        if (orderPercentageDOS.isEmpty()) {
+            return null;
+        }
+        return orderPercentageDOS.get(0);
+    }
+
+}

+ 14 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/orderpercentage/handle/OrderPercentCheckHandler.java

@@ -0,0 +1,14 @@
+package cn.newfeifan.mall.module.distri.service.orderpercentage.handle;
+
+import org.springframework.stereotype.Component;
+
+/**
+ * 订单百分比校验
+ *
+ * @author HUIHUI
+ */
+@Component
+public class OrderPercentCheckHandler  implements OrderPercentHandler{
+
+
+}

+ 24 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/orderpercentage/handle/OrderPercentHandler.java

@@ -0,0 +1,24 @@
+package cn.newfeifan.mall.module.distri.service.orderpercentage.handle;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.lang.Assert;
+import cn.newfeifan.mall.module.promotion.api.bargain.BargainActivityApi;
+import cn.newfeifan.mall.module.promotion.api.bargain.BargainRecordApi;
+import cn.newfeifan.mall.module.trade.dal.dataobject.order.TradeOrderDO;
+import cn.newfeifan.mall.module.trade.dal.dataobject.order.TradeOrderItemDO;
+import cn.newfeifan.mall.module.trade.enums.order.TradeOrderTypeEnum;
+import cn.newfeifan.mall.module.trade.service.order.handler.TradeOrderHandler;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 订单百分比
+ *
+ * @author HUIHUI
+ */
+public interface OrderPercentHandler {
+
+
+}

+ 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/partitioncrash/PartitionCrashService.java

@@ -0,0 +1,55 @@
+package cn.newfeifan.mall.module.distri.service.partitioncrash;
+
+import java.util.*;
+import javax.validation.*;
+import cn.newfeifan.mall.module.distri.controller.admin.partitioncrash.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.partitioncrash.PartitionCrashDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+
+/**
+ * 分区碰撞 Service 接口
+ *
+ * @author 非繁人
+ */
+public interface PartitionCrashService {
+
+    /**
+     * 创建分区碰撞
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createPartitionCrash(@Valid PartitionCrashSaveReqVO createReqVO);
+
+    /**
+     * 更新分区碰撞
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updatePartitionCrash(@Valid PartitionCrashSaveReqVO updateReqVO);
+
+    /**
+     * 删除分区碰撞
+     *
+     * @param id 编号
+     */
+    void deletePartitionCrash(Long id);
+
+    /**
+     * 获得分区碰撞
+     *
+     * @param id 编号
+     * @return 分区碰撞
+     */
+    PartitionCrashDO getPartitionCrash(Long id);
+
+    /**
+     * 获得分区碰撞分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 分区碰撞分页
+     */
+    PageResult<PartitionCrashDO> getPartitionCrashPage(PartitionCrashPageReqVO pageReqVO);
+
+}

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

@@ -0,0 +1,74 @@
+package cn.newfeifan.mall.module.distri.service.partitioncrash;
+
+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.partitioncrash.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.partitioncrash.PartitionCrashDO;
+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.partitioncrash.PartitionCrashMapper;
+
+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 PartitionCrashServiceImpl implements PartitionCrashService {
+
+    @Resource
+    private PartitionCrashMapper partitionCrashMapper;
+
+    @Override
+    public Long createPartitionCrash(PartitionCrashSaveReqVO createReqVO) {
+        // 插入
+        PartitionCrashDO partitionCrash = BeanUtils.toBean(createReqVO, PartitionCrashDO.class);
+        partitionCrashMapper.insert(partitionCrash);
+        // 返回
+        return partitionCrash.getId();
+    }
+
+    @Override
+    public void updatePartitionCrash(PartitionCrashSaveReqVO updateReqVO) {
+        // 校验存在
+        validatePartitionCrashExists(updateReqVO.getId());
+        // 更新
+        PartitionCrashDO updateObj = BeanUtils.toBean(updateReqVO, PartitionCrashDO.class);
+        partitionCrashMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deletePartitionCrash(Long id) {
+        // 校验存在
+        validatePartitionCrashExists(id);
+        // 删除
+        partitionCrashMapper.deleteById(id);
+    }
+
+    private void validatePartitionCrashExists(Long id) {
+        if (partitionCrashMapper.selectById(id) == null) {
+            throw exception(PARTITION_CRASH_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public PartitionCrashDO getPartitionCrash(Long id) {
+        return partitionCrashMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<PartitionCrashDO> getPartitionCrashPage(PartitionCrashPageReqVO pageReqVO) {
+        return partitionCrashMapper.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);
+    }
+
+}

+ 63 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/ptprofit/PtProfitService.java

@@ -0,0 +1,63 @@
+package cn.newfeifan.mall.module.distri.service.ptprofit;
+
+import java.util.*;
+import javax.validation.*;
+import cn.newfeifan.mall.module.distri.controller.admin.ptprofit.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.ptprofit.PtProfitDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+
+/**
+ * 平台利润 Service 接口
+ *
+ * @author 非繁人
+ */
+public interface PtProfitService {
+
+    /**
+     * 创建平台利润
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createPtProfit(@Valid PtProfitSaveReqVO createReqVO);
+
+    /**
+     * 更新平台利润
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updatePtProfit(@Valid PtProfitSaveReqVO updateReqVO);
+
+    /**
+     * 删除平台利润
+     *
+     * @param id 编号
+     */
+    void deletePtProfit(Long id);
+
+    /**
+     * 获得平台利润
+     *
+     * @param id 编号
+     * @return 平台利润
+     */
+    PtProfitDO getPtProfit(Long id);
+
+    /**
+     * 获得平台利润分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 平台利润分页
+     */
+    PageResult<PtProfitDO> getPtProfitPage(PtProfitPageReqVO pageReqVO);
+
+    /**
+     * 获取当前平台信息
+     */
+    PtProfitDO getPtProfit();
+
+
+    void saveBatch(List<PtProfitSaveReqVO> ptProfitSaveReqVOS);
+
+}

+ 91 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/ptprofit/PtProfitServiceImpl.java

@@ -0,0 +1,91 @@
+package cn.newfeifan.mall.module.distri.service.ptprofit;
+
+import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
+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.ptprofit.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.ptprofit.PtProfitDO;
+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.ptprofit.PtProfitMapper;
+
+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 PtProfitServiceImpl implements PtProfitService {
+
+    @Resource
+    private PtProfitMapper ptProfitMapper;
+
+    @Override
+    public Long createPtProfit(PtProfitSaveReqVO createReqVO) {
+        // 插入
+        PtProfitDO ptProfit = BeanUtils.toBean(createReqVO, PtProfitDO.class);
+        ptProfitMapper.insert(ptProfit);
+        // 返回
+        return ptProfit.getId();
+    }
+
+    @Override
+    public void updatePtProfit(PtProfitSaveReqVO updateReqVO) {
+        // 校验存在
+        validatePtProfitExists(updateReqVO.getId());
+        // 更新
+        PtProfitDO updateObj = BeanUtils.toBean(updateReqVO, PtProfitDO.class);
+        ptProfitMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deletePtProfit(Long id) {
+        // 校验存在
+        validatePtProfitExists(id);
+        // 删除
+        ptProfitMapper.deleteById(id);
+    }
+
+    private void validatePtProfitExists(Long id) {
+        if (ptProfitMapper.selectById(id) == null) {
+            throw exception(PT_PROFIT_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public PtProfitDO getPtProfit(Long id) {
+        return ptProfitMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<PtProfitDO> getPtProfitPage(PtProfitPageReqVO pageReqVO) {
+        return ptProfitMapper.selectPage(pageReqVO);
+    }
+
+    @Override
+    public PtProfitDO getPtProfit() {
+        return ptProfitMapper.selectList(new LambdaQueryWrapperX<PtProfitDO>()).get(0);
+    }
+
+    @Override
+    public void saveBatch(List<PtProfitSaveReqVO> ptProfitSaveReqVOS) {
+
+        List<PtProfitDO> ptProfit = BeanUtils.toBean(ptProfitSaveReqVOS, PtProfitDO.class);
+        ptProfitMapper.insertBatch(ptProfit);
+
+    }
+
+}

Some files were not shown because too many files changed in this diff