This commit is contained in:
cun-nan 2024-01-18 15:09:51 +08:00
parent 944b5bbb87
commit ab81e62477
2 changed files with 12 additions and 6 deletions

View File

@ -3,7 +3,9 @@ package com.fuint.api.fuyou.controller;
import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fuint.api.fuyou.entity.Const;
import com.fuint.api.fuyou.entity.MerchantConfig;
import com.fuint.api.fuyou.service.FyPayService;
import com.fuint.api.fuyou.service.MerchantConfigService;
import com.fuint.api.fuyou.util.Utils;
import com.fuint.business.integral.service.IntegralOrdersService;
import com.fuint.business.marketingActivity.cardFule.service.CardFuelRecordService;
@ -44,6 +46,9 @@ public class FyPayController {
@Lazy
private AllOrderInfoService allOrderInfoService;
@Autowired
@Lazy
private MerchantConfigService merchantConfigService;
@Autowired
private RedisLock redisLock;
// 接收支付平台异步通知的接口
@ -67,6 +72,13 @@ public class FyPayController {
allOrderInfo.setStatus("paid");
allOrderInfo.setPayTime(new Date());
allOrderInfoService.updateAllOrderInfo(allOrderInfo);
// 修改配置收款账户余额信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(allOrderInfo.getStoreId());
Double beforeAmount = merchantConfig.getAmount();
Double afterAmount = beforeAmount + allOrderInfo.getPayMoney();
merchantConfig.setAmount(afterAmount);
merchantConfigService.updateMerch(merchantConfig);
}
updateOrderStatus(orderNo,allOrderInfo.getType());

View File

@ -1090,12 +1090,6 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
this.updateGrowthValue(oilOrder.getPayAmount(),userId, Integer.valueOf(oilOrder.getOils()),null,oilOrder.getStoreId(),orderNo);
this.addOilTracks(oilOrder,oilOrder.getStoreId());
staffCommissionService.countStaffCommission(oilOrder.getStaffId(),oilOrder.getStoreId(),oilOrder.getOrderAmount(),oilOrder.getPayAmount(),oilOrder.getOilNum(),"1",orderNo);
// 修改配置收款账户余额信息
MerchantConfig merchantConfig = merchantConfigService.selectMeChByIdIsUse(oilOrder.getStoreId());
Double beforeAmount = merchantConfig.getAmount();
Double afterAmount = beforeAmount + oilOrder.getPayAmount();
merchantConfig.setAmount(afterAmount);
merchantConfigService.updateMerch(merchantConfig);
CashierOrder cashierOrder = cashierOrderService.selectCashierOrder(orderNo);
if (ObjectUtil.isNotEmpty(cashierOrder)){