lyhzzz пре 8 месеци
родитељ
комит
69487e24d2
37 измењених фајлова са 693 додато и 244 уклоњено
  1. 8 0
      doc/update-1.6.0.sql
  2. 6 0
      pom.xml
  3. 1 1
      src/main/java/com/fdkankan/manage/common/OssPath.java
  4. 4 0
      src/main/java/com/fdkankan/manage/common/ResultCode.java
  5. 26 4
      src/main/java/com/fdkankan/manage/controller/CaseController.java
  6. 1 1
      src/main/java/com/fdkankan/manage/controller/CommonController.java
  7. 1 1
      src/main/java/com/fdkankan/manage/controller/SceneController.java
  8. 23 5
      src/main/java/com/fdkankan/manage/controller/inner/InnerAPIController.java
  9. 1 1
      src/main/java/com/fdkankan/manage/entity/Case.java
  10. 3 5
      src/main/java/com/fdkankan/manage/entity/CommonUpload.java
  11. 3 0
      src/main/java/com/fdkankan/manage/entity/JySceneAuth.java
  12. 3 0
      src/main/java/com/fdkankan/manage/entity/JySceneUserAuth.java
  13. 15 0
      src/main/java/com/fdkankan/manage/service/ICaseNumService.java
  14. 8 0
      src/main/java/com/fdkankan/manage/service/ICaseService.java
  15. 1 1
      src/main/java/com/fdkankan/manage/service/ICommonUploadService.java
  16. 4 0
      src/main/java/com/fdkankan/manage/service/IJySceneAuthService.java
  17. 6 0
      src/main/java/com/fdkankan/manage/service/IJySceneUserAuthService.java
  18. 12 9
      src/main/java/com/fdkankan/manage/service/impl/CameraServiceImpl.java
  19. 84 0
      src/main/java/com/fdkankan/manage/service/impl/CaseNumServiceImpl.java
  20. 66 0
      src/main/java/com/fdkankan/manage/service/impl/CaseServiceImpl.java
  21. 42 27
      src/main/java/com/fdkankan/manage/service/impl/CommonServiceImpl.java
  22. 16 1
      src/main/java/com/fdkankan/manage/service/impl/CommonUploadServiceImpl.java
  23. 17 1
      src/main/java/com/fdkankan/manage/service/impl/DictFileServiceImpl.java
  24. 22 0
      src/main/java/com/fdkankan/manage/service/impl/JySceneAuthServiceImpl.java
  25. 192 47
      src/main/java/com/fdkankan/manage/service/impl/JySceneUserAuthServiceImpl.java
  26. 19 94
      src/main/java/com/fdkankan/manage/service/impl/SceneProServiceImpl.java
  27. 31 1
      src/main/java/com/fdkankan/manage/util/CaseNumTypeUtil.java
  28. 1 1
      src/main/java/com/fdkankan/manage/util/OBJToGLBUtil.java
  29. 4 4
      src/main/java/com/fdkankan/manage/util/ShellUtil.java
  30. 11 1
      src/main/java/com/fdkankan/manage/vo/request/CaseNumType.java
  31. 9 0
      src/main/java/com/fdkankan/manage/vo/request/CaseParam.java
  32. 3 0
      src/main/java/com/fdkankan/manage/vo/request/SceneParam.java
  33. 2 0
      src/main/java/com/fdkankan/manage/vo/response/DictFileVo.java
  34. 2 0
      src/main/java/com/fdkankan/manage/vo/response/SceneVo.java
  35. 4 1
      src/main/resources/bootstrap-dev.yml
  36. 4 1
      src/main/resources/bootstrap-local-kj.yml
  37. 38 37
      src/main/resources/mapper/manage/SceneProMapper.xml

+ 8 - 0
doc/update-1.6.0.sql

@@ -30,3 +30,11 @@ DROP TEMPORARY TABLE temp_menu;
 
 
 DELETE from sys_role_menu WHERE menu_id not in (SELECT id from sys_menu WHERE rec_status = 'A');
+
+
+ALTER TABLE `4dkankan_v4`.`jy_scene_auth`
+    ADD COLUMN `case_id` int NULL AFTER `update_time`;
+
+
+ALTER TABLE `4dkankan_v4`.`jy_scene_user_auth`
+    ADD COLUMN `case_id` int NULL AFTER `update_time`;

+ 6 - 0
pom.xml

@@ -65,6 +65,12 @@
     </dependency>
 
     <dependency>
+      <groupId>com.fdkankan</groupId>
+      <artifactId>4dkankan-utils-rabbitmq</artifactId>
+      <version>3.0.0-SNAPSHOT</version>
+    </dependency>
+
+    <dependency>
       <groupId>org.projectlombok</groupId>
       <artifactId>lombok</artifactId>
     </dependency>

+ 1 - 1
src/main/java/com/fdkankan/manage/common/OssPath.java

@@ -11,7 +11,7 @@ public class OssPath {
 
     public final static String default_head ="manage/user/newHead.png";
 
-    public final static String MANAGE_MODEL_FILE_PATH = "manage/media-library/%s/%s";
+    public final static String MANAGE_MODEL_FILE_PATH = "manage/media-library/%s";
 
 
 

+ 4 - 0
src/main/java/com/fdkankan/manage/common/ResultCode.java

@@ -100,6 +100,10 @@ public enum ResultCode  {
 
     UPLOAD_FILE_OBJ_ERROR(60027,"文件内容错误,缺少文件"),
     UPLOAD_FILE_MSG_ERROR(60028,"文件内容错误"),
+
+    CASE_NOT_EXIST(60029, "案件不存在"),
+    NUM_IN_CASE(60030, "该场景已被纳入案件,请跳转到案件列表修改权限或将场景移出案件。"),
+
     ;
 
     private Integer code;

+ 26 - 4
src/main/java/com/fdkankan/manage/controller/CaseController.java

@@ -2,14 +2,17 @@ package com.fdkankan.manage.controller;
 
 
 import com.fdkankan.manage.common.ResultData;
+import com.fdkankan.manage.entity.Case;
+import com.fdkankan.manage.service.ICaseNumService;
 import com.fdkankan.manage.service.ICaseService;
+import com.fdkankan.manage.vo.request.CaseNumType;
 import com.fdkankan.manage.vo.request.CaseParam;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.*;
 
-import org.springframework.web.bind.annotation.RestController;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
 
 /**
  * <p>
@@ -25,10 +28,29 @@ public class CaseController {
 
     @Autowired
     ICaseService caseService;
+    @Autowired
+    ICaseNumService caseNumService;
 
     @PostMapping("/list")
     public ResultData pageList(@RequestBody CaseParam param){
         return ResultData.ok(caseService.pageList(param));
     }
+
+    @GetMapping("/sceneList")
+    public ResultData sceneList(@RequestParam(required = false) Integer caseId){
+        HashMap<Integer, CaseNumType> map = caseNumService.getCaseNumTypeByCaseId(caseId);
+        return ResultData.ok(map.values());
+    }
+
+    @GetMapping("/getCaseByNum")
+    public ResultData getCaseByNum(@RequestParam(required = false) String num){
+        return ResultData.ok(caseService.getCaseByNum(num));
+    }
+
+    @PostMapping("/addOrUpdate")
+    public ResultData addOrUpdate(@RequestBody CaseParam param){
+        caseService.addOrUpdate(param);
+        return ResultData.ok();
+    }
 }
 

+ 1 - 1
src/main/java/com/fdkankan/manage/controller/CommonController.java

@@ -41,7 +41,7 @@ public class CommonController {
      */
     @RequestMapping(value = "/upload/fileNew", method = RequestMethod.POST)
     public ResultData uploadNew(
-            @RequestParam(value = "file") MultipartFile file,@RequestParam(value = "dictId") Integer dictId) {
+            @RequestParam(value = "file") MultipartFile file,@RequestParam(value = "dictId",required = false) Integer dictId) {
 
         return commonService.uploadFileNew(file,dictId);
     }

+ 1 - 1
src/main/java/com/fdkankan/manage/controller/SceneController.java

@@ -77,7 +77,7 @@ public class SceneController {
      */
     @PostMapping("/move")
     public ResultData move(@RequestBody SceneParam param){
-        if(StringUtils.isEmpty(param.getNum()) || StringUtils.isEmpty(param.getSnCode())){
+        if(StringUtils.isEmpty(param.getNum()) || StringUtils.isEmpty(param.getRyNo())){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         sceneProService.move(param);

+ 23 - 5
src/main/java/com/fdkankan/manage/controller/inner/InnerAPIController.java

@@ -104,16 +104,25 @@ public class InnerAPIController extends BaseController {
 
     @PostMapping("/delAuth")
     public ResultData delAuth(@RequestBody JySceneUserAuth param){
-        if(StringUtils.isBlank(param.getNum()) || (StringUtils.isBlank(param.getRyId()) && StringUtils.isBlank(param.getRyNo()))){
+        if(StringUtils.isBlank(param.getNum()) || param.getCaseId() == null || (StringUtils.isBlank(param.getRyId()) && StringUtils.isBlank(param.getRyNo()))){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
+        if(StringUtils.isNotBlank(param.getNum()) && param.getCaseId() != null){
+            param.setCaseId(null);
+        }
         JySceneUserAuth db = null;
-        if(StringUtils.isNotBlank(param.getRyId())){
+        if(StringUtils.isNotBlank(param.getRyId()) && StringUtils.isNotBlank(param.getNum())){
             db = jySceneUserAuthService.getByNumAndRyId(param.getNum(),param.getRyId());
         }
-        if(StringUtils.isNotBlank(param.getRyNo())){
+        if(StringUtils.isNotBlank(param.getRyNo()) && StringUtils.isNotBlank(param.getNum())){
             db = jySceneUserAuthService.getByNumAndRyNo(param.getNum(),param.getRyNo());
         }
+        if(StringUtils.isNotBlank(param.getRyId()) && param.getCaseId() != null){
+            db = jySceneUserAuthService.getByCaseIdAndRyId(param.getCaseId(),param.getRyId());
+        }
+        if(StringUtils.isNotBlank(param.getRyNo()) && param.getCaseId() != null){
+            db = jySceneUserAuthService.getByCaseIdAndRyNo(param.getCaseId(),param.getRyNo());
+        }
         if(db == null){
             throw new BusinessException(ResultCode.DEL_AUTH_ERROR);
         }
@@ -152,10 +161,19 @@ public class InnerAPIController extends BaseController {
         if(StringUtils.isBlank(param.getRyId()) && StringUtils.isBlank(param.getRyNo())){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        if(StringUtils.isBlank(param.getNum())){
+        if(StringUtils.isBlank(param.getNum()) || param.getCaseId() == null){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        JySceneAuth jySceneAuth = jySceneAuthService.getByNum(param.getNum());
+        if(StringUtils.isNotBlank(param.getNum()) && param.getCaseId() != null){
+            param.setCaseId(null);
+        }
+        JySceneAuth jySceneAuth = null;
+        if(StringUtils.isNotBlank(param.getNum())){
+            jySceneAuth = jySceneAuthService.getByNum(param.getNum());
+        }
+        if(param.getCaseId() != null){
+            jySceneAuth = jySceneAuthService.getByCaseId(param.getCaseId());
+        }
         if(jySceneAuth == null){
             return ResultData.ok(PageInfo.PageInfoEmpty(param.getPageNum(),param.getPageSize()));
         }

+ 1 - 1
src/main/java/com/fdkankan/manage/entity/Case.java

@@ -41,7 +41,7 @@ public class Case implements Serializable {
     private String userName;
 
     @TableField("sys_user_id")
-    private Integer sysUserId;
+    private Long sysUserId;
 
     @TableField("tb_status")
     @TableLogic

+ 3 - 5
src/main/java/com/fdkankan/manage/entity/CommonUpload.java

@@ -1,9 +1,7 @@
 package com.fdkankan.manage.entity;
 
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableLogic;
-import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.*;
+
 import java.io.Serializable;
 import java.util.Date;
 import lombok.Getter;
@@ -24,7 +22,7 @@ public class CommonUpload implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
-    @TableId("id")
+    @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
 
     @TableField("file_name")

+ 3 - 0
src/main/java/com/fdkankan/manage/entity/JySceneAuth.java

@@ -54,6 +54,9 @@ public class JySceneAuth implements Serializable {
     @TableField("update_time")
     private Date updateTime;
 
+    @TableField("case_id")
+    private Integer caseId;
+
     @TableField(exist = false)
     private PageInfo<JySceneUserAuth> pageInfo ;
 

+ 3 - 0
src/main/java/com/fdkankan/manage/entity/JySceneUserAuth.java

@@ -100,6 +100,9 @@ public class JySceneUserAuth implements Serializable {
     @TableField("update_time")
     private Date updateTime;
 
+    @TableField("case_id")
+    private Integer caseId;
+
     @TableField(exist = false)
     private String ryId;
 

+ 15 - 0
src/main/java/com/fdkankan/manage/service/ICaseNumService.java

@@ -2,6 +2,10 @@ package com.fdkankan.manage.service;
 
 import com.fdkankan.manage.entity.CaseNum;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.manage.vo.request.CaseNumType;
+
+import java.util.HashMap;
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +17,15 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface ICaseNumService extends IService<CaseNum> {
 
+    void delByCaseId(Integer caseId);
+
+    List<CaseNum> getByCaseId(Integer caseId);
+
+    void saveByCaseIdAndNumList(Integer caseId, List<String> numList,Integer type);
+
+    void delByCaseIdAndNumList(Integer caseId, List<String> numList,Integer type);
+
+    HashMap<Integer,CaseNumType> getCaseNumTypeByCaseId(Integer caseId);
+
+    List<CaseNum> getByNum(String num);
 }

+ 8 - 0
src/main/java/com/fdkankan/manage/service/ICaseService.java

@@ -5,6 +5,8 @@ import com.fdkankan.manage.entity.Case;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fdkankan.manage.vo.request.CaseParam;
 
+import java.util.List;
+
 /**
  * <p>
  *  服务类
@@ -17,4 +19,10 @@ import com.fdkankan.manage.vo.request.CaseParam;
 public interface ICaseService extends IService<Case> {
 
     Object pageList(CaseParam param);
+
+    void addOrUpdate(CaseParam param);
+
+    List<Case> getCaseByNum(String num);
+
+    void checkNumInCase(String num);
 }

+ 1 - 1
src/main/java/com/fdkankan/manage/service/ICommonUploadService.java

@@ -13,5 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface ICommonUploadService extends IService<CommonUpload> {
 
-    CommonUpload add(String replace, String url, String s, String uuid, String msg, String replace1,Integer status,String unzipPath);
+    CommonUpload add(String replace, String url, String s, String uuid, String msg, String replace1,Integer status,String unzipPath,Integer dictId);
 }

+ 4 - 0
src/main/java/com/fdkankan/manage/service/IJySceneAuthService.java

@@ -23,4 +23,8 @@ public interface IJySceneAuthService extends IService<JySceneAuth> {
     HashMap<String, JySceneAuth> getByNumList(List<String> numList);
 
     List<String> getOpenNumList();
+
+    JySceneAuth getByCaseId(Integer caseId);
+
+    void updateAuthTypeByCaseId(Integer caseId, Integer authType);
 }

+ 6 - 0
src/main/java/com/fdkankan/manage/service/IJySceneUserAuthService.java

@@ -46,4 +46,10 @@ public interface IJySceneUserAuthService extends IService<JySceneUserAuth> {
     HashMap<String, List<JySceneUserAuth>> getByNumList(List<String> numList);
 
     HashMap<String, List<JySceneUserAuth>> getByNumList(List<String> numList,Integer jyUserId);
+
+    JySceneUserAuth getByCaseIdAndJyUserId(Integer id, Integer caseId, Integer authType);
+
+    JySceneUserAuth getByCaseIdAndRyId(Integer caseId, String ryId);
+
+    JySceneUserAuth getByCaseIdAndRyNo(Integer caseId, String ryNo);
 }

+ 12 - 9
src/main/java/com/fdkankan/manage/service/impl/CameraServiceImpl.java

@@ -108,9 +108,6 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
         if(StringUtils.isEmpty(wifiName) ){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        if( !wifiName.contains("_") || !wifiName.contains("4D")){
-            throw new BusinessException(ResultCode.WIFI_NAME_ERROR);
-        }
         LambdaQueryWrapper<Camera> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(Camera::getWifiName,wifiName);
         long count = this.count(wrapper);
@@ -124,14 +121,15 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
         HashSet<String> wifiNameSet = new HashSet<>(wifiNameList);
         List<Camera> cameraList = new ArrayList<>();
         for (String wifiName : wifiNameSet) {
-            String[] res = wifiName.split("_");
-            if(res.length !=2 || StringUtils.isBlank(res[1])){
-                throw new BusinessException(ResultCode.WIFI_NAME_ERROR);
+            String snCode = wifiName;
+            if(wifiName.contains("_")){
+                String[] res = wifiName.split("_");
+                snCode = res[1];
             }
             Camera camera = new Camera();
             camera.setWifiName(wifiName);
-            camera.setSnCode(res[1]);
-            camera.setChildName(res[1]);
+            camera.setSnCode(snCode);
+            camera.setChildName(snCode);
             camera.setWifiPassword(CameraConstant.WIFI_PASSWORD_VALUE);
             camera.setChildPassword(CameraConstant.CHILD_PASSWORD_VALUE);
             camera.setActivatedTime(new Date());
@@ -143,7 +141,12 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
         List<CameraDetail> cameraDetailList = new ArrayList<>();
         for (Camera camera : cameraList) {
             String wifiName = camera.getWifiName();
-            Integer type = CameraTypeEnum.getTypeByWifiNamePrefix(wifiName.substring(0,wifiName.lastIndexOf("_") +1));
+            Integer type = 5;
+            if(wifiName.contains("_")){
+                type = CameraTypeEnum.getTypeByWifiNamePrefix(wifiName.substring(0,wifiName.lastIndexOf("_") +1));
+            }else {
+                type = CameraTypeEnum.getTypeByWifiNamePrefix("");
+            }
 
             CameraDetail cameraDetail = new CameraDetail();
             cameraDetail.setAgency(CameraConstant.DEFAULT_AGENT);

+ 84 - 0
src/main/java/com/fdkankan/manage/service/impl/CaseNumServiceImpl.java

@@ -1,11 +1,20 @@
 package com.fdkankan.manage.service.impl;
 
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fdkankan.manage.entity.CaseNum;
 import com.fdkankan.manage.mapper.ICaseNumMapper;
 import com.fdkankan.manage.service.ICaseNumService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.manage.util.CaseNumTypeUtil;
+import com.fdkankan.manage.vo.request.CaseNumType;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+
 /**
  * <p>
  *  服务实现类
@@ -15,6 +24,81 @@ import org.springframework.stereotype.Service;
  * @since 2024-12-04
  */
 @Service
+@DS("db2")
 public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNum> implements ICaseNumService {
 
+    @Override
+    public void delByCaseId(Integer caseId) {
+        LambdaQueryWrapper<CaseNum> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseNum::getCaseId,caseId);
+        this.remove(wrapper);
+    }
+
+    @Override
+    public List<CaseNum> getByCaseId(Integer caseId) {
+        LambdaQueryWrapper<CaseNum> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseNum::getCaseId,caseId);
+        return this.list(wrapper);
+    }
+
+    //0 四维看看,1看见场景,2 深时场景,3 三维模型,4深时obj ,5深光点云,6深光obj
+    //0点云,1mesh
+    @Override
+    public HashMap<Integer,CaseNumType> getCaseNumTypeByCaseId(Integer caseId) {
+        List<CaseNum> caseNums = this.getByCaseId(caseId);
+        if(caseNums.isEmpty()){
+            return new HashMap<>();
+        }
+        HashMap<Integer,CaseNumType> map = new HashMap<>();
+        for (CaseNum caseNum : caseNums) {
+            if(caseNum.getNumType() == 3){
+                continue;
+            }
+            Integer type = CaseNumTypeUtil.getType(caseNum.getNumType());
+            CaseNumType caseNumType = map.get(type);
+            if(caseNumType == null){
+                caseNumType = new CaseNumType();
+                caseNumType.setType(type);
+                caseNumType.setNumList(Arrays.asList(caseNum.getNum()));
+                map.put(type,caseNumType);
+            }else {
+                caseNumType.getNumList().add(caseNum.getNum());
+            }
+        }
+        return map;
+    }
+
+    @Override
+    public void saveByCaseIdAndNumList(Integer caseId, List<String> numList,Integer type) {
+        if(numList.isEmpty()){
+            return;
+        }
+        for (String num : numList) {
+            CaseNum caseNum = new CaseNum();
+            caseNum.setCaseId(caseId);
+            caseNum.setNum(num);
+            caseNum.setNumType(CaseNumTypeUtil.getCaseNumType(num,type));
+            this.save(caseNum);
+        }
+
+    }
+
+    @Override
+    public void delByCaseIdAndNumList(Integer caseId, List<String> numList,Integer type) {
+        if(numList.isEmpty()){
+            return;
+        }
+        LambdaQueryWrapper<CaseNum> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseNum::getCaseId,caseId);
+        wrapper.in(CaseNum::getNumType,CaseNumTypeUtil.getNumType(type));
+        wrapper.in(CaseNum::getNum,numList);
+        this.remove(wrapper);
+    }
+
+    @Override
+    public List<CaseNum> getByNum(String num) {
+        LambdaQueryWrapper<CaseNum> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CaseNum::getNum,num);
+        return this.list(wrapper);
+    }
 }

+ 66 - 0
src/main/java/com/fdkankan/manage/service/impl/CaseServiceImpl.java

@@ -5,14 +5,26 @@ import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.manage.common.PageInfo;
+import com.fdkankan.manage.common.ResultCode;
 import com.fdkankan.manage.entity.Case;
+import com.fdkankan.manage.entity.CaseNum;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.manage.mapper.ICaseMapper;
+import com.fdkankan.manage.service.ICaseNumService;
 import com.fdkankan.manage.service.ICaseService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.manage.vo.request.CaseNumType;
 import com.fdkankan.manage.vo.request.CaseParam;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
 /**
  * <p>
  *  服务实现类
@@ -25,6 +37,8 @@ import org.springframework.stereotype.Service;
 @DS("db2")
 public class CaseServiceImpl extends ServiceImpl<ICaseMapper, Case> implements ICaseService {
 
+    @Autowired
+    ICaseNumService caseNumService;
     @Override
     public Object pageList(CaseParam param) {
         LambdaQueryWrapper<Case> wrapper = new LambdaQueryWrapper<>();
@@ -36,4 +50,56 @@ public class CaseServiceImpl extends ServiceImpl<ICaseMapper, Case> implements I
         Page<Case> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
         return PageInfo.PageInfo(page);
     }
+
+    @Override
+    public List<Case> getCaseByNum(String num) {
+        List<CaseNum> caseNumList = caseNumService.getByNum(num);
+        Set<Integer> setIds = caseNumList.stream().map(CaseNum::getCaseId).collect(Collectors.toSet());
+        if(setIds.isEmpty()){
+            return new ArrayList<>();
+        }
+        return this.listByIds(setIds);
+    }
+
+    @Override
+    public void checkNumInCase(String num) {
+        List<Case> caseByNum = getCaseByNum(num);
+        if(!caseByNum.isEmpty()){
+            throw new BusinessException(ResultCode.NUM_IN_CASE);
+        }
+    }
+
+    @Override
+    public void addOrUpdate(CaseParam param) {
+        Case  caseEntity;
+        if(param.getCaseId() == null){
+            caseEntity = new Case();
+            caseEntity.setSysUserId(Long.valueOf(StpUtil.getLoginId().toString()));
+        }else {
+            caseEntity = this.getById(param.getCaseId());
+        }
+        caseEntity.setCaseTitle(param.getCaseTitle());
+        caseEntity.setUpdateTime(null);
+        this.saveOrUpdate(caseEntity);
+
+        if(param.getCaseId() != null){
+
+            HashMap<Integer,CaseNumType> map = caseNumService.getCaseNumTypeByCaseId(param.getCaseId());
+            List<Integer> typeKes = param.getCaseNumTypeList().stream().map(CaseNumType::getType).collect(Collectors.toList());
+            for (Integer key : map.keySet()) {
+                if(!typeKes.contains(key)){
+                    caseNumService.delByCaseIdAndNumList(param.getCaseId(),map.get(key).getNumList(),key);
+                }
+            }
+
+            for (CaseNumType paramType : param.getCaseNumTypeList()) {
+                CaseNumType dbType = map.get(paramType.getType());
+                List<String> delNums = dbType.getNumList().stream().filter(e -> !paramType.getNumList().contains(e)).collect(Collectors.toList());
+                List<String> addNums = paramType.getNumList().stream().filter(e -> !dbType.getNumList().contains(e)).collect(Collectors.toList());
+                caseNumService.saveByCaseIdAndNumList(param.getCaseId(),addNums,paramType.getType());
+                caseNumService.delByCaseIdAndNumList(param.getCaseId(),delNums,paramType.getType());
+            }
+        }
+
+    }
 }

+ 42 - 27
src/main/java/com/fdkankan/manage/service/impl/CommonServiceImpl.java

@@ -2,7 +2,10 @@ package com.fdkankan.manage.service.impl;
 
 import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.json.JSONObject;
 import com.alibaba.fastjson.JSONArray;
+import com.fdkankan.common.util.SecurityUtil;
 import com.fdkankan.manage.common.OssPath;
 import com.fdkankan.manage.common.ResultCode;
 import com.fdkankan.manage.common.ResultData;
@@ -23,7 +26,9 @@ import com.fdkankan.manage.util.FileWriterUtil;
 import com.fdkankan.manage.util.OBJToGLBUtil;
 import com.fdkankan.manage.util.ShellUtil;
 import com.fdkankan.manage.vo.response.DictFileVo;
+import com.fdkankan.rabbitmq.util.RabbitMqProducer;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -47,6 +52,8 @@ public class CommonServiceImpl implements ICommonService {
     private String ossUrlPrefix;
    @Autowired
     private FYunFileServiceInterface fYunFileServiceInterface;
+   @Autowired
+    RabbitMqProducer rabbitMqProducer;
 
     @Override
     public ResultData uploadFile(MultipartFile file) {
@@ -86,11 +93,10 @@ public class CommonServiceImpl implements ICommonService {
         }
         File  tempFile = null;
         try {
-            String uuid = UUID.randomUUID().toString();
+            String uuid = UUID.randomUUID().toString().replace("-","");
             String originalFilename = file.getOriginalFilename();
             String extName = originalFilename.substring(originalFilename.lastIndexOf(".")).toLowerCase();
-            String ossPath = String.format(OssPath.MANAGE_MODEL_FILE_PATH, DateUtil.format(Calendar.getInstance()
-                    .getTime(), DateExtUtil.dateStyle6), uuid + extName);
+            String ossPath = String.format(OssPath.MANAGE_MODEL_FILE_PATH, uuid + extName);
 
             tempFile = new File(OssPath.localPath + ossPath);
             if(!tempFile.getParentFile().exists()){
@@ -98,7 +104,7 @@ public class CommonServiceImpl implements ICommonService {
             }
             file.transferTo(tempFile);
             if(extName.equals(".zip")){
-                return uploadModelZip(tempFile);
+                return uploadModelZip(originalFilename.replace(extName, ""),tempFile,dictId);
             }
 
             fYunFileServiceInterface.uploadFile(tempFile.getPath(), ossPath);
@@ -108,29 +114,17 @@ public class CommonServiceImpl implements ICommonService {
             if(fileTypeEnum == null){
                 throw new BusinessException(ResultCode.FILE_TYPE_ERROR2);
             }
-            CommonUpload commonUpload = commonUploadService.add(originalFilename.replace(extName, ""), url, String.valueOf(file.getSize()), uuid, fileTypeEnum.getMsg(), extName.replace(".", ""),1,null);
-
-            DictFile dictFile = new DictFile();
-            dictFile.setName(commonUpload.getFileName());
-            dictFile.setTypeKey("media-library");
-            dictFile.setUploadId(commonUpload.getId());
-            dictFile.setDictId(dictId);
-            dictFile.setSysUserId(Long.valueOf(StpUtil.getLoginId().toString()));
-            dictFileService.addOrUpdate(dictFile);
-
+            CommonUpload commonUpload = commonUploadService.add(originalFilename.replace(extName, ""), url, String.valueOf(file.getSize()), uuid, fileTypeEnum.getMsg(), extName.replace(".", ""),1,null,dictId);
+            tempFile.delete();
             return ResultData.ok(commonUpload);
         }catch (Exception e){
             log.info("upload-file-error:{}",e);
             throw new BusinessException(ResultCode.UPLOAD_ERROR);
-        }finally {
-            if(tempFile != null){
-                tempFile.delete();
-            }
         }
     }
 
-    private ResultData uploadModelZip(File tempFile) {
-        String unzipPath = tempFile.getParentFile().getPath() +"/result";
+    private ResultData uploadModelZip(String oldName,File tempFile,Integer dictId) {
+        String unzipPath = tempFile.getParentFile().getPath() +"/result/"+UUID.randomUUID().toString().replace("-","");
         ShellUtil.unZip(tempFile.getPath(),unzipPath);
 
         File unZipFile = new File(unzipPath);
@@ -150,26 +144,39 @@ public class CommonServiceImpl implements ICommonService {
         String modelFileFormat = modelFile.getName().split("\\.")[1].toLowerCase();
         String url = null;
         switch (modelFileFormat){
-            case "obj" :  OBJToGLBUtil.checkObj(modelFile.getPath());
+            case "obj" :  url = uploadObjOss(unzipPath,modelFile);break;
             case "laz" :
             case "shp" :   url = uploadOss(unzipPath,modelFile); break;
             case "b3dm" :  url = uploadB3dm(unzipPath,modelFile); break;
             case "las" :
-            case "ply" :  url = uploadLasOrPly(modelFile);break;
+            case "ply" :  url = uploadLasOrPly(unzipPath,modelFile);break;
             case "osgb":  uploadOsgb(unzipPath,modelFile) ;break;
             default: break;
         }
-        String extName= ".zip";
         FileTypeEnum fileTypeEnum = FileTypeEnum.getByType(modelFileFormat);
         if(fileTypeEnum == null){
             throw new BusinessException(ResultCode.FILE_TYPE_ERROR2);
         }
-        CommonUpload commonUpload = commonUploadService.add(tempFile.getName().replace(extName, ""),url, String.valueOf(tempFile.getTotalSpace()),
-                null, fileTypeEnum.getMsg(), modelFileFormat,0,unzipPath);
-
+        Integer status = StringUtils.isNotBlank(url) ?1:0;
+        CommonUpload commonUpload = commonUploadService.add(oldName,url, String.valueOf(tempFile.length()),
+                null, fileTypeEnum.getMsg(), modelFileFormat,status,unzipPath,dictId);
+        tempFile.delete();
         return ResultData.ok(commonUpload);
     }
 
+    private String uploadObjOss(String unzipPath, File modelFile) {
+        OBJToGLBUtil.checkObj(modelFile.getPath());
+        String localGlbPath = modelFile.getPath().replace(".obj",".glb");
+        OBJToGLBUtil.objToGlb2(modelFile.getPath(),localGlbPath);
+        String ossPath = unzipPath.replace(OssPath.localPath,"");
+        ShellUtil.yunUpload(unzipPath,ossPath);
+        if(!fYunFileServiceInterface.fileExist(localGlbPath.replace(OssPath.localPath,""))){
+            throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
+        }
+        FileUtil.del(unzipPath);
+        return  ossUrlPrefix +  localGlbPath.replace(OssPath.localPath,"");
+    }
+
     private String uploadB3dm(String unzipPath, File modelFile) {
        String b3dmJsonPath = FileWriterUtil.checkB3dmTileset(modelFile);
         if(b3dmJsonPath == null){
@@ -183,10 +190,16 @@ public class CommonServiceImpl implements ICommonService {
         return ossUrlPrefix +  ossPath;
     }
 
+
     private void uploadOsgb(String unzipPath, File modelFile) {
+        //容器不支持转化,通知fusion容器执行
+        HashMap<String,String > map = new HashMap<>();
+        map.put("path",unzipPath);
+        rabbitMqProducer.sendByWorkQueue("queue-model-osgbToB3dm",map);
     }
 
 
+
     private String uploadOss(String unzipPath,File modelFile) {
         String ossPath = unzipPath.replace(OssPath.localPath,"");
         String modelOssPath = modelFile.getPath().replace(OssPath.localPath, "");
@@ -194,16 +207,18 @@ public class CommonServiceImpl implements ICommonService {
         if(!fYunFileServiceInterface.fileExist(modelOssPath)){
             throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
         }
+        FileUtil.del(unzipPath);
         return ossUrlPrefix +  modelOssPath;
     }
 
-    private String uploadLasOrPly(File modelFile) {
+    private String uploadLasOrPly(String unzipPath ,File modelFile) {
         File mntFile = OBJToGLBUtil.lasOrPlyToBin(modelFile);
         String ossPath = mntFile.getPath().replace(OssPath.localPath,"");
         ShellUtil.yunUpload(mntFile.getPath(),ossPath);
         if(!fYunFileServiceInterface.fileExist(ossPath+"/webcloud/cloud.js")){
             throw new BusinessException(-1,"缺少cloud.js文件");
         }
+        FileUtil.del(unzipPath);
         return ossUrlPrefix +  ossPath + "/webcloud";
     }
 }

+ 16 - 1
src/main/java/com/fdkankan/manage/service/impl/CommonUploadServiceImpl.java

@@ -1,9 +1,13 @@
 package com.fdkankan.manage.service.impl;
 
+import cn.dev33.satoken.stp.StpUtil;
 import com.fdkankan.manage.entity.CommonUpload;
+import com.fdkankan.manage.entity.DictFile;
 import com.fdkankan.manage.mapper.ICommonUploadMapper;
 import com.fdkankan.manage.service.ICommonUploadService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.manage.service.IDictFileService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 /**
@@ -17,8 +21,10 @@ import org.springframework.stereotype.Service;
 @Service
 public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, CommonUpload> implements ICommonUploadService {
 
+    @Autowired
+    IDictFileService dictFileService;
     @Override
-    public CommonUpload add(String fileName, String url, String fileSize, String uuid, String msg, String replace1,Integer status,String unzipPath) {
+    public CommonUpload add(String fileName, String url, String fileSize, String uuid, String msg, String replace1,Integer status,String unzipPath,Integer dictId) {
         CommonUpload upload = new CommonUpload();
         upload.setFileName(fileName);
         upload.setFileUrl(url);
@@ -29,6 +35,15 @@ public class CommonUploadServiceImpl extends ServiceImpl<ICommonUploadMapper, Co
         upload.setStatus(status);
         upload.setUnzipPath(unzipPath);
         this.save(upload);
+
+        DictFile dictFile = new DictFile();
+        dictFile.setName(fileName);
+        dictFile.setTypeKey("media-library");
+        dictFile.setUploadId(upload.getId());
+        dictFile.setDictId(dictId);
+        dictFile.setSysUserId(Long.valueOf(StpUtil.getLoginId().toString()));
+        dictFileService.addOrUpdate(dictFile);
+
         return upload;
     }
 }

+ 17 - 1
src/main/java/com/fdkankan/manage/service/impl/DictFileServiceImpl.java

@@ -7,12 +7,14 @@ import com.fdkankan.manage.common.PageInfo;
 import com.fdkankan.manage.common.ResultCode;
 import com.fdkankan.manage.constant.FileTypeEnum;
 import com.fdkankan.manage.entity.CommonUpload;
+import com.fdkankan.manage.entity.Dict;
 import com.fdkankan.manage.entity.DictFile;
 import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.manage.mapper.IDictFileMapper;
 import com.fdkankan.manage.service.ICommonUploadService;
 import com.fdkankan.manage.service.IDictFileService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.manage.service.IDictService;
 import com.fdkankan.manage.vo.request.DictFileParam;
 import com.fdkankan.manage.vo.response.DictFileVo;
 import org.apache.commons.lang3.StringUtils;
@@ -38,6 +40,8 @@ public class DictFileServiceImpl extends ServiceImpl<IDictFileMapper, DictFile>
 
     @Autowired
     ICommonUploadService commonUploadService;
+    @Autowired
+    IDictService dictService;
 
 
     @Override
@@ -62,14 +66,26 @@ public class DictFileServiceImpl extends ServiceImpl<IDictFileMapper, DictFile>
             List<CommonUpload> commonUploads = commonUploadService.listByIds(uploadIds);
             commonUploads.forEach(e -> map.put(e.getId(),e));
         }
+        List<Integer> dictIds = page.getRecords().stream().map(DictFile::getDictId).collect(Collectors.toList());
+
+        HashMap<Integer, Dict> dictHashMap = new HashMap<>();
+        if(!dictIds.isEmpty()){
+            List<Dict> dictList = dictService.listByIds(uploadIds);
+            dictList.forEach(e -> dictHashMap.put(e.getId(),e));
+        }
+
         List<DictFileVo> voList = new ArrayList<>();
         for (DictFile record : page.getRecords()) {
             DictFileVo vo = new DictFileVo();
-            BeanUtils.copyProperties(record,vo);
             CommonUpload upload = map.get(record.getUploadId());
             if(upload != null){
                 BeanUtils.copyProperties(upload,vo);
             }
+            BeanUtils.copyProperties(record,vo);
+            Dict dict = dictHashMap.get(record.getDictId());
+            if(dict != null){
+                vo.setDictName(dict.getDictName());
+            }
             voList.add(vo);
         }
         Page<DictFileVo> voPage = new Page<>(param.getPageNum(),param.getPageSize());

+ 22 - 0
src/main/java/com/fdkankan/manage/service/impl/JySceneAuthServiceImpl.java

@@ -70,4 +70,26 @@ public class JySceneAuthServiceImpl extends ServiceImpl<IJySceneAuthMapper, JySc
         wrapper.set(JySceneAuth::getAuthType,authType);
         this.update(wrapper);
     }
+
+    @Override
+    public void updateAuthTypeByCaseId(Integer caseId, Integer authType) {
+        JySceneAuth auth = this.getByCaseId(caseId);
+        if(auth == null){
+            auth = new JySceneAuth(authType);
+            auth.setCaseId(caseId);
+            this.save(auth);
+            return;
+        }
+        LambdaUpdateWrapper<JySceneAuth> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(JySceneAuth::getCaseId,caseId);
+        wrapper.set(JySceneAuth::getAuthType,authType);
+        this.update(wrapper);
+    }
+
+    @Override
+    public JySceneAuth getByCaseId(Integer caseId) {
+        LambdaQueryWrapper<JySceneAuth> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(JySceneAuth::getCaseId,caseId);
+        return this.getOne(wrapper);
+    }
 }

+ 192 - 47
src/main/java/com/fdkankan/manage/service/impl/JySceneUserAuthServiceImpl.java

@@ -56,40 +56,76 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
     IScenePlusService scenePlusService;
     @Autowired
     ISysUserService sysUserService;
+    @Autowired
+    ICaseService caseService;
+
 
 
     @Override
     public Object getAuthType(SceneParam param) {
-        if(StringUtils.isBlank(param.getNum())){
+        if(StringUtils.isBlank(param.getNum()) || param.getCaseId() == null){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        ScenePro pro = sceneProService.getByNum(param.getNum());
-        ScenePlus plus = scenePlusService.getByNum(param.getNum());
-        if(pro == null && plus == null){
-            throw new BusinessException(ResultCode.SCENE_NOT_EXIST);
+        if(StringUtils.isNotBlank(param.getNum()) && param.getCaseId() !=null){
+            param.setCaseId(null);
         }
-        JySceneAuth jySceneAuth = jySceneAuthService.getByNum(param.getNum());
-        if(jySceneAuth == null ){
-            return new JySceneAuth(0);
+        JySceneAuth jySceneAuth = null;
+        if(StringUtils.isNotBlank(param.getNum())){
+            caseService.checkNumInCase(param.getNum());
+            ScenePlus plus = scenePlusService.getByNum(param.getNum());
+            if(plus == null){
+                throw new BusinessException(ResultCode.SCENE_NOT_EXIST);
+            }
+            jySceneAuth = jySceneAuthService.getByNum(param.getNum());
+            if(jySceneAuth == null ){
+                return new JySceneAuth(0);
+            }
+        }
+        if(param.getCaseId() != null){
+            Case caseEntity = caseService.getById(param.getCaseId());
+            if(caseEntity == null){
+                throw new BusinessException(ResultCode.CASE_NOT_EXIST);
+            }
+
+            jySceneAuth = jySceneAuthService.getByCaseId(param.getCaseId());
+            if(jySceneAuth == null ){
+                return new JySceneAuth(0);
+            }
         }
         return jySceneAuth;
     }
 
     @Override
     public Object getAuthList(SceneParam param) {
-        if(StringUtils.isBlank(param.getNum())){
+        if(StringUtils.isBlank(param.getNum()) || param.getCaseId() == null){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-
-        ScenePro pro = sceneProService.getByNum(param.getNum());
-        ScenePlus plus = scenePlusService.getByNum(param.getNum());
-        if(pro == null && plus == null){
-            throw new BusinessException(ResultCode.SCENE_NOT_EXIST);
+        if(StringUtils.isNotBlank(param.getNum()) && param.getCaseId() !=null){
+            param.setCaseId(null);
         }
-        Long sceneUserId = pro  == null ? plus.getUserId(): pro.getUserId();
-
+        Long sceneUserId = null;
         JyUser loginUser = null;
         Long sysRoleId = null;
+        if(StringUtils.isNotBlank(param.getNum())){
+            ScenePlus plus = scenePlusService.getByNum(param.getNum());
+            if(plus == null){
+                throw new BusinessException(ResultCode.SCENE_NOT_EXIST);
+            }
+            caseService.checkNumInCase(param.getNum());
+            sceneUserId = plus.getUserId();
+        }
+        if(param.getCaseId() != null){
+            Case caseEntity = caseService.getById(param.getCaseId());
+            if(caseEntity == null){
+                throw new BusinessException(ResultCode.CASE_NOT_EXIST);
+            }
+            JyUser jyUser = jyUserService.getBySysId(caseEntity.getSysUserId());
+            if(jyUser == null){
+                throw new BusinessException(ResultCode.USER_NOT_EXIST);
+            }
+            sceneUserId = jyUser.getUserId();
+        }
+
         if(StpUtil.isLogin()){
             loginUser = jyUserService.getBySysId(StpUtil.getLoginId());
             SysUser byId = sysUserService.getById(Long.valueOf(StpUtil.getLoginId().toString()));
@@ -111,16 +147,23 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
         }
 
         LambdaQueryWrapper<JySceneUserAuth> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(JySceneUserAuth::getNum,param.getNum());
+        if(StringUtils.isNotBlank(param.getNum())){
+            wrapper.eq(JySceneUserAuth::getNum,param.getNum());
+        }
+        if(param.getCaseId() != null){
+            wrapper.eq(JySceneUserAuth::getCaseId,param.getCaseId());
+        }
         wrapper.eq(JySceneUserAuth::getAuthType,param.getAuthType());
+
         if(!sceneUserId.equals(loginUser.getUserId()) && sysRoleId!=null && sysRoleId == 47L  ){
             List<Integer> ids = new ArrayList<>();
-            getSubAuthorIdsById(loginUser.getId(),param.getNum(),ids);
+            getSubAuthorIdsById(loginUser.getId(),param.getNum(),param.getCaseId(),ids);
             if(ids.size()<=0){
                 return PageInfo.PageInfo(new Page(param.getPageNum(),param.getPageSize()));
             }
             wrapper.in(JySceneUserAuth::getAuthorId,ids);
         }
+
         wrapper.orderByDesc(JySceneUserAuth::getCreateTime);
         Page<JySceneUserAuth> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
 
@@ -139,16 +182,21 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
         return PageInfo.PageInfo(page);
     }
 
-    private void getSubAuthorIdsById(Integer id,String num,List<Integer> ids) {
+    private void getSubAuthorIdsById(Integer id,String num,Integer caseId,List<Integer> ids) {
         ids.add(id);
         LambdaQueryWrapper<JySceneUserAuth> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(JySceneUserAuth::getNum,num);
+        if(StringUtils.isNotBlank(num)){
+            wrapper.eq(JySceneUserAuth::getNum,num);
+        }
+        if(caseId != null){
+            wrapper.eq(JySceneUserAuth::getCaseId,caseId);
+        }
         wrapper.eq(JySceneUserAuth::getAuthorId,id);
         List<JySceneUserAuth> list = this.list(wrapper);
         if(list.size() >0){
             for (JySceneUserAuth auth : list) {
                 ids.add(auth.getAuthorId());
-                getSubAuthorIdsById(auth.getId(),num,ids);
+                getSubAuthorIdsById(auth.getId(),num,caseId,ids);
             }
         }
     }
@@ -156,28 +204,36 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
 
     @Override
     public void setAuthType(JySceneUserAuth param) {
-        if(StringUtils.isBlank(param.getNum()) || param.getAuthType() == null){
+
+        if(StringUtils.isBlank(param.getNum()) || param.getCaseId() == null || param.getAuthType() == null){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        ScenePro pro = sceneProService.getByNum(param.getNum());
-        ScenePlus plus = scenePlusService.getByNum(param.getNum());
-        if(pro == null && plus == null){
-            throw new BusinessException(ResultCode.SCENE_NOT_EXITS);
+        if(StringUtils.isNotBlank(param.getNum()) && param.getCaseId() !=null){
+            param.setCaseId(null);
+        }
+        if(StringUtils.isNotBlank(param.getNum())){
+            ScenePlus plus = scenePlusService.getByNum(param.getNum());
+            if( plus == null){
+                throw new BusinessException(ResultCode.SCENE_NOT_EXITS);
+            }
+            jySceneAuthService.updateAuthTypeByNum(param.getNum(),param.getAuthType());
+        }
+        if(param.getCaseId() != null){
+            Case caseEntity = caseService.getById(param.getCaseId());
+            if(caseEntity == null){
+                throw new BusinessException(ResultCode.CASE_NOT_EXIST);
+            }
+            jySceneAuthService.updateAuthTypeByCaseId(param.getCaseId(),param.getAuthType());
+
         }
 
-        jySceneAuthService.updateAuthTypeByNum(param.getNum(),param.getAuthType());
     }
 
     @Override
     public synchronized void addAuth(JySceneUserAuth param) {
-        if(StringUtils.isBlank(param.getNum()) ){
+        if(StringUtils.isBlank(param.getNum()) || param.getCaseId() == null ){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        ScenePro pro = sceneProService.getByNum(param.getNum());
-        ScenePlus plus = scenePlusService.getByNum(param.getNum());
-        if(pro == null && plus == null){
-            throw new BusinessException(ResultCode.SCENE_NOT_EXITS);
-        }
 
         JyUser jyUser = null;
         if(StringUtils.isNotBlank(param.getRyId()) ){
@@ -195,14 +251,38 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
         if(jyUser == null){
             throw new BusinessException(ResultCode.JY_ID_NO_EXIST);
         }
-        JySceneUserAuth jySceneUserAuth = jySceneUserAuthService.getByNumAndJyUserId(jyUser.getId(), param.getNum(),param.getAuthType());
+
+        Long sceneUserId = null;
+        JySceneUserAuth jySceneUserAuth = null;
+        if(StringUtils.isNotBlank(param.getNum())){
+            ScenePlus plus = scenePlusService.getByNum(param.getNum());
+            if(plus == null){
+                throw new BusinessException(ResultCode.SCENE_NOT_EXIST);
+            }
+            caseService.checkNumInCase(param.getNum());
+            sceneUserId = plus.getUserId();
+            jySceneUserAuth = jySceneUserAuthService.getByNumAndJyUserId(jyUser.getId(), param.getNum(),param.getAuthType());
+        }
+        if(param.getCaseId() != null){
+            Case caseEntity = caseService.getById(param.getCaseId());
+            if(caseEntity == null){
+                throw new BusinessException(ResultCode.CASE_NOT_EXIST);
+            }
+            JyUser jyUser2 = jyUserService.getBySysId(caseEntity.getSysUserId());
+            if(jyUser2 == null){
+                throw new BusinessException(ResultCode.USER_NOT_EXIST);
+            }
+            sceneUserId = jyUser2.getUserId();
+            jySceneUserAuth = jySceneUserAuthService.getByCaseIdAndJyUserId(jyUser.getId(), param.getCaseId(),param.getAuthType());
+        }
+
+
         if(jySceneUserAuth != null && param.getCanDel() != 1){
             throw new BusinessException(ResultCode.SCENE_AUTH_EXITS);
         }
         if(jySceneUserAuth != null && param.getCanDel() == 1){
             param.setId(jySceneUserAuth.getId());
         }
-        Long sceneUserId = pro == null ? plus.getUserId():pro.getUserId();
 
         if(sceneUserId.equals(jyUser.getUserId())){
             throw new BusinessException(ResultCode.AUTH_ERROR);
@@ -222,10 +302,21 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
         if(param.getCanEditLook() == 0 && param.getCanAuthLook() == 0){
             param.setIsAuthor(0);
         }
-        JySceneAuth jySceneAuth = jySceneAuthService.getByNum(param.getNum());
+        JySceneAuth jySceneAuth = null;
+        if(StringUtils.isNotBlank(param.getNum())){
+            jySceneAuth = jySceneAuthService.getByNum(param.getNum());
+        }
+        if(param.getCaseId() != null){
+            jySceneAuth = jySceneAuthService.getByCaseId(param.getCaseId());
+        }
         if(jySceneAuth == null){
             jySceneAuth = new JySceneAuth(param.getAuthType());
-            jySceneAuth.setNum(param.getNum());
+            if(StringUtils.isNotBlank(param.getNum())){
+                jySceneAuth.setNum(param.getNum());
+            }
+            if(param.getCaseId() != null){
+                jySceneAuth.setCaseId(param.getCaseId());
+            }
             jySceneAuthService.save(jySceneAuth);
         }
 
@@ -255,6 +346,15 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
     }
 
     @Override
+    public JySceneUserAuth getByCaseIdAndJyUserId(Integer jyUserId, Integer caseId, Integer authType) {
+        LambdaQueryWrapper<JySceneUserAuth> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(JySceneUserAuth::getJyUserId,jyUserId);
+        wrapper.eq(JySceneUserAuth::getCaseId,caseId);
+        wrapper.eq(JySceneUserAuth::getAuthType,authType);
+        return this.getOne(wrapper);
+    }
+
+    @Override
     public JySceneUserAuth getByNumAndRyId(String num, String ryId) {
         JyUser jyUser = jyUserService.getByRyId(ryId);
         if(jyUser == null){
@@ -281,6 +381,32 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
     }
 
     @Override
+    public JySceneUserAuth getByCaseIdAndRyId(Integer caseId, String ryId) {
+        JyUser jyUser = jyUserService.getByRyId(ryId);
+        if(jyUser == null){
+            throw new BusinessException(ResultCode.JY_ID_NO_EXIST);
+        }
+        JySceneAuth jySceneAuth = jySceneAuthService.getByCaseId(caseId);
+        if(jySceneAuth == null){
+            throw new BusinessException(ResultCode.DEL_AUTH_ERROR);
+        }
+        return this.getByCaseIdAndJyUserId(jyUser.getId(),caseId,jySceneAuth.getAuthType());
+    }
+
+    @Override
+    public JySceneUserAuth getByCaseIdAndRyNo(Integer caseId, String ryNo) {
+        JyUser jyUser = jyUserService.getByRyNo(ryNo);
+        if(jyUser == null){
+            throw new BusinessException(ResultCode.JY_ID_NO_EXIST);
+        }
+        JySceneAuth jySceneAuth = jySceneAuthService.getByCaseId(caseId);
+        if(jySceneAuth == null){
+            throw new BusinessException(ResultCode.DEL_AUTH_ERROR);
+        }
+        return this.getByCaseIdAndJyUserId(jyUser.getId(),caseId,jySceneAuth.getAuthType());
+    }
+
+    @Override
     public Object checkAuthOther(JySceneUserAuth param) {
         if(StringUtils.isBlank(param.getNum())){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
@@ -343,6 +469,15 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
         if(jySceneAuth!=null && jySceneAuth.getAuthType() == 1){
             sceneAuthVo.setViewAuth(true);
         }
+        List<Case> caseList = caseService.getCaseByNum(num);
+        for (Case aCase : caseList) {
+            JySceneAuth jySceneAuth1 = jySceneAuthService.getByCaseId(aCase.getCaseId());
+            if(jySceneAuth1!=null && jySceneAuth1.getAuthType() == 1){
+                sceneAuthVo.setViewAuth(true);
+                break;
+            }
+        }
+
         if(StringUtils.isBlank(token) && (StringUtils.isBlank(userName) || StringUtils.isBlank(password))){
             return sceneAuthVo;
         }
@@ -393,16 +528,12 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
         //if(jySceneAuth != null  && jySceneAuth.getAuthType() == 0){
         if(jySceneAuth != null  ){
             JySceneUserAuth jySceneUserAuth = jySceneUserAuthService.getByNumAndJyUserId(jyUser.getId(), num,jySceneAuth.getAuthType());
-            if(jySceneUserAuth != null){
-                Date date = new Date();
-                if(jySceneUserAuth.getLookAuth() == 1 ||
-                        ( jySceneUserAuth.getLookAuth() == 2 && jySceneUserAuth.getLookEndTime().getTime() >date.getTime())){
-                    sceneAuthVo.setViewAuth(true);
-                }
-                if(jySceneUserAuth.getEditAuth() == 1 ||
-                        (jySceneUserAuth.getEditAuth() == 2 && jySceneUserAuth.getEditEndTime().getTime() >date.getTime())){
-                    sceneAuthVo.setEditAuth(true);
-                }
+            setFlag(jySceneUserAuth,sceneAuthVo);
+        }
+        if(!caseList.isEmpty()){
+            for (Case aCase : caseList) {
+                JySceneUserAuth jySceneUserAuth = jySceneUserAuthService.getByCaseIdAndJyUserId(jyUser.getId(), aCase.getCaseId(),jySceneAuth.getAuthType());
+                setFlag(jySceneUserAuth,sceneAuthVo);
             }
         }
 
@@ -443,6 +574,20 @@ public class JySceneUserAuthServiceImpl extends ServiceImpl<IJySceneUserAuthMapp
         return sceneAuthVo;
     }
 
+    private void setFlag(JySceneUserAuth jySceneUserAuth,SceneAuthVo sceneAuthVo){
+        if(jySceneUserAuth != null){
+            Date date = new Date();
+            if(jySceneUserAuth.getLookAuth() == 1 ||
+                    ( jySceneUserAuth.getLookAuth() == 2 && jySceneUserAuth.getLookEndTime().getTime() >date.getTime())){
+                sceneAuthVo.setViewAuth(true);
+            }
+            if(jySceneUserAuth.getEditAuth() == 1 ||
+                    (jySceneUserAuth.getEditAuth() == 2 && jySceneUserAuth.getEditEndTime().getTime() >date.getTime())){
+                sceneAuthVo.setEditAuth(true);
+            }
+        }
+    }
+
     @Override
     public List<JySceneUserAuth> getByJyUserId(Integer jyUserId) {
         LambdaQueryWrapper<JySceneUserAuth> wrapper = new LambdaQueryWrapper<>();

+ 19 - 94
src/main/java/com/fdkankan/manage/service/impl/SceneProServiceImpl.java

@@ -318,6 +318,9 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
                return PageInfo.PageInfo(new Page(param.getPageNum(),param.getPageSize()));
             }
             param.setPlatformId(loginPlatformId);
+        }
+
+        if(param.getSceneType() == 1){
             List<String> openNums = jySceneAuthService.getOpenNumList();
             if(!openNums.isEmpty()){
                 param.getAuthNumList().addAll(openNums);
@@ -327,7 +330,6 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
                 List<String> numList = list.stream().filter(entity -> !(entity.getLookAuth()==0 && entity.getEditAuth() ==0)).map(JySceneUserAuth::getNum).collect(Collectors.toList());
                 param.getAuthNumList().addAll(numList);
             }
-
             List<JyUserShare> jyUserShares = jyUserShareService.getByJyUserId(jyUser.getId());
             List<Integer> mainUserIds = jyUserShares.stream().map(JyUserShare::getMainJyUserId).collect(Collectors.toList());
             HashMap<Integer,Long> roleMap = new HashMap<>();
@@ -346,7 +348,9 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
                     }
                 }
             }
-
+            if(param.getAuthNumList().isEmpty() && param.getOtherUserIds().isEmpty() && param.getOtherPlatformIds().isEmpty()){
+                return PageInfo.PageInfoEmpty(param.getPageNum(),param.getPageSize());
+            }
         }
 
         Set<Long> userIds = null;
@@ -356,12 +360,10 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         Page<SceneVo> page  = this.getBaseMapper().pageList(new Page<>(param.getPageNum(),param.getPageSize()),param);
         List<SceneVo> records = page.getRecords();
         List<String> numList = records.parallelStream().map(SceneVo::getNum).collect(Collectors.toList());
+        List<String> lasesrNumList = records.parallelStream().filter(e -> e.getSceneSource() ==4 || e.getSceneSource() == 5).map(SceneVo::getNum).collect(Collectors.toList());
 
-        if(param.getType() == 2 || param.getType() == 6) { //深时点云,深光点云
-            if(!numList.isEmpty()){
-                //laserMap = laserService.list(numList, param.getType() == 2 ? 4 : 5);
-                laserMap = laserService.getMapLaserSceneByDb(new LaserSceneParam(numList));
-            }
+        if(!lasesrNumList.isEmpty()){
+            laserMap = laserService.getMapLaserSceneByDb(new LaserSceneParam(numList));
         }
         userIds = page.getRecords().stream().map(SceneVo::getUserId).collect(Collectors.toSet());
         userMap = jyUserService.getMapByUserIds(userIds);
@@ -369,8 +371,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         HashMap<String,SceneCopyLog> map =  copyLogService.getByNewNumList(numList);
 
         for (SceneVo record : page.getRecords()) {
-
-            if(param.getType() == 2 || param.getType() == 6){
+            if(record.getSceneSource() == 4 || record.getSceneSource() == 5){
                 JSONObject ssObj = laserMap.get(record.getNum());
                 if(ssObj!=null){
                     record.setId(ssObj.getInteger("id"));
@@ -469,98 +470,22 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
 
     @Override
     public void move(SceneParam param) {
-        Camera camera = cameraService.getBySnCode(param.getSnCode());
-        if(camera == null){
-            throw new BusinessException(ResultCode.CAMERA_SN_NOT_EXIST);
-        }
-        CameraDetail cameraDetail = cameraDetailService.getByCameraId(camera.getId());
-        if(cameraDetail == null){
-            throw new BusinessException(ResultCode.CAMERA_SN_NOT_EXIST);
-        }
-        ScenePro scenePro = this.getByNum(param.getNum());
         ScenePlus scenePlus = scenePlusService.getByNum(param.getNum());
-        if((scenePro == null || scenePro.getCameraId() == null ) && (scenePlus== null || scenePlus.getCameraId() == null)){
+        if(scenePlus== null ){
             throw new BusinessException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
         }
-        Integer status =  scenePro == null ? scenePlus.getSceneStatus() : scenePro.getStatus();
-        if(status == 0){
+        if(scenePlus.getSceneStatus() != -2){
             throw new BusinessException(SceneConstant.FAILURE_CODE_5037, SceneConstant.FAILURE_MSG_5037);
         }
-
-        Long sceneCameraId = scenePro == null ? scenePlus.getCameraId() : scenePro.getCameraId();
-        Long space = scenePro == null ? 0 :scenePro.getSpace();
-        if(scenePlus !=null){
-            ScenePlusExt scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
-            space = scenePlusExt.getSpace();
-        }
-        space = space == null ? 0 :space;
-        Long newUseSpace = space + cameraDetail.getUsedSpace();
-
-        Long totalSpace = cameraDetail.getTotalSpace();
-        UserIncrement userIncrement = userIncrementService.getByCameraId(camera.getId());
-        if(userIncrement!=null){
-            IncrementType incrementType = incrementTypeService.getById(userIncrement.getIncrementTypeId());
-            if(incrementType!=null){
-                if(incrementType.getCameraCapacity() == -1){
-                    totalSpace   = -1L;
-                }else {
-                    totalSpace = incrementType.getCameraCapacity() * 1024 * 1024L;
-                }
-            }
-        }
-        //深时场景无限容量
-        if(cameraDetail.getType() != 10 && totalSpace !=-1 &&  newUseSpace  > totalSpace){
-            throw new BusinessException(ResultCode.CAMERA_SPACE_ERROR);
-        }
-
-        Camera oldCamera = cameraService.getById(sceneCameraId);
-        if(oldCamera == null){
-            throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
-        }
-        CameraDetail oldCameraDetail = cameraDetailService.getByCameraId(oldCamera.getId());
-        if(oldCameraDetail == null){
-            throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
-        }
-        if(oldCameraDetail.getCameraId().equals(cameraDetail.getCameraId())){
-            throw new BusinessException(ResultCode.CAMERA_NOT_MOVE);
-        }
-        if(!oldCameraDetail.getType().equals(cameraDetail.getType())){
-            throw new BusinessException(ResultCode.CAMERA_TYPE_NOT_ERROR);
-        }
-
-        Long oldUseSpace = oldCameraDetail.getUsedSpace() - space < 0 ? 0 : oldCameraDetail.getUsedSpace() - space;
-        oldCameraDetail.setUsedSpace(oldUseSpace);
-        Long subSpace =  oldCameraDetail.getTotalSpace() - oldUseSpace;
-
-        if(cameraDetail.getType() != 10 && subSpace >0){    //有剩余容量解封容量内场景
-            this.lockOrUnLockBySpace(oldCameraDetail,oldCameraDetail.getCameraId(),1);
+        JyUser jyUser = jyUserService.getByRyNo(param.getRyNo());
+        if(jyUser == null){
+            throw new BusinessException(ResultCode.USER_NOT_EXIST);
         }
-        cameraDetailService.updateById(oldCameraDetail);
-        cameraDetail.setUsedSpace(newUseSpace);
-        cameraDetailService.updateById(cameraDetail);
-
-
 
-        if(scenePro!=null){
-            LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
-            wrapper.eq(ScenePro::getId,scenePro.getId());
-            wrapper.set(ScenePro::getCameraId,camera.getId());
-            wrapper.set(ScenePro::getUserId,cameraDetail.getUserId());
-            this.update(wrapper);
-            //场景迁移到另外的相机清除本身在的文件夹
-            folderSceneService.delBySceneId(scenePro.getId());
-        }
-        if(scenePlus!=null){
-            LambdaUpdateWrapper<ScenePlus> wrapper = new LambdaUpdateWrapper<>();
-            wrapper.eq(ScenePlus::getId,scenePlus.getId());
-            wrapper.set(ScenePlus::getCameraId,camera.getId());
-            wrapper.set(ScenePlus::getUserId,cameraDetail.getUserId());
-            scenePlusService.update(wrapper);
-            folderSceneService.delBySceneId(scenePlus.getId());
-        }
-        if(cameraDetail.getType() == 10 || cameraDetail.getType() ==11){       //深时场景
-            laserService.move(param.getNum(),oldCamera.getSnCode(),camera.getSnCode());
-        }
+        LambdaUpdateWrapper<ScenePlus> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(ScenePlus::getId,scenePlus.getId());
+        wrapper.set(ScenePlus::getUserId,jyUser.getUserId());
+        scenePlusService.update(wrapper);
 
     }
 

+ 31 - 1
src/main/java/com/fdkankan/manage/util/CaseNumTypeUtil.java

@@ -1,2 +1,32 @@
-package com.fdkankan.manage.util;public class CaseNumTypeUtil {
+package com.fdkankan.manage.util;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class CaseNumTypeUtil {
+
+    //0 四维看看,1看见场景,2 深时场景,3 三维模型,4深时obj ,5深光点云,6深光obj
+    public static Integer getCaseNumType(String num,Integer numType){
+        String numpre = num.split("-")[0];
+        switch (numpre){
+            case "KK" : return 0;
+            case "KJ" : return 1;
+            case "SS" : return numType == 0?2:4;
+            case "SG" : return numType == 0?5:6;
+            default: return null;
+        }
+    }
+    public static Integer getType(Integer numType){
+        if(numType == 2 || numType == 5){
+            return 1;
+        }
+        return 0;
+    }
+
+    public static List<Integer> getNumType(Integer type){
+        if(type == 0){
+            return Arrays.asList(2,5);
+        }
+        return Arrays.asList(0,1,4,6);
+    }
 }

+ 1 - 1
src/main/java/com/fdkankan/manage/util/OBJToGLBUtil.java

@@ -107,7 +107,7 @@ public class OBJToGLBUtil {
                 throw new BusinessException(ResultCode.UPLOAD_FILE_MSG_ERROR.code(),mtlName +".jpg 图片缺失!");
             }
         }
-        updateMtlFile(file);
+       // updateMtlFile(file);
         return true;
     }
 

+ 4 - 4
src/main/java/com/fdkankan/manage/util/ShellUtil.java

@@ -3,10 +3,7 @@ package com.fdkankan.manage.util;
 import com.fdkankan.manage.common.CacheUtil;
 import lombok.extern.slf4j.Slf4j;
 
-import java.io.BufferedReader;
-import java.io.Closeable;
-import java.io.IOException;
-import java.io.InputStreamReader;
+import java.io.*;
 
 @Slf4j
 public class ShellUtil {
@@ -108,6 +105,9 @@ public class ShellUtil {
 
     public static void unZip(String zipPath, String dataPath) {
         log.info("解压zip开始");
+        if(!new File(dataPath).getParentFile().exists()){
+            new File(dataPath).getParentFile().mkdirs();
+        }
         String command = "unzip -O GBK/GB18030CP936 " + zipPath + " -d " + dataPath;
         execCmd(command);
         log.info("解压zip完毕:" + command);

+ 11 - 1
src/main/java/com/fdkankan/manage/vo/request/CaseNumType.java

@@ -1,2 +1,12 @@
-package com.fdkankan.manage.vo.request;public class CaseNumType {
+package com.fdkankan.manage.vo.request;
+
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class CaseNumType {
+    private Integer type;  //0点云,1mesh
+    private List<String> numList = new ArrayList<>();
 }

+ 9 - 0
src/main/java/com/fdkankan/manage/vo/request/CaseParam.java

@@ -2,7 +2,16 @@ package com.fdkankan.manage.vo.request;
 
 import lombok.Data;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
 @Data
 public class CaseParam extends RequestBase{
+
+    private Integer caseId;
     private String caseTitle;
+
+    private List<CaseNumType> caseNumTypeList = new ArrayList<>();
+
 }

+ 3 - 0
src/main/java/com/fdkankan/manage/vo/request/SceneParam.java

@@ -28,4 +28,7 @@ public class SceneParam extends RequestBase {
 
     private List<Long> otherUserIds =  new ArrayList<>();
     private List<Integer>  otherPlatformIds = new ArrayList<>();
+
+    private Integer sceneType = 0;  //0自己场景,1场景共享
+    private Integer caseId;
 }

+ 2 - 0
src/main/java/com/fdkankan/manage/vo/response/DictFileVo.java

@@ -25,4 +25,6 @@ public class DictFileVo extends DictFile {
     private Integer status;
 
     private String unzipPath;
+
+    private String dictName;
 }

+ 2 - 0
src/main/java/com/fdkankan/manage/vo/response/SceneVo.java

@@ -45,4 +45,6 @@ public class SceneVo {
 
     private Boolean isShare = false;
 
+    private Integer sceneSource;
+
 }

+ 4 - 1
src/main/resources/bootstrap-dev.yml

@@ -24,11 +24,14 @@ spring:
             group: DEFAULT_GROUP
             refresh: true
 
-
           - data-id: forest-config.yaml
             group: DEFAULT_GROUP
             refresh: true
 
+          - data-id: common-rabbitmq-config.yaml
+            group: DEFAULT_GROUP
+            refresh: true
+
       discovery:
         server-addr: ${spring.cloud.nacos.config.server-addr}
         namespace: ${spring.cloud.nacos.config.namespace}

+ 4 - 1
src/main/resources/bootstrap-local-kj.yml

@@ -24,11 +24,14 @@ spring:
             group: DEFAULT_GROUP
             refresh: true
 
-
           - data-id: forest-config.yaml
             group: DEFAULT_GROUP
             refresh: true
 
+          - data-id: common-rabbitmq-config.yaml
+            group: DEFAULT_GROUP
+            refresh: true
+
       discovery:
         server-addr: ${spring.cloud.nacos.config.server-addr}
         namespace: ${spring.cloud.nacos.config.namespace}

+ 38 - 37
src/main/resources/mapper/manage/SceneProMapper.xml

@@ -30,7 +30,7 @@
     <select id="pageList" resultType="com.fdkankan.manage.vo.response.SceneVo">
         select s.title as sceneName ,s.num,s.create_time,c.sn_code,e.space as sceneSize
         ,u.user_name,e.view_count,s.scene_status as status,s.pay_status,'v4' as scene_version,e.web_site , e.thumb
-        ,algorithm_time,s.user_id,jy.platform_id
+        ,algorithm_time,s.user_id,jy.platform_id,s.scene_source
         from t_scene_plus s
         left join t_scene_plus_ext e on s.id = e.plus_id
         left join t_user u on s.user_id = u.id
@@ -38,43 +38,40 @@
         left join jy_user jy on u.id = jy.user_id
         where
         <include refid="commonWhere"></include>
+        <if test="param.sceneType == 0">
+            <if test="param.userId!=null">
+                and u.id  = #{param.userId}
+            </if>
+            <if test="param.platformId!=null">
+                and jy.platform_id  = #{param.platformId}
+            </if>
+        </if>
+        <if test="param.sceneType == 1">
+            and ( 1!=1
+            <if test="param.otherPlatformIds != null and param.otherPlatformIds.size >0">
+                or jy.platform_id in
+                <foreach item="platformId" collection="param.otherPlatformIds" open="(" separator="," close=")">
+                    #{platformId}
+                </foreach>
+            </if>
 
-        <if test="param.userId!=null">
-            and u.id  = #{param.userId}
-        </if>
-        <if test="param.platformId!=null">
-            and jy.platform_id  = #{param.platformId}
-        </if>
 
-        <if test="param.otherPlatformIds != null and param.otherPlatformIds.size >0">
-            or (   <include refid="commonWhere"></include>
-            and  jy.platform_id in
-            <foreach item="platformId" collection="param.otherPlatformIds" open="(" separator="," close=")">
-                #{platformId}
-            </foreach>
-            )
-        </if>
+            <if test="param.otherUserIds !=null and param.otherUserIds.size>0">
+                or u.id in
+                <foreach item="userId" collection="param.otherUserIds" open="(" separator="," close=")">
+                    #{userId}
+                </foreach>
+            </if>
 
-        <if test="param.otherUserIds !=null and param.otherUserIds.size>0">
-            or (<include refid="commonWhere"></include>
-            and u.id in
-            <foreach item="userId" collection="param.otherUserIds" open="(" separator="," close=")">
-                #{userId}
-            </foreach>
-            )
+            <if test="param.authNumList !=null and param.authNumList.size>0  ">
+                or s.num in
+                <foreach item="num" collection="param.authNumList" open="(" separator="," close=")">
+                    #{num}
+                </foreach>
+            </if>
+         )
         </if>
 
-        <if test="param.authNumList !=null and param.authNumList.size>0  ">
-            or (
-            <include refid="commonWhere"></include>
-            and s.num in
-            <foreach item="num" collection="param.authNumList" open="(" separator="," close=")">
-                #{num}
-            </foreach>
-            )
-        </if>
-
-
         order by create_time desc
     </select>
 
@@ -83,7 +80,7 @@
         <if test="param.sceneName != null and param.sceneName!='' ">
             and s.title like concat ('%',#{param.sceneName},'%')
         </if>
-        <if test="param.type == 5 or param.type ==7">
+        <if test="param.type != null and (param.type == 5 or param.type ==7)">
             and e.is_obj = 1
         </if>
 
@@ -96,16 +93,20 @@
         <if test="param.userName != null and param.userName !='' ">
             and u.user_name like concat ('%',#{param.userName},'%')
         </if>
-        <if test="param.type !=null and param.type == 0">
+        <if test="param.type !=null and param.type == 0 ">
             and s.scene_source in (1,2,12,13,14)
         </if>
+        <if test="param.type !=null and param.type == 8 ">
+            and s.scene_source = 1
+            and s.three_cam_type = 'yzl'
+        </if>
         <if test="param.type !=null and param.type == 1">
             and s.scene_source = 3
         </if>
-        <if test="param.type == 2 or param.type ==5">
+        <if test="param.type != null and (param.type == 2 or param.type ==5)">
             and s.scene_source = 4
         </if>
-        <if test="param.type == 6 or param.type ==7">
+        <if test="param.type != null and (param.type == 6 or param.type ==7)">
             and s.scene_source = 5
         </if>
     </sql>