【同步】BOOT 和 CLOUD 的功能

This commit is contained in:
YunaiV
2026-01-18 19:01:29 +08:00
parent 2e317b165b
commit 304b2f102a
75 changed files with 3249 additions and 155 deletions

View File

@@ -13,6 +13,7 @@ public class BrokerageUserCreateReqVO {
private Long userId;
@Schema(description = "推广员编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "4587")
@NotNull(message = "推广员编号不能为空")
private Long bindUserId;
}

View File

@@ -265,8 +265,7 @@ public interface TradeOrderConvert {
ProductSpuRespDTO spu, ProductSkuRespDTO sku) {
BrokerageAddReqBO bo = new BrokerageAddReqBO().setBizId(String.valueOf(item.getId())).setSourceUserId(item.getUserId())
.setBasePrice(item.getPayPrice())
.setTitle(StrUtil.format("{}成功购买{}", user.getNickname(), item.getSpuName()))
.setFirstFixedPrice(0).setSecondFixedPrice(0);
.setTitle(StrUtil.format("{}成功购买{}", user.getNickname(), item.getSpuName()));
if (BooleanUtil.isTrue(spu.getSubCommissionType())) {
// 特殊:单独设置的佣金需要乘以购买数量。关联 https://gitee.com/yudaocode/yudao-mall-uniapp/issues/ICY7SJ
bo.setFirstFixedPrice(sku.getFirstBrokeragePrice() * item.getCount())

View File

@@ -142,7 +142,7 @@ public class BrokerageRecordServiceImpl implements BrokerageRecordService {
*/
int calculatePrice(Integer basePrice, Integer percent, Integer fixedPrice) {
// 1. 优先使用固定佣金
if (fixedPrice != null && fixedPrice > 0) {
if (fixedPrice != null && fixedPrice >= 0) {
return ObjectUtil.defaultIfNull(fixedPrice, 0);
}
// 2. 根据比例计算佣金