debug:设备分成

This commit is contained in:
墨大叔 2024-10-09 14:32:57 +08:00
parent 6852d7afeb
commit d668228d25
2 changed files with 6 additions and 9 deletions

View File

@ -1,6 +1,5 @@
package com.ruoyi.common.pay.wx.service;
import com.ruoyi.common.pay.wx.config.WxPayConfig;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.pay.wx.config.WxTransferConfig;
import com.ruoyi.common.pay.wx.domain.BatchTransferAble;

View File

@ -131,8 +131,9 @@ public class BonusConverterImpl implements BonusConverter {
point = point.subtract(agent.getAgentServiceRate());
// 代理商收取服务费
result.add(this.toPo(agent, device.getAgentServiceRate().subtract(agent.getAgentServiceRate()), agent.getUserId().toString()));
point = point.subtract(device.getAgentServiceRate());
BigDecimal agentArrivalPoint = device.getAgentServiceRate().subtract(agent.getAgentServiceRate());
result.add(this.toPo(agent, agentArrivalPoint, agent.getUserId().toString(), BonusArrivalType.AGENT));
point = point.subtract(agentArrivalPoint);
}
ServiceUtil.assertion(point.compareTo(BigDecimal.ZERO) < 0, "商户剩余分成不允许小于0");
@ -143,7 +144,7 @@ public class BonusConverterImpl implements BonusConverter {
.filter(Objects::nonNull)
.map(Object::toString)
.collect(Collectors.joining(","));
result.add(this.toPo(mch, point, ancestors));
result.add(this.toPo(mch, point, ancestors, BonusArrivalType.MCH));
return result;
}
@ -223,7 +224,7 @@ public class BonusConverterImpl implements BonusConverter {
return po;
}
private Bonus toPo(SmUserVo user, BigDecimal point, String ancestors) {
private Bonus toPo(SmUserVo user, BigDecimal point, String ancestors, BonusArrivalType arrivalType) {
if (user == null || point == null) {
return null;
}
@ -232,10 +233,7 @@ public class BonusConverterImpl implements BonusConverter {
po.setStatus(BonusStatus.UN_DIVIDEND.getStatus());
po.setArrivalId(user.getUserId());
po.setArrivalName(user.getRealOrUserName());
BonusArrivalType arrivalType = BonusArrivalType.parseByUserType(user.getType());
if (arrivalType != null) {
po.setArrivalType(arrivalType.getType());
}
po.setArrivalType(arrivalType.getType());
po.setPoint(point);
po.setAncestors(ancestors);
po.setDeptId(Constants.ROOT_DEPT);