创建订单时不保存支付金额,在支付成功后保存支付金额

This commit is contained in:
2024-03-25 12:33:24 +08:00
parent 621c765a9d
commit 3203d99144

View File

@@ -1907,7 +1907,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
.orderBasicInfo(orderBasicInfo)
.orderDetail(orderDetail)
.build();
pileTransactionService.doCreateOrder(createOrderTransactionDTO);
pileTransactionService.doCreateOrder(createOrderTransactionDTO); // 保存异常订单到订单主表
}
/**
@@ -2593,7 +2593,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
.orderBasicInfo(orderBasicInfo)
.orderDetail(orderDetail)
.build();
pileTransactionService.doCreateOrder(createOrderTransactionDTO);
pileTransactionService.doCreateOrder(createOrderTransactionDTO); // 联联平台生成订单
// 组装结果集
Map<String, Object> resultMap = Maps.newHashMap();
@@ -3083,7 +3083,10 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
orderInfo.setPayMode(dto.getPayMode());
orderInfo.setPayStatus(OrderPayStatusEnum.paid.getValue());
BigDecimal orderPayAmount = orderInfo.getPayAmount() == null ? BigDecimal.ZERO : orderInfo.getPayAmount();
orderInfo.setPayAmount(orderPayAmount.add(payAmount));
// 2024年3月25日12点26分 发现重复记录的情况
if(orderPayAmount.compareTo(payAmount) != 0) {
orderInfo.setPayAmount(orderPayAmount.add(payAmount));
}
orderInfo.setPayTime(new Date());
if (sendStartCharging) {
@@ -3515,7 +3518,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
.pileConnectorCode(dto.getPileSn() + dto.getConnectorCode())
.startMode(dto.getStartMode())
.payStatus(Constants.ZERO)
.payAmount(dto.getChargeAmount()) // 支付完成后填入支付金额
// .payAmount(dto.getChargeAmount()) // 支付完成后填入支付金额
.payMode(dto.getPayMode())
.plateNumber(plateNumber)
.orderAmount(BigDecimal.ZERO)