Yangzw 2 mēneši atpakaļ
vecāks
revīzija
7565e937b3
15 mainītis faili ar 191 papildinājumiem un 239 dzēšanām
  1. 13 6
      feifan-module-distri/feifan-module-distri-api/src/main/java/cn/newfeifan/mall/module/distri/enums/IntegralEnum.java
  2. 3 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/dailyawardrecords/vo/DailyAwardRecordsSaveReqVO.java
  3. 14 10
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integral/vo/IntegralPageReqVO.java
  4. 14 3
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integral/vo/IntegralRespVO.java
  5. 12 12
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integral/vo/IntegralSaveReqVO.java
  6. 2 2
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integraltopuplog/vo/IntegralInfoVO.java
  7. 18 19
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/dataobject/integral/IntegralDO.java
  8. 0 3
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/dailybill/DailyBillMapper.java
  9. 0 2
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/duser/DuserMapper.java
  10. 1 4
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/integral/IntegralMapper.java
  11. 0 92
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/consumptionchangelog/ConsumptionChangeLogServiceImpl.java
  12. 0 77
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/consumptiontransferlog/ConsumptionTransferLogServiceImpl.java
  13. 5 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/dailyawardrecords/DailyAwardRecordsService.java
  14. 11 9
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integralchangelog/IntegralChangeLogService.java
  15. 98 0
      feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integralchangelog/IntegralChangeLogServiceImpl.java

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

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

+ 3 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/dailyawardrecords/vo/DailyAwardRecordsSaveReqVO.java

@@ -24,6 +24,9 @@ public class DailyAwardRecordsSaveReqVO {
     @NotNull(message = "是否已结算,默认为未结算不能为空")
     private Boolean settled;
 
+    @Schema(description = "是否计算团队奖, 默认为未计算")
+    private Boolean calcLucky;
+
     @Schema(description = "日志Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16092")
     @NotNull(message = "日志Id不能为空")
     private Long logId;

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

@@ -4,6 +4,8 @@ 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;
@@ -17,21 +19,15 @@ public class IntegralPageReqVO extends PageParam {
     @Schema(description = "用户ID", example = "19778")
     private Long userId;
 
-    @Schema(description = "用户类型", example = "17348")
-    private Long categoryId;
-
     @Schema(description = "创建时间")
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
 
-    @Schema(description = "用户名称", example = "赵六")
-    private String name;
-
     @Schema(description = "用户昵称", example = "赵六")
-    private String nickName;
+    private String userName;
 
     @Schema(description = "当前积分")
-    private Long currentQuota;
+    private Long redCurrentQuota;
 
     @Schema(description = "冻结积分")
     private Long freezeQuota;
@@ -42,12 +38,20 @@ public class IntegralPageReqVO extends PageParam {
     @Schema(description = "直推奖累计获取积分")
     private Long ancestorQuota;
 
+    @Schema(description = "幸运奖累计获取积分")
+    private Long luckyQuota;
+
     @Schema(description = "最高可获取积分")
     private Long highQuota;
 
     @Schema(description = "累计获取的峰值")
     private Long highQuotaTotal;
 
-    @Schema(description = "当前消费分")
-    private Long consumptionPoints;
+    @Schema(description = "当前黄积分", requiredMode = Schema.RequiredMode.REQUIRED)
+    private Long yellowCurrentQuota;
+
+    @Schema(description = "当前绿积分", requiredMode = Schema.RequiredMode.REQUIRED)
+    private Long greenCurrentQuota;
+
+
 }

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

@@ -5,6 +5,8 @@ import lombok.*;
 import java.time.LocalDateTime;
 import com.alibaba.excel.annotation.*;
 
+import javax.validation.constraints.NotNull;
+
 @Schema(description = "管理后台 - 推荐用户积分 Response VO")
 @Data
 @ExcelIgnoreUnannotated
@@ -50,6 +52,10 @@ public class IntegralRespVO {
     @ExcelProperty("直推奖累计获取积分")
     private Long ancestorQuota;
 
+    @Schema(description = "幸运奖累计获取积分")
+    @ExcelProperty("幸运奖累计获取积分")
+    private Long luckyQuota;
+
     @Schema(description = "最高可获取积分", requiredMode = Schema.RequiredMode.REQUIRED)
     @ExcelProperty("最高可获取积分")
     private Long highQuota;
@@ -58,7 +64,12 @@ public class IntegralRespVO {
     @ExcelProperty("累计获取的峰值")
     private Long highQuotaTotal;
 
-    @Schema(description = "当前消费分", requiredMode = Schema.RequiredMode.REQUIRED)
-    @ExcelProperty("当前消费分")
-    private Long consumptionPoints;
+    @Schema(description = "当前红积分", requiredMode = Schema.RequiredMode.REQUIRED)
+    private Long redCurrentQuota;
+
+    @Schema(description = "当前黄积分", requiredMode = Schema.RequiredMode.REQUIRED)
+    private Long yellowCurrentQuota;
+
+    @Schema(description = "当前绿积分", requiredMode = Schema.RequiredMode.REQUIRED)
+    private Long greenCurrentQuota;
 }

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

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

+ 2 - 2
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/consumptiontopuplog/vo/ConsumptionInfoVO.java → feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/controller/admin/integraltopuplog/vo/IntegralInfoVO.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.Builder;
 import lombok.Data;
@@ -9,7 +9,7 @@ import lombok.Data;
 
 @Data
 @Builder
-public class ConsumptionInfoVO {
+public class IntegralInfoVO {
     /**
      * 是否是第一次充值消费分
      */

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

@@ -29,48 +29,47 @@ public class IntegralDO extends BaseDO {
      */
     private Long userId;
     /**
-     * 用户类型
+     * 当前红积分
      */
-    private Long categoryId;
-    /**
-     * 用户名称
-     */
-    private String name;
-    /**
-     * 用户昵称
-     */
-    private String nickName;
-    /**
-     * 当前积分
-     */
-    private Long currentQuota;
+    private Long redCurrentQuota;
     /**
      * 冻结积分
      */
     private Long freezeQuota;
+
+    private Long highQuota;
+
+    private String userName;
+
     /**
-     * 合赢奖累计获取积分
+     * 团队奖累计获取积分
      */
     private Long accumulatedQuota;
     /**
      * 直推奖累计获取积分
      */
     private Long ancestorQuota;
+
     /**
-     * 最高可获取积分
+     * 幸运奖累计获取积分
      */
-    private Long highQuota;
+    private Long luckyQuota;
     /**
      * 冻结的最高可获取积分
      */
     private Long freezeHighQuota;
+
     /**
      * 累计获取的峰值
      */
     private Long highQuotaTotal;
 
     /**
-     * 当前消费分
+     * 当前黄积分
+     */
+    private Long yellowCurrentQuota;
+    /**
+     * 当前绿积分
      */
-    private Long consumptionPoints;
+    private Long greenCurrentQuota;
 }

+ 0 - 3
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/dal/mysql/dailybill/DailyBillMapper.java

@@ -22,14 +22,11 @@ public interface DailyBillMapper extends BaseMapperX<DailyBillDO> {
 
     default PageResult<DailyBillDO> selectPage(DailyBillPageReqVO reqVO) {
         return selectPage(reqVO, new LambdaQueryWrapperX<DailyBillDO>()
-                .eqIfPresent(DailyBillDO::getPrice, reqVO.getPrice())
-                .eqIfPresent(DailyBillDO::getReceivedPrice, reqVO.getReceivedPrice())
                 .eqIfPresent(DailyBillDO::getOrderCount, reqVO.getOrderCount())
                 .eqIfPresent(DailyBillDO::getShopId, reqVO.getShopId())
                 .eqIfPresent(DailyBillDO::getMerchantId, reqVO.getMerchantId())
                 .eqIfPresent(DailyBillDO::getOrderIds, reqVO.getOrderIds())
                 .betweenIfPresent(DailyBillDO::getCreateTime, reqVO.getCreateTime())
-                .eqIfPresent(DailyBillDO::getRefundPrice, reqVO.getRefundPrice())
                 .eqIfPresent(DailyBillDO::getIntegral, reqVO.getIntegral())
                 .eqIfPresent(DailyBillDO::getReceivedIntegral, reqVO.getReceivedIntegral())
                 .eqIfPresent(DailyBillDO::getRefundIntegral, reqVO.getRefundIntegral())

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

@@ -20,7 +20,6 @@ public interface DuserMapper extends BaseMapperX<DuserDO> {
     default PageResult<DuserDO> selectPage(DuserPageReqVO reqVO) {
         return selectPage(reqVO, new LambdaQueryWrapperX<DuserDO>()
                 .eqIfPresent(DuserDO::getUserId, reqVO.getUserId())
-                .likeIfPresent(DuserDO::getName, reqVO.getName())
                 .eqIfPresent(DuserDO::getMobile, reqVO.getMobile())
                 .eqIfPresent(DuserDO::getIntegralId, reqVO.getIntegralId())
                 .eqIfPresent(DuserDO::getSocialStatusId, reqVO.getSocialStatusId())
@@ -29,7 +28,6 @@ public interface DuserMapper extends BaseMapperX<DuserDO> {
                 .eqIfPresent(DuserDO::getSource, reqVO.getSource())
                 .eqIfPresent(DuserDO::getSocialUpNeed, reqVO.getSocialUpNeed())
                 .eqIfPresent(DuserDO::getCategoryId, reqVO.getCategoryId())
-                .likeIfPresent(DuserDO::getNickName, reqVO.getNickName())
                 .orderByAsc(DuserDO::getId));
     }
     int hasParent(Long userId);

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

@@ -20,11 +20,8 @@ public interface IntegralMapper extends BaseMapperX<IntegralDO> {
     default PageResult<IntegralDO> selectPage(IntegralPageReqVO reqVO) {
         return selectPage(reqVO, new LambdaQueryWrapperX<IntegralDO>()
                 .eqIfPresent(IntegralDO::getUserId, reqVO.getUserId())
-                .eqIfPresent(IntegralDO::getCategoryId, reqVO.getCategoryId())
                 .betweenIfPresent(IntegralDO::getCreateTime, reqVO.getCreateTime())
-                .likeIfPresent(IntegralDO::getName, reqVO.getName())
-                .likeIfPresent(IntegralDO::getNickName, reqVO.getNickName())
-                .eqIfPresent(IntegralDO::getCurrentQuota, reqVO.getCurrentQuota())
+                .likeIfPresent(IntegralDO::getUserName, reqVO.getUserName())
                 .eqIfPresent(IntegralDO::getFreezeQuota, reqVO.getFreezeQuota())
                 .eqIfPresent(IntegralDO::getHighQuota, reqVO.getHighQuota())
                 .orderByDesc(IntegralDO::getId));

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

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

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

@@ -1,77 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.consumptiontransferlog;
-
-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.consumptiontransferlog.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.consumptiontransferlog.ConsumptionTransferLogDO;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
-
-import cn.newfeifan.mall.module.distri.dal.mysql.consumptiontransferlog.ConsumptionTransferLogMapper;
-
-import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
-import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
-
-/**
- * 消费分转让记录 Service 实现类
- *
- * @author 非繁人
- */
-@Service
-@Validated
-public class ConsumptionTransferLogServiceImpl implements ConsumptionTransferLogService {
-
-    @Resource
-    private ConsumptionTransferLogMapper consumptionTransferLogMapper;
-
-    @Override
-    public Long createConsumptionTransferLog(ConsumptionTransferLogSaveReqVO createReqVO) {
-        // 插入
-        ConsumptionTransferLogDO consumptionTransferLog = BeanUtils.toBean(createReqVO, ConsumptionTransferLogDO.class);
-        consumptionTransferLogMapper.insert(consumptionTransferLog);
-        // 返回
-        return consumptionTransferLog.getId();
-    }
-
-    @Override
-    public void updateConsumptionTransferLog(ConsumptionTransferLogSaveReqVO updateReqVO) {
-        // 校验存在
-        validateConsumptionTransferLogExists(updateReqVO.getId());
-        // 更新
-        ConsumptionTransferLogDO updateObj = BeanUtils.toBean(updateReqVO, ConsumptionTransferLogDO.class);
-        consumptionTransferLogMapper.updateById(updateObj);
-    }
-
-    @Override
-    public void deleteConsumptionTransferLog(Long id) {
-        // 校验存在
-        validateConsumptionTransferLogExists(id);
-        // 删除
-        consumptionTransferLogMapper.deleteById(id);
-    }
-
-    private void validateConsumptionTransferLogExists(Long id) {
-        if (consumptionTransferLogMapper.selectById(id) == null) {
-            throw exception(CONSUMPTION_TRANSFER_LOG_NOT_EXISTS);
-        }
-    }
-
-    @Override
-    public ConsumptionTransferLogDO getConsumptionTransferLog(Long id) {
-        return consumptionTransferLogMapper.selectById(id);
-    }
-
-    @Override
-    public PageResult<ConsumptionTransferLogDO> getConsumptionTransferLogPage(ConsumptionTransferLogPageReqVO pageReqVO) {
-        return consumptionTransferLogMapper.selectPage(pageReqVO);
-    }
-
-    @Override
-    public List<ConsumptionTransferLogDO> selectList() {
-        return consumptionTransferLogMapper.selectList();
-    }
-
-}

+ 5 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/dailyawardrecords/DailyAwardRecordsService.java

@@ -65,4 +65,9 @@ public interface DailyAwardRecordsService {
      * 获取七天前的合赢奖记录,将他转换成可用积分
      */
     void transitionBonus();
+
+    /**
+     * 计算幸运奖
+     */
+    void calcLucky();
 }

+ 11 - 9
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/consumptionchangelog/ConsumptionChangeLogService.java → feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/integralchangelog/IntegralChangeLogService.java

@@ -1,9 +1,9 @@
-package cn.newfeifan.mall.module.distri.service.consumptionchangelog;
+package cn.newfeifan.mall.module.distri.service.integralchangelog;
 
 import java.util.*;
 import javax.validation.*;
-import cn.newfeifan.mall.module.distri.controller.admin.consumptionchangelog.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.consumptionchangelog.ConsumptionChangeLogDO;
+import cn.newfeifan.mall.module.distri.controller.admin.integralchangelog.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.integralchangelog.IntegralChangeLogDO;
 import cn.newfeifan.mall.framework.common.pojo.PageResult;
 
 /**
@@ -11,7 +11,7 @@ import cn.newfeifan.mall.framework.common.pojo.PageResult;
  *
  * @author 非繁人
  */
-public interface ConsumptionChangeLogService {
+public interface IntegralChangeLogService {
 
     /**
      * 创建平台消费分变动记录
@@ -19,14 +19,14 @@ public interface ConsumptionChangeLogService {
      * @param createReqVO 创建信息
      * @return 编号
      */
-    Long createConsumptionChangeLog(@Valid ConsumptionChangeLogSaveReqVO createReqVO);
+    Long createConsumptionChangeLog(@Valid IntegralChangeLogSaveReqVO createReqVO);
 
     /**
      * 更新平台消费分变动记录
      *
      * @param updateReqVO 更新信息
      */
-    void updateConsumptionChangeLog(@Valid ConsumptionChangeLogSaveReqVO updateReqVO);
+    void updateConsumptionChangeLog(@Valid IntegralChangeLogSaveReqVO updateReqVO);
 
     /**
      * 删除平台消费分变动记录
@@ -41,7 +41,7 @@ public interface ConsumptionChangeLogService {
      * @param id 编号
      * @return 平台消费分变动记录
      */
-    ConsumptionChangeLogDO getConsumptionChangeLog(Long id);
+    IntegralChangeLogDO getConsumptionChangeLog(Long id);
 
     /**
      * 获得平台消费分变动记录分页
@@ -49,12 +49,14 @@ public interface ConsumptionChangeLogService {
      * @param pageReqVO 分页查询
      * @return 平台消费分变动记录分页
      */
-    PageResult<ConsumptionChangeLogRespVO> getConsumptionChangeLogPage(ConsumptionChangeLogPageReqVO pageReqVO);
+    PageResult<IntegralChangeLogRespVO> getConsumptionChangeLogPage(IntegralChangeLogPageReqVO pageReqVO);
 
     /**
      * 根据状态获取消费分变动记录
      * @param type 状态
      * @return 变动记录
      */
-    List<ConsumptionChangeLogDO> selectListByStatus(Integer type);
+    List<IntegralChangeLogDO> selectListByStatus(Integer type);
+
+    void saveBatch(List<IntegralChangeLogSaveReqVO> IntegralChangeLogSaveReqVOList);
 }

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

@@ -0,0 +1,98 @@
+package cn.newfeifan.mall.module.distri.service.integralchangelog;
+
+import cn.newfeifan.mall.module.distri.enums.IntegralEnum;
+import cn.newfeifan.mall.module.member.dal.dataobject.user.MemberUserDO;
+import cn.newfeifan.mall.module.member.service.user.MemberUserService;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+
+import java.util.*;
+import cn.newfeifan.mall.module.distri.controller.admin.integralchangelog.vo.*;
+import cn.newfeifan.mall.module.distri.dal.dataobject.integralchangelog.IntegralChangeLogDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+
+import cn.newfeifan.mall.module.distri.dal.mysql.integralchangelog.IntegralChangeLogMapper;
+
+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 IntegralChangeLogServiceImpl implements IntegralChangeLogService {
+
+    @Resource
+    private IntegralChangeLogMapper integralChangeLogMapper;
+
+    @Resource
+    private MemberUserService memberUserService;
+
+    @Override
+    public Long createConsumptionChangeLog(IntegralChangeLogSaveReqVO createReqVO) {
+        // 插入
+        IntegralChangeLogDO consumptionChangeLog = BeanUtils.toBean(createReqVO, IntegralChangeLogDO.class);
+        integralChangeLogMapper.insert(consumptionChangeLog);
+        // 返回
+        return consumptionChangeLog.getId();
+    }
+
+    @Override
+    public void updateConsumptionChangeLog(IntegralChangeLogSaveReqVO updateReqVO) {
+        // 校验存在
+        validateConsumptionChangeLogExists(updateReqVO.getId());
+        // 更新
+        IntegralChangeLogDO updateObj = BeanUtils.toBean(updateReqVO, IntegralChangeLogDO.class);
+        integralChangeLogMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteConsumptionChangeLog(Long id) {
+        // 校验存在
+        validateConsumptionChangeLogExists(id);
+        // 删除
+        integralChangeLogMapper.deleteById(id);
+    }
+
+    private void validateConsumptionChangeLogExists(Long id) {
+        if (integralChangeLogMapper.selectById(id) == null) {
+            throw exception(CONSUMPTION_CHANGE_LOG_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public IntegralChangeLogDO getConsumptionChangeLog(Long id) {
+        return integralChangeLogMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<IntegralChangeLogRespVO> getConsumptionChangeLogPage(IntegralChangeLogPageReqVO pageReqVO) {
+        PageResult<IntegralChangeLogRespVO> bean = BeanUtils.toBean(integralChangeLogMapper.selectPage(pageReqVO), IntegralChangeLogRespVO.class);
+
+        for (IntegralChangeLogRespVO integralChangeLogRespVO : bean.getList()) {
+            integralChangeLogRespVO.setConsumptionStatusName(IntegralEnum.getName(integralChangeLogRespVO.getIntegralStatus()));
+            if(integralChangeLogRespVO.getGenerateUserId() != null){
+                MemberUserDO user = memberUserService.getUser(integralChangeLogRespVO.getGenerateUserId());
+                integralChangeLogRespVO.setGenerateUserName(user.getUsername());
+            }
+        }
+        return bean;
+    }
+
+    @Override
+    public List<IntegralChangeLogDO> selectListByStatus(Integer type) {
+        return integralChangeLogMapper.selectList(IntegralChangeLogDO::getIntegralStatus,type);
+    }
+
+    @Override
+    public void saveBatch(List<IntegralChangeLogSaveReqVO> IntegralChangeLogSaveReqVOList) {
+        List<IntegralChangeLogDO> integralChangeLogDOList = BeanUtils.toBean(IntegralChangeLogSaveReqVOList, IntegralChangeLogDO.class);
+        integralChangeLogMapper.insertBatch(integralChangeLogDOList);
+    }
+
+}