|
@@ -121,7 +121,19 @@ public class VoyageController {
|
|
|
@Operation(summary = "获得资源管理-航次列表")
|
|
@Operation(summary = "获得资源管理-航次列表")
|
|
|
public CommonResult<List<VoyageRespVO>> getVoyageListSimple(VoyageReqVO reqVO) {
|
|
public CommonResult<List<VoyageRespVO>> getVoyageListSimple(VoyageReqVO reqVO) {
|
|
|
List<VoyageDO> list = voyageService.getListSimple(reqVO);
|
|
List<VoyageDO> list = voyageService.getListSimple(reqVO);
|
|
|
- return success(BeanUtils.toBean(list, VoyageRespVO.class));
|
|
|
|
|
|
|
+ List<VoyageRespVO> voyageRespVOS = BeanUtils.toBean(list, VoyageRespVO.class);
|
|
|
|
|
+ List<Long> routeIds = CollectionUtils.convertList(voyageRespVOS, VoyageRespVO::getRouteId);
|
|
|
|
|
+ List<ResourceRouteDO> routeList = routeService.getList(routeIds);
|
|
|
|
|
+ Map<Long, Integer> routeDoMap = CollectionUtils.convertMap(routeList, ResourceRouteDO::getId, ResourceRouteDO::getDirection);
|
|
|
|
|
+ voyageRespVOS.stream().forEach(voyageRespVO -> {
|
|
|
|
|
+ MapUtils.findAndThen(routeDoMap, voyageRespVO.getRouteId(), direction -> voyageRespVO.setDirection(direction));
|
|
|
|
|
+ if(routeDoMap.get(voyageRespVO.getRouteId()) == 2) {
|
|
|
|
|
+ voyageRespVO.setFname(voyageRespVO.getName()+"-上水");
|
|
|
|
|
+ }else {
|
|
|
|
|
+ voyageRespVO.setFname(voyageRespVO.getName()+"-下水");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ return success(voyageRespVOS);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@GetMapping("/listByShipId")
|
|
@GetMapping("/listByShipId")
|