fix:分页查询增加是否有用车行程字段
This commit is contained in:
parent
35299e05e6
commit
26f667a827
|
@ -44,6 +44,8 @@ public class RouteOrderPageRes {
|
|||
private String supplierCNName;
|
||||
@ApiModelProperty("是否为有火车的订单,0无,1有")
|
||||
private String ifHaveTrainLeg;
|
||||
@ApiModelProperty("是否为有打车的订单,0无,1有")
|
||||
private String ifHaveCarLeg;
|
||||
@ApiModelProperty("是否能被确认结束, 0不能,1能")
|
||||
private String ifCanBeFinished;
|
||||
}
|
||||
|
|
|
@ -169,49 +169,6 @@ public class OrderQuery {
|
|||
}
|
||||
});
|
||||
return new PageResult<>(total, orders);
|
||||
|
||||
// //根据订单编号事项进行模糊匹配查询
|
||||
// if (queryData.getOrderNo() != null) {
|
||||
// Page<RouteOrder> byOrderNoFuzzy = routeRepository.findByOrderNoFuzzy(queryData);
|
||||
// List<RouteOrder> content = byOrderNoFuzzy.getContent();
|
||||
// content.forEach(routeOrder -> {
|
||||
// routeOrder.reloadStatus();
|
||||
// orderDomainService.queryLocation(routeOrder.getLegItems());
|
||||
// });
|
||||
// return new PageResult<>(byOrderNoFuzzy.getTotalElements(),
|
||||
// content
|
||||
// .stream()
|
||||
// .map(OrderQuery::getRouteOrderPageRes)
|
||||
// .toList());
|
||||
// }
|
||||
//
|
||||
// //根据出差说明进行模糊匹配查询
|
||||
// if (queryData.getInstructions() != null) {
|
||||
// Page<RouteOrder> byInstructions = routeRepository.findByInstructions(queryData);
|
||||
// List<RouteOrder> content = byInstructions.getContent();
|
||||
// content.forEach(routeOrder -> {
|
||||
// routeOrder.reloadStatus();
|
||||
// orderDomainService.queryLocation(routeOrder.getLegItems());
|
||||
// });
|
||||
// return new PageResult<>(byInstructions.getTotalElements(),
|
||||
// content
|
||||
// .stream()
|
||||
// .map(OrderQuery::getRouteOrderPageRes)
|
||||
// .toList());
|
||||
// }
|
||||
//
|
||||
//
|
||||
// //执行普通分页查询
|
||||
// PageResult<RouteOrder> routeOrderPageResult = routeRepository.pageQuery(queryData);
|
||||
// routeOrderPageResult.getRecords().forEach(order -> {
|
||||
// orderDomainService.queryLocation(order.getLegItems());
|
||||
// });
|
||||
// List<RouteOrderPageRes> routeOrderPageRes = routeOrderPageResult
|
||||
// .getRecords()
|
||||
// .stream()
|
||||
// .map(OrderQuery::getRouteOrderPageRes)
|
||||
// .toList();
|
||||
// return new PageResult<>(routeOrderPageResult.getTotal(), routeOrderPageRes);
|
||||
}
|
||||
|
||||
private static List<RouteOrder> temporaryFilter(List<RouteOrder> routeOrders) {
|
||||
|
@ -301,6 +258,12 @@ public class OrderQuery {
|
|||
res.setIfHaveTrainLeg("0");
|
||||
}
|
||||
|
||||
if (routeOrder.checkIfHaveCarLeg()) {
|
||||
res.setIfHaveCarLeg("1");
|
||||
} else {
|
||||
res.setIfHaveCarLeg("0");
|
||||
}
|
||||
|
||||
List<LocationRes> locationRes = legItems
|
||||
.stream()
|
||||
.flatMap(leg -> Stream.of(leg.getOriginLocation(), leg.getDestinationLocation()))
|
||||
|
|
|
@ -536,6 +536,14 @@ public class RouteOrder implements Serializable {
|
|||
.anyMatch(leg -> leg.getLegType().equals(LEG_TYPE_TRAIN));
|
||||
}
|
||||
|
||||
public boolean checkIfHaveCarLeg() {
|
||||
if (legItems == null || legItems.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
return legItems.stream()
|
||||
.anyMatch(leg -> leg.getLegType().equals(LEG_TYPE_TAXI));
|
||||
}
|
||||
|
||||
public RouteOrderDetail mapToOrderDetailVO() {
|
||||
RouteOrderDetail routeOrderDetail = new RouteOrderDetail();
|
||||
ApproveOrderNo approveOrderNo = this.getApproveOrderNo();
|
||||
|
|
|
@ -15,7 +15,7 @@ public interface JdbcAmapPolicyRepository extends CrudRepository<AmapPolicy, Lon
|
|||
|
||||
@Query("""
|
||||
select a.* from amap_policy a left join amap_policy_rank ar on a.id = ar.amap_policy_id
|
||||
left join ranks r on ar.rank_id = r.rank_id where r.standard_level = :standardLevel
|
||||
left join ranks_standard_level r on ar.rank_standard_level_id = r.id where r.standard_level = :standardLevel
|
||||
""")
|
||||
List<AmapPolicy> queryByStandardLevel(@Param("standardLevel") String standardLevel);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue