From 85033e483171380335850825709ab296c9176dc1 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Sun, 23 Jan 2022 20:34:01 +0800 Subject: [PATCH] 1 --- .../com/cweb/controller/OutRechargeOrderController.java | 4 ---- .../java/com/cweb/controller/pay/CzOrderController.java | 8 -------- .../java/com/cweb/controller/pay/UnionPayController.java | 6 +++--- .../java/com/hai/service/OutRechargeOrderService.java | 2 +- .../com/hai/service/impl/OutRechargeOrderServiceImpl.java | 6 ++++-- .../hai/service/pay/impl/RechargeOrderServiceImpl.java | 5 ++--- 6 files changed, 10 insertions(+), 21 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java index afad3db8..4c0edb09 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java @@ -474,10 +474,6 @@ public class OutRechargeOrderController { outRechargeOrderService.goldPayOrder(userInfoModel.getHighUser().getId(), order.getId()); - if (order.getRechargeType() == 1) { - outRechargeOrderService.getMobile(order.getRechargeContent() , order.getPayPrice().intValue() , order.getOrderNo()); - } - return ResponseMsgUtil.success("支付成功"); } catch (Exception e) { log.error("orderToPay error!", e); 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 1f0905e3..dbd5adb5 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 @@ -111,7 +111,6 @@ public class CzOrderController { OutRechargeOrder order = outRechargeOrderService.findByOrderId(orderId); - HighRefundAudit highRefundAudit = highRefundAuditService.findByOrderNo(order.getOrderNo()); // 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款 6:退款中 if (order.getStatus() != 2) { @@ -144,8 +143,6 @@ public class CzOrderController { order.setRefundId(orderRefundModel.getRefund_id()); order.setRefundFee(new BigDecimal(orderRefundModel.getRefund_fee()).divide(new BigDecimal("100"))); outRechargeOrderService.updateOrder(order); - highRefundAudit.setStatus(1); - highRefundAuditService.updateRefundAudit(highRefundAudit); } else { log.error("orderToPay error!", "退款失败"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!错误代码:"+orderRefundModel.getErr_code()+",错误描述"+orderRefundModel.getErr_code_des()); @@ -169,9 +166,6 @@ public class CzOrderController { order.setOutRefundNo("HFR"+new Date().getTime() ); order.setRefundFee(order.getPayRealPrice()); order.setRefundId(dataObject.getString("orderId")); - - highRefundAudit.setStatus(1); - highRefundAuditService.updateRefundAudit(highRefundAudit); outRechargeOrderService.updateOrder(order); } else { @@ -192,8 +186,6 @@ public class CzOrderController { order.setRefundTime(new Date()); order.setOutRefundNo(refund.getString("oriwtorderid")); order.setRefundFee(order.getPayRealPrice()); - highRefundAudit.setStatus(1); - highRefundAuditService.updateRefundAudit(highRefundAudit); outRechargeOrderService.updateOrder(order); } return true; diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java index b4bddc06..426f5fb1 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java @@ -386,13 +386,13 @@ public class UnionPayController { order.setPaySerialNo(body.getString("wtorderid")); // 支付流水号 order.setPayRealPrice(order.getPayPrice()); // 实付金额 - if (order.getRechargeType() == 1) { - outRechargeOrderService.getMobile(order.getRechargeContent() , order.getPayPrice().intValue() , order.getOrderNo()); - } order.setStatus(2); order.setPayType(4); order.setPayTime(new Date()); // 支付时间 outRechargeOrderService.updateOrder(order); + if (order.getRechargeType() == 1) { + outRechargeOrderService.getMobile(order.getRechargeContent() , order.getPayPrice().intValue() , order.getOrderNo()); + } } } diff --git a/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java b/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java index 6034d0d1..cffb6cb0 100644 --- a/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java +++ b/hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java @@ -121,7 +121,7 @@ public interface OutRechargeOrderService { * @param userId * @param orderId */ - void goldPayOrder(Long userId, Long orderId); + void goldPayOrder(Long userId, Long orderId) throws Exception; /** * @Author Sum1Dream diff --git a/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java index eabe446f..13d9eb13 100644 --- a/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java @@ -332,7 +332,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { @Override @Transactional(propagation= Propagation.REQUIRES_NEW) - public void goldPayOrder(Long userId, Long orderId) { + public void goldPayOrder(Long userId, Long orderId) throws Exception { OutRechargeOrder order = findByOrderId(orderId); if(order == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_ORDER, ""); @@ -343,9 +343,11 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { // 金币 1:100 Integer goldNum = new BigDecimal(order.getPayPrice().toString()).multiply(new BigDecimal("100")).intValue(); highUserService.goldHandle(userId, goldNum, 2, 2, order.getId()); - order.setPayRealPrice(order.getPayPrice()); // 实付金额 order.setStatus(2); + if (order.getRechargeType() == 1) { + outRechargeOrderService.getMobile(order.getRechargeContent() , order.getPayPrice().intValue() , order.getOrderNo()); + } order.setPayType(3); order.setPayTime(new Date()); // 支付时间 } diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.java index f038f161..2558d40c 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/RechargeOrderServiceImpl.java @@ -74,12 +74,11 @@ public class RechargeOrderServiceImpl implements PayService { order.setPaySerialNo(map.get("transaction_id")); // 支付流水号 order.setPayRealPrice(new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100"))); // 实付金额 order.setPayTime(new Date()); // 支付时间 + order.setStatus(2); // 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款 + outRechargeOrderService.updateOrder(order); if (order.getRechargeType() == 1) { outRechargeOrderService.getMobile(order.getRechargeContent() , order.getPayPrice().intValue() , order.getOrderNo()); } - order.setStatus(2); // 订单状态 : 1.待支付 2.已支付 3.已完成 4.已取消 5.已退款 - outRechargeOrderService.updateOrder(order); - // 推送订单记录 HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); highGasOrderPush.setType(OrderPushType.type2.getType());