修改退款逻辑

This commit is contained in:
韩鹏辉
2023-08-30 15:36:39 +08:00
parent ff8e7c5770
commit d5225c65e6
2 changed files with 12 additions and 3 deletions

View File

@@ -556,6 +556,7 @@ public class MerchantOrderController {
merchantOrder.setStoreName("尖愁");
merchantOrder.setTransDt(new Date());
merchantOrder.setCreateDt(new Date());
merchantOrder.setAisleSwitch("1");
merchantOrder.setStatus("1");
//BigDecimal e=new BigDecimal(merchantOrder.getConsumeFee()).subtract(new BigDecimal(merchantOrder.getConsumeFee()).multiply(new BigDecimal("0.0038")).setScale(2,BigDecimal.ROUND_DOWN)).setScale(2,BigDecimal.ROUND_DOWN);

View File

@@ -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);
}