|
@@ -63,6 +63,10 @@ public class ReceiptServiceImpl implements ReceiptService {
|
|
private BaseMapper baseMapper;
|
|
private BaseMapper baseMapper;
|
|
@Resource
|
|
@Resource
|
|
private cmOfflineCollectionMapper collectionMapper;
|
|
private cmOfflineCollectionMapper collectionMapper;
|
|
|
|
+ @Resource
|
|
|
|
+ private CmReportingClubMapper cmReportingClubMapper;
|
|
|
|
+ @Resource
|
|
|
|
+ private CmReportingMemberMapper cmReportingMemberMapper;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1778,6 +1782,36 @@ public class ReceiptServiceImpl implements ReceiptService {
|
|
Integer sta = 1;
|
|
Integer sta = 1;
|
|
if (orderReceipt.stream().allMatch(r -> r == 3)) {
|
|
if (orderReceipt.stream().allMatch(r -> r == 3)) {
|
|
sta = 3;
|
|
sta = 3;
|
|
|
|
+ //分销人员下单修改报备记录
|
|
|
|
+ Integer identity = baseMapper.getUserIdentity(null,shopOrderVo.getOrderId(), null);
|
|
|
|
+ if (identity == 8) {
|
|
|
|
+ CmReportingClub byCmReportingClub = cmReportingClubMapper.getByCmReportingClub(new CmReportingClub()
|
|
|
|
+ .orderId(shopOrderVo.getOrderId())
|
|
|
|
+ .orderStatus(0)
|
|
|
|
+ );
|
|
|
|
+ //商品报备佣金
|
|
|
|
+ BigDecimal commission = cmReportingClubMapper.getDistributionProductCommission(byCmReportingClub.productId());
|
|
|
|
+ byCmReportingClub
|
|
|
|
+ .distributionId(shopOrderVo.getSpId())
|
|
|
|
+ .lockStatus(1)
|
|
|
|
+ .lockTime(new Date())
|
|
|
|
+ .orderStatus(1)
|
|
|
|
+ .splitCode(cmReportingClubMapper.getDistributionSplitCode(byCmReportingClub.distributionId()))
|
|
|
|
+ .commission(commission)
|
|
|
|
+ .splitSettleStatus(2)
|
|
|
|
+ .settleStatus(0);
|
|
|
|
+ cmReportingClubMapper.updateCmReportingClub(byCmReportingClub);
|
|
|
|
+ List<CmReportingMember> cmReportingMemberList = cmReportingMemberMapper.getCmReportingMemberList(new CmReportingMember()
|
|
|
|
+ .clubReportingId(Integer.valueOf(byCmReportingClub.id()))
|
|
|
|
+ .auditStatus(2)
|
|
|
|
+ );
|
|
|
|
+ //商品报备成员佣金
|
|
|
|
+ BigDecimal memberCommission = MathUtil.div(commission, cmReportingMemberList.size(), 2);
|
|
|
|
+ cmReportingMemberList.forEach(s -> {
|
|
|
|
+ s.commission(memberCommission).settleStatus(2);
|
|
|
|
+ cmReportingMemberMapper.updateCmReportingMember(s);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
} else if (orderReceipt.stream().allMatch(r -> r == 1)) {
|
|
} else if (orderReceipt.stream().allMatch(r -> r == 1)) {
|
|
sta = 1;
|
|
sta = 1;
|
|
} else {
|
|
} else {
|