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

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

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