|
@@ -22,6 +22,7 @@ import com.fdkankan.common.util.FileUtils;
|
|
|
import com.fdkankan.common.util.SnowflakeIdGenerator;
|
|
|
import com.fdkankan.contro.constant.RedisConstants;
|
|
|
import com.fdkankan.contro.entity.*;
|
|
|
+import com.fdkankan.contro.enums.CameraTypeEnum;
|
|
|
import com.fdkankan.contro.mapper.ISceneFileBuildMapper;
|
|
|
import com.fdkankan.contro.service.ICommonService;
|
|
|
import com.fdkankan.contro.service.*;
|
|
@@ -429,7 +430,8 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
String algorithm = jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam";
|
|
|
|
|
|
ScenePlusVO scenePlusVO = this.createScenePlus(sceneNum, cameraDetail.getCameraId(), jsonObject.getString("creator"),
|
|
|
- jsonObject.getString("pwd"),cameraType, dataSource, icon, jsonObject.getLong("account"), userName,algorithm,
|
|
|
+ jsonObject.getString("pwd"),cameraType, jsonObject.getJSONObject("cam").getIntValue("type"),
|
|
|
+ dataSource, icon, jsonObject.getLong("account"), userName,algorithm,jsonObject.getInteger("location"),
|
|
|
jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
|
|
|
jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, cameraDetail.getCooperationUser());
|
|
@@ -439,7 +441,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) {
|
|
@@ -522,7 +524,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());
|
|
@@ -640,7 +642,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();
|
|
@@ -782,15 +784,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();
|
|
@@ -820,8 +824,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);
|
|
|
}
|
|
@@ -830,8 +834,8 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
public ScenePlusVO createScenePlus(String projectNum, Long cameraId, String phoneId, String sceneKey,
|
|
|
- Long cameraType, String dataSource, String pic, Long userId, String userName,
|
|
|
- String algorithm, Integer sceneShootCount, String sceneName,
|
|
|
+ Long cameraType, int camType, String dataSource, String pic, Long userId, String userName,
|
|
|
+ String algorithm, Integer location, Integer sceneShootCount, String sceneName,
|
|
|
String sceneDec, Integer sceneType, String gps,Integer type,
|
|
|
Integer resolution, String firmwareVersion, String url, String buildType,
|
|
|
Long cooperationUser)throws Exception{
|
|
@@ -843,26 +847,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(4);
|
|
|
- scenePlusExt.setSceneScheme(10);
|
|
|
- scenePlusExt.setModelKind(modelKind);
|
|
|
+ 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)
|
|
@@ -1145,17 +1152,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;
|
|
|
}
|
|
|
|
|
@@ -1244,11 +1253,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)) {
|
|
@@ -1258,14 +1267,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);
|
|
@@ -1372,7 +1379,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
BuildSceneCallMessage buildSceneMqMessage = this.getBuildSceneMqMessage(
|
|
|
num, cameraType, fdageData.getString("location") != null && "1".equals(fdageData.getString("location")) ? "sfm" : "slam",
|
|
|
- fdageData.getInteger("resolution"), buildType, path);
|
|
|
+ fdageData, buildType, path);
|
|
|
rabbitMqProducer.sendByWorkQueue(queueV3ModelingPre, buildSceneMqMessage);
|
|
|
|
|
|
//重算的场景,先移除该场景对应的容量
|
|
@@ -1397,7 +1404,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 文件不存在");
|
|
|
}
|
|
@@ -1459,7 +1466,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
cameraType = 13L;
|
|
|
}
|
|
|
|
|
|
- if (detailEntity.getType() == 10) {
|
|
|
+ if (CollUtil.isNotEmpty(laserCamTypeList) && laserCamTypeList.contains(detailEntity.getType())) {
|
|
|
cameraType = 14L;
|
|
|
}
|
|
|
|
|
@@ -1492,7 +1499,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
if (!ObjectUtils.isEmpty(detailEntity.getUserId())) {
|
|
|
userName = userService.getSSOUserByUserId(detailEntity.getUserId()).getUserName();
|
|
|
}
|
|
|
- fdkkLaserService.saveScene(scenePlus, fdageData.getString("pwd"), cameraEntity, userName, false);
|
|
|
+ fdkkLaserService.saveScene(scenePlus, fdageData, cameraEntity, userName, false);
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
@@ -1558,7 +1565,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);
|
|
|
|
|
|
}
|