|
@@ -24,6 +24,7 @@ import com.fdkankan.contro.common.Result;
|
|
|
import com.fdkankan.contro.constant.RedisConstants;
|
|
|
import com.fdkankan.contro.entity.*;
|
|
|
import com.fdkankan.contro.httpclient.MyClient;
|
|
|
+import com.fdkankan.contro.enums.CameraTypeEnum;
|
|
|
import com.fdkankan.contro.mapper.ISceneFileBuildMapper;
|
|
|
import com.fdkankan.contro.service.*;
|
|
|
import com.fdkankan.contro.vo.ResponseSceneFile;
|
|
@@ -477,7 +478,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
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,
|
|
|
+ BuildSceneCallMessage mqMessage = getBuildSceneMqMessage(sceneNum, cameraType, algorithm, jsonObject, buildType,
|
|
|
scenePlusVO.getDataSource());
|
|
|
|
|
|
if (cameraDetail.getCompanyId() != null) {
|
|
@@ -559,7 +560,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
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,
|
|
|
+ BuildSceneCallMessage mqMessage = getBuildSceneMqMessage(sceneNum, cameraType, algorithm, jsonObject, buildType,
|
|
|
scenePlusVO.getDataSource());
|
|
|
if (cameraDetail.getCompanyId() != null) {
|
|
|
Company company = companyService.getById(cameraDetail.getCompanyId());
|
|
@@ -677,7 +678,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
// 判断是否是V3的场景
|
|
|
ScenePro scenePro = sceneProService.getOne(
|
|
|
- new LambdaQueryWrapper<ScenePro>().like(ScenePro::getDataSource, fileId));
|
|
|
+ new LambdaQueryWrapper<ScenePro>().like(ScenePro::getDataSource, "/".concat(fileId).concat("/")));
|
|
|
|
|
|
boolean callV3 = callV3(scenePro, preParams, fdageJson, "api/scene/file/uploadSuccessBuild");
|
|
|
if(callV3) return ResultData.ok();
|
|
@@ -818,15 +819,17 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
//13表示转台
|
|
|
Long cameraType = 13L;
|
|
|
|
|
|
- //激光转台 八目相机占用 10 和 11
|
|
|
- if(fdageJson.getJSONObject("cam").getIntValue("type") == 10){
|
|
|
+ //激光相机10 13
|
|
|
+ int camType = fdageJson.getJSONObject("cam").getIntValue("type");
|
|
|
+ log.info("camType:{}", camType);
|
|
|
+ if(laserCamTypeList.contains(camType)){
|
|
|
//激光转台
|
|
|
cameraType = 14L;
|
|
|
}
|
|
|
|
|
|
// 判断是否是V3的场景
|
|
|
ScenePro scenePro = sceneProService.getOne(
|
|
|
- new LambdaQueryWrapper<ScenePro>().like(ScenePro::getDataSource, fileId));
|
|
|
+ new LambdaQueryWrapper<ScenePro>().like(ScenePro::getDataSource, "/".concat(fileId).concat("/")));
|
|
|
|
|
|
boolean callV3 = callV3(scenePro, preParams, fdageJson, "api/scene/file/turntableUploadSuccess");
|
|
|
if (callV3) return ResultData.ok();
|
|
@@ -856,8 +859,8 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
//判断 是否为激光相机
|
|
|
Camera camera = cameraService.getByChildName(mac);
|
|
|
- if(!ObjectUtils.isEmpty(scenePlus)){
|
|
|
- fdkkLaserService.saveScene(scenePlus,fdageJson.getString("pwd"),camera,userName,false);
|
|
|
+ if(Objects.nonNull(scenePlus)){
|
|
|
+ fdkkLaserService.saveScene(scenePlus,fdageJson,camera,userName,false);
|
|
|
}else{
|
|
|
fdkkLaserService.saveScene(scenePro,fdageJson.getString("pwd"),camera,userName,false);
|
|
|
}
|
|
@@ -879,19 +882,29 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
scenePlus.setCameraId(cameraId);
|
|
|
scenePlus.setPhoneId(phoneId);
|
|
|
scenePlus.setNum(projectNum);
|
|
|
- scenePlus.setSceneSource(1);
|
|
|
+ scenePlus.setSceneSource(SceneSource.BM.code());
|
|
|
scenePlusExt.setDataSource(dataSource);
|
|
|
+ scenePlusExt.setLocation(location);
|
|
|
|
|
|
if(resolution == null || resolution.intValue() == 0){
|
|
|
scenePlusExt.setSceneScheme(cameraType.intValue());
|
|
|
}else {
|
|
|
- scenePlusExt.setSceneScheme(4);
|
|
|
+ scenePlusExt.setSceneScheme(SceneScheme.BM.code());
|
|
|
}
|
|
|
|
|
|
//转台相机用4k图
|
|
|
- if(cameraType.longValue() == 13 ){
|
|
|
- scenePlus.setSceneSource(3);
|
|
|
- scenePlusExt.setSceneScheme(10);
|
|
|
+ if(cameraType.longValue() == 13){
|
|
|
+ scenePlus.setSceneSource(SceneSource.ZT.code());
|
|
|
+ scenePlusExt.setSceneScheme(SceneScheme.FOUR_K.code());
|
|
|
+ }
|
|
|
+
|
|
|
+ //激光相机
|
|
|
+ if(cameraType.longValue() == 14){
|
|
|
+ scenePlus.setSceneSource(SceneSource.JG.code());
|
|
|
+ scenePlusExt.setSceneScheme(SceneScheme.FOUR_K.code());
|
|
|
+ if(camType == CameraTypeEnum.LASER_SG.getType()){
|
|
|
+ scenePlus.setSceneSource(SceneSource.SG.code());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if(ModelKind.THREE_D_TILE.code().equals(modelKind)
|
|
@@ -1173,17 +1186,19 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
public BuildSceneCallMessage getBuildSceneMqMessage(String projectNum,
|
|
|
- Long cameraType, String algorithm, Integer resolution,
|
|
|
+ Long cameraType, String algorithm, JSONObject fdageJson,
|
|
|
String buildType, String dataSource) {
|
|
|
BuildSceneCallMessage mqMsg = new BuildSceneCallMessage();
|
|
|
mqMsg.setSceneNum(projectNum);
|
|
|
mqMsg.setCameraType(String.valueOf(cameraType));
|
|
|
mqMsg.setAlgorithm(algorithm);
|
|
|
- mqMsg.setResolution(String.valueOf(resolution));
|
|
|
+ mqMsg.setResolution(String.valueOf(fdageJson.getInteger("resolution")));
|
|
|
mqMsg.setBuildType(buildType);
|
|
|
mqMsg.setPath(dataSource);
|
|
|
mqMsg.setCreateTime(DateUtil.format(Calendar.getInstance().getTime(), DateExtUtil.dateStyle));
|
|
|
- mqMsg.setExt(new HashMap<>());
|
|
|
+ Map<String, Object> ext = new HashMap<>();
|
|
|
+ ext.put("location", fdageJson.getInteger("location"));
|
|
|
+ mqMsg.setExt(ext);
|
|
|
return mqMsg;
|
|
|
}
|
|
|
|
|
@@ -1276,11 +1291,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
if(sceneSource == 3){
|
|
|
cameraType = 13L;
|
|
|
}
|
|
|
- if(sceneSource == 4){
|
|
|
+ if(sceneSource == 4 || sceneSource == 5){
|
|
|
cameraType = 14L;
|
|
|
}
|
|
|
BuildSceneCallMessage message = null;
|
|
|
- if(sceneSource == 4){
|
|
|
+ if(cameraType == 14){
|
|
|
String userName = null;
|
|
|
Long sceneUserId = scenePlus.getUserId();
|
|
|
if (!ObjectUtils.isEmpty(sceneUserId)) {
|
|
@@ -1290,14 +1305,12 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
Camera cameraEntity = cameraService.getById(scenePlus.getCameraId());
|
|
|
fdkkLaserService.saveScene(scenePlus,null,cameraEntity,userName,true);
|
|
|
message = this.getBuildSceneMqMessage(
|
|
|
- num, cameraType,
|
|
|
- fdageData.getString("location") != null && "1".equals(fdageData.getString("location")) ? "sfm" : "slam",
|
|
|
- fdageData.getInteger("resolution"), buildType, path);
|
|
|
+ num, cameraType, fdageData.getString("location") != null && "1".equals(fdageData.getString("location")) ? "sfm" : "slam",
|
|
|
+ fdageData, buildType, path);
|
|
|
}else{
|
|
|
message = this.getBuildSceneMqMessage(
|
|
|
num, cameraType, fdageData.getString("location") != null && "1".equals(fdageData.getString("location")) ? "sfm" : "slam",
|
|
|
- fdageData.getInteger("resolution"), buildType,
|
|
|
- path);
|
|
|
+ fdageData, buildType, path);
|
|
|
}
|
|
|
if(deleteExtras){
|
|
|
message.getExt().put("deleteExtras",deleteExtras);
|
|
@@ -1462,7 +1475,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
fYunFileService.copyFileBetweenBucket(sourceBucet,fYunPath,fYunFileConfig.getBucket(),fYunPath);
|
|
|
}
|
|
|
// 下载data.fdage
|
|
|
- JSONObject fdageData = JSONObject.parseObject(fYunFileService.getFileContent(fYunPath + "/data.fdage"));
|
|
|
+ JSONObject fdageData = JSONObject.parseObject(fYunFileService.getFileContent(sourceBucet, fYunPath + "/data.fdage"));
|
|
|
if(ObjectUtils.isEmpty(fdageData)){
|
|
|
throw new BusinessException(ErrorCode.SYSTEM_ERROR.code(),"4dage 文件不存在");
|
|
|
}
|
|
@@ -1642,7 +1655,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
BuildSceneCallMessage buildSceneMqMessage = this.getBuildSceneMqMessage(
|
|
|
sceneNum, cameraType, jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
|
|
|
- jsonObject.getInteger("resolution"), buildType, dataSource);
|
|
|
+ jsonObject, buildType, dataSource);
|
|
|
rabbitMqProducer.sendByWorkQueue(queueV3ModelingPre, buildSceneMqMessage);
|
|
|
|
|
|
}
|