Browse Source

增加文件配置

zhujinghui 4 years ago
parent
commit
92665a8e61

+ 14 - 8
src/main/java/com/example/demo/listener/RunBuild.java

@@ -2,10 +2,8 @@ package com.example.demo.listener;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.example.demo.constant.CodeConstant;
 import com.example.demo.constant.ConstantFileName;
 import com.example.demo.constant.ConstantFilePath;
-import com.example.demo.constant.Variable;
 import com.example.demo.entity.ModelUploadEntity;
 import com.example.demo.entity.SceneLightEntity;
 import com.example.demo.entity.SceneStyleEntity;
@@ -23,7 +21,6 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 import tk.mybatis.mapper.entity.Condition;
 
-import javax.annotation.PostConstruct;
 import java.io.File;
 import java.util.*;
 
@@ -143,6 +140,8 @@ public class RunBuild {
                 String buildResult = OkHttpUtils.httpPostJson(buildUrl + "pro", jsonObject.toJSONString());
                 JSONObject buildJson = JSONObject.parseObject(buildResult);
 
+                log.info("请求3d场景渲染接口获取接口数据-{}", buildJson);
+
                 if("isBusy".equals(buildJson.getString("msg"))){
                     Thread.sleep(2000L);
                     continue;
@@ -167,10 +166,13 @@ public class RunBuild {
             jsonObject = new JSONObject();
             jsonObject.put("name", vrNum);
             jsonObject.put("taskType", "all");
+            int times = 0;
             while (true){
                 String checkResult = OkHttpUtils.httpPostJson(buildUrl + "check", jsonObject.toJSONString());
                 JSONObject checkJson = JSONObject.parseObject(checkResult);
 
+                log.info("请求检查3d场景渲染接口获取接口数据-{}", checkJson);
+
                 JSONArray checkArray = checkJson.getJSONArray("msg");
 
                 if(checkArray.size() == 0){
@@ -197,7 +199,9 @@ public class RunBuild {
                     }
 
                     if(objectJson.containsKey("progress")){
-                        updateSceneStyleEntity.setProgress(objectJson.getInteger("progress"));
+                        Integer progress = objectJson.getInteger("progress");
+                        log.info("第{}次获取上传进度,进度为{}%", times++, progress);
+                        updateSceneStyleEntity.setProgress(progress);
                         updateSceneStyleEntity.setUpdateTime(new Date());
                         sceneStyleService.update(updateSceneStyleEntity);
                     }
@@ -268,9 +272,9 @@ public class RunBuild {
                 HttpRequestorUtil.doPost(mainUrl + "api/scene/updateStatusByScene", map1);
                 log.info("计算失败--修改场景状态完成");
             }catch (Exception ex){
-                ex.printStackTrace();
+                log.error("渲染失败-{}", e);
             }
-            e.printStackTrace();
+            log.error("渲染失败-{}", e);
         }
     }
 
@@ -464,6 +468,7 @@ public class RunBuild {
                         jsonObject.put("taskType", buildType);
                         jsonObject.put("taskId", taskId);
                         jsonObject.put("ratio", ratio);
+                        int times = 0;
                         while (true){
                             String checkResult = OkHttpUtils.httpPostJson(lightBuildUrl + "check", jsonObject.toJSONString());
                             JSONObject checkJson = JSONObject.parseObject(checkResult);
@@ -496,9 +501,11 @@ public class RunBuild {
                                 }
 
                                 if(objectJson.containsKey("progress")){
+                                    Integer progress = objectJson.getInteger("progress");
+                                    log.info("第{}次获取上传进度,进度为{}%", times++, progress);
                                     SceneLightEntity sceneLightEntity = new SceneLightEntity();
                                     sceneLightEntity.setId(Long.valueOf(taskId));
-                                    sceneLightEntity.setProgress(objectJson.getInteger("progress"));
+                                    sceneLightEntity.setProgress(progress);
                                     sceneLightService.update(sceneLightEntity);
                                 }
                             }
@@ -574,7 +581,6 @@ public class RunBuild {
                 uploadToOssUtil.download("images/images" + vrNum + "/tiles/pano/" + taskId +"/pano_sphere.jpg", panoPath + "/pano_sphere.jpg");
                 CreateObjUtil.panoCutaway(panoPath + "/pano_sphere.jpg");
 
-
                 if(new File(panoPath + "/vtour").exists()){
                     CreateObjUtil.ossUploadCommon(panoPath + "/vtour", "4dkankan/images/images" + vrNum + "/tiles/pano/" + taskId + "/vtour");
                     sceneLightEntity.setFilePath("https://4dkk.4dage.com/images/images" + vrNum + "/tiles/pano/" + taskId + "/vtour/tour.html");

+ 1 - 1
src/main/java/com/example/demo/util/ConvertCadKjl.java

@@ -667,7 +667,7 @@ public class ConvertCadKjl {
 //		System.out.println("bottom:" + map.get("translationAverage"));
 //		System.out.println("top:" + map.get("puckAverage"));
 		ConvertCadKjl cad = new ConvertCadKjl();
-		String data = FileUtils.readFile("F:\\文档\\WeChat Files\\Iove-bing\\FileStorage\\File\\2021-01\\test.json");
+		String data = FileUtils.readFile("D:\\floor.json");
 		JSONObject inputJson = null;
 		JSONArray inputArray = null;
 		Map<String, Double> map = null;

+ 2 - 2
src/main/resources/application-prod.properties

@@ -18,8 +18,8 @@ spring.datasource.driverClassName=com.mysql.jdbc.Driver
 #rabbitmq
 spring.rabbitmq.host=127.0.0.1
 spring.rabbitmq.port=5672
-spring.rabbitmq.username=mq
-spring.rabbitmq.password=mq123
+spring.rabbitmq.username=guest
+spring.rabbitmq.password=guest
 
 logging.level.com.example=debug