Commit 2c3d8f42 authored by KeYong's avatar KeYong

修改bug

parent 50f4fe73
......@@ -1592,22 +1592,23 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
if (equipmentSpecificId != null) {
EquipmentSpecific equipmentSpecific = this.baseMapper.selectById(equipmentSpecificId);
if (!ObjectUtils.isEmpty(equipmentSpecific)) {
QueryWrapper<VideoEquipmentSpecific> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("equipment_specific_id", equipmentSpecificId);
boolean remove = videoEquipmentSpecificService.remove(queryWrapper);
if (remove) {
List<VideoEquipmentSpecific> videoSpecificList = new ArrayList<>();
videoIdList.parallelStream().forEach(x -> {
VideoEquipmentSpecific videoEquipmentSpecific = new VideoEquipmentSpecific();
videoEquipmentSpecific.setVideoId(x);
videoEquipmentSpecific.setEquipmentSpecificId(equipmentSpecificId);
QueryWrapper<VideoEquipmentSpecific> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("equipment_specific_id", equipmentSpecificId);
queryWrapper.eq("video_id", x);
List<VideoEquipmentSpecific> list = videoEquipmentSpecificService.getBaseMapper().selectList(queryWrapper);
if (0 == list.size()) {
videoSpecificList.add(videoEquipmentSpecific);
}
});
videoEquipmentSpecificService.saveBatch(videoSpecificList);
return Boolean.TRUE;
} else {
throw new RuntimeException("设备摄像头绑定关系中此设备不存在!");
}
} else {
throw new RuntimeException("未获取到此设备!");
}
} else {
......
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