|
@@ -371,10 +371,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
} else {
|
|
|
sceneNum = scenePlus.getNum();
|
|
|
sceneCopyLogService.checkCanBuild(sceneNum);
|
|
|
- if (scenePlus.getSceneStatus().equals(SceneStatus.wait.code())) {
|
|
|
- log.info(scenePlus.getNum() + ":场景处于计算中,不能再计算");
|
|
|
- return null;
|
|
|
- }
|
|
|
+// if (scenePlus.getSceneStatus().equals(SceneStatus.wait.code())) {
|
|
|
+// log.info(scenePlus.getNum() + ":场景处于计算中,不能再计算");
|
|
|
+// return null;
|
|
|
+// }
|
|
|
}
|
|
|
if (sceneNum == null) {
|
|
|
log.error("大场景序号为空:" + sceneNum);
|
|
@@ -465,6 +465,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
}
|
|
|
mqMessage.getExt().put("deleteExtras", true);
|
|
|
+ mqMessage.getExt().put("keepTitle", 0);
|
|
|
mqMessage.setRebuild(String.valueOf(rebuild));
|
|
|
if(jsonObject.getIntValue("location") == 7){
|
|
|
//发送到全景看看进行初始化
|
|
@@ -914,6 +915,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
scenePlusExt.setPlusId(scenePlus.getId());
|
|
|
scenePlusExt.setDataSource(prefixBuffer.toString());
|
|
|
scenePlusExt.setIsObj(isObj);
|
|
|
+ scenePlusExt.setThumb(ConstantUrl.DEFAULT_SCENE_PIC);
|
|
|
scenePlusExtService.save(scenePlusExt);
|
|
|
|
|
|
|
|
@@ -956,6 +958,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
scenePlus.setSceneSource(SceneSource.BM.code());
|
|
|
scenePlusExt.setDataSource(dataSource);
|
|
|
scenePlusExt.setLocation(location);
|
|
|
+ if (sceneName != null) {
|
|
|
+ scenePlus.setTitle(sceneName);
|
|
|
+ scenePlus.setLaserTitle(sceneName);
|
|
|
+ }
|
|
|
|
|
|
if(resolution == null || resolution.intValue() == 0){
|
|
|
scenePlusExt.setSceneScheme(cameraType.intValue());
|
|
@@ -1003,9 +1009,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
} else {
|
|
|
scenePlusExt.setShootCount(sceneShootCount);
|
|
|
}
|
|
|
- if (sceneName != null) {
|
|
|
- scenePlus.setTitle(sceneName);
|
|
|
- }
|
|
|
if (sceneDec != null) {
|
|
|
scenePlus.setDescription("<p>" + new String(sceneDec.getBytes("UTF-8")) + "</p>");
|
|
|
}
|
|
@@ -1081,9 +1084,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
scenePlusExt.setSpace(oldSceneExt.getSpace());
|
|
|
scenePlusExt.setEcs(oldSceneExt.getEcs());
|
|
|
scenePlusExt.setViewCount(oldSceneExt.getViewCount());
|
|
|
- if(sceneName!=null) {
|
|
|
- scenePlus.setTitle(sceneName);
|
|
|
- }
|
|
|
if(sceneType!=null) {
|
|
|
scenePlus.setSceneType(sceneType);
|
|
|
}
|
|
@@ -1291,7 +1291,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
//已删除原始资源的场景不支持重算
|
|
|
- Long cameraId = null;
|
|
|
Date laseCallTime = null;
|
|
|
ScenePlusExt scenePlusExt = null;
|
|
|
if(Objects.nonNull(scenePlus)){
|
|
@@ -1313,7 +1312,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5072);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//激光场景校验是否能够计算
|
|
|
this.checkJgCanBuild(scenePro);
|
|
|
|
|
@@ -1329,9 +1327,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5033);
|
|
|
}
|
|
|
String path = scenePlusExt.getDataSource();
|
|
|
- Integer sceneSource = scenePlus.getSceneSource();
|
|
|
String buildType = scenePlusExt.getBuildType();
|
|
|
- Integer sceneScheme = scenePlusExt.getSceneScheme();
|
|
|
|
|
|
String dataFdageOssPath = ConstantFilePath.OSS_PREFIX+ path.replace(ConstantFilePath.BUILD_MODEL_PATH, "")
|
|
|
.replace(ConstantFilePath.BUILD_MODEL_LASER_PATH, "") + "/data.fdage";
|
|
@@ -1353,12 +1349,12 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
statusJson.put("status", SceneStatus.wait.code());
|
|
|
fYunFileService.uploadFile(statusJson.toJSONString().getBytes(StandardCharsets.UTF_8),statusJsonOssPath);
|
|
|
|
|
|
- Long cameraType = (long)sceneScheme == 3 ? 12 : (long)sceneScheme;
|
|
|
- //判断是否转台相机
|
|
|
- if(sceneSource == 3){
|
|
|
+ CameraDetail cameraDetail = cameraDetailService.getByCameraId(scenePlus.getCameraId());
|
|
|
+ Long cameraType = 10L;//默认看看
|
|
|
+ if(cameraDetail.getType() == 9){//看见
|
|
|
cameraType = 13L;
|
|
|
}
|
|
|
- if(sceneSource == 4 || sceneSource == 5){
|
|
|
+ if(cameraDetail.getType() == 10 || cameraDetail.getType() == 11){//深时、深光
|
|
|
cameraType = 14L;
|
|
|
}
|
|
|
BuildSceneCallMessage message = null;
|
|
@@ -1387,6 +1383,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
if (force) {
|
|
|
message.setRebuild("1");
|
|
|
}
|
|
|
+ message.getExt().put("keepTitle", 1);
|
|
|
|
|
|
String ossOrignPath = commonService.getOssOrignPath(path);
|
|
|
String ossPath = fYunFileService.getFileContent(ossOrignPath + "custom.txt");
|
|
@@ -1433,6 +1430,69 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public ResultData rebuildSceneE57(String num,Boolean force,Boolean deleteExtras, String from) throws IOException {
|
|
|
+
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
+
|
|
|
+ if(Objects.isNull(scenePlus)){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
+ }
|
|
|
+ if (scenePlus.getSceneStatus() == 0 && (ObjectUtils.isEmpty(force) || !force)) {
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5033);
|
|
|
+ }
|
|
|
+ ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
+
|
|
|
+ //复制出来的场景不支持重算
|
|
|
+ List<SceneCopyLog> sceneCopyLogs = sceneCopyLogService. listByNewNum(num);
|
|
|
+ if(CollUtil.isNotEmpty(sceneCopyLogs)){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5071);
|
|
|
+ }
|
|
|
+
|
|
|
+ //查询场景是否处于冻结状态,如果已冻结,不允许重算
|
|
|
+ SceneColdStorage sceneColdStorage = sceneColdStorageService.getOne(new LambdaQueryWrapper<SceneColdStorage>().eq(SceneColdStorage::getNum, num).eq(SceneColdStorage::getState, 1));
|
|
|
+ if(Objects.nonNull(sceneColdStorage)){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5074);
|
|
|
+ }
|
|
|
+
|
|
|
+ String path = scenePlusExt.getDataSource();
|
|
|
+ String buildType = scenePlusExt.getBuildType();
|
|
|
+
|
|
|
+ String e57FileKey = SceneUtil.getHomePath(path) + "input.e57";
|
|
|
+ if(!fYunFileService.fileExist(e57FileKey)){
|
|
|
+ return ResultData.error(ErrorCode.FAILURE_CODE_5074);
|
|
|
+ }
|
|
|
+
|
|
|
+ //重算的场景,先移除该场景对应的容量
|
|
|
+ String statusJsonOssPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "status.json";
|
|
|
+ JSONObject statusJson = JSONObject.parseObject(fYunFileService.getFileContent(String.format(UploadFilePath.DATA_VIEW_PATH, num) + "status.json"));
|
|
|
+ if(ObjectUtils.isEmpty(statusJson)){
|
|
|
+ statusJson = new JSONObject();
|
|
|
+ }
|
|
|
+ //临时将-2改成1,app还没完全更新
|
|
|
+ statusJson.put("status", SceneStatus.wait.code());
|
|
|
+ fYunFileService.uploadFile(statusJson.toJSONString().getBytes(StandardCharsets.UTF_8),statusJsonOssPath);
|
|
|
+
|
|
|
+ scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|
|
|
+ .set(ScenePlus::getSceneStatus, SceneStatus.wait.code())
|
|
|
+ .eq(ScenePlus::getNum, num));
|
|
|
+
|
|
|
+ HashMap<String, Object> params = new HashMap<>();
|
|
|
+ params.put("num", num);
|
|
|
+ params.put("rebuild", 1);
|
|
|
+ params.put("deleteExtras", deleteExtras);
|
|
|
+ fdkkLaserService.sendRebuildE57ToLaser(scenePlus);
|
|
|
+ rabbitMqProducer.sendByWorkQueue("reverseE57-modeling-pre", params);
|
|
|
+
|
|
|
+ //记录日志表
|
|
|
+ SceneRebuildLog rebuildLog = new SceneRebuildLog();
|
|
|
+ rebuildLog.setNum(num);
|
|
|
+ rebuildLog.setSource(from);
|
|
|
+ sceneRebuildLogService.save(rebuildLog);
|
|
|
+
|
|
|
+ return ResultData.ok();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 由于算法不支持2022年三月份前的激光场景计算,这里需要校验是否是能计算,不能就退出重算
|
|
|
* @return
|