分销金额
This commit is contained in:
@@ -618,7 +618,7 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
|
||||
distributionFlowService.save(mkDistributionFlow);
|
||||
|
||||
updateIncome(!flag ? rewardAmount : BigDecimal.ZERO,
|
||||
flag ? rewardAmount : BigDecimal.ZERO, BigDecimal.ZERO, distributionUser.getId(), shopUser.getUserId(), currentLevel == 1 ? 1 : 2);
|
||||
flag ? rewardAmount : BigDecimal.ZERO, BigDecimal.ZERO, distributionUser.getId(), shopUser.getUserId(), shopUser.getMainShopId(), currentLevel == 1 ? 1 : 2);
|
||||
|
||||
if (flag) {
|
||||
distributionAmountFlowService.save(new MkDistributionAmountFlow()
|
||||
@@ -649,8 +649,9 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateIncome(BigDecimal pendingIncome, BigDecimal receivedIncome, BigDecimal withdrawIncome, Long id, Long userId, Integer isOne) {
|
||||
userInfoService.updateDistributionAmount(userId, receivedIncome, isOne);
|
||||
public void updateIncome(BigDecimal pendingIncome, BigDecimal receivedIncome, BigDecimal withdrawIncome, Long id, Long userId, Long mainShopId, Integer isOne) {
|
||||
shopUserService.updateOneOrTwoAmount(userId, mainShopId, receivedIncome == null ? pendingIncome : receivedIncome, isOne);
|
||||
userInfoService.updateDistributionAmount(userId, receivedIncome);
|
||||
boolean flag = mapper.updateIncome(pendingIncome, receivedIncome, withdrawIncome, id);
|
||||
if (!flag) {
|
||||
throw new CzgException("操作失败");
|
||||
@@ -676,7 +677,7 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
|
||||
JSONObject jsonObject = appWxService.transferBalance(userInfo.getWechatOpenId(), userInfo.getRealName(), finalAmount, "提现", withdrawFlow.getBillNo());
|
||||
withdrawFlow.setPackageInfo(jsonObject.getString("package_info"));
|
||||
// 扣减余额
|
||||
userInfoService.updateDistributionAmount(userId, withdrawFlowDTO.getAmount().negate(), null);
|
||||
userInfoService.updateDistributionAmount(userId, withdrawFlowDTO.getAmount().negate());
|
||||
return withdrawFlowService.save(withdrawFlow);
|
||||
}
|
||||
|
||||
@@ -707,7 +708,7 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
|
||||
case "CANCELLED":
|
||||
flow.setStatus(TableValueConstant.DistributionWithdrawFlow.Status.FAIL.getCode());
|
||||
// 扣减余额
|
||||
userInfoService.updateDistributionAmount(flow.getUserId(), flow.getAmount().add(flow.getServiceFee()), null);
|
||||
userInfoService.updateDistributionAmount(flow.getUserId(), flow.getAmount().add(flow.getServiceFee()));
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user