From 126953bd852ddc7daa9369c5b1c718c89a7fd396 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Wed, 28 Feb 2024 08:38:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/chint/application/dtos/response/LegRes.java | 2 ++ .../com/chint/application/out/OrderOutController.java | 8 +++++--- .../java/com/chint/application/queryies/OrderQuery.java | 6 ++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/chint/application/dtos/response/LegRes.java b/src/main/java/com/chint/application/dtos/response/LegRes.java index 0945cbde..786e0654 100644 --- a/src/main/java/com/chint/application/dtos/response/LegRes.java +++ b/src/main/java/com/chint/application/dtos/response/LegRes.java @@ -51,6 +51,8 @@ public class LegRes { legRes.setAmountTypeName(legExtensionField.getAmountTypeName()); legRes.setAmountTypeEnName(legExtensionField.getAmountTypeEnName()); } + legRes.setOriginLocation(LocationRes.copyFrom(leg.getOriginLocation())); + legRes.setDestinationLocation(LocationRes.copyFrom(leg.getDestinationLocation())); return legRes; } } diff --git a/src/main/java/com/chint/application/out/OrderOutController.java b/src/main/java/com/chint/application/out/OrderOutController.java index 3f951b5a..50025e9f 100644 --- a/src/main/java/com/chint/application/out/OrderOutController.java +++ b/src/main/java/com/chint/application/out/OrderOutController.java @@ -12,6 +12,7 @@ import com.chint.infrastructure.util.PageResult; import com.chint.infrastructure.util.Result; import com.google.gson.Gson; import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController; import static com.chint.infrastructure.constant.CommonMessageConstant.SUCCESS; +@Slf4j @RestController @RequestMapping("/order") public class OrderOutController { @@ -37,7 +39,7 @@ public class OrderOutController { public Result queryOrderByBillCodeAndSysCode(@RequestBody OrderQueryData queryData) { RouteOrder routeOrder = orderQuery.queryByBillCodeAndSysCode(queryData.getBillcode(), queryData.getSysCode()) .reloadStatus(); - return Result.Success(SUCCESS, orderQuery.queryRouteDetail(routeOrder)); + return Result.Success(SUCCESS, orderQuery.queryRouteRes(routeOrder)); } @@ -45,7 +47,7 @@ public class OrderOutController { @PostMapping("/query") public Result queryOrder(@RequestBody OrderQueryData queryData) { RouteOrder routeOrder = orderQuery.queryById(queryData.getRouteId()).reloadStatus(); - RouteOrderRes routeOrderRes = orderQuery.queryRouteDetail(routeOrder); + RouteOrderRes routeOrderRes = orderQuery.queryRouteRes(routeOrder); return Result.Success(SUCCESS, routeOrderRes); } @@ -80,7 +82,7 @@ public class OrderOutController { TripCallback tripCallback = orderQuery.queryTripCallbackData(queryData); Gson gson = new Gson(); String json = gson.toJson(tripCallback); - System.out.println(json); + log.info(json); return Result.Success(SUCCESS, tripCallback); } diff --git a/src/main/java/com/chint/application/queryies/OrderQuery.java b/src/main/java/com/chint/application/queryies/OrderQuery.java index 452f6817..35c555c8 100644 --- a/src/main/java/com/chint/application/queryies/OrderQuery.java +++ b/src/main/java/com/chint/application/queryies/OrderQuery.java @@ -297,9 +297,11 @@ public class OrderQuery { }; } - public RouteOrderRes queryRouteDetail(RouteOrder routeOrder){ + public RouteOrderRes queryRouteRes(RouteOrder routeOrder){ RouteOrderRes routeOrderRes = RouteOrderRes.copyFrom(routeOrder); - List list = routeOrder.getLegItems().stream().map(LegRes::copyFrom).toList(); + List legItems = routeOrder.getLegItems(); + orderDomainService.queryLocation(legItems); + List list = legItems.stream().map(LegRes::copyFrom).toList(); routeOrderRes.setLegResList(list); List orderDetailResList = routeOrder .getOrderDetails()