|
@@ -103,8 +103,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
@Autowired
|
|
|
private RedisUtil redisUtil;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Autowired
|
|
|
private IScenePlusExtService scenePlusExtService;
|
|
|
|
|
@@ -165,6 +163,12 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
@Autowired
|
|
|
private ISceneCopyDistinctEnvService sceneCopyDistinctEnvService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ISceneCopyLogService sceneCopyLogService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISceneCleanOrigService sceneCleanOrigService;
|
|
|
+
|
|
|
@Override
|
|
|
public SceneFileBuild findByFileId(String fileId) {
|
|
|
|
|
@@ -1102,35 +1106,44 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
public ResultData rebuildScene(String num,Boolean force,Boolean deleteExtras) throws IOException {
|
|
|
|
|
|
ScenePro scenePro = sceneProService.getByNum(num);
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
|
|
|
- // TODO: 2023/1/12 3dtiles临时上激光场景
|
|
|
-// if(Objects.nonNull(scenePro) && (Objects.isNull(scenePro.getIsUpgrade())
|
|
|
-// || scenePro.getIsUpgrade() != CommonStatus.YES.code().intValue())){
|
|
|
-// if(scenePro.getSceneSource() == SceneSource.JG.code().intValue()){
|
|
|
-// return rebuildV3Scene(scenePro,num,force);
|
|
|
-// }else{
|
|
|
-// return rebuildV3SceneToMini(scenePro);
|
|
|
-// }
|
|
|
-// }
|
|
|
+ //复制出来的场景不支持重算
|
|
|
+ List<SceneCopyLog> sceneCopyLogs = sceneCopyLogService.listByNewNum(num);
|
|
|
+ if(CollUtil.isNotEmpty(sceneCopyLogs)){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5071);
|
|
|
+ }
|
|
|
+
|
|
|
+ //已删除原始资源的场景不支持重算
|
|
|
+ Date laseCallTime = null;
|
|
|
+ ScenePlusExt scenePlusExt = null;
|
|
|
+ if(Objects.nonNull(scenePlus)){
|
|
|
+ scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
+ laseCallTime = scenePlusExt.getAlgorithmTime();
|
|
|
+ }else{
|
|
|
+ laseCallTime = scenePro.getCreateTime();
|
|
|
+ }
|
|
|
+ //查询最后一次计算时间后是否有删除过目录,如果有,则不支持重算
|
|
|
+ List<SceneCleanOrig> sceneCleanOrigs = sceneCleanOrigService.lisByNumAfterLastCall(num, laseCallTime);
|
|
|
+ if(CollUtil.isNotEmpty(sceneCleanOrigs)){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5072);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
//激光场景校验是否能够计算
|
|
|
this.checkJgCanBuild(scenePro);
|
|
|
|
|
|
- //如果是v3场景,不允许重算,需要升级v4后再调此接口进行重算
|
|
|
if(Objects.nonNull(scenePro) && (Objects.isNull(scenePro.getIsUpgrade())
|
|
|
|| scenePro.getIsUpgrade() != CommonStatus.YES.code().intValue())){
|
|
|
return rebuildV3Scene(scenePro,num,force);
|
|
|
}
|
|
|
|
|
|
- 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());
|
|
|
String path = scenePlusExt.getDataSource();
|
|
|
Integer sceneSource = scenePlus.getSceneSource();
|
|
|
String buildType = scenePlusExt.getBuildType();
|