修改退款逻辑
This commit is contained in:
@@ -9,6 +9,7 @@ import cn.pluss.platform.merchantProfit.MerchantProfitService;
|
||||
import cn.pluss.platform.notice.NoticeService;
|
||||
import cn.pluss.platform.realFans.RealFansService;
|
||||
import cn.pluss.platform.user.impl.GeneralPushUtil;
|
||||
import cn.pluss.platform.userAccount.impl.UserAccountFlowServiceImpl;
|
||||
import cn.pluss.platform.userAccount.impl.UserAccountServiceImpl;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.userIntegral.UserIntegralService;
|
||||
@@ -48,6 +49,9 @@ public class RealFansServiceImpl extends ServiceImpl<RealFansMapper, RealFans> i
|
||||
@Autowired
|
||||
UserAccountServiceImpl userAccountService;
|
||||
|
||||
@Autowired
|
||||
UserAccountFlowServiceImpl userAccountFlowService;
|
||||
|
||||
@Override
|
||||
public void removeProfit(MerchantOrder order) {
|
||||
if(ObjectUtil.isEmpty(order)){
|
||||
@@ -83,6 +87,10 @@ public class RealFansServiceImpl extends ServiceImpl<RealFansMapper, RealFans> i
|
||||
log.info("【去除分润计算完成】开始批量插入分润数据,生成分润的订单编号:{},分润条数:{}", order.getOrderNumber(), profitList.size());
|
||||
try {
|
||||
merchantProfitService.batchInsert(profitList);
|
||||
|
||||
userAccountService.updateBatchById(userAccounts);
|
||||
|
||||
userAccountFlowService.saveBatch(accountFlows);
|
||||
log.info("【去除分润插入】插入分润成功!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -158,10 +166,10 @@ public class RealFansServiceImpl extends ServiceImpl<RealFansMapper, RealFans> i
|
||||
MerchantProfit profit = new MerchantProfit(nowUserApp, nowUserApp, order, profitAmt.negate(), profitRate, "5", "1");
|
||||
profits.add(profit);
|
||||
// sendProfitMessage(nowUserApp, profitAmt, order.getOrderNumber());
|
||||
createUserV3Profit(order,userPromotion.getParentUserId(),profits,userAccounts,flows,new BigDecimal(userPromotion.getCurrentFee()));
|
||||
createUserV3Profit(order,userPromotion.getParentUserId(),profits,userAccounts,flows,nowRate);
|
||||
|
||||
}else {
|
||||
createUserV3Profit(order,userPromotion.getParentUserId(),profits,userAccounts,flows,new BigDecimal(userPromotion.getCurrentFee()));
|
||||
createUserV3Profit(order,userPromotion.getParentUserId(),profits,userAccounts,flows,nowRate);
|
||||
}
|
||||
}else {
|
||||
BigDecimal profitRate = BigDecimal.ZERO;
|
||||
@@ -202,7 +210,7 @@ public class RealFansServiceImpl extends ServiceImpl<RealFansMapper, RealFans> i
|
||||
MerchantProfit profit = new MerchantProfit(nowUserApp,nowUserApp , order, profitAmt.abs().negate(), profitRate, "5", "1");
|
||||
profits.add(profit);
|
||||
// sendProfitMessage(nowUserApp, profitAmt, order.getOrderNumber());
|
||||
createUserV3Profit(order,userPromotion.getParentUserId(),profits,userAccounts,flows,order.getRefundAmt());
|
||||
createUserV3Profit(order,userPromotion.getParentUserId(),profits,userAccounts,flows,nowRate);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user