|
@@ -136,11 +136,12 @@ public class RunBuild {
|
|
|
|
|
|
//调用pro之前等待一秒,需要清理缓存
|
|
//调用pro之前等待一秒,需要清理缓存
|
|
Thread.sleep(1000L);
|
|
Thread.sleep(1000L);
|
|
|
|
+ log.info("vrnum是-{}", vrNum);
|
|
while (true){
|
|
while (true){
|
|
String buildResult = OkHttpUtils.httpPostJson(buildUrl + "pro", jsonObject.toJSONString());
|
|
String buildResult = OkHttpUtils.httpPostJson(buildUrl + "pro", jsonObject.toJSONString());
|
|
JSONObject buildJson = JSONObject.parseObject(buildResult);
|
|
JSONObject buildJson = JSONObject.parseObject(buildResult);
|
|
|
|
|
|
- log.info("请求3d场景渲染接口获取接口数据-{}", buildJson);
|
|
|
|
|
|
+ log.info("vrNum-{}, 请求3d场景渲染接口获取接口数据-{}", vrNum, buildJson);
|
|
|
|
|
|
if("isBusy".equals(buildJson.getString("msg"))){
|
|
if("isBusy".equals(buildJson.getString("msg"))){
|
|
Thread.sleep(2000L);
|
|
Thread.sleep(2000L);
|
|
@@ -171,7 +172,7 @@ public class RunBuild {
|
|
String checkResult = OkHttpUtils.httpPostJson(buildUrl + "check", jsonObject.toJSONString());
|
|
String checkResult = OkHttpUtils.httpPostJson(buildUrl + "check", jsonObject.toJSONString());
|
|
JSONObject checkJson = JSONObject.parseObject(checkResult);
|
|
JSONObject checkJson = JSONObject.parseObject(checkResult);
|
|
|
|
|
|
- log.info("请求检查3d场景渲染接口获取接口数据-{}", checkJson);
|
|
|
|
|
|
+ log.info("vrnum-{}, 请求检查3d场景渲染接口获取接口数据-{}", vrNum, checkJson);
|
|
|
|
|
|
JSONArray checkArray = checkJson.getJSONArray("msg");
|
|
JSONArray checkArray = checkJson.getJSONArray("msg");
|
|
|
|
|
|
@@ -184,6 +185,7 @@ public class RunBuild {
|
|
JSONObject objectJson = checkArray.getJSONObject(i);
|
|
JSONObject objectJson = checkArray.getJSONObject(i);
|
|
|
|
|
|
if(uploadObj && objectJson.containsKey("simpleModel") && "done".equals(objectJson.getString("simpleModel"))){
|
|
if(uploadObj && objectJson.containsKey("simpleModel") && "done".equals(objectJson.getString("simpleModel"))){
|
|
|
|
+ log.info("vrnum-{},进入simpleModel方法", vrNum);
|
|
uploadObjData(vrNum, sceneNum);
|
|
uploadObjData(vrNum, sceneNum);
|
|
uploadObj = false;
|
|
uploadObj = false;
|
|
}
|
|
}
|
|
@@ -200,7 +202,7 @@ public class RunBuild {
|
|
|
|
|
|
if(objectJson.containsKey("progress")){
|
|
if(objectJson.containsKey("progress")){
|
|
Integer progress = objectJson.getInteger("progress");
|
|
Integer progress = objectJson.getInteger("progress");
|
|
- log.info("第{}次获取上传进度,进度为{}%", times++, progress);
|
|
|
|
|
|
+ log.info("vrNum-{}, 第{}次获取上传进度,进度为{}%", vrNum, times++, progress);
|
|
updateSceneStyleEntity.setProgress(progress);
|
|
updateSceneStyleEntity.setProgress(progress);
|
|
updateSceneStyleEntity.setUpdateTime(new Date());
|
|
updateSceneStyleEntity.setUpdateTime(new Date());
|
|
sceneStyleService.update(updateSceneStyleEntity);
|
|
sceneStyleService.update(updateSceneStyleEntity);
|
|
@@ -315,7 +317,9 @@ public class RunBuild {
|
|
projectJson.put("status", null);
|
|
projectJson.put("status", null);
|
|
FileUtils.writeFile(path + "/project.json", projectJson.toString());
|
|
FileUtils.writeFile(path + "/project.json", projectJson.toString());
|
|
|
|
|
|
|
|
+ log.info("vrNum-{},计算模型",vrNum);
|
|
CreateObjUtil.build3dModel(path, "");
|
|
CreateObjUtil.build3dModel(path, "");
|
|
|
|
+ log.info("vrNum-{},计算模型完毕",vrNum);
|
|
|
|
|
|
String uploadData = FileUtils.readFile(path + File.separator + "results" +File.separator+"upload.json");
|
|
String uploadData = FileUtils.readFile(path + File.separator + "results" +File.separator+"upload.json");
|
|
JSONObject uploadJson = null;
|
|
JSONObject uploadJson = null;
|
|
@@ -324,6 +328,7 @@ public class RunBuild {
|
|
uploadJson = JSONObject.parseObject(uploadData);
|
|
uploadJson = JSONObject.parseObject(uploadData);
|
|
array = uploadJson.getJSONArray("upload");
|
|
array = uploadJson.getJSONArray("upload");
|
|
}
|
|
}
|
|
|
|
+ log.info("uploadJson-{}", uploadJson);
|
|
if(array == null){
|
|
if(array == null){
|
|
log.error("upload.json数据出错");
|
|
log.error("upload.json数据出错");
|
|
throw new RuntimeException("upload.json数据出错");
|
|
throw new RuntimeException("upload.json数据出错");
|
|
@@ -370,7 +375,9 @@ public class RunBuild {
|
|
FileUtils.downLoadFromUrl("https://4dkk.4dage.com/images/images" + sceneNum + "/vision.modeldata",
|
|
FileUtils.downLoadFromUrl("https://4dkk.4dage.com/images/images" + sceneNum + "/vision.modeldata",
|
|
"vision.modeldata", path);
|
|
"vision.modeldata", path);
|
|
map.put(path + File.separator + "vision.modeldata", "images/images"+vrNum+"/"+"vision.modeldata");
|
|
map.put(path + File.separator + "vision.modeldata", "images/images"+vrNum+"/"+"vision.modeldata");
|
|
|
|
+ log.info("vrNum-{},上传文件",vrNum);
|
|
uploadToOssUtil.uploadMulFiles(map);
|
|
uploadToOssUtil.uploadMulFiles(map);
|
|
|
|
+ log.info("vrNum执行完uploadObjData方法-{}", vrNum);
|
|
}
|
|
}
|
|
|
|
|
|
private void lightBuild(String data){
|
|
private void lightBuild(String data){
|
|
@@ -485,11 +492,6 @@ public class RunBuild {
|
|
for(int i = 0, len = checkArray.size(); i < len; i++){
|
|
for(int i = 0, len = checkArray.size(); i < len; i++){
|
|
JSONObject objectJson = checkArray.getJSONObject(i);
|
|
JSONObject objectJson = checkArray.getJSONObject(i);
|
|
|
|
|
|
-// if(uploadObj && objectJson.containsKey("simpleModel") && "done".equals(objectJson.getString("simpleModel"))){
|
|
|
|
-// uploadObjData(vrNum, sceneNum);
|
|
|
|
-// uploadObj = false;
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
if("error".equals(objectJson.getString("state"))){
|
|
if("error".equals(objectJson.getString("state"))){
|
|
FileUtils.writeFile(buildPath + "Input/" + vrNum + buildType + "/error-check.json", checkJson.toJSONString());
|
|
FileUtils.writeFile(buildPath + "Input/" + vrNum + buildType + "/error-check.json", checkJson.toJSONString());
|
|
throw new RuntimeException(vrNum + ":light方式check接口返回error错误");
|
|
throw new RuntimeException(vrNum + ":light方式check接口返回error错误");
|
|
@@ -517,26 +519,7 @@ public class RunBuild {
|
|
Thread.sleep(500L);
|
|
Thread.sleep(500L);
|
|
}
|
|
}
|
|
|
|
|
|
-// File outFiles = new File(buildPath.replace("Input", "Output") + vrNum + File.separator);
|
|
|
|
log.info("计算完成:" + buildPath + "Output/" + vrNum);
|
|
log.info("计算完成:" + buildPath + "Output/" + vrNum);
|
|
-// for(File outFile : outFiles.listFiles()){
|
|
|
|
-// if(outFile.isDirectory()){
|
|
|
|
-// for(File out : outFile.listFiles()){
|
|
|
|
-// uploadToOssUtil.upload(out.getAbsolutePath(), "images/images" + vrNum + "/tiles/2k/" + out.getName());
|
|
|
|
-// }
|
|
|
|
-// }else {
|
|
|
|
-// uploadToOssUtil.upload(outFile.getAbsolutePath(), "images/images" + vrNum + "/tiles/2k/" + outFile.getName());
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// log.info("oss上传完成");
|
|
|
|
-
|
|
|
|
- //渲染完成,修改风格表和灯光预览相册集
|
|
|
|
-// String finalPath = "https://4dkk.4dage.com/images/images" +
|
|
|
|
-// vrNum + "/tiles/2k/Final.jpg";
|
|
|
|
-// FileUtils.deleteFile(finalPath);
|
|
|
|
-// FileUtils.downLoadFromUrl(finalPath + "?m=" + System.currentTimeMillis(), "Final.jpg", buildPath + vrNum);
|
|
|
|
-
|
|
|
|
|
|
|
|
if("light".equals(buildType)){
|
|
if("light".equals(buildType)){
|
|
updateSceneStyleEntity.setLightStatus(1);
|
|
updateSceneStyleEntity.setLightStatus(1);
|
|
@@ -681,13 +664,6 @@ public class RunBuild {
|
|
uploadToOssUtil.uploadTo4dTjw(filePath + max.replace(".max", "") + file, "domain/eHome/furniture/InitialData/" + modelType + "/" + fileId + "/" + target.getName());
|
|
uploadToOssUtil.uploadTo4dTjw(filePath + max.replace(".max", "") + file, "domain/eHome/furniture/InitialData/" + modelType + "/" + fileId + "/" + target.getName());
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-// allList = new ArrayList<>();
|
|
|
|
-// FileUtils.readfilePath(filePath + fileId, allList);
|
|
|
|
-// for (String targetPath : allList) {
|
|
|
|
-// target = new File(targetPath);
|
|
|
|
-// uploadToOssUtil.uploadTo4dTjw(targetPath, "domain/eHome/furniture/InitialData/" + modelType + "/" + fileId + "/" + target.getName());
|
|
|
|
-// }
|
|
|
|
Thread.sleep(2000L);
|
|
Thread.sleep(2000L);
|
|
|
|
|
|
|
|
|