|
@@ -167,15 +167,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void buildScenePost(BuildSceneResultMqMessage message) throws Exception {
|
|
public void buildScenePost(BuildSceneResultMqMessage message) throws Exception {
|
|
- Integer cameraType = Integer.parseInt(message.getBuildContext().get("cameraType").toString());
|
|
|
|
String sceneCode = message.getBuildContext().get("sceneNum").toString();
|
|
String sceneCode = message.getBuildContext().get("sceneNum").toString();
|
|
- Long computeTime = message.getComputeTime();
|
|
|
|
-
|
|
|
|
String path = message.getPath();
|
|
String path = message.getPath();
|
|
-
|
|
|
|
- Boolean buildSuccess = message.getBuildSuccess();
|
|
|
|
- JSONObject fdageData = getFdageData(path + File.separator + "capture" +File.separator+"data.fdage");
|
|
|
|
- Integer videoVersion = fdageData.getInteger("videoVersion");
|
|
|
|
try {
|
|
try {
|
|
// 上传计算日志
|
|
// 上传计算日志
|
|
//如果是重复计算,没有走到计算逻辑,不需要上传日志文件
|
|
//如果是重复计算,没有走到计算逻辑,不需要上传日志文件
|
|
@@ -184,7 +177,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
fYunFileService.uploadFile(path + File.separator + "console.log", buildLogPath + "console.log");
|
|
fYunFileService.uploadFile(path + File.separator + "console.log", buildLogPath + "console.log");
|
|
log.info("计算日志上传完成");
|
|
log.info("计算日志上传完成");
|
|
|
|
|
|
- if (!buildSuccess) {
|
|
|
|
|
|
+ if (!message.getBuildSuccess()) {
|
|
log.error("建模失败,修改状态为失败状态");
|
|
log.error("建模失败,修改状态为失败状态");
|
|
scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|
|
scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|
|
.set(ScenePlus::getSceneStatus, SceneStatus.FAILD.code())
|
|
.set(ScenePlus::getSceneStatus, SceneStatus.FAILD.code())
|
|
@@ -194,36 +187,33 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
buildSceneDTService.handModelFail("计算失败", message.getPath(), sceneCode, message.getHostName());
|
|
buildSceneDTService.handModelFail("计算失败", message.getPath(), sceneCode, message.getHostName());
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ JSONObject fdageData = getFdageData(path + File.separator + "capture" +File.separator+"data.fdage");
|
|
|
|
|
|
|
|
+ Integer cameraType = Integer.parseInt(message.getBuildContext().get("cameraType").toString());
|
|
Map<String, String> uploadFiles = getUploadFiles(path,cameraType,fdageData);
|
|
Map<String, String> uploadFiles = getUploadFiles(path,cameraType,fdageData);
|
|
|
|
|
|
- //建模成功走以下逻辑
|
|
|
|
- log.info("cameraType:{}",cameraType);
|
|
|
|
-
|
|
|
|
//计算场景消耗磁盘空间
|
|
//计算场景消耗磁盘空间
|
|
long space = this.calUseSpace(uploadFiles);
|
|
long space = this.calUseSpace(uploadFiles);
|
|
|
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneCode);
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneCode);
|
|
-
|
|
|
|
- int payStatus = PayStatus.PAY.code();
|
|
|
|
|
|
+ scenePlus.setPayStatus(PayStatus.PAY.code());
|
|
//如果相机容量不足,需要把场景的paystatus改为容量不足状态
|
|
//如果相机容量不足,需要把场景的paystatus改为容量不足状态
|
|
if (cameraType != 14) {
|
|
if (cameraType != 14) {
|
|
- payStatus = this.getPayStatus(scenePlus.getCameraId(), space);
|
|
|
|
|
|
+ scenePlus.setPayStatus(this.getPayStatus(scenePlus.getCameraId(), space));
|
|
}
|
|
}
|
|
-
|
|
|
|
- //读取计算结果文件生成videosJson
|
|
|
|
- JSONObject videosJson = this.getVideosJson(path, videoVersion, sceneCode, cameraType);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- scenePlus.setPayStatus(payStatus);
|
|
|
|
scenePlus.setUpdateTime(new Date());
|
|
scenePlus.setUpdateTime(new Date());
|
|
scenePlus.setSceneStatus(SceneStatus.NO_DISPLAY.code());
|
|
scenePlus.setSceneStatus(SceneStatus.NO_DISPLAY.code());
|
|
scenePlusService.updateById(scenePlus);
|
|
scenePlusService.updateById(scenePlus);
|
|
|
|
|
|
|
|
+
|
|
|
|
+ Integer videoVersion = fdageData.getInteger("videoVersion");
|
|
|
|
+ //读取计算结果文件生成videosJson
|
|
|
|
+ JSONObject videosJson = this.getVideosJson(path, videoVersion, sceneCode, cameraType);
|
|
|
|
+
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
boolean isObj = fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1;
|
|
boolean isObj = fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1;
|
|
//写入数据库
|
|
//写入数据库
|
|
- this.updateDbPlus(scenePlus.getSceneSource(), space, videosJson.toJSONString(), computeTime,isObj,scenePlusExt);
|
|
|
|
|
|
+ this.updateDbPlus(scenePlus.getSceneSource(), space, videosJson.toJSONString(), message.getComputeTime(),isObj,scenePlusExt);
|
|
|
|
|
|
Object[] editInfoArr = this.updateEditInfo(scenePlus);
|
|
Object[] editInfoArr = this.updateEditInfo(scenePlus);
|
|
SceneEditInfo sceneEditInfo = (SceneEditInfo)editInfoArr[0];
|
|
SceneEditInfo sceneEditInfo = (SceneEditInfo)editInfoArr[0];
|