lyhzzz 4 maanden geleden
bovenliggende
commit
3a6b26da85
1 gewijzigde bestanden met toevoegingen van 14 en 5 verwijderingen
  1. 14 5
      src/main/java/com/fdkankan/ucenter/service/impl/SceneCooperationServiceImpl.java

+ 14 - 5
src/main/java/com/fdkankan/ucenter/service/impl/SceneCooperationServiceImpl.java

@@ -528,11 +528,20 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
 
 
         List<SceneCooperation> addList =new ArrayList<>();
-        if(!numList.isEmpty()){
-            addList = this.saveBatchByList(new ArrayList<>(numList), userIds, type,"mesh");
-        }
-        if(!numList1.isEmpty()){
-            addList = this.saveBatchByList(new ArrayList<>(numList1), userIds, type,"laser");
+        if(StringUtils.isNotBlank(sceneType) ){
+            if(!numList.isEmpty() && "mesh".equals(sceneType)){
+                addList = this.saveBatchByList(new ArrayList<>(numList), userIds, type,"mesh");
+            }
+            if(!numList1.isEmpty() && "laser".equals(sceneType)){
+                addList = this.saveBatchByList(new ArrayList<>(numList1), userIds, type,"laser");
+            }
+        }else {
+            if(!numList.isEmpty()){
+                addList = this.saveBatchByList(new ArrayList<>(numList), userIds, type,"mesh");
+            }
+            if(!numList1.isEmpty() ){
+                addList = this.saveBatchByList(new ArrayList<>(numList1), userIds, type,"laser");
+            }
         }
 
         List<Long> collect3 = addList.stream().map(SceneCooperation::getUserId).collect(Collectors.toList());