|
@@ -17,6 +17,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.fdkankan.common.constant.*;
|
|
import com.fdkankan.common.constant.*;
|
|
import com.fdkankan.common.util.FileUtils;
|
|
import com.fdkankan.common.util.FileUtils;
|
|
import com.fdkankan.contro.bean.SceneJsonBean;
|
|
import com.fdkankan.contro.bean.SceneJsonBean;
|
|
|
|
+import com.fdkankan.contro.constant.UserEditDataType;
|
|
import com.fdkankan.contro.entity.*;
|
|
import com.fdkankan.contro.entity.*;
|
|
import com.fdkankan.contro.mq.service.IBuildSceneService;
|
|
import com.fdkankan.contro.mq.service.IBuildSceneService;
|
|
import com.fdkankan.contro.service.*;
|
|
import com.fdkankan.contro.service.*;
|
|
@@ -81,6 +82,18 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
public String buildProgressUrl;
|
|
public String buildProgressUrl;
|
|
|
|
|
|
|
|
|
|
|
|
+ @Value("${model.modelKind:3dtiles}")
|
|
|
|
+ private String modelKind;
|
|
|
|
+
|
|
|
|
+ @Value("#{'${model.3dtiles.sceneSource:}'.split(',')}")
|
|
|
|
+ private List<Integer> sdTilesSceneSourceList;
|
|
|
|
+
|
|
|
|
+ @Value("${env:gn}")
|
|
|
|
+ private String env;
|
|
|
|
+
|
|
|
|
+ @Value("#{'${build.scene.post.not-delete-nas-nums:}'.split(',')}")
|
|
|
|
+ private List<String> notDeleteNasNumList;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private RabbitMqProducer mqProducer;
|
|
private RabbitMqProducer mqProducer;
|
|
|
|
|
|
@@ -107,26 +120,69 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ICompanyService companyService;
|
|
private ICompanyService companyService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ISceneAsynOperLogService sceneAsynOperLogService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICommonService commonService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ISceneBuildProcessLogService sceneBuildProcessLogService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ISceneColdStorageService sceneColdStorageService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void buildScenePre(BuildSceneCallMessage message) {
|
|
|
|
|
|
+ public void buildScenePre(BuildSceneCallMessage message) throws Exception{
|
|
boolean success = false;
|
|
boolean success = false;
|
|
|
|
+ String num = message.getSceneNum();
|
|
try {
|
|
try {
|
|
|
|
|
|
//开始计算前发送mq消息,监听project.json文件的变化以更新进度条
|
|
//开始计算前发送mq消息,监听project.json文件的变化以更新进度条
|
|
mqProducer.sendByWorkQueue(modelingProgressNotice, message);
|
|
mqProducer.sendByWorkQueue(modelingProgressNotice, message);
|
|
|
|
|
|
|
|
+ //重新计算时需要删除文件夹,否知使用缓存
|
|
|
|
+ if(new File(message.getPath() + File.separator + "results").exists()){
|
|
|
|
+ FileUtils.deleteDirectory(message.getPath() + File.separator + "results");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //删除project.json文件
|
|
|
|
+ FileUtil.del(message.getPath().concat(File.separator).concat("project.json"));
|
|
|
|
+
|
|
|
|
+ //删除点位校准数据
|
|
|
|
+ if (Objects.nonNull(message.getExt())
|
|
|
|
+ && message.getExt().containsKey("deleteExtras")
|
|
|
|
+ && (Boolean) message.getExt().get("deleteExtras")) {
|
|
|
|
+ String extras = String.format(UploadFilePath.scene_result_data_path, num).concat("extras");
|
|
|
|
+ if(CollUtil.isNotEmpty(fYunFileService.listRemoteFiles(extras))){
|
|
|
|
+ fYunFileService.deleteFolder(extras);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //用户相机重新全量上传,需要解冻结
|
|
|
|
+ sceneColdStorageService.unfreeze(num, "用户相机重新全量上传", message.getPath());
|
|
|
|
+
|
|
//根据相机类型,组装资源路径
|
|
//根据相机类型,组装资源路径
|
|
//下载资源到本地
|
|
//下载资源到本地
|
|
this.downLoadSource(message, message.getPath());
|
|
this.downLoadSource(message, message.getPath());
|
|
|
|
|
|
- //删除project.json文件
|
|
|
|
- FileUtil.del(message.getPath().concat(File.separator).concat("project.json"));
|
|
|
|
|
|
+ JSONObject fdageJson = JSONObject.parseObject(FileUtils.readFile(message.getPath().concat("/capture/data.fdage")));
|
|
|
|
+
|
|
|
|
+ boolean rewrite = false;
|
|
|
|
+ // 兼容旧的数据,防止OnlyExportMeshObj标志未删除掉
|
|
|
|
+ if (fdageJson.containsKey("OnlyExportMeshObj")) {
|
|
|
|
+ log.info("data.fdage 包含 OnlyExportMeshObj,进行去除!");
|
|
|
|
+ // 写入data.fdage 防止重算
|
|
|
|
+ fdageJson.remove("OnlyExportMeshObj");
|
|
|
|
+ String ossPath = getOssPath(message.getPath());
|
|
|
|
+ fYunFileService.uploadFile(fdageJson.toJSONString().getBytes(), ossPath + "data.fdage");
|
|
|
|
+ rewrite = true;
|
|
|
|
+ }
|
|
|
|
|
|
if (!ObjectUtils.isEmpty(modelType)) {
|
|
if (!ObjectUtils.isEmpty(modelType)) {
|
|
// 修改dataFdage文件
|
|
// 修改dataFdage文件
|
|
- JSONObject fdageJson = JSONObject.parseObject(FileUtils.readFile(message.getPath().concat("/capture/data.fdage")));
|
|
|
|
fdageJson.put("modelType", modelType);
|
|
fdageJson.put("modelType", modelType);
|
|
|
|
+ rewrite = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (rewrite) {
|
|
FileUtils.writeFile(message.getPath().concat("/capture/data.fdage"), fdageJson.toJSONString());
|
|
FileUtils.writeFile(message.getPath().concat("/capture/data.fdage"), fdageJson.toJSONString());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -146,27 +202,27 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
log.info("场景计算资源准备结束,场景码:{}", message.getSceneNum());
|
|
log.info("场景计算资源准备结束,场景码:{}", message.getSceneNum());
|
|
|
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- log.error("场景计算前置处理出错", e);
|
|
|
|
- }finally {
|
|
|
|
- //如果前置处理失败,发送钉钉消息
|
|
|
|
- if(!success){
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ log.error("场景计算前置处理出错,num"+num, e);
|
|
|
|
+// buildSceneDTService.handBaseFail("场景计算资源准备异常!", message.getPath(), message.getSceneNum(), "计算控制服务器");
|
|
|
|
+ throw e;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public void downLoadSource(BuildSceneCallMessage buildSceneMqMessage,String path){
|
|
|
|
|
|
+ private String getOssPath(String path) {
|
|
String ossPath = ConstantFilePath.OSS_PREFIX
|
|
String ossPath = ConstantFilePath.OSS_PREFIX
|
|
+ path.replace(ConstantFilePath.BUILD_MODEL_PATH, "")
|
|
+ path.replace(ConstantFilePath.BUILD_MODEL_PATH, "")
|
|
.replace(ConstantFilePath.BUILD_MODEL_LASER_PATH, "");
|
|
.replace(ConstantFilePath.BUILD_MODEL_LASER_PATH, "");
|
|
if (!ossPath.endsWith("/")) {
|
|
if (!ossPath.endsWith("/")) {
|
|
ossPath = ossPath.concat("/");
|
|
ossPath = ossPath.concat("/");
|
|
}
|
|
}
|
|
- fYunFileService.downloadFileByCommand(path + File.separator + "capture", ossPath);
|
|
|
|
|
|
+ return ossPath;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void downLoadSource(BuildSceneCallMessage buildSceneMqMessage,String path){
|
|
|
|
+ String ossPath = getOssPath(path);
|
|
|
|
+ fYunFileService.downloadFileByCommand(path + File.separator + "capture", ossPath);
|
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void buildScenePost(BuildSceneResultMqMessage message) throws Exception {
|
|
public void buildScenePost(BuildSceneResultMqMessage message) throws Exception {
|
|
@@ -190,23 +246,14 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
}
|
|
}
|
|
JSONObject fdageData = getFdageData(path + File.separator + "capture" +File.separator+"data.fdage");
|
|
JSONObject fdageData = getFdageData(path + File.separator + "capture" +File.separator+"data.fdage");
|
|
|
|
|
|
- Integer cameraType = Integer.parseInt(message.getBuildContext().get("cameraType").toString());
|
|
|
|
- Map<String, String> uploadFiles = getUploadFiles(path,cameraType,fdageData);
|
|
|
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneCode);
|
|
|
|
|
|
- //计算场景消耗磁盘空间
|
|
|
|
- long space = this.calUseSpace(uploadFiles);
|
|
|
|
|
|
+ Integer cameraType = Integer.parseInt(message.getBuildContext().get("cameraType").toString());
|
|
|
|
+ Map<String, String> uploadFiles = getUploadFiles(scenePlus,path,cameraType,fdageData);
|
|
|
|
|
|
- ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneCode);
|
|
|
|
scenePlus.setPayStatus(PayStatus.PAY.code());
|
|
scenePlus.setPayStatus(PayStatus.PAY.code());
|
|
- //如果相机容量不足,需要把场景的paystatus改为容量不足状态
|
|
|
|
- if (cameraType != 14) {
|
|
|
|
- scenePlus.setPayStatus(this.getPayStatus(scenePlus.getCameraId(), space));
|
|
|
|
- }
|
|
|
|
scenePlus.setUpdateTime(new Date());
|
|
scenePlus.setUpdateTime(new Date());
|
|
scenePlus.setSceneStatus(SceneStatus.NO_DISPLAY.code());
|
|
scenePlus.setSceneStatus(SceneStatus.NO_DISPLAY.code());
|
|
- scenePlusService.updateById(scenePlus);
|
|
|
|
- cameraDetailService.updateCameraDetailByCameraIdAndSpace(scenePlus.getCameraId(), space);
|
|
|
|
-
|
|
|
|
|
|
|
|
Integer videoVersion = fdageData.getInteger("videoVersion");
|
|
Integer videoVersion = fdageData.getInteger("videoVersion");
|
|
//读取计算结果文件生成videosJson
|
|
//读取计算结果文件生成videosJson
|
|
@@ -214,68 +261,104 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
boolean isObj = fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1;
|
|
boolean isObj = fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1;
|
|
- //写入数据库
|
|
|
|
- this.updateDbPlus(scenePlus.getSceneSource(), space, videosJson.toJSONString(), message.getComputeTime(),isObj,scenePlusExt);
|
|
|
|
-
|
|
|
|
- Object[] editInfoArr = this.updateEditInfo(scenePlus);
|
|
|
|
- SceneEditInfo sceneEditInfo = (SceneEditInfo)editInfoArr[0];
|
|
|
|
- SceneEditInfoExt sceneEditInfoExt = (SceneEditInfoExt)editInfoArr[1];
|
|
|
|
- SceneEditControls sceneEditControls = (SceneEditControls)editInfoArr[2];
|
|
|
|
|
|
|
|
//上传全景图俯视图
|
|
//上传全景图俯视图
|
|
this.uploadFloorCad(path, sceneCode, uploadFiles);
|
|
this.uploadFloorCad(path, sceneCode, uploadFiles);
|
|
|
|
|
|
- //上传文件
|
|
|
|
log.info("开始上传场景计算结果数据,num:{}", sceneCode);
|
|
log.info("开始上传场景计算结果数据,num:{}", sceneCode);
|
|
|
|
+ //由于3dtiles算法mesh文件发生变化,所以这里需要先清除一下oss的mesh目录,避免存在旧算法obj文件
|
|
|
|
+ fYunFileService.deleteFolder(String.format(UploadFilePath.DATA_VIEW_PATH, sceneCode) + "mesh");
|
|
|
|
+ //上传文件
|
|
fYunFileService.uploadMulFiles(uploadFiles);
|
|
fYunFileService.uploadMulFiles(uploadFiles);
|
|
|
|
|
|
|
|
+ //修改oss上dam的内容编码
|
|
Map<String,String> damFileHeaders = new HashMap<>();
|
|
Map<String,String> damFileHeaders = new HashMap<>();
|
|
damFileHeaders.put("Content-Encoding","gzip");
|
|
damFileHeaders.put("Content-Encoding","gzip");
|
|
-
|
|
|
|
- if (!fYunFileService.getFyunType().equals(FYunTypeEnum.LOCAL.code())) {
|
|
|
|
- // dam 文件设置请求头
|
|
|
|
- uploadFiles.entrySet().stream().filter(entry -> FileNameUtil.extName(entry.getKey()).equals("dam"))
|
|
|
|
- .filter(entry -> new File(entry.getKey()).exists())
|
|
|
|
- .forEach(entry -> {
|
|
|
|
- // gzip压缩
|
|
|
|
- FileUtil.writeBytes(ZipUtil.gzip(new File(entry.getKey())), entry.getKey() + ".gzip");
|
|
|
|
- // 重命名
|
|
|
|
- FileUtil.rename(new File(entry.getKey() + ".gzip"), entry.getKey(), true);
|
|
|
|
- fYunFileService.uploadFile(entry.getKey(), entry.getValue(), damFileHeaders);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ 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);
|
|
|
|
|
|
//拷贝部分文件到编辑目录,用于用户编辑
|
|
//拷贝部分文件到编辑目录,用于用户编辑
|
|
this.copyToEditDir(sceneCode);
|
|
this.copyToEditDir(sceneCode);
|
|
|
|
|
|
|
|
+ //计算完毕后,同步全景图到缓存目录
|
|
|
|
+// this.cachePanorama(path, sceneCode);
|
|
|
|
+
|
|
//生成houseTypejson并上传
|
|
//生成houseTypejson并上传
|
|
- uploadFiles.entrySet().stream().filter(entry-> FileNameUtil.getName(entry.getKey()).equals("floorplan_cad.json"))
|
|
|
|
- .forEach(entry-> uploadHouseTypeJson(sceneCode,entry.getKey()));
|
|
|
|
|
|
+ boolean existHouseType = this.uploadHouseTypeJson(sceneCode, path);
|
|
|
|
+ scenePlus.setHouseType(existHouseType ? CommonStatus.YES.code().intValue() : CommonStatus.NO.code().intValue());
|
|
|
|
+
|
|
|
|
+ //生成floorpan.json
|
|
|
|
+ commonService.uploadFloorplanJson(sceneCode, path);
|
|
|
|
+
|
|
|
|
+ //重置异步操作记录
|
|
|
|
+ this.removeSceneAsynOperLog(sceneCode);
|
|
|
|
+
|
|
|
|
+ //清除用户编辑业务数据
|
|
|
|
+ Set<String> bizs = new HashSet<>();
|
|
|
|
+ bizs.add(UserEditDataType.BOX_MODEL.message());
|
|
|
|
+ bizs.add(UserEditDataType.FLOORPLAN.message());
|
|
|
|
+ commonService.initUserEditData(sceneCode, bizs, null);
|
|
|
|
+
|
|
|
|
+ //上传计算结果文件
|
|
|
|
+ commonService.uploadBuildResultData(sceneCode, path, SceneVersionType.V4.code());
|
|
|
|
+
|
|
|
|
+ //容量统计
|
|
|
|
+ Long space = commonService.getSpace(sceneCode);
|
|
|
|
+
|
|
|
|
+ //写入数据库
|
|
|
|
+ this.updateDbPlus(scenePlus.getSceneSource(), space, videosJson.toJSONString(), message.getComputeTime(),isObj,scenePlusExt);
|
|
|
|
+
|
|
|
|
+ Object[] editInfoArr = this.updateEditInfo(scenePlus);
|
|
|
|
+ SceneEditInfo sceneEditInfo = (SceneEditInfo)editInfoArr[0];
|
|
|
|
+ SceneEditInfoExt sceneEditInfoExt = (SceneEditInfoExt)editInfoArr[1];
|
|
|
|
+ SceneEditControls sceneEditControls = (SceneEditControls)editInfoArr[2];
|
|
|
|
+
|
|
|
|
+ if (cameraType == 14) {
|
|
|
|
+ //计算成功 激光转台相机 同步 请求
|
|
|
|
+ fdkkLaserService.syncBuildResult(scenePlus.getNum(), path, scenePlus.getCreateTime(), Calendar.getInstance().getTime());
|
|
|
|
+ sceneEditControlsService.update(new LambdaUpdateWrapper<SceneEditControls>().set(SceneEditControls::getShowMap,0)
|
|
|
|
+ .eq(SceneEditControls::getEditInfoId,sceneEditInfo.getId()));
|
|
|
|
+ sceneEditControls.setShowMap(0);
|
|
|
|
+ } else if (new File(path + "/results/laserData/vision_edit.txt").exists()) {
|
|
|
|
+ fdkkLaserService.cloudPointBuild(sceneCode,path);
|
|
|
|
+ }
|
|
|
|
|
|
- //写scene.json
|
|
|
|
log.info("生成scene.json上传oss并设置缓存,num:{}", sceneCode);
|
|
log.info("生成scene.json上传oss并设置缓存,num:{}", sceneCode);
|
|
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
|
|
this.writeSceneJson(sceneCode, videosJson,sceneEditInfo, sceneEditInfoExt, sceneEditControls, scenePlus,scenePlusExt,company);
|
|
this.writeSceneJson(sceneCode, videosJson,sceneEditInfo, sceneEditInfoExt, sceneEditControls, scenePlus,scenePlusExt,company);
|
|
|
|
|
|
- createQrCode(sceneCode, scenePlusExt, ObjectUtils.isEmpty(company) ? null : company.getQrLogo());
|
|
|
|
|
|
+ String qrLogo = !ObjectUtils.isEmpty(company) && !ObjectUtils.isEmpty(company.getQrLogo()) ? company.getQrLogo() : null;
|
|
|
|
+
|
|
|
|
+ qrLogo = ObjectUtils.isEmpty(qrLogo) && !ObjectUtils.isEmpty(sceneEditInfoExt.getShareLogoImg()) ? fYunFileConfig.getHost().concat(sceneEditInfoExt.getShareLogoImg()) : null;
|
|
|
|
+
|
|
|
|
+ createQrCode(sceneCode, scenePlusExt, qrLogo);
|
|
|
|
|
|
//计算成功,通知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 (cameraType == 14) {
|
|
|
|
- // 如果是激光场景,上传全景文件到V3路径,激光系统上线后,可不用上传
|
|
|
|
- String imagePath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneCode);
|
|
|
|
- String V3ImagePath = String.format(ConstantFilePath.IMAGE_PATH_FORMAT, sceneCode);
|
|
|
|
- uploadFiles.entrySet().stream().filter(entry -> entry.getValue().contains(imagePath)).forEach(entry -> {
|
|
|
|
- fYunFileService.uploadFile(entry.getKey(), entry.getValue().replace(imagePath, V3ImagePath));
|
|
|
|
- });
|
|
|
|
|
|
+ //删除计算目录
|
|
|
|
+// if(CollUtil.isEmpty(notDeleteNasNumList) || !notDeleteNasNumList.contains(sceneCode)){
|
|
|
|
+// CreateObjUtil.deleteFile(path.replace(ConstantFilePath.BUILD_MODEL_PATH, "/"));
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+ //更新场景主表
|
|
|
|
+ //如果相机容量不足,需要把场景的paystatus改为容量不足状态
|
|
|
|
+ if (cameraType != 14) {
|
|
|
|
+ scenePlus.setPayStatus(commonService.getPayStatus(scenePlus.getCameraId(), space));
|
|
}
|
|
}
|
|
|
|
|
|
- CreateObjUtil.deleteFile(path.replace(ConstantFilePath.BUILD_MODEL_PATH, "/") + "/capture");
|
|
|
|
|
|
+ this.uploadStatusJson(scenePlus, scenePlusExt);
|
|
|
|
+
|
|
|
|
+ scenePlusService.updateById(scenePlus);
|
|
|
|
+
|
|
|
|
+ //国际环境需要发邮件通知
|
|
|
|
+ if("eur".equals(env)){
|
|
|
|
+ commonService.sendEmail(sceneCode);
|
|
|
|
+ }
|
|
|
|
|
|
redisUtil.set(String.format(RedisKey.SCENE_BUILD_FINISH_NUM, sceneCode), "1");
|
|
redisUtil.set(String.format(RedisKey.SCENE_BUILD_FINISH_NUM, sceneCode), "1");
|
|
|
|
|
|
@@ -293,30 +376,65 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
log.info("场景计算结果处理结束,场景码:{}", sceneCode);
|
|
log.info("场景计算结果处理结束,场景码:{}", sceneCode);
|
|
|
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- log.error("场景计算结果处理异常, num=" + sceneCode, e);
|
|
|
|
|
|
+ log.error("场景计算结果处理出错,num"+sceneCode, e);
|
|
|
|
+// buildSceneDTService.handBaseFail("场景计算结果处理出错!", message.getPath(), sceneCode, "计算控制服务器");
|
|
|
|
+ throw e;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private Map<String, String> getUploadFiles(String path,Integer cameraType,JSONObject fdageData) throws Exception {
|
|
|
|
- ScenePlus scenePlus = scenePlusService.getByFileId(path);
|
|
|
|
|
|
+ private void removeSceneAsynOperLog(String num){
|
|
|
|
+ List<SceneAsynOperLog> list = sceneAsynOperLogService.list(new LambdaQueryWrapper<SceneAsynOperLog>().eq(SceneAsynOperLog::getNum, num));
|
|
|
|
+ if(CollUtil.isEmpty(list)){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ //删除数据库记录
|
|
|
|
+ List<Long> deleteIdList = list.parallelStream().map(item -> item.getId()).collect(Collectors.toList());
|
|
|
|
+ sceneAsynOperLogService.removeByIds(deleteIdList);
|
|
|
|
+
|
|
|
|
+ list.parallelStream().forEach(item -> {
|
|
|
|
+ if(StrUtil.isNotEmpty(item.getUrl())){
|
|
|
|
+ try {
|
|
|
|
+ fYunFileService.deleteFile(item.getUrl());
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ log.warn("删除oss全景图下载压缩包失败,key:{}", item.getUrl());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+// private void cachePanorama(String dataSource, String num){
|
|
|
|
+// String cachedImagesPath = String.format(ConstantFilePath.SCENE_CACHE_IMAGES, num);
|
|
|
|
+// //将全景图缓存到缓存目录
|
|
|
|
+// List<String> imagesList = FileUtil.listFileNames(dataSource + "/caches/images");
|
|
|
|
+// //先清除旧的全景图
|
|
|
|
+// cn.hutool.core.io.FileUtil.del(cachedImagesPath);
|
|
|
|
+// String visionPath = dataSource + "/results/vision.txt";
|
|
|
|
+// List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
|
|
|
|
+// imagesList.stream().forEach(fileName -> {
|
|
|
|
+// if (panoramaImageList.contains(fileName)) {
|
|
|
|
+// String srcPath = dataSource + "/caches/images/" + fileName;
|
|
|
|
+// String targetPath = cachedImagesPath + fileName;
|
|
|
|
+// log.info("源文件:{}, 目标文件:{}", srcPath, targetPath);
|
|
|
|
+// cn.hutool.core.io.FileUtil.copy(srcPath, targetPath, true);
|
|
|
|
+// }
|
|
|
|
+// });
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+ 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);
|
|
}
|
|
}
|
|
|
|
|
|
String projectNum = scenePlus.getNum();
|
|
String projectNum = scenePlus.getNum();
|
|
|
|
|
|
-
|
|
|
|
String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, projectNum);
|
|
String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, projectNum);
|
|
String imagesPath = String.format(UploadFilePath.IMG_VIEW_PATH, projectNum);
|
|
String imagesPath = String.format(UploadFilePath.IMG_VIEW_PATH, projectNum);
|
|
String videoPath = String.format(UploadFilePath.VIDEOS_VIEW_PATH, projectNum);
|
|
String videoPath = String.format(UploadFilePath.VIDEOS_VIEW_PATH, projectNum);
|
|
String resultsPath = path + File.separator + "results" + File.separator;
|
|
String resultsPath = path + File.separator + "results" + File.separator;
|
|
|
|
|
|
- String uploadJsonPath = resultsPath + "upload.json";
|
|
|
|
- String uploadData = FileUtils.readFile(uploadJsonPath);
|
|
|
|
- log.info("upload.json 文件路径:{}, 内容:{}", uploadJsonPath, uploadData);
|
|
|
|
|
|
+ String uploadData = FileUtils.readFile(resultsPath + "upload.json");
|
|
JSONArray array = JSONObject.parseObject(uploadData).getJSONArray("upload");
|
|
JSONArray array = JSONObject.parseObject(uploadData).getJSONArray("upload");
|
|
|
|
|
|
-
|
|
|
|
JSONObject fileJson = null;
|
|
JSONObject fileJson = null;
|
|
String fileName = "";
|
|
String fileName = "";
|
|
|
|
|
|
@@ -370,14 +488,36 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //exportMeshObj这个是字段由app写入的
|
|
|
|
+ boolean genModel = true;//是否生成模型 默认生成,深时场景要根据 exportMeshObj判断是否生成
|
|
|
|
+ if(!ObjectUtils.isEmpty(cameraType)
|
|
|
|
+ && cameraType == 14
|
|
|
|
+ && (!fdageData.containsKey("exportMeshObj") || fdageData.getIntValue("exportMeshObj") != 1)){
|
|
|
|
+ genModel = false;
|
|
|
|
+ }
|
|
|
|
+ boolean gen3dTiles = true;//是否生成3dtiles模型 默认生成
|
|
|
|
+ if(!ModelKind.THREE_D_TILE.code().equals(modelKind)
|
|
|
|
+ || CollUtil.isEmpty(sdTilesSceneSourceList)
|
|
|
|
+ || !sdTilesSceneSourceList.contains(scenePlus.getSceneSource())){
|
|
|
|
+ gen3dTiles = false;
|
|
|
|
+ }
|
|
|
|
|
|
- if ((fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1)
|
|
|
|
- || (!ObjectUtils.isEmpty(cameraType) && (!cameraType.equals(14)))) {
|
|
|
|
- CreateObjUtil.convertTxtToDam(path + File.separator + "results" + File.separator + "tex" + File.separator + "modeldata.txt", path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam");
|
|
|
|
- CreateObjUtil.convertDamToLzma(path + File.separator + "results/");
|
|
|
|
- CreateObjUtil.convertTxtToDam(path + File.separator + "results" + File.separator + "tex" + File.separator + "modeldata.txt", path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam");
|
|
|
|
- map.put(path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam.lzma", imagesPath + ConstantFileName.modelUUID + "_50k.dam.lzma");
|
|
|
|
- map.put(path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam", imagesPath + ConstantFileName.modelUUID + "_50k.dam");
|
|
|
|
|
|
+ if(genModel){
|
|
|
|
+ if (!gen3dTiles) {
|
|
|
|
+ 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);
|
|
|
|
+ FileUtil.writeBytes(ZipUtil.gzip(new File(damPath)), damPath);
|
|
|
|
+ map.put(damPath, imagesPath + ConstantFileName.modelUUID + "_50k.dam");
|
|
|
|
+ }else{
|
|
|
|
+ List<String> list = FileUtils.list(new File(path + File.separator + "results" + File.separator + ModelKind.THREE_D_TILE.code()));
|
|
|
|
+ if(CollUtil.isEmpty(list)){
|
|
|
|
+ log.error("3dtiles目录异常,3dtiles地址:{}", new File(path + File.separator + "results" + File.separator + ModelKind.THREE_D_TILE.code()));
|
|
|
|
+ throw new Exception("3dtiles目录异常");
|
|
|
|
+ }
|
|
|
|
+ list.stream().forEach(str->{
|
|
|
|
+ map.put(str, str.replace(path + File.separator + "results" + File.separator, imagesPath));
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
CreateObjUtil.convertTxtToVisionmodeldata(resultsPath + "vision.txt", resultsPath + "vision.modeldata");
|
|
CreateObjUtil.convertTxtToVisionmodeldata(resultsPath + "vision.txt", resultsPath + "vision.modeldata");
|
|
@@ -385,9 +525,10 @@ 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);
|
|
-
|
|
|
|
- FileUtil.touch("/mnt/4Dkankan/scene/data" + File.separator + "data" + projectNum);
|
|
|
|
- map.put(resultsPath + "floorplan.json", dataViewPath + "floor.json");
|
|
|
|
|
|
+ if(!new File("/mnt/4Dkankan/scene/data" + File.separator + "data" + projectNum).exists()){
|
|
|
|
+ FileUtil.mkdir("/mnt/4Dkankan/scene/data" + File.separator + "data" + projectNum);
|
|
|
|
+ }
|
|
|
|
+// map.put(resultsPath + "floorplan.json", dataViewPath + "floor.json");
|
|
map.put(resultsPath + "floorplan_cad.json", dataViewPath + "floorplan_cad.json");
|
|
map.put(resultsPath + "floorplan_cad.json", dataViewPath + "floorplan_cad.json");
|
|
map.put(path + File.separator + "capture/stitch_params.txt", dataViewPath + "stitch_params.txt");
|
|
map.put(path + File.separator + "capture/stitch_params.txt", dataViewPath + "stitch_params.txt");
|
|
map.put(path + File.separator + "capture/Up.xml", dataViewPath + "Up.xml");
|
|
map.put(path + File.separator + "capture/Up.xml", dataViewPath + "Up.xml");
|
|
@@ -412,8 +553,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
private void uploadFloorCad(String path, String num, Map<String, String> uploadFiles){
|
|
private void uploadFloorCad(String path, String num, Map<String, String> uploadFiles){
|
|
|
|
|
|
//户型图上传
|
|
//户型图上传
|
|
- String userEditPath = UploadFilePath.USER_EDIT_PATH + "floor-cad-%s.%s";
|
|
|
|
- String userViewPath = UploadFilePath.USER_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)){
|
|
if(CollUtil.isNotEmpty(floorCadList)){
|
|
@@ -421,8 +561,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
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("\\.");
|
|
- uploadFiles.put(str, String.format(userEditPath, num, arr2[0], arr2[1]));
|
|
|
|
- uploadFiles.put(str, String.format(userViewPath, num, arr2[0], arr2[1]));
|
|
|
|
|
|
+ uploadFiles.put(str, String.format(dataViewPath, num, arr2[0], arr2[1]));
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
@@ -440,7 +579,11 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
sceneJson.setNum(num);
|
|
sceneJson.setNum(num);
|
|
sceneJson.setCreateTime(scenePlus.getCreateTime());
|
|
sceneJson.setCreateTime(scenePlus.getCreateTime());
|
|
sceneJson.setSceneResolution(scenePlusExt.getSceneResolution());
|
|
sceneJson.setSceneResolution(scenePlusExt.getSceneResolution());
|
|
|
|
+ sceneJson.setVersion(sceneEditInfo.getVersion());
|
|
|
|
+ sceneJson.setImgVersion(sceneEditInfo.getImgVersion());
|
|
sceneJson.setSceneFrom(scenePlusExt.getSceneFrom());
|
|
sceneJson.setSceneFrom(scenePlusExt.getSceneFrom());
|
|
|
|
+ sceneJson.setSceneKind(scenePlusExt.getSceneKind());
|
|
|
|
+ sceneJson.setModelKind(scenePlusExt.getModelKind());
|
|
sceneJson.setVideos(JSON.toJSONString(videosJson));
|
|
sceneJson.setVideos(JSON.toJSONString(videosJson));
|
|
sceneJson.setPayStatus(scenePlus.getPayStatus());
|
|
sceneJson.setPayStatus(scenePlus.getPayStatus());
|
|
|
|
|
|
@@ -479,7 +622,11 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
fYunFileService.uploadFile(sceneJsonStr.getBytes(), dataViewPath + "scene.json");
|
|
fYunFileService.uploadFile(sceneJsonStr.getBytes(), dataViewPath + "scene.json");
|
|
//scenejson写入缓存
|
|
//scenejson写入缓存
|
|
redisUtil.set(String.format(RedisKey.SCENE_JSON, num), sceneJsonStr);
|
|
redisUtil.set(String.format(RedisKey.SCENE_JSON, num), sceneJsonStr);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ private void uploadStatusJson(ScenePlus scenePlus, ScenePlusExt scenePlusExt){
|
|
|
|
+ String num = scenePlus.getNum();
|
|
|
|
+ String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, num);
|
|
// 上传status JSON.
|
|
// 上传status JSON.
|
|
JSONObject statusJson = new JSONObject();
|
|
JSONObject statusJson = new JSONObject();
|
|
//临时将-2改成1,app还没完全更新
|
|
//临时将-2改成1,app还没完全更新
|
|
@@ -493,7 +640,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
fYunFileService.uploadFile(ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "status.json",
|
|
fYunFileService.uploadFile(ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "status.json",
|
|
dataViewPath + "status.json");
|
|
dataViewPath + "status.json");
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private void createQrCode(String num, ScenePlusExt scenePlusExt, String qrLogo) {
|
|
private void createQrCode(String num, ScenePlusExt scenePlusExt, String qrLogo) {
|
|
@@ -511,6 +657,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
String outPathZh = ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+ num +".png";
|
|
String outPathZh = ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+ num +".png";
|
|
String outPathEn = ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+ num +"_en.png";
|
|
String outPathEn = ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+ num +"_en.png";
|
|
QrConfig qrConfig = QrConfig.create();
|
|
QrConfig qrConfig = QrConfig.create();
|
|
|
|
+ qrConfig.setWidth(1024);
|
|
|
|
+ qrConfig.setHeight(1024);
|
|
if(!ObjectUtils.isEmpty(localLogoPath)){
|
|
if(!ObjectUtils.isEmpty(localLogoPath)){
|
|
qrConfig.setImg(localLogoPath);
|
|
qrConfig.setImg(localLogoPath);
|
|
}
|
|
}
|
|
@@ -675,42 +823,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
return uploadFile.keySet().stream().map(File::new).filter(File::exists).mapToLong(File::length).sum();
|
|
return uploadFile.keySet().stream().map(File::new).filter(File::exists).mapToLong(File::length).sum();
|
|
}
|
|
}
|
|
|
|
|
|
- private void sealScene(Long scenePlusId){
|
|
|
|
- scenePlusService.update(
|
|
|
|
- new LambdaUpdateWrapper<ScenePlus>()
|
|
|
|
- .set(ScenePlus::getPayStatus, PayStatus.NO_CAPACITY.code())
|
|
|
|
- .eq(ScenePlus::getId, scenePlusId));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * <p>
|
|
|
|
- 双目场景更新数据库
|
|
|
|
- * </p>
|
|
|
|
- * @author dengsixing
|
|
|
|
- * @date 2022/3/21
|
|
|
|
- * @param num
|
|
|
|
- * @param space
|
|
|
|
- **/
|
|
|
|
- private void updateDb4Sm(String num, long space){
|
|
|
|
- List<ScenePlus> ScenePlusList = scenePlusService.list(
|
|
|
|
- new LambdaQueryWrapper<ScenePlus>().select(ScenePlus::getId).eq(ScenePlus::getNum, num));
|
|
|
|
-
|
|
|
|
- if(CollUtil.isEmpty(ScenePlusList)){
|
|
|
|
- return ;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- List<Long> sceneIds = ScenePlusList.stream().map(ScenePlus::getId).collect(Collectors.toList());
|
|
|
|
-
|
|
|
|
- //更新场景创建时间
|
|
|
|
- scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>().in(ScenePlus::getId, sceneIds)
|
|
|
|
- .set(ScenePlus::getSceneStatus, SceneStatus.NO_DISPLAY.code()));
|
|
|
|
-
|
|
|
|
- //更新使用容量
|
|
|
|
- scenePlusExtService.update(new LambdaUpdateWrapper<ScenePlusExt>().in(ScenePlusExt::getPlusId, sceneIds)
|
|
|
|
- .set(ScenePlusExt::getSpace, space)
|
|
|
|
- .set(ScenePlusExt::getAlgorithmTime, Calendar.getInstance().getTime()));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
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);
|
|
@@ -744,12 +856,14 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
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);
|
|
|
|
|
|
- scenePlusExtService.updateById(scenePlusExt);
|
|
|
|
- }
|
|
|
|
|
|
+ String dataFdage = FileUtil.readUtf8String(scenePlusExt.getDataSource().concat("/capture/").concat("data.fdage"));
|
|
|
|
+ JSONObject jsonObject = JSON.parseObject(dataFdage);
|
|
|
|
+ int points = jsonObject.getJSONArray("points").size();
|
|
|
|
+ scenePlusExt.setShootCount(points);
|
|
|
|
|
|
- private int getPayStatus(Long cameraId, Long space){
|
|
|
|
- return PayStatus.PAY.code();
|
|
|
|
|
|
+ scenePlusExtService.updateById(scenePlusExt);
|
|
}
|
|
}
|
|
|
|
|
|
private Object[] updateEditInfo(ScenePlus scenePlus){
|
|
private Object[] updateEditInfo(ScenePlus scenePlus){
|
|
@@ -762,11 +876,36 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
sceneEditInfo.setDescription(scenePlus.getDescription());
|
|
sceneEditInfo.setDescription(scenePlus.getDescription());
|
|
sceneEditInfo.setTitle(scenePlus.getTitle());
|
|
sceneEditInfo.setTitle(scenePlus.getTitle());
|
|
sceneEditInfoService.save(sceneEditInfo);
|
|
sceneEditInfoService.save(sceneEditInfo);
|
|
-
|
|
|
|
}else{
|
|
}else{
|
|
|
|
+
|
|
|
|
+ int version = 0;
|
|
|
|
+ int imgVersion = 0;
|
|
|
|
+ int linkVersion = 0;
|
|
|
|
+ //获取展示页的版本号
|
|
|
|
+ String sceneJsonStr = fYunFileService.getFileContent(String.format(UploadFilePath.DATA_VIEW_PATH, scenePlus.getNum()) + "scene.json");
|
|
|
|
+ if(StrUtil.isNotEmpty(sceneJsonStr)){
|
|
|
|
+ JSONObject sceneJson = JSON.parseObject(sceneJsonStr);
|
|
|
|
+ version = sceneJson.getIntValue("version");
|
|
|
|
+ imgVersion = sceneJson.getIntValue("imgVersion");
|
|
|
|
+ linkVersion = sceneJson.getIntValue("linkVersion");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(version < sceneEditInfo.getVersion()){
|
|
|
|
+ version = sceneEditInfo.getVersion();
|
|
|
|
+ }
|
|
|
|
+ if(imgVersion < sceneEditInfo.getImgVersion()){
|
|
|
|
+ imgVersion = sceneEditInfo.getImgVersion();
|
|
|
|
+ }
|
|
|
|
+ if(linkVersion < sceneEditInfo.getLinkVersion()){
|
|
|
|
+ linkVersion = sceneEditInfo.getLinkVersion();
|
|
|
|
+ }
|
|
|
|
+
|
|
sceneEditControls = sceneEditControlsService.getBySceneEditId(sceneEditInfo.getId());
|
|
sceneEditControls = sceneEditControlsService.getBySceneEditId(sceneEditInfo.getId());
|
|
sceneEditInfoExt = sceneEditInfoExtService.getByEditInfoId(sceneEditInfo.getId());
|
|
sceneEditInfoExt = sceneEditInfoExtService.getByEditInfoId(sceneEditInfo.getId());
|
|
- sceneEditInfo.setVersion(sceneEditInfo.getVersion() + 1);
|
|
|
|
|
|
+ sceneEditInfo.setVersion(version + 1);
|
|
|
|
+ sceneEditInfo.setImgVersion(imgVersion + 1);
|
|
|
|
+ sceneEditInfo.setLinkVersion(linkVersion + 1);
|
|
|
|
+ sceneEditInfo.setIsUploadObj(CommonStatus.NO.code());
|
|
sceneEditInfoService.updateById(sceneEditInfo);
|
|
sceneEditInfoService.updateById(sceneEditInfo);
|
|
}
|
|
}
|
|
if(sceneEditControls == null){
|
|
if(sceneEditControls == null){
|
|
@@ -783,15 +922,21 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
return new Object[]{sceneEditInfo, sceneEditInfoExt, sceneEditControls};
|
|
return new Object[]{sceneEditInfo, sceneEditInfoExt, sceneEditControls};
|
|
}
|
|
}
|
|
|
|
|
|
- public void uploadHouseTypeJson(String num, String floorPlanCardFilePath) {
|
|
|
|
|
|
+ public boolean uploadHouseTypeJson(String num, String dataSource) {
|
|
|
|
+ String floorPlanCardFilePath = dataSource + File.separator + "results/floorplan_cad.json";
|
|
if (!new File(floorPlanCardFilePath).exists()) {
|
|
if (!new File(floorPlanCardFilePath).exists()) {
|
|
- log.error("floorplan_cad.json 文件不存在,文件路径:{}", floorPlanCardFilePath);
|
|
|
|
- return;
|
|
|
|
|
|
+ log.warn("floorplan_cad.json 文件不存在,文件路径:{}", floorPlanCardFilePath);
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
JSONObject json = CreateHouseJsonUtil.createHouseTypeJsonByCad(floorPlanCardFilePath);
|
|
JSONObject json = CreateHouseJsonUtil.createHouseTypeJsonByCad(floorPlanCardFilePath);
|
|
- String hourseTypeJsonPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "houseType.json";
|
|
|
|
|
|
+ if(Objects.isNull(json)){
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ String hourseTypeJsonPath = String.format(UploadFilePath.USER_VIEW_PATH, num) + "houseType.json";
|
|
fYunFileService.uploadFile(json.toJSONString().getBytes(), hourseTypeJsonPath);
|
|
fYunFileService.uploadFile(json.toJSONString().getBytes(), hourseTypeJsonPath);
|
|
- hourseTypeJsonPath = String.format(UploadFilePath.DATA_EDIT_PATH, num) + "houseType.json";
|
|
|
|
|
|
+ hourseTypeJsonPath = String.format(UploadFilePath.USER_EDIT_PATH, num) + "houseType.json";
|
|
fYunFileService.uploadFile(json.toJSONString().getBytes(), hourseTypeJsonPath);
|
|
fYunFileService.uploadFile(json.toJSONString().getBytes(), hourseTypeJsonPath);
|
|
|
|
+
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
}
|
|
}
|