提交 2bc956f4 authored 作者: zhoushaopan's avatar zhoushaopan

feat(自查模块,装备管理模块): 修改库房存放位置,系统自查

修改了库房位置未改变,添加了装备日志,系统自查数量为0,则不尽兴清除
上级 a4ea3cce
...@@ -645,7 +645,7 @@ public class DeviceLibraryController { ...@@ -645,7 +645,7 @@ public class DeviceLibraryController {
deviceLibraryEntity.setType(libraryUpdateVo.getType()); deviceLibraryEntity.setType(libraryUpdateVo.getType());
} }
//add 库房 //add 库房
if (libraryUpdateVo.getStorageLocation()!=null){ if (libraryUpdateVo.getStorageLocation()!=null && !libraryUpdateVo.getStorageLocation().equals(deviceLibraryEntity.getStorageLocation())){
DeviceLogDto deviceLogDto = new DeviceLogDto(deviceEditVo.getDeviceId(), "将存放位置改为"+libraryUpdateVo.getStorageLocation(), null,null,null); DeviceLogDto deviceLogDto = new DeviceLogDto(deviceEditVo.getDeviceId(), "将存放位置改为"+libraryUpdateVo.getStorageLocation(), null,null,null);
deviceLogService.addLog(deviceLogDto); deviceLogService.addLog(deviceLogDto);
deviceLibraryEntity.setStorageLocation(libraryUpdateVo.getStorageLocation()); deviceLibraryEntity.setStorageLocation(libraryUpdateVo.getStorageLocation());
...@@ -816,14 +816,25 @@ public class DeviceLibraryController { ...@@ -816,14 +816,25 @@ public class DeviceLibraryController {
List<DeviceLibrary> byIds = deviceLibraryService.findByIds(deviceSelectIdsVo.getIds()); List<DeviceLibrary> byIds = deviceLibraryService.findByIds(deviceSelectIdsVo.getIds());
byIds.forEach(DeviceLibrary::setConfigName); byIds.forEach(DeviceLibrary::setConfigName);
//key为所属单位 //key为所属单位
Map<String, List<DeviceLibrary>> map = byIds.stream().collect(Collectors.groupingBy(DeviceLibrary::getOwnUnit)); Map<String, List<DeviceLibrary>> map = byIds.stream().collect(Collectors.groupingBy(deviceLibrary -> deviceLibrary.getOwnUnit()+"Ǵ"+deviceLibrary.getIsPart()));
List<DeviceNewVo> deviceNewVoList = new ArrayList<>(); List<DeviceNewVo> deviceNewVoList = new ArrayList<>();
map.forEach((k,v)->{
DeviceNewVo deviceNewVo = new DeviceNewVo(v.get(0).getModel(), v.get(0).getName(), map.forEach((k,v)->{
v.get(0).getMatchingRangeName(), v.get(0).getTypeName(), DeviceNewVo deviceNewVo = new DeviceNewVo(v.get(0).getModel(), v.get(0).getName(),
v.size(),k,DeviceModelSort.toUnitSort(k),v.stream().map(DeviceLibrary::getId).collect(Collectors.toList())); v.get(0).getMatchingRangeName(), v.get(0).getTypeName(),
deviceNewVoList.add(deviceNewVo); v.size(),k.split("Ǵ")[0],DeviceModelSort.toUnitSort(k.split("Ǵ")[0]),v.stream().map(DeviceLibrary::getId).collect(Collectors.toList()),Integer.valueOf(k.split("Ǵ")[1]));
}); deviceNewVoList.add(deviceNewVo);
});
// List<DeviceNewVo> deviceNewVoList = new ArrayList<>();
// map.forEach((k,v)->{
// DeviceNewVo deviceNewVo = new DeviceNewVo(v.get(0).getModel(), v.get(0).getName(),
// v.get(0).getMatchingRangeName(), v.get(0).getTypeName(),
// v.size(),k,DeviceModelSort.toUnitSort(k),v.stream().map(DeviceLibrary::getId).collect(Collectors.toList()));
// deviceNewVoList.add(deviceNewVo);
// });
//实现按照组织架构排序 //实现按照组织架构排序
deviceNewVoList.sort(Comparator.comparing(DeviceNewVo::getLevel)); deviceNewVoList.sort(Comparator.comparing(DeviceNewVo::getLevel));
return deviceNewVoList; return deviceNewVoList;
......
...@@ -697,13 +697,12 @@ public class SelfCheckController { ...@@ -697,13 +697,12 @@ public class SelfCheckController {
public void findBySystem1() { public void findBySystem1() {
//通过billId和businessType 和 ownUnit //通过billId和businessType 和 ownUnit
List<Task> allByBillAndBusinessTypeAndOwnUnit = taskService.findAllByBillAndBusinessTypeAndOwnUnit(4, userUtils.getCurrentUnitId()); List<Task> allByBillAndBusinessTypeAndOwnUnit = taskService.findAllByBillAndBusinessTypeAndOwnUnit(4, userUtils.getCurrentUnitId());
if (allByBillAndBusinessTypeAndOwnUnit.size() == 0){ if (allByBillAndBusinessTypeAndOwnUnit.size()>0){
throw new ApiException("该时间段没有系统发起的自查"); for (Task task : allByBillAndBusinessTypeAndOwnUnit) {
} taskService.moveToArchive(task.parse2Bto());
for (Task task : allByBillAndBusinessTypeAndOwnUnit) { //删除
taskService.moveToArchive(task.parse2Bto()); selfCheckBillService.delete(task.getBillId());
//删除 }
selfCheckBillService.delete(task.getBillId());
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论