瀏覽代碼

Merge branch 'feature-v4.3.0-20220825' into release

# Conflicts:
#	4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneProServiceImpl.java
dengsixing 2 年之前
父節點
當前提交
0391ccdab3
共有 38 個文件被更改,包括 1338 次插入207 次删除
  1. 7 0
      4dkankan-center-scene/pom.xml
  2. 1 1
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/SceneApplication.java
  3. 16 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/bean/SceneJsonBean.java
  4. 33 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/config/MvpConfig.java
  5. 21 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/controller/DownloadTourVideoController.java
  6. 113 5
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/controller/SceneEditController.java
  7. 21 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/controller/SurveillanceController.java
  8. 87 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/entity/DownloadTourVideo.java
  9. 18 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/entity/SceneEditInfoExt.java
  10. 84 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/entity/Surveillance.java
  11. 2 2
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/generate/AutoGenerate.java
  12. 66 131
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/listener/RabbitMqListener.java
  13. 18 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/mapper/IDownloadTourVideoMapper.java
  14. 18 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/mapper/ISurveillanceMapper.java
  15. 29 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/IDownloadTourVideoService.java
  16. 4 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/ISceneEditInfoService.java
  17. 1 2
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/IScenePlusService.java
  18. 5 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/ISceneUploadService.java
  19. 29 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/ISurveillanceService.java
  20. 147 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/DownloadTourVideoServiceImpl.java
  21. 210 31
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneEditInfoServiceImpl.java
  22. 10 34
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneEditServiceImpl.java
  23. 2 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/ScenePlusServiceImpl.java
  24. 3 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneProServiceImpl.java
  25. 11 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneServiceImpl.java
  26. 62 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneUploadServiceImpl.java
  27. 108 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SurveillanceServiceImpl.java
  28. 22 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/BaseIdParamVO.java
  29. 2 1
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/BaseSceneParamVO.java
  30. 21 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/BaseSidParamVO.java
  31. 21 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/DownloadTourVideoVO.java
  32. 5 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/SceneAuthVO.java
  33. 13 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/SceneInfoVO.java
  34. 45 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/SurveillanceParamVO.java
  35. 49 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/SurveillanceVO.java
  36. 24 0
      4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/UpdateSurveillanceParamVO.java
  37. 5 0
      4dkankan-center-scene/src/main/resources/mapper/scene/DownloadTourVideoMapper.xml
  38. 5 0
      4dkankan-center-scene/src/main/resources/mapper/scene/SurveillanceMapper.xml

+ 7 - 0
4dkankan-center-scene/pom.xml

@@ -45,6 +45,13 @@
             <artifactId>4dkankan-utils-rabbitmq</artifactId>
             <version>2.0.0-SNAPSHOT</version>
         </dependency>
+
+<!--        <dependency>-->
+<!--            <groupId>com.fdkankan</groupId>-->
+<!--            <artifactId>4dkankan-mvp</artifactId>-->
+<!--            <version>1.0.0-SNAPSHOT</version>-->
+<!--        </dependency>-->
+
         <dependency>
             <groupId>com.fdkankan</groupId>
             <artifactId>4dkankan-utils-redis</artifactId>

+ 1 - 1
4dkankan-center-scene/src/main/java/com/fdkankan/scene/SceneApplication.java

@@ -5,7 +5,6 @@ import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
-import org.springframework.cloud.context.config.annotation.RefreshScope;
 import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.scheduling.annotation.EnableScheduling;
@@ -20,6 +19,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
 @MapperScan("com.fdkankan.**.mapper")
 @ForestScan(basePackages = "com.fdkankan.scene.httpclient")
 public class SceneApplication {
+
     public static void main(String[] args) {
         SpringApplication.run(SceneApplication.class, args);
     }

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

@@ -189,5 +189,21 @@ public class SceneJsonBean {
      */
     private String waterMark;
 
+    /**
+     * 是否有滤镜(0-否,1-是)
+     */
+    private Integer filters;
+
+    /**
+     * 风格滤镜数据
+     */
+    private String roiFilter;
+
+    /**
+     * 是否有监控摄像头数据
+     */
+    private Integer surveillances;
+
+
 
 }

+ 33 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/config/MvpConfig.java

@@ -0,0 +1,33 @@
+//package com.fdkankan.scene.config;
+//
+//import com.fdkankan.mvp.factory.InitFactory;
+//import javax.annotation.PostConstruct;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+//import org.springframework.context.annotation.Configuration;
+//
+///**
+// * <p>
+// * TODO
+// * </p>
+// *
+// * @author dengsixing
+// * @since 2022/9/8
+// **/
+//@Configuration
+//public class MvpConfig {
+//
+//    @Value("${sip.scheme:http}")
+//    private String scheme;
+//    @Value("${sip.ip:127.0.0.1}")
+//    private String ip;
+//    @Value("${sip.port:18080}")
+//    private String port;
+//
+//    @ConditionalOnProperty(name = "sip.init",havingValue = "true")
+//    @PostConstruct
+//    public void initSip(){
+//        InitFactory.init(scheme, ip, port);
+//    }
+//
+//}

+ 21 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/controller/DownloadTourVideoController.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 2022-10-12
+ */
+@RestController
+@RequestMapping("/scene/downloadTourVideo")
+public class DownloadTourVideoController {
+
+}
+

+ 113 - 5
4dkankan-center-scene/src/main/java/com/fdkankan/scene/controller/SceneEditController.java

@@ -4,19 +4,57 @@ import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.constant.SceneInfoReqType;
 import com.fdkankan.common.controller.BaseController;
 import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.common.response.ResultData;
 import com.fdkankan.scene.annotation.CheckCooperationPermit;
+import com.fdkankan.scene.service.IDownloadTourVideoService;
 import com.fdkankan.scene.service.ISceneEditInfoService;
 import com.fdkankan.scene.service.ISceneEditService;
+import com.fdkankan.scene.service.IScenePlusService;
 import com.fdkankan.scene.service.ISceneProService;
 import com.fdkankan.scene.service.ISceneUploadService;
-import com.fdkankan.scene.vo.*;
-import com.fdkankan.common.response.ResultData;
+import com.fdkankan.scene.service.ISurveillanceService;
+import com.fdkankan.scene.vo.BaseSidParamVO;
+import com.fdkankan.scene.vo.SurveillanceParamVO;
+import com.fdkankan.scene.vo.BallScreenVideoParamVO;
+import com.fdkankan.scene.vo.BaseDataParamVO;
+import com.fdkankan.scene.vo.BaseFileParamVO;
+import com.fdkankan.scene.vo.BaseIdParamVO;
+import com.fdkankan.scene.vo.BaseSceneParamVO;
+import com.fdkankan.scene.vo.DeleteFileParamVO;
+import com.fdkankan.scene.vo.DeleteHotIconParamVO;
+import com.fdkankan.scene.vo.DeleteHotParamVO;
+import com.fdkankan.scene.vo.DeleteLinkPanParamVO;
+import com.fdkankan.scene.vo.DeleteLinkSceneStylesParamVO;
+import com.fdkankan.scene.vo.DeleteMosaicParamVO;
+import com.fdkankan.scene.vo.DeleteSidParamVO;
+import com.fdkankan.scene.vo.DownloadVO;
+import com.fdkankan.scene.vo.FileNameAndDataParamVO;
+import com.fdkankan.scene.vo.FileParamVO;
+import com.fdkankan.scene.vo.LocalesParamVO;
+import com.fdkankan.scene.vo.RenameCadParamVO;
+import com.fdkankan.scene.vo.SaveLinkPanParamVO;
+import com.fdkankan.scene.vo.SaveTagsParamVO;
+import com.fdkankan.scene.vo.SaveTagsVisibleParamVO;
+import com.fdkankan.scene.vo.SaveUploadParamVO;
+import com.fdkankan.scene.vo.SceneAuthVO;
+import com.fdkankan.scene.vo.SceneEditInfoParamVO;
+import com.fdkankan.scene.vo.SceneEditInfoVO;
+import com.fdkankan.scene.vo.SceneEditParamVO;
+import com.fdkankan.scene.vo.SceneInfoParamVO;
+import com.fdkankan.scene.vo.SceneInfoVO;
+import com.fdkankan.scene.vo.UploadContentParamVO;
 import java.io.IOException;
 import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
 /**
@@ -27,6 +65,9 @@ import org.springframework.web.multipart.MultipartFile;
 @RequestMapping("/service/scene/edit")
 public class SceneEditController extends BaseController {
 
+    @Value("${spring.profiles.active}")
+    private String env;
+
     @Autowired
     private ISceneProService sceneProService;
     @Autowired
@@ -35,8 +76,13 @@ public class SceneEditController extends BaseController {
     private ISceneUploadService sceneUploadService;
     @Autowired
     private ISceneEditService sceneEditService;
-    @Value("${spring.profiles.active}")
-    private String env;
+    @Autowired
+    private ISurveillanceService surveillanceService;
+    @Autowired
+    private IScenePlusService scenePlusService;
+    @Autowired
+    private IDownloadTourVideoService downloadTourVideoService;
+
 
     /**
      * <p>
@@ -983,6 +1029,17 @@ public class SceneEditController extends BaseController {
         return sceneEditService.saveTour(param);
     }
 
+    @PostMapping(value = "/tour/video/upload")
+    public ResultData uploadTourVideo(@RequestParam("num") String num, @RequestParam("file") MultipartFile file) throws Exception {
+        downloadTourVideoService.uploadTourVideo(num, file);
+        return null;
+    }
+
+    @PostMapping(value = "/tour/video/download")
+    public ResultData downloadTourVideo(@RequestParam("num") String num) throws Exception {
+        return downloadTourVideoService.downloadTourVideo(num);
+    }
+
     /**
      * 删除导览
      * @param param
@@ -1055,6 +1112,57 @@ public class SceneEditController extends BaseController {
         return sceneEditInfoService.deleteWaterMark(param);
     }
 
+    /**
+     * 删除水印
+     * @param param
+     * @return
+     * @throws Exception
+     */
+    @CheckCooperationPermit
+    @PostMapping(value = "/filter/save")
+    public ResultData saveFilter(@RequestBody @Validated BaseDataParamVO param) throws Exception{
+        return sceneEditInfoService.saveFilter(param);
+    }
+
+    /**
+     * 删除水印
+     * @param param
+     * @return
+     * @throws Exception
+     */
+    @CheckCooperationPermit
+    @PostMapping(value = "/filter/list")
+    public ResultData listFilter(@RequestBody @Validated BaseSceneParamVO param) throws Exception{
+        return sceneEditInfoService.listFilter(param);
+    }
+
+    /**
+     * <p>
+            添加监控
+     * </p>
+     * @author dengsixing
+     * @date 2022/9/20
+     * @param param
+     * @return com.fdkankan.common.response.ResultData
+     **/
+    @CheckCooperationPermit
+    @PostMapping("/surveillance/save")
+    public ResultData saveSurveillance(@RequestBody @Validated SurveillanceParamVO param){
+        return surveillanceService.saveSurveillance(param);
+    }
+
+    @PostMapping("/surveillance/delete")
+    public ResultData deleteSurveillance(@RequestBody @Validated BaseSidParamVO param){
+        return surveillanceService.deleteSurveillance(param);
+    }
+
+    @PostMapping("/surveillance/list")
+    public ResultData listSurveillance(@RequestBody @Validated BaseSceneParamVO param){
+        return ResultData.ok(surveillanceService.listSurveillance(param.getNum()));
+    }
+
+
+
 
 
 

+ 21 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/controller/SurveillanceController.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 2022-09-16
+ */
+@RestController
+@RequestMapping("/scene/surveillance")
+public class SurveillanceController {
+
+}
+

+ 87 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/entity/DownloadTourVideo.java

@@ -0,0 +1,87 @@
+package com.fdkankan.scene.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 导览视频转换记录表
+ * </p>
+ *
+ * @author 
+ * @since 2022-10-12
+ */
+@Getter
+@Setter
+@TableName("t_download_tour_video")
+public class DownloadTourVideo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 场景码
+     */
+    @TableField("num")
+    private String num;
+
+    /**
+     * 视频转换状态(0-等待中,1-成功,2-失败)
+     */
+    @TableField("state")
+    private Integer state;
+
+    /**
+     * 转换失败原因
+     */
+    @TableField("reason")
+    private String reason;
+
+    /**
+     * 文件名称
+     */
+    @TableField("file_name")
+    private String fileName;
+
+    /**
+     * 本地临时文件地址
+     */
+    @TableField("local_path")
+    private String localPath;
+
+    /**
+     * 导览视频目录地址
+     */
+    @TableField("download_path")
+    private String downloadPath;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 修改时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * A-有效,I-无效
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A", delval = "I")
+    private String recStatus;
+
+
+}

+ 18 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/entity/SceneEditInfoExt.java

@@ -74,6 +74,24 @@ public class SceneEditInfoExt {
     private Integer links;
 
     /**
+     * 是否有滤镜(0-否,1-是)
+     */
+    @TableField("filters")
+    private Integer filters;
+
+    /**
+     * 风格滤镜数据
+     */
+    @TableField("roi_filter")
+    private String roiFilter;
+
+    /**
+     * 是否有监控摄像头(0-否,1-是)
+     */
+    @TableField("surveillances")
+    private Integer surveillances;
+
+    /**
      * 创建时间
      */
     @TableField("create_time")

+ 84 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/entity/Surveillance.java

@@ -0,0 +1,84 @@
+package com.fdkankan.scene.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 监控推拉流信息
+ * </p>
+ *
+ * @author 
+ * @since 2022-09-16
+ */
+@Getter
+@Setter
+@TableName("t_surveillance")
+public class Surveillance implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 场景码
+     */
+    @TableField("num")
+    private String num;
+
+    /**
+     * 监控名称
+     */
+    @TableField("name")
+    private String name;
+
+    /**
+     * 监控唯一标识
+     */
+    @TableField("sid")
+    private String sid;
+
+    /**
+     * panoId
+     */
+    @TableField("pano_id")
+    private String panoId;
+
+    /**
+     * 摄像头设置信息
+     */
+    @TableField("data")
+    private String data;
+
+    /**
+     * 播放地址
+     */
+    @TableField("play_url")
+    private String playUrl;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    @TableField("rec_status")
+    @TableLogic(value = "A", delval = "I")
+    private String recStatus;
+
+
+}

+ 2 - 2
4dkankan-center-scene/src/main/java/com/fdkankan/scene/generate/AutoGenerate.java

@@ -19,7 +19,7 @@ public class AutoGenerate {
         String path =System.getProperty("user.dir") + "\\4dkankan-center-scene";
 
         generate(path,"scene", getTables(new String[]{
-                "t_scene_repair_log","t_scene_pro_v3","t_scene_pro_edit_v3"
+                "t_download_tour_video"
         }));
 
 //        generate(path,"goods", getTables(new String[]{
@@ -79,7 +79,7 @@ public class AutoGenerate {
 
                             .entityBuilder()
                             .enableLombok()
-                            .logicDeleteColumnName("tb_status")
+                            .logicDeleteColumnName("rec_status")
                             .enableTableFieldAnnotation()
 //                            .superClass(BaseEntity.class)
 

+ 66 - 131
4dkankan-center-scene/src/main/java/com/fdkankan/scene/listener/RabbitMqListener.java

@@ -1,131 +1,66 @@
-//package com.fdkankan.scene.listener;
-//
-//import com.alibaba.fastjson.JSONObject;
-//import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
-//import com.fdkankan.rabbitmq.bean.BuildSceneFailDTMqMessage;
-//import com.fdkankan.rabbitmq.bean.BuildSceneResultMqMessage;
-//import com.fdkankan.scene.service.IBuildSceneDTService;
-//import com.fdkankan.scene.service.IBuildScenePostService;
-//import com.fdkankan.scene.service.IBuildScenePreService;
-//import com.fdkankan.scene.service.impl.BuildSceneDTServiceImpl;
-//import com.rabbitmq.client.Channel;
-//import java.nio.charset.StandardCharsets;
-//import lombok.extern.slf4j.Slf4j;
-//import org.springframework.amqp.core.Message;
-//import org.springframework.amqp.rabbit.annotation.Queue;
-//import org.springframework.amqp.rabbit.annotation.RabbitListener;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.beans.factory.annotation.Value;
-//import org.springframework.stereotype.Component;
-//
-///**
-// * <p>
-// * TODO
-// * </p>
-// *
-// * @author dengsixing
-// * @since 2022/4/19
-// **/
-//@Slf4j
-//@Component
-//public class RabbitMqListener {
-//    @Value("${queue.modeling.modeling-pre}")
-//    private String queueModelingPre;
-//    @Value("${queue.modeling.modeling-post}")
-//    private String queueModelingPost;
-//    @Value("${queue.modeling.modeling-dt}")
-//    private String queueModelingDt;
-//
-//    @Autowired
-//    IBuildScenePreService buildScenePreService;
-//    @Autowired
-//    IBuildScenePostService buildScenePostService;
-//    @Autowired
-//    IBuildSceneDTService buildSceneDTService;
-//
-//
-//
-//    /**
-//     * 开启了手动确认模式,如果没有手动确认,消费者不会重试,当服务重启时会再次消费,因为rabbitmq认为你还没有处理完你的业务
-//     * queuesToDeclare = @Queue("${queue.modeling.modeling-test}"),  如果队列不不存在会自动创建队列
-//     * concurrency = "3"    设置消费线程数,每个线程每次只拉取一条消息消费
-//     */
-////    @RabbitListener(
-////        queuesToDeclare = @Queue("${queue.modeling.modeling-test}"),
-////        concurrency = "1"
-////    )
-////    public void receiveMessageDsx(Channel channel, Message message) throws Exception {
-////        channel.queueDeclare();
-////        String msg = new String(message.getBody(), StandardCharsets.UTF_8);
-////        log.info("开始消费消息-" + msg + "-" + Thread.currentThread().getId());
-////        Thread.sleep(5000L);
-////        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
-////        log.info("结束消息-" + Thread.currentThread().getId());
-////    }
-//
-//
-//    /**
-//     * 场景计算前置资源准备处理
-//     * @param channel
-//     * @param message
-//     * @throws Exception
-//     */
-//    @RabbitListener(
-//        queuesToDeclare = @Queue("${queue.modeling.modeling-pre}"),
-//        concurrency = "${maxThread.modeling.modeling-pre}"
-//    )
-//    public void buildScenePreHandler(Channel channel, Message message) throws Exception {
-//        Object correlation = message.getMessageProperties().getHeader("spring_returned_message_correlation");
-//        String correlationId = (String) correlation;
-//        String msg = new String(message.getBody(), StandardCharsets.UTF_8);
-//        log.info("场景计算资源准备开始,队列名:{},id:{},消息体:{}", queueModelingPre, correlationId, msg);
-//        BuildSceneCallMessage buildSceneMessage = JSONObject.parseObject(msg, BuildSceneCallMessage.class);
-//        Thread.sleep(2000L);
-//        buildScenePreService.buildScenePre(buildSceneMessage);
-//        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
-//    }
-//
-//    /**
-//     * 场景计算后置结果处理
-//     * @param channel
-//     * @param message
-//     * @throws Exception
-//     */
-//    @RabbitListener(
-//        queuesToDeclare = @Queue("${queue.modeling.modeling-post}"),
-//        concurrency = "${maxThread.modeling.modeling-post}"
-//    )
-//    public void buildScenePostHandler(Channel channel, Message message) throws Exception {
-//        Object correlation = message.getMessageProperties().getHeader("spring_returned_message_correlation");
-//        String correlationId = (String) correlation;
-//        String msg = new String(message.getBody(), StandardCharsets.UTF_8);
-//        log.info("场景计算结果处理开始,队列名:{},id:{},消息体:{}", queueModelingPost, correlationId, msg);
-//        BuildSceneResultMqMessage resultMessage = JSONObject.parseObject(msg, BuildSceneResultMqMessage.class);
-//        Thread.sleep(2000L);
-//        buildScenePostService.buildScenePost(resultMessage);
-//        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
-//    }
-//
-//    /**
-//     * 场景计算发送钉钉消息
-//     * @param channel
-//     * @param message
-//     * @throws Exception
-//     */
-//    @RabbitListener(
-//        queuesToDeclare = @Queue("${queue.modeling.modeling-dt}"),
-//        concurrency = "${maxThread.modeling.modeling-dt}"
-//    )
-//    public void buildSceneDTHandler(Channel channel, Message message) throws Exception {
-//        Object correlation = message.getMessageProperties().getHeader("spring_returned_message_correlation");
-//        String correlationId = (String) correlation;
-//        String msg = new String(message.getBody(), StandardCharsets.UTF_8);
-//        log.info("发送钉钉消息处理,队列名:{},id:{},消息体:{}", queueModelingDt, correlationId, msg);
-//        BuildSceneFailDTMqMessage dtMessage = JSONObject.parseObject(msg, BuildSceneFailDTMqMessage.class);
-//        buildSceneDTService.handFail(dtMessage.getReason(), dtMessage.getServerPath(),
-//            dtMessage.getNum(), dtMessage.getHostName(), BuildSceneDTServiceImpl.contentExt);
-//        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
-//    }
-//
-//
-//}
+package com.fdkankan.scene.listener;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
+import com.fdkankan.rabbitmq.bean.BuildSceneFailDTMqMessage;
+import com.fdkankan.rabbitmq.bean.BuildSceneResultMqMessage;
+import com.fdkankan.scene.entity.DownloadTourVideo;
+import com.fdkankan.scene.service.IBuildSceneDTService;
+import com.fdkankan.scene.service.IBuildScenePostService;
+import com.fdkankan.scene.service.IBuildScenePreService;
+import com.fdkankan.scene.service.IDownloadTourVideoService;
+import com.fdkankan.scene.service.impl.BuildSceneDTServiceImpl;
+import com.rabbitmq.client.Channel;
+import java.nio.charset.StandardCharsets;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.rabbit.annotation.Queue;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+/**
+ * <p>
+ * TODO
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/4/19
+ **/
+@Slf4j
+@Component
+public class RabbitMqListener {
+
+    @Value("${queue.scene.transfer-tour-video}")
+    private String downloadTourVideoQueue;
+
+    @Autowired
+    private IDownloadTourVideoService downloadTourVideoService;
+
+
+
+
+    /**
+     * 开启了手动确认模式,如果没有手动确认,消费者不会重试,当服务重启时会再次消费,因为rabbitmq认为你还没有处理完你的业务
+     * queuesToDeclare = @Queue("${queue.modeling.modeling-test}"),  如果队列不不存在会自动创建队列
+     * concurrency = "3"    设置消费线程数,每个线程每次只拉取一条消息消费
+     */
+    @RabbitListener(
+        queuesToDeclare = @Queue("${queue.scene.transfer-tour-video}")
+    )
+    public void transferTourVideo(Channel channel, Message message) throws Exception {
+        String correlation = (String)message.getMessageProperties().getHeader("spring_returned_message_correlation");
+        String msg = new String(message.getBody(), StandardCharsets.UTF_8);
+        log.info("开始消费消息,id:{},queue:{},content:{}", correlation, downloadTourVideoQueue, msg);
+        DownloadTourVideo downloadTourVideo = JSON.parseObject(msg, DownloadTourVideo.class);
+        downloadTourVideoService.transferTourVideo(downloadTourVideo);
+        channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
+        log.info("结束消费消息,id:{}", correlation);
+    }
+
+
+
+
+}

+ 18 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/mapper/IDownloadTourVideoMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.scene.mapper;
+
+import com.fdkankan.scene.entity.DownloadTourVideo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * 导览视频转换记录表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2022-10-12
+ */
+@Mapper
+public interface IDownloadTourVideoMapper extends BaseMapper<DownloadTourVideo> {
+
+}

+ 18 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/mapper/ISurveillanceMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.scene.mapper;
+
+import com.fdkankan.scene.entity.Surveillance;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * 监控推拉流信息 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2022-09-16
+ */
+@Mapper
+public interface ISurveillanceMapper extends BaseMapper<Surveillance> {
+
+}

+ 29 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/IDownloadTourVideoService.java

@@ -0,0 +1,29 @@
+package com.fdkankan.scene.service;
+
+import com.fdkankan.common.response.ResultData;
+import com.fdkankan.scene.entity.DownloadTourVideo;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * <p>
+ * 导览视频转换记录表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2022-10-12
+ */
+public interface IDownloadTourVideoService extends IService<DownloadTourVideo> {
+
+    DownloadTourVideo getWaitingByNum(String num);
+
+    void removeByNum(String num);
+
+    ResultData uploadTourVideo(String num, MultipartFile file) throws Exception;
+
+    void transferTourVideo(DownloadTourVideo downloadTourVideo);
+
+    ResultData downloadTourVideo(String num);
+
+}

+ 4 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/ISceneEditInfoService.java

@@ -92,6 +92,10 @@ public interface ISceneEditInfoService extends IService<SceneEditInfo> {
 
     ResultData deleteWaterMark(BaseFileParamVO param) throws Exception;
 
+    ResultData saveFilter(BaseDataParamVO param) throws Exception;
+
+    ResultData listFilter(BaseSceneParamVO param) throws Exception;
+
 
 
 }

+ 1 - 2
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/IScenePlusService.java

@@ -8,6 +8,7 @@ import java.util.List;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
  * <p>
@@ -30,6 +31,4 @@ public interface IScenePlusService extends IService<ScenePlus> {
     ResultData moveScene(List<String> numList, Long cameraId, Long userId);
 
 
-
-
 }

+ 5 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/ISceneUploadService.java

@@ -5,8 +5,10 @@ import com.fdkankan.common.response.ResultData;
 import com.fdkankan.scene.entity.SceneUpload;
 import com.fdkankan.scene.vo.DeleteFileParamVO;
 import com.fdkankan.scene.vo.UploadContentParamVO;
+import javax.servlet.http.HttpServletResponse;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.multipart.MultipartFile;
 
 /**
@@ -25,4 +27,7 @@ public interface ISceneUploadService extends IService<SceneUpload> {
     ResultData delete(DeleteFileParamVO param) throws Exception;
 
     String uploadContent(UploadContentParamVO param) throws Exception;
+
+    void formatMp4(@RequestParam("file") MultipartFile file, HttpServletResponse response) throws Exception;
+
 }

+ 29 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/ISurveillanceService.java

@@ -0,0 +1,29 @@
+package com.fdkankan.scene.service;
+
+import com.fdkankan.common.response.ResultData;
+import com.fdkankan.scene.vo.SurveillanceVO;
+import com.fdkankan.scene.entity.Surveillance;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.scene.vo.BaseSidParamVO;
+import com.fdkankan.scene.vo.SurveillanceParamVO;
+import java.util.List;
+
+/**
+ * <p>
+ * 监控推拉流信息 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2022-09-16
+ */
+public interface ISurveillanceService extends IService<Surveillance> {
+
+    ResultData saveSurveillance(SurveillanceParamVO param);
+
+    ResultData deleteSurveillance(BaseSidParamVO param);
+
+    List<SurveillanceVO> listSurveillance(String num);
+
+    Surveillance getBySid(String sid);
+
+}

+ 147 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/DownloadTourVideoServiceImpl.java

@@ -0,0 +1,147 @@
+package com.fdkankan.scene.service.impl;
+
+import cn.hutool.core.exceptions.ExceptionUtil;
+import cn.hutool.core.lang.UUID;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.common.constant.ConstantFilePath;
+import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.common.constant.UploadFilePath;
+import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.common.response.ResultData;
+import com.fdkankan.common.util.CreateObjUtil;
+import com.fdkankan.fyun.constant.StorageType;
+import com.fdkankan.fyun.oss.UploadToOssUtil;
+import com.fdkankan.rabbitmq.util.RabbitMqProducer;
+import com.fdkankan.scene.entity.DownloadTourVideo;
+import com.fdkankan.scene.mapper.IDownloadTourVideoMapper;
+import com.fdkankan.scene.service.IDownloadTourVideoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.scene.vo.DownloadTourVideoVO;
+import java.io.File;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import org.apache.http.HttpHeaders;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * <p>
+ * 导览视频转换记录表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2022-10-12
+ */
+@Service
+public class DownloadTourVideoServiceImpl extends ServiceImpl<IDownloadTourVideoMapper, DownloadTourVideo> implements IDownloadTourVideoService {
+
+    @Value("${queue.scene.transfer-tour-video}")
+    private String downloadTourVideoQueue;
+    @Autowired
+    private RabbitMqProducer rabbitMqProducer;
+    @Autowired
+    private UploadToOssUtil uploadToOssUtil;
+    @Value("${upload.type}")
+    private String type;
+
+    @Override
+    public DownloadTourVideo getWaitingByNum(String num) {
+        return this.getOne(
+            new LambdaQueryWrapper<DownloadTourVideo>().eq(DownloadTourVideo::getNum, num)
+                .eq(DownloadTourVideo::getState, 0));
+    }
+
+    @Override
+    public void removeByNum(String num) {
+        this.remove(new LambdaQueryWrapper<DownloadTourVideo>().eq(DownloadTourVideo::getNum, num));
+    }
+
+    @Override
+    public ResultData uploadTourVideo(String num, MultipartFile file) throws Exception {
+
+        //查询是否有任务正在执行,如果有,直接返回
+        DownloadTourVideo waiting = this.getWaitingByNum(num);
+        if(Objects.nonNull(waiting)){
+            throw new BusinessException(ErrorCode.FAILURE_CODE_5064);
+        }
+
+        String uuid = cn.hutool.core.lang.UUID.randomUUID().toString();
+        String fileName = file.getOriginalFilename();
+        String extName = cn.hutool.core.io.FileUtil.extName(fileName);
+        String tempFileName = uuid + "." + extName;
+        String srcPath = ConstantFilePath.SCENE_V4_PATH + num + "/tour/" + tempFileName;
+        File tempFile = new File(srcPath);
+        if(!tempFile.getParentFile().exists()){
+            tempFile.getParentFile().mkdirs();
+        }
+        file.transferTo(tempFile);
+
+        //先将旧纪录置为无效
+        this.removeByNum(num);
+
+        //写入新记录
+        DownloadTourVideo downloadTourVideo = new DownloadTourVideo();
+        downloadTourVideo.setNum(num);
+        downloadTourVideo.setFileName(fileName);
+        downloadTourVideo.setLocalPath(srcPath);
+        this.save(downloadTourVideo);
+
+        //发送mq
+        rabbitMqProducer.sendByWorkQueue(downloadTourVideoQueue, downloadTourVideo);
+
+        return ResultData.ok();
+    }
+
+    @Override
+    public void transferTourVideo(DownloadTourVideo downloadTourVideo) {
+
+        String destPath = null;
+        try {
+            String destFileName = UUID.randomUUID().toString() + ".mp4";
+            destPath = ConstantFilePath.SCENE_V4_PATH + downloadTourVideo.getNum() + "tour/" + destFileName;
+            File destFile = new File(destPath);
+            if(!destFile.getParentFile().exists()){
+                destFile.getParentFile().mkdir();
+            }
+            String srcPath = downloadTourVideo.getLocalPath();
+            CreateObjUtil.formatMp4(srcPath, destPath);
+            //上传到oss
+            String ossPath = String.format(UploadFilePath.DOWNLOADS_TOUR_VIDEO, downloadTourVideo.getNum()) + downloadTourVideo.getFileName();
+            Map<String, String> headers = new HashMap<>();
+            headers.put(HttpHeaders.CONTENT_TYPE, "application/octet-stream");
+            if(StorageType.OSS.code().equals(type)){
+                uploadToOssUtil.uploadOssWithHeaders(destPath, ossPath, headers);
+            }else{
+                uploadToOssUtil.uploadAwsWithHeaders(destPath, ossPath, headers);
+            }
+            downloadTourVideo.setDownloadPath(ossPath);
+            downloadTourVideo.setState(1);
+            this.updateById(downloadTourVideo);
+        }catch (Exception e) {
+            log.error("导览视频转换失败,num:" + downloadTourVideo.getNum() + "源路径:" + downloadTourVideo.getLocalPath(), e);
+            downloadTourVideo.setReason(ExceptionUtil.stacktraceToString(e, 3000));
+            downloadTourVideo.setState(2);
+            this.updateById(downloadTourVideo);
+        }
+
+    }
+
+    @Override
+    public ResultData downloadTourVideo(String num) {
+        DownloadTourVideoVO result = new DownloadTourVideoVO();
+        DownloadTourVideo downloadTourVideo = this.getOne(new LambdaQueryWrapper<DownloadTourVideo>().eq(DownloadTourVideo::getNum, num));
+        if(Objects.isNull(downloadTourVideo)){
+            result.setStatus(0);
+        }else{
+            result.setStatus(1);
+            result.setTransferStatus(downloadTourVideo.getState());
+            result.setPath(downloadTourVideo.getDownloadPath());
+        }
+        return ResultData.ok(result);
+    }
+}

+ 210 - 31
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneEditInfoServiceImpl.java

@@ -7,7 +7,6 @@ import cn.hutool.core.util.ZipUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.alibaba.fastjson.serializer.SerializerFeature;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@@ -35,12 +34,12 @@ import com.fdkankan.redis.util.RedisLockUtil;
 import com.fdkankan.redis.util.RedisUtil;
 import com.fdkankan.scene.api.dto.SceneInfoDTO;
 import com.fdkankan.scene.bean.BoxPhotoBean;
-import com.fdkankan.scene.bean.IconBean;
 import com.fdkankan.scene.bean.PointBean;
 import com.fdkankan.scene.bean.RequestSceneProV4;
 import com.fdkankan.scene.bean.SceneJsonBean;
 import com.fdkankan.scene.bean.SegmentBean;
 import com.fdkankan.scene.bean.StyleBean;
+import com.fdkankan.scene.vo.SurveillanceVO;
 import com.fdkankan.scene.bean.TagBean;
 import com.fdkankan.scene.bean.VertexBean;
 import com.fdkankan.scene.bean.WallBean;
@@ -68,6 +67,7 @@ import com.fdkankan.scene.service.IScenePlusService;
 import com.fdkankan.scene.service.ISceneProExtService;
 import com.fdkankan.scene.service.ISceneProService;
 import com.fdkankan.scene.service.ISceneUploadService;
+import com.fdkankan.scene.service.ISurveillanceService;
 import com.fdkankan.scene.vo.*;
 import com.google.common.collect.Lists;
 import com.google.errorprone.annotations.Var;
@@ -89,7 +89,6 @@ import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
 import javax.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.cloud.context.config.annotation.RefreshScope;
@@ -165,6 +164,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
     private FdkankanMiniClient fdkankanMiniClient;
     @Autowired
     private ISceneUploadService sceneUploadService;
+    @Autowired
+    private ISurveillanceService surveillanceService;
 
     @Transactional
     @Override
@@ -288,6 +289,12 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
         //发布场景关联相关数据
         this.publicLinkSceneData(num);
 
+        //发布滤镜数据
+        this.publicFilterData(num, sceneEditInfoExt.getFilters());
+
+        //发布摄像头数据
+        this.publicSurveillance(num, sceneEditInfoExt.getSurveillances());
+
         //本地写sceneJson文件
         String localSceneJsonPath = String.format(ConstantFilePath.SCENE_DATA_PATH_V4, num) + "scene.json";
         FileUtils.writeFile(localSceneJsonPath, JSON.toJSONString(sceneJson));
@@ -336,6 +343,16 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
         return ResultData.ok();
     }
 
+    private void publicSurveillance(String num, Integer surveillances) throws IOException {
+        String surveillanceJsonPath = String.format(UploadFilePath.USER_EDIT_PATH, num) + "surveillance.json";
+        if(surveillances == CommonStatus.NO.code().intValue()){
+            uploadToOssUtil.delete(surveillanceJsonPath);
+            return;
+        }
+        List<SurveillanceVO> surveillanceList = surveillanceService.listSurveillance(num);
+        uploadToOssUtil.upload(JSON.toJSONString(surveillanceList).getBytes(StandardCharsets.UTF_8), surveillanceJsonPath);
+    }
+
     public void publicLinkSceneData(String num) throws IOException {
 
         String imgEditPath = String.format(UploadFilePath.IMG_EDIT_PATH, num);
@@ -361,6 +378,20 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
 
     }
 
+    private void publicFilterData(String num, int filters) throws IOException {
+
+        String userEditPath = String.format(UploadFilePath.USER_EDIT_PATH, num);
+        if(filters == CommonStatus.NO.code()){
+            uploadToOssUtil.delete(userEditPath + "filter.json");
+            return;
+        }
+        String key = String.format(RedisKey.SCENE_filter_DATA, num);
+        List<String> list = redisUtil.lGet(key, 0, -1);
+        JSONArray jsonArray = new JSONArray();
+        list.stream().forEach(str->jsonArray.add(JSON.parseObject(str)));
+        uploadToOssUtil.upload(JSON.toJSONBytes(jsonArray), userEditPath + "filter.json");
+    }
+
     private void buildVideo(SceneEditInfo sceneEditInfo, String path, String num) throws Exception{
         if(CommonStatus.NO.equals(sceneEditInfo.getBuildVideoStatus())){
             return;
@@ -494,6 +525,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
         sceneInfoVO.setVideos(scenePlusExt.getVideos());
         sceneInfoVO.setMosaicList(this.getMosaicList(num));
 
+        this.SortBoxVideos(sceneInfoVO);
+
         // TODO: 2022/4/24 v3版本停机要切换---------------------------start
 //        this.setExtData(sceneInfoVO, scenePlus.getCameraId());
         this.setExtDataFromV3(sceneInfoVO, scenePlus.getCameraId());
@@ -502,6 +535,35 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
         return sceneInfoVO;
     }
 
+    private void SortBoxVideos(SceneInfoVO sceneInfoVO){
+        String boxVideos = sceneInfoVO.getBoxVideos();
+        if(StrUtil.isEmpty(boxVideos)){
+            return;
+        }
+        JSONArray boxVideoArr = JSON.parseArray(boxVideos);
+        if(CollUtil.isEmpty(boxVideoArr)){
+            return;
+        }
+        List<TagBean> tagBeanList = boxVideoArr.stream().map(o -> {
+                        JSONObject item = (JSONObject) o;
+                        return TagBean.builder()
+                            .createTime(item.getLong("createTime"))
+                            .tag(item).build();
+                    }).collect(Collectors.toList());
+
+        //按创建时间倒叙排序
+        tagBeanList.sort(Comparator.comparingLong(TagBean::getCreateTime).reversed());
+
+        //移除createTime字段
+        List<JSONObject> boxVideoList = tagBeanList.stream().map(tagBean -> {
+            JSONObject tag = tagBean.getTag();
+            tag.remove("createTime");
+            return tag;
+        }).collect(Collectors.toList());
+
+        sceneInfoVO.setBoxVideos(JSON.toJSONString(boxVideoList));
+    }
+
     /**
      * <p>
      getInfo接口返回字段扩展
@@ -1163,10 +1225,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
             fileJson = array.getJSONObject(i);
             fileName = fileJson.getString("file");
             //文件不存在抛出异常
-            if (!new File(target + File.separator + "results" + File.separator + fileName)
-                .exists()) {
-                throw new Exception(
-                    target + File.separator + "results" + File.separator + fileName + "文件不存在");
+            if (!new File(target + File.separator + "results" + File.separator + fileName).exists()) {
+                throw new Exception(target + File.separator + "results" + File.separator + fileName + "文件不存在");
             }
 
             //high文件夹
@@ -2392,10 +2452,24 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
             boxVideosJson = new JSONArray();
         }
 
+        if(boxVideosJson.size() > 0){
+            int i = 1;
+            long timeInMillis = Calendar.getInstance().getTimeInMillis();
+            for (Object o : boxVideosJson) {
+                JSONObject item = (JSONObject)o;
+                if(Objects.nonNull(item.getLong("createTime"))){
+                    continue;
+                }
+                item.put("createTime", timeInMillis - (i++));
+            }
+        }
+
+
         String result = null;
         //删除
         if(type == OperationType.DELETE.code()){
-            Set<String> deleteFile = new HashSet<>();
+            Set<String> deleteVidoeFile = new HashSet<>();
+            Set<String> deletePicFile = new HashSet<>();
             if(boxVideosJson.size() == 0)
                 return null;
             for(int i=0;i<boxVideosJson.size();++i){
@@ -2404,43 +2478,46 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
 
                     String poster = ele.getString("poster");
                     if(StrUtil.isNotEmpty(poster))
-                        deleteFile.add(poster);
+                        deletePicFile.add(poster);
                     String url = ele.getString("url");
                     if(StrUtil.isNotEmpty(url)){
-                        deleteFile.add(url);
-                        deleteFile.add(url.replace(".mp4",".flv"));
+                        deleteVidoeFile.add(url);
+                        deleteVidoeFile.add(url.replace(".mp4",".flv"));
                     }
 
                     boxVideosJson.remove(i);
                 }
             }
 
-            //删除资源文件
-            if(CollUtil.isNotEmpty(deleteFile))
+            //删除视频文件
+            if(CollUtil.isNotEmpty(deleteVidoeFile))
                 sceneUploadService.delete(
                     DeleteFileParamVO.builder().num(num)
                         .bizType(FileBizType.BOX_VIDEO.code())
-                        .fileNames(new ArrayList<>(deleteFile)).build());
+                        .fileNames(new ArrayList<>(deleteVidoeFile)).build());
+            //删除封面图文件
+            if(CollUtil.isNotEmpty(deleteVidoeFile))
+                sceneUploadService.delete(
+                    DeleteFileParamVO.builder().num(num)
+                        .bizType(FileBizType.BOX_POSTER.code())
+                        .fileNames(new ArrayList<>(deletePicFile)).build());
         }else{
 
-            // TODO: 2022/3/1 目前需求只保留一个,所以这里先注释掉,sid不同时,不追加
-            //更新
-//            boolean exist = false;
-//            for(int i=0;i<boxVideosJson.size();++i){
-//                JSONObject ele = boxVideosJson.getJSONObject(i);
-//                if(ele.getString("sid").equals(sid)){
-//                    boxVideosJson.set(i, boxVideo);
-//                    exist = true;
-//                }
-//            }
-//        //新增
-//        if(!exist){
-//            boxVideosJson.add(boxVideo);
-//        }
-
-            boxVideosJson.clear();
-            boxVideosJson.add(boxVideo);
+            boxVideo.put("createTime", Calendar.getInstance().getTimeInMillis());
 
+            //更新
+            boolean exist = false;
+            for(int i=0;i<boxVideosJson.size();++i){
+                JSONObject ele = boxVideosJson.getJSONObject(i);
+                if(ele.getString("sid").equals(sid)){
+                    boxVideosJson.set(i, boxVideo);
+                    exist = true;
+                }
+            }
+            //新增
+            if(!exist){
+                boxVideosJson.add(boxVideo);
+            }
         }
         if(boxVideosJson.size() != 0){
             result = boxVideosJson.toJSONString();
@@ -2635,4 +2712,106 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
 
         return ResultData.ok();
     }
+
+    @Override
+    public ResultData saveFilter(BaseDataParamVO param) throws Exception {
+
+        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(param.getNum());
+        if(Objects.isNull(scenePlus)){
+            throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
+        }
+
+        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 = CommonStatus.NO.code();
+        }else{
+            List<String> filterList = filterArr.stream().map(item->JSON.toJSONString(item)).collect(Collectors.toList());
+            redisUtil.lRightPushAll(key, filterList);
+        }
+
+        //写本地文件,作为备份
+        this.writeFilter(param.getNum());
+
+        //更新数据库
+        SceneEditInfoExt sceneEditInfoExt = sceneEditInfoExtService.getByScenePlusId(scenePlus.getId());
+        sceneEditInfoExt.setFilters(filters);
+        sceneEditInfoExtService.updateById(sceneEditInfoExt);
+
+        return ResultData.ok();
+
+    }
+
+    private void writeFilter(String num) throws Exception{
+
+        String filterPath = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num) + "filter.json";
+
+        String key = String.format(RedisKey.SCENE_filter_DATA, num);
+        List<String> filters = redisUtil.lGet(key, 0, -1);
+        if(CollUtil.isEmpty(filters)){
+            FileUtils.deleteFile(filterPath);
+            return;
+        }
+
+        String lockKey = String.format(RedisLockKey.LOCK_filter_JSON, num);
+        boolean lock = redisLockUtil.lock(lockKey, RedisKey.EXPIRE_TIME_1_MINUTE);
+        if(!lock){
+            return;
+        }
+        try{
+            FileUtils.writeFile(filterPath, JSON.toJSONString(filters));
+        }finally {
+            redisLockUtil.unlockLua(lockKey);
+        }
+    }
+
+    private void syncFiltersFromFileToRedis(String num) throws Exception{
+
+        String key = String.format(RedisKey.SCENE_filter_DATA, num);
+        boolean exist = redisUtil.hasKey(key);
+        if(exist){
+            return;
+        }
+        String lockKey = String.format(RedisLockKey.LOCK_FILTER_DATA_SYNC, num);
+        boolean lock = redisLockUtil.lock(lockKey, RedisKey.EXPIRE_TIME_1_MINUTE);
+        if(!lock){
+            throw new BusinessException(ErrorCode.SYSTEM_BUSY);
+        }
+        try{
+            exist = redisUtil.hasKey(key);
+            if(exist){
+                return;
+            }
+            String filePath = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num);
+            String filterData = FileUtils.readFile(filePath + "filter.json");
+            if(StrUtil.isEmpty(filterData)){
+                return;
+            }
+            JSONArray jsonArray = JSON.parseArray(filterData);
+            if(CollUtil.isEmpty(jsonArray)){
+                return;
+            }
+            redisUtil.lRightPushAll(key, jsonArray.stream().collect(Collectors.toList()));
+        }finally {
+            redisLockUtil.unlockLua(lockKey);
+        }
+    }
+
+    @Override
+    public ResultData listFilter(BaseSceneParamVO param) throws Exception {
+
+        //同步数据
+        this.syncFiltersFromFileToRedis(param.getNum());
+
+        //查询redis
+        String key = String.format(RedisKey.SCENE_filter_DATA, param.getNum());
+        List<String> list = redisUtil.lGet(key, 0, -1);
+        List<JSONObject> collect =
+            list.stream().map(str -> JSON.parseObject(str)).collect(Collectors.toList());
+        return ResultData.ok(collect);
+    }
+
 }

+ 10 - 34
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneEditServiceImpl.java

@@ -134,39 +134,9 @@ public class SceneEditServiceImpl implements ISceneEditService {
         //判断该场景是否属于增值权益
         boolean isVip = false;
         //获取该相机是否有权益
-        boolean isExpired  = false;
-//        ResultData<Camera> cameraResultData = platformGoodsClient.getCameraById(scenePlus.getCameraId());
-//        if(!cameraResultData.getSuccess()){
-//            throw new Exception(ServerCode.FEIGN_REQUEST_FAILD.message());
-//        }
-//        Camera camera = cameraResultData.getData();
-//        if(camera != null){
-//            ResultData<UserIncrement> incrementResultData = platformUserClient
-//                .getUserIncrementByCameraId(camera.getId());
-//            if(!incrementResultData.getSuccess()){
-//                throw new Exception(ServerCode.FEIGN_REQUEST_FAILD.message());
-//            }
-//            UserIncrement userIncrement = incrementResultData.getData();
-//            if(userIncrement != null){
-//                if( userIncrement.getIsExpired().intValue() == 0){
-//                    isVip = true;
-//                }
-//                if(userIncrement.getIsExpired().intValue() == 1){
-//                    isExpired  = true;
-//                }
-//            }else{
-//                Date date = DateUtil.parse("2021-09-09 00:00:00", DateExtUtil.dateStyle);
-//
-//                //非07批次的放开
-//                String pc = camera.getSnCode().substring(0,2);
-//                if(!pc.equals("07") ){
-//                    if(camera.getCreateTime()!=null && date.after(camera.getCreateTime())){
-//                        isVip = true;
-//                        isExpired  = false;
-//                    }
-//                }
-//            }
-//        }
+        boolean isExpired = false;
+        //本地资源是否失效
+        boolean sourceExpired = false;
         // TODO: 2022/4/25 v3v4共存过渡期结束需要删除,恢复上面注释内容 ------------------------------------------start
         url = fkankanMiniHost + URL_ISLOGIN + num;
         Result<Map<String, Object>> isLoginResult = fdkankanMiniClient
@@ -175,11 +145,17 @@ public class SceneEditServiceImpl implements ISceneEditService {
         Map<String, Object> data = isLoginResult.getData();
         isVip = (boolean)data.get("isIncrement");
         isExpired = (boolean)data.get("isExpired");
+        Object sourceExpiredObj = data.get("sourceExpired");
+        if(Objects.nonNull(sourceExpiredObj)){
+            sourceExpired = (boolean) sourceExpiredObj;
+        }
         Integer company = data.get("company") == null ? null : (int)data.get("company");
         // TODO: 2022/4/25 v3v4共存过渡期结束需要删除,恢复上面注释内容 ------------------------------------------end
 
         return SceneAuthVO.builder()
-            .isExpired(isExpired).isVip(isVip)
+            .isExpired(isExpired)
+            .isVip(isVip)
+            .sourceExpired(sourceExpired)
             .company(company)
             .exclude(data.get("exclude"))
             .include(data.get("include"))

+ 2 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/ScenePlusServiceImpl.java

@@ -24,6 +24,7 @@ import java.util.Objects;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
  * <p>
@@ -115,4 +116,5 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
         return ResultData.ok();
 
     }
+
 }

+ 3 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneProServiceImpl.java

@@ -3748,6 +3748,9 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
                 if(!data.getName().equals("mesh.obj")){
                     throw new BusinessException(ErrorCode.FAILURE_CODE_5060);
                 }
+                if(!FileUtils.checkFileSizeIsLimit(data.length(), 50, "M")){
+                    throw new BusinessException(ErrorCode.FAILURE_CODE_5020);
+                }
 
                 objFlag = true;
                 FileUtils.copyFile(dataPath + data.getName(), filePath + "mesh.obj", true);

+ 11 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneServiceImpl.java

@@ -109,6 +109,9 @@ public class SceneServiceImpl extends ServiceImpl<ISceneMapper, Scene> implement
     @Autowired
     private ISceneDataDownloadService sceneDataDownloadService;
 
+    @Autowired
+    private ISurveillanceService surveillanceService;
+
     @Value("${main.url}")
     private String mainUrl;
 
@@ -1435,6 +1438,14 @@ public class SceneServiceImpl extends ServiceImpl<ISceneMapper, Scene> implement
         sceneEditControls.setEditInfoId(sceneEditInfo.getId());
         sceneEditControlsService.save(sceneEditControls);
 
+        List<Surveillance> list = surveillanceService.list(new LambdaQueryWrapper<Surveillance>().eq(Surveillance::getNum, num));
+        if (!Objects.isNull(list)) {
+            list.stream().forEach(item -> {
+                item.setNum(newNum);
+                item.setId(null);
+                surveillanceService.save(item);
+            });
+        }
         // 生成scene.json
         SceneJsonBean sceneJson = new SceneJsonBean();
         BeanUtil.copyProperties(sceneEditInfoExt, sceneJson);

+ 62 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SceneUploadServiceImpl.java

@@ -1,10 +1,14 @@
 package com.fdkankan.scene.service.impl;
+import com.fdkankan.scene.service.IDownloadTourVideoService;
+import java.util.Date;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.io.IoUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.common.constant.ConstantFilePath;
 import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.constant.ServerCode;
 import com.fdkankan.common.constant.TbStatus;
@@ -14,8 +18,10 @@ import com.fdkankan.common.response.ResultData;
 import com.fdkankan.common.user.SSOLoginHelper;
 import com.fdkankan.common.user.SSOUser;
 import com.fdkankan.common.util.BASE64DecodedMultipartFile;
+import com.fdkankan.common.util.CreateObjUtil;
 import com.fdkankan.common.util.FileUtil;
 import com.fdkankan.fyun.oss.UploadToOssUtil;
+import com.fdkankan.scene.entity.DownloadTourVideo;
 import com.fdkankan.scene.entity.ScenePro;
 import com.fdkankan.scene.entity.SceneUpload;
 import com.fdkankan.scene.mapper.ISceneUploadMapper;
@@ -23,14 +29,24 @@ import com.fdkankan.scene.service.ISceneProService;
 import com.fdkankan.scene.service.ISceneUploadService;
 import com.fdkankan.scene.vo.DeleteFileParamVO;
 import com.fdkankan.scene.vo.UploadContentParamVO;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URLEncoder;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
+import java.util.Calendar;
 import java.util.HashSet;
+import java.util.Objects;
 import java.util.Set;
+import javax.servlet.http.HttpServletResponse;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpHeaders;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -219,4 +235,50 @@ public class SceneUploadServiceImpl extends ServiceImpl<ISceneUploadMapper, Scen
 
         return this.ossUrlPrefix + param.getOssPath();
     }
+
+    @Override
+    public void formatMp4(MultipartFile file, HttpServletResponse response) throws Exception {
+
+        String fileName = file.getOriginalFilename();
+        String suffix = fileName.substring(fileName.lastIndexOf("."));
+        File oldFile = File.createTempFile(UUID.randomUUID().toString() ,suffix);
+        file.transferTo(oldFile);
+
+        File destFile = File.createTempFile(UUID.randomUUID().toString() ,suffix);
+//        File file1 = new File(descFilePath);
+//        if(!file1.getParentFile().exists()){
+//            file1.mkdir();
+//        }
+        CreateObjUtil.formatMp4(oldFile.getPath(), destFile.getPath());
+//
+        if(!cn.hutool.core.io.FileUtil.exist(destFile.getPath())){
+            throw new BusinessException(ErrorCode.FAILURE_CODE_5038);
+        }
+        File outFile = new File(destFile.getPath());
+        //定义处理流
+        try(
+            FileInputStream inputStream = new FileInputStream(outFile);
+            OutputStream outputStream = response.getOutputStream()
+        ){
+            byte[] cache = new byte[1024];
+            response.setHeader(HttpHeaders.CONTENT_TYPE, "application/octet-stream");
+            response.setHeader(HttpHeaders.CONTENT_LENGTH, inputStream.available()+"");
+            response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode(file.getOriginalFilename(), "UTF-8"));
+            int flag;
+            while ((flag = inputStream.read(cache)) != -1) {
+                outputStream.write(cache, 0, flag);
+            }
+            outputStream.flush();
+        }finally {
+//            FileUtil.delFile(oldFile.getPath());
+//            FileUtil.delFile(destFile.getPath());
+        }
+    }
+
+    public static void main(String[] args) {
+        File file = new File("C:\\Users\\4dage\\Desktop\\screencap.mp4");
+        System.out.println(file.length());
+        File file2 = new File("C:\\Users\\4dage\\Desktop\\abc.mp4");
+        System.out.println(file2.length());
+    }
 }

+ 108 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/service/impl/SurveillanceServiceImpl.java

@@ -0,0 +1,108 @@
+package com.fdkankan.scene.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.common.constant.CommonStatus;
+import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.common.response.ResultData;
+import com.fdkankan.scene.vo.SurveillanceVO;
+import com.fdkankan.scene.entity.SceneEditInfoExt;
+import com.fdkankan.scene.entity.ScenePlus;
+import com.fdkankan.scene.entity.Surveillance;
+import com.fdkankan.scene.mapper.ISurveillanceMapper;
+import com.fdkankan.scene.service.ISceneEditInfoExtService;
+import com.fdkankan.scene.service.IScenePlusService;
+import com.fdkankan.scene.service.ISurveillanceService;
+import com.fdkankan.scene.vo.BaseSidParamVO;
+import com.fdkankan.scene.vo.SurveillanceParamVO;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 监控推拉流信息 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2022-09-16
+ */
+@Service
+public class SurveillanceServiceImpl extends ServiceImpl<ISurveillanceMapper, Surveillance> implements ISurveillanceService {
+
+    @Autowired
+    private IScenePlusService scenePlusService;
+    @Autowired
+    private ISceneEditInfoExtService sceneEditInfoExtService;
+
+    @Override
+    public ResultData saveSurveillance(SurveillanceParamVO param) {
+
+        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(param.getNum());
+        if(Objects.isNull(scenePlus)){
+            throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
+        }
+        SceneEditInfoExt sceneEditInfoExt = sceneEditInfoExtService.getByScenePlusId(scenePlus.getId());
+
+        Surveillance surveillance = this.getBySid(param.getSid());
+        if(Objects.isNull(surveillance)){
+            surveillance = new Surveillance();
+        }
+        surveillance.setSid(param.getSid());
+        surveillance.setPanoId(param.getPanoId());
+        surveillance.setNum(param.getNum());
+        surveillance.setName(param.getName());
+        surveillance.setData(param.getData().toJSONString());
+        surveillance.setPlayUrl(param.getPlayUrl());
+        this.saveOrUpdate(surveillance);
+
+        sceneEditInfoExt.setSurveillances(CommonStatus.YES.code().intValue());
+        sceneEditInfoExtService.updateById(sceneEditInfoExt);
+
+        return ResultData.ok();
+    }
+
+    @Override
+    public ResultData deleteSurveillance(BaseSidParamVO param) {
+        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(param.getNum());
+        if(Objects.isNull(scenePlus)){
+            throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
+        }
+        SceneEditInfoExt sceneEditInfoExt = sceneEditInfoExtService.getByScenePlusId(scenePlus.getId());
+
+        this.remove(new LambdaQueryWrapper<Surveillance>().eq(Surveillance::getSid, param.getSid()));
+
+        long count = this.count(new LambdaQueryWrapper<Surveillance>().eq(Surveillance::getNum, param.getNum()));
+        if(count < 1){
+            sceneEditInfoExt.setSurveillances(CommonStatus.NO.code().intValue());
+        }
+        sceneEditInfoExtService.updateById(sceneEditInfoExt);
+        return ResultData.ok();
+    }
+
+    @Override
+    public List<SurveillanceVO> listSurveillance(String num) {
+        List<Surveillance> list = this.list(new LambdaQueryWrapper<Surveillance>().eq(Surveillance::getNum, num).orderByDesc(Surveillance::getId));
+        if(Objects.isNull(list)){
+            return null;
+        }
+        List<SurveillanceVO> voList = list.stream().map(item -> {
+            SurveillanceVO vo = BeanUtil.copyProperties(item, SurveillanceVO.class, "data");
+            vo.setData(JSON.parseObject(item.getData()));
+            return vo;
+        }).collect(Collectors.toList());
+        return voList;
+    }
+
+    @Override
+    public Surveillance getBySid(String sid) {
+        return this.getOne(new LambdaQueryWrapper<Surveillance>().eq(Surveillance::getSid, sid));
+    }
+
+}

+ 22 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/BaseIdParamVO.java

@@ -0,0 +1,22 @@
+package com.fdkankan.scene.vo;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import lombok.Data;
+
+/**
+ * <p>
+ * 通用data类型参数类
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/2/10
+ **/
+@Data
+public class BaseIdParamVO extends BaseSceneParamVO{
+
+    @NotNull(message = "id不能为空")
+    private Long id;
+
+}

+ 2 - 1
4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/BaseSceneParamVO.java

@@ -1,5 +1,6 @@
 package com.fdkankan.scene.vo;
 
+import java.io.Serializable;
 import javax.validation.constraints.NotBlank;
 import lombok.Data;
 
@@ -12,7 +13,7 @@ import lombok.Data;
  * @since 2022/2/22
  **/
 @Data
-public class BaseSceneParamVO {
+public class BaseSceneParamVO implements Serializable {
 
     /**
      * 场景码

+ 21 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/BaseSidParamVO.java

@@ -0,0 +1,21 @@
+package com.fdkankan.scene.vo;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import lombok.Data;
+
+/**
+ * <p>
+ * 通用data类型参数类
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/2/10
+ **/
+@Data
+public class BaseSidParamVO extends BaseSceneParamVO{
+
+    @NotBlank(message = "sid不能为空")
+    private String sid;
+
+}

+ 21 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/DownloadTourVideoVO.java

@@ -0,0 +1,21 @@
+package com.fdkankan.scene.vo;
+
+import lombok.Data;
+
+/**
+ * <p>
+ * TODO
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/10/13
+ **/
+@Data
+public class DownloadTourVideoVO {
+
+    private Integer status;
+    private Integer transferStatus;
+    private String path;
+
+
+}

+ 5 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/SceneAuthVO.java

@@ -35,6 +35,11 @@ public class SceneAuthVO {
      */
     private boolean isVip;
 
+    /**
+     * 本地资源是否失效
+     */
+    private boolean sourceExpired;
+
     private Integer company;
 
     private Object exclude;

+ 13 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/SceneInfoVO.java

@@ -204,7 +204,20 @@ public class SceneInfoVO {
      */
     private Integer links;
 
+    /**
+     * 是否有滤镜(0-否,1-是)
+     */
+    private Integer filters;
 
+    /**
+     * 风格滤镜数据
+     */
+    private String roiFilter;
+
+    /**
+     * 是否有监控摄像头数据
+     */
+    private Integer surveillances;
 
 
 }

+ 45 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/SurveillanceParamVO.java

@@ -0,0 +1,45 @@
+package com.fdkankan.scene.vo;
+
+import com.alibaba.fastjson.JSONObject;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+import lombok.Data;
+
+/**
+ * <p>
+ * TODO
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/9/16
+ **/
+@Data
+public class SurveillanceParamVO {
+
+    @NotBlank(message = "场景码不能为空")
+    private String num;
+
+    @NotEmpty(message = "数据不能为空")
+    private JSONObject data;
+
+    @NotBlank(message = "name不能为空")
+    private String name;
+
+    @NotBlank(message = "playUrl不能为空")
+    private String playUrl;
+
+    @NotBlank(message = "panoId不能为空")
+    private String panoId;
+
+    @NotBlank(message = "sid不能为空")
+    private String sid;
+
+    private String type;
+
+    private String deviceId;
+
+    private String channelId;
+
+    private String rtspUrl;
+
+}

+ 49 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/SurveillanceVO.java

@@ -0,0 +1,49 @@
+package com.fdkankan.scene.vo;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 监控推拉流信息
+ * </p>
+ *
+ * @author 
+ * @since 2022-09-16
+ */
+@Data
+public class SurveillanceVO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    /**
+     * 监控名称
+     */
+    private String name;
+
+    /**
+     * 摄像头设置信息
+     */
+    private JSONObject data;
+
+    /**
+     * 播放地址
+     */
+    private String playUrl;
+
+    private String sid;
+
+    private String panoId;
+
+}

+ 24 - 0
4dkankan-center-scene/src/main/java/com/fdkankan/scene/vo/UpdateSurveillanceParamVO.java

@@ -0,0 +1,24 @@
+package com.fdkankan.scene.vo;
+
+import com.alibaba.fastjson.JSONObject;
+import javax.validation.constraints.NotBlank;
+import lombok.Data;
+
+/**
+ * <p>
+ * 通用data类型参数类
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/2/10
+ **/
+@Data
+public class UpdateSurveillanceParamVO extends BaseIdParamVO{
+
+    private String name;
+
+    private String playUrl;
+
+    private JSONObject data;
+
+}

+ 5 - 0
4dkankan-center-scene/src/main/resources/mapper/scene/DownloadTourVideoMapper.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.IDownloadTourVideoMapper">
+
+</mapper>

+ 5 - 0
4dkankan-center-scene/src/main/resources/mapper/scene/SurveillanceMapper.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.ISurveillanceMapper">
+
+</mapper>