|
@@ -2,9 +2,11 @@ package com.fdkankan.contro.mq.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
+import cn.hutool.core.exceptions.ExceptionUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.core.io.file.FileNameUtil;
|
|
import cn.hutool.core.io.file.FileNameUtil;
|
|
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;
|
|
@@ -21,9 +23,11 @@ import com.fdkankan.contro.mq.service.IBuildSceneService;
|
|
import com.fdkankan.contro.service.*;
|
|
import com.fdkankan.contro.service.*;
|
|
import com.fdkankan.contro.vo.SceneEditControlsVO;
|
|
import com.fdkankan.contro.vo.SceneEditControlsVO;
|
|
import com.fdkankan.fyun.config.FYunFileConfig;
|
|
import com.fdkankan.fyun.config.FYunFileConfig;
|
|
|
|
+import com.fdkankan.fyun.constant.FYunTypeEnum;
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
import com.fdkankan.model.constants.ConstantFileName;
|
|
import com.fdkankan.model.constants.ConstantFileName;
|
|
import com.fdkankan.model.constants.ConstantFilePath;
|
|
import com.fdkankan.model.constants.ConstantFilePath;
|
|
|
|
+import com.fdkankan.model.constants.SceneBuildProcessType;
|
|
import com.fdkankan.model.constants.UploadFilePath;
|
|
import com.fdkankan.model.constants.UploadFilePath;
|
|
import com.fdkankan.model.enums.ModelTypeEnums;
|
|
import com.fdkankan.model.enums.ModelTypeEnums;
|
|
import com.fdkankan.model.utils.CreateHouseJsonUtil;
|
|
import com.fdkankan.model.utils.CreateHouseJsonUtil;
|
|
@@ -66,9 +70,12 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
@Value("${queue.modeling.single.modeling-call}")
|
|
@Value("${queue.modeling.single.modeling-call}")
|
|
private String singleModelingCall;
|
|
private String singleModelingCall;
|
|
|
|
|
|
- @Value("${model.type:tile}")
|
|
|
|
|
|
+ @Value("${model.type:#{null}}")
|
|
private String modelType;
|
|
private String modelType;
|
|
|
|
|
|
|
|
+ @Value("${model.modelKind:3dtiles}")
|
|
|
|
+ private String modelKind;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private RabbitMqProducer mqProducer;
|
|
private RabbitMqProducer mqProducer;
|
|
|
|
|
|
@@ -99,10 +106,13 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ICompanyService companyService;
|
|
private ICompanyService companyService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ISceneAsynOperLogService sceneAsynOperLogService;
|
|
|
|
|
|
@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 {
|
|
//重新计算时需要删除文件夹,否知使用缓存
|
|
//重新计算时需要删除文件夹,否知使用缓存
|
|
if(new File(message.getPath() + File.separator + "results").exists()){
|
|
if(new File(message.getPath() + File.separator + "results").exists()){
|
|
@@ -152,7 +162,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
log.info("场景计算资源准备结束,场景码:{}", message.getSceneNum());
|
|
log.info("场景计算资源准备结束,场景码:{}", message.getSceneNum());
|
|
|
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- log.error("场景计算前置处理出错", e);
|
|
|
|
|
|
+ log.error("场景计算前置处理出错,num"+num, e);
|
|
|
|
+ throw e;
|
|
}finally {
|
|
}finally {
|
|
//如果前置处理失败,发送钉钉消息
|
|
//如果前置处理失败,发送钉钉消息
|
|
if(!success){
|
|
if(!success){
|
|
@@ -219,8 +230,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
}
|
|
}
|
|
scenePlus.setUpdateTime(new Date());
|
|
scenePlus.setUpdateTime(new Date());
|
|
scenePlus.setSceneStatus(SceneStatus.NO_DISPLAY.code());
|
|
scenePlus.setSceneStatus(SceneStatus.NO_DISPLAY.code());
|
|
- scenePlusService.updateById(scenePlus);
|
|
|
|
-
|
|
|
|
|
|
|
|
Integer videoVersion = fdageData.getInteger("videoVersion");
|
|
Integer videoVersion = fdageData.getInteger("videoVersion");
|
|
//读取计算结果文件生成videosJson
|
|
//读取计算结果文件生成videosJson
|
|
@@ -239,10 +248,32 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
//上传全景图俯视图
|
|
//上传全景图俯视图
|
|
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);
|
|
|
|
|
|
|
|
+ Map<String,String> damFileHeaders = new HashMap<>();
|
|
|
|
+ damFileHeaders.put("Content-Encoding","gzip");
|
|
|
|
+ if (!ObjectUtils.isEmpty(cameraType) && !cameraType.equals(14)) {
|
|
|
|
+ if (!fYunFileService.getFyunType().equals(FYunTypeEnum.LOCAL.code())) {
|
|
|
|
+ // dam 文件设置请求头
|
|
|
|
+ uploadFiles.entrySet().stream().filter(entry -> FileNameUtil.extName(entry.getKey()).equals("dam"))
|
|
|
|
+ .forEach(entry -> {
|
|
|
|
+ if (!new File(entry.getKey()).exists()) {
|
|
|
|
+ log.error("文件不存在,不予gzip压缩,文件路径:{}", entry.getKey());
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // 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);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
//拷贝部分文件到编辑目录,用于用户编辑
|
|
//拷贝部分文件到编辑目录,用于用户编辑
|
|
this.copyToEditDir(sceneCode);
|
|
this.copyToEditDir(sceneCode);
|
|
|
|
|
|
@@ -250,16 +281,18 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
this.cachePanorama(path, 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()));
|
|
|
|
-
|
|
|
|
- //写scene.json
|
|
|
|
|
|
+ boolean existHouseType = this.uploadHouseTypeJson(sceneCode, scenePlusExt.getDataSource());
|
|
|
|
+ scenePlus.setHouseType(existHouseType ? CommonStatus.YES.code().intValue() : CommonStatus.NO.code().intValue());
|
|
|
|
|
|
|
|
+ //重置异步操作记录
|
|
|
|
+ this.removeSceneAsynOperLog(sceneCode);
|
|
|
|
|
|
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);
|
|
|
|
|
|
String qrLogo = !ObjectUtils.isEmpty(company) && !ObjectUtils.isEmpty(company.getQrLogo()) ? company.getQrLogo() : null;
|
|
String qrLogo = !ObjectUtils.isEmpty(company) && !ObjectUtils.isEmpty(company.getQrLogo()) ? company.getQrLogo() : null;
|
|
@@ -271,16 +304,39 @@ 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());
|
|
|
|
|
|
+
|
|
|
|
+ //更新场景主表
|
|
|
|
+ scenePlusService.updateById(scenePlus);
|
|
|
|
|
|
CreateObjUtil.deleteFile(path.replace(ConstantFilePath.BUILD_MODEL_PATH, "/") + "/capture");
|
|
CreateObjUtil.deleteFile(path.replace(ConstantFilePath.BUILD_MODEL_PATH, "/") + "/capture");
|
|
|
|
|
|
log.info("场景计算结果处理结束,场景码:{}", sceneCode);
|
|
log.info("场景计算结果处理结束,场景码:{}", sceneCode);
|
|
|
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- e.printStackTrace();
|
|
|
|
|
|
+ log.error("场景计算结果处理出错,num"+sceneCode, e);
|
|
buildSceneDTService.handBaseFail("场景计算结果处理出错!", message.getPath(), sceneCode, "计算控制服务器");
|
|
buildSceneDTService.handBaseFail("场景计算结果处理出错!", message.getPath(), sceneCode, "计算控制服务器");
|
|
|
|
+ throw e;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ 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){
|
|
private void cachePanorama(String dataSource, String num){
|
|
@@ -369,9 +425,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
- if ((fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1)
|
|
|
|
- || (!ObjectUtils.isEmpty(cameraType) && (!cameraType.equals(14)))) {
|
|
|
|
|
|
+ //exportMeshObj这个是字段由app写入的
|
|
|
|
+ if (!ObjectUtils.isEmpty(cameraType) && cameraType != 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.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.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");
|
|
CreateObjUtil.convertTxtToDam(path + File.separator + "results" + File.separator + "tex" + File.separator + "modeldata.txt", path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam");
|
|
@@ -379,13 +434,28 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
map.put(path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam", imagesPath + ConstantFileName.modelUUID + "_50k.dam");
|
|
map.put(path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam", imagesPath + ConstantFileName.modelUUID + "_50k.dam");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(this.modelKind.equals(ModelKind.THREE_D_TILE.code())
|
|
|
|
+ && (!ObjectUtils.isEmpty(cameraType) && cameraType == 14 )//是激光场景
|
|
|
|
+ && (fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1)//选择生成obj
|
|
|
|
+ ){
|
|
|
|
+ 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");
|
|
map.put(resultsPath + "vision.txt", imagesPath + "vision.txt");
|
|
map.put(resultsPath + "vision.txt", imagesPath + "vision.txt");
|
|
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);
|
|
|
|
|
|
+ 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.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");
|
|
@@ -443,6 +513,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
sceneJson.setImgVersion(sceneEditInfo.getImgVersion());
|
|
sceneJson.setImgVersion(sceneEditInfo.getImgVersion());
|
|
sceneJson.setSceneFrom(scenePlusExt.getSceneFrom());
|
|
sceneJson.setSceneFrom(scenePlusExt.getSceneFrom());
|
|
sceneJson.setSceneKind(scenePlusExt.getSceneKind());
|
|
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());
|
|
|
|
|
|
@@ -513,6 +584,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(512);
|
|
|
|
+ qrConfig.setHeight(512);
|
|
if(!ObjectUtils.isEmpty(localLogoPath)){
|
|
if(!ObjectUtils.isEmpty(localLogoPath)){
|
|
qrConfig.setImg(localLogoPath);
|
|
qrConfig.setImg(localLogoPath);
|
|
}
|
|
}
|
|
@@ -527,10 +600,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void pushMsgToApp(Integer pushChannel, String pushToken, int cameraType, String sceneName, String webSite){
|
|
|
|
- log.info("推送消息,渠道是 {}, 手机token是 {}", pushChannel, pushToken);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private void copyToEditDir(String num) throws IOException {
|
|
private void copyToEditDir(String num) throws IOException {
|
|
|
|
|
|
String editImagesPath = String.format(UploadFilePath.IMG_EDIT_PATH, num);
|
|
String editImagesPath = String.format(UploadFilePath.IMG_EDIT_PATH, num);
|
|
@@ -636,42 +705,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);
|
|
@@ -705,6 +738,7 @@ 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);
|
|
scenePlusExtService.updateById(scenePlusExt);
|
|
}
|
|
}
|
|
@@ -731,6 +765,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
sceneEditInfoExt = sceneEditInfoExtService.getByEditInfoId(sceneEditInfo.getId());
|
|
sceneEditInfoExt = sceneEditInfoExtService.getByEditInfoId(sceneEditInfo.getId());
|
|
sceneEditInfo.setVersion(sceneEditInfo.getVersion() + 1);
|
|
sceneEditInfo.setVersion(sceneEditInfo.getVersion() + 1);
|
|
sceneEditInfo.setImgVersion(sceneEditInfo.getImgVersion() + 1);
|
|
sceneEditInfo.setImgVersion(sceneEditInfo.getImgVersion() + 1);
|
|
|
|
+ sceneEditInfo.setIsUploadObj(CommonStatus.NO.code());
|
|
sceneEditInfoService.updateById(sceneEditInfo);
|
|
sceneEditInfoService.updateById(sceneEditInfo);
|
|
}
|
|
}
|
|
if(sceneEditControls == null){
|
|
if(sceneEditControls == null){
|
|
@@ -747,15 +782,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;
|
|
}
|
|
}
|
|
}
|
|
}
|