From 89e91d9d39553f6bfb2bc07d1f94016aa3d8bf16 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Tue, 25 Jun 2024 09:52:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=97=A0=E6=B3=95=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=A1=8C=E7=A8=8B=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/in/OrderPublicController.java | 2 +- .../services/OrderApplicationService.java | 24 +++++++++---------- .../domain/service/LegDomainService.java | 13 +++++----- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/chint/application/in/OrderPublicController.java b/src/main/java/com/chint/application/in/OrderPublicController.java index ea33e517..9fed960a 100644 --- a/src/main/java/com/chint/application/in/OrderPublicController.java +++ b/src/main/java/com/chint/application/in/OrderPublicController.java @@ -81,7 +81,7 @@ public class OrderPublicController { @ApiOperation("根据行程节点号删除") @PostMapping("/leg/delete/legNo") public Result deleteLeg(@RequestBody DeleteLegData deleteLegData) { - orderApplicationService.deleteByLegNo(deleteLegData); + legDomainService.deleteByLegNo(deleteLegData.getLegNo()); return Result.Success(SUCCESS); } diff --git a/src/main/java/com/chint/application/services/OrderApplicationService.java b/src/main/java/com/chint/application/services/OrderApplicationService.java index c474fb64..6aa65e17 100644 --- a/src/main/java/com/chint/application/services/OrderApplicationService.java +++ b/src/main/java/com/chint/application/services/OrderApplicationService.java @@ -200,18 +200,18 @@ public class OrderApplicationService { }; } - public void deleteByLegNo(DeleteLegData deleteLegData) { - String legNo = deleteLegData.getLegNo(); - RouteOrder routeOrder = null; - if (legNo.contains("&")) { - String[] split = legNo.split("&"); - routeOrder = routeRepository.findTempRouteOrderBySysCodeAndBillCode(split[1], split[2]); - } - if (routeOrder != null && routeOrder.getOrderStatus().equals(ORDER_STATUS_PREPARE)){ - routeOrder.deleteLeg(legNo); - routeRepository.saveTempRouteOrder(routeOrder, 24L); - } - } +// public void deleteByLegNo(DeleteLegData deleteLegData) { +// String legNo = deleteLegData.getLegNo(); +// RouteOrder routeOrder = null; +// if (legNo.contains("&")) { +// String[] split = legNo.split("&"); +// routeOrder = routeRepository.findTempRouteOrderBySysCodeAndBillCode(split[1], split[2]); +// } +// if (routeOrder != null && routeOrder.getOrderStatus().equals(ORDER_STATUS_PREPARE)){ +// routeOrder.deleteLeg(legNo); +// routeRepository.saveTempRouteOrder(routeOrder, 24L); +// } +// } public RouteOrder deleteLegToOrder(DeleteLegData deleteLegData) { diff --git a/src/main/java/com/chint/domain/service/LegDomainService.java b/src/main/java/com/chint/domain/service/LegDomainService.java index 9dd67a9e..defd235f 100644 --- a/src/main/java/com/chint/domain/service/LegDomainService.java +++ b/src/main/java/com/chint/domain/service/LegDomainService.java @@ -110,13 +110,14 @@ public class LegDomainService { } public void deleteByLegNo(String legNo) { - Leg byLegNo = legRepository.findByLegNo(legNo); - if (byLegNo == null) { - return; + RouteOrder routeOrder = null; + if (legNo.contains("&")) { + String[] split = legNo.split("&"); + routeOrder = routeRepository.findTempRouteOrderBySysCodeAndBillCode(split[1], split[2]); } - RouteOrder routeOrder = routeRepository.queryById(byLegNo.getRouteId()).reloadStatus(); - if (routeOrder.getOrderStatus().equals(ORDER_STATUS_PREPARE)) { - legRepository.deleteById(byLegNo); + if (routeOrder != null && routeOrder.getOrderStatus().equals(ORDER_STATUS_PREPARE)){ + routeOrder.deleteLeg(legNo); + routeRepository.saveTempRouteOrder(routeOrder, 24L); } }