浏览代码

所需功能需改后首次提交

Yangzw 2 月之前
父节点
当前提交
a6b6492c0a
共有 100 个文件被更改,包括 1741 次插入3350 次删除
  1. 8 1
      feifan-framework/feifan-common/src/main/resources/i18n/messages.properties
  2. 7 0
      feifan-framework/feifan-common/src/main/resources/i18n/messages_en.properties
  3. 7 0
      feifan-framework/feifan-common/src/main/resources/i18n/messages_fr_FR.properties
  4. 7 0
      feifan-framework/feifan-common/src/main/resources/i18n/messages_ko_KR.properties
  5. 0 28
      feifan-framework/feifan-spring-boot-starter-job/src/main/java/cn/newfeifan/mall/framework/quartz/core/scheduler/SchedulerManager.java
  6. 3 0
      feifan-module-distri/feifan-module-distri-api/src/main/java/cn/newfeifan/mall/module/distri/enums/ErrorCodeConstants.java
  7. 13 6
      feifan-module-distri/feifan-module-distri-api/src/main/java/cn/newfeifan/mall/module/distri/enums/IntegralEnum.java
  8. 15 0
      feifan-module-distri/feifan-module-distri-api/src/main/java/cn/newfeifan/mall/module/distri/enums/IntegralTypeEnum.java
  9. 18 0
      feifan-module-distri/feifan-module-distri-api/src/main/java/cn/newfeifan/mall/module/distri/enums/ProfitTypeEnum.java
  10. 2 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/duser/vo/DuserInfoVO.java
  11. 1 1
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/duser/vo/DuserPageReqVO.java
  12. 1 4
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/duser/vo/DuserSaveReqVO.java
  13. 12 7
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofit/vo/PtProfitPageReqVO.java
  14. 11 7
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/ptprofit/vo/PtProfitSaveReqVO.java
  15. 0 66
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/applicationforwithdrawal/AppApplicationForWithdrawalController.java
  16. 0 48
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/applicationforwithdrawal/vo/AppApplicationForWithdrawalPageReqVO.java
  17. 0 56
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/applicationforwithdrawal/vo/AppApplicationForWithdrawalRespVO.java
  18. 0 42
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/applicationforwithdrawal/vo/AppApplicationForWithdrawalSaveReqVO.java
  19. 0 88
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/applicationforwithdrawalchannel/AppApplicationForWithdrawalChannelController.java
  20. 0 48
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/applicationforwithdrawalchannel/vo/AppApplicationForWithdrawalChannelPageReqVO.java
  21. 0 56
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/applicationforwithdrawalchannel/vo/AppApplicationForWithdrawalChannelRespVO.java
  22. 0 46
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/applicationforwithdrawalchannel/vo/AppApplicationForWithdrawalChannelSaveReqVO.java
  23. 0 34
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/consumptionchangelog/ConsumptionChangeLogController.java
  24. 0 39
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/consumptionchangelog/vo/ConsumptionChangeLogPageReqVO.java
  25. 0 50
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/consumptionchangelog/vo/ConsumptionChangeLogRespVO.java
  26. 0 40
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/consumptionchangelog/vo/ConsumptionChangeLogSaveReqVO.java
  27. 0 42
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/consumptiontransferlog/ConsumptionTransferLogController.java
  28. 4 4
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integral/IntegralController.java
  29. 12 9
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integral/vo/IntegralSaveReqVO.java
  30. 25 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integral/vo/IntegralTransitionRespVO.java
  31. 34 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integralchangelog/IntegralChangeLogController.java
  32. 64 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integralchangelog/vo/IntegralChangeLogPageReqVO.java
  33. 82 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integralchangelog/vo/IntegralChangeLogRespVO.java
  34. 59 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integralchangelog/vo/IntegralChangeLogSaveReqVO.java
  35. 40 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integraltransferlog/IntegralTransferLogController.java
  36. 5 2
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integraltransferlog/vo/IntegralTransferLogPageReqVO.java
  37. 6 2
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integraltransferlog/vo/IntegralTransferLogRespVO.java
  38. 7 5
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integraltransferlog/vo/IntegralTransferLogSaveReqVO.java
  39. 0 59
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/orderpercentage/vo/OrderPercentageDoubleSaveReqVO.java
  40. 40 26
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/orderpercentage/vo/OrderPercentagePageReqVO.java
  41. 81 12
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/orderpercentage/vo/OrderPercentageRespVO.java
  42. 0 8
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/ptprofitlog/PtProfitLogController.java
  43. 9 15
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/ptprofitlog/vo/PtProfitLogPageReqVO.java
  44. 11 38
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/ptprofitlog/vo/PtProfitLogRespVO.java
  45. 9 37
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/ptprofitlog/vo/PtProfitLogSaveReqVO.java
  46. 8 6
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/sharepath/vo/AppSharePathRespVO.java
  47. 14 21
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/sharepath/vo/SharePathPageReqVO.java
  48. 33 56
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/sharepath/vo/SharePathRespVO.java
  49. 14 21
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/sharepath/vo/SharePathSaveReqVO.java
  50. 0 26
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/sharepath/vo/SharePathTreeReqVO.java
  51. 0 35
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/convert/usertopupconsumptionpointsorder/UserTopUpConsumptionPointsOrderConvert.java
  52. 0 65
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/applicationforwithdrawal/ApplicationForWithdrawalDO.java
  53. 0 66
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/applicationforwithdrawalchannel/ApplicationForWithdrawalChannelDO.java
  54. 0 62
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/consumptionchangelog/ConsumptionChangeLogDO.java
  55. 1 5
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/duser/DuserDO.java
  56. 15 9
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/integral/IntegralDO.java
  57. 84 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/integralchangelog/IntegralChangeLogDO.java
  58. 8 4
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/integraltransferlog/IntegralTransferLogDO.java
  59. 26 40
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/orderpercentage/OrderPercentageDO.java
  60. 2 4
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/ptprofit/PtProfitDO.java
  61. 10 45
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/ptprofitlog/PtProfitLogDO.java
  62. 13 22
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/sharepath/SharePathDO.java
  63. 0 31
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/applicationforwithdrawal/ApplicationForWithdrawalMapper.java
  64. 0 31
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/applicationforwithdrawalchannel/ApplicationForWithdrawalChannelMapper.java
  65. 13 11
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/consumptionchangelog/ConsumptionChangeLogMapper.java
  66. 0 29
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/consumptiontransferlog/ConsumptionTransferLogMapper.java
  67. 1 1
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/duser/DuserMapper.java
  68. 1 2
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/integral/IntegralMapper.java
  69. 30 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/integraltransferlog/IntegralTransferLogMapper.java
  70. 0 2
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/orderpercentage/OrderPercentageMapper.java
  71. 3 69
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/ptprofitlog/PtProfitLogMapper.java
  72. 4 13
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/sharepath/SharePathMapper.java
  73. 4 2
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/mq/consumer/sharePath/AddSharePathConsumer.java
  74. 0 24
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/mq/consumer/topupconsumptionpoints/TopUpConsumptionPointsConsumer.java
  75. 0 53
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/applicationforwithdrawal/ApplicationForWithdrawalService.java
  76. 0 231
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/applicationforwithdrawal/ApplicationForWithdrawalServiceImpl.java
  77. 0 61
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/applicationforwithdrawalchannel/ApplicationForWithdrawalChannelService.java
  78. 0 108
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/applicationforwithdrawalchannel/ApplicationForWithdrawalChannelServiceImpl.java
  79. 0 56
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/consumptionchangelog/ConsumptionChangeLogService.java
  80. 0 92
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/consumptionchangelog/ConsumptionChangeLogServiceImpl.java
  81. 0 55
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/consumptiontransferlog/ConsumptionTransferLogService.java
  82. 0 164
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/consumptiontransferlog/ConsumptionTransferLogServiceImpl.java
  83. 0 43
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/duser/DuserService.java
  84. 7 65
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/duser/DuserServiceImpl.java
  85. 19 64
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integral/IntegralService.java
  86. 293 167
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integral/IntegralServiceImpl.java
  87. 42 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integralchangelog/IntegralChangeLogService.java
  88. 70 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integralchangelog/IntegralChangeLogServiceImpl.java
  89. 33 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integraltransferlog/IntegralTransferLogService.java
  90. 226 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integraltransferlog/IntegralTransferLogServiceImpl.java
  91. 0 43
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/orderpercentage/OrderPercentageService.java
  92. 0 68
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/orderpercentage/OrderPercentageServiceImpl.java
  93. 16 50
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/ptprofit/PtProfitService.java
  94. 77 58
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/ptprofit/PtProfitServiceImpl.java
  95. 0 7
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/ptprofitlog/PtProfitLogService.java
  96. 3 24
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/ptprofitlog/PtProfitLogServiceImpl.java
  97. 1 8
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/sharepath/SharePathService.java
  98. 72 152
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/sharepath/SharePathServiceImpl.java
  99. 0 29
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/usertopupconsumptionpointsorder/UserTopUpConsumptionPointsOrderService.java
  100. 5 124
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/usertopupconsumptionpointsorder/UserTopUpConsumptionPointsOrderServiceImpl.java

+ 8 - 1
feifan-framework/feifan-common/src/main/resources/i18n/messages.properties

@@ -27,6 +27,9 @@
 1002030036=消费分变动记录不存在
 1002030037=消费分转让记录不存在
 1002030038=用户充值消费分订单不存在
+1002030039=用户已经存在关系网
+1002030040=您的积分余额不足
+1002030041=您的用户身份还不是代理商,暂不能能转换绿积分!
 1001000001=参数配置不存在
 1001000002=参数配置 key 重复
 1001000003=不能删除类型为系统内置的参数配置
@@ -183,6 +186,7 @@
 1002029003=商户申请不存在
 1002029004=商户申请记录不存在
 1002029005=用户还不是代理商
+1002029006=联络人账户已存在
 1011000010=交易订单项不存在
 1011000011=交易订单不存在
 1011000012=交易订单项更新售后状态失败,请重试
@@ -254,7 +258,7 @@
 1004001002=修改手机失败,该手机号({})已经被使用
 1004001003=用户积分余额不足
 1004001004=输入的手机号不正常
-1004003000=登录失败,用户名或密码不正确
+1004003000=登录失败,手机号或密码不正确
 1004003001=登录失败,账号被禁用
 1004003005=登录失败,解析不到三方登录信息
 1004003006=登录失败,查询不到此用户
@@ -282,6 +286,9 @@
 1004012005=只能通过分享注册
 1004012006=本次注册账号失败,请退出当前页面重新扫描分享二维码注册
 1004012007=跳转失败,会员用户没有绑定系统用户
+1004012008=用户还没有设置支付密码,请前往设置!
+1004012009=支付密码错误,请重新输入!!
+1004012010=原支付密码错误,请重新修改!!
 1006000000=公众号账号不存在
 1006000001=生成公众号二维码失败,原因:{}
 1006000002=清空公众号的 API 配额失败,原因:{}

+ 7 - 0
feifan-framework/feifan-common/src/main/resources/i18n/messages_en.properties

@@ -27,6 +27,9 @@
 1002030036=Consumption points change record does not exist
 1002030037=Consumption points transfer record does not exist
 1002030038=User recharge consumption points order does not exist
+1002030039=用户已经存在关系网
+1002030040=您的积分余额不足
+1002030041=您的用户身份还不是代理商,暂不能能转换绿积分!
 1001000001=Parameter configuration does not exist
 1001000002=Parameter configuration key is duplicated
 1001000003=Cannot delete system-built-in parameter configuration
@@ -183,6 +186,7 @@
 1002029003=Merchant application does not exist
 1002029004=Merchant application record does not exist
 1002029005=Users are not agents yet
+1002029006=联络人账户已存在
 1011000010=Transaction order item does not exist
 1011000011=Transaction order does not exist
 1011000012=Failed to update after-sales status of transaction order item, please try again
@@ -282,6 +286,9 @@
 1004012005=Registration can only be completed through sharing
 1004012006=Registration failed: Please exit the current page and rescan the shared QR code to register
 1004012007=Navigation failed: Member user has not bound a system user
+1004012008=用户还没有设置支付密码,请前往设置!
+1004012009=支付密码错误,请重新输入!!
+1004012010=原支付密码错误,请重新修改!!
 1006000000=WeChat official account does not exist
 1006000001=Failed to generate official account QR code: Reason: {}
 1006000002=Failed to clear the official account API quota: Reason: {}

+ 7 - 0
feifan-framework/feifan-common/src/main/resources/i18n/messages_fr_FR.properties

@@ -27,6 +27,9 @@
 1002030036=Aucun enregistrement de modification de points de consommation n'existe
 1002030037=Aucun enregistrement de transfert de points de consommation n'existe
 1002030038=Aucune commande de recharge de points de consommation de l'utilisateur n'existe
+1002030039=用户已经存在关系网
+1002030040=您的积分余额不足
+1002030041=您的用户身份还不是代理商,暂不能能转换绿积分!
 1001000001=Aucune configuration de paramètre n'existe
 1001000002=La clé de configuration de paramètre est en double
 1001000003=Impossible de supprimer la configuration de paramètre intégrée au système
@@ -183,6 +186,7 @@
 1002029003=Aucune demande de fournisseur n'existe
 1002029004=Aucun enregistrement de demande de fournisseur n'existe
 1002029005=L’utilisateur n’est pas encore un agent
+1002029006=联络人账户已存在
 1011000010=Aucun élément de commande de transaction n'existe
 1011000011=Aucune commande de transaction n'existe
 1011000012=Échec de la mise à jour de l'état postérieur de la commande de transaction. Veuillez réessayer
@@ -282,6 +286,9 @@
 1004012005=L'inscription doit être complétée via le partage
 1004012006=L'inscription a échoué. Veuillez fermer la page actuelle et scanner à nouveau le QR code partagé pour vous inscrire
 1004012007=Échec de la navigation. L'utilisateur membre n'est pas lié à un utilisateur système
+1004012008=用户还没有设置支付密码,请前往设置!
+1004012009=支付密码错误,请重新输入!!
+1004012010=原支付密码错误,请重新修改!!
 1006000000=Aucun compte officiel WeChat n'existe
 1006000001=Impossible de générer le QR code du compte officiel. Raison : {}
 1006000002=Impossible de réinitialiser la quota API du compte officiel. Raison : {}

+ 7 - 0
feifan-framework/feifan-common/src/main/resources/i18n/messages_ko_KR.properties

@@ -27,6 +27,9 @@
 1002030036=소비 포인트 변경 기록이 존재하지 않습니다
 1002030037=소비 포인트 전송 기록이 존재하지 않습니다
 1002030038=사용자 충전 소비 포인트 주문이 존재하지 않습니다
+1002030039=用户已经存在关系网
+1002030040=您的积分余额不足
+1002030041=您的用户身份还不是代理商,暂不能能转换绿积分!
 1001000001=파라미터 구성이 존재하지 않습니다
 1001000002=파라미터 구성 키가 중복됩니다
 1001000003=시스템 내장 파라미터 구성을 삭제할 수 없습니다
@@ -183,6 +186,7 @@
 1002029003=업체 신청이 존재하지 않습니다
 1002029004=업체 신청 기록이 존재하지 않습니다
 1002029005=사용자는 대리상이 아니다
+1002029006=联络人账户已存在
 1011000010=거래 주문 항목이 존재하지 않습니다
 1011000011=거래 주문이 존재하지 않습니다
 1011000012=거래 주문서의 사후 상태 업데이트에 실패했습니다. 다시 시도하십시오
@@ -282,6 +286,9 @@
 1004012005=등록은 공유를 통해 완료해야 합니다
 1004012006=등록에 실패했습니다. 현재 페이지를 종료하고 다시 공유 QR 코드를 스캔하여 등록해주세요
 1004012007=탐색에 실패했습니다. 멤버 사용자가 시스템 사용자에 바인딩되지 않았습니다
+1004012008=用户还没有设置支付密码,请前往设置!
+1004012009=支付密码错误,请重新输入!!
+1004012010=原支付密码错误,请重新修改!!
 1006000000=WeChat 공식 계정이 존재하지 않습니다
 1006000001=공식 계정 QR 코드를 생성하지 못했습니다. 이유: {}
 1006000002=공식 계정 API 할당량을 지우지 못했습니다. 이유: {}

+ 0 - 28
feifan-framework/feifan-spring-boot-starter-job/src/main/java/cn/newfeifan/mall/framework/quartz/core/scheduler/SchedulerManager.java

@@ -1,7 +1,6 @@
 package cn.newfeifan.mall.framework.quartz.core.scheduler;
 
 import cn.newfeifan.mall.framework.quartz.core.enums.JobDataKeyEnum;
-import cn.newfeifan.mall.framework.quartz.core.handler.JobHandlerInvoker;
 import org.quartz.*;
 
 import static cn.newfeifan.mall.framework.common.exception.enums.GlobalErrorCodeConstants.NOT_IMPLEMENTED;
@@ -9,7 +8,6 @@ import static cn.newfeifan.mall.framework.common.exception.util.ServiceException
 
 /**
  * {@link org.quartz.Scheduler} 的管理器,负责创建任务
- *
  * 考虑到实现的简洁性,我们使用 jobHandlerName 作为唯一标识,即:
  * 1. Job 的 {@link JobDetail#getKey()}
  * 2. Trigger 的 {@link Trigger#getKey()}
@@ -26,32 +24,6 @@ public class SchedulerManager {
         this.scheduler = scheduler;
     }
 
-    /**
-     * 添加 Job 到 Quartz 中
-     *
-     * @param jobId 任务编号
-     * @param jobHandlerName 任务处理器的名字
-     * @param jobHandlerParam 任务处理器的参数
-     * @param cronExpression CRON 表达式
-     * @param retryCount 重试次数
-     * @param retryInterval 重试间隔
-     * @throws SchedulerException 添加异常
-     */
-    public void addJob(Long jobId, String jobHandlerName, String jobHandlerParam, String cronExpression,
-                       Integer retryCount, Integer retryInterval)
-            throws SchedulerException {
-        validateScheduler();
-        // 创建 JobDetail 对象
-        JobDetail jobDetail = JobBuilder.newJob(JobHandlerInvoker.class)
-                .usingJobData(JobDataKeyEnum.JOB_ID.name(), jobId)
-                .usingJobData(JobDataKeyEnum.JOB_HANDLER_NAME.name(), jobHandlerName)
-                .withIdentity(jobHandlerName).build();
-        // 创建 Trigger 对象
-        Trigger trigger = this.buildTrigger(jobHandlerName, jobHandlerParam, cronExpression, retryCount, retryInterval);
-        // 新增调度
-        scheduler.scheduleJob(jobDetail, trigger);
-    }
-
     /**
      * 更新 Job 到 Quartz
      *

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

@@ -40,5 +40,8 @@ public interface ErrorCodeConstants {
     ErrorCode CONSUMPTION_TRANSFER_LOG_NOT_EXISTS = new ErrorCode(1_002_030_037, "消费分转让记录不存在");
     ErrorCode USER_TOP_UP_CONSUMPTION_POINTS_ORDER_NOT_EXISTS = new ErrorCode(1_002_030_038, "用户充值消费分订单不存在");
 
+    ErrorCode USER_ALREADY_EXISTS = new ErrorCode(1_002_030_039, "用户已经存在关系网");
+    ErrorCode USER_INTEGRAL_LESS_TRANSITION_INTEGRAL = new ErrorCode(1_002_030_040, "您的积分余额不足!");
+    ErrorCode USER_IS_NOT_AGENT = new ErrorCode(1_002_030_041, "您的用户身份还不是代理商,暂不能能转换绿积分!");
 
 }

+ 13 - 6
feifan-module-distri/feifan-module-distri-api/src/main/java/cn/newfeifan/mall/module/distri/enums/ConsumptionEnum.java → feifan-module-distri/feifan-module-distri-api/src/main/java/cn/newfeifan/mall/module/distri/enums/IntegralEnum.java

@@ -5,25 +5,32 @@ import lombok.Getter;
 
 @Getter
 @AllArgsConstructor
-public enum ConsumptionEnum {
+public enum IntegralEnum {
 
     PT_TOP_TUP(1,"平台充值"),
-    COMMISSION_TRANSITION(2,"佣金转化为消费分"),
-    CONSUMPTION_TRANSFER(3,"消费分转出"),
-    CONSUMPTION_RECIPIENT(4,"消费分转入"),
-    COMMISSION_WITHDRAWAL(5,"佣金提现"),
+    RED_INTEGRAL_TRANSITION_GREEN_INTEGRAL(2,"红积分转换成绿积分"),
+    YELLOW_INTEGRAL_TRANSITION_RED_INTEGRAL(3,"黄积分转换成红积分"),
+    INTEGRAL_TRANSFER(4,"积分转出"),
+    INTEGRAL_RECIPIENT(5,"积分转入"),
+    COMMISSION_WITHDRAWAL(5,"积分提现"),
     PAY_ORDER(6,"购物支付"),
     REFUND_ORDER(7,"退回退款返回"),
     TOP_UP_GET(8,"充值获得"),
     CANCEL_ORDER_BACK_CONSUMPTION_POINTS(9,"手动取消订单退回消费分"),
     ORDER_CANCEL_BY_SYSTEM_REFUND_INTEGRAL(10,"支付超时退回消费分"),
+    RECOMMENDED_PERSON_QUOTA(11, "直推奖获得"),           //直推奖获得可用积分
+    ORDER_CANCEL_BY_USER_REFUND_INTEGRAL(12,"手动取消支付返回"),
+    BUY_ORDER(13,"用户下单"),
+    ORDER_SETTLEMENT(14,"订单收货,价格结算"),
+    TEAM_BONUS(15,"团队奖"),
+    LUCKY_BONUS(16,"幸运奖"),
     ;
 
     private final Integer type;
     private final String name;
 
     public static String getName(Integer type){
-        for (ConsumptionEnum value : ConsumptionEnum.values()) {
+        for (IntegralEnum value : IntegralEnum.values()) {
             if(value.getType().equals(type)){
                 return value.getName();
             }

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

@@ -0,0 +1,15 @@
+package cn.newfeifan.mall.module.distri.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum IntegralTypeEnum {
+    RED_INTEGRAL(1, "红色积分"),
+    YELLOW_INTEGRAL(2, "黄色积分"),
+    GREEN_INTEGRAL(3, "绿色积分");
+
+    private final Integer type;
+    private final String name;
+}

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

@@ -0,0 +1,18 @@
+package cn.newfeifan.mall.module.distri.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum ProfitTypeEnum {
+
+    PT_PROFIT(1, "平台收益"),
+    SERVICE_CHARGE(2, "服务费"),
+    PROFIT(3, "利润"),
+    SETTLEMENT_PRICE(4,"结算价");
+
+    private final Integer type;
+    private final String name;
+
+}

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

@@ -51,5 +51,7 @@ public class DuserInfoVO {
     @Schema(description = "安卓app注册id")
     private String androidRegisterId;
 
+    @Schema(description = "用户身份")
+    private Long categoryId;
 
 }

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

@@ -18,7 +18,7 @@ public class DuserPageReqVO extends PageParam {
     private Long userId;
 
     @Schema(description = "团队人员姓名", example = "李四")
-    private String name;
+    private String userName;
 
     @Schema(description = "团队人员手机号码")
     private String mobile;

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

@@ -21,7 +21,7 @@ public class DuserSaveReqVO {
 
     @Schema(description = "团队人员姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
     @NotEmpty(message = "团队人员姓名不能为空")
-    private String name;
+    private String userName;
 
     @Schema(description = "团队人员手机号码", requiredMode = Schema.RequiredMode.REQUIRED)
     @NotEmpty(message = "团队人员手机号码不能为空")
@@ -44,9 +44,6 @@ public class DuserSaveReqVO {
     @NotNull(message = "用户类型不能为空")
     private Long categoryId;
 
-    @Schema(description = "用户名称", example = "张三")
-    private String nickName;
-
     @Schema(description = "身价距下一级所需点数")
     private Long socialUpNeed;
 }

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

@@ -1,7 +1,6 @@
 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;
@@ -15,17 +14,23 @@ import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR
 @ToString(callSuper = true)
 public class PtProfitPageReqVO extends PageParam {
 
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
     @Schema(description = "平台服务费(毛利下的百分比收益)")
-    private Integer ptAdd;
+    private Long ptAdd;
 
     @Schema(description = "平台收益(0.3888 之外的收益)")
-    private Integer ptGrossAdd;
+    private Long ptGrossAdd;
 
     @Schema(description = "平台总收益")
-    private Integer ptTotalAdd;
+    private Long ptTotalAdd;
 
-    @Schema(description = "创建时间")
-    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
-    private LocalDateTime[] createTime;
+    @Schema(description = "利润")
+    private Long profit;
+
+    @Schema(description = "未结算金额", example = "8147")
+    private Long settlementPrice;
 
 }

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

@@ -2,8 +2,7 @@ package cn.newfeifan.mall.module.distri.controller.admin.ptprofit.vo;
 
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
-
-
+import javax.validation.constraints.*;
 @Schema(description = "管理后台 - 平台利润新增/修改 Request VO")
 @Data
 @Builder
@@ -14,18 +13,23 @@ public class PtProfitSaveReqVO {
     @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "24754")
     private Long id;
 
-    @Schema(description = "平台收益(0.3888 之外的收益)")
+    @Schema(description = "平台服务费(毛利下的百分比收益)", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "平台服务费(毛利下的百分比收益)不能为空")
     private Long ptAdd;
 
-    @Schema(description = "平台服务费(毛利下的百分比收益)")
+    @Schema(description = "平台收益(0.3888 之外的收益)", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "平台收益(0.3888 之外的收益)不能为空")
     private Long ptGrossAdd;
 
-    @Schema(description = "平台总收益")
+    @Schema(description = "平台总收益", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "平台总收益不能为空")
     private Long ptTotalAdd;
 
     @Schema(description = "利润", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "利润不能为空")
     private Long profit;
 
-    @Schema(description = "游客收益", requiredMode = Schema.RequiredMode.REQUIRED)
-    private Long visitorEarnings;
+    @Schema(description = "未结算金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "8147")
+    @NotNull(message = "未结算金额不能为空")
+    private Long settlementPrice;
 }

+ 0 - 66
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/applicationforwithdrawal/AppApplicationForWithdrawalController.java

@@ -1,66 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.app.applicationforwithdrawal;
-
-import org.springframework.web.bind.annotation.*;
-import javax.annotation.Resource;
-import org.springframework.validation.annotation.Validated;
-
-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.*;
-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.module.distri.controller.app.applicationforwithdrawal.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.applicationforwithdrawal.ApplicationForWithdrawalDO;
-import cn.newfeifan.mall.module.distri.service.applicationforwithdrawal.ApplicationForWithdrawalService;
-
-@Tag(name = "用户 APP - 提现申请记录")
-@RestController
-@RequestMapping("/distri/application-for-withdrawal")
-@Validated
-public class AppApplicationForWithdrawalController {
-
-    @Resource
-    private ApplicationForWithdrawalService applicationForWithdrawalService;
-
-    @PostMapping("/create")
-    @Operation(summary = "创建提现申请记录")
-    public CommonResult<Long> createApplicationForWithdrawal(@Valid @RequestBody AppApplicationForWithdrawalSaveReqVO createReqVO) {
-        return success(applicationForWithdrawalService.createApplicationForWithdrawal(createReqVO));
-    }
-
-    @PutMapping("/update")
-    @Operation(summary = "更新提现申请记录")
-    public CommonResult<Boolean> updateApplicationForWithdrawal(@Valid @RequestBody AppApplicationForWithdrawalSaveReqVO updateReqVO) {
-        applicationForWithdrawalService.updateApplicationForWithdrawal(updateReqVO);
-        return success(true);
-    }
-
-    @DeleteMapping("/delete")
-    @Operation(summary = "删除提现申请记录")
-    @Parameter(name = "id", description = "编号", required = true)
-    public CommonResult<Boolean> deleteApplicationForWithdrawal(@RequestParam("id") Long id) {
-        applicationForWithdrawalService.deleteApplicationForWithdrawal(id);
-        return success(true);
-    }
-
-    @GetMapping("/get")
-    @Operation(summary = "获得提现申请记录")
-    @Parameter(name = "id", description = "编号", required = true, example = "1024")
-    public CommonResult<AppApplicationForWithdrawalRespVO> getApplicationForWithdrawal(@RequestParam("id") Long id) {
-        ApplicationForWithdrawalDO applicationForWithdrawal = applicationForWithdrawalService.getApplicationForWithdrawal(id);
-        return success(BeanUtils.toBean(applicationForWithdrawal, AppApplicationForWithdrawalRespVO.class));
-    }
-
-    @GetMapping("/page")
-    @Operation(summary = "获得提现申请记录分页")
-    public CommonResult<PageResult<AppApplicationForWithdrawalRespVO>> getApplicationForWithdrawalPage(@Valid AppApplicationForWithdrawalPageReqVO pageReqVO) {
-        PageResult<ApplicationForWithdrawalDO> pageResult = applicationForWithdrawalService.getApplicationForWithdrawalPage(pageReqVO);
-        return success(BeanUtils.toBean(pageResult, AppApplicationForWithdrawalRespVO.class));
-    }
-
-}

+ 0 - 48
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/applicationforwithdrawal/vo/AppApplicationForWithdrawalPageReqVO.java

@@ -1,48 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.app.applicationforwithdrawal.vo;
-
-import lombok.*;
-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 = "用户 APP - 提现申请记录分页 Request VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class AppApplicationForWithdrawalPageReqVO extends PageParam {
-
-    @Schema(description = "用户ID", example = "25631")
-    private Long userId;
-
-    @Schema(description = "提现渠道类型", example = "2")
-    private Integer withdrawalType;
-
-    @Schema(description = "提现金额,单位:元")
-    private Long amount;
-
-    @Schema(description = "支付宝账号", example = "30303")
-    private String withdrawalAccount;
-
-    @Schema(description = "提现状态,成功是1, 失败是2, 提现中为0", example = "1")
-    private Integer status;
-
-    @Schema(description = "提现渠道记录id", example = "19322")
-    private Long applicationForWithdrawalChannelId;
-
-    @Schema(description = "创建时间")
-    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
-    private LocalDateTime[] createTime;
-
-    @Schema(description = "提现总金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED)
-    private Long amountTotal;
-
-    @Schema(description = "提现消费分,单位:分", requiredMode = Schema.RequiredMode.REQUIRED)
-    private Long withdrawConsumption;
-
-    @Schema(description = "计算百分比模板")
-    private String percentTemplate;
-
-}

+ 0 - 56
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/applicationforwithdrawal/vo/AppApplicationForWithdrawalRespVO.java

@@ -1,56 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.app.applicationforwithdrawal.vo;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import java.time.LocalDateTime;
-import com.alibaba.excel.annotation.*;
-
-@Schema(description = "用户 APP - 提现申请记录 Response VO")
-@Data
-@ExcelIgnoreUnannotated
-public class AppApplicationForWithdrawalRespVO {
-
-    @Schema(description = "申请id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20678")
-    @ExcelProperty("申请id")
-    private Long id;
-
-    @Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25631")
-    @ExcelProperty("用户ID")
-    private Long userId;
-
-    @Schema(description = "提现渠道类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
-    @ExcelProperty("提现渠道类型")
-    private Integer withdrawalType;
-
-    @Schema(description = "提现金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("提现金额,单位:元")
-    private Long amount;
-
-    @Schema(description = "支付宝账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "30303")
-    @ExcelProperty("支付宝账号")
-    private String withdrawalAccount;
-
-    @Schema(description = "提现状态,成功是1, 失败是2, 提现中为0", example = "1")
-    @ExcelProperty("提现状态,成功是1, 失败是2, 提现中为0")
-    private Integer status;
-
-    @Schema(description = "提现渠道记录id", requiredMode = Schema.RequiredMode.REQUIRED, example = "19322")
-    @ExcelProperty("提现渠道记录id")
-    private Long applicationForWithdrawalChannelId;
-
-    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("创建时间")
-    private LocalDateTime createTime;
-
-    @Schema(description = "提现总金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("提现总金额,单位:分")
-    private Long amountTotal;
-
-    @Schema(description = "提现消费分,单位:分", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("提现消费分,单位:分")
-    private Long withdrawConsumption;
-
-    @Schema(description = "计算百分比模板")
-    @ExcelProperty("计算百分比模板")
-    private String percentTemplate;
-}

+ 0 - 42
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/applicationforwithdrawal/vo/AppApplicationForWithdrawalSaveReqVO.java

@@ -1,42 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.app.applicationforwithdrawal.vo;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import javax.validation.constraints.*;
-
-@Schema(description = "用户 APP - 提现申请记录新增/修改 Request VO")
-@Data
-public class AppApplicationForWithdrawalSaveReqVO {
-
-    @Schema(description = "申请id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20678")
-    private Long id;
-
-    @Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25631")
-    private Long userId;
-
-    @Schema(description = "提现渠道类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
-    @NotNull(message = "提现渠道类型不能为空")
-    private Integer withdrawalType;
-
-    @Schema(description = "提现金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED)
-    private Long amount;
-
-    @Schema(description = "支付宝账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "30303")
-    private String withdrawalAccount;
-
-    @Schema(description = "提现状态,成功是1, 失败是2, 提现中为0", example = "1")
-    private Integer status;
-
-    @Schema(description = "提现渠道记录id", requiredMode = Schema.RequiredMode.REQUIRED, example = "19322")
-    private Long applicationForWithdrawalChannelId;
-
-    @Schema(description = "提现总金额,单位:分")
-    @NotNull(message = "提现金额,不能为空")
-    private Long amountTotal;
-
-    @Schema(description = "提现消费分,单位:分")
-    private Long withdrawConsumption;
-
-    @Schema(description = "计算百分比模板")
-    private String percentTemplate;
-}

+ 0 - 88
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/applicationforwithdrawalchannel/AppApplicationForWithdrawalChannelController.java

@@ -1,88 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.app.applicationforwithdrawalchannel;
-
-import org.springframework.web.bind.annotation.*;
-import javax.annotation.Resource;
-import org.springframework.validation.annotation.Validated;
-
-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.*;
-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.app.applicationforwithdrawalchannel.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.applicationforwithdrawalchannel.ApplicationForWithdrawalChannelDO;
-import cn.newfeifan.mall.module.distri.service.applicationforwithdrawalchannel.ApplicationForWithdrawalChannelService;
-
-@Tag(name = "用户 APP - 提现渠道记录")
-@RestController
-@RequestMapping("/distri/application-for-withdrawal-channel")
-@Validated
-public class AppApplicationForWithdrawalChannelController {
-
-    @Resource
-    private ApplicationForWithdrawalChannelService applicationForWithdrawalChannelService;
-
-    @PostMapping("/create")
-    @Operation(summary = "创建提现渠道记录")
-    public CommonResult<Long> createApplicationForWithdrawalChannel(@Valid @RequestBody AppApplicationForWithdrawalChannelSaveReqVO createReqVO) {
-        return success(applicationForWithdrawalChannelService.createApplicationForWithdrawalChannel(createReqVO));
-    }
-
-    @PutMapping("/update")
-    @Operation(summary = "更新提现渠道记录")
-    public CommonResult<Boolean> updateApplicationForWithdrawalChannel(@Valid @RequestBody AppApplicationForWithdrawalChannelSaveReqVO updateReqVO) {
-        applicationForWithdrawalChannelService.updateApplicationForWithdrawalChannel(updateReqVO);
-        return success(true);
-    }
-
-    @DeleteMapping("/delete")
-    @Operation(summary = "删除提现渠道记录")
-    @Parameter(name = "id", description = "编号", required = true)
-    public CommonResult<Boolean> deleteApplicationForWithdrawalChannel(@RequestParam("id") Long id) {
-        applicationForWithdrawalChannelService.deleteApplicationForWithdrawalChannel(id);
-        return success(true);
-    }
-
-    @GetMapping("/get")
-    @Operation(summary = "获得提现渠道记录")
-    @Parameter(name = "id", description = "编号", required = true, example = "1024")
-    public CommonResult<AppApplicationForWithdrawalChannelRespVO> getApplicationForWithdrawalChannel(@RequestParam("id") Long id) {
-        ApplicationForWithdrawalChannelDO applicationForWithdrawalChannel = applicationForWithdrawalChannelService.getApplicationForWithdrawalChannel(id);
-        return success(BeanUtils.toBean(applicationForWithdrawalChannel, AppApplicationForWithdrawalChannelRespVO.class));
-    }
-
-    @GetMapping("/page")
-    @Operation(summary = "获得提现渠道记录分页")
-    public CommonResult<PageResult<AppApplicationForWithdrawalChannelRespVO>> getApplicationForWithdrawalChannelPage(@Valid AppApplicationForWithdrawalChannelPageReqVO pageReqVO) {
-        PageResult<ApplicationForWithdrawalChannelDO> pageResult = applicationForWithdrawalChannelService.getApplicationForWithdrawalChannelPage(pageReqVO);
-        return success(BeanUtils.toBean(pageResult, AppApplicationForWithdrawalChannelRespVO.class));
-    }
-
-    @GetMapping("/export-excel")
-    @Operation(summary = "导出提现渠道记录 Excel")
-    @OperateLog(type = EXPORT)
-    public void exportApplicationForWithdrawalChannelExcel(@Valid AppApplicationForWithdrawalChannelPageReqVO pageReqVO,
-              HttpServletResponse response) throws IOException {
-        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
-        List<ApplicationForWithdrawalChannelDO> list = applicationForWithdrawalChannelService.getApplicationForWithdrawalChannelPage(pageReqVO).getList();
-        // 导出 Excel
-        ExcelUtils.write(response, "提现渠道记录.xls", "数据", AppApplicationForWithdrawalChannelRespVO.class,
-                        BeanUtils.toBean(list, AppApplicationForWithdrawalChannelRespVO.class));
-    }
-
-}

+ 0 - 48
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/applicationforwithdrawalchannel/vo/AppApplicationForWithdrawalChannelPageReqVO.java

@@ -1,48 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.app.applicationforwithdrawalchannel.vo;
-
-import lombok.*;
-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 = "用户 APP - 提现渠道记录分页 Request VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class AppApplicationForWithdrawalChannelPageReqVO extends PageParam {
-
-    @Schema(description = "提现渠道类型", example = "1")
-    private Integer withdrawalType;
-
-    @Schema(description = "提现渠道名称", example = "李四")
-    private String withdrawalName;
-
-    @Schema(description = "提现金额,单位:元")
-    private Long amount;
-
-    @Schema(description = "提现笔数", example = "6693")
-    private Integer count;
-
-    @Schema(description = "提现状态,已完成是1,未完成为0", example = "1")
-    private Boolean status;
-
-    @Schema(description = "提现渠道记录id", example = "14600")
-    private Long ptDailyWithdrawalId;
-
-    @Schema(description = "创建时间")
-    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
-    private LocalDateTime[] createTime;
-
-    @Schema(description = "导出状态,已导出是1,未导出为0", example = "2")
-    private Boolean excelStatus;
-
-    @Schema(description = "提现总金额,单位:分")
-    private Long amountTotal;
-
-    @Schema(description = "提现消费分,单位:分")
-    private Long withdrawConsumption;
-
-}

+ 0 - 56
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/applicationforwithdrawalchannel/vo/AppApplicationForWithdrawalChannelRespVO.java

@@ -1,56 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.app.applicationforwithdrawalchannel.vo;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import java.time.LocalDateTime;
-import com.alibaba.excel.annotation.*;
-
-@Schema(description = "用户 APP - 提现渠道记录 Response VO")
-@Data
-@ExcelIgnoreUnannotated
-public class AppApplicationForWithdrawalChannelRespVO {
-
-    @Schema(description = "提现渠道id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1595")
-    @ExcelProperty("提现渠道id")
-    private Long id;
-
-    @Schema(description = "提现渠道类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
-    @ExcelProperty("提现渠道类型")
-    private Integer withdrawalType;
-
-    @Schema(description = "提现渠道名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
-    @ExcelProperty("提现渠道名称")
-    private String withdrawalName;
-
-    @Schema(description = "提现金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("提现金额,单位:元")
-    private Long amount;
-
-    @Schema(description = "提现笔数", requiredMode = Schema.RequiredMode.REQUIRED, example = "6693")
-    @ExcelProperty("提现笔数")
-    private Integer count;
-
-    @Schema(description = "提现状态,已完成是1,未完成为0", example = "1")
-    @ExcelProperty("提现状态,已完成是1,未完成为0")
-    private Boolean status;
-
-    @Schema(description = "提现渠道记录id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14600")
-    @ExcelProperty("提现渠道记录id")
-    private Long ptDailyWithdrawalId;
-
-    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("创建时间")
-    private LocalDateTime createTime;
-
-    @Schema(description = "导出状态,已导出是1,未导出为0", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
-    @ExcelProperty("导出状态,已导出是1,未导出为0")
-    private Boolean excelStatus;
-
-    @Schema(description = "提现总金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("提现总金额,单位:分")
-    private Long amountTotal;
-
-    @Schema(description = "提现消费分,单位:分", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("提现消费分,单位:分")
-    private Long withdrawConsumption;
-}

+ 0 - 46
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/applicationforwithdrawalchannel/vo/AppApplicationForWithdrawalChannelSaveReqVO.java

@@ -1,46 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.app.applicationforwithdrawalchannel.vo;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import javax.validation.constraints.*;
-
-@Schema(description = "用户 APP - 提现渠道记录新增/修改 Request VO")
-@Data
-public class AppApplicationForWithdrawalChannelSaveReqVO {
-
-    @Schema(description = "提现渠道id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1595")
-    private Long id;
-
-    @Schema(description = "提现渠道类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
-    @NotNull(message = "提现渠道类型不能为空")
-    private Integer withdrawalType;
-
-    @Schema(description = "提现渠道名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
-    @NotEmpty(message = "提现渠道名称不能为空")
-    private String withdrawalName;
-
-    @Schema(description = "提现金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED)
-    private Long amount;
-
-    @Schema(description = "提现笔数", requiredMode = Schema.RequiredMode.REQUIRED, example = "6693")
-    @NotNull(message = "提现笔数不能为空")
-    private Integer count;
-
-    @Schema(description = "提现状态,已完成是1,未完成为0", example = "1")
-    private Boolean status;
-
-    @Schema(description = "提现渠道记录id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14600")
-    @NotNull(message = "提现渠道记录id不能为空")
-    private Long ptDailyWithdrawalId;
-
-    @Schema(description = "导出状态,已导出是1,未导出为0", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
-    @NotNull(message = "导出状态,已导出是1,未导出为0不能为空")
-    private Boolean excelStatus;
-
-    @Schema(description = "提现总金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED)
-    @NotNull(message = "提现总金额,单位:分不能为空")
-    private Long amountTotal;
-
-    @Schema(description = "提现消费分,单位:分", requiredMode = Schema.RequiredMode.REQUIRED)
-    private Long withdrawConsumption;
-}

+ 0 - 34
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/consumptionchangelog/ConsumptionChangeLogController.java

@@ -1,34 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.app.consumptionchangelog;
-
-import cn.newfeifan.mall.module.distri.controller.app.consumptionchangelog.vo.ConsumptionChangeLogPageReqVO;
-import cn.newfeifan.mall.module.distri.controller.app.consumptionchangelog.vo.ConsumptionChangeLogRespVO;
-import org.springframework.web.bind.annotation.*;
-import javax.annotation.Resource;
-import org.springframework.validation.annotation.Validated;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import io.swagger.v3.oas.annotations.Operation;
-
-import javax.validation.*;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-import cn.newfeifan.mall.framework.common.pojo.CommonResult;
-import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
-
-import cn.newfeifan.mall.module.distri.service.consumptionchangelog.ConsumptionChangeLogService;
-
-@Tag(name = "管理后台 - 平台消费分变动记录")
-@RestController
-@RequestMapping("/distri/consumption-change-log")
-@Validated
-public class ConsumptionChangeLogController {
-
-    @Resource
-    private ConsumptionChangeLogService consumptionChangeLogService;
-
-    @GetMapping("/page")
-    @Operation(summary = "获得消费分变动记录分页")
-    public CommonResult<PageResult<ConsumptionChangeLogRespVO>> getConsumptionChangeLogPage(@Valid ConsumptionChangeLogPageReqVO pageReqVO) {
-        PageResult<ConsumptionChangeLogRespVO> pageResult = consumptionChangeLogService.getConsumptionChangeLogPage(pageReqVO);
-        return success(pageResult);
-    }
-
-}

+ 0 - 39
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/consumptionchangelog/vo/ConsumptionChangeLogPageReqVO.java

@@ -1,39 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.app.consumptionchangelog.vo;
-
-import lombok.*;
-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 ConsumptionChangeLogPageReqVO extends PageParam {
-
-    @Schema(description = "用户ID", example = "10871")
-    private Long userId;
-
-    @Schema(description = "变动的消费分")
-    private Long consumptionPoints;
-
-    @Schema(description = "变动后消费分")
-    private Long afterConsumptionPoints;
-
-    @Schema(description = "消费分变动类型", example = "2")
-    private Integer consumptionStatus;
-
-    @Schema(description = "创建时间")
-    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
-    private LocalDateTime[] createTime;
-
-    @Schema(description = "实际消费分")
-    private Long practicalConsumptionPoints;
-
-    @Schema(description = "消费分产生对象", example = "23323")
-    private Long generateUserId;
-
-}

+ 0 - 50
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/consumptionchangelog/vo/ConsumptionChangeLogRespVO.java

@@ -1,50 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.app.consumptionchangelog.vo;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import java.time.LocalDateTime;
-import com.alibaba.excel.annotation.*;
-
-@Schema(description = "管理后台 - 平台消费分变动记录 Response VO")
-@Data
-@ExcelIgnoreUnannotated
-public class ConsumptionChangeLogRespVO {
-
-    @Schema(description = "日志编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "7160")
-    @ExcelProperty("日志编号")
-    private Long id;
-
-    @Schema(description = "用户ID", example = "10871")
-    @ExcelProperty("用户ID")
-    private Long userId;
-
-    @Schema(description = "变动的消费分", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("变动的消费分")
-    private Long consumptionPoints;
-
-    @Schema(description = "变动后消费分", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("变动后消费分")
-    private Long afterConsumptionPoints;
-
-    @Schema(description = "消费分变动类型", example = "2")
-    @ExcelProperty("消费分变动类型")
-    private Integer consumptionStatus;
-
-    @Schema(description = "类型名称")
-    private String consumptionStatusName;
-
-    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("创建时间")
-    private LocalDateTime createTime;
-
-    @Schema(description = "实际消费分")
-    @ExcelProperty("实际消费分")
-    private Long practicalConsumptionPoints;
-
-    @Schema(description = "消费分产生对象", example = "23323")
-    private Long generateUserId;
-
-    private String generateUserName;
-
-
-}

+ 0 - 40
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/consumptionchangelog/vo/ConsumptionChangeLogSaveReqVO.java

@@ -1,40 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.app.consumptionchangelog.vo;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import javax.validation.constraints.*;
-
-@Schema(description = "管理后台 - 平台消费分变动记录新增/修改 Request VO")
-@Data
-@Builder
-public class ConsumptionChangeLogSaveReqVO {
-
-    @Schema(description = "日志编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "7160")
-    private Long id;
-
-    @Schema(description = "用户ID", example = "10871")
-    private Long userId;
-
-    @Schema(description = "变动的消费分", requiredMode = Schema.RequiredMode.REQUIRED)
-    @NotNull(message = "变动的消费分不能为空")
-    private Long consumptionPoints;
-
-    @Schema(description = "变动后消费分", requiredMode = Schema.RequiredMode.REQUIRED)
-    @NotNull(message = "变动后消费分不能为空")
-    private Long afterConsumptionPoints;
-
-    @Schema(description = "消费分变动类型", example = "2")
-    private Integer consumptionStatus;
-
-    @Schema(description = "实际消费分")
-    private Long practicalConsumptionPoints;
-
-    @Schema(description = "消费分产生对象", example = "23323")
-    private Long generateUserId;
-
-    @Schema(description = "订单Id", example = "18715")
-    private Long orderId;
-
-    @Schema(description = "订单编号")
-    private String orderNo;
-}

+ 0 - 42
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/consumptiontransferlog/ConsumptionTransferLogController.java

@@ -1,42 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.app.consumptiontransferlog;
-
-import org.springframework.web.bind.annotation.*;
-import javax.annotation.Resource;
-import org.springframework.validation.annotation.Validated;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import io.swagger.v3.oas.annotations.Operation;
-
-import javax.validation.*;
-
-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.module.distri.controller.app.consumptiontransferlog.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.consumptiontransferlog.ConsumptionTransferLogDO;
-import cn.newfeifan.mall.module.distri.service.consumptiontransferlog.ConsumptionTransferLogService;
-
-@Tag(name = "管理后台 - 消费分转让记录")
-@RestController
-@RequestMapping("/distri/consumption-transfer-log")
-@Validated
-public class ConsumptionTransferLogController {
-
-    @Resource
-    private ConsumptionTransferLogService consumptionTransferLogService;
-
-    @PostMapping("/create")
-    @Operation(summary = "创建消费分转让记录")
-    public CommonResult<Long> createConsumptionTransferLog(@Valid @RequestBody ConsumptionTransferLogSaveReqVO createReqVO) {
-        return success(consumptionTransferLogService.createConsumptionTransferLog(createReqVO));
-    }
-
-    @GetMapping("/page")
-    @Operation(summary = "获得消费分转让记录分页")
-    public CommonResult<PageResult<ConsumptionTransferLogRespVO>> getConsumptionTransferLogPage(@Valid ConsumptionTransferLogPageReqVO pageReqVO) {
-        PageResult<ConsumptionTransferLogDO> pageResult = consumptionTransferLogService.getConsumptionTransferLogPage(pageReqVO);
-        return success(BeanUtils.toBean(pageResult, ConsumptionTransferLogRespVO.class));
-    }
-
-}

+ 4 - 4
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integral/IntegralController.java

@@ -1,6 +1,7 @@
 package cn.newfeifan.mall.module.distri.controller.app.integral;
 
 import cn.newfeifan.mall.framework.common.pojo.CommonResult;
+import cn.newfeifan.mall.module.distri.controller.app.integral.vo.IntegralTransitionRespVO;
 import cn.newfeifan.mall.module.distri.service.integral.IntegralService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -8,7 +9,6 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
-import javax.validation.constraints.NotNull;
 import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
 
 @Tag(name = "管理后台 - 推荐用户积分")
@@ -21,8 +21,8 @@ public class IntegralController {
     private IntegralService integralService;
 
     @PutMapping("/quotaTransition")
-    @Operation(summary = "佣金转化")
-    public CommonResult<Boolean> quotaTransition(@RequestParam(value = "quota") @NotNull(message = "输入的佣金不能为空") Long quota) {
-        return success(integralService.quotaTransition(quota));
+    @Operation(summary = "积分转化")
+    public CommonResult<Boolean> quotaTransition(@Validated @RequestBody IntegralTransitionRespVO respVO) {
+        return success(integralService.quotaTransition(respVO));
     }
 }

+ 12 - 9
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integral/vo/IntegralSaveReqVO.java

@@ -19,18 +19,18 @@ public class IntegralSaveReqVO {
     @Schema(description = "用户ID", example = "19778")
     private Long userId;
 
-    @Schema(description = "用户类型", example = "17348")
-    private Long categoryId;
-
-    @Schema(description = "用户名称", example = "赵六")
-    private String name;
-
     @Schema(description = "用户昵称", example = "赵六")
-    private String nickName;
+    private String userName;
 
-    @Schema(description = "当前积分", requiredMode = Schema.RequiredMode.REQUIRED)
+    @Schema(description = "当前红积分", requiredMode = Schema.RequiredMode.REQUIRED)
     @NotNull(message = "当前积分不能为空")
-    private Long currentQuota;
+    private Long redCurrentQuota;
+
+    @Schema(description = "当前黄积分", requiredMode = Schema.RequiredMode.REQUIRED)
+    private Long yellowCurrentQuota;
+
+    @Schema(description = "当前绿积分", requiredMode = Schema.RequiredMode.REQUIRED)
+    private Long greenCurrentQuota;
 
     @Schema(description = "冻结积分")
     private Long freezeQuota;
@@ -41,6 +41,9 @@ public class IntegralSaveReqVO {
     @Schema(description = "直推奖累计获取积分")
     private Long ancestorQuota;
 
+    @Schema(description = "幸运奖累计获取积分")
+    private Long luckyQuota;
+
     @Schema(description = "最高可获取积分", requiredMode = Schema.RequiredMode.REQUIRED)
     private Long highQuota;
 

+ 25 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integral/vo/IntegralTransitionRespVO.java

@@ -0,0 +1,25 @@
+package cn.newfeifan.mall.module.distri.controller.app.integral.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+
+import javax.validation.constraints.NotNull;
+
+@Schema(description = "管理后台 - 推荐用户积分新增/修改 Request VO")
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class IntegralTransitionRespVO {
+    @Schema(description = "当前积分", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "当前积分不能为空")
+    private Long quota;
+
+    @Schema(description = "积分类型", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "积分类型不能为空")
+    private Integer integralType;
+
+    @Schema(description = "支付密码", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "支付密码")
+    private String payPassword;
+}

+ 34 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integralchangelog/IntegralChangeLogController.java

@@ -0,0 +1,34 @@
+package cn.newfeifan.mall.module.distri.controller.app.integralchangelog;
+
+import cn.newfeifan.mall.module.distri.controller.app.integralchangelog.vo.IntegralChangeLogPageReqVO;
+import cn.newfeifan.mall.module.distri.controller.app.integralchangelog.vo.IntegralChangeLogRespVO;
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.*;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.CommonResult;
+import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
+
+import cn.newfeifan.mall.module.distri.service.integralchangelog.IntegralChangeLogService;
+
+@Tag(name = "管理后台 - 平台消费分变动记录")
+@RestController
+@RequestMapping("/distri/consumption-change-log")
+@Validated
+public class IntegralChangeLogController {
+
+    @Resource
+    private IntegralChangeLogService integralChangeLogService;
+
+    @GetMapping("/page")
+    @Operation(summary = "获得积分变动记录分页")
+    public CommonResult<PageResult<IntegralChangeLogRespVO>> getConsumptionChangeLogPage(@Valid IntegralChangeLogPageReqVO pageReqVO) {
+        PageResult<IntegralChangeLogRespVO> pageResult = integralChangeLogService.getConsumptionChangeLogPage(pageReqVO);
+        return success(pageResult);
+    }
+
+}

+ 64 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integralchangelog/vo/IntegralChangeLogPageReqVO.java

@@ -0,0 +1,64 @@
+package cn.newfeifan.mall.module.distri.controller.app.integralchangelog.vo;
+
+import lombok.*;
+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 IntegralChangeLogPageReqVO extends PageParam {
+
+    @Schema(description = "用户ID", example = "19315")
+    private Long userId;
+
+    @Schema(description = "积分类型", example = "1")
+    private Integer integralType;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+    @Schema(description = "订单Id", example = "11076")
+    private Long orderId;
+
+    @Schema(description = "订单编号")
+    private String orderNo;
+
+    @Schema(description = "变动的积分")
+    private Long integralPoints;
+
+    @Schema(description = "变动后积分")
+    private Long afterIntegralPoints;
+
+    @Schema(description = "实际积分")
+    private Long practicalIntegralPoints;
+
+    @Schema(description = "变动峰值")
+    private Long maxAvailablePointsAmount;
+
+    @Schema(description = "变动后峰值")
+    private Long afterMaxAvailablePointsAmount;
+
+    @Schema(description = "超出团队奖")
+    private Long accumulatedQuotaAmount;
+
+    @Schema(description = "超出直推奖")
+    private Long ancestorQuotaAmount;
+
+    @Schema(description = "超出幸运奖")
+    private Long luckyQuotaAmount;
+
+    @Schema(description = "积分变动类型", example = "2")
+    private Integer integralStatus;
+
+    @Schema(description = "积分产生对象", example = "4055")
+    private Long generateUserId;
+
+}

+ 82 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integralchangelog/vo/IntegralChangeLogRespVO.java

@@ -0,0 +1,82 @@
+package cn.newfeifan.mall.module.distri.controller.app.integralchangelog.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 平台积分变动记录 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class IntegralChangeLogRespVO {
+
+    @Schema(description = "日志编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "306")
+    @ExcelProperty("日志编号")
+    private Long id;
+
+    @Schema(description = "用户ID", example = "19315")
+    @ExcelProperty("用户ID")
+    private Long userId;
+
+    @Schema(description = "积分类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @ExcelProperty("积分类型")
+    private Integer integralType;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    @Schema(description = "订单Id", example = "11076")
+    @ExcelProperty("订单Id")
+    private Long orderId;
+
+    @Schema(description = "订单编号")
+    @ExcelProperty("订单编号")
+    private String orderNo;
+
+    @Schema(description = "变动的积分", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("变动的积分")
+    private Long integralPoints;
+
+    @Schema(description = "变动后积分", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("变动后积分")
+    private Long afterIntegralPoints;
+
+    @Schema(description = "实际积分")
+    @ExcelProperty("实际积分")
+    private Long practicalIntegralPoints;
+
+    @Schema(description = "变动峰值")
+    @ExcelProperty("变动峰值")
+    private Long maxAvailablePointsAmount;
+
+    @Schema(description = "变动后峰值")
+    @ExcelProperty("变动后峰值")
+    private Long afterMaxAvailablePointsAmount;
+
+    @Schema(description = "超出团队奖")
+    @ExcelProperty("超出团队奖")
+    private Long accumulatedQuotaAmount;
+
+    @Schema(description = "超出直推奖")
+    @ExcelProperty("超出直推奖")
+    private Long ancestorQuotaAmount;
+
+    @Schema(description = "超出幸运奖")
+    private Long luckyQuotaAmount;
+
+    @Schema(description = "积分变动类型", example = "2")
+    @ExcelProperty("积分变动类型")
+    private Integer integralStatus;
+
+    @Schema(description = "积分产生对象", example = "4055")
+    @ExcelProperty("积分产生对象")
+    private Long generateUserId;
+
+    private String generateUserName;
+
+    @Schema(description = "类型名称")
+    private String consumptionStatusName;
+
+
+}

+ 59 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integralchangelog/vo/IntegralChangeLogSaveReqVO.java

@@ -0,0 +1,59 @@
+package cn.newfeifan.mall.module.distri.controller.app.integralchangelog.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 平台积分变动记录新增/修改 Request VO")
+@Data
+@Builder
+public class IntegralChangeLogSaveReqVO {
+
+    @Schema(description = "日志编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "306")
+    private Long id;
+
+    @Schema(description = "用户ID", example = "19315")
+    private Long userId;
+
+    @Schema(description = "积分类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @NotNull(message = "积分类型不能为空")
+    private Integer integralType;
+
+    @Schema(description = "订单Id", example = "11076")
+    private Long orderId;
+
+    @Schema(description = "订单编号")
+    private String orderNo;
+
+    @Schema(description = "变动的积分", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "变动的积分不能为空")
+    private Long integralPoints;
+
+    @Schema(description = "变动后积分", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "变动后积分不能为空")
+    private Long afterIntegralPoints;
+
+    @Schema(description = "实际积分")
+    private Long practicalIntegralPoints;
+
+    @Schema(description = "变动峰值")
+    private Long maxAvailablePointsAmount;
+
+    @Schema(description = "变动后峰值")
+    private Long afterMaxAvailablePointsAmount;
+
+    @Schema(description = "超出团队奖")
+    private Long accumulatedQuotaAmount;
+
+    @Schema(description = "超出直推奖")
+    private Long ancestorQuotaAmount;
+
+    @Schema(description = "超出幸运奖")
+    private Long luckyQuotaAmount;
+
+    @Schema(description = "积分变动类型", example = "2")
+    private Integer integralStatus;
+
+    @Schema(description = "积分产生对象", example = "4055")
+    private Long generateUserId;
+}

+ 40 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integraltransferlog/IntegralTransferLogController.java

@@ -0,0 +1,40 @@
+package cn.newfeifan.mall.module.distri.controller.app.integraltransferlog;
+
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.*;
+
+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.module.distri.controller.app.integraltransferlog.vo.*;
+import cn.newfeifan.mall.module.distri.service.integraltransferlog.IntegralTransferLogService;
+
+@Tag(name = "管理后台 - 积分转让记录")
+@RestController
+@RequestMapping("/distri/consumption-transfer-log")
+@Validated
+public class IntegralTransferLogController {
+
+    @Resource
+    private IntegralTransferLogService consumptionTransferLogService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建积分转让记录")
+    public CommonResult<Long> createConsumptionTransferLog(@Valid @RequestBody IntegralTransferLogSaveReqVO createReqVO) {
+        return success(consumptionTransferLogService.createConsumptionTransferLog(createReqVO));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得积分转让记录分页")
+    public CommonResult<PageResult<IntegralTransferLogRespVO>> getConsumptionTransferLogPage(@Valid IntegralTransferLogPageReqVO pageReqVO) {
+        return success(BeanUtils.toBean(consumptionTransferLogService.getConsumptionTransferLogPage(pageReqVO), IntegralTransferLogRespVO.class));
+    }
+
+}

+ 5 - 2
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/consumptiontransferlog/vo/ConsumptionTransferLogPageReqVO.java → feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integraltransferlog/vo/IntegralTransferLogPageReqVO.java

@@ -1,4 +1,4 @@
-package cn.newfeifan.mall.module.distri.controller.app.consumptiontransferlog.vo;
+package cn.newfeifan.mall.module.distri.controller.app.integraltransferlog.vo;
 
 import lombok.*;
 import io.swagger.v3.oas.annotations.media.Schema;
@@ -12,7 +12,7 @@ import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR
 @Data
 @EqualsAndHashCode(callSuper = true)
 @ToString(callSuper = true)
-public class ConsumptionTransferLogPageReqVO extends PageParam {
+public class IntegralTransferLogPageReqVO extends PageParam {
 
     @Schema(description = "转让用户ID", example = "7655")
     private Long transferUserId;
@@ -42,4 +42,7 @@ public class ConsumptionTransferLogPageReqVO extends PageParam {
     @Schema(description = "变动后消费分(余额)")
     private Long afterRecipientConsumptionPoints;
 
+    @Schema(description = "积分类型", example = "2")
+    private Integer integralType;
+
 }

+ 6 - 2
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/consumptiontransferlog/vo/ConsumptionTransferLogRespVO.java → feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integraltransferlog/vo/IntegralTransferLogRespVO.java

@@ -1,4 +1,4 @@
-package cn.newfeifan.mall.module.distri.controller.app.consumptiontransferlog.vo;
+package cn.newfeifan.mall.module.distri.controller.app.integraltransferlog.vo;
 
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
@@ -8,7 +8,7 @@ import com.alibaba.excel.annotation.*;
 @Schema(description = "管理后台 - 消费分转让记录 Response VO")
 @Data
 @ExcelIgnoreUnannotated
-public class ConsumptionTransferLogRespVO {
+public class IntegralTransferLogRespVO {
 
     @Schema(description = "日志编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "5320")
     @ExcelProperty("日志编号")
@@ -50,4 +50,8 @@ public class ConsumptionTransferLogRespVO {
     @ExcelProperty("变动后消费分(余额)")
     private Long afterRecipientConsumptionPoints;
 
+    @Schema(description = "积分类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    @ExcelProperty("积分类型")
+    private Integer integralType;
+
 }

+ 7 - 5
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/consumptiontransferlog/vo/ConsumptionTransferLogSaveReqVO.java → feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/integraltransferlog/vo/IntegralTransferLogSaveReqVO.java

@@ -1,13 +1,12 @@
-package cn.newfeifan.mall.module.distri.controller.app.consumptiontransferlog.vo;
+package cn.newfeifan.mall.module.distri.controller.app.integraltransferlog.vo;
 
-import cn.newfeifan.mall.module.system.api.sms.dto.code.SmsCodeUseReqDTO;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
 import javax.validation.constraints.*;
 
 @Schema(description = "管理后台 - 消费分转让记录新增/修改 Request VO")
 @Data
-public class ConsumptionTransferLogSaveReqVO {
+public class IntegralTransferLogSaveReqVO {
 
     @Schema(description = "日志编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "5320")
     private Long id;
@@ -38,8 +37,11 @@ public class ConsumptionTransferLogSaveReqVO {
     @Schema(description = "变动后消费分(余额)", requiredMode = Schema.RequiredMode.REQUIRED)
     private Long afterRecipientConsumptionPoints;
 
-    @Schema(description = "短信验证码 DTO")
-    private SmsCodeUseReqDTO smsCodeUseReqDTO;
+    @Schema(description = "积分类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+    @NotNull(message = "积分类型不能为空")
+    private Integer integralType;
 
+    @Schema(description = "支付密码")
+    private String payPassword;
 
 }

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

@@ -1,59 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.app.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 = "购物订单:直推人身价提升", example = "1")
-    private String orderAncestorSocialStatus;
-
-    @Schema(description = "购物订单:本人身价提升", example = "2")
-    private String orderUserSocialStatus;
-
-    @Schema(description = "新用户注册:直推人身价提升", example = "2")
-    private String registerAncestorSocialStatus;
-
-    @Schema(description = "新用户注册:本人身价提升", example = "2")
-    private String registerSocialStatus;
-
-    @Schema(description = "是否启用 0关闭 1启动", example = "2")
-    private Integer status;
-
-    @Schema(description = "用户注册后,获得的基础最大合赢奖、直推奖积分限额")
-    private String baseMaxQuota;
-
-    @Schema(description = "收藏商品获取身价值,同一SPU商品收藏多次无效", example = "1")
-    private String collectSocialStatus;
-
-    @Schema(description = "提现佣金百分比")
-    private String withdrawCommission;
-
-    @Schema(description = "提现消费分百分比")
-    private String withdrawConsumption;
-
-
-}

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

@@ -14,23 +14,21 @@ import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR
 @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 = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
 
-    @Schema(description = "推广-合赢奖额度(浮动) 百分比")
-    private Integer grossProfitBonusQuotaPerc;
+    @Schema(description = "毛利 = 成本 * 0.38... (推广费用)")
+    private String grossProfitPerc;
 
     @Schema(description = "推广-平台分成额度(浮动) 百分比")
-    private Integer grossProfitPlatformQuotaPerc;
+    private String grossProfitPlatformQuotaPerc;
+
+    @Schema(description = "是否启用 0关闭 1启动", example = "1")
+    private Integer status;
 
-    @Schema(description = "分成百分比")
-    private Integer divideIntoPerc;
+    @Schema(description = "推广-推荐人额度 百比(上级推荐人订单提成百分比")
+    private String grossProfitAncestorQuotaPerc;
 
     @Schema(description = "购物订单:直推人身价提升", example = "1")
     private String orderAncestorSocialStatus;
@@ -44,28 +42,44 @@ public class OrderPercentagePageReqVO extends PageParam {
     @Schema(description = "新用户注册:本人身价提升", example = "2")
     private String registerSocialStatus;
 
-    @Schema(description = "创建时间")
-    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
-    private LocalDateTime[] createTime;
-    @Schema(description = "是否启用 0关闭 1启动", example = "2")
-    private Integer status;
-
     @Schema(description = "用户注册后,获得的基础最大合赢奖、直推奖积分限额")
     private String baseMaxQuota;
 
     @Schema(description = "收藏商品获取身价值,同一SPU商品收藏多次无效", example = "1")
     private String collectSocialStatus;
 
-    @Schema(description = "提现消费分百分比")
-    private String withdrawConsumption;
-
-    @Schema(description = "提现佣金百分比")
-    private String withdrawCommission;
+    @Schema(description = "用户签到可获取的最大身价值")
+    private String signInSocialStatusMax;
 
-    @Schema(description = "用户充值消费分的额度")
-    private String userTopUpConsumptionPoints;
+    @Schema(description = "签到获取身价", example = "1")
+    private String signInSocialStatus;
 
     @Schema(description = "触发倍率的最低金额")
     private String triggerMagnificationPoints;
 
+    @Schema(description = "推广-团队奖额度(浮动) 百分比")
+    private String grossProfitBonusQuotaPerc;
+
+    @Schema(description = "充值积分的倍率")
+    private String integralMagnification;
+
+    @Schema(description = "团队奖、幸运奖所得黄积分百分比")
+    private String bonusYellowIntegral;
+
+    @Schema(description = "团队奖、幸运奖所得绿积分百分比")
+    private String bonusGreenIntegral;
+
+    @Schema(description = "会员黄积分转换红积分倍率")
+    private String memberYellowTransitionRed;
+
+    @Schema(description = "会员红积分转换绿积分倍率")
+    private String memberRedTransitionGreen;
+
+    @Schema(description = "代理商黄积分转换红积分倍率")
+    private String agentYellowTransitionRed;
+
+    @Schema(description = "代理商红积分转换绿积分倍率")
+    private String agentRedTransitionGreen;
+
+
 }

+ 81 - 12
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/orderpercentage/vo/OrderPercentageRespVO.java

@@ -8,23 +8,92 @@ import com.alibaba.excel.annotation.*;
 @Data
 @ExcelIgnoreUnannotated
 public class OrderPercentageRespVO {
-    @Schema(description = "充值消费分的倍率")
-    @ExcelProperty("充值消费分的倍率")
-    private String consumptionMagnification;
+    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2203")
+    @ExcelProperty("用户编号")
+    private Long id;
 
-    @Schema(description = "提现消费分百分比")
-    @ExcelProperty("提现消费分百分比")
-    private String withdrawConsumption;
+    @Schema(description = "毛利 = 成本 * 0.38... (推广费用)")
+    @ExcelProperty("毛利 = 成本 * 0.38... (推广费用)")
+    private String grossProfitPerc;
 
-    @Schema(description = "提现佣金百分比")
-    @ExcelProperty("提现佣金百分比")
-    private String withdrawCommission;
+    @Schema(description = "推广-平台分成额度(浮动) 百分比")
+    @ExcelProperty("推广-平台分成额度(浮动) 百分比")
+    private String grossProfitPlatformQuotaPerc;
 
-    @Schema(description = "用户充值消费分的额度")
-    @ExcelProperty("用户充值消费分的额度")
-    private String userTopUpConsumptionPoints;
+    @Schema(description = "是否启用 0关闭 1启动", example = "1")
+    @ExcelProperty("是否启用 0关闭 1启动")
+    private Integer status;
+
+    @Schema(description = "推广-推荐人额度 百分比(上级推荐人订单提成百分比)")
+    @ExcelProperty("推广-推荐人额度 百分比(上级推荐人订单提成百分比)")
+    private String grossProfitAncestorQuotaPerc;
+
+    @Schema(description = "购物订单:直推人身价提升", example = "1")
+    @ExcelProperty("购物订单:直推人身价提升")
+    private String orderAncestorSocialStatus;
+
+    @Schema(description = "购物订单:本人身价提升", example = "2")
+    @ExcelProperty("购物订单:本人身价提升")
+    private String orderUserSocialStatus;
+
+    @Schema(description = "新用户注册:直推人身价提升", example = "2")
+    @ExcelProperty("新用户注册:直推人身价提升")
+    private String registerAncestorSocialStatus;
+
+    @Schema(description = "新用户注册:本人身价提升", example = "2")
+    @ExcelProperty("新用户注册:本人身价提升")
+    private String registerSocialStatus;
+
+    @Schema(description = "用户注册后,获得的基础最大合赢奖、直推奖积分限额")
+    @ExcelProperty("用户注册后,获得的基础最大合赢奖、直推奖积分限额")
+    private String baseMaxQuota;
+
+    @Schema(description = "收藏商品获取身价值,同一SPU商品收藏多次无效", example = "1")
+    @ExcelProperty("收藏商品获取身价值,同一SPU商品收藏多次无效")
+    private String collectSocialStatus;
+
+    @Schema(description = "用户签到可获取的最大身价值")
+    @ExcelProperty("用户签到可获取的最大身价值")
+    private String signInSocialStatusMax;
+
+    @Schema(description = "签到获取身价", example = "1")
+    @ExcelProperty("签到获取身价")
+    private String signInSocialStatus;
 
     @Schema(description = "触发倍率的最低金额")
     @ExcelProperty("触发倍率的最低金额")
     private String triggerMagnificationPoints;
+
+    @Schema(description = "推广-团队奖额度(浮动) 百分比")
+    @ExcelProperty("推广-团队奖额度(浮动) 百分比")
+    private String grossProfitBonusQuotaPerc;
+
+    @Schema(description = "充值积分的倍率")
+    @ExcelProperty("充值积分的倍率")
+    private String integralMagnification;
+
+    @Schema(description = "团队奖、幸运奖所得黄积分百分比")
+    @ExcelProperty("团队奖、幸运奖所得黄积分百分比")
+    private String bonusYellowIntegral;
+
+    @Schema(description = "团队奖、幸运奖所得绿积分百分比")
+    @ExcelProperty("团队奖、幸运奖所得绿积分百分比")
+    private String bonusGreenIntegral;
+
+    @Schema(description = "会员黄积分转换红积分倍率")
+    @ExcelProperty("会员黄积分转换红积分倍率")
+    private String memberYellowTransitionRed;
+
+    @Schema(description = "会员红积分转换绿积分倍率")
+    @ExcelProperty("会员红积分转换绿积分倍率")
+    private String memberRedTransitionGreen;
+
+    @Schema(description = "代理商黄积分转换红积分倍率")
+    @ExcelProperty("代理商黄积分转换红积分倍率")
+    private String agentYellowTransitionRed;
+
+    @Schema(description = "代理商红积分转换绿积分倍率")
+    @ExcelProperty("代理商红积分转换绿积分倍率")
+    private String agentRedTransitionGreen;
+
 }

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

@@ -44,14 +44,6 @@ public class PtProfitLogController {
         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)

+ 9 - 15
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/ptprofitlog/vo/PtProfitLogPageReqVO.java

@@ -21,33 +21,27 @@ public class PtProfitLogPageReqVO extends PageParam {
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
 
-    @Schema(description = "收益类型 1:平台服务器费 2:平台收益 3用户下单返回毛利额度 4直推人额度 5合赢奖", example = "2")
-    private Integer profitStatus;
-
-    @Schema(description = "用户ID , 只有收益类型为 3,4才有值", example = "6982")
-    private Long userId;
-
     @Schema(description = "订单Id", example = "26464")
     private Long orderId;
 
     @Schema(description = "订单编号")
     private String orderNo;
 
+    @Schema(description = "计算百分比模板")
+    private String percentTemplate;
+
     @Schema(description = "变动的当前可用积分值(可为负数)")
     private Long amount;
 
     @Schema(description = "变动后当前可用积分钱包的余额")
     private Long afterAmount;
 
-    @Schema(description = "变动的冻结积分值(可为负数)")
-    private Long freezeAmount;
-
-    @Schema(description = "变动后冻结积分钱包的余额")
-    private Long afterFreezeAmount;
+    @Schema(description = "收益来源 1:平台服务器费 2:平台收益 3用户下单返回毛利额度 4直推人额度 5合赢奖", example = "1")
+    private Integer profitStatus;
 
-    @Schema(description = "计算百分比模板")
-    private String percentTemplate;
+    @Schema(description = "收益类型")
+    private Integer profitType;
 
-    @Schema(description = "是否冻结  true-冻结  false-可用")
-    private Boolean isFreeze;
+    @Schema(description = "产生积分的用户ID,例如:下订单的用户ID", example = "31502")
+    private Long generateUserId;
 }

+ 11 - 38
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/ptprofitlog/vo/PtProfitLogRespVO.java

@@ -16,17 +16,9 @@ public class PtProfitLogRespVO {
     @ExcelProperty("创建时间")
     private LocalDateTime createTime;
 
-    @Schema(description = "收益类型 1:平台服务器费 2:平台收益 3用户下单返回毛利额度 4直推人额度 5合赢奖", example = "2")
-    @ExcelProperty("收益类型 1:平台服务器费 2:平台收益 3用户下单返回毛利额度 4直推人额度 5合赢奖")
-    private Integer profitStatus;
-
     @Schema(description = "收益类型名称")
     private String profitStatusName;
 
-    @Schema(description = "用户ID , 只有收益类型为 3,4才有值", example = "6982")
-    @ExcelProperty("用户ID , 只有收益类型为 3,4才有值")
-    private Long userId;
-
     @Schema(description = "订单Id", example = "26464")
     @ExcelProperty("订单Id")
     private Long orderId;
@@ -39,6 +31,10 @@ public class PtProfitLogRespVO {
     @ExcelProperty("编号")
     private Long id;
 
+    @Schema(description = "计算百分比模板")
+    @ExcelProperty("计算百分比模板")
+    private String percentTemplate;
+
     @Schema(description = "变动的当前可用积分值(可为负数)")
     @ExcelProperty("变动的当前可用积分值(可为负数)")
     private Long amount;
@@ -47,39 +43,16 @@ public class PtProfitLogRespVO {
     @ExcelProperty("变动后当前可用积分钱包的余额")
     private Long afterAmount;
 
-    @Schema(description = "变动的冻结积分值(可为负数)")
-    @ExcelProperty("变动的冻结积分值(可为负数)")
-    private Long freezeAmount;
-
-    @Schema(description = "变动后冻结积分钱包的余额")
-    @ExcelProperty("变动后冻结积分钱包的余额")
-    private Long afterFreezeAmount;
-
-    @Schema(description = "计算百分比模板")
-    @ExcelProperty("计算百分比模板")
-    private String percentTemplate;
-
-    @Schema(description = "最大可用积分变化值")
-    private Long maxAvailablePointsAmount;
-
-    @Schema(description = "最大可用积分额度")
-    private Long afterMaxAvailablePointsAmount;
-
-    @Schema(description = "合赢奖超出额度")
-    private Long accumulatedQuotaAmount;
-
-    @Schema(description = "直推奖超出额度")
-    private Long ancestorQuotaAmount;
-
-    @Schema(description = "显示这条记录是由谁产生的用户名")
-    private String username;
+    @Schema(description = "收益来源 1:平台服务器费 2:平台收益 3用户下单返回毛利额度 4直推人额度 5合赢奖", example = "1")
+    @ExcelProperty("收益类型 1:平台服务器费 2:平台收益 3用户下单返回毛利额度 4直推人额度 5合赢奖")
+    private Integer profitStatus;
 
     @Schema(description = "产生积分的用户ID,例如:下订单的用户ID", example = "31502")
+    @ExcelProperty("产生积分的用户ID,例如:下订单的用户ID")
     private Long generateUserId;
 
-    @Schema(description = "变动的冻结最大可用额度")
-    private Long freezeHighQuota;
+    @Schema(description = "收益类型")
+    private Integer profitType;
 
-    @Schema(description = "变动后的冻结最大可用额度")
-    private Long afterFreezeHighQuota;
+    private String username;
 }

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

@@ -13,19 +13,6 @@ import lombok.NoArgsConstructor;
 @NoArgsConstructor
 public class PtProfitLogSaveReqVO {
 
-    @Schema(description = "收益类型 1:平台服务器费 2:平台收益 3用户下单返回毛利额度 4直推人额度 5合赢奖", example = "2")
-    private Integer profitStatus;
-
-
-    /**
-     * 产生积分的用户ID,例如:下订单的用户ID
-     */
-    @Schema(description = "产生积分的用户ID", example = "6982")
-    private Long generateUserId;
-
-    @Schema(description = "积分变动的用户ID", example = "6982")
-    private Long userId;
-
     @Schema(description = "订单Id", example = "26464")
     private Long orderId;
 
@@ -35,37 +22,22 @@ public class PtProfitLogSaveReqVO {
     @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "5931")
     private Long id;
 
+    @Schema(description = "计算百分比模板")
+    private String percentTemplate;
+
     @Schema(description = "变动的当前可用积分值(可为负数)")
     private Long amount;
 
     @Schema(description = "变动后当前可用积分钱包的余额")
     private Long afterAmount;
 
-    @Schema(description = "变动的冻结积分值(可为负数)")
-    private Long freezeAmount;
-
-    @Schema(description = "变动后冻结积分钱包的余额")
-    private Long afterFreezeAmount;
-
-    @Schema(description = "合赢奖超出额度")
-    private Long accumulatedQuotaAmount;
-
-    @Schema(description = "直推奖超出额度")
-    private Long ancestorQuotaAmount;
-
-    @Schema(description = "最大可用积分变化值")
-    private Long maxAvailablePointsAmount;
-
-    @Schema(description = "最大可用积分额度")
-    private Long afterMaxAvailablePointsAmount;
-
-    @Schema(description = "计算百分比模板")
-    private String percentTemplate;
+    @Schema(description = "收益来源 1:平台服务器费 2:平台收益 3用户下单返回毛利额度 4直推人额度 5合赢奖", example = "1")
+    private Integer profitStatus;
 
-    @Schema(description = "变动的冻结最大可用额度")
-    private Long freezeHighQuota;
+    @Schema(description = "产生积分的用户ID,例如:下订单的用户ID", example = "31502")
+    private Long generateUserId;
 
-    @Schema(description = "变动后的冻结最大可用额度")
-    private Long afterFreezeHighQuota;
+    @Schema(description = "收益类型")
+    private Integer profitType;
 
 }

+ 8 - 6
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/sharepath/vo/AppSharePathRespVO.java

@@ -1,21 +1,23 @@
 package cn.newfeifan.mall.module.distri.controller.app.sharepath.vo;
 
+import cn.newfeifan.mall.module.member.controller.admin.user.vo.MemberUserRespVO;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Builder;
 import lombok.Data;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+import java.util.List;
 
 
 @Schema(description = "用户 APP - 分销用户关系 Response VO")
 @Data
 @Builder
 public class AppSharePathRespVO {
-    @Schema(description = "团队总数")
-    private Long teamCount;
-
     @Schema(description = "推荐人")
-    private SharePathRespVO ancestor;
+    private MemberUserRespVO referrerUser;
+
+    @Schema(description = "上级")
+    private MemberUserRespVO parentUser;
 
     @Schema(description = "团队成员")
-    private PageResult<SharePathRespVO> descendants;
+    private List<MemberUserRespVO> descendants;
 }

+ 14 - 21
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/sharepath/vo/SharePathPageReqVO.java

@@ -21,31 +21,24 @@ public class SharePathPageReqVO extends PageParam {
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
 
-    @Schema(description = "推荐人")
-    private Long ancestor;
+    @Schema(description = "用户id")
+    private Long userId;
 
-    @Schema(description = "直推人")
-    private Long descendant;
+    @Schema(description = "用户名")
+    private String userName;
 
-    @Schema(description = "顺序")
-    private Integer sort;
+    @Schema(description = "用户电话")
+    private String phone;
 
-    @Schema(description = "推荐人姓名", example = "王五")
-    private String ancName;
+    @Schema(description = "上级用户id")
+    private Long parentId;
 
-    @Schema(description = "推荐人手机号")
-    private String ancPhone;
+    @Schema(description = "左区用户id")
+    private Long leftChildId;
 
-    @Schema(description = "直推人姓名", example = "李四")
-    private String descName;
-
-    @Schema(description = "推荐人手机号")
-    private String descPhone;
-
-    @Schema(description = "推荐人昵称", example = "非繁人")
-    private String ancNickName;
-
-    @Schema(description = "直推人昵称", example = "张三")
-    private String descNickName;
+    @Schema(description = "右区用户id")
+    private Long rightChildId;
 
+    @Schema(description = "推荐人id")
+    private Long referrerId;
 }

+ 33 - 56
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/sharepath/vo/SharePathRespVO.java

@@ -10,73 +10,50 @@ import com.alibaba.excel.annotation.*;
 @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;
-
-    @Schema(description = "推荐人姓名", example = "王五")
-    @ExcelProperty("推荐人姓名")
-    private String ancName;
-
-    @Schema(description = "推荐人手机号")
-    @ExcelProperty("推荐人手机号")
-    private String ancPhone;
-
-    @Schema(description = "直推人姓名", example = "李四")
-    @ExcelProperty("直推人姓名")
-    private String descName;
-
-    @Schema(description = "推荐人手机号")
-    @ExcelProperty("推荐人手机号")
-    private String descPhone;
+    @Schema(description = "头像")
+    private String avatar;
 
-    @Schema(description = "推荐人昵称", example = "非繁人")
-    @ExcelProperty("推荐人昵称")
-    private String ancNickName;
+//    @Schema(description = "身价等级")
+//    private String socialStatusLevel;
+//
+//    @Schema(description = "身价等级名称")
+//    private String socialStatusLevelName;
+//
+//    @Schema(description = "后代人数")
+//    private Long descendantsCount;
+//
+//    @Schema(description = "最高可获取积分(峰值 / 最大值)")
+//    private Long high_quota;
+//
+////    @Schema(description = "剩余的合赢奖额度 + 待确权直推奖")
+//    @Schema(description = "分区额度")
+//    private Long residueSocial;
 
-    @Schema(description = "直推人昵称", example = "张三")
-    @ExcelProperty("直推人昵称")
-    private String descNickName;
+    @Schema(description = "用户名")
+    private String username;
 
-    @Schema(description = "头像")
-    private String avatar;
+    @Schema(description = "层级")
+    private Integer depth;
 
-    @Schema(description = "身价等级")
-    private String socialStatusLevel;
+    @Schema(description = "用户id")
+    private Long userId;
 
-    @Schema(description = "身价等级名称")
-    private String socialStatusLevelName;
+    @Schema(description = "用户电话")
+    private String phone;
 
-    @Schema(description = "后代人数")
-    private Long descendantsCount;
+    @Schema(description = "上级用户id")
+    private Long parentId;
 
-    @Schema(description = "最高可获取积分(峰值 / 最大值)")
-    private Long high_quota;
+    @Schema(description = "左区用户id")
+    private Long leftChildId;
 
-//    @Schema(description = "剩余的合赢奖额度 + 待确权直推奖")
-    @Schema(description = "分区额度")
-    private Long residueSocial;
+    @Schema(description = "右区用户id")
+    private Long rightChildId;
 
-    @Schema(description = "用户名")
-    private String username;
+    @Schema(description = "推荐人id")
+    private Long referrerId;
 }

+ 14 - 21
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/sharepath/vo/SharePathSaveReqVO.java

@@ -17,31 +17,24 @@ public class SharePathSaveReqVO {
     @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12537")
     private Long id;
 
-    @Schema(description = "推荐人")
-    private Long ancestor;
+    @Schema(description = "用户id")
+    private Long userId;
 
-    @Schema(description = "直推人")
-    private Long descendant;
+    @Schema(description = "用户名")
+    private String userName;
 
-    @Schema(description = "顺序")
-    private Integer sort;
+    @Schema(description = "用户电话")
+    private String phone;
 
-    @Schema(description = "推荐人姓名", example = "王五")
-    private String ancName;
+    @Schema(description = "上级用户id")
+    private Long parentId;
 
-    @Schema(description = "推荐人手机号")
-    private String ancPhone;
+    @Schema(description = "左区用户id")
+    private Long leftChildId;
 
-    @Schema(description = "直推人姓名", example = "李四")
-    private String descName;
-
-    @Schema(description = "推荐人手机号")
-    private String descPhone;
-
-    @Schema(description = "推荐人昵称", example = "非繁人")
-    private String ancNickName;
-
-    @Schema(description = "直推人昵称", example = "张三")
-    private String descNickName;
+    @Schema(description = "右区用户id")
+    private Long rightChildId;
 
+    @Schema(description = "推荐人id")
+    private Long referrerId;
 }

+ 0 - 26
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/app/sharepath/vo/SharePathTreeReqVO.java

@@ -1,26 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.app.sharepath.vo;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.ToString;
-
-import javax.validation.constraints.NotNull;
-
-@Schema(description = "用户 APP - 分销用户关系树 Request VO")
-@Data
-@ToString(callSuper = true)
-public class SharePathTreeReqVO {
-    @Schema(description = "名称")
-    private String name;
-
-    @Schema(description = "电话")
-    private String mobile;
-
-    @Schema(description = "最小层级")
-    @NotNull(message = "最小层级不能为空")
-    private Integer minDepth;
-
-    @Schema(description = "最大层级")
-    @NotNull(message = "最大层级不能为空")
-    private Integer maxDepth;
-}

+ 0 - 35
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/convert/usertopupconsumptionpointsorder/UserTopUpConsumptionPointsOrderConvert.java

@@ -1,35 +0,0 @@
-package cn.newfeifan.mall.module.distri.convert.usertopupconsumptionpointsorder;
-
-import cn.newfeifan.mall.framework.common.util.string.StrUtils;
-import cn.newfeifan.mall.module.distri.config.OrderProperties;
-import cn.newfeifan.mall.module.distri.dal.dataobject.usertopupconsumptionpointsorder.UserTopUpConsumptionPointsOrderDO;
-import cn.newfeifan.mall.module.pay.api.order.dto.PayOrderCreateReqDTO;
-import cn.newfeifan.mall.module.pay.dal.dataobject.order.PayOrderDO;
-import cn.newfeifan.mall.module.pay.enums.order.PayOrderStatusEnum;
-import org.mapstruct.Mapper;
-import org.mapstruct.factory.Mappers;
-
-import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.addTime;
-
-@Mapper
-public interface UserTopUpConsumptionPointsOrderConvert {
-
-    UserTopUpConsumptionPointsOrderConvert INSTANCE = Mappers.getMapper(UserTopUpConsumptionPointsOrderConvert.class);
-    default PayOrderDO convert(UserTopUpConsumptionPointsOrderDO saveReqVO, OrderProperties orderProperties)
-    {
-        PayOrderDO payOrderDO = new PayOrderDO()
-                .setAppId(orderProperties.getAppId()).setUserIp(saveReqVO.getUserIp());
-        // 商户相关字段
-        payOrderDO.setMerchantOrderId(String.valueOf(saveReqVO.getId()));
-        String subject = saveReqVO.getSubject();
-        subject = StrUtils.maxLength(subject, PayOrderCreateReqDTO.SUBJECT_MAX_LENGTH); // 避免超过 32 位
-        payOrderDO.setSubject(subject);
-        payOrderDO.setBody(subject);
-        payOrderDO.setStatus(PayOrderStatusEnum.WAITING.getStatus()).setRefundPrice(0);
-        payOrderDO.setMerchantOrderId(saveReqVO.getId().toString());
-
-        // 订单相关字段
-        payOrderDO.setPrice(saveReqVO.getPayPrice().intValue()).setExpireTime(addTime(orderProperties.getPayExpireTime()));
-        return payOrderDO;
-    }
-}

+ 0 - 65
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/applicationforwithdrawal/ApplicationForWithdrawalDO.java

@@ -1,65 +0,0 @@
-package cn.newfeifan.mall.module.distri.dal.dataobject.applicationforwithdrawal;
-
-import lombok.*;
-import com.baomidou.mybatisplus.annotation.*;
-import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
-
-/**
- * 提现申请记录 DO
- *
- * @author 非繁人
- */
-@TableName("distri_application_for_withdrawal")
-@KeySequence("distri_application_for_withdrawal_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class ApplicationForWithdrawalDO extends BaseDO {
-
-    /**
-     * 申请id
-     */
-    @TableId
-    private Long id;
-    /**
-     * 用户ID
-     */
-    private Long userId;
-    /**
-     * 提现渠道类型
-     */
-    private Integer withdrawalType;
-    /**
-     * 提现金额,单位:元
-     */
-    private Long amount;
-    /**
-     * 支付宝账号
-     */
-    private String withdrawalAccount;
-    /**
-     * 提现状态,成功是1, 失败是2, 提现中为0
-     */
-    private Integer status;
-    /**
-     * 提现渠道记录id
-     */
-    private Long applicationForWithdrawalChannelId;
-    /**
-     * 提现总金额,单位:分
-     */
-    private Long amountTotal;
-    /**
-     * 提现消费分,单位:分
-     */
-    private Long withdrawConsumption;
-    /**
-     * 计算百分比模板
-     */
-    private String percentTemplate;
-
-
-}

+ 0 - 66
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/applicationforwithdrawalchannel/ApplicationForWithdrawalChannelDO.java

@@ -1,66 +0,0 @@
-package cn.newfeifan.mall.module.distri.dal.dataobject.applicationforwithdrawalchannel;
-
-import lombok.*;
-import com.baomidou.mybatisplus.annotation.*;
-import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
-
-/**
- * 提现渠道记录 DO
- *
- * @author 非繁人
- */
-@TableName("distri_application_for_withdrawal_channel")
-@KeySequence("distri_application_for_withdrawal_channel_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class ApplicationForWithdrawalChannelDO extends BaseDO {
-
-    /**
-     * 提现渠道id
-     */
-    @TableId
-    private Long id;
-    /**
-     * 提现渠道类型
-     */
-    private Integer withdrawalType;
-    /**
-     * 提现渠道名称
-     */
-    private String withdrawalName;
-    /**
-     * 提现金额,单位:元
-     */
-    private Long amount;
-    /**
-     * 提现笔数
-     */
-    private Integer count;
-    /**
-     * 提现状态,已完成是1,未完成为0
-     */
-    private Boolean status;
-    /**
-     * 提现渠道记录id
-     */
-    private Long ptDailyWithdrawalId;
-
-    /**
-     * 导出状态,已导出是1,未导出为0
-     */
-    private Boolean excelStatus;
-    /**
-     * 提现总金额,单位:分
-     */
-    private Long amountTotal;
-    /**
-     * 提现消费分,单位:分
-     */
-    private Long withdrawConsumption;
-
-
-}

+ 0 - 62
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/consumptionchangelog/ConsumptionChangeLogDO.java

@@ -1,62 +0,0 @@
-package cn.newfeifan.mall.module.distri.dal.dataobject.consumptionchangelog;
-
-import lombok.*;
-import com.baomidou.mybatisplus.annotation.*;
-import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
-
-/**
- * 平台消费分变动记录 DO
- *
- * @author 非繁人
- */
-@TableName("distri_consumption_change_log")
-@KeySequence("distri_consumption_change_log_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class ConsumptionChangeLogDO extends BaseDO {
-
-    /**
-     * 日志编号
-     */
-    @TableId
-    private Long id;
-    /**
-     * 用户ID
-     */
-    private Long userId;
-    /**
-     * 变动的消费分
-     */
-    private Long consumptionPoints;
-    /**
-     * 变动后消费分
-     */
-    private Long afterConsumptionPoints;
-    /**
-     * 消费分变动类型
-     */
-    private Integer consumptionStatus;
-    /**
-     * 实际消费分
-     */
-    private Long practicalConsumptionPoints;
-
-    /**
-     * 消费分产生对象
-     */
-    private Long generateUserId;
-
-    /**
-     * 订单Id
-     */
-    private Long orderId;
-    /**
-     * 订单编号
-     */
-    private String orderNo;
-
-}

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

@@ -28,10 +28,6 @@ public class DuserDO extends BaseDO {
      * 团队人员ID
      */
     private Long userId;
-    /**
-     * 团队人员姓名
-     */
-    private String name;
     /**
      * 团队人员手机号码
      */
@@ -61,6 +57,6 @@ public class DuserDO extends BaseDO {
      */
     private Long categoryId;
 
-    private String nickName;
+    private String userName;
 
 }

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

@@ -29,23 +29,17 @@ public class IntegralDO extends BaseDO {
      */
     private Long userId;
     /**
-     * 当前积分
+     * 当前积分
      */
-    private Long currentQuota;
+    private Long redCurrentQuota;
     /**
      * 冻结积分
      */
     private Long freezeQuota;
-    /**
-     * 用户类型
-     */
-    private Long categoryId;
 
     private Long highQuota;
 
-    private String name;
-
-    private String nickName;
+    private String userName;
 
     /**
      * 合赢奖累计获取积分
@@ -55,6 +49,10 @@ public class IntegralDO extends BaseDO {
      * 直推奖累计获取积分
      */
     private Long ancestorQuota;
+    /**
+     * 幸运奖累计获取积分
+     */
+    private Long luckyQuota;
     /**
      * 冻结的最高可获取积分
      */
@@ -69,4 +67,12 @@ public class IntegralDO extends BaseDO {
      * 当前消费分
      */
     private Long consumptionPoints;
+    /**
+     * 当前黄积分
+     */
+    private Long yellowCurrentQuota;
+    /**
+     * 当前绿积分
+     */
+    private Long greenCurrentQuota;
 }

+ 84 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/integralchangelog/IntegralChangeLogDO.java

@@ -0,0 +1,84 @@
+package cn.newfeifan.mall.module.distri.dal.dataobject.integralchangelog;
+
+import lombok.*;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 平台消费分变动记录 DO
+ *
+ * @author 非繁人
+ */
+@TableName("distri_integral_change_log")
+@KeySequence("distri_integral_change_log_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class IntegralChangeLogDO extends BaseDO {
+
+    /**
+     * 日志编号
+     */
+    @TableId
+    private Long id;
+    /**
+     * 用户ID
+     */
+    private Long userId;
+    /**
+     * 积分类型
+     */
+    private Integer integralType;
+    /**
+     * 订单Id
+     */
+    private Long orderId;
+    /**
+     * 订单编号
+     */
+    private String orderNo;
+    /**
+     * 变动的积分
+     */
+    private Long integralPoints;
+    /**
+     * 变动后积分
+     */
+    private Long afterIntegralPoints;
+    /**
+     * 实际积分
+     */
+    private Long practicalIntegralPoints;
+    /**
+     * 变动峰值
+     */
+    private Long maxAvailablePointsAmount;
+    /**
+     * 变动后峰值
+     */
+    private Long afterMaxAvailablePointsAmount;
+    /**
+     * 超出团队奖
+     */
+    private Long accumulatedQuotaAmount;
+    /**
+     * 超出直推奖
+     */
+    private Long ancestorQuotaAmount;
+    /**
+     * 超出幸运奖
+     */
+    private Long luckyQuotaAmount;
+    /**
+     * 积分变动类型
+     */
+    private Integer integralStatus;
+    /**
+     * 积分产生对象
+     */
+    private Long generateUserId;
+
+}

+ 8 - 4
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/consumptiontransferlog/ConsumptionTransferLogDO.java → feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/integraltransferlog/IntegralTransferLogDO.java

@@ -1,4 +1,4 @@
-package cn.newfeifan.mall.module.distri.dal.dataobject.consumptiontransferlog;
+package cn.newfeifan.mall.module.distri.dal.dataobject.integraltransferlog;
 
 import lombok.*;
 import com.baomidou.mybatisplus.annotation.*;
@@ -9,15 +9,15 @@ import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
  *
  * @author 非繁人
  */
-@TableName("distri_consumption_transfer_log")
-@KeySequence("distri_consumption_transfer_log_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@TableName("distri_integral_transfer_log")
+@KeySequence("distri_integral_transfer_log_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
 @Data
 @EqualsAndHashCode(callSuper = true)
 @ToString(callSuper = true)
 @Builder
 @NoArgsConstructor
 @AllArgsConstructor
-public class ConsumptionTransferLogDO extends BaseDO {
+public class IntegralTransferLogDO extends BaseDO {
 
     /**
      * 日志编号
@@ -56,5 +56,9 @@ public class ConsumptionTransferLogDO extends BaseDO {
      * 变动后消费分(余额)
      */
     private Long afterRecipientConsumptionPoints;
+    /**
+     * 积分类型
+     */
+    private Integer integralType;
 
 }

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

@@ -28,27 +28,18 @@ public class OrderPercentageDO extends BaseDO {
      * 毛利 = 成本 * 0.38... (推广费用)
      */
     private String grossProfitPerc;
-    /**
-     * 推广-用户额度 百分比
-     */
-    private String grossProfitUserQuotaPerc;
-    /**
-     * 推广-推荐人额度 百分比
-     */
-    private String grossProfitAncestorQuotaPerc;
-    /**
-     * 推广-合赢奖额度(浮动) 百分比
-     */
-    private String grossProfitBonusQuotaPerc;
     /**
      * 推广-平台分成额度(浮动) 百分比
      */
     private String grossProfitPlatformQuotaPerc;
     /**
-     * 分成百分比
+     * 是否启用 0关闭 1启动
      */
-    private String divideIntoPerc;
-
+    private Integer status;
+    /**
+     * 推广-推荐人额度 百分比(上级推荐人订单提成百分比)
+     */
+    private String grossProfitAncestorQuotaPerc;
     /**
      * 购物订单:直推人身价提升
      */
@@ -65,19 +56,14 @@ public class OrderPercentageDO extends BaseDO {
      * 新用户注册:本人身价提升
      */
     private String registerSocialStatus;
-
-    private Integer status;
-
     /**
      * 用户注册后,获得的基础最大合赢奖、直推奖积分限额
      */
     private String baseMaxQuota;
-
     /**
      * 收藏商品获取身价值,同一SPU商品收藏多次无效
      */
     private String collectSocialStatus;
-
     /**
      * 用户签到可获取的最大身价值
      */
@@ -86,40 +72,40 @@ public class OrderPercentageDO extends BaseDO {
      * 签到获取身价
      */
     private String signInSocialStatus;
-
     /**
-     * 充值消费分的倍率
+     * 触发倍率的最低金额
+     */
+    private String triggerMagnificationPoints;
+    /**
+     * 推广-团队奖额度(浮动) 百分比
      */
-    private String consumptionMagnification;
+    private String grossProfitBonusQuotaPerc;
     /**
-     * 首次充值消费分的额度
+     * 充值积分的倍率
      */
-    private String firstTopUpConsumption;
+    private String integralMagnification;
     /**
-     * 后续充值消费分的额度
+     * 团队奖、幸运奖所得黄积分百分比
      */
-    private String followUpConsumption;
-
+    private String bonusYellowIntegral;
     /**
-     * 提现佣金百分比
+     * 团队奖、幸运奖所得绿积分百分比
      */
-    private String withdrawCommission;
+    private String bonusGreenIntegral;
     /**
-     * 提现消费分百分比
+     * 会员黄积分转换红积分倍率
      */
-    private String withdrawConsumption;
-
+    private String memberYellowTransitionRed;
     /**
-     * 用户充值消费分的额度
+     * 会员红积分转换绿积分倍率
      */
-    private String userTopUpConsumptionPoints;
-
+    private String memberRedTransitionGreen;
     /**
-     * 触发倍率的最低金额
+     * 代理商黄积分转换红积分倍率
      */
-    private String triggerMagnificationPoints;
+    private String agentYellowTransitionRed;
     /**
-     * 成为代理商所需金额
+     * 代理商红积分转换绿积分倍率
      */
-    private String agentQuota;
+    private String agentRedTransitionGreen;
 }

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

@@ -18,7 +18,6 @@ import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
 @NoArgsConstructor
 @AllArgsConstructor
 public class PtProfitDO extends BaseDO {
-
     /**
      * 用户编号
      */
@@ -41,8 +40,7 @@ public class PtProfitDO extends BaseDO {
      */
     private Long profit;
     /**
-     * 游客收益
+     * 未结算金额
      */
-    private Long visitorEarnings;
-
+    private Long settlementPrice;
 }

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

@@ -19,20 +19,6 @@ import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
 @AllArgsConstructor
 public class PtProfitLogDO extends BaseDO {
 
-    /**
-     * 收益类型 1:平台服务器费 2:平台收益 3用户下单返回毛利额度 4直推人额度 5合赢奖
-     */
-    private Integer profitStatus;
-    /**
-     * 实际变动积分的用户ID , 只有收益类型为 3,4才有值
-     */
-    private Long userId;
-
-    /**
-     * 产生积分的用户ID,例如:下订单的用户ID
-     */
-    private Long generateUserId;
-
     /**
      * 订单Id
      */
@@ -46,50 +32,29 @@ public class PtProfitLogDO extends BaseDO {
      */
     @TableId
     private Long id;
-    /**
-     * 变动的当前可用积分值(可为负数)
-     */
-    private Long amount;
-    /**
-     * 变动后当前可用积分钱包的余额
-     */
-    private Long afterAmount;
-    /**
-     * 变动的冻结积分值(可为负数)
-     */
-    private Long freezeAmount;
-    /**
-     * 变动后冻结积分钱包的余额
-     */
-    private Long afterFreezeAmount;
     /**
      * 计算百分比模板
      */
     private String percentTemplate;
-
     /**
-     * 最大可用积分变化值
+     * 变动的当前可用积分值(可为负数)
      */
-    private Long maxAvailablePointsAmount;
+    private Long amount;
     /**
-     * 最大可用积分额度
+     * 变动后当前可用积分钱包的余额
      */
-    private Long afterMaxAvailablePointsAmount;
+    private Long afterAmount;
     /**
-     * 合赢奖超出额度
+     * 收益来源 1:平台服务器费 2:平台收益 3用户下单返回毛利额度 4直推人额度 5合赢奖
      */
-    private Long accumulatedQuotaAmount;
+    private Integer profitStatus;
     /**
-     * 直推奖超出额度
+     * 产生积分的用户ID,例如:下订单的用户ID
      */
-    private Long ancestorQuotaAmount;
+    private Long generateUserId;
 
     /**
-     * 变动的冻结最大可用额度
-     */
-    private Long freezeHighQuota;
-    /**
-     * 变动后的冻结最大可用额度
+     * 收益类型
      */
-    private Long afterFreezeHighQuota;
+    private Integer profitType;
 }

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

@@ -29,40 +29,31 @@ public class SharePathDO extends BaseDO {
     @TableId
     private Long id;
     /**
-     * 推荐人
+     * 用户id
      */
-    private Long ancestor;
+    private Long userId;
     /**
      * 直推人
      */
-    private Long descendant;
+    private String userName;
     /**
-     * 顺序
+     * 手机号
      */
-    private Integer sort;
+    private String phone;
     /**
-     * 推荐人姓名
+     * 上级id
      */
-    private String ancName;
+    private Long parentId;
     /**
-     * 推荐人手机号
+     * 左区用户id
      */
-    private String ancPhone;
+    private Long leftChildId;
     /**
-     * 直推人姓名
+     * 右区用户id
      */
-    private String descName;
+    private Long rightChildId;
     /**
-     * 推荐人手机号
+     * 推荐人id
      */
-    private String descPhone;
-    /**
-     * 推荐人昵称
-     */
-    private String ancNickName;
-    /**
-     * 直推人昵称
-     */
-    private String descNickName;
-
+    private Long referrerId;
 }

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

@@ -1,31 +0,0 @@
-package cn.newfeifan.mall.module.distri.dal.mysql.applicationforwithdrawal;
-
-
-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.applicationforwithdrawal.ApplicationForWithdrawalDO;
-import org.apache.ibatis.annotations.Mapper;
-import cn.newfeifan.mall.module.distri.controller.app.applicationforwithdrawal.vo.*;
-
-/**
- * 提现申请记录 Mapper
- *
- * @author 非繁人
- */
-@Mapper
-public interface ApplicationForWithdrawalMapper extends BaseMapperX<ApplicationForWithdrawalDO> {
-
-    default PageResult<ApplicationForWithdrawalDO> selectPage(AppApplicationForWithdrawalPageReqVO reqVO) {
-        return selectPage(reqVO, new LambdaQueryWrapperX<ApplicationForWithdrawalDO>()
-                .eqIfPresent(ApplicationForWithdrawalDO::getUserId, reqVO.getUserId())
-                .eqIfPresent(ApplicationForWithdrawalDO::getWithdrawalType, reqVO.getWithdrawalType())
-                .eqIfPresent(ApplicationForWithdrawalDO::getAmount, reqVO.getAmount())
-                .eqIfPresent(ApplicationForWithdrawalDO::getWithdrawalAccount, reqVO.getWithdrawalAccount())
-                .eqIfPresent(ApplicationForWithdrawalDO::getStatus, reqVO.getStatus())
-                .eqIfPresent(ApplicationForWithdrawalDO::getApplicationForWithdrawalChannelId, reqVO.getApplicationForWithdrawalChannelId())
-                .betweenIfPresent(ApplicationForWithdrawalDO::getCreateTime, reqVO.getCreateTime())
-                .orderByDesc(ApplicationForWithdrawalDO::getId));
-    }
-
-}

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

@@ -1,31 +0,0 @@
-package cn.newfeifan.mall.module.distri.dal.mysql.applicationforwithdrawalchannel;
-
-
-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.applicationforwithdrawalchannel.ApplicationForWithdrawalChannelDO;
-import org.apache.ibatis.annotations.Mapper;
-import cn.newfeifan.mall.module.distri.controller.app.applicationforwithdrawalchannel.vo.*;
-
-/**
- * 提现渠道记录 Mapper
- *
- * @author 非繁人
- */
-@Mapper
-public interface ApplicationForWithdrawalChannelMapper extends BaseMapperX<ApplicationForWithdrawalChannelDO> {
-
-    default PageResult<ApplicationForWithdrawalChannelDO> selectPage(AppApplicationForWithdrawalChannelPageReqVO reqVO) {
-        return selectPage(reqVO, new LambdaQueryWrapperX<ApplicationForWithdrawalChannelDO>()
-                .eqIfPresent(ApplicationForWithdrawalChannelDO::getWithdrawalType, reqVO.getWithdrawalType())
-                .likeIfPresent(ApplicationForWithdrawalChannelDO::getWithdrawalName, reqVO.getWithdrawalName())
-                .eqIfPresent(ApplicationForWithdrawalChannelDO::getAmount, reqVO.getAmount())
-                .eqIfPresent(ApplicationForWithdrawalChannelDO::getCount, reqVO.getCount())
-                .eqIfPresent(ApplicationForWithdrawalChannelDO::getStatus, reqVO.getStatus())
-                .eqIfPresent(ApplicationForWithdrawalChannelDO::getPtDailyWithdrawalId, reqVO.getPtDailyWithdrawalId())
-                .betweenIfPresent(ApplicationForWithdrawalChannelDO::getCreateTime, reqVO.getCreateTime())
-                .orderByDesc(ApplicationForWithdrawalChannelDO::getId));
-    }
-
-}

+ 13 - 11
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/consumptionchangelog/ConsumptionChangeLogMapper.java

@@ -3,8 +3,8 @@ package cn.newfeifan.mall.module.distri.dal.mysql.consumptionchangelog;
 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.controller.app.consumptionchangelog.vo.ConsumptionChangeLogPageReqVO;
-import cn.newfeifan.mall.module.distri.dal.dataobject.consumptionchangelog.ConsumptionChangeLogDO;
+import cn.newfeifan.mall.module.distri.controller.app.integralchangelog.vo.IntegralChangeLogPageReqVO;
+import cn.newfeifan.mall.module.distri.dal.dataobject.integralchangelog.IntegralChangeLogDO;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
@@ -13,16 +13,18 @@ import org.apache.ibatis.annotations.Mapper;
  * @author 非繁人
  */
 @Mapper
-public interface ConsumptionChangeLogMapper extends BaseMapperX<ConsumptionChangeLogDO> {
+public interface ConsumptionChangeLogMapper extends BaseMapperX<IntegralChangeLogDO> {
 
-    default PageResult<ConsumptionChangeLogDO> selectPage(ConsumptionChangeLogPageReqVO reqVO) {
-        return selectPage(reqVO, new LambdaQueryWrapperX<ConsumptionChangeLogDO>()
-                .eqIfPresent(ConsumptionChangeLogDO::getUserId, reqVO.getUserId())
-                .eqIfPresent(ConsumptionChangeLogDO::getConsumptionPoints, reqVO.getConsumptionPoints())
-                .eqIfPresent(ConsumptionChangeLogDO::getAfterConsumptionPoints, reqVO.getAfterConsumptionPoints())
-                .eqIfPresent(ConsumptionChangeLogDO::getConsumptionStatus, reqVO.getConsumptionStatus())
-                .betweenIfPresent(ConsumptionChangeLogDO::getCreateTime, reqVO.getCreateTime())
-                .orderByDesc(ConsumptionChangeLogDO::getId));
+    default PageResult<IntegralChangeLogDO> selectPage(IntegralChangeLogPageReqVO reqVO) {
+        LambdaQueryWrapperX<IntegralChangeLogDO> wrapper = new LambdaQueryWrapperX<IntegralChangeLogDO>()
+                .eqIfPresent(IntegralChangeLogDO::getUserId, reqVO.getUserId())
+                .eqIfPresent(IntegralChangeLogDO::getIntegralType, reqVO.getIntegralType())
+                .betweenIfPresent(IntegralChangeLogDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(IntegralChangeLogDO::getId);
+        if (reqVO.getIntegralType() == null ){
+            wrapper.ne(IntegralChangeLogDO::getMaxAvailablePointsAmount, 0);
+        }
+        return selectPage(reqVO, wrapper);
     }
 
 }

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

@@ -1,29 +0,0 @@
-package cn.newfeifan.mall.module.distri.dal.mysql.consumptiontransferlog;
-
-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.controller.app.consumptiontransferlog.vo.ConsumptionTransferLogPageReqVO;
-import cn.newfeifan.mall.module.distri.dal.dataobject.consumptiontransferlog.ConsumptionTransferLogDO;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * 消费分转让记录 Mapper
- *
- * @author 非繁人
- */
-@Mapper
-public interface ConsumptionTransferLogMapper extends BaseMapperX<ConsumptionTransferLogDO> {
-
-    default PageResult<ConsumptionTransferLogDO> selectPage(ConsumptionTransferLogPageReqVO reqVO) {
-        LambdaQueryWrapperX<ConsumptionTransferLogDO> queryWrapper = new LambdaQueryWrapperX<ConsumptionTransferLogDO>()
-                .likeIfPresent(ConsumptionTransferLogDO::getTransferUserName, reqVO.getTransferUserName())
-                .eqIfPresent(ConsumptionTransferLogDO::getConsumptionPoints, reqVO.getConsumptionPoints())
-                .likeIfPresent(ConsumptionTransferLogDO::getRecipientUserName, reqVO.getRecipientUserName())
-                .betweenIfPresent(ConsumptionTransferLogDO::getCreateTime, reqVO.getCreateTime())
-                .orderByDesc(ConsumptionTransferLogDO::getId);
-        queryWrapper.apply("(transfer_user_id = '"+reqVO.getTransferUserId()+"' or recipient_user_id = '"+reqVO.getTransferUserId()+"')");
-        return selectPage(reqVO, queryWrapper);
-    }
-
-}

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

@@ -19,7 +19,7 @@ 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())
+                .likeIfPresent(DuserDO::getUserName, reqVO.getUserName())
                 .eqIfPresent(DuserDO::getMobile, reqVO.getMobile())
                 .eqIfPresent(DuserDO::getSource, reqVO.getSource())
                 .eqIfPresent(DuserDO::getIntegralId, reqVO.getIntegralId())

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

@@ -18,9 +18,8 @@ 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::getRedCurrentQuota, reqVO.getCurrentQuota())
                 .eqIfPresent(IntegralDO::getFreezeQuota, reqVO.getFreezeQuota())
-                .eqIfPresent(IntegralDO::getCategoryId, reqVO.getCategoryId())
                 .betweenIfPresent(IntegralDO::getCreateTime, reqVO.getCreateTime())
                 .orderByDesc(IntegralDO::getId));
     }

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

@@ -0,0 +1,30 @@
+package cn.newfeifan.mall.module.distri.dal.mysql.integraltransferlog;
+
+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.controller.app.integraltransferlog.vo.IntegralTransferLogPageReqVO;
+import cn.newfeifan.mall.module.distri.dal.dataobject.integraltransferlog.IntegralTransferLogDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 消费分转让记录 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface IntegralTransferLogMapper extends BaseMapperX<IntegralTransferLogDO> {
+
+    default PageResult<IntegralTransferLogDO> selectPage(IntegralTransferLogPageReqVO reqVO) {
+        LambdaQueryWrapperX<IntegralTransferLogDO> queryWrapper = new LambdaQueryWrapperX<IntegralTransferLogDO>()
+                .likeIfPresent(IntegralTransferLogDO::getTransferUserName, reqVO.getTransferUserName())
+                .eqIfPresent(IntegralTransferLogDO::getConsumptionPoints, reqVO.getConsumptionPoints())
+                .eqIfPresent(IntegralTransferLogDO::getIntegralType, reqVO.getIntegralType())
+                .likeIfPresent(IntegralTransferLogDO::getRecipientUserName, reqVO.getRecipientUserName())
+                .betweenIfPresent(IntegralTransferLogDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(IntegralTransferLogDO::getId);
+        queryWrapper.apply("(transfer_user_id = '"+reqVO.getTransferUserId()+"' or recipient_user_id = '"+reqVO.getTransferUserId()+"')");
+        return selectPage(reqVO, queryWrapper);
+    }
+
+}

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

@@ -18,12 +18,10 @@ 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));
     }

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

@@ -11,9 +11,7 @@ import cn.newfeifan.mall.module.distri.controller.app.ptprofitlog.vo.*;
 import java.util.Arrays;
 import java.util.List;
 
-import static cn.newfeifan.mall.module.distri.constant.DistriConstants.PT_ID;
 import static cn.newfeifan.mall.module.distri.enums.CaclEnum.*;
-import static cn.newfeifan.mall.module.distri.enums.CaclEnum.GROSS_PROFIT_ANCESTOR_QUOTA_PERC_EXCEED_MAXIMUM_LIMIT;
 
 /**
  * 平台利润记录 Mapper
@@ -24,79 +22,16 @@ import static cn.newfeifan.mall.module.distri.enums.CaclEnum.GROSS_PROFIT_ANCEST
 public interface PtProfitLogMapper extends BaseMapperX<PtProfitLogDO> {
 
     default PageResult<PtProfitLogDO> selectPage(PtProfitLogPageReqVO reqVO) {
-        //用户只能查看这些类型
-        List<Integer> profitStatus;
-
         LambdaQueryWrapperX<PtProfitLogDO> queryWrapper = new LambdaQueryWrapperX<PtProfitLogDO>()
+                .eqIfPresent(PtProfitLogDO::getProfitType, reqVO.getProfitType())
                 .eqIfPresent(PtProfitLogDO::getAmount, reqVO.getAmount())
                 .eqIfPresent(PtProfitLogDO::getAfterAmount, reqVO.getAfterAmount())
                 .eqIfPresent(PtProfitLogDO::getOrderId, reqVO.getOrderId())
                 .eqIfPresent(PtProfitLogDO::getPercentTemplate, reqVO.getPercentTemplate())
-                .eqIfPresent(PtProfitLogDO::getUserId, reqVO.getUserId())
+                .eqIfPresent(PtProfitLogDO::getGenerateUserId, reqVO.getGenerateUserId())
                 .orderByDesc(PtProfitLogDO::getCreateTime)
                 .orderByDesc(PtProfitLogDO::getId);
 
-        if (!reqVO.getIsFreeze()) {
-            //可用
-            profitStatus = Arrays.asList(
-                    RECOMMENDED_PERSON_QUOTA.getType(),
-                    DIRECT_REFERRAL_QUOTA.getType(),
-                    SMALL_QUOTA_CRASH_SETTLE.getType(),
-                    ORDER_PAY_INTEGRAL.getType(),
-                    ORDER_REFUND_INTEGRAL.getType(),
-                    ORDER_CANCEL_BY_USER_REFUND_INTEGRAL.getType(),
-                    ORDER_CANCEL_BY_SYSTEM_REFUND_INTEGRAL.getType(),
-                    ORDER_REFUND_INTEGRAL_CONSUMER.getType(),
-                    ORDER_REFUND_INTEGRAL_ANCESTER.getType(),
-                    MANUAL_RETURN_INTEGRAL.getType(),
-                    WITHDRAWAL.getType(),
-                    WITHDRAWAL_ERROR.getType(),
-                    COMMISSION_TRANSITION.getType()
-            );
-            queryWrapper.ne(PtProfitLogDO::getAmount,0);
-        } else {
-            //冻结
-            profitStatus = Arrays.asList(
-                    RECOMMENDED_PERSON_QUOTA.getType(),
-                    DIRECT_REFERRAL_QUOTA.getType(),
-                    SMALL_QUOTA_CRASH.getType(),
-                    ORDER_PAY_INTEGRAL_ANCESTER.getType(),
-//                    ORDER_REFUND_INTEGRAL_CONSUMER.getType(),
-//                    ORDER_REFUND_INTEGRAL_ANCESTER.getType(),
-                    ORDER_PAY_INTEGRAL_CONSUMER.getType());
-//            queryWrapper.ne(PtProfitLogDO::getFreezeAmount,0);
-        }
-
-        if (!reqVO.getIsFreeze() && reqVO.getUserId().equals(PT_ID)) {
-            //平台账号可用
-            profitStatus = Arrays.asList(
-                    PLATFORM_TOTAL_ADD.getType(),
-                    PLATFORM_SERVICE_FEE.getType(),
-                    PLATFORM_REVENUE.getType(),
-                    SMALL_QUOTA_CRASH_SETTLE.getType(),
-                    AFTER_CRASH_CALC_PT_TOTAL_QUOTA.getType(),
-                    AFTER_CRASH_CALC_PT_TOTAL_GROSS_QUOTA.getType(),
-                    GROSS_PROFIT_BONUS_QUOTA_PERC_EXCEED_MAXIMUM_LIMIT.getType(),
-                    GROSS_PROFIT_ANCESTOR_QUOTA_PERC_EXCEED_MAXIMUM_LIMIT.getType(),
-                    MANUAL_RETURN_INTEGRAL.getType(),
-                    WITHDRAWAL.getType(),
-                    WITHDRAWAL_ERROR.getType()
-            );
-            reqVO.setUserId(null);
-        } else if (reqVO.getIsFreeze() && reqVO.getUserId().equals(PT_ID)) {
-            profitStatus = Arrays.asList(
-                    RECOMMENDED_PERSON_QUOTA.getType(),
-                    DIRECT_REFERRAL_QUOTA.getType(),
-                    SMALL_QUOTA_CRASH.getType(),
-                    ORDER_PAY_INTEGRAL.getType(),
-                    ORDER_REFUND_INTEGRAL.getType(),
-                    ORDER_CANCEL_BY_USER_REFUND_INTEGRAL.getType(),
-                    ORDER_CANCEL_BY_SYSTEM_REFUND_INTEGRAL.getType()
-            );
-//            reqVO.setUserId(null);
-        }
-
-        queryWrapper.inIfPresent(PtProfitLogDO::getProfitStatus, profitStatus);
 
         return selectPage(reqVO, queryWrapper);
     }
@@ -106,12 +41,11 @@ public interface PtProfitLogMapper extends BaseMapperX<PtProfitLogDO> {
                 DIRECT_REFERRAL_QUOTA.getType(),
                 RECOMMENDED_PERSON_QUOTA.getType(),
                 SMALL_QUOTA_CRASH.getType(),
-//                ORDER_PAY_FREEZE_HIGH_QUOTA.getType(),
                 ORDER_REFUND_INTEGRAL_ANCESTER.getType(),
                 ORDER_REFUND_ORDER_PAY_FREEZE_HIGH_QUOTA.getType(),
                 MANUAL_RETURN_INTEGRAL.getType());
         return selectPage(pageReqVO, new LambdaQueryWrapperX<PtProfitLogDO>()
-                .eqIfPresent(PtProfitLogDO::getUserId, pageReqVO.getUserId())
+                .eqIfPresent(PtProfitLogDO::getGenerateUserId, pageReqVO.getGenerateUserId())
                 .inIfPresent(PtProfitLogDO::getProfitStatus, profitStatus)
                 .orderByDesc(PtProfitLogDO::getCreateTime)
                 .orderByDesc(PtProfitLogDO::getId)

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

@@ -9,6 +9,8 @@ import cn.newfeifan.mall.module.distri.dal.dataobject.sharepath.SharePathDO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * 分销用户关系 Mapper
  *
@@ -21,22 +23,9 @@ public interface SharePathMapper extends BaseMapperX<SharePathDO> {
         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("parentName") String parentName,
-                 @Param("parentNickName") String parentNickName,
-                 @Param("parentMobile") String parentMobile,
-
-                 @Param("newDescendantId") Long newDescendantId,
-                 @Param("newDescendantName") String newDescendantName,
-                 @Param("newDescendantNickName") String newDescendantNickName,
-                 @Param("newDescendantMobile") String newDescendantMobile);
-
 
     int getMaxSortByParentId(@Param("parentId") Long parentId);
 
@@ -47,4 +36,6 @@ public interface SharePathMapper extends BaseMapperX<SharePathDO> {
     void addNewAncestors(@Param("nodeId") Long nodeId, @Param("newParentId") Long newParentId);
 
     Long getAncestorIncreaseIntegralByUserId(@Param("userId") Long userId);
+
+    List<SharePathDO> selectListByUserId(@Param("referrerId") Long referrerId);
 }

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

@@ -41,8 +41,10 @@ public class AddSharePathConsumer {
         }
 
         SharePathSaveReqVO saveReqVO = SharePathSaveReqVO.builder()
-                .ancestor(ancestor)
-                .descendant(message.getDescendant()).build();
+                .referrerId(ancestor)
+                .userId(message.getDescendant())
+                .phone(message.getMobile())
+                .userName(message.getUserName()).build();
         sharePathService.createSharePathByUserId(saveReqVO);
     }
 

+ 0 - 24
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/mq/consumer/topupconsumptionpoints/TopUpConsumptionPointsConsumer.java

@@ -1,24 +0,0 @@
-package cn.newfeifan.mall.module.distri.mq.consumer.topupconsumptionpoints;
-
-import cn.newfeifan.mall.module.distri.service.usertopupconsumptionpointsorder.UserTopUpConsumptionPointsOrderService;
-import cn.newfeifan.mall.module.pay.dal.dataobject.order.PayOrderDO;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.context.event.EventListener;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.Resource;
-
-@Component
-@Slf4j
-public class TopUpConsumptionPointsConsumer {
-
-    @Resource
-    private UserTopUpConsumptionPointsOrderService userTopUpConsumptionPointsOrderService;
-
-    @EventListener
-    public void onMessage(PayOrderDO payOrderDO) {
-        //修改订单状态,并计算权益
-        log.info("app消费者开始消费:对象:{}",payOrderDO);
-        userTopUpConsumptionPointsOrderService.topUpConsumptionPoints(payOrderDO);
-    }
-}

+ 0 - 53
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/applicationforwithdrawal/ApplicationForWithdrawalService.java

@@ -1,53 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.applicationforwithdrawal;
-
-import javax.validation.*;
-import cn.newfeifan.mall.module.distri.controller.app.applicationforwithdrawal.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.applicationforwithdrawal.ApplicationForWithdrawalDO;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-
-/**
- * 提现申请记录 Service 接口
- *
- * @author 非繁人
- */
-public interface ApplicationForWithdrawalService {
-
-    /**
-     * 创建提现申请记录
-     *
-     * @param createReqVO 创建信息
-     * @return 编号
-     */
-    Long createApplicationForWithdrawal(@Valid AppApplicationForWithdrawalSaveReqVO createReqVO);
-
-    /**
-     * 更新提现申请记录
-     *
-     * @param updateReqVO 更新信息
-     */
-    void updateApplicationForWithdrawal(@Valid AppApplicationForWithdrawalSaveReqVO updateReqVO);
-
-    /**
-     * 删除提现申请记录
-     *
-     * @param id 编号
-     */
-    void deleteApplicationForWithdrawal(Long id);
-
-    /**
-     * 获得提现申请记录
-     *
-     * @param id 编号
-     * @return 提现申请记录
-     */
-    ApplicationForWithdrawalDO getApplicationForWithdrawal(Long id);
-
-    /**
-     * 获得提现申请记录分页
-     *
-     * @param pageReqVO 分页查询
-     * @return 提现申请记录分页
-     */
-    PageResult<ApplicationForWithdrawalDO> getApplicationForWithdrawalPage(AppApplicationForWithdrawalPageReqVO pageReqVO);
-
-}

+ 0 - 231
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/applicationforwithdrawal/ApplicationForWithdrawalServiceImpl.java

@@ -1,231 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.applicationforwithdrawal;
-
-import cn.newfeifan.mall.framework.common.exception.ErrorCode;
-import cn.newfeifan.mall.framework.common.util.json.JsonUtils;
-import cn.newfeifan.mall.module.distri.constant.DistriConstants;
-import cn.newfeifan.mall.module.distri.controller.app.consumptionchangelog.vo.ConsumptionChangeLogSaveReqVO;
-import cn.newfeifan.mall.module.distri.controller.app.integral.vo.IntegralSaveReqVO;
-import cn.newfeifan.mall.module.distri.controller.app.applicationforwithdrawalchannel.vo.AppApplicationForWithdrawalChannelSaveReqVO;
-import cn.newfeifan.mall.module.distri.controller.app.ptdailywithdrawal.vo.AppPtDailyWithdrawalSaveReqVO;
-import cn.newfeifan.mall.module.distri.controller.app.ptprofitlog.vo.PtProfitLogSaveReqVO;
-import cn.newfeifan.mall.module.distri.dal.dataobject.applicationforwithdrawalchannel.ApplicationForWithdrawalChannelDO;
-import cn.newfeifan.mall.module.distri.dal.dataobject.integral.IntegralDO;
-import cn.newfeifan.mall.module.distri.dal.dataobject.orderpercentage.OrderPercentageDO;
-import cn.newfeifan.mall.module.distri.dal.dataobject.ptdailywithdrawal.PtDailyWithdrawalDO;
-import cn.newfeifan.mall.module.distri.enums.CaclEnum;
-import cn.newfeifan.mall.module.distri.enums.ConsumptionEnum;
-import cn.newfeifan.mall.module.distri.enums.WithdrawalChannelTypeEnum;
-import cn.newfeifan.mall.module.distri.service.applicationforwithdrawalchannel.ApplicationForWithdrawalChannelService;
-import cn.newfeifan.mall.module.distri.service.consumptionchangelog.ConsumptionChangeLogService;
-import cn.newfeifan.mall.module.distri.service.integral.IntegralService;
-import cn.newfeifan.mall.module.distri.service.orderpercentage.OrderPercentageService;
-import cn.newfeifan.mall.module.distri.service.ptdailywithdrawal.PtDailyWithdrawalService;
-import cn.newfeifan.mall.module.distri.service.ptprofitlog.PtProfitLogService;
-import cn.newfeifan.mall.module.member.dal.dataobject.user.MemberUserDO;
-import cn.newfeifan.mall.module.member.service.user.MemberUserService;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.validation.annotation.Validated;
-
-import cn.newfeifan.mall.module.distri.controller.app.applicationforwithdrawal.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.applicationforwithdrawal.ApplicationForWithdrawalDO;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
-
-import cn.newfeifan.mall.module.distri.dal.mysql.applicationforwithdrawal.ApplicationForWithdrawalMapper;
-
-import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
-import static cn.newfeifan.mall.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
-import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
-
-/**
- * 提现申请记录 Service 实现类
- *
- * @author 非繁人
- */
-@Service
-@Validated
-public class ApplicationForWithdrawalServiceImpl implements ApplicationForWithdrawalService {
-
-    @Resource
-    private ApplicationForWithdrawalMapper applicationForWithdrawalMapper;
-
-    @Resource
-    private ApplicationForWithdrawalChannelService applicationForWithdrawalChannelService;
-
-    @Resource
-    private PtDailyWithdrawalService ptDailyWithdrawalService;
-
-    @Resource
-    private MemberUserService userService;
-
-    @Resource
-    private IntegralService integralService;
-
-    @Resource
-    private PtProfitLogService ptProfitLogService;
-
-    @Resource
-    private OrderPercentageService orderPercentageService;
-
-    @Resource
-    private ConsumptionChangeLogService consumptionChangeLogService;
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public Long createApplicationForWithdrawal(AppApplicationForWithdrawalSaveReqVO reqVO) {
-        // 百倍为 元,单位 : 分
-        reqVO.setAmountTotal(reqVO.getAmountTotal() * DistriConstants.ONE_HUNDRED);
-        OrderPercentageDO orderPercentageDO = orderPercentageService.queryStatus();
-        reqVO.setPercentTemplate(JsonUtils.toJsonString(orderPercentageDO));
-        reqVO.setAmount((long) (reqVO.getAmountTotal() * Double.parseDouble(orderPercentageDO.getWithdrawCommission())));
-        reqVO.setWithdrawConsumption((long) (reqVO.getAmountTotal() * Double.parseDouble(orderPercentageDO.getWithdrawConsumption())));
-
-        // 获取用户钱包
-        IntegralDO integralDO = integralService.selectByUser(getLoginUserId());
-
-        if(integralDO.getCurrentQuota() < reqVO.getAmount() * DistriConstants.PERCENT){
-            ErrorCode ERROR = new ErrorCode(1_005_031_005, "积分不足!");
-            throw exception(ERROR);
-        }
-
-        // 获取pt一级提现记录
-        PtDailyWithdrawalDO ptDailyWithdrawalDO = ptDailyWithdrawalService.getPtDailyWithdrawalToDay();
-
-        // 二级提现记录
-        ApplicationForWithdrawalChannelDO applicationForWithdrawalChannelDO = applicationForWithdrawalChannelService.getApplicationForWithdrawalChannel(reqVO.getWithdrawalType(), ptDailyWithdrawalDO.getId());
-
-        // 插入
-        MemberUserDO user = userService.getUser(getLoginUserId());
-
-        reqVO.setApplicationForWithdrawalChannelId(applicationForWithdrawalChannelDO.getId());
-        reqVO.setUserId(user.getId());
-
-        // 根据渠道获取对应账号
-        if (reqVO.getWithdrawalType().equals(WithdrawalChannelTypeEnum.ALIPAY.getType())) {
-            reqVO.setWithdrawalAccount(user.getAlipayAccount());
-        } else if (reqVO.getWithdrawalType().equals(WithdrawalChannelTypeEnum.BANK.getType())) {
-            reqVO.setWithdrawalAccount(user.getBankAccount());
-        }
-
-        if(reqVO.getWithdrawalAccount() == null || reqVO.getWithdrawalAccount().isEmpty()){
-            ErrorCode ERROR = new ErrorCode(1_005_031_005, "提现账号不能为空!");
-            throw exception(ERROR);
-        }
-
-        ApplicationForWithdrawalDO applicationForWithdrawal = BeanUtils.toBean(reqVO, ApplicationForWithdrawalDO.class);
-        applicationForWithdrawal.setWithdrawConsumption(reqVO.getWithdrawConsumption() * DistriConstants.PERCENT);
-        applicationForWithdrawalMapper.insert(applicationForWithdrawal);
-
-        // 每一次申请就会改变二级表总数据
-        applicationForWithdrawalChannelDO.setAmount(applicationForWithdrawalChannelDO.getAmount() + reqVO.getAmount());
-        applicationForWithdrawalChannelDO.setAmountTotal(applicationForWithdrawalChannelDO.getAmountTotal() + reqVO.getAmountTotal());
-        applicationForWithdrawalChannelDO.setWithdrawConsumption(applicationForWithdrawalChannelDO.getWithdrawConsumption() + reqVO.getWithdrawConsumption() * DistriConstants.PERCENT);
-        applicationForWithdrawalChannelDO.setCount(applicationForWithdrawalChannelDO.getCount() + 1);
-        applicationForWithdrawalChannelService.updateApplicationForWithdrawalChannel(BeanUtils.toBean(applicationForWithdrawalChannelDO, AppApplicationForWithdrawalChannelSaveReqVO.class));
-
-        // 每一次申请就会改变一级表总数据
-        ptDailyWithdrawalDO.setAmount(ptDailyWithdrawalDO.getAmount() + reqVO.getAmount());
-        ptDailyWithdrawalDO.setAmountTotal(ptDailyWithdrawalDO.getAmountTotal() + reqVO.getAmountTotal());
-        ptDailyWithdrawalDO.setWithdrawConsumption(ptDailyWithdrawalDO.getWithdrawConsumption() + reqVO.getWithdrawConsumption() * DistriConstants.PERCENT);
-        ptDailyWithdrawalDO.setCount(ptDailyWithdrawalDO.getCount() + 1);
-        ptDailyWithdrawalService.updatePtDailyWithdrawal(BeanUtils.toBean(ptDailyWithdrawalDO, AppPtDailyWithdrawalSaveReqVO.class));
-
-        // 修改用户钱包余额
-        integralDO.setCurrentQuota(integralDO.getCurrentQuota() - reqVO.getAmountTotal() * DistriConstants.PERCENT);
-        integralDO.setConsumptionPoints(integralDO.getConsumptionPoints() + reqVO.getWithdrawConsumption() * DistriConstants.PERCENT);
-        integralService.updateIntegral(BeanUtils.toBean(integralDO, IntegralSaveReqVO.class));
-
-        // 记录用户积分变动日志
-        PtProfitLogSaveReqVO ptProfitLogSaveReqVO = PtProfitLogSaveReqVO.builder()
-                .amount(-reqVO.getAmountTotal() * DistriConstants.PERCENT)
-                .afterAmount(integralDO.getCurrentQuota())
-                .profitStatus(CaclEnum.WITHDRAWAL.getType())
-                .userId(user.getId())
-                .generateUserId(user.getId())
-                .build();
-        ptProfitLogService.createPtProfitLog(ptProfitLogSaveReqVO);
-
-        // 消费分变动日志
-        ConsumptionChangeLogSaveReqVO changeLogSaveReqVO = ConsumptionChangeLogSaveReqVO.builder()
-                .consumptionPoints(reqVO.getWithdrawConsumption() * DistriConstants.PERCENT)
-                .afterConsumptionPoints(integralDO.getConsumptionPoints())
-                .consumptionStatus(ConsumptionEnum.COMMISSION_WITHDRAWAL.getType())
-                .userId(user.getId())
-                .generateUserId(user.getId())
-                .build();
-        consumptionChangeLogService.createConsumptionChangeLog(changeLogSaveReqVO);
-
-        // 返回
-        return applicationForWithdrawal.getId();
-    }
-
-    @Override
-    public void updateApplicationForWithdrawal(AppApplicationForWithdrawalSaveReqVO updateReqVO) {
-        // 校验存在
-        validateApplicationForWithdrawalExists(updateReqVO.getId());
-        // 更新
-        ApplicationForWithdrawalDO updateObj = BeanUtils.toBean(updateReqVO, ApplicationForWithdrawalDO.class);
-        applicationForWithdrawalMapper.updateById(updateObj);
-    }
-
-    @Override
-    public void deleteApplicationForWithdrawal(Long id) {
-        // 校验存在
-        validateApplicationForWithdrawalExists(id);
-        // 删除
-        applicationForWithdrawalMapper.deleteById(id);
-    }
-
-    private void validateApplicationForWithdrawalExists(Long id) {
-        if (applicationForWithdrawalMapper.selectById(id) == null) {
-            throw exception(APPLICATION_FOR_WITHDRAWAL_NOT_EXISTS);
-        }
-    }
-
-    @Override
-    public ApplicationForWithdrawalDO getApplicationForWithdrawal(Long id) {
-        return applicationForWithdrawalMapper.selectById(id);
-    }
-
-    @Override
-    public PageResult<ApplicationForWithdrawalDO> getApplicationForWithdrawalPage(AppApplicationForWithdrawalPageReqVO pageReqVO) {
-
-        pageReqVO.setUserId(getLoginUserId());
-
-        PageResult<ApplicationForWithdrawalDO> result = applicationForWithdrawalMapper.selectPage(pageReqVO);
-
-        for (ApplicationForWithdrawalDO withdrawalDO : result.getList()) {
-            withdrawalDO.setWithdrawalAccount(formatAccount(withdrawalDO.getWithdrawalAccount()));
-        }
-
-        return result;
-    }
-
-    /**
-     * 格式化账号,只显示前三位和后四位,中间用*代替
-     *
-     * @param account 原始账号字符串
-     * @return 格式化后的账号
-     */
-    private String formatAccount(String account) {
-        if (account == null || account.length() <= 7) {
-            return "****"; // 如果账号长度小于等于7,显示四个星号
-        }
-
-        // 截取前三位
-        String firstPart = account.substring(0, 3);
-        // 截取后四位
-        String lastPart = account.substring(account.length() - 4);
-
-        // 生成中间的*部分
-        String middlePart = "****";
-
-        // 拼接最终的格式化账号
-        return firstPart + middlePart + lastPart;
-    }
-
-}

+ 0 - 61
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/applicationforwithdrawalchannel/ApplicationForWithdrawalChannelService.java

@@ -1,61 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.applicationforwithdrawalchannel;
-
-import javax.validation.*;
-import cn.newfeifan.mall.module.distri.controller.app.applicationforwithdrawalchannel.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.applicationforwithdrawalchannel.ApplicationForWithdrawalChannelDO;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-
-/**
- * 提现渠道记录 Service 接口
- *
- * @author 非繁人
- */
-public interface ApplicationForWithdrawalChannelService {
-
-    /**
-     * 创建提现渠道记录
-     *
-     * @param createReqVO 创建信息
-     * @return 编号
-     */
-    Long createApplicationForWithdrawalChannel(@Valid AppApplicationForWithdrawalChannelSaveReqVO createReqVO);
-
-    /**
-     * 更新提现渠道记录
-     *
-     * @param updateReqVO 更新信息
-     */
-    void updateApplicationForWithdrawalChannel(@Valid AppApplicationForWithdrawalChannelSaveReqVO updateReqVO);
-
-    /**
-     * 删除提现渠道记录
-     *
-     * @param id 编号
-     */
-    void deleteApplicationForWithdrawalChannel(Long id);
-
-    /**
-     * 获得提现渠道记录
-     *
-     * @param id 编号
-     * @return 提现渠道记录
-     */
-    ApplicationForWithdrawalChannelDO getApplicationForWithdrawalChannel(Long id);
-
-    /**
-     * 获得提现渠道记录分页
-     *
-     * @param pageReqVO 分页查询
-     * @return 提现渠道记录分页
-     */
-    PageResult<ApplicationForWithdrawalChannelDO> getApplicationForWithdrawalChannelPage(AppApplicationForWithdrawalChannelPageReqVO pageReqVO);
-
-    /**
-     * 获得提现渠道记录
-     *
-     * @param withdrawalType 渠道类型
-     * @param id
-     * @return 提现渠道记录
-     */
-    ApplicationForWithdrawalChannelDO getApplicationForWithdrawalChannel(Integer withdrawalType, Long id);
-}

+ 0 - 108
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/applicationforwithdrawalchannel/ApplicationForWithdrawalChannelServiceImpl.java

@@ -1,108 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.applicationforwithdrawalchannel;
-
-import cn.newfeifan.mall.module.distri.enums.WithdrawalChannelTypeEnum;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-
-import org.springframework.validation.annotation.Validated;
-
-import cn.newfeifan.mall.module.distri.controller.app.applicationforwithdrawalchannel.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.applicationforwithdrawalchannel.ApplicationForWithdrawalChannelDO;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
-
-import cn.newfeifan.mall.module.distri.dal.mysql.applicationforwithdrawalchannel.ApplicationForWithdrawalChannelMapper;
-
-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 ApplicationForWithdrawalChannelServiceImpl implements ApplicationForWithdrawalChannelService {
-
-    @Resource
-    private ApplicationForWithdrawalChannelMapper applicationForWithdrawalChannelMapper;
-
-    @Override
-    public Long createApplicationForWithdrawalChannel(AppApplicationForWithdrawalChannelSaveReqVO createReqVO) {
-        // 插入
-        ApplicationForWithdrawalChannelDO applicationForWithdrawalChannel = BeanUtils.toBean(createReqVO, ApplicationForWithdrawalChannelDO.class);
-        applicationForWithdrawalChannelMapper.insert(applicationForWithdrawalChannel);
-        // 返回
-        return applicationForWithdrawalChannel.getId();
-    }
-
-    @Override
-    public void updateApplicationForWithdrawalChannel(AppApplicationForWithdrawalChannelSaveReqVO updateReqVO) {
-        // 校验存在
-        validateApplicationForWithdrawalChannelExists(updateReqVO.getId());
-        // 更新
-        ApplicationForWithdrawalChannelDO updateObj = BeanUtils.toBean(updateReqVO, ApplicationForWithdrawalChannelDO.class);
-        applicationForWithdrawalChannelMapper.updateById(updateObj);
-    }
-
-    @Override
-    public void deleteApplicationForWithdrawalChannel(Long id) {
-        // 校验存在
-        validateApplicationForWithdrawalChannelExists(id);
-        // 删除
-        applicationForWithdrawalChannelMapper.deleteById(id);
-    }
-
-    private void validateApplicationForWithdrawalChannelExists(Long id) {
-        if (applicationForWithdrawalChannelMapper.selectById(id) == null) {
-            throw exception(APPLICATION_FOR_WITHDRAWAL_CHANNEL_NOT_EXISTS);
-        }
-    }
-
-    @Override
-    public ApplicationForWithdrawalChannelDO getApplicationForWithdrawalChannel(Long id) {
-        return applicationForWithdrawalChannelMapper.selectById(id);
-    }
-
-    @Override
-    public PageResult<ApplicationForWithdrawalChannelDO> getApplicationForWithdrawalChannelPage(AppApplicationForWithdrawalChannelPageReqVO pageReqVO) {
-        return applicationForWithdrawalChannelMapper.selectPage(pageReqVO);
-    }
-
-    @Override
-    public ApplicationForWithdrawalChannelDO getApplicationForWithdrawalChannel(Integer withdrawalType, Long id) {
-
-        // 先查看有没有该渠道的记录
-        LambdaQueryWrapper<ApplicationForWithdrawalChannelDO> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(ApplicationForWithdrawalChannelDO::getPtDailyWithdrawalId, id);
-        if(WithdrawalChannelTypeEnum.ALIPAY.getType().equals(withdrawalType) || WithdrawalChannelTypeEnum.BANK.getType().equals(withdrawalType)){
-            wrapper.and(
-                    w -> w.eq(ApplicationForWithdrawalChannelDO::getWithdrawalType, WithdrawalChannelTypeEnum.ALIPAY.getType())
-                            .or()
-                            .eq(ApplicationForWithdrawalChannelDO::getWithdrawalType, WithdrawalChannelTypeEnum.BANK.getType())
-            );
-        }
-        ApplicationForWithdrawalChannelDO applicationForWithdrawalChannelDO = applicationForWithdrawalChannelMapper.selectOne(wrapper);
-
-        // 没有就插入
-        if (applicationForWithdrawalChannelDO == null) {
-            applicationForWithdrawalChannelDO = ApplicationForWithdrawalChannelDO.builder()
-                    .withdrawalType(withdrawalType)
-                    .ptDailyWithdrawalId(id)
-                    .build();
-
-            if(WithdrawalChannelTypeEnum.ALIPAY.getType().equals(withdrawalType) || WithdrawalChannelTypeEnum.BANK.getType().equals(withdrawalType)){
-                applicationForWithdrawalChannelDO.setWithdrawalName(WithdrawalChannelTypeEnum.getName(WithdrawalChannelTypeEnum.ALIPAY.getType()) + "/" + WithdrawalChannelTypeEnum.getName(WithdrawalChannelTypeEnum.BANK.getType()));
-            }
-
-            applicationForWithdrawalChannelMapper.insert(applicationForWithdrawalChannelDO);
-            return applicationForWithdrawalChannelMapper.selectById(applicationForWithdrawalChannelDO.getId());
-        }
-
-        return applicationForWithdrawalChannelDO;
-    }
-
-}

+ 0 - 56
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/consumptionchangelog/ConsumptionChangeLogService.java

@@ -1,56 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.consumptionchangelog;
-
-import javax.validation.*;
-
-import cn.newfeifan.mall.module.distri.controller.app.consumptionchangelog.vo.ConsumptionChangeLogPageReqVO;
-import cn.newfeifan.mall.module.distri.controller.app.consumptionchangelog.vo.ConsumptionChangeLogRespVO;
-import cn.newfeifan.mall.module.distri.controller.app.consumptionchangelog.vo.ConsumptionChangeLogSaveReqVO;
-import cn.newfeifan.mall.module.distri.dal.dataobject.consumptionchangelog.ConsumptionChangeLogDO;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-
-/**
- * 平台消费分变动记录 Service 接口
- *
- * @author 非繁人
- */
-public interface ConsumptionChangeLogService {
-
-    /**
-     * 创建平台消费分变动记录
-     *
-     * @param createReqVO 创建信息
-     * @return 编号
-     */
-    Long createConsumptionChangeLog(@Valid ConsumptionChangeLogSaveReqVO createReqVO);
-
-    /**
-     * 更新平台消费分变动记录
-     *
-     * @param updateReqVO 更新信息
-     */
-    void updateConsumptionChangeLog(@Valid ConsumptionChangeLogSaveReqVO updateReqVO);
-
-    /**
-     * 删除平台消费分变动记录
-     *
-     * @param id 编号
-     */
-    void deleteConsumptionChangeLog(Long id);
-
-    /**
-     * 获得平台消费分变动记录
-     *
-     * @param id 编号
-     * @return 平台消费分变动记录
-     */
-    ConsumptionChangeLogDO getConsumptionChangeLog(Long id);
-
-    /**
-     * 获得平台消费分变动记录分页
-     *
-     * @param pageReqVO 分页查询
-     * @return 平台消费分变动记录分页
-     */
-    PageResult<ConsumptionChangeLogRespVO> getConsumptionChangeLogPage(ConsumptionChangeLogPageReqVO pageReqVO);
-
-}

+ 0 - 92
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/consumptionchangelog/ConsumptionChangeLogServiceImpl.java

@@ -1,92 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.consumptionchangelog;
-
-import cn.newfeifan.mall.module.distri.controller.app.consumptionchangelog.vo.ConsumptionChangeLogPageReqVO;
-import cn.newfeifan.mall.module.distri.controller.app.consumptionchangelog.vo.ConsumptionChangeLogRespVO;
-import cn.newfeifan.mall.module.distri.controller.app.consumptionchangelog.vo.ConsumptionChangeLogSaveReqVO;
-import cn.newfeifan.mall.module.distri.enums.ConsumptionEnum;
-import cn.newfeifan.mall.module.member.dal.dataobject.user.MemberUserDO;
-import cn.newfeifan.mall.module.member.service.user.MemberUserService;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-
-import org.springframework.validation.annotation.Validated;
-
-import cn.newfeifan.mall.module.distri.dal.dataobject.consumptionchangelog.ConsumptionChangeLogDO;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
-
-import cn.newfeifan.mall.module.distri.dal.mysql.consumptionchangelog.ConsumptionChangeLogMapper;
-
-import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
-import static cn.newfeifan.mall.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
-import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
-
-/**
- * 平台消费分变动记录 Service 实现类
- *
- * @author 非繁人
- */
-@Service
-@Validated
-public class ConsumptionChangeLogServiceImpl implements ConsumptionChangeLogService {
-
-    @Resource
-    private ConsumptionChangeLogMapper consumptionChangeLogMapper;
-
-    @Resource
-    private MemberUserService memberUserService;
-
-    @Override
-    public Long createConsumptionChangeLog(ConsumptionChangeLogSaveReqVO createReqVO) {
-        // 插入
-        ConsumptionChangeLogDO consumptionChangeLog = BeanUtils.toBean(createReqVO, ConsumptionChangeLogDO.class);
-        consumptionChangeLogMapper.insert(consumptionChangeLog);
-        // 返回
-        return consumptionChangeLog.getId();
-    }
-
-    @Override
-    public void updateConsumptionChangeLog(ConsumptionChangeLogSaveReqVO updateReqVO) {
-        // 校验存在
-        validateConsumptionChangeLogExists(updateReqVO.getId());
-        // 更新
-        ConsumptionChangeLogDO updateObj = BeanUtils.toBean(updateReqVO, ConsumptionChangeLogDO.class);
-        consumptionChangeLogMapper.updateById(updateObj);
-    }
-
-    @Override
-    public void deleteConsumptionChangeLog(Long id) {
-        // 校验存在
-        validateConsumptionChangeLogExists(id);
-        // 删除
-        consumptionChangeLogMapper.deleteById(id);
-    }
-
-    private void validateConsumptionChangeLogExists(Long id) {
-        if (consumptionChangeLogMapper.selectById(id) == null) {
-            throw exception(CONSUMPTION_CHANGE_LOG_NOT_EXISTS);
-        }
-    }
-
-    @Override
-    public ConsumptionChangeLogDO getConsumptionChangeLog(Long id) {
-        return consumptionChangeLogMapper.selectById(id);
-    }
-
-    @Override
-    public PageResult<ConsumptionChangeLogRespVO> getConsumptionChangeLogPage(ConsumptionChangeLogPageReqVO pageReqVO) {
-        pageReqVO.setUserId(getLoginUserId());
-        PageResult<ConsumptionChangeLogRespVO> bean = BeanUtils.toBean(consumptionChangeLogMapper.selectPage(pageReqVO), ConsumptionChangeLogRespVO.class);
-
-        for (ConsumptionChangeLogRespVO consumptionChangeLogRespVO : bean.getList()) {
-            consumptionChangeLogRespVO.setConsumptionStatusName(ConsumptionEnum.getName(consumptionChangeLogRespVO.getConsumptionStatus()));
-            if(consumptionChangeLogRespVO.getGenerateUserId() != null){
-                MemberUserDO user = memberUserService.getUser(consumptionChangeLogRespVO.getGenerateUserId());
-                consumptionChangeLogRespVO.setGenerateUserName(user.getUsername());
-            }
-        }
-        return bean;
-    }
-
-}

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

@@ -1,55 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.consumptiontransferlog;
-
-import javax.validation.*;
-
-import cn.newfeifan.mall.module.distri.controller.app.consumptiontransferlog.vo.ConsumptionTransferLogPageReqVO;
-import cn.newfeifan.mall.module.distri.controller.app.consumptiontransferlog.vo.ConsumptionTransferLogSaveReqVO;
-import cn.newfeifan.mall.module.distri.dal.dataobject.consumptiontransferlog.ConsumptionTransferLogDO;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-
-/**
- * 消费分转让记录 Service 接口
- *
- * @author 非繁人
- */
-public interface ConsumptionTransferLogService {
-
-    /**
-     * 创建消费分转让记录
-     *
-     * @param createReqVO 创建信息
-     * @return 编号
-     */
-    Long createConsumptionTransferLog(@Valid ConsumptionTransferLogSaveReqVO createReqVO);
-
-    /**
-     * 更新消费分转让记录
-     *
-     * @param updateReqVO 更新信息
-     */
-    void updateConsumptionTransferLog(@Valid ConsumptionTransferLogSaveReqVO updateReqVO);
-
-    /**
-     * 删除消费分转让记录
-     *
-     * @param id 编号
-     */
-    void deleteConsumptionTransferLog(Long id);
-
-    /**
-     * 获得消费分转让记录
-     *
-     * @param id 编号
-     * @return 消费分转让记录
-     */
-    ConsumptionTransferLogDO getConsumptionTransferLog(Long id);
-
-    /**
-     * 获得消费分转让记录分页
-     *
-     * @param pageReqVO 分页查询
-     * @return 消费分转让记录分页
-     */
-    PageResult<ConsumptionTransferLogDO> getConsumptionTransferLogPage(ConsumptionTransferLogPageReqVO pageReqVO);
-
-}

+ 0 - 164
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/consumptiontransferlog/ConsumptionTransferLogServiceImpl.java

@@ -1,164 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.consumptiontransferlog;
-
-import cn.newfeifan.mall.framework.common.exception.ErrorCode;
-import cn.newfeifan.mall.module.distri.constant.DistriConstants;
-import cn.newfeifan.mall.module.distri.controller.app.consumptionchangelog.vo.ConsumptionChangeLogSaveReqVO;
-import cn.newfeifan.mall.module.distri.controller.app.consumptiontransferlog.vo.ConsumptionTransferLogPageReqVO;
-import cn.newfeifan.mall.module.distri.controller.app.consumptiontransferlog.vo.ConsumptionTransferLogSaveReqVO;
-import cn.newfeifan.mall.module.distri.controller.app.integral.vo.IntegralSaveReqVO;
-import cn.newfeifan.mall.module.distri.dal.dataobject.integral.IntegralDO;
-import cn.newfeifan.mall.module.distri.enums.ConsumptionEnum;
-import cn.newfeifan.mall.module.distri.service.consumptionchangelog.ConsumptionChangeLogService;
-import cn.newfeifan.mall.module.distri.service.integral.IntegralService;
-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.api.sms.dto.code.SmsCodeSendReqDTO;
-import cn.newfeifan.mall.module.system.enums.sms.SmsSceneEnum;
-import cn.newfeifan.mall.module.system.service.sms.SmsCodeService;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.validation.annotation.Validated;
-
-import cn.newfeifan.mall.module.distri.dal.dataobject.consumptiontransferlog.ConsumptionTransferLogDO;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
-
-import cn.newfeifan.mall.module.distri.dal.mysql.consumptiontransferlog.ConsumptionTransferLogMapper;
-
-import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
-import static cn.newfeifan.mall.framework.common.util.servlet.ServletUtils.getClientIP;
-import static cn.newfeifan.mall.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
-import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
-
-/**
- * 消费分转让记录 Service 实现类
- *
- * @author 非繁人
- */
-@Service
-@Validated
-public class ConsumptionTransferLogServiceImpl implements ConsumptionTransferLogService {
-
-    @Resource
-    private ConsumptionTransferLogMapper consumptionTransferLogMapper;
-
-    @Resource
-    private SmsCodeService smsCodeService;
-
-    @Resource
-    private IntegralService integralService;
-
-    @Resource
-    private ConsumptionChangeLogService consumptionChangeLogService;
-
-    @Resource
-    private MemberUserService memberUserService;
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public Long createConsumptionTransferLog(ConsumptionTransferLogSaveReqVO createReqVO) {
-        // 自己不能转账自己
-        Long loginUserId = getLoginUserId();
-        if (loginUserId != null && loginUserId.equals(createReqVO.getRecipientUserId())) {
-            ErrorCode ERROR = new ErrorCode(1_002_030_037, "自己不能转账给自己");
-            throw exception(ERROR);
-        }
-
-        // 短信验证码校验
-        smsCodeService.useSmsCode(createReqVO.getSmsCodeUseReqDTO().setUsedIp(getClientIP()));
-        // 消费分转成数据库存储的单位
-        createReqVO.setConsumptionPoints(createReqVO.getConsumptionPoints() * DistriConstants.INTEGRAL_PAGE2DB);
-        createReqVO.setTransferUserId(loginUserId);
-        MemberUserDO user = memberUserService.getUser(loginUserId);
-        createReqVO.setTransferUserName(user.getUsername());
-
-        // 转让人钱包
-        IntegralDO transferIntegral = integralService.selectByUser(createReqVO.getTransferUserId());
-        transferIntegral.setConsumptionPoints(transferIntegral.getConsumptionPoints() - createReqVO.getConsumptionPoints());
-        integralService.updateIntegral(BeanUtils.toBean(transferIntegral, IntegralSaveReqVO.class));
-        // 接收人钱包
-        IntegralDO recipientIntegral = integralService.selectByUser(createReqVO.getRecipientUserId());
-
-        // 记录变动日志
-        consumptionChangeLogService.createConsumptionChangeLog(
-                ConsumptionChangeLogSaveReqVO.builder()
-                        .userId(transferIntegral.getUserId())
-                        .consumptionPoints(-createReqVO.getConsumptionPoints())
-                        .afterConsumptionPoints(transferIntegral.getConsumptionPoints())
-                        .consumptionStatus(ConsumptionEnum.CONSUMPTION_TRANSFER.getType())
-                        .generateUserId(recipientIntegral.getUserId())
-                        .build()
-        );
-
-        recipientIntegral.setConsumptionPoints(recipientIntegral.getConsumptionPoints() + createReqVO.getConsumptionPoints());
-        integralService.updateIntegral(BeanUtils.toBean(recipientIntegral, IntegralSaveReqVO.class));
-
-        // 记录变动日志
-        consumptionChangeLogService.createConsumptionChangeLog(
-                ConsumptionChangeLogSaveReqVO.builder()
-                        .userId(recipientIntegral.getUserId())
-                        .consumptionPoints(createReqVO.getConsumptionPoints())
-                        .afterConsumptionPoints(recipientIntegral.getConsumptionPoints())
-                        .consumptionStatus(ConsumptionEnum.CONSUMPTION_RECIPIENT.getType())
-                        .generateUserId(transferIntegral.getUserId())
-                        .build()
-        );
-
-        // 插入
-        ConsumptionTransferLogDO consumptionTransferLog = BeanUtils.toBean(createReqVO, ConsumptionTransferLogDO.class);
-        consumptionTransferLog.setConsumptionPoints(-consumptionTransferLog.getConsumptionPoints());
-        consumptionTransferLog.setRecipientPoints(-consumptionTransferLog.getConsumptionPoints());
-        consumptionTransferLog.setAfterTransferConsumptionPoints(transferIntegral.getConsumptionPoints());
-        consumptionTransferLog.setAfterRecipientConsumptionPoints(recipientIntegral.getConsumptionPoints());
-        consumptionTransferLogMapper.insert(consumptionTransferLog);
-
-        // 发送短信到接收者
-        MemberUserDO receiverUser = memberUserService.getUser(createReqVO.getRecipientUserId());
-        smsCodeService.sendSmsCode(new SmsCodeSendReqDTO()
-                .setMobile(receiverUser.getMobile())
-                .setScene(SmsSceneEnum.CONSUMPTION_POINTS_TRANSFER_INFORM.getScene())
-                .setCreateIp(getClientIP())
-                .setName(user.getUsername())
-                .setMoney(createReqVO.getConsumptionPoints() / DistriConstants.INTEGRAL_PAGE2DB));
-        // 返回
-        return consumptionTransferLog.getId();
-    }
-
-    @Override
-    public void updateConsumptionTransferLog(ConsumptionTransferLogSaveReqVO updateReqVO) {
-        // 校验存在
-        validateConsumptionTransferLogExists(updateReqVO.getId());
-        // 更新
-        ConsumptionTransferLogDO updateObj = BeanUtils.toBean(updateReqVO, ConsumptionTransferLogDO.class);
-        consumptionTransferLogMapper.updateById(updateObj);
-    }
-
-    @Override
-    public void deleteConsumptionTransferLog(Long id) {
-        // 校验存在
-        validateConsumptionTransferLogExists(id);
-        // 删除
-        consumptionTransferLogMapper.deleteById(id);
-    }
-
-    private void validateConsumptionTransferLogExists(Long id) {
-        if (consumptionTransferLogMapper.selectById(id) == null) {
-            throw exception(CONSUMPTION_TRANSFER_LOG_NOT_EXISTS);
-        }
-    }
-
-    @Override
-    public ConsumptionTransferLogDO getConsumptionTransferLog(Long id) {
-        return consumptionTransferLogMapper.selectById(id);
-    }
-
-    @Override
-    public PageResult<ConsumptionTransferLogDO> getConsumptionTransferLogPage(ConsumptionTransferLogPageReqVO pageReqVO) {
-        pageReqVO.setTransferUserId(getLoginUserId());
-        return consumptionTransferLogMapper.selectPage(pageReqVO);
-    }
-
-}

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

@@ -1,10 +1,7 @@
 package cn.newfeifan.mall.module.distri.service.duser;
 
-import javax.validation.*;
 import cn.newfeifan.mall.module.distri.controller.admin.duser.vo.*;
-import cn.newfeifan.mall.module.distri.controller.app.sharepath.vo.SharePathSaveReqVO;
 import cn.newfeifan.mall.module.distri.dal.dataobject.duser.DuserDO;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
 
 /**
  * 推荐用户 Service 接口
@@ -13,46 +10,6 @@ import cn.newfeifan.mall.framework.common.pojo.PageResult;
  */
 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);
     void hasUserAndCreat(Long userId);
 
     DuserInfoVO getDuserInfo(Long userId);

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

@@ -3,14 +3,12 @@ package cn.newfeifan.mall.module.distri.service.duser;
 import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.newfeifan.mall.module.distri.controller.app.integral.vo.IntegralSaveReqVO;
 import cn.newfeifan.mall.module.distri.controller.admin.socialstatus.bo.SocialStatusBO;
-import cn.newfeifan.mall.module.distri.controller.app.sharepath.vo.SharePathSaveReqVO;
 import cn.newfeifan.mall.module.distri.dal.dataobject.integral.IntegralDO;
 import cn.newfeifan.mall.module.distri.dal.dataobject.orderpercentage.OrderPercentageDO;
 import cn.newfeifan.mall.module.distri.dal.dataobject.socialstatus.SocialStatusDO;
 import cn.newfeifan.mall.module.distri.dal.mysql.orderpercentage.OrderPercentageMapper;
 import cn.newfeifan.mall.module.distri.enums.SocialStatusEnum;
 import cn.newfeifan.mall.module.distri.service.integral.IntegralService;
-import cn.newfeifan.mall.module.distri.service.orderpercentage.OrderPercentageService;
 import cn.newfeifan.mall.module.distri.service.ptprofitlog.PtProfitLogService;
 import cn.newfeifan.mall.module.distri.service.sharepath.SharePathService;
 import cn.newfeifan.mall.module.distri.service.socialstatus.SocialStatusService;
@@ -19,6 +17,7 @@ import cn.newfeifan.mall.module.member.dal.dataobject.user.MemberUserDO;
 import cn.newfeifan.mall.module.member.service.signin.MemberSignInRecordService;
 import cn.newfeifan.mall.module.member.service.user.MemberUserService;
 import cn.newfeifan.mall.module.system.service.user.AdminUserService;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -28,12 +27,10 @@ import org.springframework.validation.annotation.Validated;
 
 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.util.object.BeanUtils;
 
 import cn.newfeifan.mall.module.distri.dal.mysql.duser.DuserMapper;
 
-import java.math.BigDecimal;
 import java.util.List;
 import java.util.Objects;
 
@@ -74,62 +71,13 @@ public class DuserServiceImpl implements DuserService {
     @Resource
     private AdminUserService adminUserService;
 
-    @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
+    @Lazy
     private IntegralService integralService;
 
     @Resource
     private SocialStatusService socialStatusService;
 
-    @Resource
-    private OrderPercentageService orderPercentageService;
-
-    @Override
-    public void hasUserAndCreat(SharePathSaveReqVO saveReqVO) {
-        checkAndCreat(saveReqVO.getDescendant());
-        checkAndCreat(saveReqVO.getAncestor());
-    }
 
     @Override
     public void hasUserAndCreat(Long userId) {
@@ -153,17 +101,13 @@ public class DuserServiceImpl implements DuserService {
             throw exception(INTEGRAL_NOT_EXISTS);
         }
 
-        OrderPercentageDO orderPercentageDO = orderPercentageService.queryStatus();
-        integral.setHighQuota(integral.getHighQuota());
-        integral.setHighQuotaTotal(integral.getHighQuotaTotal() + new BigDecimal(orderPercentageDO.getBaseMaxQuota()).longValue());
-
         DuserInfoVO.DuserInfoVOBuilder duserInfoVOBuilder = DuserInfoVO.builder()
                 .integralDO(integral)
                 .descNo(sonsId.size());
 
         String yesterday = "0";
         String totalLog = "0";
-        if (sonsId.size() > 0) {
+        if (!sonsId.isEmpty()) {
             // 获取昨日贡献值 + 合赢奖
             yesterday = ptProfitLogService.getYesterdayLog(sonsId);
             totalLog = ptProfitLogService.getTotalLog(sonsId);
@@ -185,6 +129,7 @@ public class DuserServiceImpl implements DuserService {
                 .isPtSystemUser(isPtSystemUser)
                 .isShSystemUser(isShSystemUser)
                 .androidRegisterId(memberUserService.getUser(userId).getAndroidRegisterId())
+                .categoryId(duser.getCategoryId())
                 .build();
 
     }
@@ -197,11 +142,9 @@ public class DuserServiceImpl implements DuserService {
         if (integralDO == null) {
             // 创建一个钱包
             IntegralSaveReqVO integralSaveReqVO = IntegralSaveReqVO.builder()
-                    .currentQuota(0L)
-                    .nickName(user.getNickname())
-                    .name(user.getName())
+                    .userName(user.getUsername())
+                    .redCurrentQuota(0L)
                     .freezeQuota(0L)
-                    .categoryId(3L)
                     .userId(userId).build();
             Long integralId = integralService.createIntegral(integralSaveReqVO);
             integralDO = new IntegralDO().setId(integralId);
@@ -213,9 +156,8 @@ public class DuserServiceImpl implements DuserService {
             // 创建一个新的营销用户
             DuserSaveReqVO duserSaveReqVO = DuserSaveReqVO.builder()
                     .userId(userId)
+                    .userName(user.getUsername())
                     .mobile(user.getMobile())
-                    .name(user.getName())
-                    .nickName(user.getNickname())
                     .integralId(integralDO.getId())
                     .source(userId)
                     .socialStatusPoint(Long.valueOf(orderPercentageDO.getRegisterSocialStatus()))

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

@@ -3,10 +3,8 @@ package cn.newfeifan.mall.module.distri.service.integral;
 import javax.validation.*;
 import cn.newfeifan.mall.module.distri.controller.app.integral.vo.*;
 import cn.newfeifan.mall.module.distri.dal.dataobject.integral.IntegralDO;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
 import cn.newfeifan.mall.module.distri.enums.CaclEnum;
-import cn.newfeifan.mall.module.distri.enums.ConsumptionEnum;
-import cn.newfeifan.mall.module.distri.enums.SocialStatusUpdateEnum;
+import cn.newfeifan.mall.module.distri.enums.IntegralEnum;
 
 /**
  * 推荐用户积分 Service 接口
@@ -30,13 +28,6 @@ public interface IntegralService {
      */
     void updateIntegral(@Valid IntegralSaveReqVO updateReqVO);
 
-    /**
-     * 删除推荐用户积分
-     *
-     * @param id 编号
-     */
-    void deleteIntegral(Long id);
-
     /**
      * 获得推荐用户积分
      *
@@ -45,18 +36,8 @@ public interface IntegralService {
      */
     IntegralDO getIntegral(Long id);
 
-    /**
-     * 获得推荐用户积分分页
-     *
-     * @param pageReqVO 分页查询
-     * @return 推荐用户积分分页
-     */
-    PageResult<IntegralDO> getIntegralPage(IntegralPageReqVO pageReqVO);
-
     /**
      * 根据用户ID查询是否有钱包
-     * @param descendant
-     * @return
      */
     IntegralDO selectByUser(Long descendant);
 
@@ -66,38 +47,27 @@ public interface IntegralService {
      *
      * @param generateUserId 导致产生积分变动的用户ID
      * @param userId 要修改积分的用户
-     * @param caclEnum 导致积分变化的事件类型枚举
+     * @param integralEnum 导致积分变化的事件类型枚举
      * @param amount 用户积分变化金额,可为负数
-     * @param freezeAmount 用户冻结积分变化金额,可为负数
-     * @return 返回是否执行成功。执行失败,通常是就是用户积分不足,没积分抵扣
      */
-    Boolean updateUserIntegral(Long generateUserId,//导致产生积分变动的用户ID
-            Long userId, CaclEnum caclEnum, Long amount, Long freezeAmount,
-                               Long tradeOrderId,
-                               String orderNum
+    void updateUserIntegral(Long generateUserId,//导致产生积分变动的用户ID
+                            Long userId, IntegralEnum integralEnum, Long amount,
+                            Long tradeOrderId,
+                            String orderNum,
+                            Integer integralType,
+                            Long highQuota
                                );
 
     /**
-     * 修改用户身价
-     * @param userId 用户ID
-     * @param socialStatusUpdateEnum 身价变动类别
-     * @param socialStatusPoint 身价变化值
-     * @param ObjectId 导致身价变动的对应业务对象ID,如订单ID、收藏记录ID、新注册用户ID等
-     * @return 升级后的身价名称,如果返回null,表明没升级
-     */
-    String updateUserSocialStatus(Long userId, SocialStatusUpdateEnum socialStatusUpdateEnum, Integer socialStatusPoint,
-                                   Long ObjectId);
-
-    /**
-     * 修改用户身价
-     * @param generateUserId 导致产生积分变动的用户ID
-     * @param userId 身价变动类别
-     * @param caclEnum 变化类型
-     * @param totalFreezeHighQuota 冻结峰值
-     * @param tradeOrderId 订单ID
-     * @param orderNum 订单号
+     * 增加用户的直推奖
+     * @param generateUserId 奖金来源用户
+     * @param userId 用户id
+     * @param integralEnum  奖项类别
+     * @param amount 额度
+     * @param orderId 订单id
+     * @param orderNo 订单编号
      */
-    void updateIntegralFreezeHighQuota(Long generateUserId, Long userId, CaclEnum caclEnum, Long totalFreezeHighQuota, Long tradeOrderId, String orderNum);
+    void updateUserIntegralByBonus(Long generateUserId, Long userId,IntegralEnum integralEnum, Long amount, Long orderId,String orderNo);
 
     /**
      * 修改用户积分
@@ -109,26 +79,11 @@ public interface IntegralService {
      */
     void updateUserIntegral(Long userId, CaclEnum caclEnum, Long payIntegral, Long tradeOrderId, String orderNum);
 
-    /**
-     * 修改用户消费积分
-     * @param userId 用户id
-     * @param consumptionEnum 类型
-     * @param consumptionPoints 消费分
-     * @param orderId 订单id
-     * @param orderNum 订单号
-     */
-    void updateUserConsumptionPoints(Long userId, ConsumptionEnum consumptionEnum, Long consumptionPoints, Long orderId, String orderNum);
-
     /**
      * 佣金转化
-     * @param quota 佣金
+     *
+     * @param respVO 积分类型
      * @return 结果
      */
-    Boolean quotaTransition(Long quota);
-
-    Boolean updateUserConsumptionPoints(Long generateUserId,//导致产生积分变动的用户ID
-                                        Long userId, Long amount,
-                                        Long tradeOrderId,
-                                        String orderNum
-    );
+    Boolean quotaTransition(IntegralTransitionRespVO respVO);
 }

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

@@ -1,19 +1,26 @@
 package cn.newfeifan.mall.module.distri.service.integral;
 
-import cn.newfeifan.mall.framework.common.exception.ErrorCode;
 import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.newfeifan.mall.module.distri.constant.DistriConstants;
-import cn.newfeifan.mall.module.distri.controller.app.consumptionchangelog.vo.ConsumptionChangeLogSaveReqVO;
+import cn.newfeifan.mall.module.distri.controller.app.integralchangelog.vo.IntegralChangeLogSaveReqVO;
 import cn.newfeifan.mall.module.distri.controller.app.ptprofitlog.vo.PtProfitLogSaveReqVO;
 import cn.newfeifan.mall.module.distri.dal.dataobject.duser.DuserDO;
-import cn.newfeifan.mall.module.distri.dal.mysql.duser.DuserMapper;
+import cn.newfeifan.mall.module.distri.dal.dataobject.orderpercentage.OrderPercentageDO;
+import cn.newfeifan.mall.module.distri.dal.dataobject.ptprofit.PtProfitDO;
 import cn.newfeifan.mall.module.distri.dal.mysql.ptprofit.PtProfitMapper;
 import cn.newfeifan.mall.module.distri.enums.CaclEnum;
-import cn.newfeifan.mall.module.distri.enums.ConsumptionEnum;
-import cn.newfeifan.mall.module.distri.enums.SocialStatusUpdateEnum;
-import cn.newfeifan.mall.module.distri.service.consumptionchangelog.ConsumptionChangeLogService;
+import cn.newfeifan.mall.module.distri.enums.IntegralEnum;
+import cn.newfeifan.mall.module.distri.enums.IntegralTypeEnum;
+import cn.newfeifan.mall.module.distri.enums.ProfitTypeEnum;
+import cn.newfeifan.mall.module.distri.service.integralchangelog.IntegralChangeLogService;
+import cn.newfeifan.mall.module.distri.service.duser.DuserService;
+import cn.newfeifan.mall.module.distri.service.orderpercentage.OrderPercentageService;
 import cn.newfeifan.mall.module.distri.service.ptprofitlog.PtProfitLogService;
+import cn.newfeifan.mall.module.member.dal.dataobject.user.MemberUserDO;
+import cn.newfeifan.mall.module.member.service.user.MemberUserService;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -24,7 +31,6 @@ import java.util.*;
 
 import cn.newfeifan.mall.module.distri.controller.app.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.util.object.BeanUtils;
 
 import cn.newfeifan.mall.module.distri.dal.mysql.integral.IntegralMapper;
@@ -32,6 +38,8 @@ 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.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
 import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
+import static cn.newfeifan.mall.module.member.enums.ErrorCodeConstants.USER_NOT_PAY_PASSWORD;
+import static cn.newfeifan.mall.module.member.enums.ErrorCodeConstants.USER_PAY_PASS_WORD_ERROR;
 
 /**
  * 推荐用户积分 Service 实现类
@@ -42,20 +50,23 @@ import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
 @Validated
 public class IntegralServiceImpl implements IntegralService {
 
-    @Resource
-    private DuserMapper duserMapper;
-
     @Resource
     private IntegralMapper integralMapper;
-
     @Resource
     private PtProfitMapper ptProfitMapper;
-
     @Resource
     private PtProfitLogService ptProfitLogService;
-
     @Resource
-    private ConsumptionChangeLogService consumptionChangeLogService;
+    private IntegralChangeLogService integralChangeLogService;
+    @Resource
+    private OrderPercentageService orderPercentageService;
+    @Resource
+    @Lazy
+    private DuserService duserService;
+    @Resource
+    private MemberUserService memberUserService;
+    @Resource
+    private PasswordEncoder passwordEncoder;
 
     @Override
     public Long createIntegral(IntegralSaveReqVO createReqVO) {
@@ -75,14 +86,6 @@ public class IntegralServiceImpl implements IntegralService {
         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);
@@ -91,12 +94,7 @@ public class IntegralServiceImpl implements IntegralService {
 
     @Override
     public IntegralDO getIntegral(Long id) {
-        return integralMapper.selectOne(new LambdaQueryWrapperX<IntegralDO>().eq(IntegralDO::getUserId,id));
-    }
-
-    @Override
-    public PageResult<IntegralDO> getIntegralPage(IntegralPageReqVO pageReqVO) {
-        return integralMapper.selectPage(pageReqVO);
+        return integralMapper.selectOne(new LambdaQueryWrapperX<IntegralDO>().eq(IntegralDO::getUserId, id));
     }
 
     @Override
@@ -104,195 +102,323 @@ public class IntegralServiceImpl implements IntegralService {
         return integralMapper.selectOne(new LambdaQueryWrapper<IntegralDO>().eq(IntegralDO::getUserId, descendant));
     }
 
+    private void verifyUserIntegral(Long userIntegral, Long useIntegral) {
+        if (userIntegral < useIntegral) {
+            throw exception(USER_INTEGRAL_LESS_TRANSITION_INTEGRAL);
+        }
+    }
+
     /**
      * add by Ben
      * 修改用户积分
      *
      * @param generateUserId 要修改积分的用户
-     * @param userId 要修改积分的用户
-     * @param caclEnum 导致积分变化的事件类型枚举
-     * @param amount 用户可用积分变化金额,可为负数
-     * @param freezeAmount 用户冻结积分变化金额,可为负数
+     * @param userId         要修改积分的用户
+     * @param integralEnum       导致积分变化的事件类型枚举
+     * @param amount         用户可用积分变化金额,可为负数
      * @return 返回是否执行成功。执行失败,通常是就是用户积分不足,没积分抵扣
      */
     @Override
-    public Boolean updateUserIntegral(Long generateUserId,//导致产生积分变动的用户ID
-            Long userId, CaclEnum caclEnum, Long amount, Long freezeAmount,
-                                      Long tradeOrderId,
-                                      String OrderNum
-                                      ) {
-        Boolean success = null;
-
-        //修改用户积分钱包的积分
-        int effectRowNum = ptProfitMapper.updateUserIntegral(amount,amount,freezeAmount,freezeAmount,userId);
-
-        if (effectRowNum==1) {//如果成功修改积分记录
-            success = true;
-
-            //用户修改后的当前可用的钱包余额
-            Long afterAmount = null;
-            //用户修改后的冻结积分钱包余额
-            Long afterFreezeAmount = null;
-
-            //查询用户修改后的积分
-            Map<String, Object> map = ptProfitMapper.selectUserIntegral(userId);
-            Object currentQuotaObj = map.get("current_quota");
-            Object freezeQuotaObj = map.get("freeze_quota");
-
-            afterAmount = (Long)currentQuotaObj;
-            afterFreezeAmount = (Long)freezeQuotaObj;
-
-//            if(afterAmount<0||afterFreezeAmount<0){
-//                throw new RuntimeException("用户钱包为负数:用户IO为"+userId+"的用户可用钱包为"+afterAmount+",冻结钱包为"+afterFreezeAmount);
-//            }
-
-            //记录用户的积分变动日志
-            ptProfitLogService.addMessage(generateUserId,//导致产生积分变动的用户ID
-                    userId, caclEnum, amount, afterAmount,
-                    freezeAmount, afterFreezeAmount,null,tradeOrderId,OrderNum);
-
-        }else if(effectRowNum<1){//如果钱包积分不足,不够抵扣
-            success = false;
-        } else if (effectRowNum>1) {
-//            success = false;
-            throw new RuntimeException("用户IO为"+userId+"的用户钱包不只一个!");
+    public void updateUserIntegral(Long generateUserId,//导致产生积分变动的用户ID
+                                   Long userId, IntegralEnum integralEnum, Long amount,
+                                   Long tradeOrderId,
+                                   String OrderNum,
+                                   Integer integralType,
+                                   Long highQuota
+    ) {
+        if (amount == null || amount == 0L) return;
+
+        // 用户钱包
+        IntegralDO integralDO = integralMapper.selectOne(new LambdaQueryWrapperX<IntegralDO>().eq(IntegralDO::getUserId, userId));
+        Long afterIntegralPoints = 0L;
+
+        // 溢出额度
+        Long ancestorQuotaAmount = null;
+        Long getHighQuota = 0L;     // 实得直推奖奖
+
+        // 校验用户积分是否足够
+        if (integralType.equals(IntegralTypeEnum.RED_INTEGRAL.getType())) {
+            verifyUserIntegral(integralDO.getRedCurrentQuota(), amount);
+            getHighQuota = -amount;
+
+            // 修改用户积分
+            integralDO.setRedCurrentQuota(integralDO.getRedCurrentQuota() - amount);
+            afterIntegralPoints = integralDO.getRedCurrentQuota();
+
+            if (highQuota != null) {
+                // 增加峰值
+                integralDO.setHighQuota(integralDO.getHighQuota() + highQuota);     //剩余峰值
+                integralDO.setHighQuotaTotal(integralDO.getHighQuotaTotal() + highQuota);      //累计峰值
+            }
+        } else if (integralType.equals(IntegralTypeEnum.GREEN_INTEGRAL.getType())) {
+            verifyUserIntegral(integralDO.getGreenCurrentQuota(), amount);
+            getHighQuota = -amount;
+
+            // 修改用户积分
+            integralDO.setGreenCurrentQuota(integralDO.getGreenCurrentQuota() - amount);
+            afterIntegralPoints = integralDO.getGreenCurrentQuota();
+        } else if (integralType.equals(IntegralTypeEnum.YELLOW_INTEGRAL.getType())) {
+            // 峰值小于获得额度
+            if (integralDO.getHighQuota() < amount) {
+                ancestorQuotaAmount = amount - integralDO.getHighQuota();
+                getHighQuota = integralDO.getHighQuota();
+                highQuota = -integralDO.getHighQuota();
+
+                integralDO.setYellowCurrentQuota(integralDO.getYellowCurrentQuota() + integralDO.getHighQuota());
+                integralDO.setHighQuota(0L);
+            } else {
+                getHighQuota = amount;
+                highQuota = -amount;
+                integralDO.setHighQuota(integralDO.getHighQuota() - amount);
+                integralDO.setYellowCurrentQuota(integralDO.getYellowCurrentQuota() + amount);
+            }
+            afterIntegralPoints = integralDO.getYellowCurrentQuota();
         }
 
-        return success;
-    }
-
-
-    /**
-     * 修改用户身价
-     * @param userId 用户ID
-     * @param socialStatusUpdateEnum 身价变动类别
-     * @param socialStatusPoint 身价变化值
-     * @param ObjectId 导致身价变动的对应业务对象ID,如订单ID、收藏记录ID、新注册用户ID等
-     * @return 升级后的身价名称,如果返回null,表明没升级
-     */
-    public String updateUserSocialStatus(Long userId, SocialStatusUpdateEnum socialStatusUpdateEnum, Integer socialStatusPoint,
-                                   Long ObjectId){
-        //升级后的身价名称,如果返回null,表明没升级
-        String newSocialStatusName = null;
-        //用户身价升了几级
-        Integer socialStatusUpgradation = 0;
+        integralMapper.updateById(integralDO);
 
-        DuserDO duser = duserMapper.selectOne("user_id", userId);
-        Long oldSocialStatus = duser.getSocialStatusId();//升级前身价等级
+        amount = integralType.equals(IntegralTypeEnum.RED_INTEGRAL.getType()) ||
+                integralType.equals(IntegralTypeEnum.GREEN_INTEGRAL.getType()) ? -amount : amount;
 
-        return newSocialStatusName;
+        // 记录积分变动日志
+        IntegralChangeLogSaveReqVO changeLog = IntegralChangeLogSaveReqVO.builder()
+                .userId(userId)
+                .integralPoints(amount)
+                .afterIntegralPoints(afterIntegralPoints)
+                .practicalIntegralPoints(getHighQuota)
+                .generateUserId(generateUserId)
+                .orderId(tradeOrderId)
+                .orderNo(OrderNum)
+                .integralStatus(integralEnum.getType())
+                .maxAvailablePointsAmount(highQuota)
+                .afterMaxAvailablePointsAmount(integralDO.getHighQuota())
+                .ancestorQuotaAmount(ancestorQuotaAmount)
+                .integralType(integralType)
+                .build();
+        integralChangeLogService.createIntegralChangeLog(changeLog);
     }
 
     @Override
-    public void updateIntegralFreezeHighQuota(Long generateUserId, Long userId, CaclEnum caclEnum, Long totalFreezeHighQuota, Long tradeOrderId, String orderNum) {
-        IntegralDO integralDO = integralMapper.selectOne(new LambdaQueryWrapper<IntegralDO>().eq(IntegralDO::getUserId, userId));
-        integralDO.setFreezeHighQuota(integralDO.getFreezeHighQuota() + totalFreezeHighQuota);
-        integralMapper.updateById(integralDO);
+    public void updateUserIntegralByBonus(Long generateUserId, Long userId, IntegralEnum integralEnum, Long amount, Long orderId, String orderNo) {
+        if (amount == null || amount == 0L) return;
+
+        // 用户钱包
+        IntegralDO integralDO = integralMapper.selectOne(new LambdaQueryWrapperX<IntegralDO>().eq(IntegralDO::getUserId, userId));
+        // 参数比例
+        OrderPercentageDO orderPercentageDO = orderPercentageService.queryStatus();
 
-        //记录用户的积分变动日志
-        PtProfitLogSaveReqVO profitLogSaveReqVO = PtProfitLogSaveReqVO.builder()
-                .freezeHighQuota(totalFreezeHighQuota)
-                .afterFreezeHighQuota(integralDO.getFreezeHighQuota())
+        // 记录积分变动日志
+        IntegralChangeLogSaveReqVO yellowChangeLog = IntegralChangeLogSaveReqVO.builder()
+                .integralType(IntegralTypeEnum.YELLOW_INTEGRAL.getType())
                 .userId(userId)
                 .generateUserId(generateUserId)
-                .profitStatus(caclEnum.getType())
-                .orderId(tradeOrderId)
-                .orderNo(orderNum)
+                .integralStatus(integralEnum.getType())
+                .orderId(orderId)
+                .orderNo(orderNo)
                 .build();
-        ptProfitLogService.createPtProfitLog(profitLogSaveReqVO);
+        IntegralChangeLogSaveReqVO greenChangeLog = IntegralChangeLogSaveReqVO.builder()
+                .integralType(IntegralTypeEnum.GREEN_INTEGRAL.getType())
+                .userId(userId)
+                .generateUserId(generateUserId)
+                .integralStatus(integralEnum.getType())
+                .orderId(orderId)
+                .orderNo(orderNo)
+                .build();
+
+        String bonusYellowIntegral = orderPercentageDO.getBonusYellowIntegral();
+        String bonusGreenIntegral = orderPercentageDO.getBonusGreenIntegral();
+
+        Long ancestorYellowQuotaAmount = 0L;        // 溢出黄积分额度
+        Long ancestorGreenQuotaAmount = 0L;        // 溢出绿积分额度
+        Long getYellowHighQuota;     // 实得直推奖黄积分
+        Long getGreenHighQuota;     // 实得直推奖绿积分
+        if (integralDO.getHighQuota() < amount) {
+            ancestorYellowQuotaAmount = calcIntegral((amount - integralDO.getHighQuota()), bonusYellowIntegral);
+            getYellowHighQuota = calcIntegral(integralDO.getHighQuota(), bonusYellowIntegral);
+
+            ancestorGreenQuotaAmount = calcIntegral((amount - integralDO.getHighQuota()), bonusGreenIntegral);
+            getGreenHighQuota = calcIntegral(integralDO.getHighQuota(), bonusGreenIntegral);
+        } else {
+            getYellowHighQuota = calcIntegral(amount, bonusYellowIntegral);
+
+            getGreenHighQuota = calcIntegral(amount, bonusGreenIntegral);
+        }
+
+        integralDO.setYellowCurrentQuota(integralDO.getYellowCurrentQuota() + getYellowHighQuota);
+        integralDO.setGreenCurrentQuota(integralDO.getGreenCurrentQuota() + getGreenHighQuota);
+        integralDO.setHighQuota(integralDO.getHighQuota() - getYellowHighQuota - getGreenHighQuota);
+        integralDO.setAncestorQuota(integralDO.getAncestorQuota() + getYellowHighQuota + getGreenHighQuota);
+
+        yellowChangeLog
+                .setIntegralPoints(getYellowHighQuota)
+                .setPracticalIntegralPoints(getYellowHighQuota)
+                .setAfterIntegralPoints(integralDO.getYellowCurrentQuota())
+                .setAncestorQuotaAmount(ancestorYellowQuotaAmount)
+                .setMaxAvailablePointsAmount(-getYellowHighQuota)
+                .setAfterMaxAvailablePointsAmount(integralDO.getHighQuota() + getGreenHighQuota);
+
+        greenChangeLog.
+                setIntegralPoints(getGreenHighQuota)
+                .setPracticalIntegralPoints(getGreenHighQuota)
+                .setAfterIntegralPoints(integralDO.getGreenCurrentQuota())
+                .setAncestorQuotaAmount(ancestorGreenQuotaAmount)
+                .setMaxAvailablePointsAmount(-getGreenHighQuota)
+                .setAfterMaxAvailablePointsAmount(integralDO.getHighQuota() + getYellowHighQuota);
+
+        // 修改用户积分
+        integralMapper.updateById(integralDO);
+
+        // 插入积分变动日志
+        integralChangeLogService.createIntegralChangeLogs(Arrays.asList(yellowChangeLog, greenChangeLog));
+
+        // 用户获得直推奖后要扣除平台的余额
+        if (getYellowHighQuota + getGreenHighQuota > 0) {
+            PtProfitDO ptProfitDO = ptProfitMapper.selectList().get(0);
+            ptProfitDO.setPtGrossAdd(ptProfitDO.getPtGrossAdd() - getYellowHighQuota - getGreenHighQuota);
+            ptProfitDO.setPtTotalAdd(ptProfitDO.getPtTotalAdd() - getYellowHighQuota - getGreenHighQuota);
+
+            PtProfitLogSaveReqVO ptProfitLog = PtProfitLogSaveReqVO.builder()
+                    .profitStatus(integralEnum.getType())
+                    .profitType(ProfitTypeEnum.PT_PROFIT.getType())
+                    .amount(-(getYellowHighQuota + getGreenHighQuota))
+                    .afterAmount(ptProfitDO.getPtGrossAdd())
+                    .orderId(orderId)
+                    .orderNo(orderNo)
+                    .generateUserId(userId)
+                    .build();
+
+            ptProfitMapper.updateById(ptProfitDO);
+            ptProfitLogService.createPtProfitLog(ptProfitLog);
+        }
+    }
+
+    /**
+     * 计算积分
+     * @param amount 值
+     * @param bonusIntegral 比例
+     * @return 值
+     */
+    private Long calcIntegral(Long amount, String bonusIntegral) {
+        return (long) (amount * Double.parseDouble(bonusIntegral));
     }
 
     @Override
     public void updateUserIntegral(Long userId, CaclEnum caclEnum, Long payIntegral, Long tradeOrderId, String orderNum) {
         //退还订单支付过期积分
         IntegralDO integralDO = integralMapper.selectOne(new LambdaQueryWrapper<IntegralDO>().eq(IntegralDO::getUserId, userId));
-        integralDO.setCurrentQuota(integralDO.getCurrentQuota() + payIntegral);
+        integralDO.setRedCurrentQuota(integralDO.getRedCurrentQuota() + payIntegral);
 
         integralMapper.updateById(integralDO);
 
-        ptProfitLogService.addMessage(userId,userId,caclEnum,payIntegral,integralDO.getCurrentQuota(),0L,0L,null,tradeOrderId,orderNum);
+        ptProfitLogService.addMessage(userId, userId, caclEnum, payIntegral, integralDO.getRedCurrentQuota(), 0L, 0L, null, tradeOrderId, orderNum);
     }
 
     @Override
-    public void updateUserConsumptionPoints(Long userId, ConsumptionEnum consumptionEnum, Long consumptionPoints, Long orderId, String orderNum) {
-        IntegralDO integralDO = integralMapper.selectOne(IntegralDO::getUserId, userId);
+    public Boolean quotaTransition(IntegralTransitionRespVO respVO) {
+        Long userId = getLoginUserId();
+        DuserDO duser = duserService.getDuserByUser(userId);
 
-        // 修改用户消费积分
-        integralDO.setConsumptionPoints(integralDO.getConsumptionPoints() + consumptionPoints);
-        integralMapper.updateById(integralDO);
+        // 获取用户信息并检查支付密码
+        MemberUserDO user = memberUserService.getUser(userId);
+        if (user.getPayPassword() == null || user.getPayPassword().isEmpty()) {
+            throw exception(USER_NOT_PAY_PASSWORD);
+        }
 
-        consumptionChangeLogService.createConsumptionChangeLog(
-                ConsumptionChangeLogSaveReqVO.builder()
-                        .userId(userId)
-                        .generateUserId(userId)
-                        .consumptionStatus(consumptionEnum.getType())
-                        .consumptionPoints(consumptionPoints)
-                        .afterConsumptionPoints(integralDO.getConsumptionPoints())
-                        .orderId(orderId)
-                        .orderNo(orderNum)
-                        .build());
-    }
+        // 支付密码错误
+        if (!passwordEncoder.matches(respVO.getPayPassword(), user.getPayPassword())) {
+            throw exception(USER_PAY_PASS_WORD_ERROR);
+        }
 
-    @Override
-    public Boolean quotaTransition(Long quota) {
-        Long userId = getLoginUserId();
+        // 转换倍率
+        OrderPercentageDO orderPercentageDO = orderPercentageService.queryStatus();
 
         // 输入的佣金要放大才能与数据库中匹配
-        quota = quota * DistriConstants.INTEGRAL_PAGE2DB;
-        IntegralDO integralDO = integralMapper.selectOne(IntegralDO::getUserId,userId);
-
-        if(integralDO.getCurrentQuota() < quota){
-            ErrorCode ERROR = new ErrorCode(1_002_030_003, "可用积分不足");
-            throw exception(ERROR);
+        respVO.setQuota(respVO.getQuota() * DistriConstants.INTEGRAL_PAGE2DB);
+
+        // 变动积分
+        Long practicalConsumptionPoints = 0L;
+        // 变动积分剩余
+        Long afterIntegralPoints = 0L;
+        // 增加积分剩余
+        Long afterAddIntegralPoints = 0L;
+        IntegralDO integralDO = integralMapper.selectOne(IntegralDO::getUserId, userId);
+        Integer integralStatus = 0;
+
+        // 确定转账类型
+        switch (respVO.getIntegralType()) {
+            case 1:     //红转绿
+                // 身份校验
+                if (duser.getCategoryId().equals(1L) || duser.getCategoryId().equals(2L))
+                    throw exception(USER_IS_NOT_AGENT);
+
+                // 存量校验
+                verifyIntegral(integralDO.getRedCurrentQuota(), respVO.getQuota());
+
+                integralDO.setRedCurrentQuota(integralDO.getRedCurrentQuota() - respVO.getQuota());
+                practicalConsumptionPoints = (long) (respVO.getQuota() * Double.parseDouble(orderPercentageDO.getAgentRedTransitionGreen()));
+                integralDO.setGreenCurrentQuota(integralDO.getGreenCurrentQuota() + practicalConsumptionPoints);
+                afterIntegralPoints = integralDO.getRedCurrentQuota();
+                afterAddIntegralPoints = integralDO.getGreenCurrentQuota();
+
+                integralStatus = IntegralEnum.RED_INTEGRAL_TRANSITION_GREEN_INTEGRAL.getType();
+                break;
+            case 2:     //黄转红
+                verifyIntegral(integralDO.getYellowCurrentQuota(), respVO.getQuota());
+
+                integralDO.setYellowCurrentQuota(integralDO.getYellowCurrentQuota() - respVO.getQuota());
+                if (duser.getCategoryId().equals(1L) || duser.getCategoryId().equals(2L)) {     //普通用户和会员
+                    practicalConsumptionPoints = (long) (respVO.getQuota() * Double.parseDouble(orderPercentageDO.getMemberYellowTransitionRed()));
+                } else {        // 代理商
+                    practicalConsumptionPoints = (long) (respVO.getQuota() * Double.parseDouble(orderPercentageDO.getAgentYellowTransitionRed()));
+                }
+                integralDO.setRedCurrentQuota(integralDO.getRedCurrentQuota() + practicalConsumptionPoints);
+                afterIntegralPoints = integralDO.getYellowCurrentQuota();
+                afterAddIntegralPoints = integralDO.getRedCurrentQuota();
+
+                integralStatus = IntegralEnum.YELLOW_INTEGRAL_TRANSITION_RED_INTEGRAL.getType();
+                break;
+            // 目前没有绿积分转换
         }
 
-        integralDO.setCurrentQuota(integralDO.getCurrentQuota() - quota);
-        integralDO.setConsumptionPoints(integralDO.getConsumptionPoints() + quota);
         integralMapper.updateById(integralDO);
 
-        consumptionChangeLogService.createConsumptionChangeLog(
-                ConsumptionChangeLogSaveReqVO.builder()
+        // 记录扣减变动日志
+        integralChangeLogService.createIntegralChangeLog(
+                IntegralChangeLogSaveReqVO.builder()
                         .userId(userId)
-                        .consumptionStatus(ConsumptionEnum.COMMISSION_TRANSITION.getType())
-                        .consumptionPoints(quota)
-                        .afterConsumptionPoints(integralDO.getConsumptionPoints())
+                        .integralStatus(integralStatus)
+                        .integralPoints(-respVO.getQuota())
+                        .practicalIntegralPoints(-respVO.getQuota())
+                        .afterIntegralPoints(afterIntegralPoints)
+                        .integralType(respVO.getIntegralType())
+                        .generateUserId(userId)
                         .build());
 
-        ptProfitLogService.createPtProfitLog(
-                PtProfitLogSaveReqVO.builder()
-                        .amount(-quota)
-                        .afterAmount(integralDO.getCurrentQuota())
+        // 记录增加变动日志
+        integralChangeLogService.createIntegralChangeLog(
+                IntegralChangeLogSaveReqVO.builder()
                         .userId(userId)
+                        .integralStatus(integralStatus)
+                        .integralPoints(respVO.getQuota())
+                        .practicalIntegralPoints(practicalConsumptionPoints)
+                        .afterIntegralPoints(afterAddIntegralPoints)
+                        .integralType(Objects.equals(respVO.getIntegralType(), IntegralTypeEnum.RED_INTEGRAL.getType()) ?
+                                IntegralTypeEnum.GREEN_INTEGRAL.getType() : IntegralTypeEnum.RED_INTEGRAL.getType())
                         .generateUserId(userId)
-                        .profitStatus(CaclEnum.COMMISSION_TRANSITION.getType())
                         .build());
 
         return true;
     }
 
-    @Override
-    public Boolean updateUserConsumptionPoints(Long generateUserId, Long userId, Long amount, Long tradeOrderId, String orderNum) {
-        IntegralDO integralDO = integralMapper.selectOne(IntegralDO::getUserId, userId);
-        // 消费分不足
-        if(integralDO.getConsumptionPoints() < amount){
-            return false;
+    /**
+     * 校验用户积分是否充足
+     *
+     * @param userIntegral       用户积分
+     * @param transitionIntegral 转换积分
+     */
+    private void verifyIntegral(Long userIntegral, Long transitionIntegral) {
+        if (userIntegral < transitionIntegral) {
+            throw exception(USER_INTEGRAL_LESS_TRANSITION_INTEGRAL);
         }
-
-        // 修改用户消费积分
-        integralDO.setConsumptionPoints(integralDO.getConsumptionPoints() - amount);
-        integralMapper.updateById(integralDO);
-
-        consumptionChangeLogService.createConsumptionChangeLog(
-                ConsumptionChangeLogSaveReqVO.builder()
-                        .userId(userId)
-                        .generateUserId(generateUserId)
-                        .consumptionStatus(ConsumptionEnum.PAY_ORDER.getType())
-                        .consumptionPoints(-amount)
-                        .afterConsumptionPoints(integralDO.getConsumptionPoints())
-                        .orderId(tradeOrderId)
-                        .orderNo(orderNum)
-                        .build());
-
-        return true;
     }
 }

+ 42 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integralchangelog/IntegralChangeLogService.java

@@ -0,0 +1,42 @@
+package cn.newfeifan.mall.module.distri.service.integralchangelog;
+
+import javax.validation.*;
+
+import cn.newfeifan.mall.module.distri.controller.app.integralchangelog.vo.IntegralChangeLogPageReqVO;
+import cn.newfeifan.mall.module.distri.controller.app.integralchangelog.vo.IntegralChangeLogRespVO;
+import cn.newfeifan.mall.module.distri.controller.app.integralchangelog.vo.IntegralChangeLogSaveReqVO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+import java.util.List;
+
+/**
+ * 平台消费分变动记录 Service 接口
+ *
+ * @author 非繁人
+ */
+public interface IntegralChangeLogService {
+
+    /**
+     * 创建平台消费分变动记录
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createIntegralChangeLog(@Valid IntegralChangeLogSaveReqVO createReqVO);
+
+    /**
+     * 批量创建平台消费分变动记录
+     *
+     * @param list 创建信息
+     */
+    void createIntegralChangeLogs(List<IntegralChangeLogSaveReqVO> list);
+
+    /**
+     * 获得平台消费分变动记录分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 平台消费分变动记录分页
+     */
+    PageResult<IntegralChangeLogRespVO> getConsumptionChangeLogPage(IntegralChangeLogPageReqVO pageReqVO);
+
+}

+ 70 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integralchangelog/IntegralChangeLogServiceImpl.java

@@ -0,0 +1,70 @@
+package cn.newfeifan.mall.module.distri.service.integralchangelog;
+
+import cn.newfeifan.mall.module.distri.controller.app.integralchangelog.vo.IntegralChangeLogPageReqVO;
+import cn.newfeifan.mall.module.distri.controller.app.integralchangelog.vo.IntegralChangeLogRespVO;
+import cn.newfeifan.mall.module.distri.controller.app.integralchangelog.vo.IntegralChangeLogSaveReqVO;
+import cn.newfeifan.mall.module.distri.enums.IntegralEnum;
+import cn.newfeifan.mall.module.member.dal.dataobject.user.MemberUserDO;
+import cn.newfeifan.mall.module.member.service.user.MemberUserService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+import org.springframework.validation.annotation.Validated;
+
+import cn.newfeifan.mall.module.distri.dal.dataobject.integralchangelog.IntegralChangeLogDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+
+import cn.newfeifan.mall.module.distri.dal.mysql.consumptionchangelog.ConsumptionChangeLogMapper;
+
+import java.util.List;
+
+import static cn.newfeifan.mall.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
+
+/**
+ * 平台消费分变动记录 Service 实现类
+ *
+ * @author 非繁人
+ */
+@Service
+@Validated
+public class IntegralChangeLogServiceImpl implements IntegralChangeLogService {
+
+    @Resource
+    private ConsumptionChangeLogMapper consumptionChangeLogMapper;
+
+    @Resource
+    private MemberUserService memberUserService;
+
+    @Override
+    public Long createIntegralChangeLog(IntegralChangeLogSaveReqVO createReqVO) {
+        // 插入
+        IntegralChangeLogDO consumptionChangeLog = BeanUtils.toBean(createReqVO, IntegralChangeLogDO.class);
+        consumptionChangeLogMapper.insert(consumptionChangeLog);
+        // 返回
+        return consumptionChangeLog.getId();
+    }
+
+    @Override
+    public void createIntegralChangeLogs(List<IntegralChangeLogSaveReqVO> list){
+        consumptionChangeLogMapper.insertBatch(BeanUtils.toBean(list, IntegralChangeLogDO.class));
+    }
+
+
+    @Override
+    public PageResult<IntegralChangeLogRespVO> getConsumptionChangeLogPage(IntegralChangeLogPageReqVO pageReqVO) {
+        pageReqVO.setUserId(getLoginUserId());
+        PageResult<IntegralChangeLogRespVO> bean = BeanUtils.toBean(consumptionChangeLogMapper.selectPage(pageReqVO), IntegralChangeLogRespVO.class);
+
+        for (IntegralChangeLogRespVO consumptionChangeLogRespVO : bean.getList()) {
+            consumptionChangeLogRespVO.setConsumptionStatusName(IntegralEnum.getName(consumptionChangeLogRespVO.getIntegralStatus()));
+            if(consumptionChangeLogRespVO.getGenerateUserId() != null){
+                MemberUserDO user = memberUserService.getUser(consumptionChangeLogRespVO.getGenerateUserId());
+                consumptionChangeLogRespVO.setGenerateUserName(user.getUsername());
+            }
+        }
+        return bean;
+    }
+
+}

+ 33 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integraltransferlog/IntegralTransferLogService.java

@@ -0,0 +1,33 @@
+package cn.newfeifan.mall.module.distri.service.integraltransferlog;
+
+import javax.validation.*;
+
+import cn.newfeifan.mall.module.distri.controller.app.integraltransferlog.vo.IntegralTransferLogPageReqVO;
+import cn.newfeifan.mall.module.distri.controller.app.integraltransferlog.vo.IntegralTransferLogSaveReqVO;
+import cn.newfeifan.mall.module.distri.dal.dataobject.integraltransferlog.IntegralTransferLogDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+/**
+ * 消费分转让记录 Service 接口
+ *
+ * @author 非繁人
+ */
+public interface IntegralTransferLogService {
+
+    /**
+     * 创建消费分转让记录
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createConsumptionTransferLog(@Valid IntegralTransferLogSaveReqVO createReqVO);
+
+    /**
+     * 获得消费分转让记录分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 消费分转让记录分页
+     */
+    PageResult<IntegralTransferLogDO> getConsumptionTransferLogPage(IntegralTransferLogPageReqVO pageReqVO);
+
+}

+ 226 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integraltransferlog/IntegralTransferLogServiceImpl.java

@@ -0,0 +1,226 @@
+package cn.newfeifan.mall.module.distri.service.integraltransferlog;
+
+import cn.newfeifan.mall.framework.common.exception.ErrorCode;
+import cn.newfeifan.mall.module.distri.constant.DistriConstants;
+import cn.newfeifan.mall.module.distri.controller.app.integralchangelog.vo.IntegralChangeLogSaveReqVO;
+import cn.newfeifan.mall.module.distri.controller.app.integraltransferlog.vo.IntegralTransferLogPageReqVO;
+import cn.newfeifan.mall.module.distri.controller.app.integraltransferlog.vo.IntegralTransferLogSaveReqVO;
+import cn.newfeifan.mall.module.distri.controller.app.integral.vo.IntegralSaveReqVO;
+import cn.newfeifan.mall.module.distri.dal.dataobject.integral.IntegralDO;
+import cn.newfeifan.mall.module.distri.enums.IntegralEnum;
+import cn.newfeifan.mall.module.distri.service.integralchangelog.IntegralChangeLogService;
+import cn.newfeifan.mall.module.distri.service.integral.IntegralService;
+import cn.newfeifan.mall.module.distri.utils.ReflectionUtils;
+import cn.newfeifan.mall.module.member.dal.dataobject.user.MemberUserDO;
+import cn.newfeifan.mall.module.member.service.user.MemberUserService;
+import org.springframework.security.crypto.password.PasswordEncoder;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.annotation.Validated;
+
+import cn.newfeifan.mall.module.distri.dal.dataobject.integraltransferlog.IntegralTransferLogDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+
+import cn.newfeifan.mall.module.distri.dal.mysql.integraltransferlog.IntegralTransferLogMapper;
+
+import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.newfeifan.mall.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
+import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
+import static cn.newfeifan.mall.module.member.enums.ErrorCodeConstants.USER_NOT_PAY_PASSWORD;
+import static cn.newfeifan.mall.module.member.enums.ErrorCodeConstants.USER_PAY_PASS_WORD_ERROR;
+
+/**
+ * 消费分转让记录 Service 实现类
+ *
+ * @author 非繁人
+ */
+@Service
+@Validated
+public class IntegralTransferLogServiceImpl implements IntegralTransferLogService {
+
+    @Resource
+    private IntegralTransferLogMapper consumptionTransferLogMapper;
+
+    @Resource
+    private IntegralService integralService;
+
+    @Resource
+    private IntegralChangeLogService consumptionChangeLogService;
+
+    @Resource
+    private MemberUserService memberUserService;
+
+    @Resource
+    private PasswordEncoder passwordEncoder;
+
+    @Transactional
+    public Long createConsumptionTransferLog(IntegralTransferLogSaveReqVO createReqVO) {
+        // 自己不能转账自己
+        Long loginUserId = getLoginUserId();
+        verifyIntegral(createReqVO, loginUserId);
+
+        // 消费分转成数据库存储的单位
+        createReqVO.setConsumptionPoints(createReqVO.getConsumptionPoints() * DistriConstants.INTEGRAL_PAGE2DB);
+        createReqVO.setTransferUserId(loginUserId);
+
+        // 获取用户信息并检查支付密码
+        MemberUserDO user = memberUserService.getUser(loginUserId);
+        if (user.getPayPassword() == null || user.getPayPassword().isEmpty()) {
+            throw exception(USER_NOT_PAY_PASSWORD);
+        }
+
+        // 支付密码错误
+        if (!passwordEncoder.matches(createReqVO.getPayPassword(), user.getPayPassword())) {
+            throw exception(USER_PAY_PASS_WORD_ERROR);
+        }
+        createReqVO.setTransferUserName(user.getUsername());
+
+        // 转让人钱包
+        IntegralDO transferIntegral = integralService.selectByUser(createReqVO.getTransferUserId());
+        Long afterTransferQuota = 0L;
+        // 接收人钱包
+        IntegralDO recipientIntegral = integralService.selectByUser(createReqVO.getRecipientUserId());
+        Long afterRecipientQuota = 0L;
+
+        // 根据不同积分进行转账
+        switch (createReqVO.getIntegralType()) {
+            case 1:     //红
+                updateQuota(transferIntegral, recipientIntegral, createReqVO, "redCurrentQuota");
+                afterTransferQuota = transferIntegral.getRedCurrentQuota();
+                afterRecipientQuota = recipientIntegral.getRedCurrentQuota();
+                break;
+            case 2:     //黄
+                updateQuota(transferIntegral, recipientIntegral, createReqVO, "yellowCurrentQuota");
+                afterTransferQuota = transferIntegral.getYellowCurrentQuota();
+                afterRecipientQuota = recipientIntegral.getYellowCurrentQuota();
+                break;
+            case 3:     //绿
+                updateQuota(transferIntegral, recipientIntegral, createReqVO, "greenCurrentQuota");
+                afterTransferQuota = transferIntegral.getGreenCurrentQuota();
+                afterRecipientQuota = recipientIntegral.getGreenCurrentQuota();
+                break;
+        }
+
+        // 更新积分
+        integralService.updateIntegral(BeanUtils.toBean(transferIntegral, IntegralSaveReqVO.class));
+        integralService.updateIntegral(BeanUtils.toBean(recipientIntegral, IntegralSaveReqVO.class));
+
+        // 记录变动日志
+        logIntegralChange(createReqVO, transferIntegral, recipientIntegral);
+
+        // 插入转账记录
+        IntegralTransferLogDO consumptionTransferLog = BeanUtils.toBean(createReqVO, IntegralTransferLogDO.class);
+        consumptionTransferLog.setConsumptionPoints(-consumptionTransferLog.getConsumptionPoints());
+        consumptionTransferLog.setRecipientPoints(-consumptionTransferLog.getConsumptionPoints());
+        consumptionTransferLog.setAfterTransferConsumptionPoints(afterTransferQuota);
+        consumptionTransferLog.setAfterRecipientConsumptionPoints(afterRecipientQuota);
+        consumptionTransferLogMapper.insert(consumptionTransferLog);
+
+        // 返回
+        return consumptionTransferLog.getId();
+    }
+
+    /**
+     * 更新积分配额
+     * @param transferIntegral 转让积分的对象
+     * @param recipientIntegral 接收积分的对象
+     * @param createReqVO 积分转让请求对象,包含转让所需的详细信息
+     * @param quotaField 字符串形式的配额字段名,用于通过反射获取和设置字段值
+     */
+    private void updateQuota(IntegralDO transferIntegral, IntegralDO recipientIntegral, IntegralTransferLogSaveReqVO createReqVO, String quotaField) {
+        // 获取消费积分
+        Long consumptionPoints = createReqVO.getConsumptionPoints();
+
+        try{
+            // 通过反射获取转让方和接收方的指定配额字段值
+            Long transferQuota = (Long) ReflectionUtils.getFieldValue(transferIntegral, quotaField);
+            Long recipientQuota = (Long) ReflectionUtils.getFieldValue(recipientIntegral, quotaField);
+
+            // 验证转让方的配额是否足够
+            verifyIntegral(transferQuota, consumptionPoints);
+
+            // 更新转让方和接收方的配额
+            ReflectionUtils.setFieldValue(transferIntegral, quotaField, transferQuota - consumptionPoints);
+            ReflectionUtils.setFieldValue(recipientIntegral, quotaField, recipientQuota + consumptionPoints);
+        } catch (Exception e){
+            // 如果在积分转让过程中发生异常,抛出运行时异常
+            throw new RuntimeException("积分转让异常");
+        }
+    }
+
+    private void logIntegralChange(IntegralTransferLogSaveReqVO createReqVO, IntegralDO transferIntegral, IntegralDO recipientIntegral) {
+        Long consumptionPoints = createReqVO.getConsumptionPoints();
+        Long afterTransferConsumptionPoints = getQuotaValue(transferIntegral, createReqVO.getIntegralType());
+        Long afterRecipientConsumptionPoints = getQuotaValue(recipientIntegral, createReqVO.getIntegralType());
+
+        // 记录转让人变动日志
+        consumptionChangeLogService.createIntegralChangeLog(
+                IntegralChangeLogSaveReqVO.builder()
+                        .userId(transferIntegral.getUserId())
+                        .integralPoints(-consumptionPoints)
+                        .practicalIntegralPoints(-consumptionPoints)
+                        .afterIntegralPoints(afterTransferConsumptionPoints)
+                        .integralStatus(IntegralEnum.INTEGRAL_TRANSFER.getType())
+                        .generateUserId(recipientIntegral.getUserId())
+                        .integralType(createReqVO.getIntegralType())
+                        .build()
+        );
+
+        // 记录接收人变动日志
+        consumptionChangeLogService.createIntegralChangeLog(
+                IntegralChangeLogSaveReqVO.builder()
+                        .userId(recipientIntegral.getUserId())
+                        .integralPoints(consumptionPoints)
+                        .practicalIntegralPoints(consumptionPoints)
+                        .afterIntegralPoints(afterRecipientConsumptionPoints)
+                        .integralStatus(IntegralEnum.INTEGRAL_RECIPIENT.getType())
+                        .generateUserId(transferIntegral.getUserId())
+                        .integralType(createReqVO.getIntegralType())
+                        .build()
+        );
+    }
+
+    private Long getQuotaValue(IntegralDO integral, int integralType) {
+        switch (integralType) {
+            case 1: return integral.getRedCurrentQuota();
+            case 2: return integral.getYellowCurrentQuota();
+            case 3: return integral.getGreenCurrentQuota();
+            default: return 0L;
+        }
+    }
+
+
+    /**
+     * 校验用户
+     * @param createReqVO 转让信息
+     * @param loginUserId 用户id
+     */
+    private void verifyIntegral(IntegralTransferLogSaveReqVO createReqVO, Long loginUserId) {
+        if (loginUserId != null && loginUserId.equals(createReqVO.getRecipientUserId())) {
+            ErrorCode ERROR = new ErrorCode(1_002_030_037, "自己不能转账给自己");
+            throw exception(ERROR);
+        }
+    }
+
+    /**
+     * 校验用户积分是否足够
+     * @param userIntegral 用户积分
+     * @param transitionIntegral 转账积分
+     */
+    private void verifyIntegral(Long userIntegral, Long transitionIntegral){
+        if(userIntegral < transitionIntegral){
+            throw exception(USER_INTEGRAL_LESS_TRANSITION_INTEGRAL);
+        }
+    }
+
+    @Override
+    public PageResult<IntegralTransferLogDO> getConsumptionTransferLogPage(IntegralTransferLogPageReqVO pageReqVO) {
+        pageReqVO.setTransferUserId(getLoginUserId());
+        return consumptionTransferLogMapper.selectPage(pageReqVO);
+    }
+
+}

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

@@ -1,11 +1,6 @@
 package cn.newfeifan.mall.module.distri.service.orderpercentage;
 
-import javax.validation.*;
-
-import cn.newfeifan.mall.module.distri.controller.app.orderpercentage.vo.OrderPercentageDoubleSaveReqVO;
-import cn.newfeifan.mall.module.distri.controller.app.orderpercentage.vo.OrderPercentagePageReqVO;
 import cn.newfeifan.mall.module.distri.dal.dataobject.orderpercentage.OrderPercentageDO;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
 
 /**
  * 积分相关计算浮动百分比设置 Service 接口
@@ -14,47 +9,9 @@ import cn.newfeifan.mall.framework.common.pojo.PageResult;
  */
 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();
 

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

@@ -1,9 +1,6 @@
 package cn.newfeifan.mall.module.distri.service.orderpercentage;
 
 import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
-import cn.newfeifan.mall.module.distri.controller.app.orderpercentage.vo.OrderPercentageDoubleSaveReqVO;
-import cn.newfeifan.mall.module.distri.controller.app.orderpercentage.vo.OrderPercentagePageReqVO;
-import cn.newfeifan.mall.module.distri.controller.app.orderpercentage.vo.OrderPercentageSaveReqVO;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -13,15 +10,9 @@ import org.springframework.validation.annotation.Validated;
 import java.util.*;
 
 import cn.newfeifan.mall.module.distri.dal.dataobject.orderpercentage.OrderPercentageDO;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-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;
-import static cn.newfeifan.mall.module.distri.constant.DistriConstants.PERCENT;
-import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
 
 /**
  * 积分相关计算浮动百分比设置 Service 实现类
@@ -35,65 +26,6 @@ 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;
-    }
-
-
-    @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() {

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

@@ -1,12 +1,6 @@
 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;
-import cn.newfeifan.mall.module.distri.enums.CaclEnum;
+import cn.newfeifan.mall.module.distri.enums.IntegralEnum;
 
 /**
  * 平台利润 Service 接口
@@ -14,52 +8,24 @@ import cn.newfeifan.mall.module.distri.enums.CaclEnum;
  * @author 非繁人
  */
 public interface PtProfitService {
-
     /**
-     * 创建平台利润
-     *
-     * @param createReqVO 创建信息
-     * @return 编号
+     * 更新平台利润记录
+     * @param ptProfit 平台收益
+     * @param serviceCharge 服务费
+     * @param profit 利润
+     * @param settlementPrice 未结算价
+     * @param integralEnum 收益类型
      */
-    Long createPtProfit(@Valid PtProfitSaveReqVO createReqVO);
+    void updatePtProfit(Long ptProfit, Long serviceCharge, Long profit, Long settlementPrice, IntegralEnum integralEnum,
+    Long orderId, String orderNO,Long userId);
 
     /**
-     * 更新平台利润
-     *
-     * @param updateReqVO 更新信息
+     * 结算订单
+     * @param settlementPrice 结算价
+     * @param integralEnum 收益类型
+     * @param orderId 订单id
+     * @param orderNO 订单号
+     * @param userId 用户id
      */
-    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);
-
-
+    void subtractIntegral(Long settlementPrice, IntegralEnum integralEnum, Long orderId, String orderNO, Long userId);
 }

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

@@ -1,21 +1,16 @@
 package cn.newfeifan.mall.module.distri.service.ptprofit;
 
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
-import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
-import cn.newfeifan.mall.module.distri.controller.admin.ptprofit.vo.PtProfitPageReqVO;
-import cn.newfeifan.mall.module.distri.controller.admin.ptprofit.vo.PtProfitSaveReqVO;
+import cn.newfeifan.mall.module.distri.controller.app.ptprofitlog.vo.PtProfitLogSaveReqVO;
 import cn.newfeifan.mall.module.distri.dal.dataobject.ptprofit.PtProfitDO;
 import cn.newfeifan.mall.module.distri.dal.mysql.ptprofit.PtProfitMapper;
+import cn.newfeifan.mall.module.distri.enums.IntegralEnum;
+import cn.newfeifan.mall.module.distri.enums.ProfitTypeEnum;
 import cn.newfeifan.mall.module.distri.service.ptprofitlog.PtProfitLogService;
 import org.springframework.stereotype.Service;
 import org.springframework.validation.annotation.Validated;
 
 import javax.annotation.Resource;
-import java.util.List;
-
-import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
-import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.PT_PROFIT_NOT_EXISTS;
+import java.util.Arrays;
 
 /**
  * 平台利润 Service 实现类
@@ -32,59 +27,83 @@ public class PtProfitServiceImpl implements PtProfitService {
     @Resource
     private PtProfitLogService ptProfitLogService;
 
-    @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);
+    public void updatePtProfit(Long ptProfit, Long serviceCharge, Long profit, Long settlementPrice, IntegralEnum integralEnum,
+                               Long orderId, String orderNO, Long userId) {
+        // 增加收益
+        PtProfitDO ptProfitDO = ptProfitMapper.selectList().get(0);
+        ptProfit -= serviceCharge;
+
+        ptProfitDO.setPtGrossAdd(ptProfitDO.getPtGrossAdd() + ptProfit);
+        ptProfitDO.setPtAdd(ptProfitDO.getPtAdd() + serviceCharge);
+        ptProfitDO.setProfit(ptProfitDO.getProfit() + profit);
+        ptProfitDO.setSettlementPrice(ptProfitDO.getSettlementPrice() + settlementPrice);
+        ptProfitDO.setPtTotalAdd(ptProfitDO.getPtTotalAdd() + ptProfit + serviceCharge + profit + settlementPrice);
+        ptProfitMapper.updateById(ptProfitDO);
+
+        // 添加平台收益记录
+        PtProfitLogSaveReqVO ptProfitLog = PtProfitLogSaveReqVO.builder()
+                .profitStatus(integralEnum.getType())
+                .profitType(ProfitTypeEnum.PT_PROFIT.getType())
+                .amount(ptProfit)
+                .afterAmount(ptProfitDO.getPtGrossAdd())
+                .orderId(orderId)
+                .orderNo(orderNO)
+                .generateUserId(userId)
+                .build();
+        // 添加平台服务费记录
+        PtProfitLogSaveReqVO serviceChargeLog = PtProfitLogSaveReqVO.builder()
+                .profitStatus(integralEnum.getType())
+                .profitType(ProfitTypeEnum.SERVICE_CHARGE.getType())
+                .amount(serviceCharge)
+                .afterAmount(ptProfitDO.getPtAdd())
+                .orderId(orderId)
+                .orderNo(orderNO)
+                .generateUserId(userId)
+                .build();
+        // 添加平台利润记录
+        PtProfitLogSaveReqVO profitLog = PtProfitLogSaveReqVO.builder()
+                .profitStatus(integralEnum.getType())
+                .profitType(ProfitTypeEnum.PROFIT.getType())
+                .amount(profit)
+                .afterAmount(ptProfitDO.getProfit())
+                .orderId(orderId)
+                .orderNo(orderNO)
+                .generateUserId(userId).build();
+        // 添加平台结算价记录
+        PtProfitLogSaveReqVO settlementPriceLog = PtProfitLogSaveReqVO.builder()
+                .profitStatus(integralEnum.getType())
+                .profitType(ProfitTypeEnum.SETTLEMENT_PRICE.getType())
+                .amount(settlementPrice)
+                .afterAmount(ptProfitDO.getSettlementPrice())
+                .orderId(orderId)
+                .orderNo(orderNO)
+                .generateUserId(userId).build();
+
+        ptProfitLogService.saveBatch(Arrays.asList(ptProfitLog, serviceChargeLog, profitLog, settlementPriceLog));
     }
 
     @Override
-    public void saveBatch(List<PtProfitSaveReqVO> ptProfitSaveReqVOS) {
-
-        List<PtProfitDO> ptProfit = BeanUtils.toBean(ptProfitSaveReqVOS, PtProfitDO.class);
-        ptProfitMapper.insertBatch(ptProfit);
-
+    public void subtractIntegral(Long settlementPrice, IntegralEnum integralEnum, Long orderId, String orderNO, Long userId) {
+        // 增加收益
+        PtProfitDO ptProfitDO = ptProfitMapper.selectList().get(0);
+
+        ptProfitDO.setSettlementPrice(ptProfitDO.getSettlementPrice() - settlementPrice);
+        ptProfitDO.setPtTotalAdd(ptProfitDO.getPtTotalAdd() - settlementPrice);
+
+        ptProfitMapper.updateById(ptProfitDO);
+
+        // 记录日志
+        PtProfitLogSaveReqVO settlementPriceLog = PtProfitLogSaveReqVO.builder()
+                .profitStatus(integralEnum.getType())
+                .profitType(ProfitTypeEnum.SETTLEMENT_PRICE.getType())
+                .amount(-settlementPrice)
+                .afterAmount(ptProfitDO.getSettlementPrice())
+                .orderId(orderId)
+                .orderNo(orderNO)
+                .generateUserId(userId).build();
+
+        ptProfitLogService.createPtProfitLog(settlementPriceLog);
     }
-
 }

+ 0 - 7
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/ptprofitlog/PtProfitLogService.java

@@ -25,13 +25,6 @@ public interface PtProfitLogService {
      */
     Long createPtProfitLog(@Valid PtProfitLogSaveReqVO createReqVO);
 
-    /**
-     * 更新平台利润记录
-     *
-     * @param updateReqVO 更新信息
-     */
-    void updatePtProfitLog(@Valid PtProfitLogSaveReqVO updateReqVO);
-
     /**
      * 删除平台利润记录
      *

+ 3 - 24
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/ptprofitlog/PtProfitLogServiceImpl.java

@@ -48,15 +48,6 @@ public class PtProfitLogServiceImpl implements PtProfitLogService {
         return ptProfitLog.getId();
     }
 
-    @Override
-    public void updatePtProfitLog(PtProfitLogSaveReqVO updateReqVO) {
-        // 校验存在
-        validatePtProfitLogExists(updateReqVO.getId());
-        // 更新
-        PtProfitLogDO updateObj = BeanUtils.toBean(updateReqVO, PtProfitLogDO.class);
-        ptProfitLogMapper.updateById(updateObj);
-    }
-
     @Override
     public void deletePtProfitLog(Long id) {
         // 校验存在
@@ -78,7 +69,6 @@ public class PtProfitLogServiceImpl implements PtProfitLogService {
 
     @Override
     public PageResult<PtProfitLogRespVO> getPtProfitLogPage(PtProfitLogPageReqVO pageReqVO) {
-        pageReqVO.setUserId(getLoginUserId());
         PageResult<PtProfitLogRespVO> result = BeanUtils.toBean(ptProfitLogMapper.selectPage(pageReqVO), PtProfitLogRespVO.class);
         for (PtProfitLogRespVO ptProfitLogRespVO : result.getList()) {
             if (ptProfitLogRespVO.getProfitStatus().equals(RECOMMENDED_PERSON_QUOTA.getType()) ||
@@ -96,7 +86,7 @@ public class PtProfitLogServiceImpl implements PtProfitLogService {
 
     @Override
     public PageResult<PtProfitLogRespVO> getMaxAmountPage(PtProfitLogPageReqVO pageReqVO) {
-        pageReqVO.setUserId(getLoginUserId());
+        pageReqVO.setGenerateUserId(getLoginUserId());
         PageResult<PtProfitLogRespVO> result = BeanUtils.toBean(ptProfitLogMapper.getMaxAmountPage(pageReqVO), PtProfitLogRespVO.class);
         for (PtProfitLogRespVO ptProfitLogRespVO : result.getList()) {
             if (ptProfitLogRespVO.getProfitStatus().equals(RECOMMENDED_PERSON_QUOTA.getType()) || ptProfitLogRespVO.getProfitStatus().equals(SMALL_QUOTA_CRASH.getType())) {
@@ -116,15 +106,6 @@ public class PtProfitLogServiceImpl implements PtProfitLogService {
     /**
      * 添加一条用户积分日志消息
      *
-     * @param userId
-     * @param caclEnum
-     * @param amount
-     * @param afterAmount
-     * @param freezeAmount
-     * @param afterFreezeAmount
-     * @param percentTemplate
-     * @param tradeOrderId
-     * @param OrderNum
      */
     @Override
     public void addMessage(Long generateUserId,//导致产生积分变动的用户ID
@@ -139,10 +120,8 @@ public class PtProfitLogServiceImpl implements PtProfitLogService {
                 .afterAmount(afterAmount)
                 .amount(amount)
                 .percentTemplate(percentTemplate)
-                .userId(userId)
                 .generateUserId(generateUserId)
                 .profitStatus(caclEnum.getType()).orderId(tradeOrderId).orderNo(OrderNum)
-                .freezeAmount(freezeAmount).afterFreezeAmount(afterFreezeAmount)
                 .build();
         ptProfitLogMapper.insert(BeanUtils.toBean(ptProfitLog, PtProfitLogDO.class));
 
@@ -169,7 +148,7 @@ public class PtProfitLogServiceImpl implements PtProfitLogService {
                 .betweenIfPresent(PtProfitLogDO::getCreateTime, yesterdayThreeAM, todayThreeAM)
                 .eqIfPresent(PtProfitLogDO::getProfitStatus, CaclEnum.DIRECT_REFERRAL_QUOTA.getType())
                 .or().eq(PtProfitLogDO::getProfitStatus, CaclEnum.TOGETHER_AWARD.getType())
-                .in(PtProfitLogDO::getUserId, sonsId));
+                .in(PtProfitLogDO::getGenerateUserId, sonsId));
         Long sum = ptProfitLogDOS.stream().mapToLong(PtProfitLogDO::getAmount).sum();
 
         return sum + "";
@@ -180,7 +159,7 @@ public class PtProfitLogServiceImpl implements PtProfitLogService {
         List<PtProfitLogDO> ptProfitLogDOS = ptProfitLogMapper.selectList(new LambdaQueryWrapperX<PtProfitLogDO>()
                 .eqIfPresent(PtProfitLogDO::getProfitStatus, CaclEnum.DIRECT_REFERRAL_QUOTA.getType())
                 .or().eq(PtProfitLogDO::getProfitStatus, CaclEnum.TOGETHER_AWARD.getType())
-                .in(PtProfitLogDO::getUserId, sonsId));
+                .in(PtProfitLogDO::getGenerateUserId, sonsId));
         Long sum = ptProfitLogDOS.stream().mapToLong(PtProfitLogDO::getAmount).sum();
 
         return sum + "";

+ 1 - 8
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/sharepath/SharePathService.java

@@ -15,14 +15,6 @@ import cn.newfeifan.mall.framework.common.pojo.PageResult;
  */
 public interface SharePathService {
 
-    /**
-     * 创建分销用户关系
-     *
-     * @param createReqVO 创建信息
-     * @return 编号
-     */
-    Long createSharePath(@Valid SharePathSaveReqVO createReqVO);
-
     void createSharePathByUserId(SharePathSaveReqVO createReqVO);
     void createSharePathByUserId(Long userId);
 
@@ -82,4 +74,5 @@ public interface SharePathService {
      * @return 推荐人
      */
     SharePathDO getSharePathByDescendant(Long userId);
+
 }

+ 72 - 152
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/sharepath/SharePathServiceImpl.java

@@ -3,20 +3,11 @@ package cn.newfeifan.mall.module.distri.service.sharepath;
 import cn.newfeifan.mall.framework.common.pojo.PageParam;
 import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.newfeifan.mall.module.distri.controller.app.sharepath.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.duser.DuserDO;
-import cn.newfeifan.mall.module.distri.dal.dataobject.integral.IntegralDO;
-import cn.newfeifan.mall.module.distri.dal.dataobject.orderpercentage.OrderPercentageDO;
 import cn.newfeifan.mall.module.distri.dal.dataobject.partitioncrash.PartitionCrashDO;
-import cn.newfeifan.mall.module.distri.dal.dataobject.socialstatus.SocialStatusDO;
-import cn.newfeifan.mall.module.distri.dal.mysql.orderpercentage.OrderPercentageMapper;
 import cn.newfeifan.mall.module.distri.dal.mysql.partitioncrash.PartitionCrashMapper;
-import cn.newfeifan.mall.module.distri.enums.SocialStatusEnum;
 import cn.newfeifan.mall.module.distri.service.duser.DuserService;
-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.controller.admin.user.vo.MemberUserRespVO;
 import cn.newfeifan.mall.module.member.service.user.MemberUserService;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
@@ -34,9 +25,8 @@ import cn.newfeifan.mall.module.distri.dal.mysql.sharepath.SharePathMapper;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
+import java.util.Arrays;
 import java.util.List;
-import java.util.Objects;
-import java.util.stream.Collectors;
 
 import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static cn.newfeifan.mall.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@@ -62,65 +52,63 @@ public class SharePathServiceImpl implements SharePathService {
     @Resource
     private MemberUserService memberUserService;
 
-    @Resource
-    private SocialStatusService socialStatusService;
-
-    @Resource
-    private OrderPercentageMapper orderPercentageMapper;
-
-    @Resource
-    private IntegralService integralService;
-
     @Resource
     private PartitionCrashMapper partitionCrashMapper;
 
-
-    @Override
-    public Long createSharePath(SharePathSaveReqVO createReqVO) {
-        // 插入
-        SharePathDO sharePath = BeanUtils.toBean(createReqVO, SharePathDO.class);
-        sharePathMapper.insert(sharePath);
-        // 返回
-        return sharePath.getId();
-    }
-
-
     @Override
     public void createSharePathByUserId(SharePathSaveReqVO createReqVO) {
-        // 如果直推人为空, 则直接结束
-        if (createReqVO.getDescendant() == null) {
-            return;
-        }
-
-        // 判断当前直推人是否有父亲
-        Boolean has = hasParent(createReqVO.getDescendant());
-        if (has) {
-            throw exception(HAS_PARENT);
-        }
-        MemberUserDO ancestor = memberUserService.getUser(createReqVO.getAncestor());
-        MemberUserDO descendant = memberUserService.getUser(createReqVO.getDescendant());
-
-        // 创建直推人以及推荐人的关系
-        // 需要判断当前推荐人跟直推人是否已经存在于用户表(duser)了
-        duserService.hasUserAndCreat(createReqVO);
-
-        // 存储他们之间的关系
-        if (!Objects.equals(createReqVO.getDescendant(), PT_ID)) {
-            sharePathMapper.addNode(
-                    createReqVO.getAncestor(),
-                    ancestor.getName(),
-                    ancestor.getNickname(),
-                    ancestor.getMobile(),
-
-                    createReqVO.getDescendant(),
-                    descendant.getName(),
-                    descendant.getNickname(),
-                    descendant.getMobile());
+        // 需要判断当前用户是否已经存在于关系表中
+        duserService.hasUserAndCreat(createReqVO.getUserId());
+
+        // 推荐人
+        SharePathDO referrer = sharePathMapper.selectOne(new LambdaQueryWrapperX<SharePathDO>().eq(SharePathDO::getUserId, createReqVO.getReferrerId()));
+
+        SharePathDO build = SharePathDO
+                .builder()
+                .depth(referrer.getDepth() + 1)
+                .userId(createReqVO.getUserId())
+                .parentId(createReqVO.getReferrerId())
+                .referrerId(createReqVO.getReferrerId())
+                .userName(createReqVO.getUserName())
+                .phone(createReqVO.getPhone())
+                .build();
+        // 判断左区是否有空位
+        if (referrer.getLeftChildId() == null) {
+            sharePathMapper.insert(build);
+            referrer.setLeftChildId(createReqVO.getUserId());
+            sharePathMapper.update(referrer, new LambdaQueryWrapperX<SharePathDO>().eq(SharePathDO::getUserId, referrer.getUserId()));
+        } else if (referrer.getRightChildId() == null) {    // 判断右区是否有空位
+            sharePathMapper.insert(build);
+            referrer.setRightChildId(createReqVO.getUserId());
+            sharePathMapper.update(referrer, new LambdaQueryWrapperX<SharePathDO>().eq(SharePathDO::getUserId, referrer.getUserId()));
+        } else {
+            // 左区列表
+            List<SharePathDO> leftArea = sharePathMapper.selectListByUserId(referrer.getLeftChildId());
+            // 右区列表
+            List<SharePathDO> rightArea = sharePathMapper.selectListByUserId(referrer.getRightChildId());
+
+            // 判断左右两区的节点数
+            List<SharePathDO> list = leftArea.size() <= rightArea.size() ? leftArea : rightArea;
+            for (SharePathDO sharePathDO : list) {
+                if (sharePathDO.getLeftChildId() == null) {
+                    build.setDepth(sharePathDO.getDepth() + 1);
+                    build.setParentId(sharePathDO.getUserId());
+                    sharePathMapper.insert(build);
+
+                    sharePathDO.setLeftChildId(createReqVO.getUserId());
+                    sharePathMapper.update(sharePathDO, new LambdaQueryWrapperX<SharePathDO>().eq(SharePathDO::getUserId, sharePathDO.getUserId()));
+                    break;
+                } else if (sharePathDO.getRightChildId() == null) {
+                    build.setDepth(sharePathDO.getDepth() + 1);
+                    build.setParentId(sharePathDO.getUserId());
+                    sharePathMapper.insert(build);
+
+                    sharePathDO.setRightChildId(createReqVO.getUserId());
+                    sharePathMapper.update(sharePathDO, new LambdaQueryWrapperX<SharePathDO>().eq(SharePathDO::getUserId, sharePathDO.getUserId()));
+                    break;
+                }
+            }
         }
-
-        OrderPercentageDO orderPercentageDO = orderPercentageMapper.selectList().get(0);
-        duserService.updateDuserSocial(createReqVO.getAncestor(), Long.valueOf(orderPercentageDO.getRegisterAncestorSocialStatus()), SocialStatusEnum.REGISTER_ANCESTOR_SOCIAL.getStatus());
-
     }
 
     @Override
@@ -131,17 +119,16 @@ public class SharePathServiceImpl implements SharePathService {
         }
         // 如果是没有父亲, 将其推荐人设置为平台
         SharePathSaveReqVO build = SharePathSaveReqVO.builder()
-                .ancestor(PT_ID)
-                .descendant(userId)
+                .referrerId(PT_ID)
+                .userId(userId)
                 .build();
         createSharePathByUserId(build);
     }
 
     @Override
-    public Boolean hasParent(Long descendant) {
+    public Boolean hasParent(Long userId) {
         SharePathDO sharePathDO = sharePathMapper.selectOne(new LambdaQueryWrapperX<SharePathDO>()
-                .eqIfPresent(SharePathDO::getDescendant, descendant)
-                .eqIfPresent(SharePathDO::getDepth, 1));
+                .eqIfPresent(SharePathDO::getUserId, userId));
         return sharePathDO != null;
     }
 
@@ -149,74 +136,26 @@ public class SharePathServiceImpl implements SharePathService {
     public AppSharePathRespVO getTeam(PageParam pageParam) {
         Long userId = getLoginUserId();
 
-        //获取团队数
-        LambdaQueryWrapperX<SharePathDO> wrapper = new LambdaQueryWrapperX<>();
-        wrapper.eq(SharePathDO::getAncestor, userId);
-        // +1 加自己
-        Long teamCount = sharePathMapper.selectCount(wrapper) + 1;
-
-        //获取推荐人
-        SharePathDO sharePathDO = sharePathMapper.selectOne(new LambdaQueryWrapperX<SharePathDO>()
-                .eq(SharePathDO::getDescendant, userId)
-                .eq(SharePathDO::getDepth, 1));
-        SharePathRespVO ancestor = BeanUtils.toBean(sharePathDO, SharePathRespVO.class);
-        if (ancestor != null) {
-            ancestor.setAvatar(getAvatar(ancestor.getAncestor()));
-            getSocialStatus(ancestor, ancestor.getAncestor());
-            //获取最大可用额度
-//            setHighQuota(ancestor, ancestor.getAncestor());
-
-            //获取团队数
-            Long descendantsCount = sharePathMapper.selectCount(new LambdaQueryWrapper<SharePathDO>()
-                    .eq(SharePathDO::getAncestor, ancestor.getAncestor())
-            );
-            ancestor.setDescendantsCount(descendantsCount);
-            //里面放的是本人的兄弟分区额度
-            ancestor.setResidueSocial(getBrotherSocial(userId));
-            //获取用户名
-            ancestor.setUsername(memberUserService.getUser(ancestor.getAncestor()).getUsername());
-        }
-
-        //获取团队成员
-        PageResult<SharePathDO> descendants = sharePathMapper.selectPage(pageParam, new LambdaQueryWrapperX<SharePathDO>()
-                .eq(SharePathDO::getAncestor, userId)
-                .eq(SharePathDO::getDepth, 1)
-                .orderByAsc(SharePathDO::getDepth)
-        );
-        PageResult<SharePathRespVO> result = BeanUtils.toBean(descendants, SharePathRespVO.class);
-        result.getList().forEach(item -> {
-            item.setAvatar(getAvatar(item.getDescendant()));
-            getSocialStatus(item, item.getDescendant());
-
-            Long descendantsCount = sharePathMapper.selectCount(new LambdaQueryWrapper<SharePathDO>()
-                    .eq(SharePathDO::getAncestor, item.getDescendant())
-            );
-            item.setDescendantsCount(descendantsCount);
-
-            //获取最大可用额度
-//            setHighQuota(item, item.getDescendant());
-
-            //获取剩余碰撞额度 + 待确权直推奖
-            item.setResidueSocial(getSonSocial(item.getDescendant()));
-            //获取用户名
-            item.setUsername(memberUserService.getUser(item.getDescendant()).getUsername());
-        });
-
+        SharePathDO sharePathDO = sharePathMapper.selectOne(new LambdaQueryWrapperX<SharePathDO>().eq(SharePathDO::getUserId, userId));
+        MemberUserRespVO parentUser = BeanUtils.toBean(memberUserService.getUser(sharePathDO.getParentId()), MemberUserRespVO.class);
+        MemberUserRespVO referrerUser = BeanUtils.toBean(memberUserService.getUser(sharePathDO.getReferrerId()), MemberUserRespVO.class);
 
+        List<MemberUserRespVO> list = BeanUtils.toBean(memberUserService.getUserList(Arrays.asList(sharePathDO.getLeftChildId(), sharePathDO.getRightChildId())), MemberUserRespVO.class);
         return AppSharePathRespVO.builder()
-                .teamCount(teamCount)
-                .ancestor(ancestor)
-                .descendants(result).build();
+                .parentUser(parentUser)
+                .referrerUser(referrerUser)
+                .descendants(list)
+                .build();
     }
 
     @Override
     public SharePathDO getSharePathByDescendant(Long userId) {
-        List<SharePathDO> sharePathDOS = sharePathMapper.selectList(new LambdaQueryWrapperX<SharePathDO>().eqIfPresent(SharePathDO::getDescendant, userId)
-                .eqIfPresent(SharePathDO::getDepth, 1));
+        List<SharePathDO> sharePathDOS = sharePathMapper.selectList(new LambdaQueryWrapperX<SharePathDO>().eqIfPresent(SharePathDO::getUserId, userId));
         if (sharePathDOS.isEmpty()) {
             return null;
         }
-        return sharePathDOS.get(0);    }
+        return sharePathDOS.get(0);
+    }
 
     /**
      * 获取本用户兄弟分区的剩余额度值
@@ -246,31 +185,12 @@ public class SharePathServiceImpl implements SharePathService {
         );
 
         //判断这个用户不是第一次碰撞并且没有查询到昨天的碰撞记录,有可能是昨天或者更早定时任务没有启动导致的,所以再往前查几天
-        if(!partitionCrashDOS.isEmpty() && partitionCrashDO == null){
+        if (!partitionCrashDOS.isEmpty() && partitionCrashDO == null) {
             return getYesterdayCrash(userId, ++today);
         }
         return partitionCrashDO;
     }
 
-    /**
-     * 获取直推人后代分区的剩余额度值
-     *
-     * @param userId 用户编号
-     * @return 剩余额度值
-     */
-    private Long getSonSocial(Long userId) {
-        PartitionCrashDO yesterdayCrash = getYesterdayCrash(userId, 1);
-        return yesterdayCrash == null ? 0 : yesterdayCrash.getSonPrice();
-    }
-
-    private void getSocialStatus(SharePathRespVO sharePathRespVO, Long userId) {
-        if (Objects.equals(userId, PT_ID)) return;
-        DuserDO duser = duserService.getDuserByUser(userId);
-        SocialStatusDO socialStatus = socialStatusService.getSocialStatus(duser.getSocialStatusId());
-        sharePathRespVO.setSocialStatusLevel(socialStatus.getLevel());
-        sharePathRespVO.setSocialStatusLevelName(socialStatus.getName());
-    }
-
     private String getAvatar(Long userId) {
         return memberUserService.getUser(userId).getAvatar();
     }
@@ -286,7 +206,7 @@ public class SharePathServiceImpl implements SharePathService {
 
     @Override
     public void deleteSharePath(Long id) {
-        // 校验存
+        // 校验存
         validateSharePathExists(id);
         // 删除
         sharePathMapper.deleteById(id);
@@ -322,8 +242,8 @@ public class SharePathServiceImpl implements SharePathService {
 
     @Override
     public List<Long> sonsId(Long userId) {
-        List<SharePathDO> sharePathDOS = sharePathMapper.selectList(new LambdaQueryWrapperX<SharePathDO>().eq(SharePathDO::getAncestor, userId));
-        return sharePathDOS.stream().map(SharePathDO::getDescendant).collect(Collectors.toList());
+        SharePathDO sharePathDOS = sharePathMapper.selectOne(new LambdaQueryWrapperX<SharePathDO>().eq(SharePathDO::getUserId, userId));
+        return Arrays.asList(sharePathDOS.getLeftChildId(), sharePathDOS.getRightChildId());
 
     }
 

+ 0 - 29
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/usertopupconsumptionpointsorder/UserTopUpConsumptionPointsOrderService.java

@@ -4,7 +4,6 @@ import javax.validation.*;
 import cn.newfeifan.mall.module.distri.controller.app.usertopupconsumptionpointsorder.vo.*;
 import cn.newfeifan.mall.module.distri.dal.dataobject.usertopupconsumptionpointsorder.UserTopUpConsumptionPointsOrderDO;
 import cn.newfeifan.mall.framework.common.pojo.PageResult;
-import cn.newfeifan.mall.module.pay.dal.dataobject.order.PayOrderDO;
 
 /**
  * 用户充值消费分订单 Service 接口
@@ -21,28 +20,6 @@ public interface UserTopUpConsumptionPointsOrderService {
      */
     UserTopUpConsumptionPointsOrderInfoRespVO createUserTopUpConsumptionPointsOrder(@Valid UserTopUpConsumptionPointsOrderSaveReqVO createReqVO);
 
-    /**
-     * 更新用户充值消费分订单
-     *
-     * @param updateReqVO 更新信息
-     */
-    void updateUserTopUpConsumptionPointsOrder(@Valid UserTopUpConsumptionPointsOrderSaveReqVO updateReqVO);
-
-    /**
-     * 删除用户充值消费分订单
-     *
-     * @param id 编号
-     */
-    void deleteUserTopUpConsumptionPointsOrder(Long id);
-
-    /**
-     * 获得用户充值消费分订单
-     *
-     * @param id 编号
-     * @return 用户充值消费分订单
-     */
-    UserTopUpConsumptionPointsOrderDO getUserTopUpConsumptionPointsOrder(Long id);
-
     /**
      * 获得用户充值消费分订单分页
      *
@@ -51,10 +28,4 @@ public interface UserTopUpConsumptionPointsOrderService {
      */
     PageResult<UserTopUpConsumptionPointsOrderDO> getUserTopUpConsumptionPointsOrderPage(UserTopUpConsumptionPointsOrderPageReqVO pageReqVO);
 
-    /**
-     * 充值消费
-     * @param payOrderDO 支付订单
-     */
-    void topUpConsumptionPoints(PayOrderDO payOrderDO);
-
 }

+ 5 - 124
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/usertopupconsumptionpointsorder/UserTopUpConsumptionPointsOrderServiceImpl.java

@@ -1,26 +1,9 @@
 package cn.newfeifan.mall.module.distri.service.usertopupconsumptionpointsorder;
 
-import cn.newfeifan.mall.framework.common.exception.ErrorCode;
-import cn.newfeifan.mall.module.distri.config.OrderProperties;
 import cn.newfeifan.mall.module.distri.constant.DistriConstants;
-import cn.newfeifan.mall.module.distri.controller.app.consumptionchangelog.vo.ConsumptionChangeLogSaveReqVO;
-import cn.newfeifan.mall.module.distri.controller.app.integral.vo.IntegralSaveReqVO;
-import cn.newfeifan.mall.module.distri.convert.usertopupconsumptionpointsorder.UserTopUpConsumptionPointsOrderConvert;
-import cn.newfeifan.mall.module.distri.dal.dataobject.integral.IntegralDO;
 import cn.newfeifan.mall.module.distri.dal.dataobject.orderpercentage.OrderPercentageDO;
 import cn.newfeifan.mall.module.distri.dal.redis.no.OrderNoRedisDAO;
-import cn.newfeifan.mall.module.distri.enums.ConsumptionEnum;
-import cn.newfeifan.mall.module.distri.service.consumptionchangelog.ConsumptionChangeLogService;
-import cn.newfeifan.mall.module.distri.service.integral.IntegralService;
 import cn.newfeifan.mall.module.distri.service.orderpercentage.OrderPercentageService;
-import cn.newfeifan.mall.module.member.controller.admin.user.vo.MemberUserUpdateReqVO;
-import cn.newfeifan.mall.module.member.dal.dataobject.user.MemberUserDO;
-import cn.newfeifan.mall.module.member.dal.mysql.user.MemberUserMapper;
-import cn.newfeifan.mall.module.member.service.user.MemberUserService;
-import cn.newfeifan.mall.module.pay.dal.dataobject.app.PayAppDO;
-import cn.newfeifan.mall.module.pay.dal.dataobject.order.PayOrderDO;
-import cn.newfeifan.mall.module.pay.dal.mysql.order.PayOrderMapper;
-import cn.newfeifan.mall.module.pay.service.app.PayAppService;
 import com.alibaba.fastjson.JSON;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
@@ -37,11 +20,9 @@ import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
 import cn.newfeifan.mall.module.distri.dal.mysql.usertopupconsumptionpointsorder.UserTopUpConsumptionPointsOrderMapper;
 
 
-import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static cn.newfeifan.mall.framework.common.util.servlet.ServletUtils.getClientIP;
 import static cn.newfeifan.mall.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
 import static cn.newfeifan.mall.framework.web.core.util.WebFrameworkUtils.getTerminal;
-import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
 
 /**
  * 用户充值消费分订单 Service 实现类
@@ -58,19 +39,7 @@ public class UserTopUpConsumptionPointsOrderServiceImpl implements UserTopUpCons
     @Resource
     private OrderPercentageService orderPercentageService;
     @Resource
-    private IntegralService integralService;
-    @Resource
-    private ConsumptionChangeLogService consumptionChangeLogService;
-    @Resource
     private OrderNoRedisDAO orderNoRedisDAO;
-    @Resource
-    private OrderProperties orderProperties;
-    @Resource
-    private PayAppService appService;
-    @Resource
-    private PayOrderMapper payOrderMapper;
-    @Resource
-    private MemberUserService memberUserService;
 
     @Override
     public UserTopUpConsumptionPointsOrderInfoRespVO createUserTopUpConsumptionPointsOrder(UserTopUpConsumptionPointsOrderSaveReqVO createReqVO) {
@@ -80,9 +49,6 @@ public class UserTopUpConsumptionPointsOrderServiceImpl implements UserTopUpCons
         UserTopUpConsumptionPointsOrderDO userTopUpConsumptionPointsOrder = BeanUtils.toBean(createReqVO, UserTopUpConsumptionPointsOrderDO.class);
         userTopUpConsumptionPointsOrderMapper.insert(userTopUpConsumptionPointsOrder);
 
-        // 创建支付订单
-        PayOrderDO payOrder = createPayOrder(userTopUpConsumptionPointsOrder);
-        userTopUpConsumptionPointsOrder.setPayOrderId(payOrder.getId());
 
         // 同步支付订单id
         userTopUpConsumptionPointsOrderMapper.updateById(userTopUpConsumptionPointsOrder);
@@ -94,21 +60,6 @@ public class UserTopUpConsumptionPointsOrderServiceImpl implements UserTopUpCons
                 .build();
     }
 
-    /**
-     * 创建支付订单
-     *
-     * @param createReqVO 充值订单信息
-     * @return 支付订单
-     */
-    private PayOrderDO createPayOrder(UserTopUpConsumptionPointsOrderDO createReqVO) {
-        // 校验 App
-        PayAppDO app = appService.validPayApp(orderProperties.getAppId());
-
-        PayOrderDO payOrderDO = UserTopUpConsumptionPointsOrderConvert.INSTANCE.convert(createReqVO, orderProperties);
-        payOrderDO.setNotifyUrl(app.getOrderNotifyUrl());
-        payOrderMapper.insert(payOrderDO);
-        return payOrderDO;
-    }
 
     /**
      * 订单转换
@@ -119,10 +70,10 @@ public class UserTopUpConsumptionPointsOrderServiceImpl implements UserTopUpCons
         // 计算百分比
         OrderPercentageDO orderPercentageDO = orderPercentageService.queryStatus();
 
-        if(createReqVO.getPayPrice() < Double.parseDouble(orderPercentageDO.getUserTopUpConsumptionPoints())){
-            ErrorCode ERROR = new ErrorCode(1_002_030_038, "用户充值金额不得小于:" + orderPercentageDO.getUserTopUpConsumptionPoints());
-            throw exception(ERROR);
-        }
+//        if(createReqVO.getPayPrice() < Double.parseDouble(orderPercentageDO.getUserTopUpConsumptionPoints())){
+//            ErrorCode ERROR = new ErrorCode(1_002_030_038, "用户充值金额不得小于:" + orderPercentageDO.getUserTopUpConsumptionPoints());
+//            throw exception(ERROR);
+//        }
 
         createReqVO.setUserId(getLoginUserId());
         createReqVO.setUserIp(getClientIP());
@@ -137,87 +88,17 @@ public class UserTopUpConsumptionPointsOrderServiceImpl implements UserTopUpCons
 
         // 根据充值金额计算实际到账金额
         if(createReqVO.getTopUpConsumptionPoints() >= Double.parseDouble(orderPercentageDO.getTriggerMagnificationPoints()) * DistriConstants.INTEGRAL_PAGE2DB){
-        createReqVO.setPracticalConsumptionPoints((long) (createReqVO.getTopUpConsumptionPoints() * Double.parseDouble(orderPercentageDO.getConsumptionMagnification())));
+        createReqVO.setPracticalConsumptionPoints((long) (createReqVO.getTopUpConsumptionPoints() * Double.parseDouble(orderPercentageDO.getIntegralMagnification())));
         } else {
             createReqVO.setPracticalConsumptionPoints(createReqVO.getTopUpConsumptionPoints().longValue());
         }
         createReqVO.setPercentTemplate(JSON.toJSONString(orderPercentageDO));
     }
 
-    @Override
-    public void updateUserTopUpConsumptionPointsOrder(UserTopUpConsumptionPointsOrderSaveReqVO updateReqVO) {
-        // 校验存在
-        validateUserTopUpConsumptionPointsOrderExists(updateReqVO.getId());
-        // 更新
-        UserTopUpConsumptionPointsOrderDO updateObj = BeanUtils.toBean(updateReqVO, UserTopUpConsumptionPointsOrderDO.class);
-        userTopUpConsumptionPointsOrderMapper.updateById(updateObj);
-    }
-
-    @Override
-    public void deleteUserTopUpConsumptionPointsOrder(Long id) {
-        // 校验存在
-        validateUserTopUpConsumptionPointsOrderExists(id);
-        // 删除
-        userTopUpConsumptionPointsOrderMapper.deleteById(id);
-    }
-
-    private void validateUserTopUpConsumptionPointsOrderExists(Long id) {
-        if (userTopUpConsumptionPointsOrderMapper.selectById(id) == null) {
-            throw exception(USER_TOP_UP_CONSUMPTION_POINTS_ORDER_NOT_EXISTS);
-        }
-    }
-
-    @Override
-    public UserTopUpConsumptionPointsOrderDO getUserTopUpConsumptionPointsOrder(Long id) {
-        return userTopUpConsumptionPointsOrderMapper.selectById(id);
-    }
-
     @Override
     public PageResult<UserTopUpConsumptionPointsOrderDO> getUserTopUpConsumptionPointsOrderPage(UserTopUpConsumptionPointsOrderPageReqVO pageReqVO) {
         return userTopUpConsumptionPointsOrderMapper.selectPage(pageReqVO);
     }
 
-    @Override
-    public void topUpConsumptionPoints(PayOrderDO payOrderDO) {
-        UserTopUpConsumptionPointsOrderDO topUpOrder = userTopUpConsumptionPointsOrderMapper.selectById(payOrderDO.getMerchantOrderId());
-
-        log.info("充值订单对象:{}", topUpOrder);
-        if(topUpOrder.getPayStatus()){
-            log.info("充值订单状态为已支付,return结束!");
-            return;
-        }
-
-        // 修改订单状态
-        userTopUpConsumptionPointsOrderMapper.updateById(UserTopUpConsumptionPointsOrderDO.builder()
-                .id(topUpOrder.getId())
-                .payStatus(true)
-                .payTime(payOrderDO.getSuccessTime())
-                .payChannelCode(payOrderDO.getChannelCode())
-                .finishTime(payOrderDO.getSuccessTime())
-                .build());
-
-        // 获取钱包
-        IntegralDO integralDO = integralService.selectByUser(topUpOrder.getUserId());
-        integralDO.setConsumptionPoints(integralDO.getConsumptionPoints() + topUpOrder.getPracticalConsumptionPoints());
-        integralService.updateIntegral(BeanUtils.toBean(integralDO, IntegralSaveReqVO.class));
-
-        // 消费分变动日志
-        consumptionChangeLogService.createConsumptionChangeLog(ConsumptionChangeLogSaveReqVO.builder()
-                .userId(topUpOrder.getUserId())
-                .consumptionStatus(ConsumptionEnum.TOP_UP_GET.getType())
-                .consumptionPoints(topUpOrder.getPracticalConsumptionPoints())
-                .afterConsumptionPoints(integralDO.getConsumptionPoints())
-                .practicalConsumptionPoints(topUpOrder.getTopUpConsumptionPoints())
-                .generateUserId(topUpOrder.getUserId())
-                .build());
-
-        //计算充值消费分超过设定金额将用户标志为代理商
-        MemberUserDO user = memberUserService.getUser(topUpOrder.getUserId());
-        OrderPercentageDO orderPercentageDO = orderPercentageService.queryStatus();
-        if(topUpOrder.getTopUpConsumptionPoints() >= Long.parseLong(orderPercentageDO.getAgentQuota()) && !user.getAgent()){
-            user.setAgent(true);
-            memberUserService.updateUser(BeanUtils.toBean(user, MemberUserUpdateReqVO.class));
-        }
-    }
 
 }

部分文件因为文件数量过多而无法显示