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