Yangzw před 2 měsíci
rodič
revize
64e9a9dc5b
18 změnil soubory, kde provedl 390 přidání a 351 odebrání
  1. 0 45
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/consumptionchangelog/vo/ConsumptionChangeLogPageReqVO.java
  2. 0 57
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/consumptionchangelog/vo/ConsumptionChangeLogRespVO.java
  3. 0 41
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/consumptionchangelog/vo/ConsumptionChangeLogSaveReqVO.java
  4. 0 18
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/dailybill/vo/DailyBillPageReqVO.java
  5. 1 1
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/duser/vo/DuserSaveReqVO.java
  6. 7 7
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integralchangelog/IntegralChangeLogController.java
  7. 68 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integralchangelog/vo/IntegralChangeLogPageReqVO.java
  8. 80 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integralchangelog/vo/IntegralChangeLogRespVO.java
  9. 60 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integralchangelog/vo/IntegralChangeLogSaveReqVO.java
  10. 0 62
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/consumptionchangelog/ConsumptionChangeLogDO.java
  11. 87 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/integralchangelog/IntegralChangeLogDO.java
  12. 0 29
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/consumptionchangelog/ConsumptionChangeLogMapper.java
  13. 29 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/integralchangelog/IntegralChangeLogMapper.java
  14. 0 38
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/dailybill/DailyBillServiceImpl.java
  15. 0 2
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/duser/DuserService.java
  16. 28 47
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/duser/DuserServiceImpl.java
  17. 11 4
      feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/service/delivery/DeliveryExpressTemplateService.java
  18. 19 0
      feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/service/delivery/DeliveryExpressTemplateServiceImpl.java

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

@@ -1,45 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.admin.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;
-
-    @Schema(description = "订单Id", example = "18715")
-    private Long orderId;
-
-    @Schema(description = "订单编号")
-    private String orderNo;
-
-}

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

@@ -1,57 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.admin.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;
-
-    @Schema(description = "订单Id", example = "18715")
-    @ExcelProperty("订单Id")
-    private Long orderId;
-
-    @Schema(description = "订单编号")
-    @ExcelProperty("订单编号")
-    private String orderNo;
-
-}

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

@@ -1,41 +0,0 @@
-package cn.newfeifan.mall.module.distri.controller.admin.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 - 18
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/dailybill/vo/DailyBillPageReqVO.java

@@ -16,12 +16,6 @@ import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR
 @ToString(callSuper = true)
 public class DailyBillPageReqVO extends PageParam {
 
-    @Schema(description = "金额,单位:分", example = "30486")
-    private Long price;
-
-    @Schema(description = "确收金额,单位:分", example = "29815")
-    private Long receivedPrice;
-
     @Schema(description = "订单数,默认为0", example = "27164")
     private Long orderCount;
 
@@ -38,9 +32,6 @@ public class DailyBillPageReqVO extends PageParam {
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
 
-    @Schema(description = "退款金额, 单位: 分", example = "11962")
-    private Long refundPrice;
-
     @Schema(description = "积分")
     private Long integral;
 
@@ -56,13 +47,4 @@ public class DailyBillPageReqVO extends PageParam {
     @Schema(description = "平台每日账单表id", example = "6905")
     private Long ptDailyBillId;
 
-    @Schema(description = "消费分")
-    private Long consumptionPoints;
-
-    @Schema(description = "确收消费分")
-    private Long receivedConsumptionPoints;
-
-    @Schema(description = "退款消费分")
-    private Long refundConsumptionPoints;
-
 }

+ 1 - 1
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 = "团队人员手机号码不能为空")

+ 7 - 7
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/consumptionchangelog/ConsumptionChangeLogController.java → feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integralchangelog/IntegralChangeLogController.java

@@ -1,4 +1,4 @@
-package cn.newfeifan.mall.module.distri.controller.admin.consumptionchangelog;
+package cn.newfeifan.mall.module.distri.controller.admin.integralchangelog;
 
 import org.springframework.web.bind.annotation.*;
 import javax.annotation.Resource;
@@ -13,23 +13,23 @@ import cn.newfeifan.mall.framework.common.pojo.CommonResult;
 import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
 
 
-import cn.newfeifan.mall.module.distri.controller.admin.consumptionchangelog.vo.*;
-import cn.newfeifan.mall.module.distri.service.consumptionchangelog.ConsumptionChangeLogService;
+import cn.newfeifan.mall.module.distri.controller.admin.integralchangelog.vo.*;
+import cn.newfeifan.mall.module.distri.service.integralchangelog.IntegralChangeLogService;
 
 @Tag(name = "管理后台 - 平台消费分变动记录")
 @RestController
 @RequestMapping("/distri/consumption-change-log")
 @Validated
-public class ConsumptionChangeLogController {
+public class IntegralChangeLogController {
 
     @Resource
-    private ConsumptionChangeLogService consumptionChangeLogService;
+    private IntegralChangeLogService integralChangeLogService;
 
     @GetMapping("/page")
     @Operation(summary = "获得平台消费分变动记录分页")
     @PreAuthorize("@ss.hasPermission('distri:consumption-change-log:query')")
-    public CommonResult<PageResult<ConsumptionChangeLogRespVO>> getConsumptionChangeLogPage(@Valid ConsumptionChangeLogPageReqVO pageReqVO) {
-        PageResult<ConsumptionChangeLogRespVO> pageResult = consumptionChangeLogService.getConsumptionChangeLogPage(pageReqVO);
+    public CommonResult<PageResult<IntegralChangeLogRespVO>> getConsumptionChangeLogPage(@Valid IntegralChangeLogPageReqVO pageReqVO) {
+        PageResult<IntegralChangeLogRespVO> pageResult = integralChangeLogService.getConsumptionChangeLogPage(pageReqVO);
         return success(pageResult);
     }
 

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

@@ -0,0 +1,68 @@
+package cn.newfeifan.mall.module.distri.controller.admin.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 javax.validation.constraints.NotNull;
+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")
+    @NotNull(message = "用户ID不能为空")
+    private Long userId;
+
+    @Schema(description = "积分类型", example = "1")
+    @NotNull(message = "积分类型不能为空")
+    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;
+
+
+}

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

@@ -0,0 +1,80 @@
+package cn.newfeifan.mall.module.distri.controller.admin.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;
+}

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

@@ -0,0 +1,60 @@
+package cn.newfeifan.mall.module.distri.controller.admin.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;
+
+}

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

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

@@ -0,0 +1,87 @@
+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") // 用于 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;
+
+
+}

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

@@ -1,29 +0,0 @@
-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.dal.dataobject.consumptionchangelog.ConsumptionChangeLogDO;
-import org.apache.ibatis.annotations.Mapper;
-import cn.newfeifan.mall.module.distri.controller.admin.consumptionchangelog.vo.*;
-
-/**
- * 平台消费分变动记录 Mapper
- *
- * @author 非繁人
- */
-@Mapper
-public interface ConsumptionChangeLogMapper extends BaseMapperX<ConsumptionChangeLogDO> {
-
-    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));
-    }
-
-}

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

@@ -0,0 +1,29 @@
+package cn.newfeifan.mall.module.distri.dal.mysql.integralchangelog;
+
+
+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.integralchangelog.IntegralChangeLogDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.distri.controller.admin.integralchangelog.vo.*;
+
+/**
+ * 平台消费分变动记录 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface IntegralChangeLogMapper extends BaseMapperX<IntegralChangeLogDO> {
+
+    default PageResult<IntegralChangeLogDO> selectPage(IntegralChangeLogPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<IntegralChangeLogDO>()
+                .eq(IntegralChangeLogDO::getUserId, reqVO.getUserId())
+                .eq(IntegralChangeLogDO::getIntegralType, reqVO.getIntegralType())
+                .eqIfPresent(IntegralChangeLogDO::getIntegralPoints, reqVO.getIntegralPoints())
+                .eqIfPresent(IntegralChangeLogDO::getAfterIntegralPoints, reqVO.getAfterIntegralPoints())
+                .betweenIfPresent(IntegralChangeLogDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(IntegralChangeLogDO::getId));
+    }
+
+}

+ 0 - 38
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/dailybill/DailyBillServiceImpl.java

@@ -102,12 +102,6 @@ public class DailyBillServiceImpl implements DailyBillService {
         ordersByDate.forEach((date, orderList) -> {
             // 计算分组结果,并按订单创建时间倒序输出每个日期的订单
 
-            Long ptPrice = orderList.stream()
-                    .mapToLong(OrderDTO::getPayPrice)
-                    .sum();
-            Long ptRefundPrice = orderList.stream()
-                    .mapToLong(OrderDTO::getRefundPrice)
-                    .sum();
             Long ptIntegral = orderList.stream()
                     .mapToLong(OrderDTO::getPayIntegral)
                     .sum();
@@ -115,24 +109,11 @@ public class DailyBillServiceImpl implements DailyBillService {
                     .filter(order -> order.getRefundIntegral() != null)  // 过滤掉 getRefundIntegral 为空的订单
                     .mapToLong(OrderDTO::getRefundIntegral)
                     .sum();
-            Long ptConsumptionPoints = orderList.stream()
-                    .mapToLong(OrderDTO::getPayConsumptionPoints)
-                    .sum();
-            Long ptRefundConsumptionPoints = orderList.stream()
-                    .filter(order -> order.getRefundConsumption() != null)  // 过滤掉 getRefundConsumptionPoints 为空的订单
-                    .mapToLong(OrderDTO::getRefundConsumption)
-                    .sum();
 
             PtDailyBillDO ptDailyBillDO = PtDailyBillDO.builder()
-                    .price(ptPrice)
-                    .refundPrice(ptRefundPrice)
-                    .receivedPrice(ptPrice - ptRefundPrice)
                     .integral(ptIntegral)
                     .refundIntegral(ptRefundIntegral)
                     .receivedIntegral(ptIntegral - ptRefundIntegral)
-                    .consumptionPoints(ptConsumptionPoints)
-                    .refundConsumptionPoints(ptRefundConsumptionPoints)
-                    .receivedConsumptionPoints(ptConsumptionPoints - ptRefundConsumptionPoints)
                     .orderCount((long) orderList.size())
                     .orderIds(orderList.stream().map(OrderDTO::getId).collect(Collectors.toList()).toString())
                     .orderCalcTime(date)
@@ -145,12 +126,6 @@ public class DailyBillServiceImpl implements DailyBillService {
                             Collectors.toList()));
 
             dailyBillByShop.forEach((shopId, shopOrderList) -> {
-                Long price = shopOrderList.stream()
-                        .mapToLong(OrderDTO::getPayPrice)
-                        .sum();
-                Long refundPrice = shopOrderList.stream()
-                        .mapToLong(OrderDTO::getRefundPrice)
-                        .sum();
                 Long integral = shopOrderList.stream()
                         .mapToLong(OrderDTO::getPayIntegral)
                         .sum();
@@ -158,24 +133,11 @@ public class DailyBillServiceImpl implements DailyBillService {
                         .filter(order -> order.getRefundIntegral() != null)  // 过滤掉 getRefundIntegral 为空的订单
                         .mapToLong(OrderDTO::getRefundIntegral)
                         .sum();
-                Long consumptionPoints = shopOrderList.stream()
-                        .mapToLong(OrderDTO::getPayConsumptionPoints)
-                        .sum();
-                Long refundConsumptionPoints = shopOrderList.stream()
-                        .filter(order -> order.getRefundConsumption() != null)  // 过滤掉 getRefundConsumptionPoints 为空的订单
-                        .mapToLong(OrderDTO::getRefundConsumption)
-                        .sum();
 
                 DailyBillDO dailyBillDO = DailyBillDO.builder()
-                        .price(price)
-                        .refundPrice(refundPrice)
-                        .receivedPrice(price - refundPrice)
                         .integral(integral)
                         .refundIntegral(refundIntegral)
                         .receivedIntegral(integral - refundIntegral)
-                        .consumptionPoints(consumptionPoints)
-                        .refundConsumptionPoints(refundConsumptionPoints)
-                        .receivedConsumptionPoints(consumptionPoints - refundConsumptionPoints)
                         .orderCount((long) shopOrderList.size())
                         .orderIds(shopOrderList.stream().map(OrderDTO::getId).collect(Collectors.toList()).toString())
                         .orderCalcTime(date)

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

@@ -85,8 +85,6 @@ public interface DuserService {
 
     DuserDO getDuserByUser(Long userId);
 
-    List<DuserDO> getDuserByName(String name);
-
     DuserDO getDuserByMobile(String mobile);
 
     DuserInfoVO initDuser();

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

@@ -75,7 +75,6 @@ public class DuserServiceImpl implements DuserService {
     private SocialStatusChangeLogService socialStatusChangeLogService;
 
 
-
     @Override
     public Long createDuser(DuserSaveReqVO createReqVO) {
         // 插入
@@ -118,13 +117,6 @@ public class DuserServiceImpl implements DuserService {
         return duserMapper.selectOne(new LambdaQueryWrapperX<DuserDO>().eq(DuserDO::getUserId, id));
     }
 
-    @Override
-    public List<DuserDO> getDuserByName(String name) {
-        return duserMapper.selectList(new LambdaQueryWrapperX<DuserDO>()
-                .eq(DuserDO::getNickName, name)
-        );
-    }
-
     @Override
     public DuserDO getDuserByMobile(String mobile) {
         return duserMapper.selectOne(new LambdaQueryWrapperX<DuserDO>()
@@ -146,7 +138,7 @@ public class DuserServiceImpl implements DuserService {
     public void updateDuserSocial(Long userId, Long social, Integer socialStatus) {
 
         //平台不参与身价
-        if(Objects.equals(userId, PT_ID)){
+        if (Objects.equals(userId, PT_ID)) {
             return;
         }
 
@@ -160,7 +152,7 @@ public class DuserServiceImpl implements DuserService {
 
         duserMapper.updateById(duser);
 
-        socialStatusChangeLogService.createSocialStatusChangeLog(userId, social,userId, SocialStatusEnum.getSocialStatusEnumByCode(socialStatus));
+        socialStatusChangeLogService.createSocialStatusChangeLog(userId, social, userId, SocialStatusEnum.getSocialStatusEnumByCode(socialStatus));
     }
 
     @Override
@@ -173,15 +165,18 @@ public class DuserServiceImpl implements DuserService {
         for (MemberUserRespVO memberUserRespVO : result.getList()) {
             //获取团队用户
             DuserDO duser = getDuserByUser(memberUserRespVO.getId());
-            if(duser == null) continue;
+            if (duser == null) continue;
             SocialStatusDO socialStatus = socialStatusService.getSocialStatus(duser.getSocialStatusId());
-            if(socialStatus == null) continue;
+            memberUserRespVO.setCategoryId(duser.getCategoryId());
+            if (socialStatus == null) continue;
             memberUserRespVO.setCurrentMemberWorthLevelName(socialStatus.getName());
             memberUserRespVO.setCurrentMemberWorthLevel(socialStatus.getLevel());
             //获取钱包
             IntegralDO integral = integralService.getIntegral(memberUserRespVO.getId());
+            memberUserRespVO.setYellowCurrentQuota(integral.getYellowCurrentQuota());
+            memberUserRespVO.setGreenCurrentQuota(integral.getGreenCurrentQuota());
+            memberUserRespVO.setRedCurrentQuota(integral.getRedCurrentQuota());
 //            if(integral == null) continue;
-            memberUserRespVO.setCurrentMemberPoints(integral.getCurrentQuota());
         }
         return result;
     }
@@ -189,7 +184,7 @@ public class DuserServiceImpl implements DuserService {
     @Override
     public PageResult<DuserDO> getDuserPage(DuserPageReqVO pageReqVO) {
 
-        if(pageReqVO.getUsername() != null && !pageReqVO.getUsername().isEmpty()){
+        if (pageReqVO.getUsername() != null && !pageReqVO.getUsername().isEmpty()) {
             MemberUserDO user = memberUserService.getUserByUsername(pageReqVO.getUsername());
             pageReqVO.setUserId(user == null ? -1 : user.getId());
         }
@@ -205,8 +200,8 @@ public class DuserServiceImpl implements DuserService {
 
     @Override
     public void hasUserAndCreat(SharePathSaveReqVO saveReqVO) {
-        checkAndCreat(saveReqVO.getDescendant());
-        checkAndCreat(saveReqVO.getAncestor());
+        checkAndCreat(saveReqVO.getUserId());
+        checkAndCreat(saveReqVO.getReferrerId());
     }
 
     @Override
@@ -260,12 +255,8 @@ public class DuserServiceImpl implements DuserService {
         if (integralDO == null) {
             // 创建一个钱包
             IntegralSaveReqVO integralSaveReqVO = IntegralSaveReqVO.builder()
-                    .currentQuota(0L)
-                    .nickName(user.getNickname())
-                    .name(user.getName())
+                    .redCurrentQuota(0L)
                     .freezeQuota(0L)
-                    .categoryId(3L)
-                    .highQuota(0L)
                     .userId(userId).build();
             Long integralId = integralService.createIntegral(integralSaveReqVO);
             integralDO = new IntegralDO().setId(integralId);
@@ -278,8 +269,6 @@ public class DuserServiceImpl implements DuserService {
             DuserSaveReqVO duserSaveReqVO = DuserSaveReqVO.builder()
                     .userId(userId)
                     .mobile(user.getMobile())
-                    .name(user.getName())
-                    .nickName(user.getNickname())
                     .integralId(integralDO.getId())
                     .source(userId)
                     .socialStatusPoint(Long.valueOf(orderPercentageDO.getRegisterSocialStatus()))
@@ -288,7 +277,7 @@ public class DuserServiceImpl implements DuserService {
                     .build();
             duserMapper.insert(BeanUtils.toBean(duserSaveReqVO, DuserDO.class));
 
-            socialStatusChangeLogService.createSocialStatusChangeLog(userId, Long.valueOf(orderPercentageDO.getRegisterAncestorSocialStatus()),userId, SocialStatusEnum.REGISTER_SOCIAL);
+            socialStatusChangeLogService.createSocialStatusChangeLog(userId, Long.valueOf(orderPercentageDO.getRegisterAncestorSocialStatus()), userId, SocialStatusEnum.REGISTER_SOCIAL);
         }
     }
 
@@ -297,40 +286,32 @@ public class DuserServiceImpl implements DuserService {
     public void getSharePathCount(PageResult<DuserRespVO> result) {
         List<DuserRespVO> list = result.getList();
         for (DuserRespVO duserRespVO : list) {
+            SharePathDO sharePathDO = sharePathMapper.selectOne(new LambdaQueryWrapper<SharePathDO>()
+                    .eq(SharePathDO::getUserId, duserRespVO.getUserId())
+            );
+            duserRespVO.setLeftChildId(sharePathDO.getLeftChildId());
+            duserRespVO.setRightChildId(sharePathDO.getRightChildId());
             duserRespVO.setDescendantCount(sharePathMapper.selectCount(new LambdaQueryWrapperX<SharePathDO>()
-                    .eq(SharePathDO::getAncestor, duserRespVO.getUserId())
-                    .eq(SharePathDO::getDepth, 1)
-            ));
-            duserRespVO.setChildrenCount(sharePathMapper.selectCount(new LambdaQueryWrapperX<SharePathDO>()
-                    .eq(SharePathDO::getAncestor, duserRespVO.getUserId())
+                    .eq(SharePathDO::getReferrerId, duserRespVO.getUserId())
             ));
+            duserRespVO.setLeftCount((long) sharePathMapper.selectListByUserId(sharePathDO.getLeftChildId(), 99999).size());
+            duserRespVO.setRightCount((long) sharePathMapper.selectListByUserId(sharePathDO.getRightChildId(), 99999).size());
 
-            SharePathDO sharePathDO = sharePathMapper.selectOne(new LambdaQueryWrapper<SharePathDO>()
-                    .eq(SharePathDO::getDescendant, duserRespVO.getUserId())
-                    .eq(SharePathDO::getDepth, 1)
+            SharePathDO referrer = sharePathMapper.selectOne(new LambdaQueryWrapper<SharePathDO>()
+                    .eq(SharePathDO::getUserId, sharePathDO.getReferrerId())
             );
-            if(sharePathDO != null){
-                duserRespVO.setAncNickName(sharePathDO.getAncNickName());
-                MemberUserDO user = memberUserService.getUser(sharePathDO.getAncestor());
-                duserRespVO.setAncUsername(user.getUsername());
-            }else{
-                duserRespVO.setAncNickName("");
-            }
+            duserRespVO.setAncUsername(referrer == null ? "" : referrer.getUserName());
 
             MemberUserDO user = memberUserService.getUser(duserRespVO.getUserId());
             duserRespVO.setAvatar(user.getAvatar());
             duserRespVO.setUsername(user.getUsername());
 
-            SocialStatusDO socialStatus = socialStatusService.getSocialStatus(duserRespVO.getSocialStatusId());
-            if(socialStatus != null) {
-                duserRespVO.setSocialStatusLevel(socialStatus.getLevel());
-                duserRespVO.setSocialStatusLevelName(socialStatus.getName());
-            }
 
             IntegralDO integral = integralService.getIntegral(duserRespVO.getUserId());
-            if(integral != null){
-                duserRespVO.setIntegral(integral.getCurrentQuota());
-                duserRespVO.setFreezeIntegral(integral.getFreezeQuota());
+            if (integral != null) {
+                duserRespVO.setRedCurrentQuota(integral.getRedCurrentQuota());
+                duserRespVO.setYellowCurrentQuota(integral.getYellowCurrentQuota());
+                duserRespVO.setGreenCurrentQuota(integral.getGreenCurrentQuota());
             }
         }
     }

+ 11 - 4
feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/service/delivery/DeliveryExpressTemplateService.java

@@ -1,12 +1,10 @@
 package cn.newfeifan.mall.module.trade.service.delivery;
 
 import cn.newfeifan.mall.framework.common.pojo.PageResult;
-import cn.newfeifan.mall.module.trade.controller.admin.delivery.vo.expresstemplate.DeliveryExpressTemplateCreateReqVO;
-import cn.newfeifan.mall.module.trade.controller.admin.delivery.vo.expresstemplate.DeliveryExpressTemplateDetailRespVO;
-import cn.newfeifan.mall.module.trade.controller.admin.delivery.vo.expresstemplate.DeliveryExpressTemplatePageReqVO;
-import cn.newfeifan.mall.module.trade.controller.admin.delivery.vo.expresstemplate.DeliveryExpressTemplateUpdateReqVO;
+import cn.newfeifan.mall.module.trade.controller.admin.delivery.vo.expresstemplate.*;
 import cn.newfeifan.mall.module.trade.dal.dataobject.delivery.DeliveryExpressTemplateDO;
 import cn.newfeifan.mall.module.trade.service.delivery.bo.DeliveryExpressTemplateRespBO;
+import org.springframework.transaction.annotation.Transactional;
 
 import javax.validation.Valid;
 import java.util.Collection;
@@ -28,6 +26,15 @@ public interface DeliveryExpressTemplateService {
      */
     Long createDeliveryExpressTemplate(@Valid DeliveryExpressTemplateCreateReqVO createReqVO);
 
+    /**
+     * 创建模板
+     * @param template 模板信息
+     * @param charges 运费设置
+     * @param frees 包邮设置
+     * @return id
+     */
+    Long createTemplate(DeliveryExpressTemplateDO template, List<DeliveryExpressTemplateChargeBaseVO> charges, List<DeliveryExpressTemplateFreeBaseVO> frees);
+
     /**
      * 更新快递运费模板
      *

+ 19 - 0
feifan-module-mall/feifan-module-trade-biz/src/main/java/cn/newfeifan/mall/module/trade/service/delivery/DeliveryExpressTemplateServiceImpl.java

@@ -80,6 +80,25 @@ public class DeliveryExpressTemplateServiceImpl implements DeliveryExpressTempla
         return template.getId();
     }
 
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public Long createTemplate(DeliveryExpressTemplateDO template, List<DeliveryExpressTemplateChargeBaseVO> charges, List<DeliveryExpressTemplateFreeBaseVO> frees){
+        expressTemplateMapper.insert(template);
+        // 插入运费模板计费表
+        if (CollUtil.isNotEmpty(charges)) {
+            expressTemplateChargeMapper.insertBatch(
+                    INSTANCE.convertTemplateChargeList(template.getId(), template.getChargeMode(), charges)
+            );
+        }
+        // 插入运费模板包邮表
+        if (CollUtil.isNotEmpty(frees)) {
+            expressTemplateFreeMapper.insertBatch(
+                    INSTANCE.convertTemplateFreeList(template.getId(), frees)
+            );
+        }
+        return template.getId();
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void updateDeliveryExpressTemplate(DeliveryExpressTemplateUpdateReqVO updateReqVO) {