Ver código fonte

增加相机自动入库逻辑

dengsixing 9 meses atrás
pai
commit
ce6c3939f1

+ 11 - 8
src/main/java/com/fdkankan/contro/service/impl/SceneFileBuildServiceImpl.java

@@ -2356,11 +2356,16 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         String[] uuidArr = uuid.split("_");
 
         String snCode = uuidArr[0];
-        //获取fileId
-        String fileId = this.getFileId(snCode, uuid);
-        StringBuilder prefixBuffer = new StringBuilder(snCode).append(File.separator).append(fileId).append(File.separator).append(uuid).append(File.separator);
 
-        String buildType = "V2";
+        JSONObject fdageData = JSONObject.parseObject(FileUtils.readFile(sendCallAlgorithmPath.concat(uuid).concat("/data.fdage")));
+        int camType = fdageData.getJSONObject("cam").getIntValue("type");
+        String cameraInStoreUrl = fdServiceUrl + "/service/manage/inner/cameraInStore";
+        Map<String, Object> cameraInStoreParams = new HashMap<>();
+        cameraInStoreParams.put("cameraType", camType);
+        cameraInStoreParams.put("snCode", snCode);
+        ResultData post = myClient.post(cameraInStoreUrl, cameraInStoreParams);
+        log.info("---------cameraInStore result:{}-----------", post);
+
         Long cameraType = 13L;//默认为看见相机
 
         Camera camera = cameraService.getBySnCode(snCode);
@@ -2371,7 +2376,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         if(Objects.isNull(cameraDetail)){
             throw new BusinessException(ErrorCode.CAMERA_BIND_NO_EXIST.code(), "相机未入库");
         }
-        Integer camType = cameraDetail.getType();
+        camType = cameraDetail.getType();
         if(camType == 10 || camType == 11){//深时或者深光
             cameraType = 14L;
         }else if(camType == 9){
@@ -2380,12 +2385,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             cameraType = 10L;
         }
 
-//        String fileId = getFileIdByFolderName(uuid);
+        String fileId = this.getFileId(snCode, uuid);
         String subFolder = snCode.concat(File.separator).concat(fileId).concat(File.separator).concat(uuid);
         String dataSource = ConstantFilePath.BUILD_MODEL_PATH.concat(subFolder);
         log.info("dataSource 为:{}", dataSource);
 
-
         JSONObject configJson = JSONObject.parseObject(FileUtils.readFile(sendCallAlgorithmPath.concat(uuid).concat("/config.json")));
         String folderName = configJson.getString("id");
         String customUserId = configJson.getString("customUserId");
@@ -2421,7 +2425,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             sceneNum = scene3dNumService.generateSceneNum(cameraDetail.getType());
         }
 
-        JSONObject fdageData = JSONObject.parseObject(FileUtils.readFile(sendCallAlgorithmPath.concat(uuid).concat("/data.fdage")));
 //        String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
 //        if(fdageData.containsKey("icon") && StringUtils.isNotEmpty(fdageData.getString("icon"))){
 //            String ossPath = ConstantFilePath.OSS_PREFIX + dataSource.replace(ConstantFilePath.BUILD_MODEL_PATH, "")