Przeglądaj źródła

Merge remote-tracking branch 'origin/release' into project-zgwhzx

# Conflicts:
#	src/main/java/com/fdkankan/scene/entity/FolderScene.java
#	src/main/java/com/fdkankan/scene/service/impl/LaserServiceImpl.java
dengsixing 9 miesięcy temu
rodzic
commit
94cbc22552
23 zmienionych plików z 368 dodań i 115 usunięć
  1. 4 0
      src/main/java/com/fdkankan/scene/bean/SceneJsonBean.java
  2. 21 0
      src/main/java/com/fdkankan/scene/controller/FolderSceneController.java
  3. 12 4
      src/main/java/com/fdkankan/scene/controller/SceneEditController.java
  4. 21 0
      src/main/java/com/fdkankan/scene/controller/SceneProEditController.java
  5. 17 0
      src/main/java/com/fdkankan/scene/entity/SceneEditControls.java
  6. 6 0
      src/main/java/com/fdkankan/scene/entity/SceneEditInfoExt.java
  7. 3 0
      src/main/java/com/fdkankan/scene/entity/ScenePlusExt.java
  8. 13 6
      src/main/java/com/fdkankan/scene/listener/RabbitMqListener.java
  9. 11 50
      src/main/java/com/fdkankan/scene/schedule/ScheduleJob.java
  10. 2 2
      src/main/java/com/fdkankan/scene/service/ISceneEditInfoService.java
  11. 4 0
      src/main/java/com/fdkankan/scene/service/ISceneService.java
  12. 12 0
      src/main/java/com/fdkankan/scene/service/IVisionService.java
  13. 0 19
      src/main/java/com/fdkankan/scene/service/impl/CutModelServiceImpl.java
  14. 6 0
      src/main/java/com/fdkankan/scene/service/impl/LaserServiceImpl.java
  15. 46 15
      src/main/java/com/fdkankan/scene/service/impl/SceneEditInfoServiceImpl.java
  16. 82 19
      src/main/java/com/fdkankan/scene/service/impl/SceneProServiceImpl.java
  17. 27 0
      src/main/java/com/fdkankan/scene/service/impl/SceneServiceImpl.java
  18. 58 0
      src/main/java/com/fdkankan/scene/service/impl/VisionServiceImpl.java
  19. 5 0
      src/main/java/com/fdkankan/scene/vo/SceneEditControlsParamVO.java
  20. 6 0
      src/main/java/com/fdkankan/scene/vo/SceneEditControlsVO.java
  21. 2 0
      src/main/java/com/fdkankan/scene/vo/SceneEditInfoParamVO.java
  22. 5 0
      src/main/java/com/fdkankan/scene/vo/SceneInfoVO.java
  23. 5 0
      src/main/resources/mapper/scene/SceneProEditMapper.xml

+ 4 - 0
src/main/java/com/fdkankan/scene/bean/SceneJsonBean.java

@@ -236,5 +236,9 @@ public class SceneJsonBean {
     //动态面板
     private int dynamicPanel;
 
+    private Integer floorLogoType;
+
+    private String orientation;
+
 
 }

+ 21 - 0
src/main/java/com/fdkankan/scene/controller/FolderSceneController.java

@@ -0,0 +1,21 @@
+package com.fdkankan.scene.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 文件夹和场景关联表 前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2024-07-31
+ */
+@RestController
+@RequestMapping("/scene/folderScene")
+public class FolderSceneController {
+
+}
+

+ 12 - 4
src/main/java/com/fdkankan/scene/controller/SceneEditController.java

@@ -50,6 +50,8 @@ public class SceneEditController extends BaseController {
     private ISceneEditInfoExtService sceneEditInfoExtService;
     @Autowired
     private ICutModelService cutModelService;
+    @Autowired
+    private IVisionService visionService;
 
     /**
      * <p>
@@ -324,8 +326,8 @@ public class SceneEditController extends BaseController {
      **/
     @CheckPermit
     @GetMapping(value = "/cad/dxf/download")
-    public ResultData saveCadDxf(@RequestParam String num) throws Exception{
-        return sceneEditInfoService.downloadDxf(num);
+    public ResultData saveCadDxf(@RequestParam String num, @RequestParam Integer subgroup) throws Exception{
+        return sceneEditInfoService.downloadDxf(num, subgroup);
     }
 
     /**
@@ -339,8 +341,8 @@ public class SceneEditController extends BaseController {
      **/
     @CheckPermit
     @PostMapping(value = "/cad/dxf/upload")
-    public ResultData uploadDxf(@RequestParam MultipartFile file, @RequestParam String num) throws Exception{
-        return sceneEditInfoService.uploadDxf(file, num);
+    public ResultData uploadDxf(@RequestParam MultipartFile file, @RequestParam String num, Integer subgroup) throws Exception{
+        return sceneEditInfoService.uploadDxf(file, num, subgroup);
     }
 
     /**
@@ -928,6 +930,12 @@ public class SceneEditController extends BaseController {
         return cutModelService.deleteCutModel(param);
     }
 
+    @CheckPermit
+    @GetMapping(value = "/point/getLatAndLon")
+    public ResultData getPointLatAndLon(@RequestParam String num) throws Exception {
+        return ResultData.ok(visionService.getPointLatAndLon(num));
+    }
+
 
 
 }

+ 21 - 0
src/main/java/com/fdkankan/scene/controller/SceneProEditController.java

@@ -0,0 +1,21 @@
+package com.fdkankan.scene.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * pro场景编辑数据表 前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2024-07-31
+ */
+@RestController
+@RequestMapping("/scene/sceneProEdit")
+public class SceneProEditController {
+
+}
+

+ 17 - 0
src/main/java/com/fdkankan/scene/entity/SceneEditControls.java

@@ -149,6 +149,23 @@ public class SceneEditControls implements Serializable {
     @TableField("show_all_model")
     private Integer showAllModel;
 
+    /**
+     * 是否显示监控范围
+     */
+    @TableField("show_surveil_scope")
+    private Integer showSurveilScope;
+
+    /**
+     * 是否显示cad底图
+     */
+    @TableField("show_texture")
+    private Integer showTexture;
+
+    /**
+     * 是否显示cad底图
+     */
+    @TableField("show_panos")
+    private Integer showPanos;
 
 
     /**

+ 6 - 0
src/main/java/com/fdkankan/scene/entity/SceneEditInfoExt.java

@@ -121,6 +121,12 @@ public class SceneEditInfoExt {
     private String started;
 
     /**
+     * 地面logo类型(0-指北针,1-图标)
+     */
+    @TableField("floor_logo_type")
+    private Integer floorLogoType;
+
+    /**
      * 创建时间
      */
     @TableField("create_time")

+ 3 - 0
src/main/java/com/fdkankan/scene/entity/ScenePlusExt.java

@@ -151,6 +151,9 @@ public class ScenePlusExt implements Serializable {
     @TableField("yun_file_bucket")
     private String yunFileBucket;
 
+    @TableField("orientation")
+    private String orientation;
+
     /**
      * 创建时间
      */

+ 13 - 6
src/main/java/com/fdkankan/scene/listener/RabbitMqListener.java

@@ -7,6 +7,8 @@ import com.fdkankan.scene.service.IDownloadTourVideoService;
 import com.fdkankan.scene.service.ISceneService;
 import com.rabbitmq.client.Channel;
 import java.nio.charset.StandardCharsets;
+import java.util.Map;
+
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.amqp.core.Message;
 import org.springframework.amqp.rabbit.annotation.Queue;
@@ -82,15 +84,20 @@ public class RabbitMqListener {
      * concurrency = "3"    设置消费线程数,每个线程每次只拉取一条消息消费
      */
     @RabbitListener(
-        queuesToDeclare = @Queue("test_dsx")
+        queuesToDeclare = @Queue("${queue.scene.save-scene-orientation:save-scene-orientation}")
     )
-    public void test(Channel channel, Message message) throws Exception {
+    public void saveSceneOrientation(Channel channel, Message message) throws Exception {
         String messageId = message.getMessageProperties().getMessageId();
         String msg = new String(message.getBody(), StandardCharsets.UTF_8);
-        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
-        log.info("开始消费消息,id:{},queue:{},content:{}", messageId, "test_dsx", msg);
-        Thread.sleep(10000L);
-        log.info("deliverTag:" + message.getMessageProperties().getDeliveryTag());
+        log.info("开始消费消息,id:{},queue:{},content:{}", messageId, "save-scene-orientation", msg);
+        try {
+            Map<String, Object> map = JSON.parseObject(msg, Map.class);
+            sceneService.saveSceneOientation(map);
+        }catch (Exception e){
+            log.error("更新场景方向报错", e);
+        }finally {
+            channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
+        }
         log.info("结束消费消息,id:{}", messageId);
     }
 

+ 11 - 50
src/main/java/com/fdkankan/scene/schedule/ScheduleJob.java

@@ -29,66 +29,27 @@ public class ScheduleJob {
     @Autowired
     private RedisLockUtil redisLockUtil;
 
-    /**
-     * 清除异步批量下载全景图OSS压缩包
-     */
-    @Scheduled(cron="0 0 1 * * ?")
-    public void cleanDownloadPanorama() {
-        log.info("定时清除全景图压缩包开始");
-        sceneAsynOperLogService.cleanDownloadOssPage(SceneAsynFuncType.PANORAMIC_IMAGE.code(), 1);
-        log.info("定时清除全景图压缩包完毕");
-    }
-
-    /**
-     * 清除异步批量下载全景图OSS压缩包
-     */
-    @Scheduled(cron="0 0 1 * * ?")
-    public void cleanDownloadModel() {
-        log.info("定时清除模型压缩包开始");
-        sceneAsynOperLogService.cleanDownloadOssPage(SceneAsynFuncType.MODEL.code(), 1);
-        log.info("定时清除模型压缩包完毕");
-    }
-
 //    /**
-//     * 删除场景原始资源
-//     * 每天凌晨执行
+//     * 清除异步批量下载全景图OSS压缩包
 //     */
 //    @Scheduled(cron="0 0 1 * * ?")
-//    public void cleanOssHomeV3() {
-//        log.info("删除v3场景原始资源开始");
-//        String lockKey = RedisLockKey.LOCK_CLEAN_SCENE_ORIG_V3;
-//        try {
-//            boolean lock = redisLockUtil.lock(lockKey, 24*60*60);
-//            if(!lock){
-//                return;
-//            }
-//            sceneCleanOrigService.cleanOrigV3();
-//        }finally {
-//            redisLockUtil.unlockLua(lockKey);
-//        }
-//        log.info("删除v3场景原始资源结束");
+//    public void cleanDownloadPanorama() {
+//        log.info("定时清除全景图压缩包开始");
+//        sceneAsynOperLogService.cleanDownloadOssPage(SceneAsynFuncType.PANORAMIC_IMAGE.code(), 1);
+//        log.info("定时清除全景图压缩包完毕");
 //    }
 //
 //    /**
-//     * 删除场景原始资源
-//     * 每天凌晨执行
+//     * 清除异步批量下载全景图OSS压缩包
 //     */
 //    @Scheduled(cron="0 0 1 * * ?")
-//    public void cleanOssHomeV4() {
-//        log.info("删除v4场景原始资源开始");
-//        String lockKey = RedisLockKey.LOCK_CLEAN_SCENE_ORIG_V4;
-//        try {
-//            boolean lock = redisLockUtil.lock(lockKey, 24*60*60);
-//            if(!lock){
-//                return;
-//            }
-//            sceneCleanOrigService.cleanOrigV4();
-//        }finally {
-//            redisLockUtil.unlockLua(lockKey);
-//        }
-//        log.info("删除v4场景原始资源结束");
+//    public void cleanDownloadModel() {
+//        log.info("定时清除模型压缩包开始");
+//        sceneAsynOperLogService.cleanDownloadOssPage(SceneAsynFuncType.MODEL.code(), 1);
+//        log.info("定时清除模型压缩包完毕");
 //    }
 
+
     /**
      * 删除已删除场景原始资源及caches
      * 每天凌晨执行

+ 2 - 2
src/main/java/com/fdkankan/scene/service/ISceneEditInfoService.java

@@ -52,9 +52,9 @@ public interface ISceneEditInfoService extends IService<SceneEditInfo> {
 
     ResultData saveCad(BaseDataParamVO param) throws Exception;
 
-    ResultData uploadDxf(MultipartFile file, String num) throws Exception;
+    ResultData uploadDxf(MultipartFile file, String num, Integer subgroup) throws Exception;
 
-    ResultData downloadDxf(String num) throws Exception;
+    ResultData downloadDxf(String num, Integer subgroup) throws Exception;
 
     ResultData resetCad(String num) throws IOException;
 

+ 4 - 0
src/main/java/com/fdkankan/scene/service/ISceneService.java

@@ -5,6 +5,8 @@ import com.fdkankan.web.response.ResultData;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.util.Map;
+
 public interface ISceneService {
 
     ResultData uploadBodySegment(MultipartFile file,Integer rotate) throws Exception;
@@ -13,4 +15,6 @@ public interface ISceneService {
 
     ResultData getBodySegmentStatus(String uuid);
 
+    void saveSceneOientation(Map<String, Object> map);
+
 }

+ 12 - 0
src/main/java/com/fdkankan/scene/service/IVisionService.java

@@ -0,0 +1,12 @@
+package com.fdkankan.scene.service;
+
+import com.fdkankan.web.response.ResultData;
+
+import java.util.List;
+import java.util.Map;
+
+public interface IVisionService {
+
+    List<Map<String, Object>> getPointLatAndLon(String num);
+
+}

+ 0 - 19
src/main/java/com/fdkankan/scene/service/impl/CutModelServiceImpl.java

@@ -120,25 +120,6 @@ public class CutModelServiceImpl implements ICutModelService {
         //写入本地文件,作为备份
         this.writeFile(param.getNum());
 
-        //删除oss文件
-        List<String> deleteFileList = new ArrayList<>();
-        deleteList.stream().forEach(str -> {
-            JSONObject parse = JSON.parseObject(str);
-            String playUrl = parse.getString("playUrl");
-            if(StrUtil.isNotEmpty(playUrl) && playUrl.length() > 1){
-                deleteFileList.add(playUrl);
-            }
-            String poster = parse.getString("poster");
-            if(StrUtil.isNotEmpty(poster) && poster.length() > 1){
-                deleteFileList.add(poster);
-            }
-        });
-        sceneUploadService.delete(
-                DeleteFileParamVO.builder()
-                        .num(param.getNum())
-                        .fileNames(deleteFileList)
-                        .bizType(FileBizType.CUT_MODEL.code()).build());
-
         //保存数据库
         SceneEditInfoExt sceneEditInfoExt = sceneEditInfoExtService.getByScenePlusId(scenePlus.getId());
         this.updateDb(param.getNum(), scenePlus.getId());

+ 6 - 0
src/main/java/com/fdkankan/scene/service/impl/LaserServiceImpl.java

@@ -29,6 +29,8 @@ public class LaserServiceImpl implements ILaserService {
     private String cloudPointBuild;
     @Value("${queue.application.laser.copy-scene:laser-copy-scene}")
     private String laserCopyScene;
+    @Value("${queue.application.laser.copy-scene:laser-copy-scene-init}")
+    private String laserInitCopyScene;
     @Override
     public void copy(String oldNum, String newNum, String path, Boolean flag) {
         Map<String,Object> params = new HashMap<>();
@@ -36,6 +38,10 @@ public class LaserServiceImpl implements ILaserService {
         params.put("oldSceneCode", oldNum);
         params.put("path",path);
         params.put("init",flag);
+        if(flag){
+            rabbitMqProducer.sendByWorkQueue(laserInitCopyScene,params);
+            return;
+        }
         rabbitMqProducer.sendByWorkQueue(laserCopyScene,params);
     }
 

+ 46 - 15
src/main/java/com/fdkankan/scene/service/impl/SceneEditInfoServiceImpl.java

@@ -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());

+ 82 - 19
src/main/java/com/fdkankan/scene/service/impl/SceneProServiceImpl.java

@@ -476,15 +476,29 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
             return;
 
         //数据验证,新增、修改状态,hotdata不能为空
+        Set<String> linkSids = new HashSet<>();
         for (String sid : addOrUpdateMap.keySet()) {
             String hotData = addOrUpdateMap.get(sid);
             if(StrUtil.isEmpty(hotData)){
                 throw new BusinessException(ErrorCode.FAILURE_CODE_7004);
             }
+            JSONObject jsonObject = JSON.parseObject(hotData);
+            String type = jsonObject.getString("type");
+            if("link".equals(type)){
+                linkSids.add(sid);
+            }
         }
 
-        //批量写入缓存
+        //如果是修改,且由多媒体改成link的方式,将原有的多媒体文件删除
         String key = String.format(RedisKey.SCENE_HOT_DATA, num);
+        List<String> updateList = redisUtil.hMultiGet(key, new ArrayList<>(linkSids));
+        try {
+            this.deleteHotMediaFile(num, updateList, false);
+        }catch (Exception e){
+            log.error("删除多媒体文件失败", e);
+        }
+
+        //批量写入缓存
         redisUtil.hmset(key, addOrUpdateMap);
     }
 
@@ -502,34 +516,83 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         List<String> deletDataList = redisUtil.hMultiGet(key, deleteSidList);
         if(CollUtil.isEmpty(deletDataList))
             return;
-        String userDataPath = String.format(UploadFilePath.USER_EDIT_PATH, num);
+
+        //从redis中移除热点数据
+        redisUtil.hdel(key, deleteSidList.toArray());
 
         //删除图片音频视频等资源文件
-        for (String data : deletDataList) {
+        this.deleteHotMediaFile(num, deletDataList, true);
+
+    }
+
+    private void deleteHotMediaFile(String num, List<String> hotdataList, boolean deleteBgm) throws Exception {
+        if(CollUtil.isEmpty(hotdataList)){
+            return;
+        }
+        //删除图片音频视频等资源文件
+        List<String> deleteFileList = new ArrayList<>();
+        for (String data : hotdataList) {
             if(StrUtil.isBlank(data)){
                 continue;
             }
             JSONObject jsonObject = JSON.parseObject(data);
-            String sid = jsonObject.getString("sid");
-            if(jsonObject.containsKey("media")){
-                String fileType = jsonObject.getString("media");
-                if(fileType.contains("photo"))
-                {
-                    fYunFileService.deleteFile(bucket,userDataPath + "hot"+sid+".jpg");
-                }
-                if(fileType.contains("audio") || fileType.contains("voice"))
-                {
-                    fYunFileService.deleteFile(bucket,userDataPath + "hot"+sid+".mp3");
+
+            //删除背景音乐
+            if(deleteBgm){
+                JSONObject bgm = jsonObject.getJSONObject("bgm");
+                if(Objects.nonNull(bgm) && StrUtil.isNotEmpty(bgm.getString("src"))){
+                    String bgmSrc = bgm.getString("src");
+                    deleteFileList.add(bgmSrc);
                 }
-                if(fileType.contains("video"))
+            }
+
+
+            String type = jsonObject.getString("type");
+
+            if("media".equals(type)){//V4.13.0版本改成这种方式
+                //删除图片、视频
+                JSONArray media = jsonObject.getJSONArray("media");
+                media.stream().forEach(v->{
+                    JSONObject o = (JSONObject) v;
+                    String src = o.getString("src");
+                    if(StrUtil.isNotEmpty(src)){
+                        deleteFileList.add(src);
+                    }
+                });
+            }
+
+            /* v4.12版本之前是这种方式
+            "media": {
+                "image": [
                 {
-                    fYunFileService.deleteFile(bucket,userDataPath + "hot"+sid+".mp4");
+                    "src": "FfRdi413774.jpg"
                 }
+		    ]
+            },
+            "type": "image"
+             */
+            if("image".equals(type) || "audio".equals(type) || "video".equals(type)){
+                //删除图片、视频
+                JSONObject media = jsonObject.getJSONObject("media");
+                JSONArray jsonArray = media.getJSONArray(type);
+                jsonArray.stream().forEach(v->{
+                    JSONObject o = (JSONObject) v;
+                    String src = o.getString("src");
+                    if(StrUtil.isNotEmpty(src)){
+                        deleteFileList.add(src);
+                    }
+                });
             }
         }
 
-        //从redis中移除热点数据
-        redisUtil.hdel(key, deleteSidList.toArray());
+        if(CollUtil.isEmpty(deleteFileList)){
+            return;
+        }
+        sceneUploadService.delete(
+                DeleteFileParamVO.builder()
+                        .num(num)
+                        .fileNames(deleteFileList)
+                        .bizType("tag-media").build());
     }
 
     @Override
@@ -1145,7 +1208,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         //删除本地文件
         FileUtil.del(meshLocalPath);
         FileUtil.del(zipFilePath);
-        String url = "downloads/extras/" + zipName + "?t=" + Calendar.getInstance().getTimeInMillis();
+        String url = "downloads/extras/" + zipName;
         return url;
     }
 
@@ -1201,7 +1264,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         ZipUtil.zip(meshPath, zipPath);
         //上传压缩包
         fYunFileService.uploadFile(bucket, zipPath, "downloads/extras/" + zipName);
-        String url = "downloads/extras/" + zipName + "?t=" + Calendar.getInstance().getTimeInMillis();
+        String url = "downloads/extras/" + zipName;
         FileUtil.del(zipPath);
         return url;
     }

+ 27 - 0
src/main/java/com/fdkankan/scene/service/impl/SceneServiceImpl.java

@@ -5,6 +5,7 @@ import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.lang.UUID;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.fdkankan.common.constant.CommonOperStatus;
 import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
@@ -17,6 +18,10 @@ import com.fdkankan.rabbitmq.util.RabbitMqProducer;
 import com.fdkankan.redis.constant.RedisKey;
 import com.fdkankan.redis.util.RedisUtil;
 import com.fdkankan.scene.bean.BodySegmentStatusBean;
+import com.fdkankan.scene.entity.ScenePlus;
+import com.fdkankan.scene.entity.ScenePlusExt;
+import com.fdkankan.scene.service.IScenePlusExtService;
+import com.fdkankan.scene.service.IScenePlusService;
 import com.fdkankan.scene.service.ISceneService;
 import com.fdkankan.scene.util.OssBodySegmentUtil;
 import com.fdkankan.web.response.ResultData;
@@ -59,6 +64,10 @@ public class SceneServiceImpl implements ISceneService {
     private FYunFileServiceInterface fYunFileService;
     @Autowired
     public FYunFileConfig fYunFileConfig;
+    @Autowired
+    public IScenePlusService scenePlusService;
+    @Autowired
+    public IScenePlusExtService scenePlusExtService;
 
     @Override
     public ResultData uploadBodySegment(MultipartFile file, Integer rotate) throws Exception {
@@ -157,6 +166,24 @@ public class SceneServiceImpl implements ISceneService {
     }
 
     @Override
+    public void saveSceneOientation(Map<String, Object> map) {
+        String num = (String) map.get("num");
+        String orientation = (String)map.get("orientation");
+        Integer status = (Integer)map.get("status");
+        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
+        if(Objects.isNull(scenePlus)){
+            return;
+        }
+        ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
+        if(status == 0){
+            scenePlusExtService.update(new LambdaUpdateWrapper<ScenePlusExt>().eq(ScenePlusExt::getId, scenePlusExt.getId()).setSql("orientation = null"));
+        }else{
+            scenePlusExt.setOrientation(orientation);
+            scenePlusExtService.updateById(scenePlusExt);
+        }
+    }
+
+    @Override
     public ResultData getBodySegmentStatus(String uuid) {
 
         String progress = redisUtil.get(String.format(RedisKey.SCENE_BODY_SEGMENT, uuid));

+ 58 - 0
src/main/java/com/fdkankan/scene/service/impl/VisionServiceImpl.java

@@ -0,0 +1,58 @@
+package com.fdkankan.scene.service.impl;
+
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.model.constants.UploadFilePath;
+import com.fdkankan.scene.service.IVisionService;
+import com.google.common.collect.Lists;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+@Service
+@Slf4j
+public class VisionServiceImpl implements IVisionService {
+
+    @Resource
+    private FYunFileServiceInterface fYunFileService;
+
+    @Override
+    public List<Map<String, Object>> getPointLatAndLon(String num) {
+        List<Map<String, Object>> list = Lists.newArrayList();
+        String visionTxt = fYunFileService.getFileContent(String.format(UploadFilePath.IMG_VIEW_PATH, num) + "vision.txt");
+        JSONObject visionJson = JSON.parseObject(visionTxt);
+        if(!visionJson.containsKey("sweepLocations")){
+            return list;
+        }
+        JSONArray sweepLocations = visionJson.getJSONArray("sweepLocations");
+        for (int i = 0; i < sweepLocations.size(); ++i) {
+            JSONObject sweepItem = sweepLocations.getJSONObject(i);
+            String id = sweepItem.getString("id");
+            String uuid = sweepItem.getString("uuid");
+            JSONObject ggaLocation = sweepItem.getJSONObject("ggaLocation");
+            if (Objects.nonNull(ggaLocation)
+                    && StrUtil.isNotEmpty(ggaLocation.getString("lon"))
+                    && StrUtil.isNotEmpty(ggaLocation.getString("lat"))
+                    && StrUtil.isNotEmpty(ggaLocation.getString("alt"))) {
+                Map<String, Object> item = new HashMap<>();
+                item.put("lon", ggaLocation.getString("lon"));
+                item.put("lat", ggaLocation.getString("lat"));
+                item.put("alt", ggaLocation.getString("alt"));
+                item.put("id", id);
+                item.put("uuid", uuid);
+                list.add(item);
+            }
+        }
+
+        return list;
+    }
+}

+ 5 - 0
src/main/java/com/fdkankan/scene/vo/SceneEditControlsParamVO.java

@@ -127,6 +127,11 @@ public class SceneEditControlsParamVO implements Serializable {
      */
     private Integer showAllModel;
 
+    private Integer showSurveilScope;
+
+    private Integer showTexture;
+
+    private Integer showPanos;
 
 
 

+ 6 - 0
src/main/java/com/fdkankan/scene/vo/SceneEditControlsVO.java

@@ -117,5 +117,11 @@ public class SceneEditControlsVO implements Serializable {
      */
     private Integer showAllModel;
 
+    private Integer showSurveilScope;
+
+    private Integer showTexture;
+
+    private Integer showPanos;
+
 
 }

+ 2 - 0
src/main/java/com/fdkankan/scene/vo/SceneEditInfoParamVO.java

@@ -84,5 +84,7 @@ public class SceneEditInfoParamVO extends BaseSceneParamVO{
      */
     private JSONObject started;
 
+    private Integer floorLogoType;
+
 
 }

+ 5 - 0
src/main/java/com/fdkankan/scene/vo/SceneInfoVO.java

@@ -262,5 +262,10 @@ public class SceneInfoVO {
     //动态面板
     private int dynamicPanel;
 
+    private Integer payStatus;
+
+    private Integer floorLogoType;
+
+    private String orientation;
 
 }

+ 5 - 0
src/main/resources/mapper/scene/SceneProEditMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.scene.mapper.ISceneProEditMapper">
+
+</mapper>