Commit d36f66f2 authored by KeYong's avatar KeYong

修复bug

parent 276264e0
...@@ -1598,8 +1598,29 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1598,8 +1598,29 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
if (!ObjectUtils.isEmpty(equipmentSpecific)) { if (!ObjectUtils.isEmpty(equipmentSpecific)) {
QueryWrapper<VideoEquipmentSpecific> queryWrapper = new QueryWrapper<>(); QueryWrapper<VideoEquipmentSpecific> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("equipment_specific_id", equipmentSpecificId); queryWrapper.eq("equipment_specific_id", equipmentSpecificId);
if (0 == videoIdList.size()) {
videoEquipmentSpecificService.remove(queryWrapper);
return Boolean.TRUE;
}
List<VideoEquipmentSpecific> list = videoEquipmentSpecificService.getBaseMapper().selectList(queryWrapper);
if (0 < list.size()) {
boolean remove = videoEquipmentSpecificService.remove(queryWrapper); boolean remove = videoEquipmentSpecificService.remove(queryWrapper);
if (remove) { if (remove) {
this.bingEquipmentRelationshipToVideo(videoIdList, equipmentSpecificId);
}
} else {
this.bingEquipmentRelationshipToVideo(videoIdList, equipmentSpecificId);
}
return Boolean.FALSE;
} else {
throw new RuntimeException("未获取到此设备!");
}
} else {
throw new RuntimeException("设备ID为空!");
}
}
private Boolean bingEquipmentRelationshipToVideo(List<Long> videoIdList, Long equipmentSpecificId) {
List<VideoEquipmentSpecific> videoSpecificList = new ArrayList<>(); List<VideoEquipmentSpecific> videoSpecificList = new ArrayList<>();
videoIdList.parallelStream().forEach(x -> { videoIdList.parallelStream().forEach(x -> {
VideoEquipmentSpecific videoEquipmentSpecific = new VideoEquipmentSpecific(); VideoEquipmentSpecific videoEquipmentSpecific = new VideoEquipmentSpecific();
...@@ -1609,14 +1630,6 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1609,14 +1630,6 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
}); });
videoEquipmentSpecificService.saveBatch(videoSpecificList); videoEquipmentSpecificService.saveBatch(videoSpecificList);
return Boolean.TRUE; return Boolean.TRUE;
} else {
throw new RuntimeException("设备摄像头绑定关系中此设备不存在!");
}
} else {
throw new RuntimeException("未获取到此设备!");
}
} else {
throw new RuntimeException("设备ID为空!");
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment