积分流水-业务类型修订
This commit is contained in:
@@ -22,13 +22,13 @@ public class CommonUserPointManager {
|
||||
public boolean giveBenefitPoint(GiveBenefitPointRequest request) {
|
||||
User user = userService.getById(request.getId());
|
||||
Assert.notNull(user , "用户不存在或已注销");
|
||||
Assert.isTrue(request.getAmount().compareTo(BigDecimal.ZERO) > 0, "划拨积分必须大于0");
|
||||
Assert.isTrue(request.getAmount().compareTo(BigDecimal.ZERO) > 0, "划拨福利积分必须大于0");
|
||||
|
||||
CommonBenefitPointApiDTO dto = new CommonBenefitPointApiDTO();
|
||||
dto.setUserId(user.getId())
|
||||
.setAmount(request.getAmount())
|
||||
.setFee(BigDecimal.ZERO)
|
||||
.setSourceType(BenefitPointSourceType.BACKEND_TRANSFER.getCode())
|
||||
.setSourceType(BenefitPointSourceType.BACKEND_TRANSFER)
|
||||
.setSourceId(request.getId())
|
||||
.setSourceDetail("后台划拨福利积分")
|
||||
.setRemark(request.getRemark());
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.springblade.modules.common.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springblade.modules.common.eums.BenefitPointSourceType;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@@ -27,7 +28,7 @@ public class CommonBenefitPointApiDTO {
|
||||
/**
|
||||
* 来源类型 0-福利包产出 1-福利包兑换 2-用户直推 3-otc交易
|
||||
*/
|
||||
private Integer sourceType;
|
||||
private BenefitPointSourceType sourceType;
|
||||
/**
|
||||
* 来源id
|
||||
*/
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.springblade.modules.common.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springblade.modules.common.eums.CashCouponSourceType;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@@ -21,7 +22,7 @@ public class CommonCashCouponApiDTO {
|
||||
/**
|
||||
* 来源类型 0-福利包产出 1-福利包兑换 2-用户直推 3-otc交易
|
||||
*/
|
||||
private Integer sourceType;
|
||||
private CashCouponSourceType sourceType;
|
||||
/**
|
||||
* 来源id
|
||||
*/
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.springblade.modules.common.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springblade.modules.common.eums.UserPointSourceType;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@@ -21,7 +22,7 @@ public class CommonUserPointApiDTO {
|
||||
/**
|
||||
* 来源类型 0-商城订单 1-商城抽奖
|
||||
*/
|
||||
private Integer sourceType;
|
||||
private UserPointSourceType sourceType;
|
||||
/**
|
||||
* 来源id
|
||||
*/
|
||||
|
||||
@@ -85,6 +85,7 @@ public class CommonBenefitPointServiceImpl extends BaseServiceImpl<CommonBenefit
|
||||
|
||||
private CommonBenefitPointLogEntity saveBenefitPointLog(CommonBenefitPointApiDTO dto , Integer type){
|
||||
CommonBenefitPointLogEntity benefitPointLog = AppCommonConvert.INSTANCE.convertBenefitPointDTOToEntity(dto);
|
||||
benefitPointLog.setSourceType(dto.getSourceType().getCode());
|
||||
benefitPointLog.setType(type);
|
||||
benefitPointLog.setStatisticalDate(DateUtil.getToday());
|
||||
if (type == 2){
|
||||
|
||||
@@ -112,6 +112,7 @@ public class CommonCashCouponServiceImpl extends BaseServiceImpl<CommonCashCoupo
|
||||
|
||||
private CommonCashCouponLogEntity saveBenefitPointLog(CommonCashCouponApiDTO dto , Integer type){
|
||||
CommonCashCouponLogEntity cashCouponLog = AppCommonConvert.INSTANCE.convertCashCouponDTOToEntity(dto);
|
||||
cashCouponLog.setSourceType(dto.getSourceType().getCode());
|
||||
cashCouponLog.setType(type);
|
||||
cashCouponLog.setStatisticalDate(DateUtil.getToday());
|
||||
if (type == 2){
|
||||
|
||||
@@ -87,6 +87,7 @@ public class CommonUserPointServiceImpl extends BaseServiceImpl<CommonUserPointM
|
||||
|
||||
private CommonUserPointLogEntity saveBenefitPointLog(CommonUserPointApiDTO dto , Integer type){
|
||||
CommonUserPointLogEntity userPointLog = AppCommonConvert.INSTANCE.convertUserPointDTOToEntity(dto);
|
||||
userPointLog.setSourceType(dto.getSourceType().getCode());
|
||||
userPointLog.setType(type);
|
||||
userPointLog.setStatisticalDate(DateUtil.getToday());
|
||||
if (type == 2){
|
||||
|
||||
Reference in New Issue
Block a user