|
@@ -86,6 +86,8 @@ public class BuildReverseE57SceneServiceImpl implements IBuildSceneService {
|
|
private IFdkkLaserService fdkkLaserService;
|
|
private IFdkkLaserService fdkkLaserService;
|
|
@Autowired
|
|
@Autowired
|
|
private ISceneEditControlsService sceneEditControlsService;
|
|
private ISceneEditControlsService sceneEditControlsService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IBuildService buildService;
|
|
|
|
|
|
@Value("${main.url}")
|
|
@Value("${main.url}")
|
|
private String mainUrl;
|
|
private String mainUrl;
|
|
@@ -93,7 +95,6 @@ public class BuildReverseE57SceneServiceImpl implements IBuildSceneService {
|
|
public void buildScenePre(BuildSceneCallMessage message) throws Exception{
|
|
public void buildScenePre(BuildSceneCallMessage message) throws Exception{
|
|
String num = message.getSceneNum();
|
|
String num = message.getSceneNum();
|
|
Integer rebuild = (Integer)message.getExt().get("rebuild");
|
|
Integer rebuild = (Integer)message.getExt().get("rebuild");
|
|
- Boolean deleteExtras = (Boolean)message.getExt().get("deleteExtras");
|
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
try {
|
|
try {
|
|
@@ -101,16 +102,12 @@ public class BuildReverseE57SceneServiceImpl implements IBuildSceneService {
|
|
String homePath = SceneUtil.getHomePath(dataSource);
|
|
String homePath = SceneUtil.getHomePath(dataSource);
|
|
message.setPath(dataSource);
|
|
message.setPath(dataSource);
|
|
String homeKey = homePath + "input.e57";
|
|
String homeKey = homePath + "input.e57";
|
|
- String key = null;
|
|
|
|
if(Objects.isNull(rebuild) || rebuild == CommonStatus.NO.code().intValue()){
|
|
if(Objects.isNull(rebuild) || rebuild == CommonStatus.NO.code().intValue()){
|
|
String path = (String)message.getExt().get("path");
|
|
String path = (String)message.getExt().get("path");
|
|
//复制原始资源到home目录
|
|
//复制原始资源到home目录
|
|
fYunFileService.copyFileInBucket(path, homeKey);
|
|
fYunFileService.copyFileInBucket(path, homeKey);
|
|
//删除临时文件
|
|
//删除临时文件
|
|
fYunFileService.deleteFile(path);
|
|
fYunFileService.deleteFile(path);
|
|
- key = homeKey;
|
|
|
|
- }else{
|
|
|
|
- key = homeKey;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//删除点位校准数据
|
|
//删除点位校准数据
|
|
@@ -137,6 +134,19 @@ public class BuildReverseE57SceneServiceImpl implements IBuildSceneService {
|
|
message.setResultReceiverMqName(queueModelingPost);
|
|
message.setResultReceiverMqName(queueModelingPost);
|
|
message.setBizType("reverseE57");
|
|
message.setBizType("reverseE57");
|
|
|
|
|
|
|
|
+ String splitType = "SPLIT_V29";
|
|
|
|
+ String skyboxType = "SKYBOX_V11";
|
|
|
|
+ String otherType = (String)message.getExt().get("otherType");
|
|
|
|
+ Integer isObj = (Integer) message.getExt().get("isObj");
|
|
|
|
+ if(StrUtil.isNotEmpty(modelType) && ModelTypeEnums.TILE_CODE.equals(modelType)){
|
|
|
|
+ skyboxType = "SKYBOX_V15";
|
|
|
|
+ }
|
|
|
|
+ if(Objects.nonNull(isObj) && isObj == CommonStatus.YES.code().intValue()){
|
|
|
|
+ splitType = "SPLIT_V30";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.createProjectAndDataFile(message.getPath(), num, splitType, skyboxType,otherType,null,null);
|
|
|
|
+
|
|
log.info("上传e57计算资源准备结束,场景码:{}", message.getSceneNum());
|
|
log.info("上传e57计算资源准备结束,场景码:{}", message.getSceneNum());
|
|
|
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
@@ -149,6 +159,26 @@ public class BuildReverseE57SceneServiceImpl implements IBuildSceneService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void createProjectAndDataFile(String path, String sceneNum, String splitType, String skyboxType, String otherType, Map<String, Object> projectExtras, Map<String, Object> dataExtras) {
|
|
|
|
+ JSONObject projectJson = new JSONObject();
|
|
|
|
+ if (!org.apache.commons.lang3.ObjectUtils.isEmpty(projectExtras)) {
|
|
|
|
+ projectJson.putAll(projectExtras);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ projectJson.put("sceneNum", sceneNum);
|
|
|
|
+ FileUtils.writeFile(path + File.separator + "project.json", projectJson.toString());
|
|
|
|
+ JSONObject dataJson = new JSONObject();
|
|
|
|
+ if (!org.apache.commons.lang3.ObjectUtils.isEmpty(dataExtras)) {
|
|
|
|
+ dataJson.putAll(dataExtras);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ dataJson.put("split_type", splitType);
|
|
|
|
+ dataJson.put("skybox_type", skyboxType);
|
|
|
|
+ dataJson.put("extras", (Object)null);
|
|
|
|
+ dataJson.put("other_type", otherType);
|
|
|
|
+ FileUtils.writeFile(path + File.separator + "data.json", dataJson.toString());
|
|
|
|
+ }
|
|
|
|
+
|
|
private String getOssPath(String path) {
|
|
private String getOssPath(String path) {
|
|
String ossPath = ConstantFilePath.OSS_PREFIX
|
|
String ossPath = ConstantFilePath.OSS_PREFIX
|
|
+ path.replace(ConstantFilePath.BUILD_MODEL_PATH, "")
|
|
+ path.replace(ConstantFilePath.BUILD_MODEL_PATH, "")
|