|
@@ -152,6 +152,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(Objects.nonNull(param.getStarted())){
|
|
|
sceneEditInfoExt.setStarted(JSON.toJSONString(param.getStarted()));
|
|
|
}
|
|
|
+ sceneEditInfoExt.setFloorLogoType(param.getFloorLogoType());
|
|
|
// else{
|
|
|
// sceneEditInfoExt.setStarted("");
|
|
|
// }
|
|
@@ -240,6 +241,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
sceneJson.setSceneFrom(scenePlusExt.getSceneFrom());
|
|
|
sceneJson.setSceneKind(scenePlusExt.getSceneKind());
|
|
|
sceneJson.setModelKind(scenePlusExt.getModelKind());
|
|
|
+ sceneJson.setOrientation(scenePlusExt.getOrientation());
|
|
|
if(StrUtil.isNotEmpty(scenePlusExt.getVideos())){
|
|
|
sceneJson.setVideos(scenePlusExt.getVideos());
|
|
|
}
|
|
@@ -493,6 +495,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
sceneInfoVO.setSpace(FileSizeUtil.convert(scenePlusExt.getSpace(), FileSizeUnitType.MB.code()));
|
|
|
sceneInfoVO.setSns(JSON.parseObject(sceneEditInfoExt.getSnsInfo()));
|
|
|
sceneInfoVO.setStarted(JSON.parseObject(sceneEditInfoExt.getStarted()));
|
|
|
+ sceneInfoVO.setOrientation(scenePlusExt.getOrientation());
|
|
|
|
|
|
this.SortBoxVideos(sceneInfoVO);
|
|
|
|
|
@@ -600,6 +603,9 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(Objects.isNull(sceneInfoVO.getFloorPlanCompass())){
|
|
|
sceneInfoVO.setFloorPlanCompass(0f);
|
|
|
}
|
|
|
+ if(Objects.isNull(sceneInfoVO.getFloorLogoType())){
|
|
|
+ sceneInfoVO.setFloorLogoType(1);
|
|
|
+ }
|
|
|
SceneEditControlsVO controls = sceneInfoVO.getControls();
|
|
|
if(Objects.isNull(controls.getShowShare())){
|
|
|
controls.setShowShare(CommonStatus.YES.code().intValue());
|
|
@@ -613,6 +619,11 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(Objects.isNull(controls.getShowDrawTitle())){
|
|
|
controls.setShowDrawTitle(CommonStatus.YES.code().intValue());
|
|
|
}
|
|
|
+ if(Objects.isNull(controls.getShowSurveilScope())){
|
|
|
+ controls.setShowSurveilScope(CommonStatus.YES.code().intValue());
|
|
|
+ }
|
|
|
+
|
|
|
+ sceneInfoVO.setPayStatus(scenePlus.getPayStatus());
|
|
|
|
|
|
return sceneInfoVO;
|
|
|
}
|
|
@@ -691,7 +702,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResultData uploadDxf(MultipartFile file, String num) throws Exception {
|
|
|
+ public ResultData uploadDxf(MultipartFile file, String num, Integer subgroup) throws Exception {
|
|
|
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
@@ -706,6 +717,25 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
try {
|
|
|
String editUserPath = String.format(UploadFilePath.USER_EDIT_PATH, num);
|
|
|
FdJsonToDxfUtil.dxfToFdJson(dfxPath, floorplanUserPath);
|
|
|
+
|
|
|
+ String floorplanUserStr = FileUtil.readUtf8String(floorplanUserPath);
|
|
|
+ JSONObject floorplanUserObj = JSON.parseObject(floorplanUserStr);
|
|
|
+ JSONArray floors = floorplanUserObj.getJSONArray("floors");
|
|
|
+ JSONObject floor = floors.getJSONObject(0);
|
|
|
+
|
|
|
+ String ossFloorplanUserStr = fYunFileService.getFileContent(editUserPath + "floorplan.json");
|
|
|
+ JSONObject ossFloorplanUserObj = JSON.parseObject(ossFloorplanUserStr);
|
|
|
+ JSONArray ossFloors = ossFloorplanUserObj.getJSONArray("floors");
|
|
|
+ for(int i = 0; i < ossFloors.size(); i++){
|
|
|
+ JSONObject item = (JSONObject) ossFloors.get(i);
|
|
|
+ Integer itemSubgroup = item.getInteger("subgroup");
|
|
|
+ if(itemSubgroup == subgroup){
|
|
|
+ ossFloors.set(i, floor);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ FileUtil.writeUtf8String(ossFloorplanUserObj.toJSONString(), floorplanUserPath);
|
|
|
+
|
|
|
fYunFileService.uploadFile(scenePlusExt.getYunFileBucket(), floorplanUserPath, editUserPath + "floorplan.json");
|
|
|
JSONObject houseTypeJson = CreateHouseJsonUtil
|
|
|
.createHouseTypeJsonByUser(floorplanUserPath);
|
|
@@ -735,20 +765,20 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ResultData downloadDxf(String num) throws Exception {
|
|
|
+ public ResultData downloadDxf(String num, Integer subgroup) throws Exception {
|
|
|
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
SceneEditInfo sceneEditInfo = this.getByScenePlusId(scenePlus.getId());
|
|
|
- if(Objects.isNull(sceneEditInfo.getFloorPlanUser()) || sceneEditInfo.getFloorPlanUser() == CommonStatus.NO.code()){
|
|
|
- return ResultData.ok();
|
|
|
+ String ossFloorplanPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "floorplan.json";
|
|
|
+ if(Objects.nonNull(sceneEditInfo.getFloorPlanUser()) && sceneEditInfo.getFloorPlanUser() == CommonStatus.YES.code().intValue()){
|
|
|
+ ossFloorplanPath = String.format(UploadFilePath.USER_EDIT_PATH, num) + "floorplan.json";
|
|
|
}
|
|
|
|
|
|
String localFloorplan = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num) + UUID.randomUUID() + ".json";
|
|
|
- fYunFileService.downloadFile(scenePlusExt.getYunFileBucket(),
|
|
|
- String.format(UploadFilePath.USER_EDIT_PATH, num) + "floorplan.json", localFloorplan);
|
|
|
+ fYunFileService.downloadFile(scenePlusExt.getYunFileBucket(), ossFloorplanPath, localFloorplan);
|
|
|
String localDxf = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num) + UUID.randomUUID() + ".dxf";
|
|
|
- FdJsonToDxfUtil.fdJsonToDxf(localFloorplan, localDxf);
|
|
|
+ FdJsonToDxfUtil.fdJsonToDxf(localFloorplan, localDxf, subgroup);
|
|
|
String key = OssFileUtil.getUploadTempFileKey(null, "dxf");
|
|
|
fYunFileService.uploadFile(scenePlusExt.getYunFileBucket(), localDxf, key);
|
|
|
String url = fYunFileConfig.getHost() + key;
|
|
@@ -2798,23 +2828,24 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
|
|
|
String key = String.format(RedisKey.SCENE_filter_DATA, param.getNum());
|
|
|
+ redisUtil.del(key);//前端将全量数据传过来,所以这里先清空历史数据,然后保存前端数据即可
|
|
|
JSONArray filterArr = JSON.parseArray(param.getData());
|
|
|
int filters = CommonStatus.YES.code();
|
|
|
- if(CollUtil.isEmpty(filterArr)){
|
|
|
+ //如果页面选择恢复默认,filters字段值为否
|
|
|
+ if(Objects.nonNull(param.getReset()) && param.getReset() == CommonStatus.YES.code().intValue()){
|
|
|
filters = CommonStatus.NO.code();
|
|
|
- redisUtil.del(key);
|
|
|
}else{
|
|
|
- List<String> filterList = filterArr.stream().map(item->JSON.toJSONString(item)).collect(Collectors.toList());
|
|
|
- redisUtil.lRightPushAll(key, filterList);
|
|
|
+ if(CollUtil.isNotEmpty(filterArr)){
|
|
|
+ List<String> filterList = filterArr.stream().map(item->JSON.toJSONString(item)).collect(Collectors.toList());
|
|
|
+ redisUtil.lRightPushAll(key, filterList);
|
|
|
+ }else{
|
|
|
+ filters = CommonStatus.NO.code();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//写本地文件,作为备份
|
|
|
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());
|