lyhzzz 1 년 전
부모
커밋
0c271f24c4

+ 2 - 0
src/main/java/com/fdkankan/ucenter/service/ICameraService.java

@@ -49,4 +49,6 @@ public interface ICameraService extends IService<Camera> {
     List<Camera> getAllList(String childName,String token);
 
     List<Camera> findLikeChildName(String searchKey);
+
+    List<Camera> getBySnCodes(List<String> snCodes);
 }

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

@@ -445,4 +445,14 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
         wrapper.like(Camera::getSnCode,searchKey);
         return this.list(wrapper);
     }
+
+    @Override
+    public List<Camera> getBySnCodes(List<String> snCodes) {
+        LambdaQueryWrapper<Camera> wrapper = new LambdaQueryWrapper<>();
+        if(snCodes == null || snCodes.size()<=0){
+            return new ArrayList<>();
+        }
+        wrapper.in(Camera::getSnCode,snCodes);
+        return this.list(wrapper);
+    }
 }

+ 19 - 3
src/main/java/com/fdkankan/ucenter/service/impl/FusionService.java

@@ -42,8 +42,10 @@ public class FusionService implements IFusionService {
             SceneProEntityVo vo = new SceneProEntityVo();
             vo.setSceneName(scenePlusVo.getTitle());
             vo.setStatus(scenePlusVo.getSceneStatus());
-            BeanUtils.copyProperties(scenePlusVo,vo);
-            BeanUtils.copyProperties(scenePlusVo.getPlusExt(),vo);
+            if(scenePlusVo.getPlusExt() !=null){
+                BeanUtils.copyProperties(scenePlusVo.getPlusExt(),vo);
+            }
+            BeanUtils.copyProperties(scenePlusVo, vo);
             proEntityVos.add(vo);
         }
         Page<SceneProEntityVo> pageVo = new Page<>(param.getPageNum(),param.getPageSize());
@@ -56,7 +58,15 @@ public class FusionService implements IFusionService {
     @Override
     public PageInfo scenePageList(SceneParam param, String token) {
         LambdaQueryWrapper<ScenePlus> wrapper = new LambdaQueryWrapper<>();
-
+        if(param.getSnCodes() != null && param.getSnCodes().size() >0){
+            List<Camera> cameras = cameraService.getBySnCodes(param.getSnCodes());
+            if(cameras.size() >0){
+                List<Long> cameraIds = cameras.stream().map(Camera::getId).collect(Collectors.toList());
+                wrapper.in(ScenePlus::getCameraId,cameraIds);
+            }else {
+                return PageInfo.PageInfo(new Page<>(param.getPageNum(),param.getPageSize()));
+            }
+        }
         if(StringUtils.isNotBlank(token)){
             User user = userService.getByToken(token);
             if(user == null){
@@ -71,6 +81,10 @@ public class FusionService implements IFusionService {
             resourceList = Collections.singletonList(3);
         }else if(param.getType()!=null && param.getType() == 4){
             resourceList = Collections.singletonList(4);
+        }else if(param.getType() !=null && param.getType() == 6){
+            resourceList = Collections.singletonList(5);
+        }
+        if(param.getType() !=null &&  (param.getType() == 4 || param.getType() == 6 )){
             List<ScenePlusExt> plusExtList = scenePlusExtService.getSsObj();
             List<Long> plusIds = plusExtList.stream().map(ScenePlusExt::getPlusId).collect(Collectors.toList());
             if(plusIds.size() >0){
@@ -104,6 +118,7 @@ public class FusionService implements IFusionService {
         HashMap<Long, ScenePlusExt> extMap = scenePlusExtService.getByPlusIds(plusIds);
         HashMap<Long, ScenePlusVoid> voidMap = scenePlusVoidService.getByPlusIds(plusIds);
         HashMap<Long, Camera> cameraMap = cameraService.getByIds(cameraIds);
+        HashMap<Long, User> userMap = userService.getByIds(page.getRecords().stream().map(ScenePlus::getUserId).collect(Collectors.toList()));
         for (ScenePlus record : page.getRecords()) {
             ScenePlusVo scenePlusVo = new ScenePlusVo();
             BeanUtils.copyProperties(record,scenePlusVo);
@@ -112,6 +127,7 @@ public class FusionService implements IFusionService {
             scenePlusVo.setSnCode(snCode);
             scenePlusVo.setSceneType(param.getType());
             scenePlusVo.setPlusVoid(voidMap.get(record.getId()));
+            scenePlusVo.setPhone(userMap.get(record.getUserId()) == null ?null : userMap.get(record.getUserId()).getUserName());
             list.add(scenePlusVo);
         }
         Page<ScenePlusVo> pageVo = new Page<>(param.getPageNum(),param.getPageSize());

+ 2 - 0
src/main/java/com/fdkankan/ucenter/vo/request/SceneParam.java

@@ -17,6 +17,8 @@ public class SceneParam extends RequestBase {
 
     private String sceneName;       //场景名称
     private String snCode;          //相机snCode
+    private List<String> snCodes;
+
     private String userName;        //协作者名称
 
     private String sceneNum;

+ 1 - 0
src/main/java/com/fdkankan/ucenter/vo/response/ScenePlusVo.java

@@ -10,4 +10,5 @@ public class ScenePlusVo extends ScenePlus {
     private String snCode;
     private ScenePlusExt plusExt;
     private ScenePlusVoid plusVoid;
+    private String phone;
 }

+ 4 - 0
src/main/java/com/fdkankan/ucenter/vo/response/SceneProEntityVo.java

@@ -74,4 +74,8 @@ public class SceneProEntityVo  implements Serializable {
 
     private String recStatus;
 
+    private String phone;
+
+    private Integer shootCount;
+
 }