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

fix(装备列装模块): 修改列装解绑出现500

修改列装解绑出现500
上级 853e2ca2
...@@ -977,23 +977,25 @@ public class PackingLibraryServiceImpl implements PackingLibraryService { ...@@ -977,23 +977,25 @@ public class PackingLibraryServiceImpl implements PackingLibraryService {
if (packingLibrary.getIsPart() == 1) { if (packingLibrary.getIsPart() == 1) {
//说明是附件目录 //说明是附件目录
List<DeviceLibrary> deviceLibraries = deviceLibraryService.findAllByPackingId(packingLibrary.getId()); List<DeviceLibrary> deviceLibraries = deviceLibraryService.findAllByPackingId(packingLibrary.getId());
List<Integer> deviceIds = deviceLibraries.stream().map(DeviceLibrary::getId).collect(Collectors.toList()); if (deviceLibraries.size()>0){
//将装备的父id全部置空 List<Integer> deviceIds = deviceLibraries.stream().map(DeviceLibrary::getId).collect(Collectors.toList());
Integer userId = userUtils.getCurrentUserId(); //将装备的父id全部置空
List<DeviceLogDto> deviceLogDtos = new ArrayList<>(); Integer userId = userUtils.getCurrentUserId();
long l = System.currentTimeMillis(); List<DeviceLogDto> deviceLogDtos = new ArrayList<>();
deviceLibraryService.updatePartParentId(deviceIds); long l = System.currentTimeMillis();
log.info("更新父id时间为:{}",System.currentTimeMillis()-l); deviceLibraryService.updatePartParentId(deviceIds);
deviceLibraries.forEach(deviceLibrary -> { log.info("更新父id时间为:{}",System.currentTimeMillis()-l);
DeviceLogDto deviceLogDto = new DeviceLogDto(); deviceLibraries.forEach(deviceLibrary -> {
deviceLogDto.setDeviceId(deviceLibrary.getId()); DeviceLogDto deviceLogDto = new DeviceLogDto();
deviceLogDto.setRemark("由于列装进行了解绑,装备也需要进行解绑"); deviceLogDto.setDeviceId(deviceLibrary.getId());
deviceLogDto.setCreateUserId(userId); deviceLogDto.setRemark("由于列装进行了解绑,装备也需要进行解绑");
deviceLogDtos.add(deviceLogDto); deviceLogDto.setCreateUserId(userId);
}); deviceLogDtos.add(deviceLogDto);
executor.execute(()->{ });
deviceLogService.addAllLog(deviceLogDtos); executor.execute(()->{
}); deviceLogService.addAllLog(deviceLogDtos);
});
}
} }
//修改列装 //修改列装
packingLibrary.setPartParentId(null); packingLibrary.setPartParentId(null);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论