福利积分 , 现金券 , 佣金流水接口

This commit is contained in:
2026-02-14 17:19:58 +08:00
parent e1105dae89
commit e2e9b18503
7 changed files with 253 additions and 2 deletions

View File

@@ -137,7 +137,7 @@ public class BenefitPackageSendPointProcessor implements BasicProcessor {
.setSourceDetail(JSONObject.toJSONString(pkg))
.setIsComplete(0)
.setStatisticalDate(new Date())
.setRemark("每日福利包产出")
.setRemark(pkg.getPackageName() + "每日福利积分产出")
);
lastAmount = lastAmount.add(amountDay);

View File

@@ -15,6 +15,7 @@ import org.springblade.modules.api.request.AcquireBenefitPackageRequest;
import org.springblade.modules.api.vo.*;
import org.springblade.modules.common.service.ICommonUserNoticeService;
import org.springblade.modules.market.manager.MarketUserManager;
import org.springblade.modules.market.manager.MarketUserPointManager;
import org.springblade.modules.market.service.IMarketBenefitPackageService;
import org.springframework.web.bind.annotation.*;
@@ -33,6 +34,8 @@ public class MarketUserController {
private final ICommonUserNoticeService userNoticeService;
private final MarketUserPointManager marketUserPointManager;
@GetMapping("/package-list")
@ApiOperationSupport(order = 1)
@@ -108,10 +111,32 @@ public class MarketUserController {
}
@GetMapping("/user-assets")
@ApiOperationSupport(order = 9)
@ApiOperationSupport(order = 10)
@Operation(summary = "用户资产查询")
public R<UserAssetsApiVO> userAssets() {
return R.data(marketUserManager.userAssets());
}
@GetMapping("/benefit-point-log")
@ApiOperationSupport(order = 11)
@Operation(summary = "福利积分流水")
public R<IPage<MarketUserBenefitPointLogVO>> benefitPointLogList(Query query , MarketUserBenefitPointLogVO benefitPointLogVO) {
return R.data(marketUserPointManager.benefitPointLogList(Condition.getPage(query) , benefitPointLogVO));
}
@GetMapping("/cash-coupon-log")
@ApiOperationSupport(order = 12)
@Operation(summary = "现金券流水")
public R<IPage<MarketUserCashCouponLogVO>> cashCouponLogList(Query query , MarketUserCashCouponLogVO cashCouponLogVO) {
return R.data(marketUserPointManager.cashCouponLogList(Condition.getPage(query) , cashCouponLogVO));
}
@GetMapping("/user-commission-log")
@ApiOperationSupport(order = 13)
@Operation(summary = "用户佣金流水")
public R<IPage<MarketUserCommissionLogVO>> userCommissionLogList(Query query , MarketUserCommissionLogVO userCommissionLogVO) {
return R.data(marketUserPointManager.userCommissionLogList(Condition.getPage(query) , userCommissionLogVO));
}
}

View File

@@ -0,0 +1,52 @@
package org.springblade.modules.api.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 用户福利值流水表 实体类
*
* @author BladeX
* @since 2026-02-12
*/
@Data
@Accessors(chain = true)
public class MarketUserBenefitPointLogVO implements Serializable {
/**
* 金额
*/
private BigDecimal amount;
/**
* 上一笔金额
*/
private BigDecimal lastAmount;
/**
* 手续费
*/
private BigDecimal fee;
/**
* 消费类型 1-收入 2-支出
*/
private Integer type;
/**
* 统计时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date statisticalDate;
/**
* 备注
*/
private String remark;
}

View File

@@ -0,0 +1,52 @@
package org.springblade.modules.api.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 用户福利值流水表 实体类
*
* @author BladeX
* @since 2026-02-12
*/
@Data
@Accessors(chain = true)
public class MarketUserCashCouponLogVO implements Serializable {
/**
* 金额
*/
private BigDecimal amount;
/**
* 上一笔金额
*/
private BigDecimal lastAmount;
/**
* 手续费
*/
private BigDecimal fee;
/**
* 消费类型 1-收入 2-支出
*/
private Integer type;
/**
* 统计时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date statisticalDate;
/**
* 备注
*/
private String remark;
}

View File

@@ -0,0 +1,52 @@
package org.springblade.modules.api.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 用户福利值流水表 实体类
*
* @author BladeX
* @since 2026-02-12
*/
@Data
@Accessors(chain = true)
public class MarketUserCommissionLogVO implements Serializable {
/**
* 金额
*/
private BigDecimal amount;
/**
* 上一笔金额
*/
private BigDecimal lastAmount;
/**
* 手续费
*/
private BigDecimal fee;
/**
* 消费类型 1-收入 2-支出
*/
private Integer type;
/**
* 统计时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date statisticalDate;
/**
* 备注
*/
private String remark;
}

View File

@@ -4,10 +4,14 @@ import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import org.springblade.modules.api.vo.MarketDirectInfoApiVO;
import org.springblade.modules.api.vo.MarketUserBenefitPointLogVO;
import org.springblade.modules.api.vo.MarketUserCashCouponLogVO;
import org.springblade.modules.api.vo.MarketUserCommissionLogVO;
import org.springblade.modules.market.pojo.dto.MarketBenefitPointApiDTO;
import org.springblade.modules.market.pojo.dto.MarketCashCouponApiDTO;
import org.springblade.modules.market.pojo.entity.MarketBenefitPointLogEntity;
import org.springblade.modules.market.pojo.entity.MarketCashCouponLogEntity;
import org.springblade.modules.market.pojo.entity.MarketUserCommissionLogEntity;
import org.springblade.modules.system.pojo.entity.User;
import java.util.List;
@@ -27,4 +31,10 @@ public interface MarketUserMarketInfoConvert {
MarketBenefitPointLogEntity convertBenefitPointDTOToEntity(MarketBenefitPointApiDTO dto);
MarketCashCouponLogEntity convertCashCouponDTOToEntity(MarketCashCouponApiDTO dto);
MarketUserBenefitPointLogVO convertMarketBenefitPointLogVO(MarketBenefitPointLogEntity marketBenefitPointLogEntity);
MarketUserCashCouponLogVO convertMarketCashCouponLogVO(MarketCashCouponLogEntity marketCashCouponLogEntity);
MarketUserCommissionLogVO convertMarketUserCommissionLogVO(MarketUserCommissionLogEntity marketUserCommissionLogEntity);
}

View File

@@ -1,17 +1,30 @@
package org.springblade.modules.market.manager;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.modules.api.vo.MarketUserBenefitPointLogVO;
import org.springblade.modules.api.vo.MarketUserCashCouponLogVO;
import org.springblade.modules.api.vo.MarketUserCommissionLogVO;
import org.springblade.modules.market.convert.MarketUserMarketInfoConvert;
import org.springblade.modules.market.pojo.entity.MarketBenefitPointLogEntity;
import org.springblade.modules.market.pojo.entity.MarketCashCouponLogEntity;
import org.springblade.modules.market.pojo.entity.MarketUserCommissionLogEntity;
import org.springblade.modules.market.request.BenefitPointTransferRequest;
import org.springblade.modules.market.pojo.entity.MarketBenefitPointEntity;
import org.springblade.modules.market.service.IMarketBenefitPointLogService;
import org.springblade.modules.market.service.IMarketBenefitPointService;
import org.springblade.modules.market.service.IMarketCashCouponLogService;
import org.springblade.modules.market.service.IMarketUserCommissionLogService;
import org.springblade.modules.system.pojo.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;
import java.math.BigDecimal;
import java.util.Objects;
@Slf4j
@Component
@@ -19,6 +32,9 @@ import java.math.BigDecimal;
public class MarketUserPointManager {
private final IMarketBenefitPointService marketBenefitPointService;
private final IMarketBenefitPointLogService marketBenefitPointLogService;
private final IMarketCashCouponLogService marketCashCouponLogService;
private final IMarketUserCommissionLogService marketUserCommissionLogService;
private final IUserService userService;
@@ -46,4 +62,48 @@ public class MarketUserPointManager {
return Boolean.TRUE;
}
public IPage<MarketUserBenefitPointLogVO> benefitPointLogList(IPage<MarketBenefitPointLogEntity> page, MarketUserBenefitPointLogVO benefitPointLogVO) {
IPage<MarketBenefitPointLogEntity> pageResult = marketBenefitPointLogService.page(
page,
Wrappers.lambdaQuery(MarketBenefitPointLogEntity.class)
.eq(MarketBenefitPointLogEntity::getIsComplete, 1)
.eq(MarketBenefitPointLogEntity::getUserId, AuthUtil.getUserId())
.eq(Objects.nonNull(benefitPointLogVO.getType()), MarketBenefitPointLogEntity::getType, (benefitPointLogVO.getType()))
.eq(Objects.nonNull(benefitPointLogVO.getStatisticalDate()), MarketBenefitPointLogEntity::getStatisticalDate, (benefitPointLogVO.getStatisticalDate()))
.orderByDesc(MarketBenefitPointLogEntity::getCreateTime)
);
return pageResult.convert(MarketUserMarketInfoConvert.INSTANCE::convertMarketBenefitPointLogVO);
}
public IPage<MarketUserCashCouponLogVO> cashCouponLogList(IPage<MarketCashCouponLogEntity> page, MarketUserCashCouponLogVO cashCouponLogVO) {
IPage<MarketCashCouponLogEntity> pageResult = marketCashCouponLogService.page(
page,
Wrappers.lambdaQuery(MarketCashCouponLogEntity.class)
.eq(MarketCashCouponLogEntity::getIsComplete, 1)
.eq(MarketCashCouponLogEntity::getUserId, AuthUtil.getUserId())
.eq(Objects.nonNull(cashCouponLogVO.getType()), MarketCashCouponLogEntity::getType, (cashCouponLogVO.getType()))
.eq(Objects.nonNull(cashCouponLogVO.getStatisticalDate()), MarketCashCouponLogEntity::getStatisticalDate, (cashCouponLogVO.getStatisticalDate()))
.orderByDesc(MarketCashCouponLogEntity::getCreateTime)
);
return pageResult.convert(MarketUserMarketInfoConvert.INSTANCE::convertMarketCashCouponLogVO);
}
public IPage<MarketUserCommissionLogVO> userCommissionLogList(IPage<MarketUserCommissionLogEntity> page, MarketUserCommissionLogVO userCommissionLogVO) {
IPage<MarketUserCommissionLogEntity> pageResult = marketUserCommissionLogService.page(
page,
Wrappers.lambdaQuery(MarketUserCommissionLogEntity.class)
.eq(MarketUserCommissionLogEntity::getIsComplete, 1)
.eq(MarketUserCommissionLogEntity::getUserId, AuthUtil.getUserId())
.eq(Objects.nonNull(userCommissionLogVO.getType()), MarketUserCommissionLogEntity::getType, (userCommissionLogVO.getType()))
.eq(Objects.nonNull(userCommissionLogVO.getStatisticalDate()), MarketUserCommissionLogEntity::getStatisticalDate, (userCommissionLogVO.getStatisticalDate()))
.orderByDesc(MarketUserCommissionLogEntity::getCreateTime)
);
return pageResult.convert(MarketUserMarketInfoConvert.INSTANCE::convertMarketUserCommissionLogVO);
}
}