|
@@ -19,7 +19,6 @@ import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.common.util.FileSizeUtil;
|
|
import com.fdkankan.common.util.FileSizeUtil;
|
|
|
import com.fdkankan.common.util.FileUtils;
|
|
import com.fdkankan.common.util.FileUtils;
|
|
|
import com.fdkankan.dxf.parse.utils.FdJsonToDxfUtil;
|
|
import com.fdkankan.dxf.parse.utils.FdJsonToDxfUtil;
|
|
|
-import com.fdkankan.model.constants.ConstantFilePath;
|
|
|
|
|
import com.fdkankan.model.constants.UploadFilePath;
|
|
import com.fdkankan.model.constants.UploadFilePath;
|
|
|
import com.fdkankan.model.utils.ComputerUtil;
|
|
import com.fdkankan.model.utils.ComputerUtil;
|
|
|
import com.fdkankan.model.utils.CreateHouseJsonUtil;
|
|
import com.fdkankan.model.utils.CreateHouseJsonUtil;
|
|
@@ -284,7 +283,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
// sceneJson.setDynamicPanel(sceneDynamicPanelService.checkDynamicPanel(num));
|
|
// sceneJson.setDynamicPanel(sceneDynamicPanelService.checkDynamicPanel(num));
|
|
|
|
|
|
|
|
//本地写sceneJson文件
|
|
//本地写sceneJson文件
|
|
|
- String localSceneJsonPath = String.format(scenePlusExt.getDataSource()+ ConstantFileLocPath.SCENE_DATA_PATH_V4, num) + "scene.json";
|
|
|
|
|
|
|
+ String localSceneJsonPath = scenePlusExt.getDataSource() + File.separator + String.format(ConstantFileLocPath.SCENE_DATA_PATH_V4, num) + "scene.json";
|
|
|
FileUtils.writeFile(localSceneJsonPath, JSON.toJSONString(sceneJson));
|
|
FileUtils.writeFile(localSceneJsonPath, JSON.toJSONString(sceneJson));
|
|
|
//上传sceneJson文件
|
|
//上传sceneJson文件
|
|
|
String sceneJsonPath = String.format(UploadFilePath.DATA_VIEW_PATH+"scene.json", num);
|
|
String sceneJsonPath = String.format(UploadFilePath.DATA_VIEW_PATH+"scene.json", num);
|
|
@@ -607,7 +606,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
SceneInfoVO sceneInfoVO = null;
|
|
SceneInfoVO sceneInfoVO = null;
|
|
|
//先查询redis
|
|
//先查询redis
|
|
|
if(StrUtil.isEmpty(sceneJson)) {
|
|
if(StrUtil.isEmpty(sceneJson)) {
|
|
|
- String objectName = String.format(ConstantFilePath.SCENE_VIEW_DATA_DATA_SCENEJSON, num);
|
|
|
|
|
|
|
+ String objectName = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "scene.json";
|
|
|
sceneJson = ossUtil.getFileContent(bucket, objectName);
|
|
sceneJson = ossUtil.getFileContent(bucket, objectName);
|
|
|
redisUtil.set(key, sceneJson);
|
|
redisUtil.set(key, sceneJson);
|
|
|
}
|
|
}
|
|
@@ -655,7 +654,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
|
|
String bucket = scenePlusExt.getYunFileBucket();
|
|
String bucket = scenePlusExt.getYunFileBucket();
|
|
|
String editUserPath = String.format(UploadFilePath.USER_EDIT_PATH, num);
|
|
String editUserPath = String.format(UploadFilePath.USER_EDIT_PATH, num);
|
|
|
- String localDataPath = String.format(scenePlusExt.getDataSource()+ ConstantFileLocPath.SCENE_DATA_PATH_V4, num);
|
|
|
|
|
|
|
+ String localDataPath = scenePlusExt.getDataSource() + File.separator + String.format(ConstantFileLocPath.SCENE_DATA_PATH_V4, num);
|
|
|
|
|
|
|
|
JSONObject fileInfoJson = JSON.parseObject(param.getData());
|
|
JSONObject fileInfoJson = JSON.parseObject(param.getData());
|
|
|
Float angel = null;
|
|
Float angel = null;
|
|
@@ -727,8 +726,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(!"dxf".equals(extName)){
|
|
if(!"dxf".equals(extName)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_7007.code(), ErrorCode.FAILURE_CODE_7007.formatMessage("dxf"));
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_7007.code(), ErrorCode.FAILURE_CODE_7007.formatMessage("dxf"));
|
|
|
}
|
|
}
|
|
|
- String dfxPath = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num) + UUID.randomUUID() + "." + extName;
|
|
|
|
|
- String floorplanUserPath = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num) + UUID.randomUUID() + ".json";
|
|
|
|
|
|
|
+ String dfxPath = scenePlusService.getDataSource(num) + File.separator + String.format(ConstantFileLocPath.SCENE_USER_PATH_V4, num) + UUID.randomUUID() + "." + extName;
|
|
|
|
|
+ String floorplanUserPath = scenePlusService.getDataSource(num) + File.separator + String.format(ConstantFileLocPath.SCENE_USER_PATH_V4, num) + UUID.randomUUID() + ".json";
|
|
|
file.transferTo(new File(dfxPath));
|
|
file.transferTo(new File(dfxPath));
|
|
|
try {
|
|
try {
|
|
|
String editUserPath = String.format(UploadFilePath.USER_EDIT_PATH, num);
|
|
String editUserPath = String.format(UploadFilePath.USER_EDIT_PATH, num);
|
|
@@ -791,9 +790,9 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
ossFloorplanPath = String.format(UploadFilePath.USER_EDIT_PATH, num) + "floorplan.json";
|
|
ossFloorplanPath = String.format(UploadFilePath.USER_EDIT_PATH, num) + "floorplan.json";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- String localFloorplan = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num) + UUID.randomUUID() + ".json";
|
|
|
|
|
|
|
+ String localFloorplan = scenePlusService.getDataSource(num) + File.separator + String.format(ConstantFileLocPath.SCENE_USER_PATH_V4, num) + UUID.randomUUID() + ".json";
|
|
|
ossUtil.downloadFile(scenePlusExt.getYunFileBucket(), ossFloorplanPath, localFloorplan);
|
|
ossUtil.downloadFile(scenePlusExt.getYunFileBucket(), ossFloorplanPath, localFloorplan);
|
|
|
- String localDxf = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num) + UUID.randomUUID() + ".dxf";
|
|
|
|
|
|
|
+ String localDxf = scenePlusService.getDataSource(num) + File.separator + String.format(ConstantFileLocPath.SCENE_USER_PATH_V4, num) + UUID.randomUUID() + ".dxf";
|
|
|
FdJsonToDxfUtil.fdJsonToDxf(localFloorplan, localDxf, subgroup);
|
|
FdJsonToDxfUtil.fdJsonToDxf(localFloorplan, localDxf, subgroup);
|
|
|
String key = ossUtil.getUploadTempFileKey(null, "dxf");
|
|
String key = ossUtil.getUploadTempFileKey(null, "dxf");
|
|
|
ossUtil.uploadFile(scenePlusExt.getYunFileBucket(), key, localDxf, false);
|
|
ossUtil.uploadFile(scenePlusExt.getYunFileBucket(), key, localDxf, false);
|
|
@@ -1150,7 +1149,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
|
|
//比对图片列表,不存在的要返回名称集合
|
|
//比对图片列表,不存在的要返回名称集合
|
|
|
String ossVisionPath = String.format(UploadFilePath.IMG_VIEW_PATH, 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";
|
|
|
|
|
|
|
+ String visionPath = scenePlusService.getDataSource(num) + File.separator + String.format(ConstantFileLocPath.SCENE_DATA_PATH_V4, num) + "vision.txt";
|
|
|
ossUtil.downloadFile(bucket, ossVisionPath, visionPath);
|
|
ossUtil.downloadFile(bucket, ossVisionPath, visionPath);
|
|
|
List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
|
|
List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
|
|
|
List<String> notExistFileList = uploadFileList.stream().filter(filePath -> {
|
|
List<String> notExistFileList = uploadFileList.stream().filter(filePath -> {
|
|
@@ -1370,21 +1369,19 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
String bucket = scenePlusExt.getYunFileBucket();
|
|
String bucket = scenePlusExt.getYunFileBucket();
|
|
|
- String path = scenePlusExt.getDataSource();
|
|
|
|
|
|
|
|
|
|
- String cachePath = String.format(ConstantFilePath.SCENE_CACHE, num);
|
|
|
|
|
- String imgCachePath = String.format(UploadFilePath.IMG_CACHES_PATH, num);
|
|
|
|
|
- String localImagesPath = String.format(ConstantFilePath.SCENE_CACHE_IMAGES, num);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ String cachePath = scenePlusService.getDataSource(num) + File.separator + String.format(ConstantFileLocPath.SCENE_CACHE, num);
|
|
|
|
|
+ String localImagesPath = scenePlusService.getDataSource(num) + File.separator + String.format(ConstantFileLocPath.SCENE_CACHE_IMAGES, num);
|
|
|
|
|
|
|
|
String cacheFormat = "downloads/scene/%s/caches/";
|
|
String cacheFormat = "downloads/scene/%s/caches/";
|
|
|
- String cacheImageFormat = "downloads/scene/%s/caches/images/";
|
|
|
|
|
|
|
|
|
|
//判断全景图缓存是否存在,如果不存在,从计算目录中拷贝到缓存目录
|
|
//判断全景图缓存是否存在,如果不存在,从计算目录中拷贝到缓存目录
|
|
|
// this.cachePanorama(scenePlusExt.getDataSource(), num);
|
|
// this.cachePanorama(scenePlusExt.getDataSource(), num);
|
|
|
|
|
|
|
|
//根据vision.txt获取到有效的全景图名称
|
|
//根据vision.txt获取到有效的全景图名称
|
|
|
String ossVisionPath = String.format(UploadFilePath.IMG_VIEW_PATH, 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";
|
|
|
|
|
|
|
+ String visionPath = scenePlusService.getDataSource(num) + File.separator + String.format(ConstantFileLocPath.SCENE_DATA_PATH_V4, num) + "vision.txt";
|
|
|
ossUtil.downloadFile(bucket, ossVisionPath, visionPath);
|
|
ossUtil.downloadFile(bucket, ossVisionPath, visionPath);
|
|
|
List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
|
|
List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
|
|
|
if(CollUtil.isEmpty(panoramaImageList)){
|
|
if(CollUtil.isEmpty(panoramaImageList)){
|
|
@@ -1472,7 +1469,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void cachePanorama(String dataSource, String num){
|
|
private void cachePanorama(String dataSource, String num){
|
|
|
- String cachedImagesPath = String.format(ConstantFilePath.SCENE_CACHE_IMAGES, num);
|
|
|
|
|
|
|
+ String cachedImagesPath = scenePlusService.getDataSource(num) + File.separator + String.format(ConstantFileLocPath.SCENE_CACHE_IMAGES, num);
|
|
|
if(FileUtil.exist(cachedImagesPath) && CollUtil.isNotEmpty(FileUtil.listFileNames(cachedImagesPath))){
|
|
if(FileUtil.exist(cachedImagesPath) && CollUtil.isNotEmpty(FileUtil.listFileNames(cachedImagesPath))){
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -1647,10 +1644,6 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_7012);
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_7012);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if(path != null && !"".equals(path) && path.startsWith("http")){
|
|
|
|
|
- path = ConstantFilePath.BUILD_MODEL_PATH + File.separator + path.split("/")[path.split("/").length - 2];
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
String target = path + "_images";
|
|
String target = path + "_images";
|
|
|
|
|
|
|
|
String filePath = target + File.separator + "extras/video" + File.separator + fileName;
|
|
String filePath = target + File.separator + "extras/video" + File.separator + fileName;
|
|
@@ -1697,7 +1690,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
@Override
|
|
@Override
|
|
|
public void upgradeVersionToSceneJson(String num, String bucket) throws Exception{
|
|
public void upgradeVersionToSceneJson(String num, String bucket) throws Exception{
|
|
|
String key = String.format(RedisKey.SCENE_JSON, num);
|
|
String key = String.format(RedisKey.SCENE_JSON, num);
|
|
|
- String objectName = String.format(ConstantFilePath.SCENE_VIEW_DATA_DATA_SCENEJSON, num);
|
|
|
|
|
|
|
+ String objectName = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "scene.json";
|
|
|
String objectContent = ossUtil.getFileContent(bucket, objectName);
|
|
String objectContent = ossUtil.getFileContent(bucket, objectName);
|
|
|
SceneJsonBean sceneJsonBean = JSON.parseObject(objectContent, SceneJsonBean.class);
|
|
SceneJsonBean sceneJsonBean = JSON.parseObject(objectContent, SceneJsonBean.class);
|
|
|
sceneJsonBean.setVersion(sceneJsonBean.getVersion() +1);
|
|
sceneJsonBean.setVersion(sceneJsonBean.getVersion() +1);
|
|
@@ -1724,13 +1717,13 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
// String bucket = scenePlusExt.getYunFileBucket();
|
|
// String bucket = scenePlusExt.getYunFileBucket();
|
|
|
//
|
|
//
|
|
|
// //更新scene.json文件
|
|
// //更新scene.json文件
|
|
|
-// String strsceneInfos = FileUtils.readFile(ConstantFilePath.SCENE_PATH + "data" + File.separator + "data" + num + File.separator + "scene.json");
|
|
|
|
|
|
|
+// String strsceneInfos = FileUtils.readFile(ConstantFileLocPath.SCENE_PATH + "data" + File.separator + "data" + num + File.separator + "scene.json");
|
|
|
// if(strsceneInfos == null)
|
|
// if(strsceneInfos == null)
|
|
|
-// new File(ConstantFilePath.SCENE_PATH + "data" + File.separator + "data" + num + File.separator + "scene.json").createNewFile();
|
|
|
|
|
|
|
+// new File(ConstantFileLocPath.SCENE_PATH + "data" + File.separator + "data" + num + File.separator + "scene.json").createNewFile();
|
|
|
//
|
|
//
|
|
|
// String path = scenePlusExt.getDataSource();// /mnt/data/0662c5389/831989883441512448/4898cab04f8c_202104141602356060/
|
|
// String path = scenePlusExt.getDataSource();// /mnt/data/0662c5389/831989883441512448/4898cab04f8c_202104141602356060/
|
|
|
// if(path != null && !"".equals(path) && path.startsWith("http")){
|
|
// if(path != null && !"".equals(path) && path.startsWith("http")){
|
|
|
-// path = ConstantFilePath.BUILD_MODEL_PATH + File.separator + path.split("/")[path.split("/").length - 2];
|
|
|
|
|
|
|
+// path = ConstantFileLocPath.BUILD_MODEL_PATH + File.separator + path.split("/")[path.split("/").length - 2];
|
|
|
// }
|
|
// }
|
|
|
// String target = path + "_ajk"; // /mnt/data/0662c5389/831989883441512448/4898cab04f8c_202104141602356060_ajk
|
|
// String target = path + "_ajk"; // /mnt/data/0662c5389/831989883441512448/4898cab04f8c_202104141602356060_ajk
|
|
|
// File editPath = new File(target);
|
|
// File editPath = new File(target);
|
|
@@ -1799,10 +1792,10 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
// FileUtils.writeFile(target + File.separator + "extras" + File.separator + "floorplan.json", new String(floorPlanJson.getBytes(), "UTF-8"));
|
|
// FileUtils.writeFile(target + File.separator + "extras" + File.separator + "floorplan.json", new String(floorPlanJson.getBytes(), "UTF-8"));
|
|
|
//
|
|
//
|
|
|
// FileUtils.writeFile(target + File.separator + "extras" + File.separator + "floor_ajk.json", new String(ajkJson.getBytes(), "UTF-8"));
|
|
// FileUtils.writeFile(target + File.separator + "extras" + File.separator + "floor_ajk.json", new String(ajkJson.getBytes(), "UTF-8"));
|
|
|
-// FileUtils.writeFile(ConstantFilePath.SCENE_PATH+"data"+File.separator+"data"+num + File.separator + "floor_ajk.json", new String(ajkJson.getBytes(), "UTF-8"));
|
|
|
|
|
|
|
+// FileUtils.writeFile(ConstantFileLocPath.SCENE_PATH+"data"+File.separator+"data"+num + File.separator + "floor_ajk.json", new String(ajkJson.getBytes(), "UTF-8"));
|
|
|
//
|
|
//
|
|
|
// FileUtils.writeFile(target + File.separator + "extras" + File.separator + "vision.txt", new String(cameraJson.getBytes(), "UTF-8"));
|
|
// FileUtils.writeFile(target + File.separator + "extras" + File.separator + "vision.txt", new String(cameraJson.getBytes(), "UTF-8"));
|
|
|
-// FileUtils.writeFile(ConstantFilePath.SCENE_PATH+"data"+File.separator+"data"+num + File.separator + "camera.json", new String(cameraJson.getBytes(), "UTF-8"));
|
|
|
|
|
|
|
+// FileUtils.writeFile(ConstantFileLocPath.SCENE_PATH+"data"+File.separator+"data"+num + File.separator + "camera.json", new String(cameraJson.getBytes(), "UTF-8"));
|
|
|
//
|
|
//
|
|
|
// for(int i = 0; i < files.length; i ++){
|
|
// for(int i = 0; i < files.length; i ++){
|
|
|
//
|
|
//
|
|
@@ -1967,7 +1960,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(exist){
|
|
if(exist){
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- String filePath = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num) + "mosaic.json";
|
|
|
|
|
|
|
+ String filePath = scenePlusService.getDataSource(num) + File.separator + String.format(ConstantFileLocPath.SCENE_USER_PATH_V4, num) + "mosaic.json";
|
|
|
String mosaicData = FileUtils.readUtf8String(filePath);
|
|
String mosaicData = FileUtils.readUtf8String(filePath);
|
|
|
if(StrUtil.isEmpty(mosaicData)){
|
|
if(StrUtil.isEmpty(mosaicData)){
|
|
|
return;
|
|
return;
|
|
@@ -1993,7 +1986,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
**/
|
|
**/
|
|
|
private void writeMosaic(String num) throws Exception{
|
|
private void writeMosaic(String num) throws Exception{
|
|
|
|
|
|
|
|
- String mosaicPath = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num) + "mosaic.json";
|
|
|
|
|
|
|
+ String mosaicPath = scenePlusService.getDataSource(num) + File.separator + String.format(ConstantFileLocPath.SCENE_USER_PATH_V4, num) + "mosaic.json";
|
|
|
|
|
|
|
|
String key = String.format(RedisKey.SCENE_MOSAIC_DATA, num);
|
|
String key = String.format(RedisKey.SCENE_MOSAIC_DATA, num);
|
|
|
Map<String, String> mosaicMap = redisUtil.hmget(key);
|
|
Map<String, String> mosaicMap = redisUtil.hmget(key);
|
|
@@ -2030,7 +2023,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
String bucket = scenePlusExt.getYunFileBucket();
|
|
String bucket = scenePlusExt.getYunFileBucket();
|
|
|
|
|
|
|
|
-// String localImagesPath = String.format(ConstantFilePath.IMAGESBUFFER_FORMAT, num);
|
|
|
|
|
|
|
+// String localImagesPath = String.format(ConstantFileLocPath.IMAGESBUFFER_FORMAT, num);
|
|
|
String localImagesPath = sceneService.getDataSource(num, scenePlus.getSceneSource(), scenePlusExt.getDataSource()) + "linkPan" + File.separator;
|
|
String localImagesPath = sceneService.getDataSource(num, scenePlus.getSceneSource(), scenePlusExt.getDataSource()) + "linkPan" + File.separator;
|
|
|
String path = scenePlusExt.getDataSource();
|
|
String path = scenePlusExt.getDataSource();
|
|
|
String target = localImagesPath + "panorama/" + sid;
|
|
String target = localImagesPath + "panorama/" + sid;
|
|
@@ -2392,7 +2385,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
}
|
|
|
jsonObject.put("styles", styleList);
|
|
jsonObject.put("styles", styleList);
|
|
|
|
|
|
|
|
- String linkScenePath = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num) + "links.json";
|
|
|
|
|
|
|
+ String linkScenePath = scenePlusService.getDataSource(num) + File.separator + String.format(ConstantFileLocPath.SCENE_USER_PATH_V4, num) + "links.json";
|
|
|
String lockVal = cn.hutool.core.lang.UUID.randomUUID().toString();
|
|
String lockVal = cn.hutool.core.lang.UUID.randomUUID().toString();
|
|
|
String lockKey = String.format(RedisLockKey.LOCK_LINK_SCENE_JSON, num);
|
|
String lockKey = String.format(RedisLockKey.LOCK_LINK_SCENE_JSON, num);
|
|
|
boolean lock = redisLockUtil.lock(lockKey, lockVal, RedisKey.EXPIRE_TIME_1_MINUTE);
|
|
boolean lock = redisLockUtil.lock(lockKey, lockVal, RedisKey.EXPIRE_TIME_1_MINUTE);
|
|
@@ -2453,7 +2446,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(exist){
|
|
if(exist){
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- String linkSceneFilePath = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num);
|
|
|
|
|
|
|
+ String linkSceneFilePath = scenePlusService.getDataSource(num) + File.separator + String.format(ConstantFileLocPath.SCENE_USER_PATH_V4, num);
|
|
|
String linkSceneData = FileUtils.readUtf8String(linkSceneFilePath + "links.json");
|
|
String linkSceneData = FileUtils.readUtf8String(linkSceneFilePath + "links.json");
|
|
|
if(StrUtil.isEmpty(linkSceneData)){
|
|
if(StrUtil.isEmpty(linkSceneData)){
|
|
|
return;
|
|
return;
|
|
@@ -2515,7 +2508,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(exist){
|
|
if(exist){
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- String linkSceneFilePath = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num);
|
|
|
|
|
|
|
+ String linkSceneFilePath = scenePlusService.getDataSource(num) + File.separator + String.format(ConstantFileLocPath.SCENE_USER_PATH_V4, num);
|
|
|
String linkSceneData = FileUtils.readUtf8String(linkSceneFilePath + "links.json");
|
|
String linkSceneData = FileUtils.readUtf8String(linkSceneFilePath + "links.json");
|
|
|
if(StrUtil.isEmpty(linkSceneData)){
|
|
if(StrUtil.isEmpty(linkSceneData)){
|
|
|
return;
|
|
return;
|
|
@@ -2868,7 +2861,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
|
|
private void writeFilter(String num) throws Exception{
|
|
private void writeFilter(String num) throws Exception{
|
|
|
|
|
|
|
|
- String filterPath = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num) + "filter.json";
|
|
|
|
|
|
|
+ String filterPath = scenePlusService.getDataSource(num) + File.separator + String.format(ConstantFileLocPath.SCENE_USER_PATH_V4, num) + "filter.json";
|
|
|
|
|
|
|
|
String key = String.format(RedisKey.SCENE_filter_DATA, num);
|
|
String key = String.format(RedisKey.SCENE_filter_DATA, num);
|
|
|
List<String> filters = redisUtil.lGet(key, 0, -1);
|
|
List<String> filters = redisUtil.lGet(key, 0, -1);
|
|
@@ -2908,7 +2901,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(exist){
|
|
if(exist){
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- String filePath = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num);
|
|
|
|
|
|
|
+ String filePath = scenePlusService.getDataSource(num) + File.separator + String.format(ConstantFileLocPath.SCENE_USER_PATH_V4, num);
|
|
|
String filterData = FileUtils.readUtf8String(filePath + "filter.json");
|
|
String filterData = FileUtils.readUtf8String(filePath + "filter.json");
|
|
|
if(StrUtil.isEmpty(filterData)){
|
|
if(StrUtil.isEmpty(filterData)){
|
|
|
return;
|
|
return;
|