From 355c61e32a9e2ecd4b90c16c238b90e0e9a4e240 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Tue, 27 Feb 2024 16:14:33 +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 --- .../chint/application/queryies/OrderQuery.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/chint/application/queryies/OrderQuery.java b/src/main/java/com/chint/application/queryies/OrderQuery.java index 1b16c9cc..7fc44606 100644 --- a/src/main/java/com/chint/application/queryies/OrderQuery.java +++ b/src/main/java/com/chint/application/queryies/OrderQuery.java @@ -20,6 +20,7 @@ import com.chint.infrastructure.constant.FSSCConstant; import com.chint.infrastructure.constant.LegConstant; import com.chint.infrastructure.util.BaseContext; import com.chint.infrastructure.util.PageResult; +import com.chint.interfaces.rest.user.UserHttpRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.stereotype.Service; @@ -32,7 +33,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_C_TRIP; -import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_L_Y; @Service public class OrderQuery { @@ -52,6 +52,9 @@ public class OrderQuery { @Autowired private UserRepository userRepository; + @Autowired + private UserHttpRequest userHttpRequest; + @Autowired private EstimateAdapter estimateAdapter; @@ -105,7 +108,7 @@ public class OrderQuery { } //根据出差说明进行模糊匹配查询 - if(queryData.getInstructions() != null){ + if (queryData.getInstructions() != null) { Page byInstructions = routeRepository.findByInstructions(queryData); List content = byInstructions.getContent(); content.forEach(RouteOrder::reloadStatus); @@ -118,7 +121,6 @@ public class OrderQuery { } - //执行普通分页查询 PageResult routeOrderPageResult = routeRepository.pageQuery(queryData); routeOrderPageResult.getRecords().forEach(order -> { @@ -169,7 +171,7 @@ public class OrderQuery { } public TripCallback queryTripCallbackData(OrderQueryData queryData) { - User currentUser = BaseContext.getCurrentUser(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); DateTimeFormatter simpleFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); // RouteOrder routeOrder = routeRepository.findByFakeOrderNoAndSysCode(queryData.getBillcode(), queryData.getSysCode()) @@ -177,10 +179,13 @@ public class OrderQuery { RouteOrder routeOrder = routeRepository.queryById(queryData.getRouteId()) .reloadStatus(); List locationList = new ArrayList<>(); - + User currentUser = userHttpRequest.loadUserInfo( + userRepository.findByUserEmployeeNo(routeOrder.getUserId()) + ); List legItems = orderDomainService.queryLocation(routeOrder.getLegItems()); + legItems.forEach(leg -> { if (!locationList.contains(leg.getOriginLocation())) { locationList.add(leg.getOriginLocation()); @@ -252,7 +257,7 @@ public class OrderQuery { .endDate(simpleFormatter.format(leg.getEndTime())) .systemStatus(FSSCConstant.TRIP_CALLBACK_RECEIPT_STATUS) .parentScheduleNum(leg.getLegNo()) - .amount(leg.queryEstimateAmount(estimateAdapter,SUPPLIER_C_TRIP).getEstimateAmount()) + .amount(leg.queryEstimateAmount(estimateAdapter, SUPPLIER_C_TRIP).getEstimateAmount()) .reserveCount("1") .quoteGroupNum("0") .extStatus(0)