|
@@ -1317,7 +1317,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5072);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//激光场景校验是否能够计算
|
|
|
this.checkJgCanBuild(scenePro);
|
|
|
|
|
@@ -1435,6 +1434,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
|