feat(payment): 调整订单信息

master
yang 2025-02-08 18:01:07 +08:00
parent e97b6492b2
commit f4e4ef40c1
2 changed files with 7 additions and 0 deletions

View File

@ -35,6 +35,7 @@ import com.mcwl.pay.domain.OrderTrade;
import com.mcwl.pay.domain.OrderTradeDto; import com.mcwl.pay.domain.OrderTradeDto;
import com.mcwl.pay.domain.vo.PayVo; import com.mcwl.pay.domain.vo.PayVo;
import com.mcwl.pay.service.AliPayService; import com.mcwl.pay.service.AliPayService;
import com.mcwl.pay.service.OrderTradeService;
import com.mcwl.system.domain.SysUserPayAccount; import com.mcwl.system.domain.SysUserPayAccount;
import com.mcwl.system.domain.SysUserPayAccountLog; import com.mcwl.system.domain.SysUserPayAccountLog;
import com.mcwl.system.service.ISysUserPayAccountLogService; import com.mcwl.system.service.ISysUserPayAccountLogService;
@ -78,6 +79,9 @@ public class AliPayServiceImpl implements AliPayService {
@Autowired @Autowired
private ISysUserPayAccountLogService sysUserPayAccountLogService; private ISysUserPayAccountLogService sysUserPayAccountLogService;
@Autowired
private OrderTradeService orderTradeService;
public AliPayServiceImpl(Config config) { public AliPayServiceImpl(Config config) {
Factory.setOptions(config); Factory.setOptions(config);
@ -156,6 +160,8 @@ public class AliPayServiceImpl implements AliPayService {
tradeEntity.setUserName(SecurityUtils.getUsername()); tradeEntity.setUserName(SecurityUtils.getUsername());
tradeEntity.setProductName(memberLevel.getMemberName()); tradeEntity.setProductName(memberLevel.getMemberName());
orderTradeService.save(tradeEntity);
//调用支付宝的接口 //调用支付宝的接口
AlipayTradePrecreateResponse payResponse = Factory.Payment.FaceToFace() AlipayTradePrecreateResponse payResponse = Factory.Payment.FaceToFace()
// 设置过期时 // 设置过期时

View File

@ -225,6 +225,7 @@ public class OrderTradeServiceImpl extends ServiceImpl<OrderTradeMapper, OrderTr
BigDecimal buyerPayAmount = new BigDecimal(buyerPayAmountStr); BigDecimal buyerPayAmount = new BigDecimal(buyerPayAmountStr);
orderTrade.setPaymentAmount(buyerPayAmount.intValue()); orderTrade.setPaymentAmount(buyerPayAmount.intValue());
} }
orderTrade.setCreateTime(new Date());
orderTradeService.save(orderTrade); orderTradeService.save(orderTrade);
} }
} }