!1068 【修复】驳回佣金提现时,报'模板参数(reason)缺失'&【修复】用户购买一件以上数量时推广者返佣金额就出错(翻倍)&【优化】分后设置为“指定分销”时,让普通用户无需成为推广者也可以绑定成为 推广者的下级以便让指定的推广者赚取佣金

Merge pull request !1068 from heyho/master-jdk17
This commit is contained in:
芋道源码 2024-09-03 02:39:32 +00:00 committed by Gitee
commit bb7e56e28e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 7 additions and 5 deletions

View File

@ -261,7 +261,7 @@ public interface TradeOrderConvert {
default BrokerageAddReqBO convert(MemberUserRespDTO user, TradeOrderItemDO item, default BrokerageAddReqBO convert(MemberUserRespDTO user, TradeOrderItemDO item,
ProductSpuRespDTO spu, ProductSkuRespDTO sku) { ProductSpuRespDTO spu, ProductSkuRespDTO sku) {
BrokerageAddReqBO bo = new BrokerageAddReqBO().setBizId(String.valueOf(item.getId())).setSourceUserId(item.getUserId()) BrokerageAddReqBO bo = new BrokerageAddReqBO().setBizId(String.valueOf(item.getId())).setSourceUserId(item.getUserId())
.setBasePrice(item.getPayPrice() * item.getCount()) .setBasePrice(item.getPayPrice())
.setTitle(StrUtil.format("{}成功购买{}", user.getNickname(), item.getSpuName())) .setTitle(StrUtil.format("{}成功购买{}", user.getNickname(), item.getSpuName()))
.setFirstFixedPrice(0).setSecondFixedPrice(0); .setFirstFixedPrice(0).setSecondFixedPrice(0);
if (BooleanUtil.isTrue(spu.getSubCommissionType())) { if (BooleanUtil.isTrue(spu.getSubCommissionType())) {

View File

@ -192,6 +192,8 @@ public class BrokerageUserServiceImpl implements BrokerageUserService {
Integer enabledCondition = tradeConfigService.getTradeConfig().getBrokerageEnabledCondition(); Integer enabledCondition = tradeConfigService.getTradeConfig().getBrokerageEnabledCondition();
if (BrokerageEnabledConditionEnum.ALL.getCondition().equals(enabledCondition)) { // 人人分销用户默认就有分销资格 if (BrokerageEnabledConditionEnum.ALL.getCondition().equals(enabledCondition)) { // 人人分销用户默认就有分销资格
brokerageUser.setBrokerageEnabled(true).setBrokerageTime(LocalDateTime.now()); brokerageUser.setBrokerageEnabled(true).setBrokerageTime(LocalDateTime.now());
} else {
brokerageUser.setBrokerageEnabled(false).setBrokerageTime(LocalDateTime.now());
} }
brokerageUserMapper.insert(fillBindUserData(bindUserId, brokerageUser)); brokerageUserMapper.insert(fillBindUserData(bindUserId, brokerageUser));
} else { } else {
@ -267,9 +269,9 @@ public class BrokerageUserServiceImpl implements BrokerageUserService {
} }
// 校验分佣模式仅可后台手动设置推广员 // 校验分佣模式仅可后台手动设置推广员
if (BrokerageEnabledConditionEnum.ADMIN.getCondition().equals(tradeConfig.getBrokerageEnabledCondition())) { // if (BrokerageEnabledConditionEnum.ADMIN.getCondition().equals(tradeConfig.getBrokerageEnabledCondition())) {
throw exception(BROKERAGE_BIND_CONDITION_ADMIN); // throw exception(BROKERAGE_BIND_CONDITION_ADMIN);
} // }
// 校验分销关系绑定模式 // 校验分销关系绑定模式
if (BrokerageBindModeEnum.REGISTER.getMode().equals(tradeConfig.getBrokerageBindMode())) { if (BrokerageBindModeEnum.REGISTER.getMode().equals(tradeConfig.getBrokerageBindMode())) {

View File

@ -96,7 +96,7 @@ public class BrokerageWithdrawServiceImpl implements BrokerageWithdrawService {
Map<String, Object> templateParams = MapUtil.<String, Object>builder() Map<String, Object> templateParams = MapUtil.<String, Object>builder()
.put("createTime", LocalDateTimeUtil.formatNormal(withdraw.getCreateTime())) .put("createTime", LocalDateTimeUtil.formatNormal(withdraw.getCreateTime()))
.put("price", MoneyUtils.fenToYuanStr(withdraw.getPrice())) .put("price", MoneyUtils.fenToYuanStr(withdraw.getPrice()))
.put("reason", withdraw.getAuditReason()) .put("reason", auditReason)
.build(); .build();
notifyMessageSendApi.sendSingleMessageToMember(new NotifySendSingleToUserReqDTO() notifyMessageSendApi.sendSingleMessageToMember(new NotifySendSingleToUserReqDTO()
.setUserId(withdraw.getUserId()).setTemplateCode(templateCode).setTemplateParams(templateParams)); .setUserId(withdraw.getUserId()).setTemplateCode(templateCode).setTemplateParams(templateParams));