|
|
@@ -493,18 +493,24 @@ public class MintOrderService {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- MintOrder order = mintOrderRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));
|
|
|
- MintActivity activity = mintActivityRepo.findById(order.getMintActivityId())
|
|
|
- .orElseThrow(new BusinessException("无活动"));
|
|
|
- //活动是否需要审核
|
|
|
- if (activity.isAudit()) {
|
|
|
- order.setStatus(MintOrderStatus.PENDING);
|
|
|
- order.setTransactionId(transactionId);
|
|
|
- order.setPayMethod(payMethod);
|
|
|
- order.setPayAt(LocalDateTime.now());
|
|
|
- mintOrderRepo.save(order);
|
|
|
- } else {
|
|
|
- this.notify(order, payMethod, transactionId, true);
|
|
|
+ try {
|
|
|
+ MintOrder order = mintOrderRepo.findById(orderId).orElseThrow(new BusinessException("订单不存在"));
|
|
|
+ if (order.getStatus() == MintOrderStatus.NOT_PAID) {
|
|
|
+ MintActivity activity = mintActivityRepo.findById(order.getMintActivityId())
|
|
|
+ .orElseThrow(new BusinessException("无活动"));
|
|
|
+ //活动是否需要审核
|
|
|
+ if (activity.isAudit()) {
|
|
|
+ order.setStatus(MintOrderStatus.PENDING);
|
|
|
+ order.setTransactionId(transactionId);
|
|
|
+ order.setPayMethod(payMethod);
|
|
|
+ order.setPayAt(LocalDateTime.now());
|
|
|
+ mintOrderRepo.save(order);
|
|
|
+ } else {
|
|
|
+ this.notify(order, payMethod, transactionId, true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("铸造订单回调出错 orderId={}", orderId, e);
|
|
|
}
|
|
|
|
|
|
releaseOrderLock(orderId);
|