Sfoglia il codice sorgente

修改V3场景构建逻辑

tianboguang 2 anni fa
parent
commit
c9fa91fea1

+ 285 - 0
src/main/java/com/fdkankan/contro/entity/SceneProEdit.java

@@ -0,0 +1,285 @@
+package com.fdkankan.contro.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>
+ * pro场景编辑数据表
+ * </p>
+ *
+ * @author 
+ * @since 2022-07-12
+ */
+@Getter
+@Setter
+@TableName("t_scene_pro_edit")
+public class SceneProEdit implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * pro场景id
+     */
+    @TableField("pro_id")
+    private Long proId;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 大场景的密钥
+     */
+    @TableField("scene_key")
+    private String sceneKey;
+
+    /**
+     * 展示页面密码,0不需要,1需要
+     */
+    @TableField("need_key")
+    private Integer needKey;
+
+    /**
+     * 版本
+     */
+    @TableField("version")
+    private Integer version;
+
+    /**
+     * 表示缩略图是否存在
+     */
+    @TableField("thumb_status")
+    private Integer thumbStatus;
+
+    /**
+     * 地面点位标志
+     */
+    @TableField("marker_logo")
+    private String markerLogo;
+
+    /**
+     * 0表示默认,1表示自己上传
+     */
+    @TableField("floor_logo")
+    private String floorLogo;
+
+    /**
+     * 标记大小
+     */
+    @TableField("floor_logo_size")
+    private Integer floorLogoSize;
+
+    /**
+     * 要上传的热点的id集合,用逗号隔开
+     */
+    @TableField("hots_ids")
+    private String hotsIds;
+
+    /**
+     * 表示初始点信息
+     */
+    @TableField("entry")
+    private String entry;
+
+    /**
+     * 背景音乐名称
+     */
+    @TableField("bg_music")
+    private String bgMusic;
+
+    /**
+     * 记录的状态,A: 生效,I: 禁用
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+    /**
+     * 更新时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * 普通录屏文件地址
+     */
+    @TableField("screencap_voice_src")
+    private String screencapVoiceSrc;
+
+    /**
+     * 录音文件地址
+     */
+    @TableField("screencap_voice_sound")
+    private String screencapVoiceSound;
+
+    /**
+     * 同步录音地址
+     */
+    @TableField("screencap_voice_soundsync")
+    private String screencapVoiceSoundsync;
+
+    /**
+     * 选择的类型,sound为screencapVoiceSound,file为screencapVoiceSrc,soundsync为screencap_voice_soundsync
+     */
+    @TableField("screencap_voice_type")
+    private String screencapVoiceType;
+
+    /**
+     * 录屏文件地址
+     */
+    @TableField("play_data")
+    private String playData;
+
+    /**
+     * 重新建模的版本
+     */
+    @TableField("floor_edit_ver")
+    private Integer floorEditVer;
+
+    /**
+     * 正式发布重新建模的版本
+     */
+    @TableField("floor_publish_ver")
+    private Integer floorPublishVer;
+
+    /**
+     * 录屏图片存放文件
+     */
+    @TableField("screencap_thumb")
+    private String screencapThumb;
+
+    /**
+     * 分享的logo和生成二维码的logo
+     */
+    @TableField("share_logo")
+    private String shareLogo;
+
+    /**
+     * 小地图浏览
+     */
+    @TableField("map_visi")
+    private Integer mapVisi;
+
+    /**
+     * 自动导览
+     */
+    @TableField("tour_visi")
+    private Integer tourVisi;
+
+    /**
+     * vr模式
+     */
+    @TableField("vr_visi")
+    private Integer vrVisi;
+
+    /**
+     * 展示页面是否显示标尺
+     */
+    @TableField("ruler_visi")
+    private Integer rulerVisi;
+
+    /**
+     * 展示页面cad图在平面图是否显示
+     */
+    @TableField("cad_img_visi")
+    private Integer cadImgVisi;
+
+    /**
+     * cad平面图
+     */
+    @TableField("floor_plan_png")
+    private String floorPlanPng;
+
+    /**
+     * cad平面图参数
+     */
+    @TableField("cad_info")
+    private String cadInfo;
+
+    @TableField("pano_visi")
+    private Integer panoVisi;
+
+    @TableField("m2d_visi")
+    private Integer m2dVisi;
+
+    @TableField("m3d_visi")
+    private Integer m3dVisi;
+
+    @TableField("measure_visi")
+    private Integer measureVisi;
+
+    /**
+     * 肖安需求,场景于场景之间的关联
+     */
+    @TableField("link_scene")
+    private String linkScene;
+
+    @TableField("overlay")
+    private String overlay;
+
+    /**
+     * 是否显示底部logo,1显示,0不显示
+     */
+    @TableField("show_logo_bottom")
+    private Boolean showLogoBottom;
+
+    /**
+     * 全景图版本号
+     */
+    @TableField("images_version")
+    private Integer imagesVersion;
+
+    /**
+     * 上传的背景音乐
+     */
+    @TableField("bg_music_name")
+    private String bgMusicName;
+
+    @TableField("jump_scene")
+    private Boolean jumpScene;
+
+    /**
+     * 旋转角度
+     */
+    @TableField("floor_plan_angle")
+    private String floorPlanAngle;
+
+    /**
+     * 场景下载次数
+     */
+    @TableField("download_num")
+    private Integer downloadNum;
+
+    /**
+     * 绿幕抠图json数据
+     */
+    @TableField("videos_user")
+    private String videosUser;
+
+    /**
+     * 大场景序号(随心装场景码)
+     */
+    @TableField("vr_num")
+    private String vrNum;
+
+    /**
+     * 随心装封面图
+     */
+    @TableField("vr_thumb")
+    private String vrThumb;
+
+
+}

+ 18 - 0
src/main/java/com/fdkankan/contro/mapper/ISceneProEditMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.contro.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fdkankan.contro.entity.SceneProEdit;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * pro场景编辑数据表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2022-07-12
+ */
+@Mapper
+public interface ISceneProEditMapper extends BaseMapper<SceneProEdit> {
+
+}

+ 4 - 3
src/main/java/com/fdkankan/contro/mq/listener/BuildSceneListener.java

@@ -2,6 +2,7 @@ package com.fdkankan.contro.mq.listener;
 
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.contro.mq.service.impl.BuildSceneServiceImpl;
+import com.fdkankan.contro.mq.service.impl.BuildV3SceneServiceImpl;
 import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
 import com.fdkankan.rabbitmq.bean.BuildSceneResultMqMessage;
 import com.rabbitmq.client.Channel;
@@ -25,7 +26,7 @@ public class BuildSceneListener extends AbstrackBuildSceneListener {
     private String queueModelingPost;
 
     @Autowired
-    private BuildSceneServiceImpl buildSceneService;
+    private BuildV3SceneServiceImpl buildSceneService;
 
     /**
      * 场景计算前置资源准备处理
@@ -34,7 +35,7 @@ public class BuildSceneListener extends AbstrackBuildSceneListener {
      * @throws Exception
      */
     @RabbitListener(
-            queuesToDeclare = @Queue("${queue.modeling.modeling-pre}"),
+            queuesToDeclare = @Queue("${queue.modeling.v3.modeling-pre}"),
             concurrency = "${maxThread.modeling.modeling-pre}"
     )
     public void buildScenePreHandler(Channel channel, Message message) throws Exception {
@@ -48,7 +49,7 @@ public class BuildSceneListener extends AbstrackBuildSceneListener {
      * @throws Exception
      */
     @RabbitListener(
-            queuesToDeclare = @Queue("${queue.modeling.modeling-post}"),
+            queuesToDeclare = @Queue("${queue.modeling.v3.modeling-post}"),
             concurrency = "${maxThread.modeling.modeling-post}"
     )
     public void buildScenePostHandler(Channel channel, Message message) throws Exception {

+ 53 - 0
src/main/java/com/fdkankan/contro/mq/listener/BuildV3SceneListener.java

@@ -0,0 +1,53 @@
+package com.fdkankan.contro.mq.listener;
+
+import com.fdkankan.contro.mq.service.impl.BuildSceneServiceImpl;
+import com.rabbitmq.client.Channel;
+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;
+
+@Slf4j
+@Component
+public class BuildV3SceneListener extends AbstrackBuildSceneListener {
+
+    @Value("${queue.modeling.modeling-pre}")
+    private String queueModelingPre;
+    @Value("${queue.modeling.modeling-post}")
+    private String queueModelingPost;
+
+    @Autowired
+    private BuildSceneServiceImpl buildSceneService;
+
+    /**
+     * 场景计算前置资源准备处理
+     * @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 {
+        preHandle(channel,queueModelingPre,message,buildSceneService);
+    }
+
+    /**
+     * 场景计算后置结果处理
+     * @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 {
+        postHandle(channel,queueModelingPost,message,buildSceneService);
+
+    }
+}

+ 1 - 0
src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java

@@ -212,6 +212,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
             //上传全景图俯视图
             this.uploadFloorCad(path, sceneCode, uploadFiles);
 
+
             //上传文件
             log.info("开始上传场景计算结果数据,num:{}", sceneCode);
             fYunFileService.uploadMulFiles(uploadFiles);

+ 753 - 0
src/main/java/com/fdkankan/contro/mq/service/impl/BuildV3SceneServiceImpl.java

@@ -0,0 +1,753 @@
+package com.fdkankan.contro.mq.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.io.file.FileNameUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.util.ZipUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.fdkankan.common.constant.*;
+import com.fdkankan.common.util.FileUtils;
+import com.fdkankan.contro.bean.SceneJsonBean;
+import com.fdkankan.contro.entity.*;
+import com.fdkankan.contro.mq.service.IBuildSceneService;
+import com.fdkankan.contro.service.*;
+import com.fdkankan.contro.service.impl.FdkkV4Service;
+import com.fdkankan.contro.vo.SceneEditControlsVO;
+import com.fdkankan.fyun.config.FYunFileConfig;
+import com.fdkankan.fyun.constant.FYunTypeEnum;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.image.MatrixToImageWriterUtil;
+import com.fdkankan.model.constants.ConstantFileName;
+import com.fdkankan.model.constants.ConstantFilePath;
+import com.fdkankan.model.constants.UploadFilePath;
+import com.fdkankan.model.utils.CreateHouseJsonUtil;
+import com.fdkankan.model.utils.CreateObjUtil;
+import com.fdkankan.push.config.PushMessageConfig;
+import com.fdkankan.push.utils.PushMsgUtil;
+import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
+import com.fdkankan.rabbitmq.bean.BuildSceneResultMqMessage;
+import com.fdkankan.rabbitmq.util.RabbitMqProducer;
+import com.fdkankan.redis.constant.RedisKey;
+import com.fdkankan.redis.util.RedisUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.*;
+import java.util.Map.Entry;
+import java.util.stream.Collectors;
+
+
+/**
+ * <p>
+ * TODO
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/4/20
+ **/
+@Slf4j
+@Service
+public class BuildV3SceneServiceImpl implements IBuildSceneService {
+
+    @Value("${queue.modeling.modeling-call}")
+    private String queueModelingCall;
+
+    @Value("${queue.modeling.v3.modeling-post}")
+    private String queueV3ModelingPost;
+
+    @Autowired
+    private RabbitMqProducer mqProducer;
+
+    @Autowired
+    private FYunFileServiceInterface fYunFileService;
+    @Autowired
+    private ICameraDetailService cameraDetailService;
+    @Autowired
+    private ISceneEditInfoService sceneEditInfoService;
+    @Autowired
+    private ISceneEditControlsService sceneEditControlsService;
+
+    @Autowired
+    private FYunFileConfig fYunFileConfig;
+
+    @Autowired
+    private RedisUtil redisUtil;
+    @Autowired
+    private IScenePlusService scenePlusService;
+    @Autowired
+    private IScenePlusExtService scenePlusExtService;
+    @Autowired
+    private ISceneEditInfoExtService sceneEditInfoExtService;
+
+    @Autowired
+    private IUserIncrementService userIncrementService;
+
+    @Autowired
+    private IFdkkLaserService fdkkLaserService;
+
+    @Autowired
+    private FdkkV4Service fdkkV4Service;
+
+    @Autowired
+    private IBuildSceneDTService buildSceneDTService;
+
+    @Override
+    public void buildScenePre(BuildSceneCallMessage message) {
+        boolean success = false;
+        try {
+            //根据相机类型,组装资源路径
+            //下载资源到本地
+            this.downLoadSource(message, message.getPath());
+
+            message.getBuildContext().put("cameraType",message.getCameraType());
+
+            message.setResultReceiverMqName(queueV3ModelingPost);
+
+            //发送mq,就进行计算
+            mqProducer.sendByWorkQueue(queueModelingCall, message);
+
+            success = true;
+
+            log.info("场景计算资源准备结束,场景码:{}", message.getSceneNum());
+
+        }catch (Exception e){
+            log.error("场景计算前置处理出错", e);
+        }finally {
+            //如果前置处理失败,发送钉钉消息
+            if(!success){
+                buildSceneDTService.handFail("场景计算资源准备异常!", message.getPath(), message.getSceneNum(), "计算控制服务器", null);
+            }
+
+        }
+    }
+
+    @Override
+    public void downLoadSource(BuildSceneCallMessage buildSceneMqMessage,String path){
+        String ossPath = ConstantFilePath.OSS_PREFIX
+                + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "")
+                .replace(ConstantFilePath.BUILD_MODEL_LASER_PATH, "");
+        if (!ossPath.endsWith("/")) {
+            ossPath = ossPath.concat("/");
+        }
+        fYunFileService.downloadFileByCommand(path + File.separator + "capture", ossPath);
+    }
+
+
+    @Override
+    public void buildScenePost(BuildSceneResultMqMessage message) throws Exception {
+        Integer cameraType = Integer.parseInt(message.getBuildContext().get("cameraType").toString());
+        String sceneCode = message.getBuildContext().get("sceneNum").toString();
+        Long computeTime = message.getComputeTime();
+
+        String path = message.getPath();
+
+        Boolean buildSuccess = message.getBuildSuccess();
+        JSONObject fdageData = getFdageData(path + File.separator + "capture" +File.separator+"data.fdage");
+        Integer videoVersion = fdageData.getInteger("videoVersion");
+        try {
+            // 上传计算日志
+            //如果是重复计算,没有走到计算逻辑,不需要上传日志文件
+            log.info("开始上传计算日志");
+            String buildLogPath = String.format(UploadFilePath.BUILD_LOG_PATH, sceneCode);
+            fYunFileService.uploadFile(path + File.separator + "console.log", buildLogPath + "console.log");
+            log.info("计算日志上传完成");
+
+            if (!buildSuccess) {
+                log.error("建模失败,修改状态为失败状态");
+                scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
+                        .set(ScenePlus::getSceneStatus, SceneStatus.FAILD.code())
+                        .eq(ScenePlus::getNum, sceneCode));
+                throw new RuntimeException("建模失败!");
+            }
+
+            Map<String, String> uploadFiles = getUploadFiles(path,cameraType,fdageData);
+
+            //建模成功走以下逻辑
+            log.info("cameraType:{}",cameraType);
+
+            //计算场景消耗磁盘空间
+            long space = this.calUseSpace(uploadFiles);
+
+            if(cameraType < 3){
+                this.updateDb4Sm(sceneCode, space);
+                fYunFileService.uploadMulFiles(uploadFiles);
+                return;
+            }
+
+            //读取计算结果文件生成videosJson
+            JSONObject videosJson = this.getVideosJson(path, videoVersion, sceneCode, cameraType);
+
+            //写入数据库
+            ScenePlus scenePlus = this.updateDbPlus(sceneCode, space, videosJson.toJSONString(), computeTime,fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1);
+            ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
+
+            //变更容量,arrearCap为true时,代表容量不足
+            boolean arrearCap = this.updateSpace(scenePlus.getCameraId(), space);
+
+            //如果相机容量不足,需要把场景的paystatus改为容量不足状态
+            if (arrearCap && cameraType != 14) {
+                this.sealScene(arrearCap, scenePlus.getId(), scenePlus.getId());
+            }
+
+            Object[] editInfoArr = this.updateEditInfo(scenePlus);
+            SceneEditInfo sceneEditInfo = (SceneEditInfo)editInfoArr[0];
+            SceneEditInfoExt sceneEditInfoExt = (SceneEditInfoExt)editInfoArr[1];
+            SceneEditControls sceneEditControls = (SceneEditControls)editInfoArr[2];
+
+            String outPathZh = ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+sceneCode+".png";
+            String outPathEn = ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+sceneCode+"_en.png";
+            //生成新的分享的二维码-中文版本
+            MatrixToImageWriterUtil.createQRCode(scenePlusExt.getWebSite(), outPathZh, false,null);
+            //生成新的分享的二维码-英文版本
+            MatrixToImageWriterUtil.createQRCode(scenePlusExt.getWebSite() + "&lang=en", outPathEn, false, null);
+            //上传二维码
+            fYunFileService.uploadFile(outPathZh, String.format(UploadFilePath.DOWNLOADS_QRCODE, sceneCode) + sceneCode + ".png");
+            fYunFileService.uploadFile(outPathEn, String.format(UploadFilePath.DOWNLOADS_QRCODE, sceneCode) + sceneCode + "_en.png");
+
+            //上传全景图俯视图
+            this.uploadFloorCad(path, sceneCode, uploadFiles);
+
+
+            //上传文件
+            log.info("开始上传场景计算结果数据,num:{}", sceneCode);
+            fYunFileService.uploadMulFiles(uploadFiles);
+
+            Map<String,String> damFileHeaders = new HashMap<>();
+            damFileHeaders.put("Content-Encoding","gzip");
+
+            if (!fYunFileService.getFyunType().equals(FYunTypeEnum.LOCAL.code())) {
+                // dam 文件设置请求头
+                uploadFiles.entrySet().stream().filter(entry -> FileNameUtil.extName(entry.getKey()).equals("dam"))
+                        .filter(entry -> new File(entry.getKey()).exists())
+                        .forEach(entry -> {
+                            // gzip压缩
+                            FileUtil.writeBytes(ZipUtil.gzip(new File(entry.getKey())), entry.getKey() + ".gzip");
+                            // 重命名
+                            FileUtil.rename(new File(entry.getKey() + ".gzip"), entry.getKey(), true);
+                            fYunFileService.uploadFile(entry.getKey(), entry.getValue(), damFileHeaders);
+                        });
+            }
+
+            //拷贝部分文件到编辑目录,用于用户编辑
+            this.copyToEditDir(sceneCode);
+
+            //生成houseTypejson并上传
+            uploadFiles.entrySet().stream().filter(entry-> FileNameUtil.getName(entry.getKey()).equals("floorplan_cad.json"))
+                    .forEach(entry-> uploadHouseTypeJson(sceneCode,entry.getKey()));
+
+            //写scene.json
+            log.info("生成scene.json上传oss并设置缓存,num:{}", sceneCode);
+            this.writeSceneJson(sceneCode, videosJson,sceneEditInfo, sceneEditInfoExt, sceneEditControls, scenePlus,
+                    scenePlusExt, arrearCap);
+
+            //计算成功,通知APP
+            Integer pushChannel = fdageData.getInteger("pushChannel");
+            String pushToken = fdageData.getString("pushToken");
+            this.pushMsgToApp(pushChannel,pushToken, cameraType, scenePlus.getTitle(), scenePlusExt.getWebSite());
+
+            if (cameraType == 14) {
+                //计算成功  激光转台相机 同步 请求
+                fdkkLaserService.syncBuildResult(scenePlus, scenePlusExt);
+            }
+
+            CreateObjUtil.deleteFile(path.replace(ConstantFilePath.BUILD_MODEL_PATH, "/") + "/capture");
+
+            log.info("场景计算结果处理结束,场景码:{}", sceneCode);
+
+            // 判断是否升级V4
+            if(fdageData.containsKey("updateV4") && fdageData.getIntValue("updateV4") == 1){
+                fdkkV4Service.upgradeToV4(sceneCode);
+            }
+
+        }catch (Exception e){
+            String errorMsg = "场景计算结果处理出错!";
+            String hostName = "计算控制服务";
+            log.error(errorMsg);
+            e.printStackTrace();
+            if(!buildSuccess){
+                errorMsg = "场景构建失败!";
+                hostName = message.getHostName();
+            }
+            //发送钉钉
+            String serverPath = message.getPath();
+            buildSceneDTService.handFail(errorMsg, serverPath, sceneCode, hostName, null);
+        }
+    }
+
+    private Map<String, String> getUploadFiles(String path,Integer cameraType,JSONObject fdageData) throws Exception {
+        ScenePlus scenePlus = scenePlusService.getByFileId(path);
+        if (ObjectUtils.isEmpty(scenePlus)) {
+            throw new Exception("未找到场景信息:" + path);
+        }
+
+        String projectNum = scenePlus.getNum();
+
+
+        String dataViewPath = String.format(ConstantFilePath.DATA_PATH_FORMAT, projectNum);
+        String imagesPath = String.format(ConstantFilePath.IMAGE_PATH_FORMAT, projectNum);
+        String videoPath = String.format(ConstantFilePath.VIDEO_PATH_FORMAT, projectNum);
+        String resultsPath = path + File.separator + "results" + File.separator;
+
+        String uploadJsonPath = resultsPath + "upload.json";
+        String uploadData = FileUtils.readFile(uploadJsonPath);
+        log.info("upload.json 文件路径:{}, 内容:{}", uploadJsonPath, uploadData);
+        JSONArray array = JSONObject.parseObject(uploadData).getJSONArray("upload");
+
+
+        JSONObject fileJson = null;
+        String fileName = "";
+
+        Map<String, String> map = new HashMap();
+
+        for (int i = 0; i < array.size(); ++i) {
+            fileJson = array.getJSONObject(i);
+            fileName = fileJson.getString("file");
+            String filePath = resultsPath + fileName;
+
+            if (!(new File(filePath)).exists()) {
+                throw new Exception(filePath + "文件不存在");
+            }
+
+            if ("vision2.txt".equals(fileName)) {
+                CreateObjUtil.convertTxtToVisionmodeldata(resultsPath + "vision2.txt", resultsPath + "vision2.modeldata");
+                map.put(resultsPath + "vision2.modeldata", imagesPath + "vision2.modeldata");
+                map.put(resultsPath + "vision2.txt", imagesPath + "vision2.txt");
+            }
+
+            if (fileJson.getIntValue("clazz") == 2) {
+                map.put(filePath, imagesPath + ConstantFileName.modelUUID + "_50k_texture_jpg_high1/" + fileName.replace("tex/", ""));
+            } else if (fileJson.getIntValue("clazz") == 3) {
+                map.put(filePath, imagesPath + "pan/high/" + fileName.replace("high/", ""));
+            } else if (fileJson.getIntValue("clazz") == 4) {
+                map.put(filePath, imagesPath + "pan/low/" + fileName.replace("low/", ""));
+            } else if (fileJson.getIntValue("clazz") == 5) {
+                map.put(filePath, imagesPath + fileName);
+            } else if (fileJson.getIntValue("clazz") == 7) {
+                map.put(filePath, imagesPath + fileName);
+            } else if (fileJson.getIntValue("clazz") == 10) {
+                String updown = FileUtils.readFile(filePath);
+                JSONObject updownJson = JSONObject.parseObject(updown);
+                String mappingOssPath = String.format("scene_edit_data/%s/data/", projectNum) + fileName.replace("updown", "mapping");
+                map.put(filePath, mappingOssPath);
+            } else {
+                if (fileJson.getIntValue("clazz") == 11 || fileJson.getIntValue("clazz") == 12) {
+                    map.put(filePath, videoPath + fileName.replace("videos/", ""));
+                    if (fileName.contains(".mp4")) {
+                        map.put(resultsPath + fileName.replace("mp4", "flv"), videoPath + fileName.replace("videos/", "").replace("mp4", "flv"));
+                    }
+                }
+
+                if (fileJson.getIntValue("clazz") == 16) {
+                    map.put(filePath, dataViewPath + fileName);
+                }
+
+                if (fileJson.getIntValue("clazz") == 18) {
+                    map.put(filePath, imagesPath + fileName);
+                }
+            }
+        }
+
+
+        if ((fdageData.containsKey("exportMeshObj") && fdageData.getIntValue("exportMeshObj") == 1)
+                || (!ObjectUtils.isEmpty(cameraType) && (!cameraType.equals(14)))) {
+            CreateObjUtil.convertTxtToDam(path + File.separator + "results" + File.separator + "tex" + File.separator + "modeldata.txt", path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam");
+            CreateObjUtil.convertDamToLzma(path + File.separator + "results/");
+            CreateObjUtil.convertTxtToDam(path + File.separator + "results" + File.separator + "tex" + File.separator + "modeldata.txt", path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam");
+            map.put(path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam.lzma", imagesPath + ConstantFileName.modelUUID + "_50k.dam.lzma");
+            map.put(path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam", imagesPath + ConstantFileName.modelUUID + "_50k.dam");
+        }
+
+        CreateObjUtil.convertTxtToVisionmodeldata(resultsPath + "vision.txt", resultsPath + "vision.modeldata");
+        map.put(resultsPath + "vision.txt", imagesPath + "vision.txt");
+        map.put(resultsPath + "vision.modeldata", imagesPath + "vision.modeldata");
+
+        log.info("数据转换完成:" + projectNum);
+
+        FileUtil.touch("/mnt/4Dkankan/scene/data" + File.separator + "data" + projectNum);
+        map.put(resultsPath + "floorplan.json", dataViewPath + "floor.json");
+        map.put(resultsPath + "floorplan_cad.json", dataViewPath + "floorplan_cad.json");
+        map.put(path + File.separator + "capture/stitch_params.txt", dataViewPath + "stitch_params.txt");
+        map.put(path + File.separator + "capture/Up.xml", dataViewPath + "Up.xml");
+        map.put(path + File.separator + "capture/Up2.xml", dataViewPath + "Up2.xml");
+        map.put(path + File.separator + "capture/Up.txt", dataViewPath + "Up.txt");
+        map.put(path + File.separator + "capture/Up2.txt", dataViewPath + "Up2.txt");
+        return map;
+
+    }
+
+    private JSONObject getFdageData(String dataFdagePath) {
+        log.info("dataFdagePath 文件路径 :{}", dataFdagePath);
+        String data = FileUtils.readFile(dataFdagePath);
+        //获取data.fdage的内容
+        JSONObject dataJson = new JSONObject();
+        if(data!=null){
+            dataJson = JSONObject.parseObject(data);
+        }
+        return dataJson;
+    }
+
+    private void uploadFloorCad(String path, String num, Map<String, String> uploadFiles){
+
+        //户型图上传
+        String  userEditPath = UploadFilePath.USER_EDIT_PATH + "floor-cad-%s.%s";
+        String  userViewPath = UploadFilePath.USER_VIEW_PATH + "floor-cad-%s.%s";
+        String floorCadPath = path + "/results/floorplan_cad";
+        List<String> floorCadList = FileUtils.getFileList(floorCadPath);
+        if(CollUtil.isNotEmpty(floorCadList)){
+            floorCadList.stream().forEach(str->{
+                String substring = str.substring(str.lastIndexOf(File.separator) + 1);
+                String[] arr = substring.split("floor");
+                String[] arr2 = arr[1].split("\\.");
+                uploadFiles.put(str, String.format(userEditPath, num, arr2[0], arr2[1]));
+                uploadFiles.put(str, String.format(userViewPath, num, arr2[0], arr2[1]));
+            });
+        }
+
+    }
+
+    private void writeSceneJson(String num, JSONObject videosJson, SceneEditInfo sceneEditInfo, SceneEditInfoExt sceneEditInfoExt,
+                                SceneEditControls sceneEditControls, ScenePlus scenePlus, ScenePlusExt scenePlusExt, boolean arrearCap)  throws Exception{
+        String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, num);
+
+        String sceneJsonKey = dataViewPath + "scene.json";
+        boolean exist = fYunFileService.fileExist(sceneJsonKey);
+        //如果云端没有scene.json文件,生成一份
+        if(!exist){
+            SceneJsonBean sceneJson = new SceneJsonBean();
+            BeanUtil.copyProperties(sceneEditInfoExt, sceneJson);
+            BeanUtil.copyProperties(sceneEditInfo, sceneJson);
+            SceneEditControlsVO sceneEditControlsVO = BeanUtil.copyProperties(sceneEditControls, SceneEditControlsVO.class);
+            sceneJson.setControls(sceneEditControlsVO);
+            sceneJson.setNum(num);
+            sceneJson.setCreateTime(scenePlus.getCreateTime());
+            sceneJson.setSceneResolution(scenePlusExt.getSceneResolution());
+            sceneJson.setSceneFrom(scenePlusExt.getSceneFrom());
+            sceneJson.setVideos(JSON.toJSONString(videosJson));
+            if(arrearCap) {
+                sceneJson.setPayStatus(PayStatus.NO_CAPACITY.code());
+            }
+
+            String sceneJsonStr = JSON.toJSONString(sceneJson);
+            //上传sceneJson文件
+            fYunFileService.uploadFile(sceneJsonStr.getBytes(), sceneJsonKey);
+            //scenejson写入缓存
+            redisUtil.set(String.format(RedisKey.SCENE_JSON, num), sceneJsonStr);
+        }
+        // 上传status JSON.
+
+        JSONObject statusJson = new JSONObject();
+        //临时将-2改成1,app还没完全更新
+        statusJson.put("status", 1);
+        statusJson.put("webSite", scenePlusExt.getWebSite());
+        statusJson.put("sceneNum", num);
+        statusJson.put("thumb", scenePlusExt.getThumb());
+        statusJson.put("payStatus", 1);
+        FileUtils.writeFile(ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "status.json", statusJson.toString());
+
+        fYunFileService.uploadFile(ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "status.json",
+                dataViewPath + "status.json");
+    }
+
+    private void pushMsgToApp(Integer pushChannel, String pushToken, int cameraType, String sceneName, String webSite){
+        log.info("推送消息,渠道是 {}, 手机token是 {}", pushChannel, pushToken);
+        if(Objects.isNull(pushChannel) && StrUtil.isBlank(pushToken)){
+            return;
+        }
+
+        String title = sceneName + "计算完成";
+        String body = "您上传的" + sceneName + "计算完成,点击查看";
+
+        try{
+            if(FYunTypeEnum.AWS.code().equals(fYunFileService.getFyunType())){
+                PushMsgUtil.googlePushMsg(ConstantFilePath.BASE_PATH + "/refreshToken.json", pushToken,
+                        title, body , webSite);
+                return;
+            }
+
+            PushMessageConfig pushConfig = null;
+            if(pushChannel == 0){
+                if(cameraType == 10 || cameraType == 13){
+                    //ios
+                    pushConfig = new PushMessageConfig(PushMessageConfig.IOS_KEY_Z, PushMessageConfig.IOS_SECRET_Z);
+                    pushConfig.sendIOSUnicast(pushToken,  "四维看看Minion",title, body, webSite);
+                }else {
+                    //ios
+                    pushConfig = new PushMessageConfig(PushMessageConfig.IOS_KEY, PushMessageConfig.IOS_SECRET);
+                    pushConfig.sendIOSUnicast(pushToken, "四维看看Pro",title, body, webSite);
+                }
+            }else {
+                if(cameraType == 10 || cameraType == 13){
+                    //ios
+                    //安卓
+                    pushConfig = new PushMessageConfig(PushMessageConfig.ANDROID_KEY_Z, PushMessageConfig.ANDROID_SECRET_Z);
+                    pushConfig.sendAndroidUnicast2(pushToken, "四维看看Minion",title, body, webSite);
+                }else {
+                    //安卓
+                    pushConfig = new PushMessageConfig(PushMessageConfig.ANDROID_KEY, PushMessageConfig.ANDROID_SECRET);
+                    pushConfig.sendAndroidUnicast(pushToken, "四维看看Pro",title, body, webSite);
+                }
+            }
+            log.info("消息推送结束!");
+        }catch (Exception e){
+            log.error("推送消息失败:", e);
+        }
+    }
+
+    private void copyToEditDir(String num) throws IOException {
+
+        String editImagesPath = String.format(UploadFilePath.IMG_EDIT_PATH, num);
+        String viewImagesPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
+
+        String editDataPath = String.format(UploadFilePath.DATA_EDIT_PATH, num);
+        String viewDataPath = String.format(UploadFilePath.DATA_VIEW_PATH, num);
+
+        Map<String, String> map = new HashMap<>();
+        map.put(editImagesPath + "vision.modeldata", viewImagesPath + "vision.modeldata");
+        map.put(editImagesPath + "vision2.modeldata", viewImagesPath + "vision2.modeldata");
+        map.put(editDataPath + "floorplan_cad.json", viewDataPath + "floorplan_cad.json");
+
+        for (Entry<String, String> entry : map.entrySet()) {
+                fYunFileService.copyFileInBucket(entry.getValue(), entry.getKey());
+        }
+    }
+
+    private JSONObject getVideosJson(String path, Integer videoVersion, String projectNum, int cameraType) throws Exception {
+        //读取videos_hdr_param.json, 保存点位视频的value
+        Map<String, Object> videoMap = new HashMap<>();
+        String videosHdr = FileUtils.readFile(path + File.separator + "results/videos/videos_hdr_param.json");
+        JSONArray videoArray = null;
+        if(StringUtils.isNotEmpty(videosHdr)){
+            videoArray = JSONObject.parseObject(videosHdr).getJSONArray("hdr_param");
+        }
+        if(videoArray != null){
+            for(int i = 0, len = videoArray.size(); i < len; i++) {
+                videoMap.put(videoArray.getJSONObject(i).getString("name"), videoArray.getJSONObject(i).getString("value"));
+                if(videoArray.getJSONObject(i).containsKey("fov")){
+                    videoMap.put(videoArray.getJSONObject(i).getString("name") + "_fov", videoArray.getJSONObject(i).getString("fov"));
+                }
+            }
+        }
+
+        //获取upload中的video视频名称
+        String uploadData = FileUtils.readFile(path + File.separator + "results" +File.separator+"upload.json");
+        JSONObject uploadJson = null;
+        JSONArray array = null;
+        if(uploadData!=null) {
+            uploadJson = JSONObject.parseObject(uploadData);
+            array = uploadJson.getJSONArray("upload");
+        }
+        JSONObject fileJson = null;
+        String fileName = "";
+
+        //计算ts文件的大小,并拼接成json格式
+        JSONArray jsonArray = new JSONArray();
+        JSONObject videoJson = null;
+        JSONObject videosJson = new JSONObject();
+        long videoSize = 0L;
+        for(int i = 0, len = array.size(); i < len; i++) {
+            fileJson = array.getJSONObject(i);
+            fileName = fileJson.getString("file");
+            if(fileJson.getIntValue("clazz") == 11 && fileName.contains(".mp4") && !fileName.contains("-ios.mp4")){
+                videoJson = new JSONObject();
+                videoJson.put("id", fileName.substring(
+                    0, fileName.lastIndexOf(".")).replace("videos/", ""));
+
+                //如果ts文件存在,就计算ts大小
+                if(new File(path + File.separator + "results" +File.separator+ fileName.replace(".mp4", ".ts")).exists()){
+                    videoSize = new File(path + File.separator + "results" +File.separator+ fileName.replace(".mp4", ".ts")).length();
+                    videoJson.put("tsSize", videoSize);
+                }
+                if(videoMap.containsKey(videoJson.get("id"))){
+                    videoJson.put("value", videoMap.get(videoJson.get("id")));
+                }
+                if(videoMap.containsKey(videoJson.get("id") + "_fov")){
+                    videoJson.put("blend_fov", videoMap.get(videoJson.get("id") + "_fov"));
+                }else {
+                    videoJson.put("blend_fov", 7);
+                }
+                jsonArray.add(videoJson);
+            }
+        }
+
+        videosJson.put("data", jsonArray);
+        if(Objects.nonNull(videoVersion) && videoVersion >= 4){
+            videosJson.put("version", 3);
+            videosJson.put("upPath", fYunFileConfig.getHost() + String.format(UploadFilePath.DATA_VIEW_PATH, projectNum) + "Up.xml");
+            if(cameraType == 13){
+                //转台相机
+                videosJson.put("upPath", videosJson.getString("upPath").replace(".xml", ".txt"));
+            }
+        }else {
+            videosJson.put("version", 1);
+            videosJson.put("upPath", fYunFileConfig.getHost() + String.format(UploadFilePath.DATA_VIEW_PATH, projectNum) + "Up2.xml");
+            if(cameraType == 13){
+                //转台相机
+                videosJson.put("upPath", videosJson.getString("upPath").replace(".xml", ".txt"));
+            }
+        }
+
+        if(cameraType == 5 || cameraType == 6){
+            videosJson.put("version", 1);
+            videosJson.put("upPath", fYunFileConfig.getHost() + String.format(UploadFilePath.DATA_VIEW_PATH, projectNum) + "stitch_params.txt");
+        }
+
+        return videosJson;
+    }
+
+    private Long calUseSpace(Map<String, String> uploadFile) {
+        return uploadFile.keySet().stream().map(File::new).filter(File::exists).mapToLong(File::length).sum();
+    }
+
+    private void sealScene(boolean arrearCap, Long scenePlusId, Long sceneProId){
+        scenePlusService.update(
+            new LambdaUpdateWrapper<ScenePlus>()
+                .set(ScenePlus::getPayStatus, PayStatus.NO_CAPACITY.code())
+                .eq(ScenePlus::getId, scenePlusId));
+    }
+
+    /**
+     * <p>
+     双目场景更新数据库
+     * </p>
+     * @author dengsixing
+     * @date 2022/3/21
+     * @param num
+     * @param space
+     **/
+    private void updateDb4Sm(String num, long space){
+        List<ScenePlus> ScenePlusList = scenePlusService.list(
+            new LambdaQueryWrapper<ScenePlus>().select(ScenePlus::getId).eq(ScenePlus::getNum, num));
+
+        if(CollUtil.isEmpty(ScenePlusList)){
+            return ;
+        }
+
+        List<Long> sceneIds = ScenePlusList.stream().map(ScenePlus::getId).collect(Collectors.toList());
+
+        //更新场景创建时间
+        scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>().in(ScenePlus::getId, sceneIds)
+            .set(ScenePlus::getSceneStatus, SceneStatus.NO_DISPLAY.code()));
+
+        //更新使用容量
+        scenePlusExtService.update(new LambdaUpdateWrapper<ScenePlusExt>().in(ScenePlusExt::getPlusId, sceneIds)
+                .set(ScenePlusExt::getSpace, space)
+                .set(ScenePlusExt::getAlgorithmTime, Calendar.getInstance().getTime()));
+    }
+
+    private ScenePlus updateDbPlus(String num, Long space, String videosJson, Long computeTime,boolean isObj){
+        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
+        ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
+        List<ScenePlus> list = scenePlusService.list(new LambdaQueryWrapper<ScenePlus>()
+                .select(ScenePlus::getId).eq(ScenePlus::getNum, num));
+        if (CollUtil.isEmpty(list)) {
+            return null;
+        }
+
+        //修改场景状态 空间 支付状态 计算时间
+        List<Long> scenePlusIds = list.stream().map(ScenePlus::getId).collect(Collectors.toList());
+
+        scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
+            .in(ScenePlus::getId, scenePlusIds)
+            .set(ScenePlus::getSceneStatus, SceneStatus.NO_DISPLAY.code())
+            .set(ScenePlus::getUpdateTime, new Date())
+            .set(ScenePlus::getPayStatus, PayStatus.PAY.code()));
+
+        scenePlusExt.setSpace(space);
+        scenePlusExt.setComputeTime(computeTime.toString());
+        scenePlusExt.setAlgorithmTime(new Date());
+        scenePlusExt.setVideos(videosJson);
+        scenePlusExt.setIsObj(isObj ? 1 : 0);
+
+        SceneSource sceneSource = SceneSource.get(scenePlus.getSceneSource());
+        switch (sceneSource){
+            case BM:
+                scenePlusExt.setSceneResolution(SceneResolution.TILES_2K.code());
+                scenePlusExt.setSceneFrom(SceneFrom.PRO.code());
+                break;
+            case SM:
+                scenePlusExt.setSceneResolution(SceneResolution.TILES_1K.code());
+                scenePlusExt.setSceneFrom(SceneFrom.LITE.code());
+                break;
+            case ZT:
+                scenePlusExt.setSceneResolution(SceneResolution.TILES_4K.code());
+                scenePlusExt.setSceneFrom(SceneFrom.MINION.code());
+                break;
+            case JG:
+                scenePlusExt.setSceneResolution(SceneResolution.TILES_4K.code());
+                scenePlusExt.setSceneFrom(SceneFrom.LASER.code());
+                break;
+        }
+        scenePlusExtService.updateById(scenePlusExt);
+
+
+        return scenePlus;
+    }
+
+    private boolean updateSpace(Long cameraId, Long space) throws Exception{
+        //更新相机使用用量
+        CameraDetail cameraDetail = cameraDetailService.updateCameraDetailByCameraIdAndSpace(cameraId, space);
+        UserIncrement userIncrement = userIncrementService.getByCameraId(cameraId);
+        if( userIncrement == null || userIncrement.getIsExpired() == ExpiredStatus.Expired.code()) {
+            // 新上传的场景,如果总容量小于使用容量,则该大场景保留在临时存储空间30天
+            if (cameraDetail.getTotalSpace().compareTo(cameraDetail.getUsedSpace()) == -1){
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private Object[] updateEditInfo(ScenePlus scenePlus){
+        SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(scenePlus.getId());
+        SceneEditControls sceneEditControls = null;
+        SceneEditInfoExt sceneEditInfoExt = null;
+        if(sceneEditInfo == null){
+            sceneEditInfo = new SceneEditInfo();
+            sceneEditInfo.setScenePlusId(scenePlus.getId());
+            sceneEditInfo.setDescription(scenePlus.getDescription());
+            sceneEditInfo.setTitle(scenePlus.getTitle());
+            sceneEditInfoService.save(sceneEditInfo);
+
+        }else{
+            sceneEditControls = sceneEditControlsService.getBySceneEditId(sceneEditInfo.getId());
+            sceneEditInfoExt = sceneEditInfoExtService.getByEditInfoId(sceneEditInfo.getId());
+            sceneEditInfo.setVersion(sceneEditInfo.getVersion() + 1);
+            sceneEditInfoService.updateById(sceneEditInfo);
+        }
+        if(sceneEditControls == null){
+            sceneEditControls = new SceneEditControls();
+            sceneEditControls.setEditInfoId(sceneEditInfo.getId());
+            sceneEditControlsService.save(sceneEditControls);
+        }
+        if(sceneEditInfoExt == null){
+            sceneEditInfoExt = new SceneEditInfoExt();
+            sceneEditInfoExt.setScenePlusId(scenePlus.getId());
+            sceneEditInfoExt.setEditInfoId(sceneEditInfo.getId());
+            sceneEditInfoExtService.save(sceneEditInfoExt);
+        }
+        return new Object[]{sceneEditInfo, sceneEditInfoExt, sceneEditControls};
+    }
+
+    public void uploadHouseTypeJson(String num, String floorPlanCardFilePath) {
+        if (!new File(floorPlanCardFilePath).exists()) {
+            log.error("floorplan_cad.json 文件不存在,文件路径:{}", floorPlanCardFilePath);
+            return;
+        }
+        JSONObject json = CreateHouseJsonUtil.createHouseTypeJsonByCad(floorPlanCardFilePath);
+        String hourseTypeJsonPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "houseType.json";
+        fYunFileService.uploadFile(json.toJSONString().getBytes(), hourseTypeJsonPath);
+        hourseTypeJsonPath = String.format(UploadFilePath.DATA_EDIT_PATH, num) + "houseType.json";
+        fYunFileService.uploadFile(json.toJSONString().getBytes(), hourseTypeJsonPath);
+    }
+}

+ 3 - 0
src/main/java/com/fdkankan/contro/service/IFdkkLaserService.java

@@ -3,6 +3,7 @@ package com.fdkankan.contro.service;
 import com.fdkankan.contro.entity.Camera;
 import com.fdkankan.contro.entity.ScenePlus;
 import com.fdkankan.contro.entity.ScenePlusExt;
+import com.fdkankan.contro.entity.ScenePro;
 
 /**
  * <p>
@@ -18,4 +19,6 @@ public interface IFdkkLaserService {
     void pushBuildStatusToLaserSystem(String projectNum, String laserObjFilePath);
 
     void saveScene(ScenePlus scenePlus, String scenePassword, Camera cameraEntity, String userName, boolean b);
+
+    void saveScene(ScenePro scenePro, String scenePassword, Camera cameraEntity, String phone, boolean rebuild);
 }

+ 17 - 0
src/main/java/com/fdkankan/contro/service/ISceneProEditService.java

@@ -0,0 +1,17 @@
+package com.fdkankan.contro.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.contro.entity.SceneProEdit;
+
+/**
+ * <p>
+ * pro场景编辑数据表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2022-07-12
+ */
+public interface ISceneProEditService extends IService<SceneProEdit> {
+
+    SceneProEdit getByProId(Long proId);
+}

+ 25 - 0
src/main/java/com/fdkankan/contro/service/impl/IFdkkLaserServiceImpl.java

@@ -6,6 +6,7 @@ import com.fdkankan.common.util.FileUtils;
 import com.fdkankan.contro.entity.Camera;
 import com.fdkankan.contro.entity.ScenePlus;
 import com.fdkankan.contro.entity.ScenePlusExt;
+import com.fdkankan.contro.entity.ScenePro;
 import com.fdkankan.contro.service.IFdkkLaserService;
 import com.fdkankan.contro.service.IScenePlusService;
 import com.fdkankan.web.response.Result;
@@ -129,4 +130,28 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
         }
     }
 
+    public void saveScene(ScenePro scenePro, String scenePassword, Camera cameraEntity, String phone, boolean rebuild) {
+        String url = laserHost + String.format(SAVE_SCENE_URL_TEMPLATE, scenePro.getNum());
+        Map<String, Object> params = new HashMap<>();
+        params.put("childName", cameraEntity.getChildName());
+        params.put("createTime", DateUtil.date2String(scenePro.getCreateTime(), null));
+        params.put("phone", phone);
+        params.put("sceneCode", scenePro.getNum());
+        params.put("snCode", cameraEntity.getSnCode());
+        params.put("status", scenePro.getStatus());
+        if (!rebuild) {
+            params.put("password", scenePassword);
+        } else {
+            params.put("status", 4);
+        }
+        params.put("title", scenePro.getSceneName());
+        params.put("userId", scenePro.getUserId());
+        log.info("自研激光转台相机同步,url:{},params:{}", url, JSONObject.toJSONString(params));
+        ResponseEntity<Result> responseEntity = restTemplate.postForEntity(url, params, Result.class);
+        log.info("自研激光转台相机同步,url:{},params:{},结果,{}", url, JSONObject.toJSONString(params), JSONObject.toJSONString(responseEntity.getBody()));
+        if (responseEntity.getStatusCode() != HttpStatus.OK || responseEntity.getBody().getCode() != HttpStatus.OK.value()) {
+            log.error("激光场景状态同步失败!");
+        }
+    }
+
 }

+ 344 - 22
src/main/java/com/fdkankan/contro/service/impl/SceneFileBuildServiceImpl.java

@@ -28,12 +28,12 @@ import com.fdkankan.model.constants.UploadFilePath;
 import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
 import com.fdkankan.rabbitmq.util.RabbitMqProducer;
 import com.fdkankan.redis.util.RedisUtil;
-import com.fdkankan.web.config.FileRouteConfig;
 import com.fdkankan.web.response.ResultData;
 import com.fdkankan.web.util.RSAEncrypt;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.lang3.StringUtils;
+import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -42,7 +42,10 @@ import org.springframework.util.ObjectUtils;
 import java.io.File;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
-import java.util.*;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
 
 /**
  * <p>
@@ -67,11 +70,12 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
     @Value("${queue.modeling.modeling-pre}")
     private String queueModelingPre;
 
+    @Value("${queue.modeling.v3.modeling-pre}")
+    private String queueV3ModelingPre;
+
     @Autowired
     private RedisUtil redisUtil;
 
-    @Autowired
-    private FileRouteConfig routeConfig;
 
     @Autowired
     private IScenePlusExtService scenePlusExtService;
@@ -86,6 +90,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
     private RabbitMqProducer rabbitMqProducer;
 
     @Autowired
+    private ISceneProEditService sceneProEditService;
+
+    @Autowired
     private ISceneEditInfoService sceneEditInfoService;
     @Autowired
     private ISceneEditControlsService sceneEditControlsService;
@@ -351,6 +358,116 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         return scenePlusVO;
     }
 
+    public ScenePlusVO buildV3Scene(ScenePro scenePro,String fileId, String prefix,JSONObject jsonObject,String buildType,long cameraType) throws Exception{
+        //调用createScene方法生成scene数据和加入算法队列
+
+        String cameraName = jsonObject.getJSONObject("cam").getString("uuid");
+        String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
+
+        Camera camera = cameraService.getByChildName(cameraName);
+
+        if (camera == null) {
+            throw new BusinessException(CameraConstant.FAILURE_6003);
+        }
+
+        CameraDetail cameraDetail = cameraDetailService.getByCameraId(camera.getId());
+        if (cameraDetail == null) {
+            log.error("该相机详情不存在:" + cameraName);
+            throw new BusinessException(CameraConstant.FAILURE_6003);
+        }
+
+        String sceneNum = scenePro.getNum();
+        if (scenePro.getStatus().equals(SceneStatus.wait.code())) {
+            log.info(scenePro.getNum() + ":场景处于计算中,不能再计算");
+            return null;
+        }
+
+        String localDataPath = String.format(ConstantFilePath.DATABUFFER_FORMAT, sceneNum);
+        String imgViewPath = String.format(ConstantFilePath.IMAGE_PATH_FORMAT, sceneNum);
+        String dataViewPath = String.format(ConstantFilePath.DATA_PATH_FORMAT, sceneNum);
+
+        String userName = null;
+        if (!ObjectUtils.isEmpty(cameraDetail.getUserId())) {
+            SSOUser user = userService.getSSOUserByUserId(cameraDetail.getUserId());
+            userName = ObjectUtils.isEmpty(user) ? null : user.getUserName();
+        }
+
+        String icon = null;
+        if (!ObjectUtils.isEmpty(jsonObject.getString("icon"))) {
+            fYunFileService.copyFileInBucket(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"),imgViewPath + jsonObject.getString("icon"));
+            icon = fYunFileConfig.getHost() + imgViewPath + jsonObject.getString("icon");
+            log.info("上传icon成功....");
+        }
+
+        JSONObject firmwareVersion = new JSONObject();
+        if (!ObjectUtils.isEmpty(jsonObject.getString("camSoftwareVersion"))) {
+            firmwareVersion.put("camSoftwareVersion", jsonObject.getString("camSoftwareVersion"));
+        }
+
+        if (!ObjectUtils.isEmpty(jsonObject.getString("version"))) {
+            firmwareVersion.put("version", jsonObject.getString("version"));
+        }
+
+        String sceneUrl = mainUrl + "/" + sceneProNewUrl;
+
+        //重算的场景,先移除该场景对应的容量
+        scenePlusService.resetSpace(sceneNum);
+
+        //删除oss的houst_floor.json(国际版可能会卡住)
+        fYunFileService.deleteFile(dataViewPath + "houst_floor.json");
+
+        String algorithm = jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam";
+
+        ScenePlusVO scenePlusVO = this.createScenePro(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
+                jsonObject.getString("pwd"), unicode,cameraType, fileId, icon,  cameraDetail.getUserId(), userName,algorithm,
+                jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
+                jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), 1,
+                jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, cameraDetail.getCooperationUser());
+
+        if (Objects.nonNull(scenePlusVO)) {
+            JSONObject statusJson = new JSONObject();
+            //临时将-2改成1,app还没完全更新
+            statusJson.put("status", scenePlusVO.getSceneStatus() == -2 ? 1 : scenePlusVO.getSceneStatus());
+            statusJson.put("webSite", scenePlusVO.getWebSite());
+            statusJson.put("sceneNum", scenePlusVO.getNum());
+            statusJson.put("thumb", scenePlusVO.getThumb());
+            statusJson.put("payStatus", 0);
+            statusJson.put("recStatus", 'A');
+            FileUtils.writeFile(localDataPath + "status.json", statusJson.toString());
+            fYunFileService.uploadFile(localDataPath + "status.json", dataViewPath + "status.json");
+        }
+        if (cameraDetail.getCompanyId() != null) {
+            Company company = companyService.getById(cameraDetail.getCompanyId());
+            if (company != null) {
+                log.info("复制企业logo");
+                SceneProEdit sceneEditInfo = sceneProEditService.getByProId(scenePlusVO.getId());
+                if (StrUtil.isNotEmpty(company.getTopLogo())) {
+                    fYunFileService.copyFileInBucket(company.getTopLogo(),imgViewPath + "logo-main.png");
+                }
+                if (StrUtil.isNotEmpty(company.getFloorLogo())) {
+                    fYunFileService.copyFileInBucket(company.getFloorLogo(),imgViewPath + "floorLogoImg.png");
+                    sceneEditInfo.setFloorLogo("user");
+                }
+
+                if (StrUtil.isNotEmpty(company.getQrLogo())) {
+                    //生成新的分享的二维码
+                    MatrixToImageWriterUtil.createQRCode(sceneUrl + sceneNum, ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/" + sceneNum + ".png",
+                            false, ConstantFilePath.SCENE_PATH + imgViewPath + "QRShareLogo.png");
+                    MatrixToImageWriterUtil.createQRCode(sceneUrl + sceneNum + "&lang=en", ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/" + sceneNum + "_en.png",
+                            false, ConstantFilePath.SCENE_PATH + imgViewPath + "QRShareLogo.png");
+                }
+                sceneProEditService.updateById(sceneEditInfo);
+            }
+
+        }
+
+        BuildSceneCallMessage mqMessage = getBuildSceneMqMessage(sceneNum, cameraType, algorithm, jsonObject.getInteger("resolution"), buildType,
+                scenePlusVO.getDataSource());
+        rabbitMqProducer.sendByWorkQueue(queueV3ModelingPre, mqMessage);
+
+        return scenePlusVO;
+    }
+
     @Override
     public ResultData uploadSuccessBuild(String params) throws Exception {
         log.info("uploadSuccessBuild-params: " + params);
@@ -398,7 +515,14 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
                 cameraType = 11L;
             }
         }
-        buildScene(fileId, prefixBuffer.toString(),fdageJson,buildType,cameraType);
+        // 判断是否是V3的场景
+        ScenePro scenePro = sceneProService.getOne(
+                new LambdaQueryWrapper<ScenePro>().like(ScenePro::getDataSource, fileId));
+        if (ObjectUtils.isEmpty(scenePro) || (!ObjectUtils.isEmpty(scenePro.getIsUpgrade()) && scenePro.getIsUpgrade() == 1)) {
+            buildScene(fileId, prefixBuffer.toString(),fdageJson,buildType,cameraType);
+        }else{
+            buildV3Scene(scenePro,fileId, prefixBuffer.toString(),fdageJson,buildType,cameraType);
+        }
         return ResultData.ok();
     }
 
@@ -434,18 +558,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             redisUtil.set(String.format(RedisConstants.FILEID_FOLDER_BUILD, fileId), folderName);
         }
 
-        //判断 是否为激光相机
-        Camera camera = cameraService.getByChildName(mac);
-        CameraDetail cameraDetail = cameraDetailService.getByCameraId(camera.getId());
-        String hardDisk = routeConfig.getHardDisk();
-        if(cameraDetail!=null){
-            if(cameraDetail.getType() == 10){
-                hardDisk = routeConfig.getHardDiskLaser();
-            }
-        }
-
-        log.info("相机 mnt 路径 : " + hardDisk + ", 相机类型 : " + cameraDetail.getType());
-
         //云目录
         StringBuilder prefixBuffer = new StringBuilder(mac).append(File.separator).append(fileId).append(File.separator).append(folderName).append(File.separator);
 
@@ -463,7 +575,19 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             //激光转台
             cameraType = 14L;
         }
-        ScenePlusVO scenePlusVO = buildScene(fileId, prefixBuffer.toString(), fdageJson, buildType, cameraType);
+
+        ScenePlusVO scenePlusVO = null;
+
+        // 判断是否是V3的场景
+        ScenePro scenePro = sceneProService.getOne(
+                new LambdaQueryWrapper<ScenePro>().like(ScenePro::getDataSource, fileId));
+        if (ObjectUtils.isEmpty(scenePro) || (!ObjectUtils.isEmpty(scenePro.getIsUpgrade()) && scenePro.getIsUpgrade() == 1)) {
+            scenePlusVO = buildScene(fileId, prefixBuffer.toString(), fdageJson, buildType, cameraType);
+        } else {
+            scenePlusVO = buildV3Scene(scenePro,fileId, prefixBuffer.toString(), fdageJson, buildType, cameraType);
+        }
+
+
         if(ObjectUtils.isEmpty(scenePlusVO)){
             return ResultData.ok();
         }
@@ -475,7 +599,13 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             if(!ObjectUtils.isEmpty(sceneUserId)){
                 userName = userService.getSSOUserByUserId(sceneUserId).getUserName();
             }
-            fdkkLaserService.saveScene(scenePlus,fdageJson.getString("pwd"),camera,userName,false);
+            //判断 是否为激光相机
+            Camera camera = cameraService.getByChildName(mac);
+            if(!ObjectUtils.isEmpty(scenePlus)){
+                fdkkLaserService.saveScene(scenePlus,fdageJson.getString("pwd"),camera,userName,false);
+            }else{
+                fdkkLaserService.saveScene(scenePro,fdageJson.getString("pwd"),camera,userName,false);
+            }
         }
         return ResultData.ok();
     }
@@ -495,14 +625,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         scenePlus.setPhoneId(phoneId);
         scenePlus.setNum(projectNum);
 
-        String path =  ConstantFilePath.BUILD_MODEL_PATH + unicode;
-
         scenePlus.setSceneSource(1);
          if(cameraType.longValue() == 14){
             scenePlusExt.setDataSource(ConstantFilePath.BUILD_MODEL_LASER_PATH +
                     cameraName.replace("4DKKPRO_", "").replace("-fdage", "").toLowerCase() + File.separator +
                     fileId + File.separator + unicode);
-            path =  ConstantFilePath.BUILD_MODEL_LASER_PATH + unicode;
         }else{
             scenePlusExt.setDataSource(ConstantFilePath.BUILD_MODEL_PATH +
                     cameraName.replace("4DKKPRO_", "").replace("-fdage", "").toLowerCase() + File.separator +
@@ -660,6 +787,201 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         return scenePlusVO;
     }
 
+    public ScenePlusVO createScenePro(String projectNum, Long cameraId, String cameraName, String phoneId, String sceneKey,
+                                       String unicode, Long cameraType, String fileId, String pic, Long userId, String userName,
+                                       String algorithm, Integer sceneShootCount, String sceneName,
+                                       String sceneDec, Integer sceneType, String gps,Integer type,
+                                       Integer resolution, String firmwareVersion, String url, String buildType,
+                                       Long cooperationUser)throws Exception{
+
+
+        ScenePro scene = sceneProService.getByNum(projectNum);
+        SceneProEdit sceneEdit = sceneProEditService.getByProId(scene.getId());
+
+        //先返回链接地址
+        scene.setWebSite(url+projectNum);
+        scene.setCameraId(cameraId);
+        scene.setPhoneId(phoneId);
+        scene.setNum(projectNum);
+
+        scene.setSceneSource(1);
+        if(cameraType.longValue() == 5 || cameraType.longValue() == 6){
+            //场景来源双目相机
+            scene.setSceneSource(2);
+            scene.setDataSource(ConstantFilePath.BUILD_MODEL_PATH + unicode);
+        }else if(cameraType.longValue() == 14){
+
+            scene.setDataSource(ConstantFilePath.BUILD_MODEL_LASER_PATH +
+                    cameraName.replace("4DKKPRO_", "").replace("-fdage", "").toLowerCase() + File.separator +
+                    fileId + File.separator + unicode);
+            log.info("激光相机 dataSource :" + scene.getDataSource());
+
+        }else if(cameraType.longValue() >= 3){
+            scene.setDataSource(ConstantFilePath.BUILD_MODEL_PATH +
+                    cameraName.replace("4DKKPRO_", "").replace("-fdage", "").toLowerCase() + File.separator +
+                    fileId + File.separator + unicode);
+        }
+
+        if(resolution == null || resolution.intValue() == 0){
+            scene.setSceneScheme(cameraType.intValue());
+        }else {
+            scene.setSceneScheme(4);
+        }
+
+        //场景来源双目相机,sceneScheme为4,加载high,low图
+        if(cameraType.longValue() == 5 || cameraType.longValue() == 6){
+            scene.setSceneScheme(4);
+        }
+
+        //转台相机用4k图
+        if(cameraType.longValue() == 13 ){
+            scene.setSceneSource(3);
+            scene.setSceneScheme(10);
+        }
+
+        //激光相机
+        if(cameraType.longValue() == 14 ){
+            scene.setSceneSource(4);
+            scene.setSceneScheme(10);
+        }
+
+        if(pic!=null&&pic.length()>5)
+        {
+            scene.setThumb(pic);
+        }
+        else
+        {
+            scene.setThumb(ConstantUrl.DEFAULT_SCENE_PIC);
+        }
+        scene.setThumb(scene.getThumb().concat("?t=")+System.currentTimeMillis());
+
+        if(!ObjectUtils.isEmpty(userName)){
+            scene.setUserId(userId);
+        }
+
+        if(sceneShootCount == null)
+        {
+            scene.setShootCount(0);
+        }
+        else
+        {
+            scene.setShootCount(sceneShootCount);
+        }
+        if(sceneName!=null)
+        {
+            scene.setSceneName(sceneName);
+        }
+        if(sceneDec!=null)
+        {
+            scene.setSceneDec("<p>"+ new String(sceneDec.getBytes("UTF-8"))+"</p>");
+        }
+
+        if(sceneType!=null)
+        {
+            scene.setSceneType(sceneType);
+        }
+
+        if(gps!=null&&!gps.trim().equals(""))
+        {
+            scene.setGps(gps);
+        }
+
+        scene.setAlgorithm(algorithm);
+        if(!org.springframework.util.StringUtils.isEmpty(firmwareVersion)){
+            scene.setFirmwareVersion(firmwareVersion);
+        }
+        scene.setBuildType(buildType);
+        log.info("场景记录添加到数据库:"+projectNum);
+
+        scene.setStatus(0);
+        scene.setPayStatus(0);
+        scene.setRecStatus("A");
+        scene.setCreateTime(new Date());
+        if (sceneName != null) {
+            scene.setSceneName(sceneName);
+        }
+        if (sceneType != null) {
+            scene.setSceneType(sceneType);
+        }
+        sceneProService.updateById(scene);
+
+        sceneEdit.setNeedKey(0);
+        if (cameraType.longValue() != 14 && !ObjectUtils.isEmpty(sceneKey)) {
+            sceneEdit.setNeedKey(1);
+            sceneEdit.setSceneKey(sceneKey);
+        }
+        sceneEdit.setProId(scene.getId());
+        sceneEdit.setMapVisi(1);
+        sceneEdit.setTourVisi(1);
+        sceneEdit.setVrVisi(1);
+        sceneEdit.setCadImgVisi(1);
+        sceneEdit.setPanoVisi(1);
+        sceneEdit.setOverlay(null);
+        sceneEdit.setM2dVisi(1);
+        sceneEdit.setPlayData(null);
+        sceneEdit.setFloorLogo("0");
+        sceneEdit.setM3dVisi(1);
+        sceneEdit.setJumpScene(false);
+        sceneEdit.setMeasureVisi(0);
+        sceneEdit.setFloorLogoSize(100);
+        sceneEdit.setUpdateTime(new Date());
+        sceneEdit.setRecStatus("A");
+        sceneEdit.setFloorPublishVer(sceneEdit.getFloorEditVer() + 1);
+        sceneEdit.setFloorEditVer(sceneEdit.getFloorEditVer() + 1);
+        sceneEdit.setVersion(sceneEdit.getVersion() + 1);
+        sceneEdit.setImagesVersion(sceneEdit.getImagesVersion() + 1);
+
+        sceneProEditService.updateById(sceneEdit);
+
+
+        JSONObject scenejson = JSONObject.parseObject(JSONObject.toJSONString(scene));
+        scenejson.put("thumbImg", 0);
+        scenejson.put("version", sceneEdit.getVersion());
+        scenejson.put("floorLogo", 0);
+        if(!ObjectUtils.isEmpty(sceneKey)){
+            scenejson.put("sceneKey", sceneKey);
+            scenejson.put("public", 1);
+        }else{
+            scenejson.put("sceneKey", "");
+            scenejson.put("public", 0);
+        }
+        if(cameraType.longValue() < 4 || cameraType.longValue() == 5 || cameraType.longValue() == 6){
+            scenejson.put("visions", 1);
+        }else {
+            scenejson.put("visions", 2);
+        }
+        scenejson.put("createTime", new DateTime(new Date()).toString("yyyy-MM-dd HH:mm"));
+
+        scenejson.put("floorPublishVer", sceneEdit.getFloorPublishVer());
+        scenejson.put("floorEditVer", sceneEdit.getFloorEditVer());
+        scenejson.put("rulerVisi", sceneEdit.getRulerVisi());
+        scenejson.put("entry", null);
+
+        if(!org.springframework.util.StringUtils.isEmpty(sceneEdit.getHotsIds())){
+            scenejson.put("hots", 1);
+        }
+
+        File file = new File(ConstantFilePath.SCENE_PATH+"data/data"+projectNum);
+        if(!file.exists()||!file.isDirectory())
+        {
+            file.mkdirs();
+        }
+        FileUtils.writeFile(ConstantFilePath.SCENE_PATH+"data/data"+projectNum+File.separator+"scene.json", scenejson.toString());
+
+        //生成二维码
+        MatrixToImageWriterUtil.createQRCode(url + projectNum, ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+projectNum+".png",false, null);
+        MatrixToImageWriterUtil.createQRCode(url + projectNum + "&lang=en", ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+projectNum+"_en.png",false, null);
+        log.info("二维码生成完成");
+
+        ScenePlusVO scenePlusVO = new ScenePlusVO();
+        scenePlusVO.setSceneStatus(scene.getStatus());
+        scenePlusVO.setThumb(scene.getThumb());
+        scenePlusVO.setPayStatus(scene.getPayStatus());
+        scenePlusVO.setId(scene.getId());
+        scenePlusVO.setNum(scene.getNum());
+        return scenePlusVO;
+    }
+
     public BuildSceneCallMessage getBuildSceneMqMessage(String projectNum,
                                                         Long cameraType, String algorithm, Integer resolution,
                                                         String buildType, String dataSource) {

+ 33 - 0
src/main/java/com/fdkankan/contro/service/impl/SceneProEditServiceImpl.java

@@ -0,0 +1,33 @@
+package com.fdkankan.contro.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.contro.entity.SceneProEdit;
+import com.fdkankan.contro.mapper.ISceneProEditMapper;
+import com.fdkankan.contro.service.ISceneProEditService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * pro场景编辑数据表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2022-07-12
+ */
+@Service
+public class SceneProEditServiceImpl extends ServiceImpl<ISceneProEditMapper, SceneProEdit> implements ISceneProEditService {
+
+    @Override
+    public SceneProEdit getByProId(Long proId) {
+        LambdaQueryWrapper<SceneProEdit> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(SceneProEdit::getProId,proId);
+        List<SceneProEdit> list = this.list(wrapper);
+        if(list != null && list.size() >0){
+            return list.get(0);
+        }
+        return null;
+    }
+}