dengsixing 5 månader sedan
förälder
incheckning
bb08d9db5b

+ 1 - 1
src/main/java/com/fdkankan/contro/controller/SceneFileController.java

@@ -71,7 +71,7 @@ public class SceneFileController{
      */
     @PostMapping("uploadSuccessBuild")
     public ResultData uploadSuccessBuild(String params) throws Exception {
-        return sceneFileBuildService.uploadSuccessBuild(params);
+        return sceneFileBuildService.uploadSuccessBuild(params, null, null);
     }
 
     /**

+ 1 - 1
src/main/java/com/fdkankan/contro/service/ISceneFileBuildService.java

@@ -24,7 +24,7 @@ public interface ISceneFileBuildService extends IService<SceneFileBuild> {
 
     ResponseSceneFile preUpload(String params) throws Exception;
 
-    ResultData uploadSuccessBuild(String params) throws Exception;
+    ResultData uploadSuccessBuild(String params, String taskId, String kNo) throws Exception;
 
     ResultData turntableUploadSuccess(String params, String taskId, String kNo) throws Exception;
 

+ 9 - 3
src/main/java/com/fdkankan/contro/service/impl/GzZcdjzxServiceImpl.java

@@ -113,8 +113,9 @@ public class GzZcdjzxServiceImpl implements GzZcdjzxService {
                 String realDataSource =  ConstantFilePath.BUILD_MODEL_PATH + snCode + "/" + fileId + "/" + unicode;
                 String realOssHomePath = SceneUtil.getHomePath(realDataSource);
                 String realOssHomeAbsolutePath = LocalConstants.BASE_PATH + fYunFileConfig.getBucket() + "/" + realOssHomePath;
-                FileUtil.listFileNames(zipDir).stream().forEach(fileName -> {
-                    FileUtil.copy(zipDir + "/" + fileName, realOssHomeAbsolutePath + "/" + fileName, true);
+                FileUtil.loopFiles(zipDir).stream().forEach(file -> {
+//                    FileUtil.copy(zipDir + "/" + fileName, realOssHomeAbsolutePath + "/" + fileName, true);
+                    FileUtil.copy(file.getAbsolutePath(),  file.getAbsolutePath().replace(zipDir, realOssHomeAbsolutePath), true);
                 });
 
 
@@ -126,7 +127,12 @@ public class GzZcdjzxServiceImpl implements GzZcdjzxService {
 
                 Integer code = null;
                 try {
-                    ResultData resultData = sceneFileBuildService.turntableUploadSuccess(params, taskId, kNo);
+                    ResultData resultData = null;
+                    if(camType == 5){//圆周率
+                         resultData = sceneFileBuildService.uploadSuccessBuild(params, taskId, kNo);
+                    }else{
+                         resultData = sceneFileBuildService.turntableUploadSuccess(params, taskId, kNo);
+                    }
                     code = resultData.getCode();
                 }catch (BusinessException e){
                     code = e.getCode();

+ 22 - 1
src/main/java/com/fdkankan/contro/service/impl/SceneFileBuildServiceImpl.java

@@ -630,7 +630,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
     }
 
     @Override
-    public ResultData uploadSuccessBuild(String params) throws Exception {
+    public ResultData uploadSuccessBuild(String params, String taskId, String kNo) throws Exception {
         log.info("uploadSuccessBuild-params: " + params);
         String preParams = params;
         if (StringUtils.isEmpty(params)) {
@@ -683,8 +683,29 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             }
         }
 
+        int camType = fdageJson.getJSONObject("cam").getIntValue("type");
+        if(camType == 5){
+            cameraType = 6L;//圆周率
+        }
+
+        fdageJson.put("taskId", taskId);
+        fdageJson.put("kNo", kNo);
+
         this.removeUpdateV4(ConstantFilePath.OSS_PREFIX + prefixBuffer + "data.fdage", fdageJson);
 
+        //调用接口入库
+        Map<String, Object> signPlayload = new HashMap<>();
+        signPlayload.put("appId", "ucenter");
+        signPlayload.put("timestamp", Calendar.getInstance().getTimeInMillis());
+        String sign = RsaUtils.encipher(JSON.toJSONString(signPlayload), RsaUtils.publicKey);
+        JSONObject cameraInStoreParams = new JSONObject();
+        cameraInStoreParams.put("cameraType", camType);
+        cameraInStoreParams.put("snCode", mac);
+        ResultData resultData = httpClient.postJson("http://127.0.0.1:8081/ucenter/_inner/cameraInStore", sign, cameraInStoreParams);
+        Object data = resultData.getData();
+        Long cameraId = ((JSONObject)data).getLong("id");
+        log.info("自动入库,cameraId:{}", cameraId);
+
         // 判断是否是V3的场景
         ScenePro scenePro = sceneProService.getOne(
             new LambdaQueryWrapper<ScenePro>().like(ScenePro::getDataSource, "/".concat(fileId).concat("/")));