fix(order): 修复订单支付时间设置逻辑

- 将支付时间设置为订单创建时间而非当前时间
- 添加订单状态检查逻辑
- 当订单状态为2时自动重置为0状态
- 确保支付成功后的时间戳一致性
This commit is contained in:
2026-02-23 02:29:40 +08:00
parent eaea99a1e9
commit be58a5cada

View File

@@ -779,7 +779,10 @@ public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder
return true; return true;
} }
shopOrder.setPayStatus(true); shopOrder.setPayStatus(true);
shopOrder.setPayTime(LocalDateTime.now()); shopOrder.setPayTime(shopOrder.getCreateTime());
if(shopOrder.getOrderStatus().equals(2)){
shopOrder.setOrderStatus(0);
}
shopOrder.setTransactionId(result.getTransactionId()); shopOrder.setTransactionId(result.getTransactionId());
updateById(shopOrder); updateById(shopOrder);
handlePaymentSuccess(shopOrder); handlePaymentSuccess(shopOrder);