فهرست منبع

协作资源bug

lyhzzz 1 سال پیش
والد
کامیت
07edd22fa1
1فایلهای تغییر یافته به همراه10 افزوده شده و 4 حذف شده
  1. 10 4
      src/main/java/com/fdkankan/ucenter/service/impl/CameraServiceImpl.java

+ 10 - 4
src/main/java/com/fdkankan/ucenter/service/impl/CameraServiceImpl.java

@@ -376,10 +376,16 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
         List<ScenePlus> scenePlusList = scenePlusService.getListByCameraIds(cameraIds);
         sceneCooperationService.deleteCooperationList(sceneProList,scenePlusList);
 
-        List<Long> v3Ids = v3List.stream().map(SceneResource::getId).collect(Collectors.toList());
-        List<Long> v4Ids = v4List.stream().map(SceneResource::getId).collect(Collectors.toList());
-        sceneCooperationService.saveBatchByList(sceneProList,new ArrayList<>(),user.getId(),v3Ids);
-        sceneCooperationService.saveBatchByList(new ArrayList<>(),scenePlusList,user.getId(),v4Ids);
+        if(!v3List.isEmpty() && !sceneProList.isEmpty()){
+            List<Long> v3Ids = v3List.stream().map(SceneResource::getId).collect(Collectors.toList());
+            sceneCooperationService.saveBatchByList(sceneProList,new ArrayList<>(),user.getId(),v3Ids);
+        }
+
+        if(!v4List.isEmpty() && !scenePlusList.isEmpty()){
+            List<Long> v4Ids = v4List.stream().map(SceneResource::getId).collect(Collectors.toList());
+            sceneCooperationService.saveBatchByList(new ArrayList<>(),scenePlusList,user.getId(),v4Ids);
+        }
+
 
         fdkkLaserService.disableCooperation(detailMap, cameraMap);
         fdkkLaserService.enableCameraCooperation(detailMap, cameraMap, username);