|
@@ -23,6 +23,7 @@ import com.fdkankan.common.util.SnowflakeIdGenerator;
|
|
|
import com.fdkankan.contro.constant.RedisConstants;
|
|
|
import com.fdkankan.contro.entity.*;
|
|
|
import com.fdkankan.contro.mapper.ISceneFileBuildMapper;
|
|
|
+import com.fdkankan.contro.service.ICommonService;
|
|
|
import com.fdkankan.contro.service.*;
|
|
|
import com.fdkankan.contro.vo.ResponseSceneFile;
|
|
|
import com.fdkankan.contro.vo.ScenePlusVO;
|
|
@@ -82,6 +83,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
@Value("${scene.pro.new.url}")
|
|
|
private String sceneProNewUrl;
|
|
|
|
|
|
+ @Value("${scene.pro.v3.url}")
|
|
|
+ private String sceneProV3Url;
|
|
|
+
|
|
|
@Value("${queue.modeling.modeling-pre}")
|
|
|
private String queueModelingPre;
|
|
|
|
|
@@ -97,14 +101,15 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
@Value("#{'${model.3dtiles.sceneSource:}'.split(',')}")
|
|
|
private List<Integer> sdTilesSceneSourceList;
|
|
|
|
|
|
+ @Value("#{'${camType.laser:}'.split(',')}")
|
|
|
+ private List<Integer> laserCamTypeList;
|
|
|
+
|
|
|
@Value("${build.notSupport.beforeTime:202203}")
|
|
|
private String jgNotSupportBuildTime;
|
|
|
|
|
|
@Autowired
|
|
|
private RedisUtil redisUtil;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Autowired
|
|
|
private IScenePlusExtService scenePlusExtService;
|
|
|
|
|
@@ -165,6 +170,24 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
@Autowired
|
|
|
private ISceneCopyDistinctEnvService sceneCopyDistinctEnvService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ISceneCopyLogService sceneCopyLogService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISceneCleanOrigService sceneCleanOrigService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ICommonService commonService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IExceedSpaceSceneService exceedSpaceSceneService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISceneColdStorageLogService sceneColdStorageLogService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISceneColdStorageService sceneColdStorageService;
|
|
|
+
|
|
|
@Override
|
|
|
public SceneFileBuild findByFileId(String fileId) {
|
|
|
|
|
@@ -217,14 +240,23 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
// 检测是否有生成
|
|
|
String fileId = redisUtil.get(String.format(RedisConstants.FOLDER_FILEID_BUILD, folderName));
|
|
|
- if (!ObjectUtils.isEmpty(fileId)) {
|
|
|
- responseSceneFile.setFileId(fileId);
|
|
|
- return responseSceneFile;
|
|
|
+ if (StrUtil.isEmpty(fileId)) {
|
|
|
+ SceneFileBuild sceneFileBuild = this.findByUnicode(folderName);
|
|
|
+ if (sceneFileBuild != null) {
|
|
|
+ fileId = sceneFileBuild.getFileId();
|
|
|
+ }
|
|
|
}
|
|
|
+ if(StrUtil.isNotEmpty(fileId)){
|
|
|
+
|
|
|
+ //校验目录是否被上锁,如果上锁,抛出错误(避免删除原始资源定时任务执行过程中,有场景补拍重新上传)
|
|
|
+ String homePath = redisUtil.get(String.format(RedisKey.SCENE_OSS_HOME_DIR_DELETE, folderName));
|
|
|
+ if(StrUtil.isNotEmpty(homePath)){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5073);
|
|
|
+ }
|
|
|
+ //如果原始资源目录不是正在被定时任务删除中,就加上上传锁,并正常返回
|
|
|
+ homePath = ConstantFilePath.OSS_PREFIX.concat(mac).concat("/").concat(fileId).concat("/").concat(folderName);
|
|
|
+ redisUtil.set(String.format(RedisKey.SCENE_OSS_HOME_DIR_UPLOAD, folderName), homePath, RedisKey.CAMERA_EXPIRE_7_TIME);
|
|
|
|
|
|
- SceneFileBuild sceneFileBuild = this.findByUnicode(folderName);
|
|
|
- if (sceneFileBuild != null) {
|
|
|
- fileId = sceneFileBuild.getFileId();
|
|
|
responseSceneFile.setFileId(fileId);
|
|
|
redisUtil.set(String.format(RedisConstants.FOLDER_FILEID_BUILD, folderName), fileId, 2 * 24 * 60 * 60);
|
|
|
return responseSceneFile;
|
|
@@ -238,7 +270,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
// 查找场景表
|
|
|
LambdaQueryWrapper<ScenePro> proWrapper = new LambdaQueryWrapper<>();
|
|
|
- proWrapper.like(ScenePro::getDataSource, "/" + folderName).eq(ScenePro::getRecStatus, 'A');
|
|
|
+ proWrapper.like(ScenePro::getDataSource, "/" + folderName);
|
|
|
ScenePro pro = sceneProService.getOne(proWrapper);
|
|
|
|
|
|
String dataSource = null;
|
|
@@ -249,7 +281,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
dataSource = scenePlusService.getDataSourceLikeUnicode("/" + folderName);
|
|
|
}
|
|
|
|
|
|
- if (!ObjectUtils.isEmpty(dataSource)) {
|
|
|
+ if (StrUtil.isNotEmpty(dataSource)) {
|
|
|
log.info("从数据库中查到与 fileId:{} 匹配的路径为:{}", fileId, dataSource);
|
|
|
int n = dataSource.split("/").length;
|
|
|
if (n > 1) {
|
|
@@ -257,11 +289,12 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (ObjectUtils.isEmpty(fileId)) {
|
|
|
+ if (StrUtil.isEmpty(fileId)) {
|
|
|
fileId = new SnowflakeIdGenerator(0, 0).nextId() + "";
|
|
|
log.info("新生成build数据,{}", fileId);
|
|
|
}
|
|
|
- sceneFileBuild = new SceneFileBuild();
|
|
|
+
|
|
|
+ SceneFileBuild sceneFileBuild = new SceneFileBuild();
|
|
|
sceneFileBuild.setChildName(mac);
|
|
|
sceneFileBuild.setFileId(fileId);
|
|
|
sceneFileBuild.setRecStatus("A");
|
|
@@ -308,12 +341,19 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
//查看场景中的文件目录是否有改文件id,有则重新计算改场景,无则新建场景
|
|
|
ScenePlus scenePlus = scenePlusService.getByFileId("/" + fileId + "/");
|
|
|
- int rebuild = 1;
|
|
|
+ int rebuild = CommonStatus.YES.code();
|
|
|
if (ObjectUtils.isEmpty(scenePlus)) {
|
|
|
+
|
|
|
+
|
|
|
+ //清除超容量场景记录
|
|
|
+ exceedSpaceSceneService.repeal(camera.getId(), fileId, unicode);
|
|
|
+
|
|
|
sceneNum = scene3dNumService.generateSceneNum(cameraDetail.getType());
|
|
|
- rebuild = 0;
|
|
|
+
|
|
|
+ rebuild = CommonStatus.NO.code();
|
|
|
} else {
|
|
|
sceneNum = scenePlus.getNum();
|
|
|
+ sceneCopyLogService.checkCanBuild(sceneNum);
|
|
|
if (scenePlus.getSceneStatus().equals(SceneStatus.wait.code())) {
|
|
|
log.info(scenePlus.getNum() + ":场景处于计算中,不能再计算");
|
|
|
return null;
|
|
@@ -323,6 +363,18 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
log.error("大场景序号为空:" + sceneNum);
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
}
|
|
|
+
|
|
|
+ //如果是相机计算容量的模式是场景个数模式,则需要拦截计算
|
|
|
+ if(rebuild == CommonStatus.NO.code() && cameraType != 14){//新场景需要校验容量是否超出限制
|
|
|
+ boolean exceedSpace = exceedSpaceSceneService.cehckExceedSpace(sceneNum, cameraDetail, cameraName, fileId, unicode);
|
|
|
+ if(exceedSpace){
|
|
|
+ ScenePlusVO scenePlusVO = new ScenePlusVO();
|
|
|
+ scenePlusVO.setNum(sceneNum);
|
|
|
+ scenePlusVO.setSceneStatus(SceneStatus.EXCEED_SPACE.code());
|
|
|
+ return scenePlusVO;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
String dataSource = cameraName.replace("4DKKPRO_", "").replace("-fdage", "").toLowerCase() + File.separator +
|
|
|
fileId + File.separator + unicode;
|
|
|
if (cameraType == 14) {
|
|
@@ -345,9 +397,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
private ScenePlusVO buildScenePost(String dataSource, JSONObject jsonObject, String buildType, long cameraType,
|
|
|
String sceneNum, CameraDetail cameraDetail, int rebuild,String icon) throws Exception {
|
|
|
- String localDataPath = String.format(ConstantFilePath.DATABUFFER_FORMAT, sceneNum);
|
|
|
String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
|
|
|
- String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, sceneNum);
|
|
|
|
|
|
String userName = null;
|
|
|
if (!ObjectUtils.isEmpty(cameraDetail.getUserId())) {
|
|
@@ -368,9 +418,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
//重算的场景,先移除该场景对应的容量
|
|
|
if (rebuild == 1) {
|
|
|
- scenePlusService.resetSpace(sceneNum);
|
|
|
- //删除oss的houst_floor.json(国际版可能会卡住)
|
|
|
- fYunFileService.deleteFile(dataViewPath + "houst_floor.json");
|
|
|
+ if(CollUtil.isEmpty(laserCamTypeList) || !laserCamTypeList.contains(cameraDetail.getType())){
|
|
|
+ scenePlusService.resetSpace(sceneNum);
|
|
|
+ }
|
|
|
} else {
|
|
|
//上传log-main.png
|
|
|
fYunFileService.uploadFile(ConstantFilePath.LOGO_PATH + "logo-main.png", imgViewPath + "logo-main.png");
|
|
@@ -384,18 +434,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, cameraDetail.getCooperationUser());
|
|
|
|
|
|
- if (Objects.nonNull(scenePlusVO)) {
|
|
|
- JSONObject statusJson = new JSONObject();
|
|
|
- //临时将-2改成1,app还没完全更新
|
|
|
- statusJson.put("status", scenePlusVO.getSceneStatus() == -2 ? 1 : scenePlusVO.getSceneStatus());
|
|
|
- statusJson.put("webSite", scenePlusVO.getWebSite());
|
|
|
- statusJson.put("sceneNum", scenePlusVO.getNum());
|
|
|
- statusJson.put("thumb", scenePlusVO.getThumb());
|
|
|
- statusJson.put("payStatus", 0);
|
|
|
- statusJson.put("recStatus", 'A');
|
|
|
- FileUtils.writeFile(localDataPath + "status.json", statusJson.toString());
|
|
|
- fYunFileService.uploadFile(localDataPath + "status.json", dataViewPath + "status.json");
|
|
|
- }
|
|
|
+ //上传app状态文件
|
|
|
+ commonService.uploadStatusJson(sceneNum, scenePlusVO.getSceneStatus(),
|
|
|
+ scenePlusVO.getWebSite(),scenePlusVO.getThumb(),PayStatus.NOT_PAY.code(),
|
|
|
+ String.format(UploadFilePath.DATA_VIEW_PATH, sceneNum));
|
|
|
|
|
|
BuildSceneCallMessage mqMessage = getBuildSceneMqMessage(sceneNum, cameraType, algorithm, jsonObject.getInteger("resolution"), buildType,
|
|
|
scenePlusVO.getDataSource());
|
|
@@ -413,8 +455,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
public ScenePlusVO buildV3Scene(ScenePro scenePro,String fileId, String prefix,JSONObject jsonObject,String buildType,long cameraType) throws Exception{
|
|
|
- //调用createScene方法生成scene数据和加入算法队列
|
|
|
|
|
|
+ sceneCopyLogService.checkCanBuild(scenePro.getNum());
|
|
|
+
|
|
|
+ //调用createScene方法生成scene数据和加入算法队列
|
|
|
String cameraName = jsonObject.getJSONObject("cam").getString("uuid");
|
|
|
String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
|
|
|
|
|
@@ -473,18 +517,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
jsonObject.getInteger("scenetype"), jsonObject.getString("gps"),
|
|
|
jsonObject.getInteger("resolution"), firmwareVersion.toString(), buildType);
|
|
|
|
|
|
- if (Objects.nonNull(scenePlusVO)) {
|
|
|
- JSONObject statusJson = new JSONObject();
|
|
|
- //临时将-2改成1,app还没完全更新
|
|
|
- statusJson.put("status", scenePlusVO.getSceneStatus() == -2 ? 1 : scenePlusVO.getSceneStatus());
|
|
|
- statusJson.put("webSite", scenePlusVO.getWebSite());
|
|
|
- statusJson.put("sceneNum", scenePlusVO.getNum());
|
|
|
- statusJson.put("thumb", scenePlusVO.getThumb());
|
|
|
- statusJson.put("payStatus", 0);
|
|
|
- statusJson.put("recStatus", 'A');
|
|
|
- FileUtils.writeFile(localDataPath + "status.json", statusJson.toString());
|
|
|
- fYunFileService.uploadFile(localDataPath + "status.json", dataViewPath + "status.json");
|
|
|
- }
|
|
|
+ //上传场景状态文件
|
|
|
+ commonService.uploadStatusJson(sceneNum, scenePlusVO.getSceneStatus(),
|
|
|
+ scenePlusVO.getWebSite(),scenePlusVO.getThumb(),PayStatus.NOT_PAY.code(),
|
|
|
+ String.format(ConstantFilePath.DATA_PATH_FORMAT, sceneNum));
|
|
|
+
|
|
|
BuildSceneCallMessage mqMessage = getBuildSceneMqMessage(sceneNum, cameraType, algorithm, jsonObject.getInteger("resolution"), buildType,
|
|
|
scenePlusVO.getDataSource());
|
|
|
if (cameraDetail.getCompanyId() != null) {
|
|
@@ -599,6 +636,8 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ this.removeUpdateV4(ConstantFilePath.OSS_PREFIX + prefixBuffer + "data.fdage", fdageJson);
|
|
|
+
|
|
|
// 判断是否是V3的场景
|
|
|
ScenePro scenePro = sceneProService.getOne(
|
|
|
new LambdaQueryWrapper<ScenePro>().like(ScenePro::getDataSource, fileId));
|
|
@@ -615,7 +654,22 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
+ private void removeUpdateV4(String dataFdagePath, JSONObject fdageJson){
|
|
|
+ Integer updateV4 = fdageJson.getInteger("updateV4");
|
|
|
+ if(Objects.isNull(updateV4) || updateV4 == 0){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ fdageJson.put("updateV4", CommonStatus.NO.code());
|
|
|
+ fYunFileService.uploadFile(fdageJson.toJSONString().getBytes(StandardCharsets.UTF_8), dataFdagePath);
|
|
|
+ }
|
|
|
+
|
|
|
private boolean callV3(ScenePro scenePro, String preParams, JSONObject fdageJson,String api) throws Exception {
|
|
|
+
|
|
|
+ //复制出来的场景不支持补拍上传
|
|
|
+ if(Objects.nonNull(scenePro)){
|
|
|
+ sceneCopyLogService.checkCanBuild(scenePro.getNum());
|
|
|
+ }
|
|
|
+
|
|
|
String cameraName = fdageJson.getJSONObject("cam").getString("uuid");
|
|
|
|
|
|
Camera camera = cameraService.getByChildName(cameraName);
|
|
@@ -637,6 +691,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
}
|
|
|
if (!ObjectUtils.isEmpty(company.getSceneVersion()) && company.getSceneVersion().equals("V3")) {
|
|
|
+ //如果是app重新上传,需要解冻结
|
|
|
+ if(Objects.nonNull(scenePro)){
|
|
|
+ sceneColdStorageService.unfreeze(scenePro.getNum(), "用户相机重新全量上传", scenePro.getDataSource());
|
|
|
+ }
|
|
|
+
|
|
|
callV3Service(preParams, api);
|
|
|
return Boolean.TRUE;
|
|
|
}
|
|
@@ -716,6 +775,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
log.info("data.fdage文件为空");
|
|
|
throw new BusinessException(CameraConstant.FAILURE_6009);
|
|
|
}
|
|
|
+
|
|
|
+ this.removeUpdateV4(ConstantFilePath.OSS_PREFIX + prefixBuffer + "data.fdage", fdageJson);
|
|
|
+
|
|
|
String buildType = "V3";
|
|
|
//13表示转台
|
|
|
Long cameraType = 13L;
|
|
@@ -745,7 +807,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
|
|
|
- if(ObjectUtils.isEmpty(scenePlusVO)){
|
|
|
+ if(ObjectUtils.isEmpty(scenePlusVO) || scenePlusVO.getSceneStatus() == SceneStatus.EXCEED_SPACE.code()){
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
// 通知激光场景系统开始构建场景
|
|
@@ -893,9 +955,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}else {
|
|
|
ScenePlus oldScene = scenePlusService.getScenePlusByNum(projectNum);
|
|
|
scenePlus.setId(oldScene.getId());
|
|
|
- scenePlus.setSceneStatus(0);
|
|
|
+ scenePlus.setSceneStatus(SceneStatus.wait.code());
|
|
|
scenePlus.setRecStatus(RecStatus.VALID.code());
|
|
|
- scenePlus.setPayStatus(0);
|
|
|
+ scenePlus.setPayStatus(PayStatus.NOT_PAY.code());
|
|
|
scenePlus.setCreateTime(Calendar.getInstance().getTime());
|
|
|
|
|
|
ScenePlusExt oldSceneExt = scenePlusExtService.getScenePlusExtByPlusId(oldScene.getId());
|
|
@@ -1101,35 +1163,54 @@ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ //已删除原始资源的场景不支持重算
|
|
|
+ Long cameraId = null;
|
|
|
+ Date laseCallTime = null;
|
|
|
+ ScenePlusExt scenePlusExt = null;
|
|
|
+ if(Objects.nonNull(scenePlus)){
|
|
|
+ scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
+ laseCallTime = scenePlusExt.getAlgorithmTime();
|
|
|
+ cameraId = scenePlus.getCameraId();
|
|
|
+ }else{
|
|
|
+ laseCallTime = scenePro.getCreateTime();
|
|
|
+ cameraId = scenePro.getCameraId();
|
|
|
+ }
|
|
|
+
|
|
|
+ //查询场景是否处于冻结状态,如果已冻结,不允许重算
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ //查询最后一次计算时间后是否有删除过目录,如果有,则不支持重算
|
|
|
+ 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();
|
|
@@ -1145,7 +1226,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
//重算的场景,先移除该场景对应的容量
|
|
|
- scenePlusService.resetSpace(num);
|
|
|
+ CameraDetail cameraDetail = cameraDetailService.getByCameraId(cameraId);
|
|
|
+ if(CollUtil.isEmpty(laserCamTypeList) || !laserCamTypeList.contains(cameraDetail.getType())){
|
|
|
+ scenePlusService.resetSpace(num);
|
|
|
+ }
|
|
|
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)){
|
|
@@ -1453,7 +1537,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
|
|
|
String buildType = "V3";
|
|
|
- String sceneUrl = mainUrl + "/" + sceneProNewUrl;
|
|
|
+ String sceneUrl = mainUrl + "/" + sceneProV3Url;
|
|
|
|
|
|
boolean isObj = jsonObject.containsKey("exportMeshObj") && jsonObject.getIntValue("exportMeshObj") == 1;
|
|
|
|