提交 52a09525 authored 作者: zhoushaopan's avatar zhoushaopan

feat(自查模块): 修改自查

修改自查
上级 b42e0d47
......@@ -643,6 +643,27 @@ public class DeviceLibraryController {
map.put("types",types.stream().map(integer -> new TypeVo(integer,styleMap.get(integer))).collect(Collectors.toList()));
return ResultUtil.success(map);
}
@ApiOperation(value = "模糊查询核心装备统计分页(可以勾选多个单位)", notes = "可以通过这个接口查询装备列表,全省设备库")
@PostMapping("/core/stat/summary/unitList")
public ResponseEntity getDeviceStatisticsPageUnitList(@RequestBody DeviceLibrarySelectVo deviceLibrarySelectVo) {
List<DeviceStatisticsVo> deviceStatisticsVoList = deviceLibraryService.getDeviceStatisticsPage1(deviceLibrarySelectVo, deviceLibrarySelectVo.getPageable(),deviceLibrarySelectVo.getPageable().getSort());
List<DeviceStatisticsVo> deviceStatisticsVoSorts = deviceStatisticsVoList.stream()
.sorted(Comparator.comparing(DeviceStatisticsVo::getModel).thenComparing(DeviceStatisticsVo::getName)).collect(Collectors.toList());
Page<DeviceStatisticsVo> deviceStatisticsVos = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), deviceStatisticsVoSorts, deviceLibrarySelectVo.getPageable());
Map<String,Object> map = new HashMap<>();
Map<Integer, String> styleMap = configCache.getStyleMap();
List<String> models = deviceStatisticsVoList.stream().map(DeviceStatisticsVo::getModel).distinct().collect(Collectors.toList());
List<String> modelToSort = DeviceModelSort.modelToSort(models);
map.put("pages",deviceStatisticsVos);
map.put("models",modelToSort);
//名称排序
map.put("names",deviceStatisticsVoList.stream().map(DeviceStatisticsVo::getName).distinct().sorted(Comparator.comparing(String::toString)).collect(Collectors.toList()));
//形态
List<Integer> types = deviceStatisticsVoList.stream().map(DeviceStatisticsVo::getType).distinct().collect(Collectors.toList());
Collections.sort(types);
map.put("types",types.stream().map(integer -> new TypeVo(integer,styleMap.get(integer))).collect(Collectors.toList()));
return ResultUtil.success(map);
}
// @ApiOperation(value = "本级模糊查询核心装备统计分页", notes = "可以通过这个接口查询装备列表")
// @PostMapping("/core/stat/local/summary")
......
......@@ -51,6 +51,15 @@ public interface DeviceLibraryService {
* @param pageable 获取装备统计分页
*/
List<DeviceStatisticsVo> getDeviceStatisticsPage(DeviceLibrarySelectVo deviceLibrarySelectVo, Pageable pageable, Sort sort);
/**
* 后续修改为可以勾选多个单位
* @param deviceLibrarySelectVo
* @param pageable
* @param sort
* @return
*/
List<DeviceStatisticsVo> getDeviceStatisticsPage1(DeviceLibrarySelectVo deviceLibrarySelectVo, Pageable pageable, Sort sort);
// /**
// * @param deviceLibrarySelectVo 装备查询vo
// * @param pageable 获取装备统计分页
......
......@@ -146,4 +146,7 @@ public class DeviceLibrarySelectVo extends CustomPage {
@ApiModelProperty(value = "装备序列号", example = "123-1")
public String seqNumber;
@ApiModelProperty(value = "单位id的集合")
private List<Integer> unitIdList;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论