lyhzzz недель назад: 3
Родитель
Сommit
722b128c22

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

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

+ 8 - 9
src/main/java/com/fdkankan/ucenter/service/impl/AppSceneService.java

@@ -80,6 +80,13 @@ public class AppSceneService extends BaseController {
         if(StringUtils.isEmpty(param.getAppUserName()) && StringUtils.isEmpty(param.getPhoneNum())){
             throw new BusinessException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
         }
+
+        CameraTypelEnum cameraTypelEnum = CameraTypelEnum.getByCameraType(param.getCameraType());
+        if(cameraTypelEnum == null){
+            throw new BusinessException(CameraConstant.FAILURE_CODE_6028, CameraConstant.FAILURE_MSG_6028);
+        }
+        param.setIsLaser(cameraTypelEnum.getLaser());
+
         if(!StringUtils.isEmpty(param.getAppUserName())){
             Camera camera = cameraService.getByChildName(param.getAppUserName());
             if(camera == null){
@@ -99,7 +106,7 @@ public class AppSceneService extends BaseController {
             if(user == null){
                 throw new BusinessException(LoginConstant.FAILURE_CODE_3015, LoginConstant.FAILURE_MSG_3015);
             }
-            cooperationNumList = sceneCooperationService.getNumByUserIds(Arrays.asList(user.getId()));
+            cooperationNumList = sceneCooperationService.getNumByUserIds(Arrays.asList(user.getId()),param.getIsLaser()?"laser":"mesh");
             if(cooperationNumList.size() >0){
                 param.setCooperationNumList(cooperationNumList );
             }
@@ -109,19 +116,11 @@ public class AppSceneService extends BaseController {
         Set<String> copyNumSet = sceneCopyLogService.getCopyNumSet();
         param.setCopyNumSet(copyNumSet);
 
-        CameraTypelEnum cameraTypelEnum = CameraTypelEnum.getByCameraType(param.getCameraType());
-        if(cameraTypelEnum == null){
-            throw new BusinessException(CameraConstant.FAILURE_CODE_6028, CameraConstant.FAILURE_MSG_6028);
-        }
 
-        param.setIsLaser(cameraTypelEnum.getLaser());
-        
         Page<AppSceneVo> page =  scenePlusMapper.pageList(new Page<>(param.getPageNum(),param.getPageSize()),param);
         List<String> numList = page.getRecords().stream().map(AppSceneVo::getNum).collect(Collectors.toList());
 
 
-
-
         HashMap<String, JSONObject> ssSceneMap = new HashMap<>();
         if(cameraTypelEnum.getLaser() ){  //深时
             ssSceneMap = laserService.list(numList,cameraTypelEnum.getSceneSource().get(0));

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

@@ -611,9 +611,10 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
     }
 
     @Override
-    public List<String> getNumByUserIds(List<Long> userIds) {
+    public List<String> getNumByUserIds(List<Long> userIds,String sceneType ) {
         LambdaQueryWrapper<SceneCooperation> wrapper = new LambdaQueryWrapper<>();
         wrapper.in(SceneCooperation::getUserId,userIds);
+        wrapper.eq(SceneCooperation::getSceneType,sceneType);
         Set<String> collect = this.list(wrapper).parallelStream().map(SceneCooperation::getSceneNum).collect(Collectors.toSet());
         return new ArrayList<>(collect);
     }

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

@@ -514,7 +514,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         if(StringUtils.isNotEmpty(param.getSearchKey()) && !"11".equals(param.getType())){
             List<Long> userIds = userService.getLikeUserName(param.getSearchKey());
             if(userIds.size() > 0){
-                List<String> cooperationList = sceneCooperationService.getNumByUserIds(userIds);
+                List<String> cooperationList = sceneCooperationService.getNumByUserIds(userIds,"mesh");
                 param.setNumList(cooperationList);
             }
         }