|
@@ -2,9 +2,7 @@ package com.fdkankan.contro.mq.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
-import cn.hutool.core.thread.ThreadUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
-import cn.hutool.core.util.ZipUtil;
|
|
|
|
import cn.hutool.extra.qrcode.QrCodeUtil;
|
|
import cn.hutool.extra.qrcode.QrCodeUtil;
|
|
import cn.hutool.extra.qrcode.QrConfig;
|
|
import cn.hutool.extra.qrcode.QrConfig;
|
|
import cn.hutool.http.HttpUtil;
|
|
import cn.hutool.http.HttpUtil;
|
|
@@ -146,7 +144,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
private ILinkPanService linkPanService;
|
|
private ILinkPanService linkPanService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void buildScenePre(BuildSceneCallMessage message) throws Exception{
|
|
|
|
|
|
+ public void buildScenePre(BuildSceneCallMessage message) throws Exception {
|
|
String num = message.getSceneNum();
|
|
String num = message.getSceneNum();
|
|
try {
|
|
try {
|
|
Map<String, Object> sceneStatusParam = new HashMap<>();
|
|
Map<String, Object> sceneStatusParam = new HashMap<>();
|
|
@@ -154,11 +152,11 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
sceneStatusParam.put("status", 0);
|
|
sceneStatusParam.put("status", 0);
|
|
commonService.sendUpdateSceneStatusMqToQueues(sceneStatusParam);
|
|
commonService.sendUpdateSceneStatusMqToQueues(sceneStatusParam);
|
|
//重新计算时需要删除文件夹,否知使用缓存
|
|
//重新计算时需要删除文件夹,否知使用缓存
|
|
- if(new File(message.getPath() + File.separator + "results").exists()){
|
|
|
|
|
|
+ if (new File(message.getPath() + File.separator + "results").exists()) {
|
|
FileUtils.deleteDirectory(message.getPath() + File.separator + "results");
|
|
FileUtils.deleteDirectory(message.getPath() + File.separator + "results");
|
|
}
|
|
}
|
|
//由于刘强说caches会影响计算结果,所以这里删除caches
|
|
//由于刘强说caches会影响计算结果,所以这里删除caches
|
|
- if(new File(message.getPath() + File.separator + "caches").exists()){
|
|
|
|
|
|
+ if (new File(message.getPath() + File.separator + "caches").exists()) {
|
|
FileUtils.deleteDirectory(message.getPath() + File.separator + "caches");
|
|
FileUtils.deleteDirectory(message.getPath() + File.separator + "caches");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -167,7 +165,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
&& message.getExt().containsKey("deleteExtras")
|
|
&& message.getExt().containsKey("deleteExtras")
|
|
&& (Boolean) message.getExt().get("deleteExtras")) {
|
|
&& (Boolean) message.getExt().get("deleteExtras")) {
|
|
String extras = String.format(UploadFilePath.scene_result_data_path, num).concat("extras");
|
|
String extras = String.format(UploadFilePath.scene_result_data_path, num).concat("extras");
|
|
- if(CollUtil.isNotEmpty(fYunFileService.listRemoteFiles(extras))){
|
|
|
|
|
|
+ if (CollUtil.isNotEmpty(fYunFileService.listRemoteFiles(extras))) {
|
|
fYunFileService.deleteFolder(extras);
|
|
fYunFileService.deleteFolder(extras);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -180,9 +178,9 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
this.downLoadSource(message, message.getPath());
|
|
this.downLoadSource(message, message.getPath());
|
|
|
|
|
|
List<String> linkPanTargetList = linkPanService.genLinkPanPre(num);
|
|
List<String> linkPanTargetList = linkPanService.genLinkPanPre(num);
|
|
- if(CollUtil.isNotEmpty(linkPanTargetList)){
|
|
|
|
|
|
+ if (CollUtil.isNotEmpty(linkPanTargetList)) {
|
|
Map<String, Object> ext = message.getExt();
|
|
Map<String, Object> ext = message.getExt();
|
|
- if(Objects.isNull(ext)){
|
|
|
|
|
|
+ if (Objects.isNull(ext)) {
|
|
ext = new HashMap<>();
|
|
ext = new HashMap<>();
|
|
message.setExt(ext);
|
|
message.setExt(ext);
|
|
}
|
|
}
|
|
@@ -210,19 +208,19 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
if (rewrite) {
|
|
if (rewrite) {
|
|
Integer location = fdageJson.getInteger("location");
|
|
Integer location = fdageJson.getInteger("location");
|
|
- if(location != null && location == 6 && fdageJson.containsKey("exportMeshObj")){
|
|
|
|
|
|
+ if (location != null && location == 6 && fdageJson.containsKey("exportMeshObj")) {
|
|
fdageJson.remove("exportMeshObj");
|
|
fdageJson.remove("exportMeshObj");
|
|
}
|
|
}
|
|
FileUtils.writeFile(message.getPath().concat("/capture/data.fdage"), fdageJson.toJSONString());
|
|
FileUtils.writeFile(message.getPath().concat("/capture/data.fdage"), fdageJson.toJSONString());
|
|
}
|
|
}
|
|
|
|
|
|
- message.getBuildContext().put("cameraType",message.getCameraType());
|
|
|
|
|
|
+ message.getBuildContext().put("cameraType", message.getCameraType());
|
|
|
|
|
|
//查询是否超过比例50%,如果超过,则启动128G服务器弹性伸缩
|
|
//查询是否超过比例50%,如果超过,则启动128G服务器弹性伸缩
|
|
Float maxRate = fdageJson.getFloat("maxRate");
|
|
Float maxRate = fdageJson.getFloat("maxRate");
|
|
- if(env.equals("gn") && Objects.nonNull(maxRate) && maxRate > 50){
|
|
|
|
|
|
+ if (env.equals("gn") && Objects.nonNull(maxRate) && maxRate > 50) {
|
|
Map<String, Object> ext = message.getExt();
|
|
Map<String, Object> ext = message.getExt();
|
|
- if(Objects.isNull(ext)){
|
|
|
|
|
|
+ if (Objects.isNull(ext)) {
|
|
ext = new HashMap<>();
|
|
ext = new HashMap<>();
|
|
message.setExt(ext);
|
|
message.setExt(ext);
|
|
}
|
|
}
|
|
@@ -231,8 +229,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
log.info("场景计算资源准备结束,场景码:{}", message.getSceneNum());
|
|
log.info("场景计算资源准备结束,场景码:{}", message.getSceneNum());
|
|
|
|
|
|
- }catch (Exception e){
|
|
|
|
- log.error("场景计算前置处理出错,num"+num, e);
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("场景计算前置处理出错,num" + num, e);
|
|
buildSceneDTService.handBaseFail("场景计算资源准备异常!", message.getPath(), message.getSceneNum(), "计算控制服务器");
|
|
buildSceneDTService.handBaseFail("场景计算资源准备异常!", message.getPath(), message.getSceneNum(), "计算控制服务器");
|
|
haixinService.noticHaixin(num, false);
|
|
haixinService.noticHaixin(num, false);
|
|
throw e;
|
|
throw e;
|
|
@@ -250,7 +248,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void downLoadSource(BuildSceneCallMessage buildSceneMqMessage,String path){
|
|
|
|
|
|
+ public void downLoadSource(BuildSceneCallMessage buildSceneMqMessage, String path) {
|
|
String ossPath = getOssPath(path);
|
|
String ossPath = getOssPath(path);
|
|
fYunFileService.downloadFileByCommand(path + File.separator + "capture", ossPath);
|
|
fYunFileService.downloadFileByCommand(path + File.separator + "capture", ossPath);
|
|
}
|
|
}
|
|
@@ -278,12 +276,12 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
buildSceneDTService.handModelFail("计算失败", message.getPath(), sceneCode, message.getHostName());
|
|
buildSceneDTService.handModelFail("计算失败", message.getPath(), sceneCode, message.getHostName());
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- JSONObject fdageData = getFdageData(path + File.separator + "capture" +File.separator+"data.fdage");
|
|
|
|
|
|
+ JSONObject fdageData = getFdageData(path + File.separator + "capture" + File.separator + "data.fdage");
|
|
|
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneCode);
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneCode);
|
|
|
|
|
|
Integer cameraType = Integer.parseInt(message.getBuildContext().get("cameraType").toString());
|
|
Integer cameraType = Integer.parseInt(message.getBuildContext().get("cameraType").toString());
|
|
- Map<String, String> uploadFiles = getUploadFiles(scenePlus,path,cameraType,fdageData);
|
|
|
|
|
|
+ Map<String, String> uploadFiles = getUploadFiles(scenePlus, path, cameraType, fdageData);
|
|
|
|
|
|
scenePlus.setPayStatus(PayStatus.PAY.code());
|
|
scenePlus.setPayStatus(PayStatus.PAY.code());
|
|
scenePlus.setUpdateTime(new Date());
|
|
scenePlus.setUpdateTime(new Date());
|
|
@@ -306,10 +304,10 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
fYunFileService.uploadMulFiles(uploadFiles);
|
|
fYunFileService.uploadMulFiles(uploadFiles);
|
|
|
|
|
|
//修改oss上dam的内容编码
|
|
//修改oss上dam的内容编码
|
|
- Map<String,String> damFileHeaders = new HashMap<>();
|
|
|
|
- damFileHeaders.put("Content-Encoding","gzip");
|
|
|
|
|
|
+ Map<String, String> damFileHeaders = new HashMap<>();
|
|
|
|
+ damFileHeaders.put("Content-Encoding", "gzip");
|
|
String damPath = path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam";
|
|
String damPath = path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam";
|
|
- fYunFileService.uploadFile(damPath, String.format(UploadFilePath.IMG_VIEW_PATH, sceneCode) + ConstantFileName.modelUUID + "_50k.dam", damFileHeaders);
|
|
|
|
|
|
+ fYunFileService.uploadFile(damPath, String.format(UploadFilePath.IMG_VIEW_PATH, sceneCode) + ConstantFileName.modelUUID + "_50k.dam", damFileHeaders);
|
|
|
|
|
|
//拷贝部分文件到编辑目录,用于用户编辑
|
|
//拷贝部分文件到编辑目录,用于用户编辑
|
|
this.copyToEditDir(sceneCode);
|
|
this.copyToEditDir(sceneCode);
|
|
@@ -330,15 +328,11 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
//江门需求,算法识别平面图
|
|
//江门需求,算法识别平面图
|
|
commonService.uploadFloorplanAi(sceneCode, path);
|
|
commonService.uploadFloorplanAi(sceneCode, path);
|
|
|
|
|
|
- boolean detFloorplan = false;
|
|
|
|
- Map<String, Object> ext = message.getExt();
|
|
|
|
- if(CollUtil.isNotEmpty(ext) && ext.containsKey("detFloorplan") && Objects.nonNull(ext.get("detFloorplan"))){
|
|
|
|
- detFloorplan = (Boolean) ext.get("detFloorplan");
|
|
|
|
- }
|
|
|
|
|
|
+ LinkedHashMap<Integer, Boolean> detFloorplan = message.getDetFloorplan();
|
|
boolean hasFloorplanAi = commonService.detFloorPlanAi(sceneCode, path, detFloorplan);
|
|
boolean hasFloorplanAi = commonService.detFloorPlanAi(sceneCode, path, detFloorplan);
|
|
- if(hasFloorplanAi){
|
|
|
|
|
|
+ if (hasFloorplanAi) {
|
|
scenePlus.setHasFloorplanAi(CommonStatus.YES.code().intValue());
|
|
scenePlus.setHasFloorplanAi(CommonStatus.YES.code().intValue());
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
scenePlus.setHasFloorplanAi(CommonStatus.NO.code().intValue());
|
|
scenePlus.setHasFloorplanAi(CommonStatus.NO.code().intValue());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -359,12 +353,12 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
Long space = commonService.getSpace(sceneCode);
|
|
Long space = commonService.getSpace(sceneCode);
|
|
|
|
|
|
//写入数据库
|
|
//写入数据库
|
|
- this.updateDbPlus(scenePlus.getSceneSource(), space, videosJson.toJSONString(), message.getComputeTime(),isObj,scenePlusExt);
|
|
|
|
|
|
+ this.updateDbPlus(scenePlus.getSceneSource(), space, videosJson.toJSONString(), message.getComputeTime(), isObj, scenePlusExt);
|
|
|
|
|
|
Object[] editInfoArr = commonService.updateEditInfo(scenePlus);
|
|
Object[] editInfoArr = commonService.updateEditInfo(scenePlus);
|
|
- SceneEditInfo sceneEditInfo = (SceneEditInfo)editInfoArr[0];
|
|
|
|
- SceneEditInfoExt sceneEditInfoExt = (SceneEditInfoExt)editInfoArr[1];
|
|
|
|
- SceneEditControls sceneEditControls = (SceneEditControls)editInfoArr[2];
|
|
|
|
|
|
+ SceneEditInfo sceneEditInfo = (SceneEditInfo) editInfoArr[0];
|
|
|
|
+ SceneEditInfoExt sceneEditInfoExt = (SceneEditInfoExt) editInfoArr[1];
|
|
|
|
+ SceneEditControls sceneEditControls = (SceneEditControls) editInfoArr[2];
|
|
sceneEditInfoExt.setLinks(links);
|
|
sceneEditInfoExt.setLinks(links);
|
|
sceneEditInfoExtService.updateById(sceneEditInfoExt);
|
|
sceneEditInfoExtService.updateById(sceneEditInfoExt);
|
|
|
|
|
|
@@ -377,11 +371,11 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
if (cameraType == 14) {
|
|
if (cameraType == 14) {
|
|
//计算成功 激光转台相机 同步 请求
|
|
//计算成功 激光转台相机 同步 请求
|
|
fdkkLaserService.syncBuildResult(scenePlus.getNum(), path, scenePlus.getCreateTime(), Calendar.getInstance().getTime(), scenePlusExt.getShootCount(), scenePlus.getPayStatus());
|
|
fdkkLaserService.syncBuildResult(scenePlus.getNum(), path, scenePlus.getCreateTime(), Calendar.getInstance().getTime(), scenePlusExt.getShootCount(), scenePlus.getPayStatus());
|
|
- sceneEditControlsService.update(new LambdaUpdateWrapper<SceneEditControls>().set(SceneEditControls::getShowMap,0)
|
|
|
|
- .eq(SceneEditControls::getEditInfoId,sceneEditInfo.getId()));
|
|
|
|
|
|
+ sceneEditControlsService.update(new LambdaUpdateWrapper<SceneEditControls>().set(SceneEditControls::getShowMap, 0)
|
|
|
|
+ .eq(SceneEditControls::getEditInfoId, sceneEditInfo.getId()));
|
|
sceneEditControls.setShowMap(0);
|
|
sceneEditControls.setShowMap(0);
|
|
} else if (new File(path + "/results/laserData/vision_edit.txt").exists()) {
|
|
} else if (new File(path + "/results/laserData/vision_edit.txt").exists()) {
|
|
- fdkkLaserService.cloudPointBuild(sceneCode,path);
|
|
|
|
|
|
+ fdkkLaserService.cloudPointBuild(sceneCode, path);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -389,7 +383,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
CameraDetail cameraDetail = cameraDetailService.getByCameraId(scenePlus.getCameraId());
|
|
CameraDetail cameraDetail = cameraDetailService.getByCameraId(scenePlus.getCameraId());
|
|
Company company = !ObjectUtils.isEmpty(cameraDetail.getCompanyId()) ? companyService.getById(cameraDetail.getCompanyId()) : null;
|
|
Company company = !ObjectUtils.isEmpty(cameraDetail.getCompanyId()) ? companyService.getById(cameraDetail.getCompanyId()) : null;
|
|
//写scene.json
|
|
//写scene.json
|
|
- commonService.writeSceneJson(sceneCode, videosJson,sceneEditInfo, sceneEditInfoExt, sceneEditControls, scenePlus,scenePlusExt,company);
|
|
|
|
|
|
+ commonService.writeSceneJson(sceneCode, videosJson, sceneEditInfo, sceneEditInfoExt, sceneEditControls, scenePlus, scenePlusExt, company);
|
|
|
|
|
|
String qrLogo = !ObjectUtils.isEmpty(company) && !ObjectUtils.isEmpty(company.getQrLogo()) ? company.getQrLogo() : null;
|
|
String qrLogo = !ObjectUtils.isEmpty(company) && !ObjectUtils.isEmpty(company.getQrLogo()) ? company.getQrLogo() : null;
|
|
|
|
|
|
@@ -400,10 +394,10 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
//计算成功,通知APP
|
|
//计算成功,通知APP
|
|
Integer pushChannel = fdageData.getInteger("pushChannel");
|
|
Integer pushChannel = fdageData.getInteger("pushChannel");
|
|
String pushToken = fdageData.getString("pushToken");
|
|
String pushToken = fdageData.getString("pushToken");
|
|
- this.pushMsgToApp(pushChannel,pushToken, cameraType, scenePlus.getTitle(), scenePlusExt.getWebSite());
|
|
|
|
|
|
+ this.pushMsgToApp(pushChannel, pushToken, cameraType, scenePlus.getTitle(), scenePlusExt.getWebSite());
|
|
|
|
|
|
// //删除计算目录
|
|
// //删除计算目录
|
|
- if(CollUtil.isEmpty(notDeleteNasNumList) || !notDeleteNasNumList.contains(sceneCode)){
|
|
|
|
|
|
+ if (CollUtil.isEmpty(notDeleteNasNumList) || !notDeleteNasNumList.contains(sceneCode)) {
|
|
CreateObjUtil.deleteFile(path.replace(ConstantFilePath.BUILD_MODEL_PATH, "/"));
|
|
CreateObjUtil.deleteFile(path.replace(ConstantFilePath.BUILD_MODEL_PATH, "/"));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -414,7 +408,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
scenePlusExtService.updateById(scenePlusExt);
|
|
scenePlusExtService.updateById(scenePlusExt);
|
|
|
|
|
|
//国际环境需要发邮件通知
|
|
//国际环境需要发邮件通知
|
|
- if("eur".equals(env)){
|
|
|
|
|
|
+ if ("eur".equals(env)) {
|
|
commonService.sendEmail(sceneCode);
|
|
commonService.sendEmail(sceneCode);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -422,8 +416,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
log.info("场景计算结果处理结束,场景码:{}", sceneCode);
|
|
log.info("场景计算结果处理结束,场景码:{}", sceneCode);
|
|
|
|
|
|
- }catch (Exception e){
|
|
|
|
- log.error("场景计算结果处理出错,num"+sceneCode, e);
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("场景计算结果处理出错,num" + sceneCode, e);
|
|
buildSceneDTService.handBaseFail("场景计算结果处理出错!", message.getPath(), sceneCode, "计算控制服务器");
|
|
buildSceneDTService.handBaseFail("场景计算结果处理出错!", message.getPath(), sceneCode, "计算控制服务器");
|
|
throw e;
|
|
throw e;
|
|
} finally {
|
|
} finally {
|
|
@@ -437,9 +431,9 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void removeSceneAsynOperLog(String num){
|
|
|
|
|
|
+ private void removeSceneAsynOperLog(String num) {
|
|
List<SceneAsynOperLog> list = sceneAsynOperLogService.list(new LambdaQueryWrapper<SceneAsynOperLog>().eq(SceneAsynOperLog::getNum, num));
|
|
List<SceneAsynOperLog> list = sceneAsynOperLogService.list(new LambdaQueryWrapper<SceneAsynOperLog>().eq(SceneAsynOperLog::getNum, num));
|
|
- if(CollUtil.isEmpty(list)){
|
|
|
|
|
|
+ if (CollUtil.isEmpty(list)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
//删除数据库记录
|
|
//删除数据库记录
|
|
@@ -447,7 +441,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
sceneAsynOperLogService.removeByIds(deleteIdList);
|
|
sceneAsynOperLogService.removeByIds(deleteIdList);
|
|
|
|
|
|
list.parallelStream().forEach(item -> {
|
|
list.parallelStream().forEach(item -> {
|
|
- if(StrUtil.isNotEmpty(item.getUrl())){
|
|
|
|
|
|
+ if (StrUtil.isNotEmpty(item.getUrl())) {
|
|
try {
|
|
try {
|
|
fYunFileService.deleteFile(item.getUrl());
|
|
fYunFileService.deleteFile(item.getUrl());
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
@@ -475,7 +469,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
// });
|
|
// });
|
|
// }
|
|
// }
|
|
|
|
|
|
- private Map<String, String> getUploadFiles(ScenePlus scenePlus,String path,Integer cameraType,JSONObject fdageData) throws Exception {
|
|
|
|
|
|
+ private Map<String, String> getUploadFiles(ScenePlus scenePlus, String path, Integer cameraType, JSONObject fdageData) throws Exception {
|
|
if (ObjectUtils.isEmpty(scenePlus)) {
|
|
if (ObjectUtils.isEmpty(scenePlus)) {
|
|
throw new Exception("未找到场景信息:" + path);
|
|
throw new Exception("未找到场景信息:" + path);
|
|
}
|
|
}
|
|
@@ -545,34 +539,34 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
//exportMeshObj这个是字段由app写入的
|
|
//exportMeshObj这个是字段由app写入的
|
|
boolean genModel = true;//是否生成模型 默认生成,深时场景要根据 exportMeshObj判断是否生成
|
|
boolean genModel = true;//是否生成模型 默认生成,深时场景要根据 exportMeshObj判断是否生成
|
|
- if(!ObjectUtils.isEmpty(cameraType)
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(cameraType)
|
|
&& cameraType == 14
|
|
&& cameraType == 14
|
|
- && (!fdageData.containsKey("exportMeshObj") || fdageData.getIntValue("exportMeshObj") != 1)){
|
|
|
|
|
|
+ && (!fdageData.containsKey("exportMeshObj") || fdageData.getIntValue("exportMeshObj") != 1)) {
|
|
genModel = false;
|
|
genModel = false;
|
|
}
|
|
}
|
|
boolean gen3dTiles = true;//是否生成3dtiles模型 默认生成
|
|
boolean gen3dTiles = true;//是否生成3dtiles模型 默认生成
|
|
- if(!ModelKind.THREE_D_TILE.code().equals(modelKind)
|
|
|
|
|
|
+ if (!ModelKind.THREE_D_TILE.code().equals(modelKind)
|
|
|| CollUtil.isEmpty(sdTilesSceneSourceList)
|
|
|| CollUtil.isEmpty(sdTilesSceneSourceList)
|
|
- || !sdTilesSceneSourceList.contains(scenePlus.getSceneSource())){
|
|
|
|
|
|
+ || !sdTilesSceneSourceList.contains(scenePlus.getSceneSource())) {
|
|
gen3dTiles = false;
|
|
gen3dTiles = false;
|
|
}
|
|
}
|
|
|
|
|
|
log.info("--------------genModel:{}, gen3dTiles:{}----------------------", genModel, gen3dTiles);
|
|
log.info("--------------genModel:{}, gen3dTiles:{}----------------------", genModel, gen3dTiles);
|
|
|
|
|
|
- if(genModel){
|
|
|
|
|
|
+ if (genModel) {
|
|
if (!gen3dTiles) {
|
|
if (!gen3dTiles) {
|
|
String damPath = path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam";
|
|
String damPath = path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam";
|
|
CreateObjUtil.convertTxtToDam(path + File.separator + "results" + File.separator + "tex" + File.separator + "modeldata.txt", damPath);
|
|
CreateObjUtil.convertTxtToDam(path + File.separator + "results" + File.separator + "tex" + File.separator + "modeldata.txt", damPath);
|
|
// FileUtil.writeBytes(ZipUtil.gzip(new File(damPath)), damPath);
|
|
// FileUtil.writeBytes(ZipUtil.gzip(new File(damPath)), damPath);
|
|
map.put(damPath, imagesPath + ConstantFileName.modelUUID + "_50k.dam");
|
|
map.put(damPath, imagesPath + ConstantFileName.modelUUID + "_50k.dam");
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
List<String> list = FileUtils.list(new File(path + File.separator + "results" + File.separator + ModelKind.THREE_D_TILE.code()));
|
|
List<String> list = FileUtils.list(new File(path + File.separator + "results" + File.separator + ModelKind.THREE_D_TILE.code()));
|
|
log.info("3dtiles list:{}", JSON.toJSONString(list));
|
|
log.info("3dtiles list:{}", JSON.toJSONString(list));
|
|
- if(CollUtil.isEmpty(list)){
|
|
|
|
|
|
+ if (CollUtil.isEmpty(list)) {
|
|
log.error("3dtiles目录异常,3dtiles地址:{}", new File(path + File.separator + "results" + File.separator + ModelKind.THREE_D_TILE.code()));
|
|
log.error("3dtiles目录异常,3dtiles地址:{}", new File(path + File.separator + "results" + File.separator + ModelKind.THREE_D_TILE.code()));
|
|
throw new Exception("3dtiles目录异常");
|
|
throw new Exception("3dtiles目录异常");
|
|
}
|
|
}
|
|
- list.stream().forEach(str->{
|
|
|
|
|
|
+ list.stream().forEach(str -> {
|
|
map.put(str, str.replace(path + File.separator + "results" + File.separator, imagesPath));
|
|
map.put(str, str.replace(path + File.separator + "results" + File.separator, imagesPath));
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -583,7 +577,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
map.put(resultsPath + "vision.modeldata", imagesPath + "vision.modeldata");
|
|
map.put(resultsPath + "vision.modeldata", imagesPath + "vision.modeldata");
|
|
|
|
|
|
log.info("数据转换完成:" + projectNum);
|
|
log.info("数据转换完成:" + projectNum);
|
|
- if(!new File("/mnt/4Dkankan/scene/data" + File.separator + "data" + projectNum).exists()){
|
|
|
|
|
|
+ if (!new File("/mnt/4Dkankan/scene/data" + File.separator + "data" + projectNum).exists()) {
|
|
FileUtil.mkdir("/mnt/4Dkankan/scene/data" + File.separator + "data" + projectNum);
|
|
FileUtil.mkdir("/mnt/4Dkankan/scene/data" + File.separator + "data" + projectNum);
|
|
}
|
|
}
|
|
// map.put(resultsPath + "floorplan.json", dataViewPath + "floor.json");
|
|
// map.put(resultsPath + "floorplan.json", dataViewPath + "floor.json");
|
|
@@ -602,20 +596,20 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
String data = FileUtils.readFile(dataFdagePath);
|
|
String data = FileUtils.readFile(dataFdagePath);
|
|
//获取data.fdage的内容
|
|
//获取data.fdage的内容
|
|
JSONObject dataJson = new JSONObject();
|
|
JSONObject dataJson = new JSONObject();
|
|
- if(data!=null){
|
|
|
|
|
|
+ if (data != null) {
|
|
dataJson = JSONObject.parseObject(data);
|
|
dataJson = JSONObject.parseObject(data);
|
|
}
|
|
}
|
|
return dataJson;
|
|
return dataJson;
|
|
}
|
|
}
|
|
|
|
|
|
- private void uploadFloorCad(String path, String num, Map<String, String> uploadFiles){
|
|
|
|
|
|
+ private void uploadFloorCad(String path, String num, Map<String, String> uploadFiles) {
|
|
|
|
|
|
//户型图上传
|
|
//户型图上传
|
|
- String dataViewPath = UploadFilePath.DATA_VIEW_PATH + "floor-cad-%s.%s";
|
|
|
|
|
|
+ String dataViewPath = UploadFilePath.DATA_VIEW_PATH + "floor-cad-%s.%s";
|
|
String floorCadPath = path + "/results/floorplan_cad";
|
|
String floorCadPath = path + "/results/floorplan_cad";
|
|
List<String> floorCadList = FileUtils.getFileList(floorCadPath);
|
|
List<String> floorCadList = FileUtils.getFileList(floorCadPath);
|
|
- if(CollUtil.isNotEmpty(floorCadList)){
|
|
|
|
- floorCadList.stream().forEach(str->{
|
|
|
|
|
|
+ if (CollUtil.isNotEmpty(floorCadList)) {
|
|
|
|
+ floorCadList.stream().forEach(str -> {
|
|
String substring = str.substring(str.lastIndexOf(File.separator) + 1);
|
|
String substring = str.substring(str.lastIndexOf(File.separator) + 1);
|
|
String[] arr = substring.split("floor");
|
|
String[] arr = substring.split("floor");
|
|
String[] arr2 = arr[1].split("\\.");
|
|
String[] arr2 = arr[1].split("\\.");
|
|
@@ -625,12 +619,12 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- private void uploadStatusJson(ScenePlus scenePlus, ScenePlusExt scenePlusExt){
|
|
|
|
|
|
+ private void uploadStatusJson(ScenePlus scenePlus, ScenePlusExt scenePlusExt) {
|
|
String num = scenePlus.getNum();
|
|
String num = scenePlus.getNum();
|
|
String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, num);
|
|
String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, num);
|
|
|
|
|
|
Integer status = 1;
|
|
Integer status = 1;
|
|
- if(scenePlus.getSceneSource() == 4 || scenePlus.getSceneSource() == 5){//如果是激光场景,需要激光系统那边完全处理好之后再发mq通知更新状态
|
|
|
|
|
|
+ if (scenePlus.getSceneSource() == 4 || scenePlus.getSceneSource() == 5) {//如果是激光场景,需要激光系统那边完全处理好之后再发mq通知更新状态
|
|
status = 0;
|
|
status = 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -660,12 +654,12 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//生成二维码
|
|
//生成二维码
|
|
- String outPathZh = ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+ num +".png";
|
|
|
|
- String outPathEn = ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+ num +"_en.png";
|
|
|
|
|
|
+ String outPathZh = ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/" + num + ".png";
|
|
|
|
+ String outPathEn = ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/" + num + "_en.png";
|
|
QrConfig qrConfig = QrConfig.create();
|
|
QrConfig qrConfig = QrConfig.create();
|
|
qrConfig.setWidth(1024);
|
|
qrConfig.setWidth(1024);
|
|
qrConfig.setHeight(1024);
|
|
qrConfig.setHeight(1024);
|
|
- if(StrUtil.isNotEmpty(localLogoPath)){
|
|
|
|
|
|
+ if (StrUtil.isNotEmpty(localLogoPath)) {
|
|
qrConfig.setImg(localLogoPath);
|
|
qrConfig.setImg(localLogoPath);
|
|
}
|
|
}
|
|
QrCodeUtil.generate(scenePlusExt.getWebSite(), qrConfig, FileUtil.file(outPathZh));
|
|
QrCodeUtil.generate(scenePlusExt.getWebSite(), qrConfig, FileUtil.file(outPathZh));
|
|
@@ -674,52 +668,52 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
fYunFileService.uploadFile(outPathZh, String.format(UploadFilePath.DOWNLOADS_QRCODE, num) + num + ".png");
|
|
fYunFileService.uploadFile(outPathZh, String.format(UploadFilePath.DOWNLOADS_QRCODE, num) + num + ".png");
|
|
fYunFileService.uploadFile(outPathEn, String.format(UploadFilePath.DOWNLOADS_QRCODE, num) + num + "_en.png");
|
|
fYunFileService.uploadFile(outPathEn, String.format(UploadFilePath.DOWNLOADS_QRCODE, num) + num + "_en.png");
|
|
|
|
|
|
- if(!ObjectUtils.isEmpty(localLogoPath)){
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(localLogoPath)) {
|
|
FileUtils.deleteFile(localLogoPath);
|
|
FileUtils.deleteFile(localLogoPath);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void pushMsgToApp(Integer pushChannel, String pushToken, int cameraType, String sceneName, String webSite){
|
|
|
|
|
|
+ private void pushMsgToApp(Integer pushChannel, String pushToken, int cameraType, String sceneName, String webSite) {
|
|
log.info("推送消息,渠道是 {}, 手机token是 {}", pushChannel, pushToken);
|
|
log.info("推送消息,渠道是 {}, 手机token是 {}", pushChannel, pushToken);
|
|
- if(Objects.isNull(pushChannel) || StrUtil.isBlank(pushToken)){
|
|
|
|
|
|
+ if (Objects.isNull(pushChannel) || StrUtil.isBlank(pushToken)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
String title = sceneName + "计算完成";
|
|
String title = sceneName + "计算完成";
|
|
String body = "您上传的" + sceneName + "计算完成,点击查看";
|
|
String body = "您上传的" + sceneName + "计算完成,点击查看";
|
|
|
|
|
|
- try{
|
|
|
|
- if(FYunTypeEnum.AWS.code().equals(fYunFileService.getFyunType())){
|
|
|
|
|
|
+ try {
|
|
|
|
+ if (FYunTypeEnum.AWS.code().equals(fYunFileService.getFyunType())) {
|
|
PushMsgUtil.googlePushMsg(ConstantFilePath.BASE_PATH + "/refreshToken.json", pushToken,
|
|
PushMsgUtil.googlePushMsg(ConstantFilePath.BASE_PATH + "/refreshToken.json", pushToken,
|
|
- title, body , webSite);
|
|
|
|
|
|
+ title, body, webSite);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
PushMessageConfig pushConfig = null;
|
|
PushMessageConfig pushConfig = null;
|
|
- if(pushChannel == 0){
|
|
|
|
- if(cameraType == 10 || cameraType == 13){
|
|
|
|
|
|
+ if (pushChannel == 0) {
|
|
|
|
+ if (cameraType == 10 || cameraType == 13) {
|
|
//ios
|
|
//ios
|
|
pushConfig = new PushMessageConfig(PushMessageConfig.IOS_KEY_Z, PushMessageConfig.IOS_SECRET_Z);
|
|
pushConfig = new PushMessageConfig(PushMessageConfig.IOS_KEY_Z, PushMessageConfig.IOS_SECRET_Z);
|
|
- pushConfig.sendIOSUnicast(pushToken, "四维看看Minion",title, body, webSite);
|
|
|
|
- }else {
|
|
|
|
|
|
+ pushConfig.sendIOSUnicast(pushToken, "四维看看Minion", title, body, webSite);
|
|
|
|
+ } else {
|
|
//ios
|
|
//ios
|
|
pushConfig = new PushMessageConfig(PushMessageConfig.IOS_KEY, PushMessageConfig.IOS_SECRET);
|
|
pushConfig = new PushMessageConfig(PushMessageConfig.IOS_KEY, PushMessageConfig.IOS_SECRET);
|
|
- pushConfig.sendIOSUnicast(pushToken, "四维看看Pro",title, body, webSite);
|
|
|
|
|
|
+ pushConfig.sendIOSUnicast(pushToken, "四维看看Pro", title, body, webSite);
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
- if(cameraType == 10 || cameraType == 13){
|
|
|
|
|
|
+ } else {
|
|
|
|
+ if (cameraType == 10 || cameraType == 13) {
|
|
//ios
|
|
//ios
|
|
//安卓
|
|
//安卓
|
|
pushConfig = new PushMessageConfig(PushMessageConfig.ANDROID_KEY_Z, PushMessageConfig.ANDROID_SECRET_Z);
|
|
pushConfig = new PushMessageConfig(PushMessageConfig.ANDROID_KEY_Z, PushMessageConfig.ANDROID_SECRET_Z);
|
|
- pushConfig.sendAndroidUnicast2(pushToken, "四维看看Minion",title, body, webSite);
|
|
|
|
- }else {
|
|
|
|
|
|
+ pushConfig.sendAndroidUnicast2(pushToken, "四维看看Minion", title, body, webSite);
|
|
|
|
+ } else {
|
|
//安卓
|
|
//安卓
|
|
pushConfig = new PushMessageConfig(PushMessageConfig.ANDROID_KEY, PushMessageConfig.ANDROID_SECRET);
|
|
pushConfig = new PushMessageConfig(PushMessageConfig.ANDROID_KEY, PushMessageConfig.ANDROID_SECRET);
|
|
- pushConfig.sendAndroidUnicast(pushToken, "四维看看Pro",title, body, webSite);
|
|
|
|
|
|
+ pushConfig.sendAndroidUnicast(pushToken, "四维看看Pro", title, body, webSite);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
log.info("消息推送结束!");
|
|
log.info("消息推送结束!");
|
|
- }catch (Exception e){
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
log.error("推送消息失败:", e);
|
|
log.error("推送消息失败:", e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -738,7 +732,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
map.put(editDataPath + "floorplan_cad.json", viewDataPath + "floorplan_cad.json");
|
|
map.put(editDataPath + "floorplan_cad.json", viewDataPath + "floorplan_cad.json");
|
|
|
|
|
|
for (Entry<String, String> entry : map.entrySet()) {
|
|
for (Entry<String, String> entry : map.entrySet()) {
|
|
- fYunFileService.copyFileInBucket(entry.getValue(), entry.getKey());
|
|
|
|
|
|
+ fYunFileService.copyFileInBucket(entry.getValue(), entry.getKey());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -747,23 +741,23 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
Map<String, Object> videoMap = new HashMap<>();
|
|
Map<String, Object> videoMap = new HashMap<>();
|
|
String videosHdr = FileUtils.readFile(path + File.separator + "results/videos/videos_hdr_param.json");
|
|
String videosHdr = FileUtils.readFile(path + File.separator + "results/videos/videos_hdr_param.json");
|
|
JSONArray videoArray = null;
|
|
JSONArray videoArray = null;
|
|
- if(StringUtils.isNotEmpty(videosHdr)){
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(videosHdr)) {
|
|
videoArray = JSONObject.parseObject(videosHdr).getJSONArray("hdr_param");
|
|
videoArray = JSONObject.parseObject(videosHdr).getJSONArray("hdr_param");
|
|
}
|
|
}
|
|
- if(videoArray != null){
|
|
|
|
- for(int i = 0, len = videoArray.size(); i < len; i++) {
|
|
|
|
|
|
+ if (videoArray != null) {
|
|
|
|
+ for (int i = 0, len = videoArray.size(); i < len; i++) {
|
|
videoMap.put(videoArray.getJSONObject(i).getString("name"), videoArray.getJSONObject(i).getString("value"));
|
|
videoMap.put(videoArray.getJSONObject(i).getString("name"), videoArray.getJSONObject(i).getString("value"));
|
|
- if(videoArray.getJSONObject(i).containsKey("fov")){
|
|
|
|
|
|
+ if (videoArray.getJSONObject(i).containsKey("fov")) {
|
|
videoMap.put(videoArray.getJSONObject(i).getString("name") + "_fov", videoArray.getJSONObject(i).getString("fov"));
|
|
videoMap.put(videoArray.getJSONObject(i).getString("name") + "_fov", videoArray.getJSONObject(i).getString("fov"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
//获取upload中的video视频名称
|
|
//获取upload中的video视频名称
|
|
- String uploadData = FileUtils.readFile(path + File.separator + "results" +File.separator+"upload.json");
|
|
|
|
|
|
+ String uploadData = FileUtils.readFile(path + File.separator + "results" + File.separator + "upload.json");
|
|
JSONObject uploadJson = null;
|
|
JSONObject uploadJson = null;
|
|
JSONArray array = null;
|
|
JSONArray array = null;
|
|
- if(uploadData!=null) {
|
|
|
|
|
|
+ if (uploadData != null) {
|
|
uploadJson = JSONObject.parseObject(uploadData);
|
|
uploadJson = JSONObject.parseObject(uploadData);
|
|
array = uploadJson.getJSONArray("upload");
|
|
array = uploadJson.getJSONArray("upload");
|
|
}
|
|
}
|
|
@@ -775,25 +769,25 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
JSONObject videoJson = null;
|
|
JSONObject videoJson = null;
|
|
JSONObject videosJson = new JSONObject();
|
|
JSONObject videosJson = new JSONObject();
|
|
long videoSize = 0L;
|
|
long videoSize = 0L;
|
|
- for(int i = 0, len = array.size(); i < len; i++) {
|
|
|
|
|
|
+ for (int i = 0, len = array.size(); i < len; i++) {
|
|
fileJson = array.getJSONObject(i);
|
|
fileJson = array.getJSONObject(i);
|
|
fileName = fileJson.getString("file");
|
|
fileName = fileJson.getString("file");
|
|
- if(fileJson.getIntValue("clazz") == 11 && fileName.contains(".mp4") && !fileName.contains("-ios.mp4")){
|
|
|
|
|
|
+ if (fileJson.getIntValue("clazz") == 11 && fileName.contains(".mp4") && !fileName.contains("-ios.mp4")) {
|
|
videoJson = new JSONObject();
|
|
videoJson = new JSONObject();
|
|
videoJson.put("id", fileName.substring(
|
|
videoJson.put("id", fileName.substring(
|
|
- 0, fileName.lastIndexOf(".")).replace("videos/", ""));
|
|
|
|
|
|
+ 0, fileName.lastIndexOf(".")).replace("videos/", ""));
|
|
|
|
|
|
//如果ts文件存在,就计算ts大小
|
|
//如果ts文件存在,就计算ts大小
|
|
- if(new File(path + File.separator + "results" +File.separator+ fileName.replace(".mp4", ".ts")).exists()){
|
|
|
|
- videoSize = new File(path + File.separator + "results" +File.separator+ fileName.replace(".mp4", ".ts")).length();
|
|
|
|
|
|
+ if (new File(path + File.separator + "results" + File.separator + fileName.replace(".mp4", ".ts")).exists()) {
|
|
|
|
+ videoSize = new File(path + File.separator + "results" + File.separator + fileName.replace(".mp4", ".ts")).length();
|
|
videoJson.put("tsSize", videoSize);
|
|
videoJson.put("tsSize", videoSize);
|
|
}
|
|
}
|
|
- if(videoMap.containsKey(videoJson.get("id"))){
|
|
|
|
|
|
+ if (videoMap.containsKey(videoJson.get("id"))) {
|
|
videoJson.put("value", videoMap.get(videoJson.get("id")));
|
|
videoJson.put("value", videoMap.get(videoJson.get("id")));
|
|
}
|
|
}
|
|
- if(videoMap.containsKey(videoJson.get("id") + "_fov")){
|
|
|
|
|
|
+ if (videoMap.containsKey(videoJson.get("id") + "_fov")) {
|
|
videoJson.put("blend_fov", videoMap.get(videoJson.get("id") + "_fov"));
|
|
videoJson.put("blend_fov", videoMap.get(videoJson.get("id") + "_fov"));
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
videoJson.put("blend_fov", 7);
|
|
videoJson.put("blend_fov", 7);
|
|
}
|
|
}
|
|
jsonArray.add(videoJson);
|
|
jsonArray.add(videoJson);
|
|
@@ -801,30 +795,31 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
}
|
|
}
|
|
|
|
|
|
videosJson.put("data", jsonArray);
|
|
videosJson.put("data", jsonArray);
|
|
- if(Objects.nonNull(videoVersion) && videoVersion >= 4){
|
|
|
|
|
|
+ if (Objects.nonNull(videoVersion) && videoVersion >= 4) {
|
|
videosJson.put("version", 3);
|
|
videosJson.put("version", 3);
|
|
videosJson.put("upPath", String.format(UploadFilePath.DATA_VIEW_PATH, projectNum) + "Up.xml");
|
|
videosJson.put("upPath", String.format(UploadFilePath.DATA_VIEW_PATH, projectNum) + "Up.xml");
|
|
- if(cameraType == 13 || cameraType == 14){
|
|
|
|
|
|
+ if (cameraType == 13 || cameraType == 14) {
|
|
//转台相机
|
|
//转台相机
|
|
videosJson.put("upPath", videosJson.getString("upPath").replace(".xml", ".txt"));
|
|
videosJson.put("upPath", videosJson.getString("upPath").replace(".xml", ".txt"));
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
videosJson.put("version", 1);
|
|
videosJson.put("version", 1);
|
|
videosJson.put("upPath", String.format(UploadFilePath.DATA_VIEW_PATH, projectNum) + "Up2.xml");
|
|
videosJson.put("upPath", String.format(UploadFilePath.DATA_VIEW_PATH, projectNum) + "Up2.xml");
|
|
- if(cameraType == 13 || cameraType == 14){
|
|
|
|
|
|
+ if (cameraType == 13 || cameraType == 14) {
|
|
//转台相机
|
|
//转台相机
|
|
videosJson.put("upPath", videosJson.getString("upPath").replace(".xml", ".txt"));
|
|
videosJson.put("upPath", videosJson.getString("upPath").replace(".xml", ".txt"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if(cameraType == 5 || cameraType == 6){
|
|
|
|
|
|
+ if (cameraType == 5 || cameraType == 6) {
|
|
videosJson.put("version", 1);
|
|
videosJson.put("version", 1);
|
|
videosJson.put("upPath", String.format(UploadFilePath.DATA_VIEW_PATH, projectNum) + "stitch_params.txt");
|
|
videosJson.put("upPath", String.format(UploadFilePath.DATA_VIEW_PATH, projectNum) + "stitch_params.txt");
|
|
}
|
|
}
|
|
|
|
|
|
return videosJson;
|
|
return videosJson;
|
|
}
|
|
}
|
|
- private void updateDbPlus(int sceneSource,Long space,String videosJson, Long computeTime,boolean isObj,ScenePlusExt scenePlusExt){
|
|
|
|
|
|
+
|
|
|
|
+ private void updateDbPlus(int sceneSource, Long space, String videosJson, Long computeTime, boolean isObj, ScenePlusExt scenePlusExt) {
|
|
|
|
|
|
scenePlusExt.setSpace(space);
|
|
scenePlusExt.setSpace(space);
|
|
scenePlusExt.setComputeTime(computeTime.toString());
|
|
scenePlusExt.setComputeTime(computeTime.toString());
|
|
@@ -832,11 +827,11 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
scenePlusExt.setVideos(videosJson);
|
|
scenePlusExt.setVideos(videosJson);
|
|
scenePlusExt.setIsObj(isObj ? 1 : 0);
|
|
scenePlusExt.setIsObj(isObj ? 1 : 0);
|
|
|
|
|
|
- if(ModelTypeEnums.TILE_CODE.equals(modelType)){
|
|
|
|
|
|
+ if (ModelTypeEnums.TILE_CODE.equals(modelType)) {
|
|
scenePlusExt.setSceneScheme(3);
|
|
scenePlusExt.setSceneScheme(3);
|
|
}
|
|
}
|
|
|
|
|
|
- switch (SceneSource.get(sceneSource)){
|
|
|
|
|
|
+ switch (SceneSource.get(sceneSource)) {
|
|
case BM:
|
|
case BM:
|
|
scenePlusExt.setSceneResolution(SceneResolution.two_K.code());
|
|
scenePlusExt.setSceneResolution(SceneResolution.two_K.code());
|
|
scenePlusExt.setSceneFrom(SceneFrom.PRO.code());
|
|
scenePlusExt.setSceneFrom(SceneFrom.PRO.code());
|
|
@@ -859,7 +854,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
- String sceneKind = scenePlusExt.getSceneScheme() == 3 ? SceneKind.FACE.code():SceneKind.TILES.code();
|
|
|
|
|
|
+ String sceneKind = scenePlusExt.getSceneScheme() == 3 ? SceneKind.FACE.code() : SceneKind.TILES.code();
|
|
scenePlusExt.setSceneKind(sceneKind);
|
|
scenePlusExt.setSceneKind(sceneKind);
|
|
// scenePlusExt.setModelKind(modelKind);
|
|
// scenePlusExt.setModelKind(modelKind);
|
|
|
|
|
|
@@ -869,27 +864,27 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
scenePlusExtService.updateById(scenePlusExt);
|
|
scenePlusExtService.updateById(scenePlusExt);
|
|
}
|
|
}
|
|
|
|
|
|
- private Integer getShootCount(ScenePlusExt scenePlusExt){
|
|
|
|
|
|
+ private Integer getShootCount(ScenePlusExt scenePlusExt) {
|
|
Integer shootCount = null;
|
|
Integer shootCount = null;
|
|
String homePath = SceneUtil.getHomePath(scenePlusExt.getDataSource());
|
|
String homePath = SceneUtil.getHomePath(scenePlusExt.getDataSource());
|
|
JSONObject dataFdageObj = JSON.parseObject(fYunFileService.getFileContent(homePath.concat("data.fdage")));
|
|
JSONObject dataFdageObj = JSON.parseObject(fYunFileService.getFileContent(homePath.concat("data.fdage")));
|
|
- if(Objects.nonNull(dataFdageObj)){
|
|
|
|
|
|
+ if (Objects.nonNull(dataFdageObj)) {
|
|
JSONArray points = dataFdageObj.getJSONArray("points");
|
|
JSONArray points = dataFdageObj.getJSONArray("points");
|
|
- if(CollUtil.isNotEmpty(points)){
|
|
|
|
|
|
+ if (CollUtil.isNotEmpty(points)) {
|
|
shootCount = points.size();
|
|
shootCount = points.size();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(Objects.nonNull(shootCount) && shootCount > 0){
|
|
|
|
|
|
+ if (Objects.nonNull(shootCount) && shootCount > 0) {
|
|
return shootCount;
|
|
return shootCount;
|
|
}
|
|
}
|
|
|
|
|
|
String slamDataStr = fYunFileService.getFileContent(homePath.concat("slam_data.json"));
|
|
String slamDataStr = fYunFileService.getFileContent(homePath.concat("slam_data.json"));
|
|
JSONObject slamDataObj = JSON.parseObject(slamDataStr);
|
|
JSONObject slamDataObj = JSON.parseObject(slamDataStr);
|
|
- if(Objects.nonNull(slamDataObj)){
|
|
|
|
|
|
+ if (Objects.nonNull(slamDataObj)) {
|
|
JSONArray viewsInfo = slamDataObj.getJSONArray("views_info");
|
|
JSONArray viewsInfo = slamDataObj.getJSONArray("views_info");
|
|
- if(CollUtil.isNotEmpty(viewsInfo)){
|
|
|
|
|
|
+ if (CollUtil.isNotEmpty(viewsInfo)) {
|
|
shootCount = viewsInfo.stream().mapToInt(info -> {
|
|
shootCount = viewsInfo.stream().mapToInt(info -> {
|
|
- return ((JSONObject) info).getJSONArray("list_pose").size();
|
|
|
|
|
|
+ return ((JSONObject) info).getJSONArray("list_pose").size();
|
|
}).sum();
|
|
}).sum();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -910,7 +905,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
JSONObject json = CreateHouseJsonUtil.createHouseTypeJsonByCad(floorPlanCardFilePath);
|
|
JSONObject json = CreateHouseJsonUtil.createHouseTypeJsonByCad(floorPlanCardFilePath);
|
|
- if(Objects.isNull(json)){
|
|
|
|
|
|
+ if (Objects.isNull(json)) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
String hourseTypeJsonPath = String.format(UploadFilePath.USER_VIEW_PATH, num) + "houseType.json";
|
|
String hourseTypeJsonPath = String.format(UploadFilePath.USER_VIEW_PATH, num) + "houseType.json";
|