Selaa lähdekoodia

生成obj拦截复制场景生成obj

lyhzzz 1 vuosi sitten
vanhempi
commit
68dedaf928

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

@@ -76,6 +76,7 @@ public enum ResultCode  {
     DATA_TOO_LONG(60009, "长度超过限制"),
     API_AUTH_DEL_ERROR(60010, "api添加权限,不可删除"),
     SS_SCENE_DOWN_ERROR(60011, "深时点云场景下载失败"),
+    COPY_NUM_NOT_GEN_OBJ(60012, "复制场景不支持生成 Obj"),
 
 
     ;

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

@@ -48,6 +48,8 @@ public class SceneController {
     ISysUserService sysUserService;
    @Autowired
    IJyUserService jyUserService;
+   @Autowired
+   ISceneCopyLogService sceneCopyLogService;
 
     @PostMapping("/list")
     public ResultData list(@RequestBody SceneParam param){
@@ -180,6 +182,12 @@ public class SceneController {
         if(param.getId() == null){
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
+        if(StringUtils.isNotBlank(param.getSceneNum())){
+            List<SceneCopyLog> byNewNum = sceneCopyLogService.getByNewNum(param.getSceneNum());
+            if(byNewNum!=null && !byNewNum.isEmpty()){
+                throw new BusinessException(ResultCode.COPY_NUM_NOT_GEN_OBJ);
+            }
+        }
         FdkkResponse fdkkResponse = laserClient.buildSceneObj(param, StpUtil.getTokenValue());
         if(fdkkResponse.getCode() != 200){
             throw new BusinessException(fdkkResponse.getCode(),fdkkResponse.getMsg());

+ 2 - 0
src/main/java/com/fdkankan/manage/httpClient/param/LaserSceneParam.java

@@ -20,4 +20,6 @@ public class LaserSceneParam {
     private List<Long> otherUserIds;
 
     private Integer id;
+
+    private String sceneNum;
 }

+ 2 - 0
src/main/java/com/fdkankan/manage/service/ISceneCopyLogService.java

@@ -21,4 +21,6 @@ public interface ISceneCopyLogService extends IService<SceneCopyLog> {
     void saveByNum(String oldNum, String newNum, Long userId);
 
     HashMap<String, SceneCopyLog> getByNewNumList(List<String> numList);
+
+    List<SceneCopyLog> getByNewNum(String sceneNum);
 }

+ 7 - 0
src/main/java/com/fdkankan/manage/service/impl/SceneCopyLogServiceImpl.java

@@ -48,4 +48,11 @@ public class SceneCopyLogServiceImpl extends ServiceImpl<ISceneCopyLogMapper, Sc
         }
         return map;
     }
+
+    @Override
+    public List<SceneCopyLog> getByNewNum(String sceneNum) {
+        LambdaQueryWrapper<SceneCopyLog> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(SceneCopyLog::getNewNum,sceneNum);
+        return this.list(wrapper);
+    }
 }