|
@@ -538,19 +538,21 @@ public class TBDeviceDeliveryServiceImpl extends ServiceImpl<TBDeviceDeliveryMap
|
|
DeviceInOutForm.class);
|
|
DeviceInOutForm.class);
|
|
deviceSerialNoList.add(deviceInOutForm.getSerialNo());
|
|
deviceSerialNoList.add(deviceInOutForm.getSerialNo());
|
|
|
|
|
|
- TBDeviceInOut tbDeviceInOut = tbDeviceInOutService.getOne(
|
|
|
|
|
|
+ List<TBDeviceInOut> tbDeviceInOutList = tbDeviceInOutService.list(
|
|
new QueryWrapper<TBDeviceInOut>().lambda().eq(TBDeviceInOut::getSopNo, sopNo)
|
|
new QueryWrapper<TBDeviceInOut>().lambda().eq(TBDeviceInOut::getSopNo, sopNo)
|
|
.eq(TBDeviceInOut::getType, InOutTypeEnum.OUT)
|
|
.eq(TBDeviceInOut::getType, InOutTypeEnum.OUT)
|
|
- .eq(TBDeviceInOut::getSerialNo, deviceInOutForm.getSerialNo()));
|
|
|
|
- if (Objects.nonNull(tbDeviceInOut)) {
|
|
|
|
- SysDevice sysDevice = sysDeviceService.getOne(new QueryWrapper<SysDevice>().lambda()
|
|
|
|
- .eq(SysDevice::getSerialNo, deviceInOutForm.getSerialNo()));
|
|
|
|
- sysDevice.setLocation(tbDeviceInOut.getLocation());
|
|
|
|
- sysDevice.setLocationArr(tbDeviceInOut.getAddressArr());
|
|
|
|
- sysDevice.updateInfo(userId);
|
|
|
|
-
|
|
|
|
- tbDeviceInOutService.removeById(tbDeviceInOut.getId());
|
|
|
|
- sysDeviceService.updateById(sysDevice);
|
|
|
|
|
|
+ .eq(TBDeviceInOut::getDeviceSerialNo, deviceInOutForm.getSerialNo()));
|
|
|
|
+ if (!org.springframework.util.CollectionUtils.isEmpty(tbDeviceInOutList)) {
|
|
|
|
+ for (TBDeviceInOut tbDeviceInOut : tbDeviceInOutList) {
|
|
|
|
+ SysDevice sysDevice = sysDeviceService.getOne(new QueryWrapper<SysDevice>().lambda()
|
|
|
|
+ .eq(SysDevice::getSerialNo, deviceInOutForm.getSerialNo()));
|
|
|
|
+ sysDevice.setLocation(tbDeviceInOut.getLocation());
|
|
|
|
+ sysDevice.setLocationArr(tbDeviceInOut.getAddressArr());
|
|
|
|
+ sysDevice.updateInfo(userId);
|
|
|
|
+ sysDeviceService.updateById(sysDevice);
|
|
|
|
+ }
|
|
|
|
+ tbDeviceInOutService.removeByIds(
|
|
|
|
+ tbDeviceInOutList.stream().map(s -> s.getId()).collect(Collectors.toList()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|