|
@@ -751,7 +751,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
if(!password.equals(camera.getChildPassword())){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_3014);
|
|
|
}
|
|
|
-
|
|
|
+ CameraDetail cameraDetail = platformGoodsClient.getCameraDetailByCameraId(camera.getId()).getData();
|
|
|
+ if(cameraDetail == null){
|
|
|
+ throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
+ }
|
|
|
String unicode = prefix.substring(prefix.lastIndexOf("/") + 1);
|
|
|
String path = ConstantFilePath.BUILD_MODEL_PATH + unicode;
|
|
|
|
|
@@ -777,7 +780,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
//重算的场景,先移除该场景对应的容量
|
|
|
sceneProService.rebuildReduceSpaceBySceneNum(sceneNum);
|
|
|
}else {
|
|
|
- sceneNum = scene3dNumService.generateSceneNum();
|
|
|
+ sceneNum = scene3dNumService.generateSceneNum(cameraDetail.getCameraType());
|
|
|
rebuild = 0;
|
|
|
}
|
|
|
}
|
|
@@ -802,13 +805,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- ResultData<CameraDetail> detailResult = platformGoodsClient.getCameraDetailByCameraId(camera.getId());
|
|
|
- CameraDetail cameraDetail = detailResult.getData();
|
|
|
|
|
|
- if(cameraDetail == null){
|
|
|
- log.error("该相机详情不存在:" + cameraName);
|
|
|
- throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
- }
|
|
|
|
|
|
String icon = null;
|
|
|
if(jsonObject.containsKey("icon") && StrUtil.isNotEmpty(jsonObject.getString("icon"))){
|
|
@@ -897,8 +894,28 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
String data = FileUtils.readFile(ConstantFilePath.BUILD_MODEL_PATH + unicode + "/data.fdage");
|
|
|
JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
+ String cameraName = jsonObject.getJSONObject("cam").getString("uuid");
|
|
|
|
|
|
- String sceneNum = scene3dNumService.generateSceneNum();
|
|
|
+ log.info("查询相机:" + cameraName);
|
|
|
+ Camera cameraEntity = platformGoodsClient.getCameraByChildName(cameraName).getData();
|
|
|
+ if(cameraEntity == null){
|
|
|
+ log.error("该相机不存在:" + cameraName);
|
|
|
+ //偶现data.fdage给的相机码多了或少了4DKKPRO_
|
|
|
+ if(cameraName.contains("4DKKPRO_")){
|
|
|
+ cameraEntity = platformGoodsClient.getCameraByChildName(cameraName.replace("4DKKPRO_", "")).getData();
|
|
|
+ }else {
|
|
|
+ cameraEntity = platformGoodsClient.getCameraByChildName("4DKKPRO_" + cameraName).getData();
|
|
|
+ }
|
|
|
+ if(cameraEntity == null){
|
|
|
+ throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ CameraDetail detailEntity = platformGoodsClient.getCameraDetailByCameraId(cameraEntity.getId()).getData();
|
|
|
+ if(detailEntity == null){
|
|
|
+ log.error("该相机详情不存在:" + cameraName);
|
|
|
+ throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
+ }
|
|
|
+ String sceneNum = scene3dNumService.generateSceneNum(detailEntity.getCameraType());
|
|
|
|
|
|
return ResultData.ok(mainUrl + sceneProNewUrl + sceneNum);
|
|
|
}
|
|
@@ -931,26 +948,8 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
// TODO: 2022/3/19 plus 版本稳定后删除-------------------------------end
|
|
|
|
|
|
int rebuild = 1;
|
|
|
- if(scene1 != null){
|
|
|
- sceneNum = scene1.getNum();
|
|
|
- if(scene1.getSceneStatus() == SceneStatus.wait.code()){
|
|
|
- log.info(sceneNum + ":场景处于计算中,不能再计算");
|
|
|
- return;
|
|
|
- }
|
|
|
- }else {
|
|
|
- sceneNum = scene3dNumService.generateSceneNum();
|
|
|
- rebuild = 0;
|
|
|
- }
|
|
|
log.info("是否是重算,rebuild:{}",rebuild);
|
|
|
|
|
|
- if(sceneNum == null){
|
|
|
- log.error("大场景序号为空:" + sceneNum);
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
- }
|
|
|
-
|
|
|
- String imageViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
|
|
|
- String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, sceneNum);
|
|
|
-
|
|
|
log.info("查询相机:" + snCode);
|
|
|
ResultData<Camera> cameraResult = platformGoodsClient.getCameraByChildName(snCode);
|
|
|
Camera camera = cameraResult.getData();
|
|
@@ -970,6 +969,23 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
log.error("该相机详情不存在:" + snCode);
|
|
|
throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
}
|
|
|
+ if(scene1 != null){
|
|
|
+ sceneNum = scene1.getNum();
|
|
|
+ if(scene1.getSceneStatus() == SceneStatus.wait.code()){
|
|
|
+ log.info(sceneNum + ":场景处于计算中,不能再计算");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ sceneNum = scene3dNumService.generateSceneNum(cameraDetail.getCameraType());
|
|
|
+ rebuild = 0;
|
|
|
+ }
|
|
|
+ if(sceneNum == null){
|
|
|
+ log.error("大场景序号为空:" + sceneNum);
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
+ }
|
|
|
+
|
|
|
+ String imageViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
|
|
|
+ String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, sceneNum);
|
|
|
|
|
|
String userName = null;
|
|
|
if(cameraDetail.getUserId() != null){
|
|
@@ -1198,11 +1214,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
String sceneNum = null;
|
|
|
try{
|
|
|
- sceneNum = scene3dNumService.generateSceneNum();
|
|
|
- if(sceneNum == null){
|
|
|
- log.error("大场景序号为空:" + sceneNum);
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
- }
|
|
|
|
|
|
log.info("查询相机:" + buildScene.getCameraName());
|
|
|
ResultData<Camera> cameraResult= platformGoodsClient.getCameraByChildName(buildScene.getCameraName());
|
|
@@ -1216,6 +1227,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
ResultData<CameraDetail> cameraDetailResult = platformGoodsClient.getCameraDetailByCameraId(camera.getId());
|
|
|
CameraDetail cameraDetail = cameraDetailResult.getData();
|
|
|
|
|
|
+ sceneNum = scene3dNumService.generateSceneNum(cameraDetail.getCameraType());
|
|
|
+ if(sceneNum == null){
|
|
|
+ log.error("大场景序号为空:" + sceneNum);
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
+ }
|
|
|
int balance = Integer.valueOf(cameraDetail.getBalance());
|
|
|
if(balance - Constant.MONEY_SCENE <0){
|
|
|
log.error("相机点数不足:" + buildScene.getCameraName());
|
|
@@ -1278,24 +1294,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
String cameraName = jsonObject.getJSONObject("cam").getString("uuid");
|
|
|
String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
|
|
|
- //查看场景中的文件目录是否有改文件id,有则重新计算改场景,无则新建场景
|
|
|
- SceneProPO proEntity = sceneProService.findByFileId("/" + fileId + "/");
|
|
|
- int rebuild = 1;
|
|
|
- if(proEntity != null){
|
|
|
- sceneNum = proEntity.getNum();
|
|
|
- if(proEntity.getSceneStatus() == SceneStatus.wait.code()){
|
|
|
- log.info(sceneNum + ":场景处于计算中,不能再计算");
|
|
|
- return;
|
|
|
- }
|
|
|
- }else {
|
|
|
- sceneNum = scene3dNumService.generateSceneNum();
|
|
|
- rebuild = 0;
|
|
|
- }
|
|
|
-
|
|
|
- if(sceneNum == null){
|
|
|
- log.error("大场景序号为空:" + sceneNum);
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
- }
|
|
|
|
|
|
log.info("查询相机:" + cameraName);
|
|
|
ResultData<Camera> cameraResult = platformGoodsClient.getCameraByChildName(cameraName);
|
|
@@ -1323,6 +1321,27 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
}
|
|
|
|
|
|
+ //查看场景中的文件目录是否有改文件id,有则重新计算改场景,无则新建场景
|
|
|
+ SceneProPO proEntity = sceneProService.findByFileId("/" + fileId + "/");
|
|
|
+ int rebuild = 1;
|
|
|
+ if(proEntity != null){
|
|
|
+ sceneNum = proEntity.getNum();
|
|
|
+ if(proEntity.getSceneStatus() == SceneStatus.wait.code()){
|
|
|
+ log.info(sceneNum + ":场景处于计算中,不能再计算");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ sceneNum = scene3dNumService.generateSceneNum(cameraDetail.getCameraType());
|
|
|
+ rebuild = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(sceneNum == null){
|
|
|
+ log.error("大场景序号为空:" + sceneNum);
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
String userName = null;
|
|
|
if(cameraDetail.getUserId() != null){
|
|
|
ResultData<SSOUser> ssoResult = platformUserClient.getSSOUserByUserId(cameraDetail.getUserId());
|