Forráskód Böngészése

深时访问返回

lyhzzz 2 éve
szülő
commit
fa5481877c

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

@@ -41,5 +41,5 @@ public interface IScenePlusService extends IService<ScenePlus> {
 
     List<ScenePlus> getByIds(List<Long> plusIds);
 
-    List<ScenePlus> getListByUserId(Long id);
+    List<ScenePlus> getListByUserId(Long id,Long cameraId);
 }

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

@@ -94,5 +94,5 @@ public interface ISceneProService extends IService<ScenePro> {
 
     Integer getSceneSourceByNum(String sceneNum);
 
-    List<ScenePro> getListByUserId(Long id);
+    List<ScenePro> getListByUserId(Long id,Long cameraId);
 }

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

@@ -23,6 +23,7 @@ import com.fdkankan.ucenter.vo.response.CameraAppVo;
 import com.fdkankan.ucenter.vo.response.CameraSpaceVo;
 import com.fdkankan.ucenter.vo.response.CameraVo;
 import com.fdkankan.ucenter.vo.response.GroupByCount;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.joda.time.DateTime;
 import org.joda.time.Days;
@@ -42,6 +43,7 @@ import java.util.stream.Stream;
  * @since 2022-07-04
  */
 @Service
+@Slf4j
 public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implements ICameraService {
 
     @Autowired
@@ -174,12 +176,13 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
         }
         for (CameraVo responseCamera : page.getRecords()) {
 
-            List<ScenePro> proList = sceneProService.getListByUserId(user.getId());
-            List<ScenePlus> plusList = scenePlusService.getListByUserId(user.getId());
+            List<ScenePro> proList = sceneProService.getListByUserId(user.getId(),responseCamera.getId());
+            List<ScenePlus> plusList = scenePlusService.getListByUserId(user.getId(),responseCamera.getId());
             Set<String> numList = proList.stream().map(ScenePro::getNum).collect(Collectors.toSet());
             Set<String> numList2 = plusList.stream().map(ScenePlus::getNum).collect(Collectors.toSet());
             numList.addAll(numList2);
             responseCamera.setSceneList(new ArrayList<>(numList));
+            log.info("listNew---深时访问返回----camera:{},numList:{}",responseCamera.getSnCode(),numList);
 
             responseCamera.setCameraType(param.getCameraType());
             if (responseCamera.getType() != 0){

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

@@ -92,9 +92,10 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
         return this.list(wrapper);
     }
     @Override
-    public List<ScenePlus> getListByUserId(Long userId) {
+    public List<ScenePlus> getListByUserId(Long userId,Long cameraId) {
         LambdaQueryWrapper<ScenePlus> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(ScenePlus::getUserId,userId);
+        wrapper.eq(ScenePlus::getCameraId,cameraId);
         return this.list(wrapper);
     }
 

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

@@ -398,9 +398,10 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         return this.list(wrapper);
     }
     @Override
-    public List<ScenePro> getListByUserId(Long userId) {
+    public List<ScenePro> getListByUserId(Long userId,Long cameraId) {
         LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(ScenePro::getUserId,userId)
+                .eq(ScenePro::getCameraId,cameraId)
                 .eq(ScenePro::getIsUpgrade,0);
         return this.list(wrapper);
     }