|
@@ -1,4 +1,12 @@
|
|
|
package com.fdkankan.scene.service.impl;
|
|
|
+import cn.hutool.core.net.multipart.UploadFile;
|
|
|
+import cn.hutool.core.util.CharsetUtil;
|
|
|
+import com.fdkankan.common.constant.*;
|
|
|
+import com.fdkankan.common.util.FileSizeUtil;
|
|
|
+import com.fdkankan.common.util.MD5;
|
|
|
+import com.fdkankan.scene.vo.SaveFiltersParamVO;
|
|
|
+import io.opencensus.metrics.LongGauge;
|
|
|
+import java.util.Date;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
@@ -12,13 +20,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.fdkankan.common.constant.CommonStatus;
|
|
|
-import com.fdkankan.common.constant.ErrorCode;
|
|
|
-import com.fdkankan.common.constant.FileBizType;
|
|
|
-import com.fdkankan.common.constant.OperationType;
|
|
|
-import com.fdkankan.common.constant.SceneFrom;
|
|
|
-import com.fdkankan.common.constant.SceneInfoReqType;
|
|
|
-import com.fdkankan.common.constant.ServerCode;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.common.util.FileMd5Util;
|
|
|
import com.fdkankan.common.util.FileUtils;
|
|
@@ -44,6 +45,7 @@ import com.fdkankan.scene.bean.VertexBean;
|
|
|
import com.fdkankan.scene.bean.WallBean;
|
|
|
import com.fdkankan.scene.entity.CameraDetail;
|
|
|
import com.fdkankan.scene.entity.Company;
|
|
|
+import com.fdkankan.scene.entity.SceneAsynOperLog;
|
|
|
import com.fdkankan.scene.entity.SceneDataDownload;
|
|
|
import com.fdkankan.scene.entity.SceneEditControls;
|
|
|
import com.fdkankan.scene.entity.SceneEditInfo;
|
|
@@ -53,6 +55,7 @@ import com.fdkankan.scene.entity.ScenePlusExt;
|
|
|
import com.fdkankan.scene.mapper.ISceneEditInfoMapper;
|
|
|
import com.fdkankan.scene.service.ICameraDetailService;
|
|
|
import com.fdkankan.scene.service.ICompanyService;
|
|
|
+import com.fdkankan.scene.service.ISceneAsynOperLogService;
|
|
|
import com.fdkankan.scene.service.ISceneDataDownloadService;
|
|
|
import com.fdkankan.scene.service.ISceneEditControlsService;
|
|
|
import com.fdkankan.scene.service.ISceneEditInfoExtService;
|
|
@@ -103,6 +106,7 @@ import java.util.Map.Entry;
|
|
|
import java.util.Objects;
|
|
|
import java.util.Set;
|
|
|
import java.util.UUID;
|
|
|
+import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
import java.util.stream.Collectors;
|
|
|
import javax.annotation.Resource;
|
|
@@ -162,6 +166,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
private ICompanyService companyService;
|
|
|
@Autowired
|
|
|
private ISurveillanceService surveillanceService;
|
|
|
+ @Autowired
|
|
|
+ private ISceneAsynOperLogService sceneAsynOperLogService;
|
|
|
|
|
|
@Transactional
|
|
|
@Override
|
|
@@ -272,6 +278,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
sceneJson.setSceneResolution(scenePlusExt.getSceneResolution());
|
|
|
sceneJson.setSceneFrom(scenePlusExt.getSceneFrom());
|
|
|
sceneJson.setSceneKind(scenePlusExt.getSceneKind());
|
|
|
+ sceneJson.setModelKind(scenePlusExt.getModelKind());
|
|
|
if(StrUtil.isNotEmpty(scenePlusExt.getVideos())){
|
|
|
sceneJson.setVideos(scenePlusExt.getVideos());
|
|
|
}
|
|
@@ -304,7 +311,10 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
//删除发布数据中的user目录
|
|
|
String publicUserPath = String.format(UploadFilePath.USER_VIEW_PATH, num);
|
|
|
- fYunFileService.deleteFile(bucket, publicUserPath);
|
|
|
+ List<String> userViewFileList = fYunFileService.listRemoteFiles(bucket, publicUserPath);
|
|
|
+ if(CollUtil.isNotEmpty(userViewFileList)){
|
|
|
+ fYunFileService.deleteFolder(bucket, publicUserPath);
|
|
|
+ }
|
|
|
|
|
|
//复制编辑目录到发布目录
|
|
|
String editPath = String.format(UploadFilePath.USER_EDIT_PATH, param.getNum());
|
|
@@ -323,11 +333,18 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
scenePlus.setTitle(sceneEditInfo.getTitle());
|
|
|
scenePlus.setDescription(sceneEditInfo.getDescription());
|
|
|
+ scenePlus.setHouseType(this.existsHouseType(bucket, num));
|
|
|
scenePlusService.updateById(scenePlus);
|
|
|
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
+ private int existsHouseType(String bucket, String num){
|
|
|
+ String houseTypePath = String.format(UploadFilePath.USER_VIEW_PATH, num) + "houseType.json";
|
|
|
+ boolean exist = fYunFileService.fileExist(bucket, houseTypePath);
|
|
|
+ return exist ? CommonStatus.YES.code().intValue() : CommonStatus.NO.code().intValue();
|
|
|
+ }
|
|
|
+
|
|
|
private void publicSurveillance(String num, Integer surveillances, String bucket) throws IOException {
|
|
|
String surveillanceJsonPath = String.format(UploadFilePath.USER_EDIT_PATH, num) + "surveillance.json";
|
|
|
if(surveillances == CommonStatus.NO.code().intValue()){
|
|
@@ -358,6 +375,11 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
String userEditPath = String.format(UploadFilePath.USER_EDIT_PATH, num);
|
|
|
String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
|
|
|
|
|
|
+ //清除发布目录中的场景关联图片
|
|
|
+ if(fYunFileService.fileExist(bucket,imgViewPath + "panorama")){
|
|
|
+ fYunFileService.deleteFolder(bucket,imgViewPath + "panorama");
|
|
|
+ }
|
|
|
+
|
|
|
//生成links.json并上传到发布目录
|
|
|
String linkPanKey = String.format(RedisKey.SCENE_LINKPAN_DATA, num);
|
|
|
Map<String, String> linkPanMap = redisUtil.hmget(linkPanKey);
|
|
@@ -372,7 +394,6 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
fYunFileService.uploadFile(bucket, linkPanArr.toString().getBytes(), linkScenePath);
|
|
|
|
|
|
//拷贝编辑目录到发布目录
|
|
|
- fYunFileService.deleteFile(bucket,imgViewPath + "panorama");
|
|
|
fYunFileService.copyFileBetweenBucket(bucket, imgEditPath + "panorama", bucket, imgViewPath + "panorama");
|
|
|
|
|
|
}
|
|
@@ -400,7 +421,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
String hotJsonPath = String.format(UploadFilePath.USER_EDIT_PATH, sceneNum) + "hot.json";
|
|
|
fYunFileService.uploadFile(bucket, tags.toString().getBytes(), hotJsonPath);
|
|
|
- this.saveTagsToSceneEditInfo(sceneNum, sceneEditInfo);
|
|
|
+// this.saveTagsToSceneEditInfo(sceneNum, sceneEditInfo);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -458,10 +479,12 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
sceneInfoVO.setSceneResolution(scenePlusExt.getSceneResolution());
|
|
|
sceneInfoVO.setSceneFrom(scenePlusExt.getSceneFrom());
|
|
|
sceneInfoVO.setSceneKind(scenePlusExt.getSceneKind());
|
|
|
+ sceneInfoVO.setModelKind(scenePlusExt.getModelKind());
|
|
|
sceneInfoVO.setVideos(scenePlusExt.getVideos());
|
|
|
- if(CommonStatus.YES.code().equals(sceneEditInfoExt.getMosaic())){
|
|
|
+ if(CommonStatus.YES.code().intValue() == sceneEditInfoExt.getMosaic()){
|
|
|
sceneInfoVO.setMosaicList(this.getMosaicList(num));
|
|
|
}
|
|
|
+ sceneInfoVO.setSpace(FileSizeUtil.convert(scenePlusExt.getSpace(), FileSizeUnitType.MB.code()));
|
|
|
|
|
|
this.SortBoxVideos(sceneInfoVO);
|
|
|
|
|
@@ -605,7 +628,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
//处理户型图数据
|
|
|
//上传floorplan_user.json文件
|
|
|
FileUtils.writeFile(localDataPath + "floorplan_user.json", floorJsonData);
|
|
|
- fYunFileService.uploadFile(bucket, localDataPath + "floorplan_user.json", editUserPath + "floorplan_user.json");
|
|
|
+ fYunFileService.uploadFile(bucket, localDataPath + "floorplan_user.json", editUserPath + "floorplan.json");
|
|
|
|
|
|
//写入数据库
|
|
|
Byte floorPlanUser = null;
|
|
@@ -664,20 +687,24 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
String path = scenePlusExt.getDataSource();
|
|
|
|
|
|
//户型图上传
|
|
|
- String userEditPath = UploadFilePath.USER_EDIT_PATH + "floor-cad-%s.%s";
|
|
|
- String floorCadPath = path + "/results/floorplan_cad";
|
|
|
- List<String> floorCadList = FileUtils.getFileList(floorCadPath);
|
|
|
- if(CollUtil.isNotEmpty(floorCadList)){
|
|
|
- floorCadList.stream().forEach(str->{
|
|
|
- String substring = str.substring(str.lastIndexOf(File.separator) + 1);
|
|
|
- String[] arr = substring.split("floor");
|
|
|
- String[] arr2 = arr[1].split("\\.");
|
|
|
- fYunFileService.uploadFile(bucket, str, String.format(userEditPath, num, arr2[0], arr2[1]));
|
|
|
- });
|
|
|
- }
|
|
|
+ String ossResultPath = String.format(UploadFilePath.scene_result_data_path, num);
|
|
|
+ String floorplanCadPath = ossResultPath + "floorplan_cad/";
|
|
|
+ fYunFileService.copyFileBetweenBucket(bucket, floorplanCadPath, bucket, String.format(UploadFilePath.USER_EDIT_PATH, num));
|
|
|
+
|
|
|
+// String userEditPath = UploadFilePath.USER_EDIT_PATH + "floor-cad-%s.%s";
|
|
|
+// String floorCadPath = path + "/results/floorplan_cad";
|
|
|
+// List<String> floorCadList = FileUtils.getFileList(floorCadPath);
|
|
|
+// if(CollUtil.isNotEmpty(floorCadList)){
|
|
|
+// floorCadList.stream().forEach(str->{
|
|
|
+// String substring = str.substring(str.lastIndexOf(File.separator) + 1);
|
|
|
+// String[] arr = substring.split("floor");
|
|
|
+// String[] arr2 = arr[1].split("\\.");
|
|
|
+// fYunFileService.uploadFile(bucket, str, String.format(userEditPath, num, arr2[0], arr2[1]));
|
|
|
+// });
|
|
|
+// }
|
|
|
|
|
|
//根据floorplan_cad.json生成houseType.json
|
|
|
- this.uploadHouseTypeJson(num, bucket);
|
|
|
+// this.uploadHouseTypeJson(num, bucket);
|
|
|
|
|
|
SceneEditInfo sceneEditInfoDb = this.getByScenePlusId(scenePlus.getId());
|
|
|
SceneEditInfoExt sceneEditInfoExt = null;
|
|
@@ -715,6 +742,10 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
result.put("version", "2.1");
|
|
|
|
|
|
String floorplanCadPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "floorplan_cad.json";
|
|
|
+ if(!fYunFileService.fileExist(bucket, floorplanCadPath)){
|
|
|
+ log.warn("生成houseType.json失败,原因:floorplan_cad.json文件不存在,num:{}", num);
|
|
|
+ return;
|
|
|
+ }
|
|
|
String floorcadStr = fYunFileService.getFileContent(bucket, floorplanCadPath);
|
|
|
|
|
|
JSONObject floorcadObj = JSON.parseObject(floorcadStr);
|
|
@@ -897,9 +928,11 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
String sceneJson = redisUtil.get(key);
|
|
|
if(StrUtil.isNotEmpty(sceneJson)){
|
|
|
SceneJsonBean sceneJsonBean = JSON.parseObject(sceneJson, SceneJsonBean.class);
|
|
|
- sceneJsonBean.setVersion(version);
|
|
|
+ if(Objects.nonNull(version)){
|
|
|
+ sceneJsonBean.setVersion(version);
|
|
|
+ }
|
|
|
if(Objects.nonNull(imgVersion)){
|
|
|
- sceneJsonBean.setImgVersion(imgVersion + 1);
|
|
|
+ sceneJsonBean.setImgVersion(imgVersion);
|
|
|
}
|
|
|
redisUtil.set(key, JSON.toJSONString(sceneJsonBean));
|
|
|
}
|
|
@@ -909,9 +942,11 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
sceneJson= fYunFileService.getFileContent(bucket, sceneJsonPath);
|
|
|
if(StrUtil.isNotEmpty(sceneJson)){
|
|
|
SceneJsonBean sceneJsonBean = JSON.parseObject(sceneJson, SceneJsonBean.class);
|
|
|
- sceneJsonBean.setVersion(version);
|
|
|
+ if(Objects.nonNull(version)){
|
|
|
+ sceneJsonBean.setVersion(version);
|
|
|
+ }
|
|
|
if(Objects.nonNull(imgVersion)){
|
|
|
- sceneJsonBean.setImgVersion(imgVersion + 1);
|
|
|
+ sceneJsonBean.setImgVersion(imgVersion);
|
|
|
}
|
|
|
fYunFileService.uploadFile(bucket, JSON.toJSONString(sceneJsonBean).getBytes(StandardCharsets.UTF_8), sceneJsonPath);
|
|
|
}
|
|
@@ -929,6 +964,19 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(scenePlus == null){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
}
|
|
|
+
|
|
|
+ //查询是否存在等待中的异步操作记录,如果存在,抛出业务异常,终止操作
|
|
|
+ this.checkSceneAsynOper(num, null, SceneAsynModuleType.UPLOAD_DOWNLOAD.code() , SceneAsynFuncType.PANORAMIC_IMAGE.code());
|
|
|
+
|
|
|
+ //清除全景图异步操作记录,防止再次下载的时候请求到旧的压缩包
|
|
|
+ sceneAsynOperLogService.remove(
|
|
|
+ new LambdaQueryWrapper<SceneAsynOperLog>()
|
|
|
+ .eq(SceneAsynOperLog::getNum, num)
|
|
|
+ .eq(SceneAsynOperLog::getModule, SceneAsynModuleType.UPLOAD_DOWNLOAD.code())
|
|
|
+ .eq(SceneAsynOperLog::getFunc, SceneAsynFuncType.PANORAMIC_IMAGE.code())
|
|
|
+ );
|
|
|
+
|
|
|
+
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
String bucket = scenePlusExt.getYunFileBucket();
|
|
|
|
|
@@ -943,7 +991,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
String zipTargetFilePath = targetImagesPath + file.getOriginalFilename();
|
|
|
|
|
|
//判断全景图缓存是否存在,如果不存在,从计算目录中拷贝到缓存目录
|
|
|
- this.cachePanorama(path, num);
|
|
|
+// this.cachePanorama(path, num);
|
|
|
|
|
|
//先删除本地文件
|
|
|
FileUtils.deleteDirectory(targetImagesPath);
|
|
@@ -954,9 +1002,14 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
file.transferTo(targetFile);
|
|
|
|
|
|
//如果是压缩包上传,需要解压缩
|
|
|
+ int async = CommonStatus.NO.code();
|
|
|
if(file.getOriginalFilename().endsWith(".zip")){
|
|
|
+
|
|
|
+ //标记为异步处理
|
|
|
+ async = CommonStatus.YES.code();
|
|
|
+
|
|
|
//解压zip包
|
|
|
- ZipUtil.unzip(zipTargetFilePath,targetImagesPath);
|
|
|
+ ZipUtil.unzip(zipTargetFilePath,targetImagesPath, CharsetUtil.CHARSET_GBK);
|
|
|
//删除压缩包
|
|
|
FileUtils.delFile(zipTargetFilePath);
|
|
|
}
|
|
@@ -990,11 +1043,13 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
|
|
|
//比对图片列表,不存在的要返回名称集合
|
|
|
- String visionPath = path + "/results/vision.txt";
|
|
|
+ String ossVisionPath = String.format(UploadFilePath.IMG_VIEW_PATH, num) + "vision.txt";
|
|
|
+ String visionPath = String.format(ConstantFilePath.SCENE_DATA_PATH_V4, num) + "vision.txt";
|
|
|
+ fYunFileService.downloadFile(ossVisionPath, visionPath);
|
|
|
List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
|
|
|
List<String> notExistFileList = uploadFileList.stream().filter(filePath -> {
|
|
|
filePath = filePath.substring(filePath.lastIndexOf(File.separator) + 1);
|
|
|
- if(panoramaImageList.contains(filePath)){
|
|
|
+ if(CollUtil.isEmpty(panoramaImageList) || panoramaImageList.contains(filePath)){
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|
|
@@ -1015,7 +1070,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
return filePath.substring(filePath.lastIndexOf(File.separator) + 1);
|
|
|
}).collect(Collectors.toList());
|
|
|
}
|
|
|
- return ResultData.ok(new UploadPanoramaVO(0, notExistFileList));
|
|
|
+ return ResultData.ok(new UploadPanoramaVO(0,0, notExistFileList));
|
|
|
}
|
|
|
|
|
|
//上传
|
|
@@ -1026,8 +1081,9 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
CreateObjUtil.convertVisionmodeldataToTxt(target + File.separator + "extras" + File.separator + "vision.modeldata",
|
|
|
target + File.separator + "extras" + File.separator + "vision.txt");
|
|
|
|
|
|
- FileUtils.copyFile(path + File.separator + "data.json", target + File.separator+"data.json", true);
|
|
|
- FileUtils.copyFile(path + File.separator + "project.json", target + File.separator+"project.json", true);
|
|
|
+ String ossResultPath = String.format(UploadFilePath.scene_result_data_path, num);
|
|
|
+ fYunFileService.downloadFile(bucket, ossResultPath + "data.json", target + File.separator+"data.json");
|
|
|
+ fYunFileService.downloadFile(bucket, ossResultPath + "project.json", target + File.separator+"project.json");
|
|
|
|
|
|
//data.json增加extras为执行重建算法
|
|
|
String data = FileUtils.readFile(target + File.separator+"data.json");
|
|
@@ -1061,11 +1117,74 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(new File(target + File.separator + "results").exists()){
|
|
|
FileUtils.delAllFile(target + File.separator + "results");
|
|
|
}
|
|
|
- if(FYunTypeEnum.AWS.code().equals(fyunType)){
|
|
|
- //亚马逊保持旧方式,超链接capture
|
|
|
- CreateObjUtil.createSoftConnection(path + File.separator + "capture", target + File.separator + "capture");
|
|
|
- }
|
|
|
+
|
|
|
fYunFileService.downloadFile(ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", target + File.separator + "capture/data.fdage");
|
|
|
+
|
|
|
+ //如果部分成功,则需要返回成功数量和失败列表
|
|
|
+ if(CollUtil.isNotEmpty(notExistFileList)){
|
|
|
+ notExistFileList = notExistFileList.stream().map(filePath -> {
|
|
|
+ return filePath.substring(filePath.lastIndexOf(File.separator) + 1);
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
+ UploadPanoramaVO uploadPanoramaVO = new UploadPanoramaVO();
|
|
|
+ uploadPanoramaVO.setAsyn(async);
|
|
|
+ if(async == CommonStatus.YES.code().intValue()){
|
|
|
+ List<String> finalUploadFileList = uploadFileList;
|
|
|
+ List<String> finalNotExistFileList = notExistFileList;
|
|
|
+ CompletableFuture.runAsync(() -> {
|
|
|
+ SceneAsynOperLog sceneAsynOperLog = new SceneAsynOperLog();
|
|
|
+ sceneAsynOperLog.setNum(num);
|
|
|
+ sceneAsynOperLog.setOperType(SceneAsynOperType.UPLOAD.code());
|
|
|
+ sceneAsynOperLog.setModule(SceneAsynModuleType.UPLOAD_DOWNLOAD.code());
|
|
|
+ sceneAsynOperLog.setFunc(SceneAsynFuncType.PANORAMIC_IMAGE.code());
|
|
|
+ if(CollUtil.isNotEmpty(finalNotExistFileList)){
|
|
|
+ Map<String, Object> extData = new HashMap<>();
|
|
|
+ extData.put("successCnt", finalUploadFileList.size());
|
|
|
+ extData.put("failList", finalNotExistFileList);
|
|
|
+ sceneAsynOperLog.setExtData(JSON.toJSONString(extData));
|
|
|
+ }
|
|
|
+ sceneAsynOperLogService.save(sceneAsynOperLog);
|
|
|
+ try {
|
|
|
+ this.uploadPanoramaHandler(num,bucket,target,imgViewPath, finalUploadFileList,targetImagesPath);
|
|
|
+ sceneAsynOperLog.setState(CommonOperStatus.SUCCESS.code());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("上传全景图报错,num:" + num, e);
|
|
|
+ sceneAsynOperLog.setState(CommonOperStatus.FAILD.code());
|
|
|
+ }
|
|
|
+ sceneAsynOperLogService.updateById(sceneAsynOperLog);
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.uploadPanoramaHandler(num,bucket,target,imgViewPath,uploadFileList,targetImagesPath);
|
|
|
+ if(CollUtil.isNotEmpty(notExistFileList)){
|
|
|
+ uploadPanoramaVO.setSuccessCnt(uploadFileList.size());
|
|
|
+ uploadPanoramaVO.setFailList(notExistFileList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ResultData.ok(uploadPanoramaVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void checkSceneAsynOper(String num, String operType, String module, String function){
|
|
|
+ LambdaQueryWrapper<SceneAsynOperLog> queryWrapper =
|
|
|
+ new LambdaQueryWrapper<SceneAsynOperLog>()
|
|
|
+ .eq(SceneAsynOperLog::getNum,num)
|
|
|
+ .eq(SceneAsynOperLog::getState, CommonOperStatus.WAITING.code());
|
|
|
+ if(StrUtil.isNotEmpty(operType)){
|
|
|
+ queryWrapper.eq(SceneAsynOperLog::getOperType, operType);
|
|
|
+ }
|
|
|
+ if(StrUtil.isNotEmpty(module)){
|
|
|
+ queryWrapper.eq(SceneAsynOperLog::getModule, module);
|
|
|
+ }
|
|
|
+ if(StrUtil.isNotEmpty(function)){
|
|
|
+ queryWrapper.eq(SceneAsynOperLog::getFunc, function);
|
|
|
+ }
|
|
|
+ List<SceneAsynOperLog> waittingLogList = sceneAsynOperLogService.list(queryWrapper);
|
|
|
+ if(CollUtil.isNotEmpty(waittingLogList)){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5066);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void uploadPanoramaHandler(String num, String bucket, String target, String imgViewPath, List<String> uploadFileList, String targetImagesPath) throws Exception {
|
|
|
CreateObjUtil.build3dModel(target , "1");
|
|
|
|
|
|
String uploadJsonPath= target + File.separator + "results" +File.separator+"upload.json";
|
|
@@ -1084,6 +1203,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(array == null){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_7013);
|
|
|
}
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
JSONObject fileJson = null;
|
|
|
String fileName = "";
|
|
|
for(int i = 0, len = array.size(); i < len; i++) {
|
|
@@ -1123,31 +1243,23 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
- if(map.size()>0) {
|
|
|
- fYunFileService.uploadMulFiles(bucket, map);
|
|
|
- }
|
|
|
|
|
|
- //拷贝修改后的全景图到缓存目录
|
|
|
- String cachedImagesPath = String.format(ConstantFilePath.SCENE_CACHE_IMAGES, num);
|
|
|
+ //用户上传的全景图上传到ossresult目录
|
|
|
+ String ossCachesImagesPath = String.format(UploadFilePath.scene_result_data_path, num) + "caches/images/";
|
|
|
uploadFileList.stream().forEach(srcPath->{
|
|
|
- cn.hutool.core.io.FileUtil.copy(srcPath, srcPath.replace(targetImagesPath, cachedImagesPath), true);
|
|
|
+ map.put(srcPath, srcPath.replace(targetImagesPath, ossCachesImagesPath));
|
|
|
});
|
|
|
|
|
|
+ if(map.size()>0) {
|
|
|
+ fYunFileService.uploadMulFiles(bucket, map);
|
|
|
+ }
|
|
|
+
|
|
|
//更新数据库版本号
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
SceneEditInfo sceneEditInfo = this.getByScenePlusId(scenePlus.getId());
|
|
|
this.upgradeVersionAndImgVersionById(sceneEditInfo.getId());
|
|
|
//更新scenejson缓存和oss文件版本号
|
|
|
this.upgradeSceneJsonVersion(num, sceneEditInfo.getVersion() + 1, sceneEditInfo.getImgVersion() + 1, bucket);
|
|
|
-
|
|
|
- //如果部分成功,则需要返回成功数量和失败列表
|
|
|
- if(CollUtil.isNotEmpty(notExistFileList)){
|
|
|
- notExistFileList = notExistFileList.stream().map(filePath -> {
|
|
|
- return filePath.substring(filePath.lastIndexOf(File.separator) + 1);
|
|
|
- }).collect(Collectors.toList());
|
|
|
- return ResultData.ok(new UploadPanoramaVO(uploadFileList.size(), notExistFileList));
|
|
|
- }
|
|
|
-
|
|
|
- return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1162,6 +1274,10 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(Objects.isNull(scenePlus)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
}
|
|
|
+
|
|
|
+ //查询是否存在等待中的异步操作记录,如果存在,抛出业务异常,终止操作
|
|
|
+ this.checkSceneAsynOper(num,null, SceneAsynModuleType.UPLOAD_DOWNLOAD.code() , SceneAsynFuncType.PANORAMIC_IMAGE.code());
|
|
|
+
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
String bucket = scenePlusExt.getYunFileBucket();
|
|
|
String path = scenePlusExt.getDataSource();
|
|
@@ -1174,47 +1290,96 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
String cacheImageFormat = "downloads/scene/%s/caches/images/";
|
|
|
|
|
|
//判断全景图缓存是否存在,如果不存在,从计算目录中拷贝到缓存目录
|
|
|
- this.cachePanorama(scenePlusExt.getDataSource(), num);
|
|
|
+// this.cachePanorama(scenePlusExt.getDataSource(), num);
|
|
|
+
|
|
|
+ //根据vision.txt获取到有效的全景图名称
|
|
|
+ String ossVisionPath = String.format(UploadFilePath.IMG_VIEW_PATH, num) + "vision.txt";
|
|
|
+ String visionPath = String.format(ConstantFilePath.SCENE_DATA_PATH_V4, num) + "vision.txt";
|
|
|
+ fYunFileService.downloadFile(ossVisionPath, visionPath);
|
|
|
+ List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
|
|
|
+ if(CollUtil.isEmpty(panoramaImageList)){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5063);
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
- String url = null;
|
|
|
- String downloadName = null;
|
|
|
+ //标记是否是异步操作,默认是同步操作
|
|
|
//如果入参文件名不为空,则是单个文件下载,不需要打包
|
|
|
+ String ossResultPath = String.format(UploadFilePath.scene_result_data_path, num) + "caches/images/";
|
|
|
if(StrUtil.isNotEmpty(fileName)){
|
|
|
//如果是单张图片,直接提供oss url
|
|
|
- String localFilePath = localImagesPath + fileName;
|
|
|
- String ossFilePath = imgCachePath + fileName;
|
|
|
- if(!cn.hutool.core.io.FileUtil.exist(localFilePath)){
|
|
|
+// if(!fYunFileService.fileExist(bucket, ossResultPath + fileName)){
|
|
|
+// throw new BusinessException(ErrorCode.FAILURE_CODE_5063);
|
|
|
+// }
|
|
|
+ if(!panoramaImageList.contains(fileName)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5063);
|
|
|
}
|
|
|
- fYunFileService.uploadFile(bucket, localFilePath, ossFilePath);
|
|
|
- url = ossUrlPrefix + ossFilePath;
|
|
|
- downloadName = fileName;
|
|
|
+ String url = ossUrlPrefix + ossResultPath + fileName;
|
|
|
+ String downloadName = fileName;
|
|
|
+ map.put("asyn", CommonStatus.NO.code());
|
|
|
+ map.put("fileUrl", url + "?t=" + System.currentTimeMillis());
|
|
|
+ map.put("fileName", downloadName);
|
|
|
+ return ResultData.ok(map);
|
|
|
}else{
|
|
|
- if(!cn.hutool.core.io.FileUtil.exist(localImagesPath)
|
|
|
- || cn.hutool.core.io.FileUtil.isDirEmpty(new File(localImagesPath))){
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5063);
|
|
|
- }
|
|
|
+ //清除旧的下载记录
|
|
|
+ sceneAsynOperLogService.remove(
|
|
|
+ new LambdaQueryWrapper<SceneAsynOperLog>()
|
|
|
+ .eq(SceneAsynOperLog::getNum, num)
|
|
|
+ .eq(SceneAsynOperLog::getOperType, SceneAsynOperType.DOWNLOAD.code())
|
|
|
+ .eq(SceneAsynOperLog::getModule, SceneAsynModuleType.UPLOAD_DOWNLOAD.code())
|
|
|
+ .eq(SceneAsynOperLog::getFunc, SceneAsynFuncType.PANORAMIC_IMAGE.code()));
|
|
|
+
|
|
|
+ //开始异步执行下载全景图压缩包操作
|
|
|
+ CompletableFuture.runAsync(() -> {
|
|
|
+ SceneEditInfo sceneEditInfo = this.getByScenePlusId(scenePlus.getId());
|
|
|
+ SceneAsynOperLog sceneAsynOperLog = new SceneAsynOperLog();
|
|
|
+ sceneAsynOperLog.setNum(num);
|
|
|
+ sceneAsynOperLog.setOperType(SceneAsynOperType.DOWNLOAD.code());
|
|
|
+ sceneAsynOperLog.setModule(SceneAsynModuleType.UPLOAD_DOWNLOAD.code());
|
|
|
+ sceneAsynOperLog.setFunc(SceneAsynFuncType.PANORAMIC_IMAGE.code());
|
|
|
+ sceneAsynOperLog.setVersion(sceneEditInfo.getImgVersion());
|
|
|
+ sceneAsynOperLogService.save(sceneAsynOperLog);
|
|
|
+ try {
|
|
|
+
|
|
|
+ //下载到本地目录
|
|
|
+ FileUtil.del(localImagesPath);
|
|
|
+ fYunFileService.downloadFileByCommand(bucket, localImagesPath, ossResultPath);
|
|
|
+ //移除非必须文件
|
|
|
+ List<String> fileNames = FileUtil.listFileNames(localImagesPath);
|
|
|
+ fileNames.stream().forEach(name->{
|
|
|
+ if(!panoramaImageList.contains(name)){
|
|
|
+ FileUtil.del(localImagesPath + name);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ String downloadName = num + "_images.zip";
|
|
|
+ long start = Calendar.getInstance().getTimeInMillis();
|
|
|
+ //打包
|
|
|
+ String zipPath = cachePath + downloadName;
|
|
|
+ ZipUtil.zip(localImagesPath, zipPath);
|
|
|
+ long end1 = Calendar.getInstance().getTimeInMillis();
|
|
|
+ log.info("打包耗时:" + (end1 - start));
|
|
|
+ //上传压缩包
|
|
|
+ fYunFileService.uploadFileByCommand(bucket, zipPath, String.format(cacheFormat, num) + downloadName);
|
|
|
+ String url = String.format(cacheFormat, num) + downloadName;
|
|
|
+ long end2 = Calendar.getInstance().getTimeInMillis();
|
|
|
+ log.info("上传耗时:" + (end2 - end1));
|
|
|
+ //删除本地压缩包
|
|
|
+ FileUtils.deleteFile(zipPath);
|
|
|
+ //删除本地目录
|
|
|
+ FileUtils.deleteDirectory(localImagesPath);
|
|
|
+ sceneAsynOperLog.setState(CommonOperStatus.SUCCESS.code());
|
|
|
+ sceneAsynOperLog.setUrl(url);
|
|
|
+ }catch (Exception e){
|
|
|
+ sceneAsynOperLog.setState(CommonOperStatus.FAILD.code());
|
|
|
+ log.error("下载全景图压缩包失败,num:" + num, e);
|
|
|
+ }
|
|
|
+ sceneAsynOperLogService.saveOrUpdate(sceneAsynOperLog);
|
|
|
+ });
|
|
|
|
|
|
- downloadName = num + "_images.zip";
|
|
|
- long start = Calendar.getInstance().getTimeInMillis();
|
|
|
- //打包
|
|
|
- String zipPath = cachePath + downloadName;
|
|
|
- ZipUtil.zip(localImagesPath, zipPath);
|
|
|
- long end1 = Calendar.getInstance().getTimeInMillis();
|
|
|
- log.info("打包耗时:" + (end1 - start));
|
|
|
- //上传压缩包
|
|
|
- fYunFileService.uploadFileByCommand(bucket, zipPath, String.format(cacheFormat, num) + downloadName);
|
|
|
- url = ossUrlPrefix + String.format(cacheFormat, num) + downloadName;
|
|
|
- long end2 = Calendar.getInstance().getTimeInMillis();
|
|
|
- log.info("上传耗时:" + (end2 - end1));
|
|
|
- //删除本地压缩包
|
|
|
-// FileUtils.deleteFile(zipPath);
|
|
|
+ map.put("asyn", CommonStatus.YES.code());
|
|
|
+ return ResultData.ok(map);
|
|
|
}
|
|
|
-
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("fileUrl", url + "?t=" + System.currentTimeMillis());
|
|
|
- map.put("fileName", downloadName);
|
|
|
- return ResultData.ok(map);
|
|
|
}
|
|
|
|
|
|
private void cachePanorama(String dataSource, String num){
|
|
@@ -1425,8 +1590,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
fYunFileService.uploadFile(bucket, target + File.separator + "extras/video/" + videoName.replace("mp4", "flv"),videosViewPath + videoName.replace("mp4", "flv"));
|
|
|
|
|
|
//覆盖原始视频资源
|
|
|
- FileUtils.copyFile(target + File.separator + "extras/video/" + videoName,
|
|
|
- path + File.separator + "caches/videos/" + videoName, true);
|
|
|
+// FileUtils.copyFile(target + File.separator + "extras/video/" + videoName,
|
|
|
+// path + File.separator + "caches/videos/" + videoName, true);
|
|
|
|
|
|
}
|
|
|
FileUtils.deleteDirectory(target + File.separator + "extras/video/");
|
|
@@ -1498,15 +1663,20 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(new File(target + File.separator + "results").exists()){
|
|
|
FileUtils.delAllFile(target + File.separator + "results");
|
|
|
}
|
|
|
+
|
|
|
//创建文件夹,并link文件夹
|
|
|
new File(target + File.separator + "caches").mkdirs();
|
|
|
- CreateObjUtil.createSoftConnection(path + File.separator + "capture", target + File.separator + "capture");
|
|
|
+ fYunFileService.downloadFileByCommand(target + File.separator + "capture", SceneUtil.getHomePath(path));
|
|
|
+// CreateObjUtil.createSoftConnection(path + File.separator + "capture", target + File.separator + "capture");
|
|
|
if(new File(path + File.separator + "caches" + File.separator + "images").exists()){
|
|
|
CreateObjUtil.createSoftConnection(path + File.separator + "caches" + File.separator + "images", target + File.separator + "caches" + File.separator + "images");
|
|
|
}
|
|
|
|
|
|
- FileUtils.copyFile(path + File.separator + "data.json", target + File.separator+"data.json", true);
|
|
|
- FileUtils.copyFile(path + File.separator + "project.json", target + File.separator+"project.json", true);
|
|
|
+ String ossResultPath = String.format(UploadFilePath.scene_result_data_path, num);
|
|
|
+ fYunFileService.downloadFile(bucket, ossResultPath + "data.json", target + File.separator+"data.json");
|
|
|
+ fYunFileService.downloadFile(bucket, ossResultPath + "project.json", target + File.separator+"project.json");
|
|
|
+// FileUtils.copyFile(path + File.separator + "data.json", target + File.separator+"data.json", true);
|
|
|
+// FileUtils.copyFile(path + File.separator + "project.json", target + File.separator+"project.json", true);
|
|
|
|
|
|
//data.json增加extras为执行重建算法
|
|
|
String project = FileUtils.readFile(target + File.separator+"project.json");
|
|
@@ -1779,7 +1949,6 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
String bucket = scenePlusExt.getYunFileBucket();
|
|
|
|
|
|
- String localDataPath = String.format(ConstantFilePath.DATABUFFER_FORMAT, num);
|
|
|
String localImagesPath = String.format(ConstantFilePath.IMAGESBUFFER_FORMAT, num);
|
|
|
String path = scenePlusExt.getDataSource();
|
|
|
String target = localImagesPath + "panorama/" + sid;
|
|
@@ -1794,8 +1963,9 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
file.transferTo(targetFile);
|
|
|
|
|
|
//调用算法切全景图
|
|
|
- FileUtils.copyFile(path + File.separator + "data.json", target + File.separator+"data.json", true);
|
|
|
- FileUtils.copyFile(path + File.separator + "project.json", target + File.separator+"project.json", true);
|
|
|
+ String ossResultPath = String.format(UploadFilePath.scene_result_data_path, num);
|
|
|
+ fYunFileService.downloadFile(bucket, ossResultPath + "data.json", target + File.separator+"data.json");
|
|
|
+ fYunFileService.downloadFile(bucket, ossResultPath + "project.json", target + File.separator+"project.json");
|
|
|
JSONObject visionJson = new JSONObject();
|
|
|
JSONArray visionArray = new JSONArray();
|
|
|
visionJson.put("uuid", sid);
|
|
@@ -1804,9 +1974,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
visionArray.add(visionJson);
|
|
|
JSONObject vision = new JSONObject();
|
|
|
vision.put("sweepLocations", visionArray);
|
|
|
- cn.hutool.core.io.FileUtil.writeString(vision.toString(),
|
|
|
- target + "/extras" + File.separator + "vision.txt",
|
|
|
- StandardCharsets.UTF_8);
|
|
|
+ cn.hutool.core.io.FileUtil.writeString(vision.toString(), target + "/extras" + File.separator + "vision.txt", StandardCharsets.UTF_8);
|
|
|
|
|
|
//data.json增加extras为执行重建算法
|
|
|
String type = "4k";
|
|
@@ -1834,8 +2002,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
dataJson.put("skybox_type", skyboxType);
|
|
|
|
|
|
- cn.hutool.core.io.FileUtil.writeString(dataJson.toString(),
|
|
|
- target + File.separator+"data.json", StandardCharsets.UTF_8);
|
|
|
+ cn.hutool.core.io.FileUtil.writeString(dataJson.toString(), target + File.separator+"data.json", StandardCharsets.UTF_8);
|
|
|
}
|
|
|
|
|
|
//创建文件夹软连接并且复制data.json和project.json
|
|
@@ -1850,10 +2017,6 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
cn.hutool.core.io.FileUtil.del(resultPath);
|
|
|
}
|
|
|
//下载data.fdage
|
|
|
- if(FYunTypeEnum.AWS.code().equals(this.fyunType)){
|
|
|
- //亚马逊保持旧方式,超链接capture
|
|
|
- CreateObjUtil.createSoftConnection(path + File.separator + "capture", capturePath);
|
|
|
- }
|
|
|
fYunFileService.downloadFile(ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", capturePath + "/data.fdage");
|
|
|
CreateObjUtil.build3dModel(target , "1");
|
|
|
|
|
@@ -1983,14 +2146,19 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
List<String> deletDataList = redisUtil.hMultiGet(key, deleteSidList);
|
|
|
if(CollUtil.isEmpty(deletDataList))
|
|
|
return;
|
|
|
+ List<String> thumbNameList = deleteSidList.stream().map(sid -> {
|
|
|
+ String linkPan = redisUtil.hget(key, sid);
|
|
|
+ JSONObject linkPanObj = JSON.parseObject(linkPan);
|
|
|
+ return FileUtil.getPrefix(linkPanObj.getString("thumb"));
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
|
|
//从redis中移除热点数据
|
|
|
redisUtil.hdel(key, deleteSidList.toArray());
|
|
|
|
|
|
//删除oss文件
|
|
|
String imgEditPath = String.format(UploadFilePath.IMG_EDIT_PATH, num);
|
|
|
- deleteSidList.stream().forEach(sid->{
|
|
|
- fYunFileService.deleteFolder(bucket, imgEditPath + "panorama_edit/" + sid);
|
|
|
+ thumbNameList.stream().forEach(thumbName->{
|
|
|
+ fYunFileService.deleteFolder(bucket, imgEditPath + "panorama/" + thumbName);
|
|
|
});
|
|
|
|
|
|
}
|
|
@@ -2405,8 +2573,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
boxVideosJson.add(boxVideo);
|
|
|
}
|
|
|
|
|
|
- boxVideosJson.clear();
|
|
|
- boxVideosJson.add(boxVideo);
|
|
|
+// boxVideosJson.clear();
|
|
|
+// boxVideosJson.add(boxVideo);
|
|
|
|
|
|
}
|
|
|
if(boxVideosJson.size() != 0){
|
|
@@ -2600,7 +2768,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResultData saveFilter(BaseDataParamVO param) throws Exception {
|
|
|
+ public ResultData saveFilter(SaveFiltersParamVO param) throws Exception {
|
|
|
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(param.getNum());
|
|
|
if(Objects.isNull(scenePlus)){
|
|
@@ -2621,11 +2789,19 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
//写本地文件,作为备份
|
|
|
this.writeFilter(param.getNum());
|
|
|
|
|
|
+ //如果页面选择恢复默认,filters字段值为否
|
|
|
+ if(Objects.nonNull(param.getReset()) && param.getReset() == CommonStatus.YES.code().intValue()){
|
|
|
+ filters = CommonStatus.NO.code();
|
|
|
+ }
|
|
|
+
|
|
|
//更新数据库
|
|
|
SceneEditInfoExt sceneEditInfoExt = sceneEditInfoExtService.getByScenePlusId(scenePlus.getId());
|
|
|
sceneEditInfoExt.setFilters(filters);
|
|
|
sceneEditInfoExtService.updateById(sceneEditInfoExt);
|
|
|
|
|
|
+ //更新版本号
|
|
|
+ this.upgradeVersionById(sceneEditInfoExt.getEditInfoId());
|
|
|
+
|
|
|
return ResultData.ok();
|
|
|
|
|
|
}
|