From ab1b61b1ab02cefd05584707b70b6ad4767638f2 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Tue, 26 Apr 2022 17:54:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=9D=E8=B4=B9=E5=85=85?= =?UTF-8?q?=E5=80=BCbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/pay/CzOrderController.java | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java index 3db354c9..4429b0d1 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/CzOrderController.java @@ -125,20 +125,23 @@ public class CzOrderController { rechargeOrderRecord = new OutRechargeOrderRecord(); // 查询订单 OutRechargeOrder order = outRechargeOrderService.findByOrderNo(dataObject.getString("out_order_id")); - if (order.getRechargeType() == 1) { - String orderNo = "CZ" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5); - JSONObject object = outRechargeOrderService.getMobile(order.getRechargeContent() , order.getOrderPrice().intValue() , orderNo , order.getRechargeType()); - if (object.getInteger("code") != 200) { - order.setRechargeStatus(1); - order.setAbnormalMsg(object.getString("message")); + if (order.getStatus() == 2) { + if (order.getRechargeType() == 1) { + String orderNo = "CZ" + DateUtil.date2String(new Date(),"yyyyMMddHHmmss") + IDGenerator.nextId(5); + JSONObject object = outRechargeOrderService.getMobile(order.getRechargeContent() , order.getOrderPrice().intValue() , orderNo , order.getRechargeType()); + if (object.getInteger("code") != 200) { + order.setRechargeStatus(1); + order.setAbnormalMsg(object.getString("message")); + } + outRechargeOrderService.updateOrder(order); + rechargeOrderRecord.setRechargeOrderId(order.getId()); + rechargeOrderRecord.setRechargeOrderNo(orderNo); + rechargeOrderRecord.setCreateTime(new Date()); + rechargeOrderRecord.setStatus(1); + rechargeOrderRecordService.insertOrder(rechargeOrderRecord); } - outRechargeOrderService.updateOrder(order); - rechargeOrderRecord.setRechargeOrderId(order.getId()); - rechargeOrderRecord.setRechargeOrderNo(orderNo); - rechargeOrderRecord.setCreateTime(new Date()); - rechargeOrderRecord.setStatus(1); - rechargeOrderRecordService.insertOrder(rechargeOrderRecord); } + } else { // 查询订单 OutRechargeOrder order = outRechargeOrderService.findByOrderId(rechargeOrderRecord.getRechargeOrderId());