|
|
@@ -99,6 +99,15 @@ public class DeviceService {
|
|
|
if (Objects.isNull(device)) {
|
|
|
throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.DEVICE_NOT_EXISTS);
|
|
|
}
|
|
|
+ //验证设备存在与项目关联管理 设备不允许删除
|
|
|
+ List<KwsProjectDevice> projectDevices = projectDeviceMapper.selectList(
|
|
|
+ new LambdaQueryWrapper<KwsProjectDevice>()
|
|
|
+ .eq(KwsProjectDevice::getDeviceId, ids)
|
|
|
+ .eq(KwsProjectDevice::getDelFlag, NumberConstant.ZERO)
|
|
|
+ );
|
|
|
+ if (!CollectionUtils.isEmpty(projectDevices) && projectDevices.size()>0){
|
|
|
+ return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE,"设备与项目存在关联,解除关联后,可允许删除");
|
|
|
+ }
|
|
|
HeaderData headerData = commonService.getHeaderData(response);
|
|
|
//List<Long> list = StringUtils.splitStrToList(ids, Long.class);
|
|
|
int update = deviceMapper.update(null, new LambdaUpdateWrapper<KwsDevice>()
|