Browse Source

首次提交

Yangzw 2 months ago
parent
commit
5b8c4af17c
25 changed files with 352 additions and 405 deletions
  1. 24 0
      feifan-module-distri/feifan-module-distri-api/src/main/java/cn/newfeifan/mall/module/distri/enums/IntegralTypeEnum.java
  2. 0 80
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/consumptiontopuplog/ConsumptionTopUpLogController.java
  3. 80 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integraltopuplog/IntegralTopUpLogController.java
  4. 7 7
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integraltopuplog/vo/IntegralTopUpLogPageReqVO.java
  5. 9 9
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integraltopuplog/vo/IntegralTopUpLogRespVO.java
  6. 8 8
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integraltopuplog/vo/IntegralTopUpLogSaveReqVO.java
  7. 21 21
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integraltransferlog/IntegralTransferLogController.java
  8. 2 2
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integraltransferlog/vo/IntegralTransferLogPageReqVO.java
  9. 2 2
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integraltransferlog/vo/IntegralTransferLogRespVO.java
  10. 2 2
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integraltransferlog/vo/IntegralTransferLogSaveReqVO.java
  11. 6 6
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/integraltopuplog/IntegralTopUpLogDO.java
  12. 4 4
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/integraltransferlog/IntegralTransferLogDO.java
  13. 0 30
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/consumptiontransferlog/ConsumptionTransferLogMapper.java
  14. 30 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/integraltransferlog/IntegralTransferLogMapper.java
  15. 1 21
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integral/IntegralService.java
  16. 4 114
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integral/IntegralServiceImpl.java
  17. 10 10
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integraltopuplog/IntegralTopUpLogService.java
  18. 52 54
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integraltopuplog/IntegralTopUpLogServiceImpl.java
  19. 9 9
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integraltransferlog/IntegralTransferLogService.java
  20. 77 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integraltransferlog/IntegralTransferLogServiceImpl.java
  21. 1 1
      feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/controller/admin/point/vo/recrod/MemberPointRecordRespVO.java
  22. 1 1
      feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/convert/point/MemberPointRecordConvert.java
  23. 1 1
      feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/convert/signin/MemberSignInRecordConvert.java
  24. 1 3
      feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/service/level/MemberLevelServiceImpl.java
  25. 0 20
      feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/service/point/MemberPointRecordServiceImpl.java

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

@@ -0,0 +1,24 @@
+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;
+
+    public static IntegralTypeEnum getIntegralTypeEnumByType(int status) {
+        for (IntegralTypeEnum integralTypeEnum : IntegralTypeEnum.values()) {
+            if (integralTypeEnum.getType() == status) {
+                return integralTypeEnum;
+            }
+        }
+        return null;
+    }
+}

+ 0 - 80
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/consumptiontopuplog/ConsumptionTopUpLogController.java

@@ -1,80 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.admin.consumptiontopuplog;
-
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-
-import org.springframework.validation.annotation.Validated;
-import org.springframework.security.access.prepost.PreAuthorize;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.Operation;
-
-import javax.validation.*;
-
-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.admin.consumptiontopuplog.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.consumptiontopuplog.ConsumptionTopUpLogDO;
-import cn.newfeifan.mall.module.distri.service.consumptiontopuplog.ConsumptionTopUpLogService;
-
-@Tag(name = "管理后台 - 平台消费分充值记录")
-@RestController
-@RequestMapping("/distri/consumption-top-up-log")
-@Validated
-public class ConsumptionTopUpLogController {
-
-    @Resource
-    private ConsumptionTopUpLogService consumptionTopUpLogService;
-
-    @PostMapping("/create")
-    @Operation(summary = "创建平台消费分充值记录")
-    @PreAuthorize("@ss.hasPermission('distri:consumption-top-up-log:create')")
-    public CommonResult<Long> createConsumptionTopUpLog(@Valid @RequestBody ConsumptionTopUpLogSaveReqVO createReqVO) {
-        return success(consumptionTopUpLogService.createConsumptionTopUpLog(createReqVO));
-    }
-
-    @PutMapping("/update")
-    @Operation(summary = "更新平台消费分充值记录")
-    @PreAuthorize("@ss.hasPermission('distri:consumption-top-up-log:update')")
-    public CommonResult<Boolean> updateConsumptionTopUpLog(@Valid @RequestBody ConsumptionTopUpLogSaveReqVO updateReqVO) {
-        consumptionTopUpLogService.updateConsumptionTopUpLog(updateReqVO);
-        return success(true);
-    }
-
-    @GetMapping("/get")
-    @Operation(summary = "获得平台消费分充值记录")
-    @Parameter(name = "id", description = "编号", required = true, example = "1024")
-    @PreAuthorize("@ss.hasPermission('distri:consumption-top-up-log:query')")
-    public CommonResult<ConsumptionTopUpLogRespVO> getConsumptionTopUpLog(@RequestParam("id") Long id) {
-        ConsumptionTopUpLogDO consumptionTopUpLog = consumptionTopUpLogService.getConsumptionTopUpLog(id);
-        return success(BeanUtils.toBean(consumptionTopUpLog, ConsumptionTopUpLogRespVO.class));
-    }
-
-    @GetMapping("/page")
-    @Operation(summary = "获得平台消费分充值记录分页")
-    @PreAuthorize("@ss.hasPermission('distri:consumption-top-up-log:query')")
-    public CommonResult<PageResult<ConsumptionTopUpLogRespVO>> getConsumptionTopUpLogPage(@Valid ConsumptionTopUpLogPageReqVO pageReqVO) {
-        PageResult<ConsumptionTopUpLogDO> pageResult = consumptionTopUpLogService.getConsumptionTopUpLogPage(pageReqVO);
-        return success(BeanUtils.toBean(pageResult, ConsumptionTopUpLogRespVO.class));
-    }
-
-    @GetMapping("/isFirstConsumption")
-    @Operation(summary = "是否是第一次充值消费分")
-    @PreAuthorize("@ss.hasPermission('distri:consumption-top-up-log:query')")
-    public CommonResult<ConsumptionInfoVO> isFirstConsumption(@RequestParam("userId") Long userId) {
-        return success(consumptionTopUpLogService.isFirstConsumption(userId));
-    }
-
-    @GetMapping("/ptTopUpWithUserTopUpList")
-    @Operation(summary = "获取平台充值和用户充值记录")
-    @PreAuthorize("@ss.hasPermission('distri:consumption-top-up-log:ptTopUpWithUserTopUpList')")
-    public CommonResult<PtTopUpWithUserTopUpRespVO> ptTopUpWithUserTopUpList() {
-        return success(consumptionTopUpLogService.ptTopUpWithUserTopUpList());
-    }
-}

+ 80 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integraltopuplog/IntegralTopUpLogController.java

@@ -0,0 +1,80 @@
+package cn.newfeifan.mall.module.distri.controller.admin.integraltopuplog;
+
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.*;
+
+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.admin.integraltopuplog.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.integraltopuplog.IntegralTopUpLogDO;
+import cn.newfeifan.mall.module.distri.service.integraltopuplog.IntegralTopUpLogService;
+
+@Tag(name = "管理后台 - 平台积分充值记录")
+@RestController
+@RequestMapping("/distri/consumption-top-up-log")
+@Validated
+public class IntegralTopUpLogController {
+
+    @Resource
+    private IntegralTopUpLogService integralTopUpLogService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建平台积分充值记录")
+    @PreAuthorize("@ss.hasPermission('distri:consumption-top-up-log:create')")
+    public CommonResult<Long> createConsumptionTopUpLog(@Valid @RequestBody IntegralTopUpLogSaveReqVO createReqVO) {
+        return success(integralTopUpLogService.createConsumptionTopUpLog(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新平台积分充值记录")
+    @PreAuthorize("@ss.hasPermission('distri:consumption-top-up-log:update')")
+    public CommonResult<Boolean> updateConsumptionTopUpLog(@Valid @RequestBody IntegralTopUpLogSaveReqVO updateReqVO) {
+        integralTopUpLogService.updateConsumptionTopUpLog(updateReqVO);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得平台积分充值记录")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('distri:consumption-top-up-log:query')")
+    public CommonResult<IntegralTopUpLogRespVO> getConsumptionTopUpLog(@RequestParam("id") Long id) {
+        IntegralTopUpLogDO consumptionTopUpLog = integralTopUpLogService.getConsumptionTopUpLog(id);
+        return success(BeanUtils.toBean(consumptionTopUpLog, IntegralTopUpLogRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得平台积分充值记录分页")
+    @PreAuthorize("@ss.hasPermission('distri:consumption-top-up-log:query')")
+    public CommonResult<PageResult<IntegralTopUpLogRespVO>> getConsumptionTopUpLogPage(@Valid IntegralTopUpLogPageReqVO pageReqVO) {
+        PageResult<IntegralTopUpLogDO> pageResult = integralTopUpLogService.getConsumptionTopUpLogPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, IntegralTopUpLogRespVO.class));
+    }
+
+    @GetMapping("/isFirstConsumption")
+    @Operation(summary = "是否是第一次充值积分")
+    @PreAuthorize("@ss.hasPermission('distri:consumption-top-up-log:query')")
+    public CommonResult<IntegralInfoVO> isFirstConsumption(@RequestParam("userId") Long userId) {
+        return success(integralTopUpLogService.isFirstConsumption(userId));
+    }
+
+    @GetMapping("/ptTopUpWithUserTopUpList")
+    @Operation(summary = "获取平台充值和用户充值记录")
+    @PreAuthorize("@ss.hasPermission('distri:consumption-top-up-log:ptTopUpWithUserTopUpList')")
+    public CommonResult<PtTopUpWithUserTopUpRespVO> ptTopUpWithUserTopUpList() {
+        return success(integralTopUpLogService.ptTopUpWithUserTopUpList());
+    }
+}

+ 7 - 7
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/consumptiontopuplog/vo/ConsumptionTopUpLogPageReqVO.java → feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integraltopuplog/vo/IntegralTopUpLogPageReqVO.java

@@ -1,4 +1,4 @@
-package cn.newfeifan.mall.module.distri.controller.admin.consumptiontopuplog.vo;
+package cn.newfeifan.mall.module.distri.controller.admin.integraltopuplog.vo;
 
 
 import lombok.*;
 import lombok.*;
 import io.swagger.v3.oas.annotations.media.Schema;
 import io.swagger.v3.oas.annotations.media.Schema;
@@ -8,11 +8,11 @@ import java.time.LocalDateTime;
 
 
 import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
 import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
 
 
-@Schema(description = "管理后台 - 平台消费分充值记录分页 Request VO")
+@Schema(description = "管理后台 - 平台分充值记录分页 Request VO")
 @Data
 @Data
 @EqualsAndHashCode(callSuper = true)
 @EqualsAndHashCode(callSuper = true)
 @ToString(callSuper = true)
 @ToString(callSuper = true)
-public class ConsumptionTopUpLogPageReqVO extends PageParam {
+public class IntegralTopUpLogPageReqVO extends PageParam {
 
 
     @Schema(description = "用户ID", example = "22163")
     @Schema(description = "用户ID", example = "22163")
     private Long userId;
     private Long userId;
@@ -20,11 +20,11 @@ public class ConsumptionTopUpLogPageReqVO extends PageParam {
     @Schema(description = "转账凭证附件")
     @Schema(description = "转账凭证附件")
     private String attachment;
     private String attachment;
 
 
-    @Schema(description = "消费分")
-    private Long consumptionPoints;
+    @Schema(description = "分")
+    private Long integralPoints;
 
 
-    @Schema(description = "实际消费分")
-    private Long practicalConsumptionPoints;
+    @Schema(description = "实际分")
+    private Long practicalIntegralPoints;
 
 
     @Schema(description = "创建时间")
     @Schema(description = "创建时间")
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)

+ 9 - 9
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/consumptiontopuplog/vo/ConsumptionTopUpLogRespVO.java → feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integraltopuplog/vo/IntegralTopUpLogRespVO.java

@@ -1,14 +1,14 @@
-package cn.newfeifan.mall.module.distri.controller.admin.consumptiontopuplog.vo;
+package cn.newfeifan.mall.module.distri.controller.admin.integraltopuplog.vo;
 
 
 import io.swagger.v3.oas.annotations.media.Schema;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
 import lombok.*;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import com.alibaba.excel.annotation.*;
 import com.alibaba.excel.annotation.*;
 
 
-@Schema(description = "管理后台 - 平台消费分充值记录 Response VO")
+@Schema(description = "管理后台 - 平台分充值记录 Response VO")
 @Data
 @Data
 @ExcelIgnoreUnannotated
 @ExcelIgnoreUnannotated
-public class ConsumptionTopUpLogRespVO {
+public class IntegralTopUpLogRespVO {
 
 
     @Schema(description = "充值编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "5725")
     @Schema(description = "充值编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "5725")
     @ExcelProperty("充值编号")
     @ExcelProperty("充值编号")
@@ -22,13 +22,13 @@ public class ConsumptionTopUpLogRespVO {
     @ExcelProperty("转账凭证附件")
     @ExcelProperty("转账凭证附件")
     private String attachment;
     private String attachment;
 
 
-    @Schema(description = "消费分", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("消费分")
-    private Long consumptionPoints;
+    @Schema(description = "分", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("分")
+    private Long integralPoints;
 
 
-    @Schema(description = "实际消费分", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("实际消费分")
-    private Long practicalConsumptionPoints;
+    @Schema(description = "实际分", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("实际分")
+    private Long practicalIntegralPoints;
 
 
     @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
     @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
     @ExcelProperty("创建时间")
     @ExcelProperty("创建时间")

+ 8 - 8
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/consumptiontopuplog/vo/ConsumptionTopUpLogSaveReqVO.java → feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integraltopuplog/vo/IntegralTopUpLogSaveReqVO.java

@@ -1,13 +1,13 @@
-package cn.newfeifan.mall.module.distri.controller.admin.consumptiontopuplog.vo;
+package cn.newfeifan.mall.module.distri.controller.admin.integraltopuplog.vo;
 
 
 import cn.newfeifan.mall.module.system.api.sms.dto.code.SmsCodeUseReqDTO;
 import cn.newfeifan.mall.module.system.api.sms.dto.code.SmsCodeUseReqDTO;
 import io.swagger.v3.oas.annotations.media.Schema;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
 import lombok.*;
 import javax.validation.constraints.*;
 import javax.validation.constraints.*;
 
 
-@Schema(description = "管理后台 - 平台消费分充值记录新增/修改 Request VO")
+@Schema(description = "管理后台 - 平台分充值记录新增/修改 Request VO")
 @Data
 @Data
-public class ConsumptionTopUpLogSaveReqVO {
+public class IntegralTopUpLogSaveReqVO {
 
 
     @Schema(description = "充值编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "5725")
     @Schema(description = "充值编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "5725")
     private Long id;
     private Long id;
@@ -19,12 +19,12 @@ public class ConsumptionTopUpLogSaveReqVO {
     @Schema(description = "转账凭证附件")
     @Schema(description = "转账凭证附件")
     private String attachment;
     private String attachment;
 
 
-    @Schema(description = "消费分", requiredMode = Schema.RequiredMode.REQUIRED)
-    @NotNull(message = "消费分不能为空")
-    private Long consumptionPoints;
+    @Schema(description = "分", requiredMode = Schema.RequiredMode.REQUIRED)
+    @NotNull(message = "分不能为空")
+    private Long integralPoints;
 
 
-    @Schema(description = "实际消费分", requiredMode = Schema.RequiredMode.REQUIRED)
-    private Long practicalConsumptionPoints;
+    @Schema(description = "实际分", requiredMode = Schema.RequiredMode.REQUIRED)
+    private Long practicalIntegralPoints;
 
 
     @Schema(description = "用户名", example = "赵六")
     @Schema(description = "用户名", example = "赵六")
     @NotNull(message = "用户名不能为空")
     @NotNull(message = "用户名不能为空")

+ 21 - 21
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/consumptiontransferlog/ConsumptionTransferLogController.java → feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integraltransferlog/IntegralTransferLogController.java

@@ -1,4 +1,4 @@
-package cn.newfeifan.mall.module.distri.controller.admin.consumptiontransferlog;
+package cn.newfeifan.mall.module.distri.controller.admin.integraltransferlog;
 
 
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 import javax.annotation.Resource;
 import javax.annotation.Resource;
@@ -24,31 +24,31 @@ import cn.newfeifan.mall.framework.excel.core.util.ExcelUtils;
 import cn.newfeifan.mall.framework.operatelog.core.annotations.OperateLog;
 import cn.newfeifan.mall.framework.operatelog.core.annotations.OperateLog;
 import static cn.newfeifan.mall.framework.operatelog.core.enums.OperateTypeEnum.*;
 import static cn.newfeifan.mall.framework.operatelog.core.enums.OperateTypeEnum.*;
 
 
-import cn.newfeifan.mall.module.distri.controller.admin.consumptiontransferlog.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.consumptiontransferlog.ConsumptionTransferLogDO;
-import cn.newfeifan.mall.module.distri.service.consumptiontransferlog.ConsumptionTransferLogService;
+import cn.newfeifan.mall.module.distri.controller.admin.integraltransferlog.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.integraltransferlog.IntegralTransferLogDO;
+import cn.newfeifan.mall.module.distri.service.integraltransferlog.IntegralTransferLogService;
 
 
 @Tag(name = "管理后台 - 消费分转让记录")
 @Tag(name = "管理后台 - 消费分转让记录")
 @RestController
 @RestController
 @RequestMapping("/distri/consumption-transfer-log")
 @RequestMapping("/distri/consumption-transfer-log")
 @Validated
 @Validated
-public class ConsumptionTransferLogController {
+public class IntegralTransferLogController {
 
 
     @Resource
     @Resource
-    private ConsumptionTransferLogService consumptionTransferLogService;
+    private IntegralTransferLogService integralTransferLogService;
 
 
     @PostMapping("/create")
     @PostMapping("/create")
     @Operation(summary = "创建消费分转让记录")
     @Operation(summary = "创建消费分转让记录")
     @PreAuthorize("@ss.hasPermission('distri:consumption-transfer-log:create')")
     @PreAuthorize("@ss.hasPermission('distri:consumption-transfer-log:create')")
-    public CommonResult<Long> createConsumptionTransferLog(@Valid @RequestBody ConsumptionTransferLogSaveReqVO createReqVO) {
-        return success(consumptionTransferLogService.createConsumptionTransferLog(createReqVO));
+    public CommonResult<Long> createConsumptionTransferLog(@Valid @RequestBody IntegralTransferLogSaveReqVO createReqVO) {
+        return success(integralTransferLogService.createConsumptionTransferLog(createReqVO));
     }
     }
 
 
     @PutMapping("/update")
     @PutMapping("/update")
     @Operation(summary = "更新消费分转让记录")
     @Operation(summary = "更新消费分转让记录")
     @PreAuthorize("@ss.hasPermission('distri:consumption-transfer-log:update')")
     @PreAuthorize("@ss.hasPermission('distri:consumption-transfer-log:update')")
-    public CommonResult<Boolean> updateConsumptionTransferLog(@Valid @RequestBody ConsumptionTransferLogSaveReqVO updateReqVO) {
-        consumptionTransferLogService.updateConsumptionTransferLog(updateReqVO);
+    public CommonResult<Boolean> updateConsumptionTransferLog(@Valid @RequestBody IntegralTransferLogSaveReqVO updateReqVO) {
+        integralTransferLogService.updateConsumptionTransferLog(updateReqVO);
         return success(true);
         return success(true);
     }
     }
 
 
@@ -57,7 +57,7 @@ public class ConsumptionTransferLogController {
     @Parameter(name = "id", description = "编号", required = true)
     @Parameter(name = "id", description = "编号", required = true)
     @PreAuthorize("@ss.hasPermission('distri:consumption-transfer-log:delete')")
     @PreAuthorize("@ss.hasPermission('distri:consumption-transfer-log:delete')")
     public CommonResult<Boolean> deleteConsumptionTransferLog(@RequestParam("id") Long id) {
     public CommonResult<Boolean> deleteConsumptionTransferLog(@RequestParam("id") Long id) {
-        consumptionTransferLogService.deleteConsumptionTransferLog(id);
+        integralTransferLogService.deleteConsumptionTransferLog(id);
         return success(true);
         return success(true);
     }
     }
 
 
@@ -65,30 +65,30 @@ public class ConsumptionTransferLogController {
     @Operation(summary = "获得消费分转让记录")
     @Operation(summary = "获得消费分转让记录")
     @Parameter(name = "id", description = "编号", required = true, example = "1024")
     @Parameter(name = "id", description = "编号", required = true, example = "1024")
     @PreAuthorize("@ss.hasPermission('distri:consumption-transfer-log:query')")
     @PreAuthorize("@ss.hasPermission('distri:consumption-transfer-log:query')")
-    public CommonResult<ConsumptionTransferLogRespVO> getConsumptionTransferLog(@RequestParam("id") Long id) {
-        ConsumptionTransferLogDO consumptionTransferLog = consumptionTransferLogService.getConsumptionTransferLog(id);
-        return success(BeanUtils.toBean(consumptionTransferLog, ConsumptionTransferLogRespVO.class));
+    public CommonResult<IntegralTransferLogRespVO> getConsumptionTransferLog(@RequestParam("id") Long id) {
+        IntegralTransferLogDO consumptionTransferLog = integralTransferLogService.getConsumptionTransferLog(id);
+        return success(BeanUtils.toBean(consumptionTransferLog, IntegralTransferLogRespVO.class));
     }
     }
 
 
     @GetMapping("/page")
     @GetMapping("/page")
     @Operation(summary = "获得消费分转让记录分页")
     @Operation(summary = "获得消费分转让记录分页")
     @PreAuthorize("@ss.hasPermission('distri:consumption-transfer-log:query')")
     @PreAuthorize("@ss.hasPermission('distri:consumption-transfer-log:query')")
-    public CommonResult<PageResult<ConsumptionTransferLogRespVO>> getConsumptionTransferLogPage(@Valid ConsumptionTransferLogPageReqVO pageReqVO) {
-        PageResult<ConsumptionTransferLogDO> pageResult = consumptionTransferLogService.getConsumptionTransferLogPage(pageReqVO);
-        return success(BeanUtils.toBean(pageResult, ConsumptionTransferLogRespVO.class));
+    public CommonResult<PageResult<IntegralTransferLogRespVO>> getConsumptionTransferLogPage(@Valid IntegralTransferLogPageReqVO pageReqVO) {
+        PageResult<IntegralTransferLogDO> pageResult = integralTransferLogService.getConsumptionTransferLogPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, IntegralTransferLogRespVO.class));
     }
     }
 
 
     @GetMapping("/export-excel")
     @GetMapping("/export-excel")
     @Operation(summary = "导出消费分转让记录 Excel")
     @Operation(summary = "导出消费分转让记录 Excel")
     @PreAuthorize("@ss.hasPermission('distri:consumption-transfer-log:export')")
     @PreAuthorize("@ss.hasPermission('distri:consumption-transfer-log:export')")
     @OperateLog(type = EXPORT)
     @OperateLog(type = EXPORT)
-    public void exportConsumptionTransferLogExcel(@Valid ConsumptionTransferLogPageReqVO pageReqVO,
+    public void exportConsumptionTransferLogExcel(@Valid IntegralTransferLogPageReqVO pageReqVO,
               HttpServletResponse response) throws IOException {
               HttpServletResponse response) throws IOException {
         pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
         pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
-        List<ConsumptionTransferLogDO> list = consumptionTransferLogService.getConsumptionTransferLogPage(pageReqVO).getList();
+        List<IntegralTransferLogDO> list = integralTransferLogService.getConsumptionTransferLogPage(pageReqVO).getList();
         // 导出 Excel
         // 导出 Excel
-        ExcelUtils.write(response, "消费分转让记录.xls", "数据", ConsumptionTransferLogRespVO.class,
-                        BeanUtils.toBean(list, ConsumptionTransferLogRespVO.class));
+        ExcelUtils.write(response, "消费分转让记录.xls", "数据", IntegralTransferLogRespVO.class,
+                        BeanUtils.toBean(list, IntegralTransferLogRespVO.class));
     }
     }
 
 
 }
 }

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

@@ -1,4 +1,4 @@
-package cn.newfeifan.mall.module.distri.controller.admin.consumptiontransferlog.vo;
+package cn.newfeifan.mall.module.distri.controller.admin.integraltransferlog.vo;
 
 
 import lombok.*;
 import lombok.*;
 import io.swagger.v3.oas.annotations.media.Schema;
 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
 @Data
 @EqualsAndHashCode(callSuper = true)
 @EqualsAndHashCode(callSuper = true)
 @ToString(callSuper = true)
 @ToString(callSuper = true)
-public class ConsumptionTransferLogPageReqVO extends PageParam {
+public class IntegralTransferLogPageReqVO extends PageParam {
 
 
     @Schema(description = "转让用户ID", example = "7655")
     @Schema(description = "转让用户ID", example = "7655")
     private Long transferUserId;
     private Long transferUserId;

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

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

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

@@ -1,4 +1,4 @@
-package cn.newfeifan.mall.module.distri.controller.admin.consumptiontransferlog.vo;
+package cn.newfeifan.mall.module.distri.controller.admin.integraltransferlog.vo;
 
 
 import io.swagger.v3.oas.annotations.media.Schema;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
 import lombok.*;
@@ -6,7 +6,7 @@ import javax.validation.constraints.*;
 
 
 @Schema(description = "管理后台 - 消费分转让记录新增/修改 Request VO")
 @Schema(description = "管理后台 - 消费分转让记录新增/修改 Request VO")
 @Data
 @Data
-public class ConsumptionTransferLogSaveReqVO {
+public class IntegralTransferLogSaveReqVO {
 
 
     @Schema(description = "日志编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "5320")
     @Schema(description = "日志编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "5320")
     private Long id;
     private Long id;

+ 6 - 6
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/consumptiontopuplog/ConsumptionTopUpLogDO.java → feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/integraltopuplog/IntegralTopUpLogDO.java

@@ -1,4 +1,4 @@
-package cn.newfeifan.mall.module.distri.dal.dataobject.consumptiontopuplog;
+package cn.newfeifan.mall.module.distri.dal.dataobject.integraltopuplog;
 
 
 import lombok.*;
 import lombok.*;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.annotation.*;
@@ -9,15 +9,15 @@ import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
  *
  *
  * @author 非繁人
  * @author 非繁人
  */
  */
-@TableName("distri_consumption_top_up_log")
-@KeySequence("distri_consumption_top_up_log_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@TableName("distri_integral_top_up_log")
+@KeySequence("distri_integral_top_up_log_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
 @Data
 @Data
 @EqualsAndHashCode(callSuper = true)
 @EqualsAndHashCode(callSuper = true)
 @ToString(callSuper = true)
 @ToString(callSuper = true)
 @Builder
 @Builder
 @NoArgsConstructor
 @NoArgsConstructor
 @AllArgsConstructor
 @AllArgsConstructor
-public class ConsumptionTopUpLogDO extends BaseDO {
+public class IntegralTopUpLogDO extends BaseDO {
 
 
     /**
     /**
      * 充值编号
      * 充值编号
@@ -35,11 +35,11 @@ public class ConsumptionTopUpLogDO extends BaseDO {
     /**
     /**
      * 消费分
      * 消费分
      */
      */
-    private Long consumptionPoints;
+    private Long integralPoints;
     /**
     /**
      * 实际消费分
      * 实际消费分
      */
      */
-    private Long practicalConsumptionPoints;
+    private Long practicalIntegralPoints;
     /**
     /**
      * 用户名
      * 用户名
      */
      */

+ 4 - 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 lombok.*;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.annotation.*;
@@ -9,15 +9,15 @@ import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
  *
  *
  * @author 非繁人
  * @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
 @Data
 @EqualsAndHashCode(callSuper = true)
 @EqualsAndHashCode(callSuper = true)
 @ToString(callSuper = true)
 @ToString(callSuper = true)
 @Builder
 @Builder
 @NoArgsConstructor
 @NoArgsConstructor
 @AllArgsConstructor
 @AllArgsConstructor
-public class ConsumptionTransferLogDO extends BaseDO {
+public class IntegralTransferLogDO extends BaseDO {
 
 
     /**
     /**
      * 日志编号
      * 日志编号

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

@@ -1,30 +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.dal.dataobject.consumptiontransferlog.ConsumptionTransferLogDO;
-import org.apache.ibatis.annotations.Mapper;
-import cn.newfeifan.mall.module.distri.controller.admin.consumptiontransferlog.vo.*;
-
-/**
- * 消费分转让记录 Mapper
- *
- * @author 非繁人
- */
-@Mapper
-public interface ConsumptionTransferLogMapper extends BaseMapperX<ConsumptionTransferLogDO> {
-
-    default PageResult<ConsumptionTransferLogDO> selectPage(ConsumptionTransferLogPageReqVO reqVO) {
-        return selectPage(reqVO, new LambdaQueryWrapperX<ConsumptionTransferLogDO>()
-                .eqIfPresent(ConsumptionTransferLogDO::getTransferUserId, reqVO.getTransferUserId())
-                .likeIfPresent(ConsumptionTransferLogDO::getTransferUserName, reqVO.getTransferUserName())
-                .eqIfPresent(ConsumptionTransferLogDO::getConsumptionPoints, reqVO.getConsumptionPoints())
-                .eqIfPresent(ConsumptionTransferLogDO::getRecipientUserId, reqVO.getRecipientUserId())
-                .likeIfPresent(ConsumptionTransferLogDO::getRecipientUserName, reqVO.getRecipientUserName())
-                .betweenIfPresent(ConsumptionTransferLogDO::getCreateTime, reqVO.getCreateTime())
-                .orderByDesc(ConsumptionTransferLogDO::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.dal.dataobject.integraltransferlog.IntegralTransferLogDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.distri.controller.admin.integraltransferlog.vo.*;
+
+/**
+ * 消费分转让记录 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface IntegralTransferLogMapper extends BaseMapperX<IntegralTransferLogDO> {
+
+    default PageResult<IntegralTransferLogDO> selectPage(IntegralTransferLogPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<IntegralTransferLogDO>()
+                .eqIfPresent(IntegralTransferLogDO::getTransferUserId, reqVO.getTransferUserId())
+                .likeIfPresent(IntegralTransferLogDO::getTransferUserName, reqVO.getTransferUserName())
+                .eqIfPresent(IntegralTransferLogDO::getConsumptionPoints, reqVO.getConsumptionPoints())
+                .eqIfPresent(IntegralTransferLogDO::getRecipientUserId, reqVO.getRecipientUserId())
+                .likeIfPresent(IntegralTransferLogDO::getRecipientUserName, reqVO.getRecipientUserName())
+                .betweenIfPresent(IntegralTransferLogDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(IntegralTransferLogDO::getId));
+    }
+
+}

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

@@ -7,7 +7,7 @@ import cn.newfeifan.mall.module.distri.controller.admin.integral.vo.*;
 import cn.newfeifan.mall.module.distri.dal.dataobject.integral.IntegralDO;
 import cn.newfeifan.mall.module.distri.dal.dataobject.integral.IntegralDO;
 import cn.newfeifan.mall.framework.common.pojo.PageResult;
 import cn.newfeifan.mall.framework.common.pojo.PageResult;
 import cn.newfeifan.mall.module.distri.enums.CaclEnum;
 import cn.newfeifan.mall.module.distri.enums.CaclEnum;
-import cn.newfeifan.mall.module.distri.enums.ConsumptionEnum;
+import cn.newfeifan.mall.module.distri.enums.IntegralEnum;
 
 
 /**
 /**
  * 推荐用户积分 Service 接口
  * 推荐用户积分 Service 接口
@@ -70,16 +70,6 @@ public interface IntegralService {
      */
      */
     void updateBatch(List<IntegralSaveReqVO> integralSaveReqVOS);
     void updateBatch(List<IntegralSaveReqVO> integralSaveReqVOS);
 
 
-
-    /**
-     * 查询当前用户的父亲的积分信息
-     * @param userId
-     * @return
-     */
-    IntegralDO selectUserParent(Long userId);
-
-
-
     List<IntegralDO> selectAllUser();
     List<IntegralDO> selectAllUser();
 
 
     IntegralDO getIntegralByUserId(Long userId);
     IntegralDO getIntegralByUserId(Long userId);
@@ -140,14 +130,4 @@ public interface IntegralService {
     );
     );
 
 
     void calcIntegral();
     void calcIntegral();
-
-    /**
-     * 修改用户消费积分
-     * @param userId 用户id
-     * @param consumptionEnum 类型
-     * @param consumptionPoints 消费分
-     * @param orderId 订单id
-     * @param orderNum 订单号
-     */
-    void updateUserConsumptionPoints(Long userId, ConsumptionEnum consumptionEnum, Long consumptionPoints, Long orderId, String orderNum);
 }
 }

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

@@ -1,21 +1,13 @@
 package cn.newfeifan.mall.module.distri.service.integral;
 package cn.newfeifan.mall.module.distri.service.integral;
 
 
 import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
-import cn.newfeifan.mall.module.distri.controller.admin.consumptionchangelog.vo.ConsumptionChangeLogSaveReqVO;
-import cn.newfeifan.mall.module.distri.controller.admin.ptprofit.vo.PtProfitSaveReqVO;
 import cn.newfeifan.mall.module.distri.controller.admin.ptprofitlog.vo.PtProfitLogSaveReqVO;
 import cn.newfeifan.mall.module.distri.controller.admin.ptprofitlog.vo.PtProfitLogSaveReqVO;
-import cn.newfeifan.mall.module.distri.dal.dataobject.ptprofit.PtProfitDO;
 import cn.newfeifan.mall.module.distri.dal.dataobject.ptprofitlog.PtProfitLogDO;
 import cn.newfeifan.mall.module.distri.dal.dataobject.ptprofitlog.PtProfitLogDO;
 import cn.newfeifan.mall.module.distri.dal.mysql.ptprofit.PtProfitMapper;
 import cn.newfeifan.mall.module.distri.dal.mysql.ptprofit.PtProfitMapper;
 import cn.newfeifan.mall.module.distri.dal.mysql.ptprofitlog.PtProfitLogMapper;
 import cn.newfeifan.mall.module.distri.dal.mysql.ptprofitlog.PtProfitLogMapper;
 import cn.newfeifan.mall.module.distri.enums.CaclEnum;
 import cn.newfeifan.mall.module.distri.enums.CaclEnum;
-import cn.newfeifan.mall.module.distri.enums.ConsumptionEnum;
-import cn.newfeifan.mall.module.distri.service.consumptionchangelog.ConsumptionChangeLogService;
-import cn.newfeifan.mall.module.distri.service.ptprofit.PtProfitService;
 import cn.newfeifan.mall.module.distri.service.ptprofitlog.PtProfitLogService;
 import cn.newfeifan.mall.module.distri.service.ptprofitlog.PtProfitLogService;
-import cn.newfeifan.mall.module.distri.service.sharepath.SharePathService;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
@@ -33,7 +25,6 @@ import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
 import cn.newfeifan.mall.module.distri.dal.mysql.integral.IntegralMapper;
 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.common.exception.util.ServiceExceptionUtil.exception;
-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.*;
 import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
 import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
 
 
@@ -48,22 +39,12 @@ public class IntegralServiceImpl implements IntegralService {
 
 
     @Resource
     @Resource
     private IntegralMapper integralMapper;
     private IntegralMapper integralMapper;
-    @Resource
-    private ConsumptionChangeLogService consumptionChangeLogService;
-
     @Resource
     @Resource
     private PtProfitLogMapper ptProfitLogMapper;
     private PtProfitLogMapper ptProfitLogMapper;
 
 
-    @Resource
-    @Lazy
-    private SharePathService sharePathService;
-
     @Resource
     @Resource
     private PtProfitLogService ptProfitLogService;
     private PtProfitLogService ptProfitLogService;
 
 
-    @Resource
-    private PtProfitService ptProfitService;
-
     @Resource
     @Resource
     private PtProfitMapper ptProfitMapper;
     private PtProfitMapper ptProfitMapper;
 
 
@@ -128,24 +109,8 @@ public class IntegralServiceImpl implements IntegralService {
 
 
     @Override
     @Override
     public void updateBatch(List<IntegralSaveReqVO> integralSaveReqVOS) {
     public void updateBatch(List<IntegralSaveReqVO> integralSaveReqVOS) {
-
-        integralSaveReqVOS.forEach(k -> {
-            // 校验存在
-            validateIntegralExists(k.getId());
-            // 更新
-            IntegralDO updateObj = BeanUtils.toBean(k, IntegralDO.class);
-            integralMapper.updateById(updateObj);
-        });
-
+        integralMapper.updateBatch(BeanUtils.toBean(integralSaveReqVOS, IntegralDO.class));
     }
     }
-
-    @Override
-    public IntegralDO selectUserParent(Long userId) {
-
-        Long parentId = sharePathService.queryParentBySonUserId(userId);
-        return integralMapper.selectOne(new LambdaQueryWrapperX<IntegralDO>().eqIfPresent(IntegralDO::getUserId, parentId));
-    }
-
     @Override
     @Override
     public List<IntegralDO> selectAllUser() {
     public List<IntegralDO> selectAllUser() {
 
 
@@ -169,9 +134,6 @@ public class IntegralServiceImpl implements IntegralService {
 
 
             //记录用户的积分变动日志
             //记录用户的积分变动日志
             PtProfitLogDO ptProfitLogDO = PtProfitLogDO.builder()
             PtProfitLogDO ptProfitLogDO = PtProfitLogDO.builder()
-                    .freezeHighQuota(totalFreezeHighQuota)
-                    .afterFreezeHighQuota(integralDO.getFreezeHighQuota())
-                    .userId(userId)
                     .generateUserId(generateUserId)
                     .generateUserId(generateUserId)
                     .profitStatus(caclEnum.getType())
                     .profitStatus(caclEnum.getType())
                     .orderId(tradeOrderId)
                     .orderId(tradeOrderId)
@@ -193,9 +155,6 @@ public class IntegralServiceImpl implements IntegralService {
 
 
         //记录用户的积分变动日志
         //记录用户的积分变动日志
         PtProfitLogSaveReqVO profitLogSaveReqVO = PtProfitLogSaveReqVO.builder()
         PtProfitLogSaveReqVO profitLogSaveReqVO = PtProfitLogSaveReqVO.builder()
-                .freezeHighQuota(totalFreezeHighQuota)
-                .afterFreezeHighQuota(integralDO.getFreezeHighQuota())
-                .userId(userId)
                 .generateUserId(generateUserId)
                 .generateUserId(generateUserId)
                 .profitStatus(caclEnum.getType())
                 .profitStatus(caclEnum.getType())
                 .orderId(tradeOrderId)
                 .orderId(tradeOrderId)
@@ -209,13 +168,9 @@ public class IntegralServiceImpl implements IntegralService {
         List<IntegralDO> integralDOS = integralMapper.selectList();
         List<IntegralDO> integralDOS = integralMapper.selectList();
         for (IntegralDO integralDO : integralDOS) {
         for (IntegralDO integralDO : integralDOS) {
             List<PtProfitLogDO> ptProfitLogDOS = ptProfitLogMapper.selectList(new LambdaQueryWrapper<PtProfitLogDO>()
             List<PtProfitLogDO> ptProfitLogDOS = ptProfitLogMapper.selectList(new LambdaQueryWrapper<PtProfitLogDO>()
-                    .eq(PtProfitLogDO::getUserId, integralDO.getUserId())
+                    .eq(PtProfitLogDO::getGenerateUserId, integralDO.getUserId())
                     .eq(PtProfitLogDO::getProfitStatus, DIRECT_REFERRAL_QUOTA.getType())
                     .eq(PtProfitLogDO::getProfitStatus, DIRECT_REFERRAL_QUOTA.getType())
             );
             );
-            for (PtProfitLogDO ptProfitLogDO : ptProfitLogDOS) {
-                integralDO.setHighQuotaTotal(integralDO.getHighQuotaTotal() + ptProfitLogDO.getMaxAvailablePointsAmount());
-            }
-
             integralMapper.updateById(integralDO);
             integralMapper.updateById(integralDO);
             if(ptProfitLogDOS.size() > 1){
             if(ptProfitLogDOS.size() > 1){
                 System.out.println("用户编号:[" + integralDO.getUserId() + "]");
                 System.out.println("用户编号:[" + integralDO.getUserId() + "]");
@@ -227,11 +182,11 @@ public class IntegralServiceImpl implements IntegralService {
     public void updateUserIntegral(Long userId, CaclEnum caclEnum, Long payIntegral, Long tradeOrderId, String orderNum) {
     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 integralDO = integralMapper.selectOne(new LambdaQueryWrapper<IntegralDO>().eq(IntegralDO::getUserId, userId));
-        integralDO.setCurrentQuota(integralDO.getCurrentQuota() + payIntegral);
+        integralDO.setRedCurrentQuota(integralDO.getRedCurrentQuota() + payIntegral);
 
 
         integralMapper.updateById(integralDO);
         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);
     }
     }
 
 
     /**
     /**
@@ -292,74 +247,9 @@ public class IntegralServiceImpl implements IntegralService {
 
 
     @Override
     @Override
     public void calcIntegral() {
     public void calcIntegral() {
-        List<PtProfitLogDO> ptProfitLogDOS = ptProfitLogService.calcIntegral();
-        for (PtProfitLogDO ptProfitLogDO : ptProfitLogDOS) {
-            IntegralDO integralDO = integralMapper.selectOne(new LambdaQueryWrapper<IntegralDO>().eq(IntegralDO::getUserId, ptProfitLogDO.getUserId()));
-            //加积分余额
-            integralDO.setCurrentQuota(integralDO.getCurrentQuota() + ptProfitLogDO.getAccumulatedQuotaAmount());
-            //加累计积分余额
-            integralDO.setAccumulatedQuota(integralDO.getAccumulatedQuota() + ptProfitLogDO.getAccumulatedQuotaAmount());
-            //减可用峰值
-            integralDO.setHighQuota(integralDO.getHighQuota() - ptProfitLogDO.getAccumulatedQuotaAmount());
 
 
-            integralMapper.updateById(integralDO);
-
-            PtProfitDO ptProfit = ptProfitService.getPtProfit();
-            IntegralDO ptIntegralDO = selectByUser(PT_ID);
-
-            //平台用户扣除积分
-            ptProfit.setPtGrossAdd(ptProfit.getPtGrossAdd() - ptProfitLogDO.getAccumulatedQuotaAmount());
-            ptIntegralDO.setCurrentQuota(ptIntegralDO.getCurrentQuota() - ptProfitLogDO.getAccumulatedQuotaAmount());
-            // 平台扣除积分
-            ptProfit.setPtTotalAdd(ptProfit.getPtTotalAdd() - ptProfitLogDO.getAccumulatedQuotaAmount());
-
-            integralMapper.updateById(ptIntegralDO);
-            ptProfitService.updatePtProfit(PtProfitSaveReqVO.builder().id(ptProfit.getId())
-                    .ptAdd(ptProfit.getPtAdd())
-                    .ptGrossAdd(ptProfit.getPtGrossAdd())
-                    .ptTotalAdd(ptProfit.getPtTotalAdd()).build());
-
-            //这条记录是用户看的
-            PtProfitLogSaveReqVO ProfitLog = PtProfitLogSaveReqVO.builder()
-                    .amount(ptProfitLogDO.getAccumulatedQuotaAmount())
-                    .afterAmount(integralDO.getCurrentQuota())
-                    .userId(ptProfitLogDO.getUserId())
-                    .generateUserId(ptProfitLogDO.getGenerateUserId())
-                    .profitStatus(MANUAL_RETURN_INTEGRAL.getType())
-                    .maxAvailablePointsAmount(-ptProfitLogDO.getAccumulatedQuotaAmount())
-                    .afterMaxAvailablePointsAmount(integralDO.getHighQuota())
-                    .build();
-            ptProfitLogMapper.insert(BeanUtils.toBean(ProfitLog, PtProfitLogDO.class));
-
-            //这条是pt看的
-            PtProfitLogSaveReqVO ptProfitLog = PtProfitLogSaveReqVO.builder()
-                    .amount(ptProfitLogDO.getAccumulatedQuotaAmount())
-                    .afterAmount(ptProfit.getPtGrossAdd())
-                    .generateUserId(ptProfitLogDO.getGenerateUserId())
-                    .profitStatus(MANUAL_RETURN_INTEGRAL.getType())
-                    .build();
-            ptProfitLogMapper.insert(BeanUtils.toBean(ptProfitLog, PtProfitLogDO.class));
-        }
     }
     }
 
 
-    @Override
-    public void updateUserConsumptionPoints(Long userId, ConsumptionEnum consumptionEnum, Long consumptionPoints, Long orderId, String orderNum) {
-        IntegralDO integralDO = integralMapper.selectOne(IntegralDO::getUserId, userId);
-
-        // 修改用户消费积分
-        integralDO.setConsumptionPoints(integralDO.getConsumptionPoints() + consumptionPoints);
-        integralMapper.updateById(integralDO);
 
 
-        consumptionChangeLogService.createConsumptionChangeLog(
-                ConsumptionChangeLogSaveReqVO.builder()
-                        .userId(userId)
-                        .generateUserId(userId)
-                        .consumptionStatus(consumptionEnum.getType())
-                        .consumptionPoints(consumptionPoints)
-                        .afterConsumptionPoints(integralDO.getConsumptionPoints())
-                        .orderId(orderId)
-                        .orderNo(orderNum)
-                        .build());
-    }
 
 
 }
 }

+ 10 - 10
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/consumptiontopuplog/ConsumptionTopUpLogService.java → feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integraltopuplog/IntegralTopUpLogService.java

@@ -1,9 +1,9 @@
-package cn.newfeifan.mall.module.distri.service.consumptiontopuplog;
+package cn.newfeifan.mall.module.distri.service.integraltopuplog;
 
 
 import java.util.*;
 import java.util.*;
 import javax.validation.*;
 import javax.validation.*;
-import cn.newfeifan.mall.module.distri.controller.admin.consumptiontopuplog.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.consumptiontopuplog.ConsumptionTopUpLogDO;
+import cn.newfeifan.mall.module.distri.controller.admin.integraltopuplog.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.integraltopuplog.IntegralTopUpLogDO;
 import cn.newfeifan.mall.framework.common.pojo.PageResult;
 import cn.newfeifan.mall.framework.common.pojo.PageResult;
 
 
 /**
 /**
@@ -11,7 +11,7 @@ import cn.newfeifan.mall.framework.common.pojo.PageResult;
  *
  *
  * @author 非繁人
  * @author 非繁人
  */
  */
-public interface ConsumptionTopUpLogService {
+public interface IntegralTopUpLogService {
 
 
     /**
     /**
      * 创建平台消费分充值记录
      * 创建平台消费分充值记录
@@ -19,14 +19,14 @@ public interface ConsumptionTopUpLogService {
      * @param createReqVO 创建信息
      * @param createReqVO 创建信息
      * @return 编号
      * @return 编号
      */
      */
-    Long createConsumptionTopUpLog(@Valid ConsumptionTopUpLogSaveReqVO createReqVO);
+    Long createConsumptionTopUpLog(@Valid IntegralTopUpLogSaveReqVO createReqVO);
 
 
     /**
     /**
      * 更新平台消费分充值记录
      * 更新平台消费分充值记录
      *
      *
      * @param updateReqVO 更新信息
      * @param updateReqVO 更新信息
      */
      */
-    void updateConsumptionTopUpLog(@Valid ConsumptionTopUpLogSaveReqVO updateReqVO);
+    void updateConsumptionTopUpLog(@Valid IntegralTopUpLogSaveReqVO updateReqVO);
 
 
 
 
     /**
     /**
@@ -35,7 +35,7 @@ public interface ConsumptionTopUpLogService {
      * @param id 编号
      * @param id 编号
      * @return 平台消费分充值记录
      * @return 平台消费分充值记录
      */
      */
-    ConsumptionTopUpLogDO getConsumptionTopUpLog(Long id);
+    IntegralTopUpLogDO getConsumptionTopUpLog(Long id);
 
 
     /**
     /**
      * 获得平台消费分充值记录分页
      * 获得平台消费分充值记录分页
@@ -43,7 +43,7 @@ public interface ConsumptionTopUpLogService {
      * @param pageReqVO 分页查询
      * @param pageReqVO 分页查询
      * @return 平台消费分充值记录分页
      * @return 平台消费分充值记录分页
      */
      */
-    PageResult<ConsumptionTopUpLogDO> getConsumptionTopUpLogPage(ConsumptionTopUpLogPageReqVO pageReqVO);
+    PageResult<IntegralTopUpLogDO> getConsumptionTopUpLogPage(IntegralTopUpLogPageReqVO pageReqVO);
 
 
     /**
     /**
      * 是否是第一次充值消费分
      * 是否是第一次充值消费分
@@ -51,13 +51,13 @@ public interface ConsumptionTopUpLogService {
      * @param userId 用户编号
      * @param userId 用户编号
      * @return 是否是第一次充值消费分
      * @return 是否是第一次充值消费分
      */
      */
-    ConsumptionInfoVO isFirstConsumption(Long userId);
+    IntegralInfoVO isFirstConsumption(Long userId);
 
 
     /**
     /**
      * 获取所有的充值记录
      * 获取所有的充值记录
      * @return 充值记录
      * @return 充值记录
      */
      */
-    List<ConsumptionTopUpLogDO> selectList();
+    List<IntegralTopUpLogDO> selectList();
 
 
     /**
     /**
      * 获取平台充值记录和用户充值记录
      * 获取平台充值记录和用户充值记录

+ 52 - 54
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/consumptiontopuplog/ConsumptionTopUpLogServiceImpl.java → feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integraltopuplog/IntegralTopUpLogServiceImpl.java

@@ -1,20 +1,19 @@
-package cn.newfeifan.mall.module.distri.service.consumptiontopuplog;
+package cn.newfeifan.mall.module.distri.service.integraltopuplog;
 
 
 import cn.newfeifan.mall.framework.common.exception.ErrorCode;
 import cn.newfeifan.mall.framework.common.exception.ErrorCode;
 import cn.newfeifan.mall.module.distri.constant.DistriConstants;
 import cn.newfeifan.mall.module.distri.constant.DistriConstants;
-import cn.newfeifan.mall.module.distri.controller.admin.consumptionchangelog.vo.ConsumptionChangeLogSaveReqVO;
+import cn.newfeifan.mall.module.distri.controller.admin.integralchangelog.vo.IntegralChangeLogSaveReqVO;
 import cn.newfeifan.mall.module.distri.controller.admin.integral.vo.IntegralSaveReqVO;
 import cn.newfeifan.mall.module.distri.controller.admin.integral.vo.IntegralSaveReqVO;
 import cn.newfeifan.mall.module.distri.dal.dataobject.integral.IntegralDO;
 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.orderpercentage.OrderPercentageDO;
-import cn.newfeifan.mall.module.distri.enums.ConsumptionEnum;
-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.service.integralchangelog.IntegralChangeLogService;
 import cn.newfeifan.mall.module.distri.service.integral.IntegralService;
 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.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.dataobject.user.MemberUserDO;
 import cn.newfeifan.mall.module.member.service.user.MemberUserService;
 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.api.sms.dto.code.SmsCodeSendReqDTO;
-import cn.newfeifan.mall.module.system.controller.admin.auth.vo.AuthSmsSendReqVO;
 import cn.newfeifan.mall.module.system.enums.sms.SmsSceneEnum;
 import cn.newfeifan.mall.module.system.enums.sms.SmsSceneEnum;
 import cn.newfeifan.mall.module.system.service.sms.SmsCodeService;
 import cn.newfeifan.mall.module.system.service.sms.SmsCodeService;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -24,8 +23,8 @@ import javax.annotation.Resource;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.validation.annotation.Validated;
 
 
-import cn.newfeifan.mall.module.distri.controller.admin.consumptiontopuplog.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.consumptiontopuplog.ConsumptionTopUpLogDO;
+import cn.newfeifan.mall.module.distri.controller.admin.integraltopuplog.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.integraltopuplog.IntegralTopUpLogDO;
 import cn.newfeifan.mall.framework.common.pojo.PageResult;
 import cn.newfeifan.mall.framework.common.pojo.PageResult;
 import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
 import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
 
 
@@ -45,7 +44,7 @@ import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
  */
  */
 @Service
 @Service
 @Validated
 @Validated
-public class ConsumptionTopUpLogServiceImpl implements ConsumptionTopUpLogService {
+public class IntegralTopUpLogServiceImpl implements IntegralTopUpLogService {
 
 
     @Resource
     @Resource
     private ConsumptionTopUpLogMapper consumptionTopUpLogMapper;
     private ConsumptionTopUpLogMapper consumptionTopUpLogMapper;
@@ -57,68 +56,67 @@ public class ConsumptionTopUpLogServiceImpl implements ConsumptionTopUpLogServic
     private IntegralService integralService;
     private IntegralService integralService;
 
 
     @Resource
     @Resource
-    private ConsumptionChangeLogService consumptionChangeLogService;
+    private IntegralChangeLogService integralChangeLogService;
 
 
     @Resource
     @Resource
     private SmsCodeService smsCodeService;
     private SmsCodeService smsCodeService;
-    @Resource
-    private MemberUserService memberUserService;
 
 
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
-    public Long createConsumptionTopUpLog(ConsumptionTopUpLogSaveReqVO createReqVO) {
+    public Long createConsumptionTopUpLog(IntegralTopUpLogSaveReqVO createReqVO) {
         // 充值的额度
         // 充值的额度
-        Long agentQuota = createReqVO.getConsumptionPoints();
+        Long agentQuota = createReqVO.getIntegralPoints();
         OrderPercentageDO orderPercentageDO = orderPercentageService.queryStatus();
         OrderPercentageDO orderPercentageDO = orderPercentageService.queryStatus();
         // 充值额度校验
         // 充值额度校验
-        quotaVerify(createReqVO.getUserId(), createReqVO.getConsumptionPoints(), orderPercentageDO);
+        quotaVerify(createReqVO.getUserId(), createReqVO.getIntegralPoints(), orderPercentageDO);
 
 
         // 短信验证码校验
         // 短信验证码校验
         smsCodeService.useSmsCode(createReqVO.getSmsCodeUseReqDTO().setUsedIp(getClientIP()));
         smsCodeService.useSmsCode(createReqVO.getSmsCodeUseReqDTO().setUsedIp(getClientIP()));
 
 
         // 额度放大百万倍,存储需要(方便换算),和积分一样
         // 额度放大百万倍,存储需要(方便换算),和积分一样
-        createReqVO.setConsumptionPoints(createReqVO.getConsumptionPoints() * DistriConstants.MILLION);
+        createReqVO.setIntegralPoints(createReqVO.getIntegralPoints() * DistriConstants.MILLION);
 
 
         // 充值倍率
         // 充值倍率
-        if (createReqVO.getConsumptionPoints() >= Long.parseLong(orderPercentageDO.getTriggerMagnificationPoints()) * DistriConstants.MILLION) {
-            createReqVO.setPracticalConsumptionPoints((long) (createReqVO.getConsumptionPoints() * Double.parseDouble(orderPercentageDO.getConsumptionMagnification())));
+        if (createReqVO.getIntegralPoints() >= Long.parseLong(orderPercentageDO.getTriggerMagnificationPoints()) * DistriConstants.MILLION) {
+            createReqVO.setPracticalIntegralPoints((long) (createReqVO.getIntegralPoints() * Double.parseDouble(orderPercentageDO.getIntegralMagnification())));
         } else {
         } else {
-            createReqVO.setPracticalConsumptionPoints(createReqVO.getConsumptionPoints());
+            createReqVO.setPracticalIntegralPoints(createReqVO.getIntegralPoints());
         }
         }
 
 
 
 
         // 插入
         // 插入
-        ConsumptionTopUpLogDO consumptionTopUpLog = BeanUtils.toBean(createReqVO, ConsumptionTopUpLogDO.class);
+        IntegralTopUpLogDO consumptionTopUpLog = BeanUtils.toBean(createReqVO, IntegralTopUpLogDO.class);
         consumptionTopUpLogMapper.insert(consumptionTopUpLog);
         consumptionTopUpLogMapper.insert(consumptionTopUpLog);
 
 
         // 修改用户钱包
         // 修改用户钱包
         IntegralDO integralDO = integralService.selectByUser(consumptionTopUpLog.getUserId());
         IntegralDO integralDO = integralService.selectByUser(consumptionTopUpLog.getUserId());
-        integralDO.setConsumptionPoints(integralDO.getConsumptionPoints() + consumptionTopUpLog.getPracticalConsumptionPoints());
+        integralDO.setRedCurrentQuota(integralDO.getRedCurrentQuota() + consumptionTopUpLog.getPracticalIntegralPoints());
         integralService.updateIntegral(BeanUtils.toBean(integralDO, IntegralSaveReqVO.class));
         integralService.updateIntegral(BeanUtils.toBean(integralDO, IntegralSaveReqVO.class));
 
 
         // 记录用户消费分变动日志
         // 记录用户消费分变动日志
-        consumptionChangeLogService.createConsumptionChangeLog(ConsumptionChangeLogSaveReqVO.builder()
+        integralChangeLogService.createConsumptionChangeLog(IntegralChangeLogSaveReqVO.builder()
                 .userId(consumptionTopUpLog.getUserId())
                 .userId(consumptionTopUpLog.getUserId())
-                .consumptionPoints(consumptionTopUpLog.getPracticalConsumptionPoints())
-                .afterConsumptionPoints(integralDO.getConsumptionPoints())
-                .consumptionStatus(ConsumptionEnum.PT_TOP_TUP.getType())
-                .practicalConsumptionPoints(consumptionTopUpLog.getConsumptionPoints())
+                .integralPoints(consumptionTopUpLog.getPracticalIntegralPoints())
+                .afterIntegralPoints(integralDO.getRedCurrentQuota())
+                .integralStatus(IntegralEnum.PT_TOP_TUP.getType())
+                .integralType(IntegralTypeEnum.RED_INTEGRAL.getType())
+                .practicalIntegralPoints(consumptionTopUpLog.getIntegralPoints())
                 .generateUserId(getLoginUserId())
                 .generateUserId(getLoginUserId())
                 .build());
                 .build());
 
 
         // 发送短信通知用户充值成功
         // 发送短信通知用户充值成功
-        MemberUserDO user = memberUserService.getUser(consumptionTopUpLog.getUserId());
-        smsCodeService.sendSmsCode(SmsCodeSendReqDTO.builder()
-                .mobile(user.getMobile())
-                .scene(SmsSceneEnum.CONSUMPTION_POINTS_TOP_UP.getScene())
-                .createIp(getClientIP())
-                .build());
-
-        // 当单笔充值大于设定金额时,将用户设置为代理商
-        if(agentQuota >= Long.parseLong(orderPercentageDO.getAgentQuota()) && !user.getAgent()){
-            user.setAgent(true);
-            memberUserService.updateUser(BeanUtils.toBean(user, MemberUserUpdateReqVO.class));
-        }
+//        MemberUserDO user = memberUserService.getUser(consumptionTopUpLog.getUserId());
+//        smsCodeService.sendSmsCode(SmsCodeSendReqDTO.builder()
+//                .mobile(user.getMobile())
+//                .scene(SmsSceneEnum.CONSUMPTION_POINTS_TOP_UP.getScene())
+//                .createIp(getClientIP())
+//                .build());
+
+//        // 当单笔充值大于设定金额时,将用户设置为代理商
+//        if(agentQuota >= Long.parseLong(orderPercentageDO.getAgentQuota()) && !user.getAgent()){
+//            user.setAgent(true);
+//            memberUserService.updateUser(BeanUtils.toBean(user, MemberUserUpdateReqVO.class));
+//        }
 
 
         // 返回
         // 返回
         return consumptionTopUpLog.getId();
         return consumptionTopUpLog.getId();
@@ -150,11 +148,11 @@ public class ConsumptionTopUpLogServiceImpl implements ConsumptionTopUpLogServic
     }
     }
 
 
     @Override
     @Override
-    public void updateConsumptionTopUpLog(ConsumptionTopUpLogSaveReqVO updateReqVO) {
+    public void updateConsumptionTopUpLog(IntegralTopUpLogSaveReqVO updateReqVO) {
         // 校验存在
         // 校验存在
         validateConsumptionTopUpLogExists(updateReqVO.getId());
         validateConsumptionTopUpLogExists(updateReqVO.getId());
         // 更新
         // 更新
-        ConsumptionTopUpLogDO updateObj = BeanUtils.toBean(updateReqVO, ConsumptionTopUpLogDO.class);
+        IntegralTopUpLogDO updateObj = BeanUtils.toBean(updateReqVO, IntegralTopUpLogDO.class);
         consumptionTopUpLogMapper.updateById(updateObj);
         consumptionTopUpLogMapper.updateById(updateObj);
     }
     }
 
 
@@ -165,35 +163,35 @@ public class ConsumptionTopUpLogServiceImpl implements ConsumptionTopUpLogServic
     }
     }
 
 
     @Override
     @Override
-    public ConsumptionTopUpLogDO getConsumptionTopUpLog(Long id) {
+    public IntegralTopUpLogDO getConsumptionTopUpLog(Long id) {
         return consumptionTopUpLogMapper.selectById(id);
         return consumptionTopUpLogMapper.selectById(id);
     }
     }
 
 
     @Override
     @Override
-    public PageResult<ConsumptionTopUpLogDO> getConsumptionTopUpLogPage(ConsumptionTopUpLogPageReqVO pageReqVO) {
+    public PageResult<IntegralTopUpLogDO> getConsumptionTopUpLogPage(IntegralTopUpLogPageReqVO pageReqVO) {
         return consumptionTopUpLogMapper.selectPage(pageReqVO);
         return consumptionTopUpLogMapper.selectPage(pageReqVO);
     }
     }
 
 
     @Override
     @Override
-    public ConsumptionInfoVO isFirstConsumption(Long userId) {
-        List<ConsumptionTopUpLogDO> consumptionTopUpLogDOS = consumptionTopUpLogMapper.selectList(ConsumptionTopUpLogDO::getUserId, userId);
+    public IntegralInfoVO isFirstConsumption(Long userId) {
+        List<IntegralTopUpLogDO> integralTopUpLogDOS = consumptionTopUpLogMapper.selectList(IntegralTopUpLogDO::getUserId, userId);
 
 
-        ConsumptionInfoVO build = ConsumptionInfoVO.builder().build();
+        IntegralInfoVO build = IntegralInfoVO.builder().build();
         OrderPercentageDO orderPercentageDO = orderPercentageService.queryStatus();
         OrderPercentageDO orderPercentageDO = orderPercentageService.queryStatus();
-        if (consumptionTopUpLogDOS.isEmpty()) {
-            build.setIsFirstConsumption(true);
-            build.setMinimumConsumptionPoints(Long.valueOf(orderPercentageDO.getFirstTopUpConsumption()));
-        } else {
-            build.setIsFirstConsumption(false);
-            build.setMinimumConsumptionPoints(Long.valueOf(orderPercentageDO.getFollowUpConsumption()));
-        }
-        build.setConsumptionMagnification(orderPercentageDO.getConsumptionMagnification());
+//        if (consumptionTopUpLogDOS.isEmpty()) {
+//            build.setIsFirstConsumption(true);
+//            build.setMinimumConsumptionPoints(Long.valueOf(orderPercentageDO.getFirstTopUpConsumption()));
+//        } else {
+//            build.setIsFirstConsumption(false);
+//            build.setMinimumConsumptionPoints(Long.valueOf(orderPercentageDO.getFollowUpConsumption()));
+//        }
+        build.setConsumptionMagnification(orderPercentageDO.getIntegralMagnification());
         build.setTriggerMagnificationPoints(orderPercentageDO.getTriggerMagnificationPoints());
         build.setTriggerMagnificationPoints(orderPercentageDO.getTriggerMagnificationPoints());
         return build;
         return build;
     }
     }
 
 
     @Override
     @Override
-    public List<ConsumptionTopUpLogDO> selectList() {
+    public List<IntegralTopUpLogDO> selectList() {
         return consumptionTopUpLogMapper.selectList();
         return consumptionTopUpLogMapper.selectList();
     }
     }
 
 

+ 9 - 9
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/consumptiontransferlog/ConsumptionTransferLogService.java → feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integraltransferlog/IntegralTransferLogService.java

@@ -1,9 +1,9 @@
-package cn.newfeifan.mall.module.distri.service.consumptiontransferlog;
+package cn.newfeifan.mall.module.distri.service.integraltransferlog;
 
 
 import java.util.*;
 import java.util.*;
 import javax.validation.*;
 import javax.validation.*;
-import cn.newfeifan.mall.module.distri.controller.admin.consumptiontransferlog.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.consumptiontransferlog.ConsumptionTransferLogDO;
+import cn.newfeifan.mall.module.distri.controller.admin.integraltransferlog.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.integraltransferlog.IntegralTransferLogDO;
 import cn.newfeifan.mall.framework.common.pojo.PageResult;
 import cn.newfeifan.mall.framework.common.pojo.PageResult;
 
 
 /**
 /**
@@ -11,7 +11,7 @@ import cn.newfeifan.mall.framework.common.pojo.PageResult;
  *
  *
  * @author 非繁人
  * @author 非繁人
  */
  */
-public interface ConsumptionTransferLogService {
+public interface IntegralTransferLogService {
 
 
     /**
     /**
      * 创建消费分转让记录
      * 创建消费分转让记录
@@ -19,14 +19,14 @@ public interface ConsumptionTransferLogService {
      * @param createReqVO 创建信息
      * @param createReqVO 创建信息
      * @return 编号
      * @return 编号
      */
      */
-    Long createConsumptionTransferLog(@Valid ConsumptionTransferLogSaveReqVO createReqVO);
+    Long createConsumptionTransferLog(@Valid IntegralTransferLogSaveReqVO createReqVO);
 
 
     /**
     /**
      * 更新消费分转让记录
      * 更新消费分转让记录
      *
      *
      * @param updateReqVO 更新信息
      * @param updateReqVO 更新信息
      */
      */
-    void updateConsumptionTransferLog(@Valid ConsumptionTransferLogSaveReqVO updateReqVO);
+    void updateConsumptionTransferLog(@Valid IntegralTransferLogSaveReqVO updateReqVO);
 
 
     /**
     /**
      * 删除消费分转让记录
      * 删除消费分转让记录
@@ -41,7 +41,7 @@ public interface ConsumptionTransferLogService {
      * @param id 编号
      * @param id 编号
      * @return 消费分转让记录
      * @return 消费分转让记录
      */
      */
-    ConsumptionTransferLogDO getConsumptionTransferLog(Long id);
+    IntegralTransferLogDO getConsumptionTransferLog(Long id);
 
 
     /**
     /**
      * 获得消费分转让记录分页
      * 获得消费分转让记录分页
@@ -49,11 +49,11 @@ public interface ConsumptionTransferLogService {
      * @param pageReqVO 分页查询
      * @param pageReqVO 分页查询
      * @return 消费分转让记录分页
      * @return 消费分转让记录分页
      */
      */
-    PageResult<ConsumptionTransferLogDO> getConsumptionTransferLogPage(ConsumptionTransferLogPageReqVO pageReqVO);
+    PageResult<IntegralTransferLogDO> getConsumptionTransferLogPage(IntegralTransferLogPageReqVO pageReqVO);
 
 
     /**
     /**
      * 获取转让记录
      * 获取转让记录
      * @return 转让记录
      * @return 转让记录
      */
      */
-    List<ConsumptionTransferLogDO> selectList();
+    List<IntegralTransferLogDO> selectList();
 }
 }

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

@@ -0,0 +1,77 @@
+package cn.newfeifan.mall.module.distri.service.integraltransferlog;
+
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+
+import java.util.*;
+import cn.newfeifan.mall.module.distri.controller.admin.integraltransferlog.vo.*;
+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.module.distri.enums.ErrorCodeConstants.*;
+
+/**
+ * 消费分转让记录 Service 实现类
+ *
+ * @author 非繁人
+ */
+@Service
+@Validated
+public class IntegralTransferLogServiceImpl implements IntegralTransferLogService {
+
+    @Resource
+    private IntegralTransferLogMapper integralTransferLogMapper;
+
+    @Override
+    public Long createConsumptionTransferLog(IntegralTransferLogSaveReqVO createReqVO) {
+        // 插入
+        IntegralTransferLogDO consumptionTransferLog = BeanUtils.toBean(createReqVO, IntegralTransferLogDO.class);
+        integralTransferLogMapper.insert(consumptionTransferLog);
+        // 返回
+        return consumptionTransferLog.getId();
+    }
+
+    @Override
+    public void updateConsumptionTransferLog(IntegralTransferLogSaveReqVO updateReqVO) {
+        // 校验存在
+        validateConsumptionTransferLogExists(updateReqVO.getId());
+        // 更新
+        IntegralTransferLogDO updateObj = BeanUtils.toBean(updateReqVO, IntegralTransferLogDO.class);
+        integralTransferLogMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteConsumptionTransferLog(Long id) {
+        // 校验存在
+        validateConsumptionTransferLogExists(id);
+        // 删除
+        integralTransferLogMapper.deleteById(id);
+    }
+
+    private void validateConsumptionTransferLogExists(Long id) {
+        if (integralTransferLogMapper.selectById(id) == null) {
+            throw exception(CONSUMPTION_TRANSFER_LOG_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public IntegralTransferLogDO getConsumptionTransferLog(Long id) {
+        return integralTransferLogMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<IntegralTransferLogDO> getConsumptionTransferLogPage(IntegralTransferLogPageReqVO pageReqVO) {
+        return integralTransferLogMapper.selectPage(pageReqVO);
+    }
+
+    @Override
+    public List<IntegralTransferLogDO> selectList() {
+        return integralTransferLogMapper.selectList();
+    }
+
+}

+ 1 - 1
feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/controller/admin/point/vo/recrod/MemberPointRecordRespVO.java

@@ -16,7 +16,7 @@ public class MemberPointRecordRespVO {
     private Long userId;
     private Long userId;
 
 
     @Schema(description = "昵称", example = "张三")
     @Schema(description = "昵称", example = "张三")
-    private String nickname;
+    private String username;
 
 
     @Schema(description = "业务编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "22706")
     @Schema(description = "业务编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "22706")
     private String bizId;
     private String bizId;

+ 1 - 1
feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/convert/point/MemberPointRecordConvert.java

@@ -29,7 +29,7 @@ public interface MemberPointRecordConvert {
         // user 拼接
         // user 拼接
         Map<Long, MemberUserDO> userMap = convertMap(users, MemberUserDO::getId);
         Map<Long, MemberUserDO> userMap = convertMap(users, MemberUserDO::getId);
         voPageResult.getList().forEach(record -> MapUtils.findAndThen(userMap, record.getUserId(),
         voPageResult.getList().forEach(record -> MapUtils.findAndThen(userMap, record.getUserId(),
-                memberUserRespDTO -> record.setNickname(memberUserRespDTO.getNickname())));
+                memberUserRespDTO -> record.setUsername(memberUserRespDTO.getUsername())));
         return voPageResult;
         return voPageResult;
     }
     }
     PageResult<MemberPointRecordRespVO> convertPage(PageResult<MemberPointRecordDO> pageResult);
     PageResult<MemberPointRecordRespVO> convertPage(PageResult<MemberPointRecordDO> pageResult);

+ 1 - 1
feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/convert/signin/MemberSignInRecordConvert.java

@@ -34,7 +34,7 @@ public interface MemberSignInRecordConvert {
         // user 拼接
         // user 拼接
         Map<Long, MemberUserDO> userMap = convertMap(users, MemberUserDO::getId);
         Map<Long, MemberUserDO> userMap = convertMap(users, MemberUserDO::getId);
         voPageResult.getList().forEach(record -> MapUtils.findAndThen(userMap, record.getUserId(),
         voPageResult.getList().forEach(record -> MapUtils.findAndThen(userMap, record.getUserId(),
-                memberUserRespDTO -> record.setNickname(memberUserRespDTO.getNickname())));
+                memberUserRespDTO -> record.setNickname(memberUserRespDTO.getUsername())));
         return voPageResult;
         return voPageResult;
     }
     }
 
 

+ 1 - 3
feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/service/level/MemberLevelServiceImpl.java

@@ -201,7 +201,6 @@ public class MemberLevelServiceImpl implements MemberLevelService {
         MemberLevelDO memberLevel = null;
         MemberLevelDO memberLevel = null;
         if (updateReqVO.getLevelId() == null) {
         if (updateReqVO.getLevelId() == null) {
             // 取消用户等级时,需要扣减经验
             // 取消用户等级时,需要扣减经验
-            levelRecord.setExperience(-user.getExperience());
             levelRecord.setUserExperience(0);
             levelRecord.setUserExperience(0);
             levelRecord.setDescription("管理员取消了等级");
             levelRecord.setDescription("管理员取消了等级");
         } else {
         } else {
@@ -209,7 +208,6 @@ public class MemberLevelServiceImpl implements MemberLevelService {
             memberLevel = validateLevelExists(updateReqVO.getLevelId());
             memberLevel = validateLevelExists(updateReqVO.getLevelId());
             MemberLevelRecordConvert.INSTANCE.copyTo(memberLevel, levelRecord);
             MemberLevelRecordConvert.INSTANCE.copyTo(memberLevel, levelRecord);
             // 变动经验值 = 等级的升级经验 - 会员当前的经验;正数为增加经验,负数为扣减经验
             // 变动经验值 = 等级的升级经验 - 会员当前的经验;正数为增加经验,负数为扣减经验
-            levelRecord.setExperience(memberLevel.getExperience() - user.getExperience());
             levelRecord.setUserExperience(memberLevel.getExperience()); // 会员当前的经验 = 等级的升级经验
             levelRecord.setUserExperience(memberLevel.getExperience()); // 会员当前的经验 = 等级的升级经验
             levelRecord.setDescription("管理员调整为:" + memberLevel.getName());
             levelRecord.setDescription("管理员调整为:" + memberLevel.getName());
         }
         }
@@ -240,7 +238,7 @@ public class MemberLevelServiceImpl implements MemberLevelService {
 
 
         // 1. 创建经验记录
         // 1. 创建经验记录
         MemberUserDO user = memberUserService.getUser(userId);
         MemberUserDO user = memberUserService.getUser(userId);
-        Integer userExperience = ObjUtil.defaultIfNull(user.getExperience(), 0);
+        Integer userExperience =0;
         userExperience = NumberUtil.max(userExperience + experience, 0); // 防止扣出负数
         userExperience = NumberUtil.max(userExperience + experience, 0); // 防止扣出负数
         MemberLevelRecordDO levelRecord = new MemberLevelRecordDO()
         MemberLevelRecordDO levelRecord = new MemberLevelRecordDO()
                 .setUserId(user.getId())
                 .setUserId(user.getId())

+ 0 - 20
feifan-module-member/feifan-module-member-biz/src/main/java/cn/newfeifan/mall/module/member/service/point/MemberPointRecordServiceImpl.java

@@ -70,26 +70,6 @@ public class MemberPointRecordServiceImpl implements MemberPointRecordService {
         if (point == 0) {
         if (point == 0) {
             return;
             return;
         }
         }
-        // 1. 校验用户积分余额
-        MemberUserDO user = memberUserService.getUser(userId);
-        Integer userPoint = ObjectUtil.defaultIfNull(user.getPoint(), 0);
-        int totalPoint = userPoint + point; // 用户变动后的积分
-        if (totalPoint < 0) {
-            throw exception(USER_POINT_NOT_ENOUGH);
-        }
-
-        // 2. 更新用户积分
-        boolean success = memberUserService.updateUserPoint(userId, point);
-        if (!success) {
-            throw exception(USER_POINT_NOT_ENOUGH);
-        }
-
-        // 3. 增加积分记录
-        MemberPointRecordDO record = new MemberPointRecordDO()
-                .setUserId(userId).setBizId(bizId).setBizType(bizType.getType())
-                .setTitle(bizType.getName()).setDescription(StrUtil.format(bizType.getDescription(), point))
-                .setPoint(point).setTotalPoint(totalPoint);
-        memberPointRecordMapper.insert(record);
     }
     }
 
 
 }
 }