修复当不传行程节点参数的时候,默认为全部行程节点

This commit is contained in:
lulz1 2024-04-09 12:59:20 +08:00
parent b33224b5f6
commit 2005e023a8
2 changed files with 14 additions and 6 deletions

View File

@ -81,4 +81,5 @@ public class OrderPublicController {
return Result.Success(SUCCESS);
}
}

View File

@ -144,10 +144,17 @@ public class RouteRequestDomainService {
//获取目前已经同步到供应商的差旅申请单
private RouteRequest loadLegInfo(RouteRequest routeRequest, RouteOrder routeOrder, List<Long> legIds) {
List<Leg> legItems = routeOrder.getLegItems();
List<RouteRequestLeg> list = legItems.stream()
List<RouteRequestLeg> list;
if (legIds != null && !legIds.isEmpty()) {
list = legItems.stream()
.filter(leg -> legIds.contains(leg.getLegId()))
.map(RouteRequestLeg::ofLeg)
.toList();
} else {
list = legItems.stream()
.map(RouteRequestLeg::ofLeg)
.toList();
}
routeRequest.setRouteRequestLegList(list);
return routeRequest;
}
@ -168,7 +175,7 @@ public class RouteRequestDomainService {
public RouteOrder getRouteOrder(String journeyNo) {
//先通过
RouteRequest routeRequest = routeRequestRepository.findByRouteRequestNo(journeyNo);
if(routeRequest == null){
if (routeRequest == null) {
return routeRepository.findByOrderNo(journeyNo);
}
return routeRepository.queryById(routeRequest.getRouteId());