lyhzzz 5 місяців тому
батько
коміт
3570b9be70

+ 1 - 1
src/main/java/com/fdkankan/ucenter/controller/app/SceneApiController.java

@@ -164,7 +164,7 @@ public class SceneApiController extends BaseController {
         BeanUtils.copyProperties(user,ssoUser);
 
         if(!ssoUser.getId().equals(userId)) {
-            HashMap<String, List<User>> cooMap = cooperationService.getByNumList(Arrays.asList(sceneNum));
+            HashMap<String, List<User>> cooMap = cooperationService.getByNumList(Arrays.asList(sceneNum),"mesh");
             List<User> cooUsers = cooMap.get(sceneNum);
             if(cooUsers == null || cooUsers.isEmpty()){
                 throw new BusinessException(SceneConstant.FAILURE_CODE_5014, SceneConstant.FAILURE_MSG_5014);

+ 1 - 1
src/main/java/com/fdkankan/ucenter/service/ISceneCooperationService.java

@@ -38,7 +38,7 @@ public interface ISceneCooperationService extends IService<SceneCooperation> {
 
     List<String> getNumByUserIds(List<Long> userIds);
 
-    HashMap<String, List<User>> getByNumList(List<String> numList);
+    HashMap<String, List<User>> getByNumList(List<String> numList,String sceneType);
 
     SceneCooperation getByNum(String num);
 

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

@@ -341,7 +341,7 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
         numList.addAll(v3List);
         numList.addAll(v4List);
         if( !numList.isEmpty()){
-            sceneCooperationService.saveBatchByList(numList,Arrays.asList(user.getId()),"camera",null);
+            sceneCooperationService.saveBatchByList(numList,Arrays.asList(user.getId()),"camera","mesh");
         }
 
 

+ 4 - 3
src/main/java/com/fdkankan/ucenter/service/impl/SceneCooperationServiceImpl.java

@@ -115,7 +115,7 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
         List<SceneCooperation> list = new ArrayList<>();
         List<String> delList = new ArrayList<>();
 
-        HashMap<String, List<User>> byNumList = this.getByNumList(numList);
+        HashMap<String, List<User>> byNumList = this.getByNumList(numList,sceneType);
 
 
         for (Long userId : userIds) {
@@ -404,7 +404,7 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
         HashMap<String,Integer> freeMap = new HashMap<>();
         freeCountList.forEach(e -> freeMap.put(e.getNum(),e.getCount()));
 
-        HashMap<String, List<User>> map = this.getByNumList(numList);
+        HashMap<String, List<User>> map = this.getByNumList(numList,sceneType);
         Integer totalCount = 0;
         for (String num : numList) {
             Integer freeCount = freeMap.get(num) == null ? 1 :freeMap.get(num);
@@ -518,12 +518,13 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
     }
 
     @Override
-    public HashMap<String, List<User>> getByNumList(List<String> numList) {
+    public HashMap<String, List<User>> getByNumList(List<String> numList,String sceneType) {
         if(numList == null || numList.isEmpty()){
             return new HashMap<>();
         }
         LambdaQueryWrapper<SceneCooperation> wrapper = new LambdaQueryWrapper<>();
         wrapper.in(SceneCooperation::getSceneNum,numList);
+        wrapper.eq(SceneCooperation::getSceneType,sceneType);
         List<SceneCooperation> list = this.list(wrapper);
         HashMap<String,List<User>> cooMap = new HashMap<>();
         if(list.size() >0){

+ 1 - 1
src/main/java/com/fdkankan/ucenter/service/impl/SceneProServiceImpl.java

@@ -529,7 +529,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         //设置协作者信息
         if(sceneVoPage.getRecords().size() >0){
             List<String> numList = sceneVoPage.getRecords().parallelStream().map(SceneVo::getNum).collect(Collectors.toList());
-            HashMap<String,List<User>> cooMap = sceneCooperationService.getByNumList(numList);
+            HashMap<String,List<User>> cooMap = sceneCooperationService.getByNumList(numList,"mesh");
             for (SceneVo vo : sceneVoPage.getRecords()) {
                 if (StringUtils.isNotBlank(vo.getNum())) {
                     List<User> userVos = cooMap.get(vo.getNum());