From 06d83cbcde7a89a8d6fc4ad9d8f4b65f1299dc71 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Fri, 19 May 2023 11:35:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=AE=9E=E7=89=A9=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OrderMobileRechargeController.java | 23 +++++++++++++++---- .../com/hai/order/service/OrderService.java | 11 +++++++++ .../order/service/impl/OrderServiceImpl.java | 12 ++++++++++ .../impl/OutRechargeOrderServiceImpl.java | 3 +++ 4 files changed, 44 insertions(+), 5 deletions(-) diff --git a/hai-order/src/main/java/com/web/controller/business/OrderMobileRechargeController.java b/hai-order/src/main/java/com/web/controller/business/OrderMobileRechargeController.java index f17dab74..76750873 100644 --- a/hai-order/src/main/java/com/web/controller/business/OrderMobileRechargeController.java +++ b/hai-order/src/main/java/com/web/controller/business/OrderMobileRechargeController.java @@ -41,10 +41,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.io.File; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; @Controller @RequestMapping(value = "mobileRecharge") @@ -68,6 +65,9 @@ public class OrderMobileRechargeController { @Autowired private RedisTemplate redisTemplate; + @Resource + private OutRechargeChildOrderService outRechargeChildOrderService; + @RequestMapping(value = "/getOrderList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询话费订单列表") @@ -249,7 +249,7 @@ public class OrderMobileRechargeController { public ResponseData getMobileOrderDetail(@RequestParam(name = "orderNo", required = true) String orderNo) { try { Map map = new HashMap<>(); - map.put("tradeOrder", orderService.getOrderDetailByNo(orderNo)); + map.put("tradeOrder", orderService.getOrderDetail(orderNo)); map.put("mobileOrder", outRechargeOrderService.findByOrderNo(orderNo)); return ResponseMsgUtil.success(map); @@ -288,6 +288,8 @@ public class OrderMobileRechargeController { refundOrder(orderNo); } + + HighOrder order = highOrderService.getOrderByOrderNo(orderNo); order.setExceptionStatus(false); highOrderService.updateOrder(order); @@ -311,6 +313,17 @@ public class OrderMobileRechargeController { try { + OutRechargeOrder rechargeOrder = outRechargeOrderService.findByOrderNo(orderNo); + + List rechargeChildOrderList = outRechargeChildOrderService.getListRechargeChildOrderByOrderId(rechargeOrder.getId()); + + for (OutRechargeChildOrder rechargeChildOrder : rechargeChildOrderList) { + if (rechargeChildOrder.getStatus() == 104) { + rechargeChildOrder.setStatus(102); + } + outRechargeChildOrderService.updateOrder(rechargeChildOrder); + } + HighOrder order = highOrderService.getOrderByOrderNo(orderNo); order.setExceptionStatus(false); highOrderService.updateOrder(order); diff --git a/hai-service/src/main/java/com/hai/order/service/OrderService.java b/hai-service/src/main/java/com/hai/order/service/OrderService.java index 2c0b1333..12f6df6d 100644 --- a/hai-service/src/main/java/com/hai/order/service/OrderService.java +++ b/hai-service/src/main/java/com/hai/order/service/OrderService.java @@ -69,6 +69,17 @@ public interface OrderService { */ HighOrder getOrderDetailByNo(String orderNo); + + /** + * @Author Sum1Dream + * @Name getOrderDetail + * @Description // 查询线上 + * @Date 18:29 2023/5/18 + * @Param [orderNo] + * @Return com.hai.entity.HighOrder + */ + HighOrder getOrderDetail(String orderNo); + /** * 根据子订单号查询子订单信息 * @param childOrderNo diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java index 0187c230..c5e6e3ab 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java @@ -756,6 +756,18 @@ public class OrderServiceImpl implements OrderService { return order; } + @Override + public HighOrder getOrderDetail(String orderNo) { + HighOrderExample orderExample = new HighOrderExample(); + orderExample.createCriteria().andOrderNoEqualTo(orderNo); + List orderList = orderMapper.selectByExample(orderExample); + if (orderList.size() == 0) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单号"); + } + + return orderList.get(0); + } + @Override public HighChildOrder getChildOrderByNo(String childOrderNo) { HighChildOrderExample childOrderExample = new HighChildOrderExample(); 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 1ca2dffc..02e124d6 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 @@ -760,6 +760,9 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { if (status == 2 || status == -1) { childOrder.setStatus(103); } + if (status == 99 ) { + childOrder.setStatus(104); + } childOrder.setUpdateTime(new Date()); outRechargeChildOrderService.updateOrder(childOrder);