|
@@ -52,17 +52,16 @@ public class QueryOrderStateTask {
|
|
|
public void queryOrderState() throws Exception {
|
|
|
if (canScheduleRun && production) {
|
|
|
List<TradeNo> tradeNos = dao.selectTradeNosForScheduleTask();
|
|
|
- if (null == tradeNos || tradeNos.isEmpty()) {
|
|
|
- return;
|
|
|
- }
|
|
|
- log.info("定时查询订单支付状态:{}", tradeNos);
|
|
|
- for (TradeNo tradeNo : tradeNos) {
|
|
|
- if (tradeNo.getQueryStateTimes() >= 20) {
|
|
|
- WxPayOrder order = new WxPayOrder();
|
|
|
- order.setTradeNo(tradeNo.getTradeNo());
|
|
|
- service.closeWxOrder(order);
|
|
|
- } else {
|
|
|
- service.queryOrderState(tradeNo.getTradeNo(), QuerySource.SCHEDULE);
|
|
|
+ if (null != tradeNos && !tradeNos.isEmpty()) {
|
|
|
+ log.info("定时查询订单支付状态:{}", tradeNos);
|
|
|
+ for (TradeNo tradeNo : tradeNos) {
|
|
|
+ if (tradeNo.getQueryStateTimes() >= 20) {
|
|
|
+ WxPayOrder order = new WxPayOrder();
|
|
|
+ order.setTradeNo(tradeNo.getTradeNo());
|
|
|
+ service.closeWxOrder(order);
|
|
|
+ } else {
|
|
|
+ service.queryOrderState(tradeNo.getTradeNo(), QuerySource.SCHEDULE);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|