提交 a03599a7 authored 作者: zhoushaopan's avatar zhoushaopan

编辑装备,对设备统计进行排序

上级 f7712daf
流水线 #313 已失败 于阶段
...@@ -79,8 +79,6 @@ public class DeviceLibraryController { ...@@ -79,8 +79,6 @@ public class DeviceLibraryController {
@Autowired @Autowired
private DeviceLibraryCacheService cacheLibraryService; private DeviceLibraryCacheService cacheLibraryService;
@ApiOperation(value = "修改装备备注", notes = "修改装备备注") @ApiOperation(value = "修改装备备注", notes = "修改装备备注")
@PostMapping("/setRecord") @PostMapping("/setRecord")
@CacheEvict(value = "devicesLibraryList",key = "'device'",allEntries = true) @CacheEvict(value = "devicesLibraryList",key = "'device'",allEntries = true)
...@@ -646,6 +644,19 @@ public class DeviceLibraryController { ...@@ -646,6 +644,19 @@ public class DeviceLibraryController {
if (libraryUpdateVo.getType() != null) { if (libraryUpdateVo.getType() != null) {
deviceLibraryEntity.setType(libraryUpdateVo.getType()); deviceLibraryEntity.setType(libraryUpdateVo.getType());
} }
//add 库房
if (libraryUpdateVo.getStorageLocation()!=null){
DeviceLogDto deviceLogDto = new DeviceLogDto(deviceEditVo.getDeviceId(), "将存放位置改为"+libraryUpdateVo.getStorageLocation(), null,null,null);
deviceLogService.addLog(deviceLogDto);
deviceLibraryEntity.setStorageLocation(libraryUpdateVo.getStorageLocation());
}
//add 备注
if (libraryUpdateVo.getRecord()!=null){
DeviceLogDto deviceLogDto = new DeviceLogDto(deviceEditVo.getDeviceId(), "将备注改为"+libraryUpdateVo.getRecord(), null,null,null);
deviceLogService.addLog(deviceLogDto);
deviceLibraryEntity.setRecord(libraryUpdateVo.getRecord());
}
deviceLibraryService.update(deviceLibraryEntity); deviceLibraryService.update(deviceLibraryEntity);
} }
//添加绑定配件 //添加绑定配件
...@@ -809,12 +820,11 @@ public class DeviceLibraryController { ...@@ -809,12 +820,11 @@ public class DeviceLibraryController {
map.forEach((k,v)->{ map.forEach((k,v)->{
DeviceNewVo deviceNewVo = new DeviceNewVo(v.get(0).getModel(), v.get(0).getName(), DeviceNewVo deviceNewVo = new DeviceNewVo(v.get(0).getModel(), v.get(0).getName(),
v.get(0).getMatchingRangeName(), v.get(0).getTypeName(), v.get(0).getMatchingRangeName(), v.get(0).getTypeName(),
v.size(), k,v.stream().map(DeviceLibrary::getId).collect(Collectors.toList())); v.size(),k,DeviceModelSort.toUnitSort(k),v.stream().map(DeviceLibrary::getId).collect(Collectors.toList()));
deviceNewVoList.add(deviceNewVo); deviceNewVoList.add(deviceNewVo);
}); });
for (DeviceNewVo deviceNewVo : deviceNewVoList) { deviceNewVoList.sort(Comparator.comparing(DeviceNewVo::getLevel));
Integer unitSort = DeviceModelSort.toUnitSort(deviceNewVo.getOwnUnit());
}
return deviceNewVoList; return deviceNewVoList;
} }
......
...@@ -45,4 +45,11 @@ public class DeviceLibraryUpdateVo { ...@@ -45,4 +45,11 @@ public class DeviceLibraryUpdateVo {
@ApiModelProperty(value = "管理状态,0-不再所属单位,1-在所属单位") @ApiModelProperty(value = "管理状态,0-不再所属单位,1-在所属单位")
private Integer manageStatus; private Integer manageStatus;
@ApiModelProperty("库存位置")
private String storageLocation;
@ApiModelProperty("备注")
private String record;
} }
...@@ -35,6 +35,9 @@ public class DeviceNewVo { ...@@ -35,6 +35,9 @@ public class DeviceNewVo {
@ApiModelProperty(value = "所属单位", example = "省机要局") @ApiModelProperty(value = "所属单位", example = "省机要局")
private String ownUnit; private String ownUnit;
@ApiModelProperty("组织架构级别")
private Integer level;
@ApiModelProperty(value = "装备id") @ApiModelProperty(value = "装备id")
private List<Integer> devicesId; private List<Integer> devicesId;
......
...@@ -43,7 +43,7 @@ public class DeviceModelSort { ...@@ -43,7 +43,7 @@ public class DeviceModelSort {
/** /**
* 单位排序排序方法 * 单位排序排序方法
* @param unitList 需要排序的型号 * @param unitList 需要排序的型号
* @return 排序过后的型号列表 * @return 排序过后的型号列表
*/ */
public static List<String> unitToSort(List<String> unitList){ public static List<String> unitToSort(List<String> unitList){
return unitList.stream().sorted(Comparator.comparing(DeviceModelSort::toUnitSort)).collect(Collectors.toList()); return unitList.stream().sorted(Comparator.comparing(DeviceModelSort::toUnitSort)).collect(Collectors.toList());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论