|
@@ -60,11 +60,6 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
- @Value("${main.url}")
|
|
|
- private String mainUrl;
|
|
|
- @Value("${scene.pro.new.url}")
|
|
|
- private String sceneProNewUrl;
|
|
|
-
|
|
|
@Value("${queue.modeling.modeling-call}")
|
|
|
private String queueModelingCall;
|
|
|
|
|
@@ -73,9 +68,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
@Autowired
|
|
|
private FYunFileServiceInterface fYunFileService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ISceneFileBuildService sceneFileBuildService;
|
|
|
@Autowired
|
|
|
private ICameraDetailService cameraDetailService;
|
|
|
@Autowired
|
|
@@ -101,15 +93,19 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
@Autowired
|
|
|
private IFdkkLaserService fdkkLaserService;
|
|
|
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IBuildSceneDTService buildSceneDTService;
|
|
|
+
|
|
|
@Override
|
|
|
public void buildScenePre(BuildSceneCallMessage message) {
|
|
|
boolean success = false;
|
|
|
try {
|
|
|
//根据相机类型,组装资源路径
|
|
|
- String path = message.getDataSource();
|
|
|
-
|
|
|
//下载资源到本地
|
|
|
- this.downLoadSource(message, path);
|
|
|
+ this.downLoadSource(message, message.getPath());
|
|
|
+
|
|
|
+ message.getBuildContext().put("cameraType",message.getCameraType());
|
|
|
|
|
|
//发送mq,就进行计算
|
|
|
mqProducer.sendByWorkQueue(queueModelingCall, message);
|
|
@@ -123,8 +119,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
}finally {
|
|
|
//如果前置处理失败,发送钉钉消息
|
|
|
if(!success){
|
|
|
- String serverPath = message.getPath().substring(0,message.getPath().lastIndexOf("/")+1).concat(message.getPrefix());
|
|
|
-// buildSceneDTService.handFail("场景计算前置处理出错", serverPath, message.getSceneNum(), BuildScenePreServiceImpl.hostName, null);
|
|
|
+ buildSceneDTService.handFail("场景计算资源准备异常!", message.getPath(), message.getSceneNum(), "计算控制服务器", null);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -144,9 +139,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
@Override
|
|
|
public void buildScenePost(BuildSceneResultMqMessage message) throws Exception {
|
|
|
- Integer cameraType = Integer.parseInt(message.getCameraType());
|
|
|
- String sceneCode = message.getSceneCode();
|
|
|
- String fileId = message.getFileId();
|
|
|
+ Integer cameraType = Integer.parseInt(message.getBuildContext().get("cameraType").toString());
|
|
|
+ String sceneCode = message.getBuildContext().get("sceneNum").toString();
|
|
|
Long computeTime = message.getComputeTime();
|
|
|
|
|
|
String path = message.getPath();
|
|
@@ -154,9 +148,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
Boolean buildSuccess = message.getBuildSuccess();
|
|
|
JSONObject fdageData = getFdageData(path + File.separator + "capture" +File.separator+"data.fdage");
|
|
|
Integer videoVersion = fdageData.getInteger("videoVersion");
|
|
|
-
|
|
|
-
|
|
|
- String prefix = message.getPrefix();
|
|
|
try {
|
|
|
// 上传计算日志
|
|
|
//如果是重复计算,没有走到计算逻辑,不需要上传日志文件
|
|
@@ -170,12 +161,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|
|
|
.set(ScenePlus::getSceneStatus, SceneStatus.FAILD.code())
|
|
|
.eq(ScenePlus::getNum, sceneCode));
|
|
|
-
|
|
|
- SceneFileBuild sceneFileBuild = sceneFileBuildService.findByFileId(fileId);
|
|
|
- if (Objects.nonNull(sceneFileBuild)) {
|
|
|
- sceneFileBuild.setBuildStatus(BuildStatus.fail.code());
|
|
|
- sceneFileBuildService.updateById(sceneFileBuild);
|
|
|
- }
|
|
|
throw new RuntimeException("建模失败!");
|
|
|
}
|
|
|
|
|
@@ -197,7 +182,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
JSONObject videosJson = this.getVideosJson(path, videoVersion, sceneCode, cameraType);
|
|
|
|
|
|
//写入数据库
|
|
|
- ScenePlus scenePlus = this.updateDbPlus(sceneCode, space, videosJson.toJSONString(), computeTime, fileId,fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1);
|
|
|
+ ScenePlus scenePlus = this.updateDbPlus(sceneCode, space, videosJson.toJSONString(), computeTime,fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1);
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
|
|
|
//变更容量,arrearCap为true时,代表容量不足
|
|
@@ -268,7 +253,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
CreateObjUtil.deleteFile(path.replace(ConstantFilePath.BUILD_MODEL_PATH, "/") + "/capture");
|
|
|
|
|
|
- log.info("场景计算结果处理结束,场景码:{}", message.getSceneCode());
|
|
|
+ log.info("场景计算结果处理结束,场景码:{}", sceneCode);
|
|
|
|
|
|
}catch (Exception e){
|
|
|
String errorMsg = "场景计算结果处理出错!";
|
|
@@ -278,8 +263,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
errorMsg = "场景构建失败!";
|
|
|
}
|
|
|
//发送钉钉
|
|
|
- String serverPath = message.getPath().substring(0,message.getPath().lastIndexOf("/")+1).concat(prefix);
|
|
|
-// buildSceneDTService.handFail(errorMsg, serverPath, sceneCode, BuildScenePreServiceImpl.hostName, BuildScenePreServiceImpl.contentExt);
|
|
|
+ String serverPath = message.getPath();
|
|
|
+ buildSceneDTService.handFail(errorMsg, serverPath, sceneCode, message.getHostName(), null);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -646,7 +631,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
.set(ScenePlusExt::getAlgorithmTime, Calendar.getInstance().getTime()));
|
|
|
}
|
|
|
|
|
|
- private ScenePlus updateDbPlus(String num, Long space, String videosJson, Long computeTime, String fileId,boolean isObj){
|
|
|
+ private ScenePlus updateDbPlus(String num, Long space, String videosJson, Long computeTime,boolean isObj){
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
List<ScenePlus> list = scenePlusService.list(new LambdaQueryWrapper<ScenePlus>()
|
|
@@ -664,12 +649,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
.set(ScenePlus::getUpdateTime, new Date())
|
|
|
.set(ScenePlus::getPayStatus, PayStatus.PAY.code()));
|
|
|
|
|
|
- SceneFileBuild sceneFileBuild = sceneFileBuildService.findByFileId(fileId);
|
|
|
- if(sceneFileBuild != null){
|
|
|
- sceneFileBuild.setBuildStatus(BuildStatus.success.code());
|
|
|
- sceneFileBuildService.updateById(sceneFileBuild);
|
|
|
- }
|
|
|
-
|
|
|
scenePlusExt.setSpace(space);
|
|
|
scenePlusExt.setComputeTime(computeTime.toString());
|
|
|
scenePlusExt.setAlgorithmTime(new Date());
|