|
@@ -106,7 +106,6 @@ public class RabbitMqListener {
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
@RabbitListener(
|
|
@RabbitListener(
|
|
- //queuesToDeclare = @Queue("${queue.modeling.modeling-call}"),
|
|
|
|
queuesToDeclare = @Queue("#{queueNameService.getQueueName()}"),
|
|
queuesToDeclare = @Queue("#{queueNameService.getQueueName()}"),
|
|
concurrency = "${maxThread.modeling.modeling-call}",
|
|
concurrency = "${maxThread.modeling.modeling-call}",
|
|
priority = "${mq.consumerPriority}"
|
|
priority = "${mq.consumerPriority}"
|
|
@@ -177,8 +176,6 @@ public class RabbitMqListener {
|
|
StopWatch watch = new StopWatch();
|
|
StopWatch watch = new StopWatch();
|
|
watch.start();
|
|
watch.start();
|
|
|
|
|
|
- String num = message.getSceneNum();
|
|
|
|
-
|
|
|
|
//发送记录计算状态为计算中
|
|
//发送记录计算状态为计算中
|
|
this.sendCallBuildProcessLog(message, ModelingBuildStatus.CALCULATING);
|
|
this.sendCallBuildProcessLog(message, ModelingBuildStatus.CALCULATING);
|
|
|
|
|
|
@@ -248,68 +245,17 @@ public class RabbitMqListener {
|
|
String num = message.getSceneNum();
|
|
String num = message.getSceneNum();
|
|
//不同的相机不同的方法
|
|
//不同的相机不同的方法
|
|
String cameraType = message.getCameraType();
|
|
String cameraType = message.getCameraType();
|
|
- String algorithm = message.getAlgorithm();
|
|
|
|
- //0表示有4k图,1表示没有
|
|
|
|
- String resolution = message.getResolution();
|
|
|
|
//判断调用V2还是V3版本的算法
|
|
//判断调用V2还是V3版本的算法
|
|
String buildType = ObjectUtils.isEmpty(message.getBuildType()) ? "V2" : message.getBuildType();
|
|
String buildType = ObjectUtils.isEmpty(message.getBuildType()) ? "V2" : message.getBuildType();
|
|
|
|
+ if(StrUtil.isEmpty(buildType)){
|
|
|
|
+ buildType = "V3";
|
|
|
|
+ }
|
|
|
|
|
|
buildSceneResult.setCameraType(cameraType);
|
|
buildSceneResult.setCameraType(cameraType);
|
|
buildSceneResult.setNum(num);
|
|
buildSceneResult.setNum(num);
|
|
buildSceneResult.setPath(path);
|
|
buildSceneResult.setPath(path);
|
|
|
|
|
|
- log.info("用的算法是:" + algorithm);
|
|
|
|
-
|
|
|
|
- String dataFdagePath = path + File.separator + "capture" +File.separator+"data.fdage";
|
|
|
|
- log.info("dataFdagePath 文件路径 :{}", dataFdagePath);
|
|
|
|
- String data = FileUtils.readFile(dataFdagePath);
|
|
|
|
- //获取data.fdage的内容
|
|
|
|
- JSONObject dataJson = new JSONObject();
|
|
|
|
- if(data!=null){
|
|
|
|
- dataJson = JSONObject.parseObject(data);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (dataJson.containsKey("OnlyExportMeshObj")) {
|
|
|
|
- logRecord.setBuildType(2);
|
|
|
|
- Map<String, String> context = new HashMap<>();
|
|
|
|
- context.put("path", path);
|
|
|
|
- context.put("cameraType", cameraType);
|
|
|
|
- context.put("algorithm", algorithm);
|
|
|
|
- context.put("resolution", resolution);
|
|
|
|
- context.put("projectNum", num);
|
|
|
|
- context.put("dataJson", data);
|
|
|
|
- try {
|
|
|
|
- laserSceneObjGenerateHandler.handle(context);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 检测计算结果文件是否有生成
|
|
|
|
- String resultsPath = path + File.separator + "results" + File.separator;
|
|
|
|
- if (!new File(resultsPath + "upload.json").exists()) {
|
|
|
|
- log.error("未检测到计算结果文件:upload.json");
|
|
|
|
- result.put("status", ModelingBuildStatus.FAILED);
|
|
|
|
- result.put("errorType", 2);
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- result.put("status", ModelingBuildStatus.SUCCESS);
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Map<String, String> dataMap = buildService.getTypeString(cameraType, algorithm, resolution,dataJson);
|
|
|
|
-
|
|
|
|
- String splitType = dataMap.get("splitType");
|
|
|
|
- String skyboxType = dataMap.get("skyboxType");
|
|
|
|
- if(Objects.nonNull(message.getExt().get("splitType"))){
|
|
|
|
- splitType = (String) message.getExt().get("splitType");
|
|
|
|
- }
|
|
|
|
- if(Objects.nonNull(message.getExt().get("skyboxType"))){
|
|
|
|
- skyboxType = (String) message.getExt().get("skyboxType");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- ComputerUtil.createProjectAndDataFile(path,num, splitType, skyboxType,null,null);
|
|
|
|
- //计算模型并返回需要上传oss的文件集合
|
|
|
|
|
|
+ //调用算法
|
|
ComputerUtil.computer(num, path, buildType);
|
|
ComputerUtil.computer(num, path, buildType);
|
|
|
|
|
|
// 检测计算结果文件是否有生成
|
|
// 检测计算结果文件是否有生成
|
|
@@ -358,10 +304,6 @@ public class RabbitMqListener {
|
|
buildSceneResult.setNum(num);
|
|
buildSceneResult.setNum(num);
|
|
buildSceneResult.setPath(path);
|
|
buildSceneResult.setPath(path);
|
|
|
|
|
|
- String splitType = "SPLIT_V27";
|
|
|
|
- String skyboxType = "SKYBOX_V5";
|
|
|
|
-
|
|
|
|
- ComputerUtil.createProjectAndDataFile(path,num, splitType, skyboxType,null,null);
|
|
|
|
//计算模型并返回需要上传oss的文件集合
|
|
//计算模型并返回需要上传oss的文件集合
|
|
ComputerUtil.computer(num, path, "V3");
|
|
ComputerUtil.computer(num, path, "V3");
|
|
|
|
|