|
@@ -3233,9 +3233,8 @@ public class OrderServiceImpl implements OrderService {
|
|
|
int times = 0;
|
|
|
// 查询是否支付了
|
|
|
while (true) {
|
|
|
- boolean flag = orderQuery(order, processRecordEntity);
|
|
|
+ boolean flag = orderQuery(order, processRecordEntity, store);
|
|
|
if (flag) {
|
|
|
- atomicBoolean.set(true);
|
|
|
break;
|
|
|
}
|
|
|
try {
|
|
@@ -3274,20 +3273,21 @@ public class OrderServiceImpl implements OrderService {
|
|
|
throw new RuntimeException("未支付或支付失败,请联系管理员");
|
|
|
}
|
|
|
|
|
|
- if (atomicBoolean.get()) {
|
|
|
- // 推送支付单
|
|
|
- sendWxPayInfo(order, store, wechatMicropayApiResult);
|
|
|
- }
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- private void sendWxPayInfo(OrderVo order, StoreEntity store, WechatMicropayApiResult wechatMicropayApiResult) {
|
|
|
+ private void sendWxPayInfo(OrderVo order, StoreEntity store, String tradeNo) {
|
|
|
// 组装支付单信息
|
|
|
String payTransactionId = "";
|
|
|
- if (Objects.nonNull(wechatMicropayApiResult)) {
|
|
|
- payTransactionId = wechatMicropayApiResult.getTransaction_id();
|
|
|
+ if (!org.springframework.util.StringUtils.isEmpty(tradeNo)) {
|
|
|
+ payTransactionId = tradeNo;
|
|
|
} else {
|
|
|
- payTransactionId = order.getPayTransactionId();
|
|
|
+ if (!org.springframework.util.StringUtils.isEmpty(order.getPayTransactionId())) {
|
|
|
+ payTransactionId = order.getPayTransactionId();
|
|
|
+ } else {
|
|
|
+ OrderEntity orderEntity = orderDao.queryObjectByOrderSn(order.getOrder_sn());
|
|
|
+ payTransactionId = orderEntity.getPayTransactionId();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
Map<String, Object> orderSendCusParams = new HashMap<>();
|
|
@@ -3434,7 +3434,7 @@ public class OrderServiceImpl implements OrderService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private boolean orderQuery(OrderVo order, OrderProcessRecordEntity processRecordEntity) {
|
|
|
+ private boolean orderQuery(OrderVo order, OrderProcessRecordEntity processRecordEntity, StoreEntity store) {
|
|
|
LOGGER.info(">>>>>>>>>>>>>>>>>>>>wxOrderQuery 微信查询接口调用");
|
|
|
String merchOrderSn = order.getMerchOrderSn();
|
|
|
String orderId = order.getId() + "";
|
|
@@ -3459,6 +3459,9 @@ public class OrderServiceImpl implements OrderService {
|
|
|
order.setPayTransactionId(result.getTransaction_id());
|
|
|
orderDao.updateOrderProcessRecord(processParam);
|
|
|
|
|
|
+ sendWxPayInfo(order, store, result.getTransaction_id());
|
|
|
+
|
|
|
+
|
|
|
// orderWXPayRecordService
|
|
|
// .updateWXPayRecordTradeState(orderWXPayRecordTemp.getId(), wechatRefundApiResult);
|
|
|
|