|
@@ -213,7 +213,8 @@ public class SceneListener {
|
|
|
scenePanoService.updateById(scenePanoEntity);
|
|
|
}
|
|
|
|
|
|
- String visionUrl = domain4dKK+"/oss/scene_view_data/"+param.getSceneCode()+"/images/vision.txt";
|
|
|
+ String visionUrl = domain4dKK+"/scene_view_data/"+param.getSceneCode()+"/images/vision.txt";
|
|
|
+
|
|
|
HttpResponse execute = HttpRequest.get(visionUrl+"?m="+System.currentTimeMillis()).execute();
|
|
|
JSONArray sweepLocations = new JSONArray();
|
|
|
if (execute.getStatus()==200){
|
|
@@ -349,23 +350,16 @@ public class SceneListener {
|
|
|
private void updateOssStatusJson(String sceneCode, int status) throws IOException {
|
|
|
//修改OSS,status状态 scene_view_data/场景码/data/status.json
|
|
|
String statusJson = "scene_view_data/"+sceneCode+"/data/status.json";
|
|
|
- String statusJsonUrl =domain4dKK+"/oss/"+statusJson;
|
|
|
- HttpResponse execute = HttpRequest.get(statusJsonUrl+"?m="+System.currentTimeMillis()).execute();
|
|
|
- if (execute.getStatus()==200){
|
|
|
- log.info("statusJson存在: {}");
|
|
|
- JSONObject statusJsonObj = JSONObject.parseObject(execute.body());
|
|
|
- statusJsonObj.put("status",status);
|
|
|
-// fileAndOssUtil.upload("4dkankan",statusJsonObj.toJSONString().getBytes(StandardCharsets.UTF_8), statusJson);
|
|
|
-
|
|
|
- File tempDir = Files.createTempDirectory("temp").toFile();
|
|
|
- tempDir.deleteOnExit(); // 设置临时文件夹在JVM退出时删除
|
|
|
- // 在临时文件夹中创建一个临时文件
|
|
|
- File tempFile = File.createTempFile("temp", ".json", tempDir);
|
|
|
- tempFile.deleteOnExit(); // 设置临时文件在JVM退出时删除
|
|
|
- FileWriter writer = new FileWriter(tempFile);
|
|
|
- writer.write(statusJsonObj.toJSONString());
|
|
|
- fileAndOssUtil.uploadBySh(tempFile.getAbsolutePath(), statusJson,"4dkankan","local");
|
|
|
- tempFile.delete();
|
|
|
+ Boolean exist=fileAndOssUtil.existKey("4dkankan",statusJson);
|
|
|
+ if (exist){
|
|
|
+ String statusJsonUrl = domain4dKK+"/"+statusJson;
|
|
|
+ HttpResponse execute = HttpRequest.get(statusJsonUrl+"?m="+System.currentTimeMillis()).execute();
|
|
|
+ if (execute.getStatus()==200){
|
|
|
+ log.info("statusJson存在: {}");
|
|
|
+ JSONObject statusJsonObj = JSONObject.parseObject(execute.body());
|
|
|
+ statusJsonObj.put("status",status);
|
|
|
+ fileAndOssUtil.upload("4dkankan",statusJsonObj.toJSONString().getBytes(StandardCharsets.UTF_8), statusJson);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -426,7 +420,8 @@ public class SceneListener {
|
|
|
sceneCode = RandomUtils.getSceneCode("fd720_");
|
|
|
newName = sceneCode + ".jpg";
|
|
|
filePath = configConstant.serverBasePath + sceneCode+ "/" + newName;
|
|
|
- fileAndOssUtil.downloadBySh(item, filePath,"4dkankan","local");
|
|
|
+ fileAndOssUtil.downloadFile("4dkankan",item,filePath );
|
|
|
+
|
|
|
entity = new ScenePanoEntity();
|
|
|
entity.setFilePath(filePath);
|
|
|
entity.setFileName(FileUtil.getName(filePath));
|