Commit 8ced8dc8 authored by zhangsen's avatar zhangsen

修改bug top改为非必传

parent d89ec3c2
...@@ -63,7 +63,7 @@ public class FireStationInfoController extends BaseController { ...@@ -63,7 +63,7 @@ public class FireStationInfoController extends BaseController {
@GetMapping(value = "/getStationSafetyListByCode") @GetMapping(value = "/getStationSafetyListByCode")
public ResponseModel<List<FireStationInfoDto>> stationSafetyList( public ResponseModel<List<FireStationInfoDto>> stationSafetyList(
@ApiParam(value = "换流站编码") @RequestParam(required = false) String stationCode, @ApiParam(value = "换流站编码") @RequestParam(required = false) String stationCode,
@ApiParam(value = "数量") @RequestParam(required = true) Integer top) { @ApiParam(value = "数量") @RequestParam(required = false) Integer top) {
return ResponseHelper.buildResponse(fireStationInfoServiceImpl.queryStationAlarmListByCode(stationCode, top)); return ResponseHelper.buildResponse(fireStationInfoServiceImpl.queryStationAlarmListByCode(stationCode, top));
} }
......
...@@ -63,7 +63,12 @@ public class FireStationInfoServiceImpl extends BaseService<FireStationInfoDto, ...@@ -63,7 +63,12 @@ public class FireStationInfoServiceImpl extends BaseService<FireStationInfoDto,
item.setConfirmFalseNum(collect.get(item.getCode()).getConfirmFalseNum()); item.setConfirmFalseNum(collect.get(item.getCode()).getConfirmFalseNum());
} }
}); });
List<FireStationInfoDto> finalVoList = fireStationInfoList.stream().skip(0).limit(top).sorted(Comparator.comparing(FireStationInfoDto::getAlarmNum).reversed()).collect(Collectors.toList()); List<FireStationInfoDto> finalVoList = new ArrayList<>();
if (null == top) {
finalVoList = fireStationInfoList.stream().skip(0).sorted(Comparator.comparing(FireStationInfoDto::getAlarmNum).reversed()).collect(Collectors.toList());
} else {
finalVoList = fireStationInfoList.stream().skip(0).limit(top).sorted(Comparator.comparing(FireStationInfoDto::getAlarmNum).reversed()).collect(Collectors.toList());
}
return finalVoList; return finalVoList;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment