ソースを参照

Merge branch 'project-jmga-2.2.0-2.0.1' into project-jmga-dev

# Conflicts:
#	src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java
dengsixing 1 ヶ月 前
コミット
cb5b7c49a5
49 ファイル変更1372 行追加123 行削除
  1. 7 0
      pom.xml
  2. 1 1
      src/main/java/com/fdkankan/contro/controller/DetectType.java
  3. 8 7
      src/main/java/com/fdkankan/contro/controller/SceneFileController.java
  4. 36 0
      src/main/java/com/fdkankan/contro/controller/SceneOrigBdController.java
  5. 51 0
      src/main/java/com/fdkankan/contro/dto/UploadSceneDTO.java
  6. 111 0
      src/main/java/com/fdkankan/contro/entity/BuildLog.java
  7. 6 0
      src/main/java/com/fdkankan/contro/entity/SceneFileBuild.java
  8. 55 0
      src/main/java/com/fdkankan/contro/entity/SceneFilename.java
  9. 93 0
      src/main/java/com/fdkankan/contro/entity/SceneOrigBd.java
  10. 11 0
      src/main/java/com/fdkankan/contro/entity/ScenePlus.java
  11. 7 7
      src/main/java/com/fdkankan/contro/entity/ScenePlusExt.java
  12. 39 0
      src/main/java/com/fdkankan/contro/httpclient/CustomHttpClient.java
  13. 19 0
      src/main/java/com/fdkankan/contro/httpclient/HaixinClient.java
  14. 18 0
      src/main/java/com/fdkankan/contro/mapper/IBuildLogMapper.java
  15. 3 0
      src/main/java/com/fdkankan/contro/mapper/ISceneBuildProcessLogMapper.java
  16. 18 0
      src/main/java/com/fdkankan/contro/mapper/ISceneFilenameMapper.java
  17. 18 0
      src/main/java/com/fdkankan/contro/mapper/ISceneOrigBdMapper.java
  18. 10 8
      src/main/java/com/fdkankan/contro/mq/listener/UploadShootingListener.java
  19. 16 0
      src/main/java/com/fdkankan/contro/mq/service/IBuildLogService.java
  20. 20 0
      src/main/java/com/fdkankan/contro/mq/service/impl/BuildLogServiceImpl.java
  21. 26 21
      src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java
  22. 13 0
      src/main/java/com/fdkankan/contro/schedule/ScheduleJob.java
  23. 13 0
      src/main/java/com/fdkankan/contro/service/IAiService.java
  24. 12 0
      src/main/java/com/fdkankan/contro/service/IHaixinService.java
  25. 2 0
      src/main/java/com/fdkankan/contro/service/IJmgaService.java
  26. 4 0
      src/main/java/com/fdkankan/contro/service/ISceneBuildProcessLogService.java
  27. 1 1
      src/main/java/com/fdkankan/contro/service/ISceneFileBuildService.java
  28. 16 0
      src/main/java/com/fdkankan/contro/service/ISceneFilenameService.java
  29. 19 0
      src/main/java/com/fdkankan/contro/service/ISceneOrigBdService.java
  30. 4 0
      src/main/java/com/fdkankan/contro/service/IScenePlusService.java
  31. 8 0
      src/main/java/com/fdkankan/contro/service/MjService.java
  32. 142 0
      src/main/java/com/fdkankan/contro/service/impl/AiServiceImpl.java
  33. 1 1
      src/main/java/com/fdkankan/contro/service/impl/CommonServiceImpl.java
  34. 130 0
      src/main/java/com/fdkankan/contro/service/impl/HaixinServiceImpl.java
  35. 88 8
      src/main/java/com/fdkankan/contro/service/impl/JmgaServiceImpl.java
  36. 136 0
      src/main/java/com/fdkankan/contro/service/impl/MjServiceImpl.java
  37. 5 1
      src/main/java/com/fdkankan/contro/service/impl/OrigFileUploadServiceImpl.java
  38. 7 1
      src/main/java/com/fdkankan/contro/service/impl/SceneBuildProcessLogServiceImpl.java
  39. 105 55
      src/main/java/com/fdkankan/contro/service/impl/SceneFileBuildServiceImpl.java
  40. 20 0
      src/main/java/com/fdkankan/contro/service/impl/SceneFilenameServiceImpl.java
  41. 1 1
      src/main/java/com/fdkankan/contro/service/impl/SceneMarkShapeServiceImpl.java
  42. 24 0
      src/main/java/com/fdkankan/contro/service/impl/SceneOrigBdServiceImpl.java
  43. 5 0
      src/main/java/com/fdkankan/contro/service/impl/ScenePlusServiceImpl.java
  44. 11 9
      src/main/java/com/fdkankan/contro/service/impl/UploadShootingServiceImpl.java
  45. 16 0
      src/main/java/com/fdkankan/contro/util/ExcelUtil.java
  46. 2 2
      src/main/resources/logback-nacos.xml
  47. 4 0
      src/main/resources/mapper/contro/SceneBuildProcessLogMapper.xml
  48. 5 0
      src/main/resources/mapper/contro/SceneFilenameMapper.xml
  49. 5 0
      src/main/resources/mapper/contro/SceneOrigBdMapper.xml

+ 7 - 0
pom.xml

@@ -195,6 +195,13 @@
       <version>1.5.19</version>
       <version>1.5.19</version>
     </dependency>
     </dependency>
 
 
+
+    <dependency>
+      <groupId>com.alibaba</groupId>
+      <artifactId>easyexcel</artifactId>
+      <version>4.0.3</version>
+    </dependency>
+
   </dependencies>
   </dependencies>
   <build>
   <build>
     <finalName>${artifactId}</finalName>
     <finalName>${artifactId}</finalName>

+ 1 - 1
src/main/java/com/fdkankan/contro/controller/DetectType.java

@@ -1,4 +1,4 @@
-package com.fdkankan.contro.controller;
+package com.fdkankan.contro.constant;
 
 
 /**
 /**
  * 用户状态
  * 用户状态

+ 8 - 7
src/main/java/com/fdkankan/contro/controller/SceneFileController.java

@@ -226,7 +226,7 @@ public class SceneFileController{
             return ResultData.ok();
             return ResultData.ok();
         }
         }
 
 
-        return sceneFileBuildService.noticeBuild(detail.getUuid());
+        return sceneFileBuildService.noticeBuild(detail.getUuid(), null, null, "single");
     }
     }
 
 
     @PostMapping("/send_bd")
     @PostMapping("/send_bd")
@@ -261,14 +261,15 @@ public class SceneFileController{
             @RequestPart SendCallAlgorithmDetail details) throws Exception {
             @RequestPart SendCallAlgorithmDetail details) throws Exception {
 
 
         String parentPath = "/oss/4dkankan/bd_server/upload_while_shooting/" + details.getUuid() + "/";
         String parentPath = "/oss/4dkankan/bd_server/upload_while_shooting/" + details.getUuid() + "/";
-        String localPath = parentPath + details.getIndex() + details.getFileName();
-        FileUtil.mkParentDirs(localPath);
-        String url = "https://survey.4dkankan.com"  + localPath.replace("4dkankan/", "");
-        if(details.getFileName().equals("data.fdage")){
-            file.transferTo(new File(parentPath + details.getFileName()));
+        String localPath = null;
+        if(details.getIndex() != -1){
+            localPath = parentPath + details.getIndex() + "/" + details.getFileName();
         }else{
         }else{
-            file.transferTo(new File(localPath));
+            localPath = parentPath + details.getFileName();
         }
         }
+        FileUtil.mkParentDirs(localPath);
+        String url = "https://survey.4dkankan.com"  + localPath.replace("4dkankan/", "");
+        file.transferTo(new File(localPath));
 
 
         SendCallAlgorithmParam param = new SendCallAlgorithmParam();
         SendCallAlgorithmParam param = new SendCallAlgorithmParam();
         param.setFilepath(url);
         param.setFilepath(url);

+ 36 - 0
src/main/java/com/fdkankan/contro/controller/SceneOrigBdController.java

@@ -0,0 +1,36 @@
+package com.fdkankan.contro.controller;
+
+
+import com.fdkankan.contro.dto.UploadSceneDTO;
+import com.fdkankan.contro.service.IHaixinService;
+import com.fdkankan.web.response.ResultData;
+import org.springframework.beans.factory.annotation.Autowired;
+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.RestController;
+
+import javax.validation.Valid;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2025-05-07
+ */
+@RestController
+@RequestMapping("/api/scene/bd")
+public class SceneOrigBdController {
+
+    @Autowired
+    private IHaixinService haixinService;
+
+    @PostMapping("uploadScene")
+    public ResultData uploadScene(@RequestBody @Valid UploadSceneDTO dto) throws Exception {
+        return haixinService.uploadScene(dto);
+    }
+
+}
+

+ 51 - 0
src/main/java/com/fdkankan/contro/dto/UploadSceneDTO.java

@@ -0,0 +1,51 @@
+package com.fdkankan.contro.dto;
+
+import cn.hutool.crypto.digest.MD5;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+@Data
+public class UploadSceneDTO {
+
+    /**
+     * 原始资源压缩包url
+     */
+    @NotBlank(message = "fileUrl不能为空")
+    private String fileUrl;
+
+    @NotBlank(message = "项目号不能为空")
+    private String taskId;
+
+//    @NotBlank(message = "案件号不能为空")
+    private String kNo;
+
+    private String ryId;
+
+    private String ryNo;
+
+    private String password;
+
+    private String ryPhone;
+
+    private String ryCid;
+
+    private String ryName;
+
+    public String getkNo() {
+        return kNo;
+    }
+
+    public String setkNo(String kNo) {
+        return this.kNo = kNo;
+    }
+
+    public static void main(String[] args) {
+        String s = MD5.create().digestHex("Aa123456789");
+        System.out.println(s);
+    }
+
+
+
+
+}

+ 111 - 0
src/main/java/com/fdkankan/contro/entity/BuildLog.java

@@ -0,0 +1,111 @@
+package com.fdkankan.contro.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author
+ * @since 2022-04-07
+ */
+@Getter
+@Setter
+@TableName("t_build_log")
+public class BuildLog implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 消息id
+     */
+    @TableField("message_id")
+    private String messageId;
+
+    /**
+     * 消息id
+     */
+    @TableField("content")
+    private String content;
+
+    /**
+     * 场景码
+     */
+    @TableField("scene_num")
+    private String sceneNum;
+
+    /**
+     * 资源路径
+     */
+    @TableField("data_source")
+    private String dataSource;
+
+    /**
+     * 主题名称
+     */
+    @TableField("queue_name")
+    private String queueName;
+
+    /**
+     * ModelingBuildStatus
+     */
+    @TableField("status")
+    private Integer status;
+
+    /**
+     * 服务器名称
+     */
+    @TableField("host_name")
+    private String hostName;
+
+    /**
+     * 计算类型
+     * 0:场景计算
+     * 1:标定算法,
+     * 2:只生激光场景OBJ文件
+     * 3:生成e57
+     */
+    @TableField("build_type")
+    private Integer buildType;
+
+    /**
+     * 计算耗时
+     */
+    @TableField("duration")
+    private Long duration;
+
+    /**
+     * 开始计算时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 结束计算时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * 结束计算时间
+     */
+    @TableField("result_queue_name")
+    private String resultQuequeName;
+
+    @TableField("rec_status")
+    @TableLogic(value = "A", delval = "I")
+    private String recStatus;
+
+}

+ 6 - 0
src/main/java/com/fdkankan/contro/entity/SceneFileBuild.java

@@ -83,5 +83,11 @@ public class SceneFileBuild implements Serializable {
     @TableLogic("A")
     @TableLogic("A")
     private String recStatus;
     private String recStatus;
 
 
+    @TableField("task_id")
+    private String taskId;
+
+    @TableField("k_no")
+    private String kNo;
+
 
 
 }
 }

+ 55 - 0
src/main/java/com/fdkankan/contro/entity/SceneFilename.java

@@ -0,0 +1,55 @@
+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.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2025-05-07
+ */
+@Getter
+@Setter
+@TableName("t_scene_filename")
+public class SceneFilename implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 场景码
+     */
+    @TableField("num")
+    private String num;
+
+    /**
+     * 文件名
+     */
+    @TableField("filename")
+    private String filename;
+
+    /**
+     * unicode
+     */
+    @TableField("unicode")
+    private String unicode;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+
+}

+ 93 - 0
src/main/java/com/fdkankan/contro/entity/SceneOrigBd.java

@@ -0,0 +1,93 @@
+package com.fdkankan.contro.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author
+ * @since 2025-02-13
+ */
+@Getter
+@Setter
+@TableName("t_scene_orig_bd")
+public class SceneOrigBd implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 原始资源url
+     */
+    @TableField("file_url")
+    private String fileUrl;
+
+    /**
+     * 案件号
+     */
+    @TableField("task_id")
+    private String taskId;
+
+    /**
+     * 勘探号
+     */
+    @TableField("k_no")
+    private String kNo;
+
+    /**
+     * 处理状态(-1-处理失败,0-等待中,1-成功推送计算)
+     */
+    @TableField("status")
+    private Integer status;
+
+    @TableField("reason")
+    private String reason;
+
+    /**
+     * 删除状态
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A", delval = "I")
+    private String recStatus;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    @TableField("ry_no")
+    private String ryNo;
+
+    @TableField("ry_id")
+    private String ryId;
+
+    @TableField("password")
+    private String password;
+
+    @TableField("ry_phone")
+    private String ryPhone;
+
+    @TableField("ry_cid")
+    private String ryCid;
+
+    @TableField("ry_name")
+    private String ryName;
+
+
+}

+ 11 - 0
src/main/java/com/fdkankan/contro/entity/ScenePlus.java

@@ -128,6 +128,17 @@ public class ScenePlus implements Serializable {
     @TableLogic("A")
     @TableLogic("A")
     private String recStatus;
     private String recStatus;
 
 
+    @TableField("other_type")
+    private String otherType;
+
+    @TableField("source_id")
+    private Long sourceId;
+
+    @TableField("task_id")
+    private String taskId;
+
+    @TableField("k_no")
+    private String kNo;
 
 
     /**
     /**
      * 是否有平面图i识别
      * 是否有平面图i识别

+ 7 - 7
src/main/java/com/fdkankan/contro/entity/ScenePlusExt.java

@@ -1,15 +1,12 @@
 package com.fdkankan.contro.entity;
 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 com.baomidou.mybatisplus.annotation.*;
 import lombok.Getter;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.Setter;
 
 
+import java.io.Serializable;
+import java.util.Date;
+
 /**
 /**
  * <p>
  * <p>
  *
  *
@@ -188,6 +185,9 @@ public class ScenePlusExt implements Serializable {
     @TableField("is_obj")
     @TableField("is_obj")
     private int isObj;
     private int isObj;
 
 
+    @TableField("has_recognition")
+    private Integer hasRecognition;
+
     @TableField("orientation")
     @TableField("orientation")
     private String orientation;
     private String orientation;
 }
 }

+ 39 - 0
src/main/java/com/fdkankan/contro/httpclient/CustomHttpClient.java

@@ -0,0 +1,39 @@
+package com.fdkankan.contro.httpclient;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.dtflys.forest.annotation.*;
+import com.dtflys.forest.extensions.DownloadFile;
+import com.fdkankan.web.response.ResultData;
+
+import java.io.InputStream;
+import java.util.Map;
+
+public interface CustomHttpClient {
+
+    @Post(url = "{url}", connectTimeout = 30000,  readTimeout = 30000, maxRetryInterval = 5)
+    JSONObject postJson(@Var("url") String url, @JSONBody Object object);
+
+    @Post(url = "{url}", connectTimeout = 30000,  readTimeout = 30000, maxRetryInterval = 5)
+    JSONObject postJson(@Var("url") String url, @Header Map<String, String> headers, @JSONBody Object object);
+
+    @Post(url = "{url}", connectTimeout = 30000,  readTimeout = 30000, maxRetryInterval = 5)
+    JSONObject post(@Header Map<String, String> headers, @Var("url") String url);
+
+    @Post(url = "{url}", connectTimeout = 30000,  readTimeout = 30000, maxRetryInterval = 5)
+    ResultData post(@Var("url") String url, @Body("params") String params);
+
+    /**
+     * 返回类型用InputStream,用流的方式读取文件内容
+     */
+    @GetRequest(url = "{url}", connectTimeout = 6000, readTimeout = 60000, maxRetryInterval = 5)
+    InputStream downloadFileToInputStream(@Var("url") String url);
+
+    @GetRequest(url = "{url}", connectTimeout = 60000, readTimeout = 600000, maxRetryInterval = 5)
+    @DownloadFile(dir = "{dir}", filename = "{fileName}")
+    void downloadFile(@Var("url") String url, @Var("dir") String dir, @Var("fileName") String fileName);
+
+    @Post(url="{url}", readTimeout = 60*60*1000, connectTimeout = 60*60*1000, timeout = 60*60*1000, maxRetryInterval = 5)
+    JSONObject upload(@Var("url")String url, @Header Map<String, String> headers, @DataFile("file") String filePath, @Body Object param);
+
+}

+ 19 - 0
src/main/java/com/fdkankan/contro/httpclient/HaixinClient.java

@@ -0,0 +1,19 @@
+package com.fdkankan.contro.httpclient;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.dtflys.forest.annotation.DataFile;
+import com.dtflys.forest.annotation.JSONBody;
+import com.dtflys.forest.annotation.Post;
+import com.dtflys.forest.annotation.Var;
+import com.fdkankan.web.response.ResultData;
+
+public interface HaixinClient {
+
+    @Post(url = "${url}", readTimeout = 60*60*1000, connectTimeout = 60*60*1000, timeout = 60*60*1000, maxRetryInterval = 5)
+    ResultData postJson(@Var("url") String url, @JSONBody Object param);
+
+    @Post(url="{url}", readTimeout = 60*60*1000, connectTimeout = 60*60*1000, timeout = 60*60*1000, maxRetryInterval = 5)
+    JSONObject uploadToFdfs(@Var("url")String url, @DataFile("file") String filePath);
+
+}

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

@@ -0,0 +1,18 @@
+package com.fdkankan.contro.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fdkankan.contro.entity.BuildLog;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2022-04-07
+ */
+@Mapper
+public interface IBuildLogMapper extends BaseMapper<BuildLog> {
+
+}

+ 3 - 0
src/main/java/com/fdkankan/contro/mapper/ISceneBuildProcessLogMapper.java

@@ -4,6 +4,8 @@ import com.fdkankan.contro.entity.SceneBuildProcessLog;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 
 
+import java.util.List;
+
 /**
 /**
  * <p>
  * <p>
  * 场景计算流程状态表 Mapper 接口
  * 场景计算流程状态表 Mapper 接口
@@ -15,4 +17,5 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 @Mapper
 public interface ISceneBuildProcessLogMapper extends BaseMapper<SceneBuildProcessLog> {
 public interface ISceneBuildProcessLogMapper extends BaseMapper<SceneBuildProcessLog> {
 
 
+    List<SceneBuildProcessLog> listByNum(String num);
 }
 }

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

@@ -0,0 +1,18 @@
+package com.fdkankan.contro.mapper;
+
+import com.fdkankan.contro.entity.SceneFilename;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2025-05-07
+ */
+@Mapper
+public interface ISceneFilenameMapper extends BaseMapper<SceneFilename> {
+
+}

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

@@ -0,0 +1,18 @@
+package com.fdkankan.contro.mapper;
+
+import com.fdkankan.contro.entity.SceneOrigBd;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2025-05-07
+ */
+@Mapper
+public interface ISceneOrigBdMapper extends BaseMapper<SceneOrigBd> {
+
+}

+ 10 - 8
src/main/java/com/fdkankan/contro/mq/listener/UploadShootingListener.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.common.constant.CommonStatus;
 import com.fdkankan.common.constant.CommonStatus;
 import com.fdkankan.common.constant.CommonSuccessStatus;
 import com.fdkankan.common.constant.CommonSuccessStatus;
 import com.fdkankan.common.constant.SceneStatus;
 import com.fdkankan.common.constant.SceneStatus;
+import com.fdkankan.contro.constant.RedisConstants;
 import com.fdkankan.contro.entity.*;
 import com.fdkankan.contro.entity.*;
 import com.fdkankan.contro.service.*;
 import com.fdkankan.contro.service.*;
 import com.fdkankan.contro.util.HttpUtilExt;
 import com.fdkankan.contro.util.HttpUtilExt;
@@ -77,15 +78,15 @@ public class UploadShootingListener {
                 return;
                 return;
             }
             }
 
 
-            Set<Integer> indexs = new HashSet<>();
+            Set<String> indexs = new HashSet<>();
             String basePath = ConstantFilePath.BUILD_MODEL_PATH + "upload_while_shooting/" + uuid + "/";
             String basePath = ConstantFilePath.BUILD_MODEL_PATH + "upload_while_shooting/" + uuid + "/";
             //遍历检查点位相关文件是否齐全,如果齐全改为进入计算
             //遍历检查点位相关文件是否齐全,如果齐全改为进入计算
             List<OrigFileUploadBatch> updateList = new ArrayList<>();
             List<OrigFileUploadBatch> updateList = new ArrayList<>();
             for (OrigFileUploadBatch batch : batches) {
             for (OrigFileUploadBatch batch : batches) {
                 List<OrigFileUpload> fileUploadList = origFileUploadService.getByBatchId(batch.getBatchId());
                 List<OrigFileUpload> fileUploadList = origFileUploadService.getByBatchId(batch.getBatchId());
                 String workPath = basePath;
                 String workPath = basePath;
-                if(index != -1){
-                    workPath = workPath + index + "/";
+                if(batch.getPtIndex() != -1){
+                    workPath = workPath + batch.getPtIndex() + "/";
                 }
                 }
                 //下载文件
                 //下载文件
                 for (OrigFileUpload origFileUpload : fileUploadList) {
                 for (OrigFileUpload origFileUpload : fileUploadList) {
@@ -96,7 +97,7 @@ public class UploadShootingListener {
                     //如果是点位上传批次,需要校验文件上传是否齐全
                     //如果是点位上传批次,需要校验文件上传是否齐全
                     boolean lackFille = uploadShootingService.checkLackFille(batch.getPtIndex(), fileUploadList);
                     boolean lackFille = uploadShootingService.checkLackFille(batch.getPtIndex(), fileUploadList);
                     if(!lackFille){
                     if(!lackFille){
-                        indexs.add(batch.getPtIndex());
+                        indexs.add(String.valueOf(batch.getPtIndex()));
                         updateList.add(batch);
                         updateList.add(batch);
                     }
                     }
                 }else{
                 }else{
@@ -107,6 +108,7 @@ public class UploadShootingListener {
             JSONObject playLoad = new JSONObject();
             JSONObject playLoad = new JSONObject();
             playLoad.put("uuid", uuid);
             playLoad.put("uuid", uuid);
             playLoad.put("path", basePath);
             playLoad.put("path", basePath);
+            playLoad.put("sceneCode", num);
             if(indexs.size() > 0){
             if(indexs.size() > 0){
                 playLoad.put("indexs", indexs);
                 playLoad.put("indexs", indexs);
             }else if(index == -1){
             }else if(index == -1){
@@ -119,12 +121,12 @@ public class UploadShootingListener {
             if(CollUtil.isNotEmpty(updateList)){
             if(CollUtil.isNotEmpty(updateList)){
                 updateList.stream().forEach(v->v.setStatus(2));
                 updateList.stream().forEach(v->v.setStatus(2));
                 origFileUploadBatchService.updateBatchById(updateList);
                 origFileUploadBatchService.updateBatchById(updateList);
+                for (OrigFileUploadBatch origFileUploadBatch : updateList) {
+                    String batchKey = RedisConstants.BATCH_ID_UPLOAD_SHOOTING.replace("@uuid@", uuid).replace("@index@", String.valueOf(origFileUploadBatch.getPtIndex()));
+                    redisUtil.del(batchKey);
+                }
             }
             }
 
 
-//            String batchKey = RedisConstants.BATCH_ID_UPLOAD_SHOOTING.replace("@uuid@", uuid).replace("@index@", String.valueOf(index));
-//            redisUtil.del(batchKey);
-
-
         }catch (Exception e){
         }catch (Exception e){
             log.error("场景预览文件处理出错, num:{}", num, e);
             log.error("场景预览文件处理出错, num:{}", num, e);
         }finally {
         }finally {

+ 16 - 0
src/main/java/com/fdkankan/contro/mq/service/IBuildLogService.java

@@ -0,0 +1,16 @@
+package com.fdkankan.contro.mq.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.contro.entity.BuildLog;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2022-04-07
+ */
+public interface IBuildLogService extends IService<BuildLog> {
+
+}

+ 20 - 0
src/main/java/com/fdkankan/contro/mq/service/impl/BuildLogServiceImpl.java

@@ -0,0 +1,20 @@
+package com.fdkankan.contro.mq.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.contro.entity.BuildLog;
+import com.fdkankan.contro.mapper.IBuildLogMapper;
+import com.fdkankan.contro.mq.service.IBuildLogService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2022-04-07
+ */
+@Service
+public class BuildLogServiceImpl extends ServiceImpl<IBuildLogMapper, BuildLog> implements IBuildLogService {
+
+}

+ 26 - 21
src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java

@@ -160,6 +160,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
     private RabbitTemplate rabbitTemplate;
     private RabbitTemplate rabbitTemplate;
     @Resource
     @Resource
     private EcsScaling ecsScaling;
     private EcsScaling ecsScaling;
+    @Autowired
+    private IAiService aiService;
 
 
 
 
     @Override
     @Override
@@ -168,6 +170,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
         String num = message.getSceneNum();
         String num = message.getSceneNum();
         String batchIds = (String) message.getExt().get("batchId");
         String batchIds = (String) message.getExt().get("batchId");
         String threeCamType = (String) message.getExt().get("threeCamType");
         String threeCamType = (String) message.getExt().get("threeCamType");
+        String filename = (String)message.getExt().get("filename");
         try {
         try {
 
 
             //如果场景原始资源上传批次id不为空,则需要下载批次文件上传到oss目录
             //如果场景原始资源上传批次id不为空,则需要下载批次文件上传到oss目录
@@ -204,10 +207,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
                 FileUtil.del(message.getPath() + "/extras");
                 FileUtil.del(message.getPath() + "/extras");
             }
             }
 
 
-//            //用户相机重新全量上传,需要解冻结
-//            sceneColdStorageService.unfreeze(num, "用户相机重新全量上传", message.getPath());
-
-            //根据相机类型,组装资源路径
             //下载资源到本地
             //下载资源到本地
             this.downLoadSource(message, message.getPath());
             this.downLoadSource(message, message.getPath());
 
 
@@ -318,10 +317,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
                 reason = "前置处理异常";
                 reason = "前置处理异常";
             }
             }
 
 
-            scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
-                    .set(ScenePlus::getSceneStatus, SceneStatus.FAILD.code())
-                    .set(ScenePlus::getBuildFailReason, reason)
-                    .eq(ScenePlus::getNum, num));
+            jmgaService.updateSceneFailAndZipLog(num, reason);
 
 
             this.sendFailToLaser(num);
             this.sendFailToLaser(num);
 
 
@@ -446,6 +442,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
     public void buildScenePost(BuildSceneResultMqMessage message) throws Exception {
     public void buildScenePost(BuildSceneResultMqMessage message) throws Exception {
         String sceneCode = message.getBuildContext().get("sceneNum").toString();
         String sceneCode = message.getBuildContext().get("sceneNum").toString();
         String path = message.getPath();
         String path = message.getPath();
+        boolean status = false;
         String batchIds = (String) message.getExt().get("batchId");
         String batchIds = (String) message.getExt().get("batchId");
         Long count = redisUtil.decr("modeling-count:" + sceneCode, 1);
         Long count = redisUtil.decr("modeling-count:" + sceneCode, 1);
         log.info("场景:{},剩余计算次数:{}", sceneCode, count);
         log.info("场景:{},剩余计算次数:{}", sceneCode, count);
@@ -468,14 +465,10 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
             JSONObject fdageData = getFdageData(path + File.separator + "capture" +File.separator+"data.fdage");
             JSONObject fdageData = getFdageData(path + File.separator + "capture" +File.separator+"data.fdage");
             String uuid = fdageData.getString("creator") + "_" + fdageData.getString("uuidtime");
             String uuid = fdageData.getString("creator") + "_" + fdageData.getString("uuidtime");
 
 
-
             if (!message.getBuildSuccess()) {
             if (!message.getBuildSuccess()) {
                 log.error("建模失败,修改状态为失败状态");
                 log.error("建模失败,修改状态为失败状态");
                 if(count < 1){
                 if(count < 1){
-                    scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
-                            .set(ScenePlus::getSceneStatus, SceneStatus.FAILD.code())
-                            .set(ScenePlus::getBuildFailReason, "算法报错")
-                            .eq(ScenePlus::getNum, sceneCode));
+                    jmgaService.updateSceneFailAndZipLog(sceneCode, "算法报错");
 
 
                     this.sendFailToLaser(sceneCode);
                     this.sendFailToLaser(sceneCode);
 
 
@@ -583,6 +576,9 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
             //容量统计
             //容量统计
             Long space = commonService.getSpace(sceneCode);
             Long space = commonService.getSpace(sceneCode);
 
 
+            //ai识别
+            aiService.detectScenePano(scenePlus, scenePlusExt, path);
+
             //写入数据库
             //写入数据库
             this.updateDbPlus(scenePlus.getSceneSource(), space, videosJson.toJSONString(), message.getComputeTime(),isObj,scenePlusExt);
             this.updateDbPlus(scenePlus.getSceneSource(), space, videosJson.toJSONString(), message.getComputeTime(),isObj,scenePlusExt);
 
 
@@ -620,6 +616,10 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
             }
             }
 
 
 
 
+            if(cameraType == 6){
+                scenePlusExt.setModelKind(modelKind);
+            }
+
             log.info("生成scene.json上传oss并设置缓存,num:{}", sceneCode);
             log.info("生成scene.json上传oss并设置缓存,num:{}", sceneCode);
             CameraDetail cameraDetail = cameraDetailService.getByCameraId(scenePlus.getCameraId());
             CameraDetail cameraDetail = cameraDetailService.getByCameraId(scenePlus.getCameraId());
             Company company = !ObjectUtils.isEmpty(cameraDetail.getCompanyId()) ? companyService.getById(cameraDetail.getCompanyId()) : null;
             Company company = !ObjectUtils.isEmpty(cameraDetail.getCompanyId()) ? companyService.getById(cameraDetail.getCompanyId()) : null;
@@ -653,19 +653,24 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
             scenePlusService.updateById(scenePlus);
             scenePlusService.updateById(scenePlus);
             scenePlusExtService.updateById(scenePlusExt);
             scenePlusExtService.updateById(scenePlusExt);
 
 
+            //推送场景码以及案件号到案件系统
+            Map<String, String> params = new HashMap<>();
+            params.put("num", sceneCode);
+            params.put("kNo",scenePlus.getKNo());
+            mqProducer.sendByWorkQueue("queue-aj-add-scene", params);
+
             //国际环境需要发邮件通知
             //国际环境需要发邮件通知
             if("eur".equals(env)){
             if("eur".equals(env)){
                 commonService.sendEmail(sceneCode);
                 commonService.sendEmail(sceneCode);
             }
             }
 
 
-            //拜城公安需求
-//            this.sendMqForBcgn(sceneCode);
-
             //推送ai识别平面图mq
             //推送ai识别平面图mq
             this.sendMqForAiPano(sceneCode);
             this.sendMqForAiPano(sceneCode);
 
 
 //            redisUtil.set(String.format(RedisKey.SCENE_BUILD_FINISH_NUM, sceneCode), "1");
 //            redisUtil.set(String.format(RedisKey.SCENE_BUILD_FINISH_NUM, sceneCode), "1");
 
 
+            status = true;
+
             log.info("场景计算结果处理结束,场景码:{}", sceneCode);
             log.info("场景计算结果处理结束,场景码:{}", sceneCode);
 
 
             Map<String, Object> param = new HashMap<>();
             Map<String, Object> param = new HashMap<>();
@@ -689,10 +694,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
         }catch (Exception e){
         }catch (Exception e){
             log.error("场景计算结果处理出错,num"+sceneCode, e);
             log.error("场景计算结果处理出错,num"+sceneCode, e);
 
 
-            scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
-                    .set(ScenePlus::getSceneStatus, SceneStatus.FAILD.code())
-                    .set(ScenePlus::getBuildFailReason, "后置处理异常")
-                    .eq(ScenePlus::getNum, sceneCode));
+            jmgaService.updateSceneFailAndZipLog(sceneCode, "后置处理异常");
 
 
             this.sendFailToLaser(sceneCode);
             this.sendFailToLaser(sceneCode);
 
 
@@ -724,7 +726,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
             if(StrUtil.isNotEmpty(batchIds)){
             if(StrUtil.isNotEmpty(batchIds)){
                 origFileUploadBatchService.update(new LambdaUpdateWrapper<OrigFileUploadBatch>().set(OrigFileUploadBatch::getStatus, 3).in(OrigFileUploadBatch::getBatchId, batchIds.split(",")));
                 origFileUploadBatchService.update(new LambdaUpdateWrapper<OrigFileUploadBatch>().set(OrigFileUploadBatch::getStatus, 3).in(OrigFileUploadBatch::getBatchId, batchIds.split(",")));
             }
             }
-
         }
         }
     }
     }
 
 
@@ -847,6 +848,10 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
             gen3dTiles = true;
             gen3dTiles = true;
         }
         }
 
 
+        if(cameraType == 6){
+            gen3dTiles = true;
+        }
+
         if(genModel){
         if(genModel){
             if (!gen3dTiles) {
             if (!gen3dTiles) {
                 String damPath = path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam";
                 String damPath = path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam";

+ 13 - 0
src/main/java/com/fdkankan/contro/schedule/ScheduleJob.java

@@ -1,6 +1,7 @@
 package com.fdkankan.contro.schedule;
 package com.fdkankan.contro.schedule;
 
 
 import com.fdkankan.contro.mq.service.CallBuildService;
 import com.fdkankan.contro.mq.service.CallBuildService;
+import com.fdkankan.contro.service.MjService;
 import com.fdkankan.contro.service.IScene3dNumService;
 import com.fdkankan.contro.service.IScene3dNumService;
 import lombok.extern.log4j.Log4j2;
 import lombok.extern.log4j.Log4j2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -15,6 +16,8 @@ public class ScheduleJob {
     private IScene3dNumService scene3dNumService;
     private IScene3dNumService scene3dNumService;
     @Autowired
     @Autowired
     private CallBuildService callBuildService;
     private CallBuildService callBuildService;
+    @Autowired
+    private MjService gzZcdjzxService;
 
 
 
 
     /**
     /**
@@ -32,4 +35,14 @@ public class ScheduleJob {
     public void pushPre() {
     public void pushPre() {
         callBuildService.pushPre();
         callBuildService.pushPre();
     }
     }
+
+    /**
+     * 每隔十分钟拉取一次压缩包
+     */
+    @Scheduled(fixedDelay = 5*60*1000, initialDelay = 1000)
+    public void bd() {
+        log.info("定时任务推送开始");
+        gzZcdjzxService.bd();
+        log.info("定时任务推送结束");
+    }
 }
 }

+ 13 - 0
src/main/java/com/fdkankan/contro/service/IAiService.java

@@ -0,0 +1,13 @@
+package com.fdkankan.contro.service;
+
+import com.fdkankan.contro.entity.SceneMarkShape;
+import com.fdkankan.contro.entity.ScenePlus;
+import com.fdkankan.contro.entity.ScenePlusExt;
+
+public interface IAiService {
+
+    void detectScenePano(ScenePlus scenePlus, ScenePlusExt scenePlusExt, String path);
+
+    SceneMarkShape readDetectJson(String jsonPath);
+
+}

+ 12 - 0
src/main/java/com/fdkankan/contro/service/IHaixinService.java

@@ -0,0 +1,12 @@
+package com.fdkankan.contro.service;
+
+import com.fdkankan.contro.dto.UploadSceneDTO;
+import com.fdkankan.web.response.ResultData;
+
+public interface IHaixinService {
+
+    ResultData uploadScene(UploadSceneDTO dto);
+
+    void noticHaixin(String num, boolean buildSuccess) throws Exception;
+    void sendResult(String taskId, String packetPath);
+}

+ 2 - 0
src/main/java/com/fdkankan/contro/service/IJmgaService.java

@@ -17,4 +17,6 @@ public interface IJmgaService {
 
 
     void noticeBuildBd(String ossHost, String uuid, String dir);
     void noticeBuildBd(String ossHost, String uuid, String dir);
 
 
+    void updateSceneFailAndZipLog(String num, String failReason);
+
 }
 }

+ 4 - 0
src/main/java/com/fdkankan/contro/service/ISceneBuildProcessLogService.java

@@ -3,6 +3,8 @@ package com.fdkankan.contro.service;
 import com.fdkankan.contro.entity.SceneBuildProcessLog;
 import com.fdkankan.contro.entity.SceneBuildProcessLog;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 
+import java.util.List;
+
 /**
 /**
  * <p>
  * <p>
  * 场景计算流程状态表 服务类
  * 场景计算流程状态表 服务类
@@ -17,4 +19,6 @@ public interface ISceneBuildProcessLogService extends IService<SceneBuildProcess
 
 
     public void saveSceneBuildProcessLog(String num, String process, String queueName, int status, String reason);
     public void saveSceneBuildProcessLog(String num, String process, String queueName, int status, String reason);
 
 
+    public List<SceneBuildProcessLog> listByNum(String num);
+
 }
 }

+ 1 - 1
src/main/java/com/fdkankan/contro/service/ISceneFileBuildService.java

@@ -36,7 +36,7 @@ public interface ISceneFileBuildService extends IService<SceneFileBuild> {
 
 
     ResultData uploadFile(SendCallAlgorithmParam param) throws Exception;
     ResultData uploadFile(SendCallAlgorithmParam param) throws Exception;
 
 
-    ResultData noticeBuild(String params) throws Exception;
+    ResultData noticeBuild(String params, Long bdId, String dataSource, String uploadType) throws Exception;
 
 
     String getFileId(String snCode, String uuid);
     String getFileId(String snCode, String uuid);
 }
 }

+ 16 - 0
src/main/java/com/fdkankan/contro/service/ISceneFilenameService.java

@@ -0,0 +1,16 @@
+package com.fdkankan.contro.service;
+
+import com.fdkankan.contro.entity.SceneFilename;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2025-05-07
+ */
+public interface ISceneFilenameService extends IService<SceneFilename> {
+
+}

+ 19 - 0
src/main/java/com/fdkankan/contro/service/ISceneOrigBdService.java

@@ -0,0 +1,19 @@
+package com.fdkankan.contro.service;
+
+import com.fdkankan.contro.entity.SceneOrigBd;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2025-05-07
+ */
+public interface ISceneOrigBdService extends IService<SceneOrigBd> {
+
+//    SceneOrigBd getEnableOne(String filename);
+
+
+}

+ 4 - 0
src/main/java/com/fdkankan/contro/service/IScenePlusService.java

@@ -25,7 +25,11 @@ public interface IScenePlusService extends IService<ScenePlus> {
 
 
     Long sumUsedSpaceByCameraId(Long cameraId, String spaceTypeStr);
     Long sumUsedSpaceByCameraId(Long cameraId, String spaceTypeStr);
 
 
+    ScenePlus getByTaskId(String taskId);
+
     JyUser getJyUserByNum(String num);
     JyUser getJyUserByNum(String num);
 
 
     ScenePlus getByUuid(String uuid);
     ScenePlus getByUuid(String uuid);
+
+
 }
 }

+ 8 - 0
src/main/java/com/fdkankan/contro/service/MjService.java

@@ -0,0 +1,8 @@
+package com.fdkankan.contro.service;
+
+public interface MjService {
+
+    void bd();
+
+
+}

+ 142 - 0
src/main/java/com/fdkankan/contro/service/impl/AiServiceImpl.java

@@ -0,0 +1,142 @@
+package com.fdkankan.contro.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.common.constant.CommonStatus;
+import com.fdkankan.contro.constant.DetectType;
+import com.fdkankan.contro.entity.SceneMarkShape;
+import com.fdkankan.contro.entity.ScenePlus;
+import com.fdkankan.contro.entity.ScenePlusExt;
+import com.fdkankan.contro.entity.SceneShapeEnum;
+import com.fdkankan.contro.service.*;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.model.constants.UploadFilePath;
+import com.fdkankan.model.utils.ComputerUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.nio.charset.StandardCharsets;
+import java.util.Date;
+import java.util.List;
+
+@Slf4j
+@Service
+public class AiServiceImpl implements IAiService {
+
+    @Autowired
+    private IScenePlusService scenePlusService;
+    @Autowired
+    private IScenePlusExtService scenePlusExtService;
+    @Resource
+    private FYunFileServiceInterface fYunFileService;
+    @Autowired
+    private SceneShapeEnumService sceneShapeEnumService;
+    @Autowired
+    private ISceneMarkShapeService sceneMarkShapeService;
+
+    @Override
+    public void detectScenePano(ScenePlus scenePlus, ScenePlusExt scenePlusExt, String path) {
+        try {
+            String resultsPath = path + File.separator + "results" + File.separator;
+            String highPath = resultsPath + "high" + File.separator;
+            String aiWorkPath = highPath + "ai" + File.separator;
+            List<File> highImgs = FileUtil.loopFiles(highPath);
+            if(CollUtil.isEmpty(highImgs)){
+                return;
+            }
+
+            for (File file : highImgs) {
+                String absolutePath = file.getAbsolutePath();
+                try {
+                    String name = FileUtil.getName(absolutePath);
+                    String prefix = FileUtil.getPrefix(name);
+                    String outPath = aiWorkPath + prefix + File.separator;
+                    String detectPath = outPath + "detect.json";
+                    String cutImagesPath = outPath + "cut_images";
+                    if(!ComputerUtil.checkComputeCompleted(detectPath, 5, 200)){
+                        continue;
+                    }
+                    SceneMarkShape sceneMarkShape = readDetectJson(detectPath);
+                    if (ObjectUtil.isNotNull(sceneMarkShape)){
+                        sceneMarkShape.setNum(scenePlus.getNum());
+                        SceneMarkShape shape = sceneMarkShapeService.findByNumAndImagePathAndType(scenePlus.getNum(), sceneMarkShape.getImagePath(), DetectType.PANO.getCode());
+                        if (ObjectUtil.isNotNull(shape)){
+                            sceneMarkShape.setId(shape.getId());
+                            sceneMarkShape.setUpdateTime(new Date());
+                            sceneMarkShapeService.updateById(sceneMarkShape);
+                        }else {
+                            sceneMarkShape.setCreateTime(new Date());
+                            sceneMarkShape.setType(DetectType.PANO.getCode());
+                            sceneMarkShapeService.save(sceneMarkShape);
+                        }
+                    }
+                    if (FileUtil.exist(cutImagesPath)){
+                        //上传这个文件夹所有的文件
+                        List<File> files = FileUtil.loopFiles(cutImagesPath);
+                        String keyPath =  String.format(UploadFilePath.IMG_VIEW_PATH, scenePlus.getNum()) + "cut_images/";
+                        files.forEach(v -> fYunFileService.uploadFile(v.getAbsolutePath(),keyPath+v.getName()));
+                    }
+
+                }catch (Exception e){
+                    log.error("ai识别报错,inPath:{}", absolutePath, e);
+                }
+            }
+
+            //生成ai.json
+            List<SceneMarkShape> sceneMarkShapes = sceneMarkShapeService.findByNumAndType(scenePlus.getNum(), DetectType.PANO.getCode());
+            if(CollUtil.isNotEmpty(sceneMarkShapes)){
+                for (SceneMarkShape sceneMarkShape : sceneMarkShapes) {
+                    if (ObjectUtil.isNotEmpty(sceneMarkShape.getShapes())){
+                        for (JSONObject shape : sceneMarkShape.getShapes()) {
+                            String category = shape.getString("category");
+                            SceneShapeEnum sceneShapeEnum = sceneShapeEnumService.findByClassName(category);
+                            if (ObjectUtil.isNotNull(sceneShapeEnum)){
+                                shape.put("name",sceneShapeEnum.getName());
+                            }
+                            if (category.contains("Tag_")){
+                                shape.put("category","Tag");
+                            }
+                        }
+                    }
+                }
+
+                String ajJsonKey = String.format(UploadFilePath.IMG_VIEW_PATH, scenePlus.getNum()) + "ai.json";
+                fYunFileService.uploadFile(JSON.toJSONString(sceneMarkShapes).getBytes(StandardCharsets.UTF_8), ajJsonKey);
+
+                scenePlusExt.setHasRecognition(CommonStatus.YES.code().intValue());
+            }
+        }catch (Exception e){
+            log.error("ai识别出错,num:{}", scenePlus.getNum());
+        }
+    }
+
+    @Override
+    public SceneMarkShape readDetectJson(String jsonPath) {
+        String strings = FileUtil.readString(jsonPath, "UTF-8");
+        JSONObject bbbb = JSONObject.parseObject(strings);
+        SceneMarkShape parse = JSONObject.toJavaObject(bbbb, SceneMarkShape.class);
+        System.out.println(parse);
+        if (ObjectUtil.isNull(parse.getShapes())){
+            return null;
+        }
+        List<JSONObject> shapes = parse.getShapes();
+        for (JSONObject shape : shapes) {
+            shape.remove("name");
+            SceneShapeEnum category = sceneShapeEnumService.findByClassName(shape.getString("category"));
+            if (ObjectUtil.isNull(category)){
+                SceneShapeEnum sceneShapeEnum = new SceneShapeEnum();
+                sceneShapeEnum.setName(shape.getString("name"));
+                sceneShapeEnum.setClassName(shape.getString("category"));
+                sceneShapeEnumService.save(sceneShapeEnum);
+            }
+        }
+        return parse;
+    }
+
+}

+ 1 - 1
src/main/java/com/fdkankan/contro/service/impl/CommonServiceImpl.java

@@ -17,7 +17,7 @@ import com.fdkankan.common.constant.SpaceType;
 import com.fdkankan.common.util.FileUtils;
 import com.fdkankan.common.util.FileUtils;
 import com.fdkankan.contro.bean.SceneJsonBean;
 import com.fdkankan.contro.bean.SceneJsonBean;
 import com.fdkankan.contro.constant.RedisKeyExt;
 import com.fdkankan.contro.constant.RedisKeyExt;
-import com.fdkankan.contro.controller.DetectType;
+import com.fdkankan.contro.constant.DetectType;
 import com.fdkankan.contro.entity.*;
 import com.fdkankan.contro.entity.*;
 import com.fdkankan.contro.factory.UserEditData.UserEditDataHandler;
 import com.fdkankan.contro.factory.UserEditData.UserEditDataHandler;
 import com.fdkankan.contro.factory.UserEditData.UserEditDataHandlerFactory;
 import com.fdkankan.contro.factory.UserEditData.UserEditDataHandlerFactory;

+ 130 - 0
src/main/java/com/fdkankan/contro/service/impl/HaixinServiceImpl.java

@@ -0,0 +1,130 @@
+package com.fdkankan.contro.service.impl;
+
+import cn.hutool.core.io.FileUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.common.util.CmdUtils;
+import com.fdkankan.contro.dto.UploadSceneDTO;
+import com.fdkankan.contro.entity.SceneOrigBd;
+import com.fdkankan.contro.entity.ScenePlus;
+import com.fdkankan.contro.httpclient.HaixinClient;
+import com.fdkankan.contro.service.IHaixinService;
+import com.fdkankan.contro.service.ISceneOrigBdService;
+import com.fdkankan.contro.service.IScenePlusService;
+import com.fdkankan.fyun.config.FYunFileConfig;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.model.constants.ConstantFilePath;
+import com.fdkankan.model.constants.UploadFilePath;
+import com.fdkankan.web.response.ResultData;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Slf4j
+@Service
+public class HaixinServiceImpl implements IHaixinService {
+
+    private static final String  API_FDFS_UPLOAD = "/fdfs/api/file/upload";
+    private static final String  API_SUBMIT_RENDER_RESULT = "/ecs/api/panoramicImageService/submitRenderResult";
+
+    @Value("${haixin.host:#{null}}")
+    private String haixinHost;
+
+    @Autowired
+    private ISceneOrigBdService sceneOrigBdService;
+    @Resource
+    private FYunFileConfig fYunFileConfig;
+    @Resource
+    private FYunFileServiceInterface fileServiceInterface;
+    @Autowired
+    private IScenePlusService scenePlusService;
+    @Resource
+    private HaixinClient haixinClient;
+
+    @Override
+    public ResultData uploadScene(UploadSceneDTO dto) {
+        SceneOrigBd sceneOrigBd = new SceneOrigBd();
+        sceneOrigBd.setFileUrl(dto.getFileUrl());
+        sceneOrigBd.setTaskId(dto.getTaskId());
+        sceneOrigBd.setKNo(dto.getkNo());
+        sceneOrigBd.setRyId(dto.getRyId());
+        sceneOrigBd.setRyNo(dto.getRyNo());
+        sceneOrigBd.setPassword(dto.getPassword());
+        sceneOrigBd.setRyPhone(dto.getRyPhone());
+        sceneOrigBd.setRyCid(dto.getRyCid());
+        sceneOrigBd.setRyName(dto.getRyName());
+        sceneOrigBdService.save(sceneOrigBd);
+        return ResultData.ok();
+    }
+
+    @Override
+    public void noticHaixin(String num, boolean buildSuccess) throws Exception {
+        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
+        String taskId = scenePlus.getTaskId();
+        String zipDir = String.format(ConstantFilePath.SCENE_USER_PATH_V4, num) + "haixin/";
+        String zipPath = zipDir + num + ".zip";
+        try {
+            if(buildSuccess){//计算成功,把原始资源打压缩包
+                //复制scene_edit_data/num/data/mapping目录到view目录
+                String editMappingPath = "/oss/4dkankan/" + String.format(UploadFilePath.DATA_EDIT_PATH, num) + "mapping";
+                String viewMappingPath = "/oss/4dkankan/" + String.format(UploadFilePath.DATA_VIEW_PATH, num) + "mapping";
+                if(FileUtil.exist(editMappingPath)){
+                    FileUtil.copyContent(new File(editMappingPath), new File(viewMappingPath), true);
+                }
+
+                String viewPath = "/oss/4dkankan/" + String.format(UploadFilePath.VIEW_PATH, num);
+
+                //打压缩包
+                this.zip(viewPath, zipPath);
+
+                //上传到fastdf
+                String url = haixinHost.concat(API_FDFS_UPLOAD);
+                List<File> files = FileUtil.loopFiles(zipDir);
+                List<String> fileNameRemoteList = new ArrayList<>();
+                String finalUrl = url;
+                files.stream().forEach(file->{
+                    JSONObject jsonObject = haixinClient.uploadToFdfs(finalUrl, file.getAbsolutePath());
+                    JSONObject data = jsonObject.getJSONObject("data");
+                    fileNameRemoteList.add(data.getString("fileNameRemote"));
+                });
+
+                //通知计算结果
+                StringBuilder sb = new StringBuilder();
+                for (String fileNameRemote : fileNameRemoteList) {
+                    sb.append(",").append(fileNameRemote);
+                }
+                this.sendResult(taskId, sb.substring(1));
+            }else{
+                this.sendResult(taskId, null);
+            }
+        }catch (Exception e){
+            log.warn("推送计算结果失败,taskId:{}", taskId, e);
+            this.sendResult(taskId, null);
+        }finally {
+            FileUtil.del(zipDir);
+        }
+    }
+
+    private void zip(String sourcePath, String zipPath) throws Exception {
+        FileUtil.mkParentDirs(zipPath);
+        String cmd = "cd " + sourcePath + " && zip -r -s 2048M " + zipPath + " *";//&& mv -f " + zipPath + " "  + target
+        CmdUtils.callLineSh(cmd, 200);
+    }
+
+    @Override
+    public void sendResult(String taskId, String packetPath){
+        String url = haixinHost.concat(API_SUBMIT_RENDER_RESULT);
+        Map<String, String> params = new HashMap<>();
+        params.put("vendor","A0BF");
+        params.put("projectId", taskId);
+        params.put("packetPath", packetPath);
+        haixinClient.postJson(url, params);
+    }
+}

+ 88 - 8
src/main/java/com/fdkankan/contro/service/impl/JmgaServiceImpl.java

@@ -6,18 +6,20 @@ import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.lang.UUID;
 import cn.hutool.core.lang.UUID;
 import cn.hutool.core.util.ZipUtil;
 import cn.hutool.core.util.ZipUtil;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.http.HttpUtil;
+import com.alibaba.excel.EasyExcel;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.common.constant.SceneStatus;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.common.exception.BusinessException;
 import com.fdkankan.common.util.CmdUtils;
 import com.fdkankan.common.util.CmdUtils;
 import com.fdkankan.contro.bean.SendCallAlgorithmDetail;
 import com.fdkankan.contro.bean.SendCallAlgorithmDetail;
 import com.fdkankan.contro.constant.ZipConstant;
 import com.fdkankan.contro.constant.ZipConstant;
-import com.fdkankan.contro.entity.OrigFileUpload;
-import com.fdkankan.contro.entity.OrigFileUploadBatch;
-import com.fdkankan.contro.entity.User;
+import com.fdkankan.contro.entity.*;
+import com.fdkankan.contro.mq.service.IBuildLogService;
 import com.fdkankan.contro.service.*;
 import com.fdkankan.contro.service.*;
 import com.fdkankan.contro.vo.SendCallAlgorithmParam;
 import com.fdkankan.contro.vo.SendCallAlgorithmParam;
 import com.fdkankan.contro.vo.UploadSceneOrigParamVo;
 import com.fdkankan.contro.vo.UploadSceneOrigParamVo;
@@ -55,6 +57,14 @@ public class JmgaServiceImpl implements IJmgaService {
     private ISceneFileBuildService sceneFileBuildService;
     private ISceneFileBuildService sceneFileBuildService;
     @Autowired
     @Autowired
     private IUserService userService;
     private IUserService userService;
+    @Autowired
+    private IScenePlusService scenePlusService;
+    @Autowired
+    private IScenePlusExtService scenePlusExtService;
+    @Autowired
+    private ISceneBuildProcessLogService sceneBuildProcessLogService;
+    @Autowired
+    private IBuildLogService buildLogService;
 
 
     @Override
     @Override
     public void checkFileWhole(String uuid, String dataSource, JSONObject fdageData) {
     public void checkFileWhole(String uuid, String dataSource, JSONObject fdageData) {
@@ -95,11 +105,6 @@ public class JmgaServiceImpl implements IJmgaService {
             fileList = fileList.stream().filter(v -> origFileList.stream().noneMatch(k -> k.getFileName().equals(v))).collect(Collectors.toList());
             fileList = fileList.stream().filter(v -> origFileList.stream().noneMatch(k -> k.getFileName().equals(v))).collect(Collectors.toList());
         }
         }
 
 
-//        //查询oss文件目录是否存在
-//        String homePath = SceneUtil.getHomePath(dataSource);
-//        List<String> ossKeyList = fileServiceInterface.listRemoteFiles(homePath);
-//        fileList = fileList.stream().filter(v->ossKeyList.stream().noneMatch(k->FileUtil.getName(k).equals(v))).collect(Collectors.toList());
-//
         if(CollUtil.isNotEmpty(fileList)){
         if(CollUtil.isNotEmpty(fileList)){
             String args = JSON.toJSONString(fileList);
             String args = JSON.toJSONString(fileList);
             if(fileList.size() > 5){
             if(fileList.size() > 5){
@@ -265,4 +270,79 @@ public class JmgaServiceImpl implements IJmgaService {
             HttpUtil.post("http://127.0.0.1:8085/api/scene/file/sendCallAlgorithm", JSON.toJSONString(param));
             HttpUtil.post("http://127.0.0.1:8085/api/scene/file/sendCallAlgorithm", JSON.toJSONString(param));
         });
         });
     }
     }
+
+    @Override
+    public void updateSceneFailAndZipLog(String num, String failReason) {
+        scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
+                .set(ScenePlus::getSceneStatus, SceneStatus.FAILD.code())
+                .set(ScenePlus::getBuildFailReason, failReason)
+                .eq(ScenePlus::getNum, num));
+
+        String logBasePath = File.separator + "mnt" + File.separator + "logs" + File.separator;
+        String tmpPath = logBasePath + "tmp" + File.separator;
+        String logPath = tmpPath + num + "-" + Calendar.getInstance().getTimeInMillis() + File.separator;
+        String zipPath = tmpPath + num + "-" + Calendar.getInstance().getTimeInMillis() + ".zip";
+        //打包服务端日志
+        File[] ls = FileUtil.ls(logBasePath);
+        for (File l : ls) {
+            if(l.isFile() || !l.getName().startsWith("modeling-control")){
+                continue;
+            }
+            this.copyLog(l.getAbsolutePath(), tmpPath, "info","sql","error");
+        }
+        //打包算法日志
+        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
+        ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
+        String consoleLogPath = scenePlusExt.getDataSource() + "console.log";
+        String consoleOldLogPath = scenePlusExt.getDataSource() + "console.old.log";
+        if(FileUtil.exist(consoleLogPath)){
+            FileUtil.copy(consoleLogPath, logPath,true);
+        }
+        if(FileUtil.exist(consoleOldLogPath)){
+            FileUtil.copy(consoleOldLogPath, logPath,true);
+        }
+        //打包数据库记录
+        String[] split = scenePlusExt.getDataSource().split("/");
+        String uuid = split[split.length -1];
+        List<OrigFileUploadBatch> batchList = origFileUploadBatchService.list(new LambdaQueryWrapper<OrigFileUploadBatch>().eq(OrigFileUploadBatch::getUuid, uuid));
+        if(CollUtil.isNotEmpty(batchList)){
+            EasyExcel.write(logPath.concat("origFileUploadBatch.xlsx"), OrigFileUploadBatch.class).sheet("origFileUploadBatch").doWrite(batchList);
+            List<String> batchIdList = batchList.stream().map(v -> v.getBatchId()).collect(Collectors.toList());
+            List<OrigFileUpload> uploadList = origFileUploadService.list(new LambdaQueryWrapper<OrigFileUpload>().in(OrigFileUpload::getBatchId, batchIdList));
+            if(CollUtil.isNotEmpty(uploadList)){
+                EasyExcel.write(logPath.concat("origFileUpload.xlsx"), OrigFileUpload.class).sheet("origFileUpload").doWrite(uploadList);
+            }
+        }
+        List<SceneBuildProcessLog> processLogList = sceneBuildProcessLogService.listByNum(num);
+        if(CollUtil.isNotEmpty(processLogList)){
+            EasyExcel.write(logPath.concat("sceneBuildProcessLog.xlsx"), SceneBuildProcessLog.class).sheet("sceneBuildProcessLog").doWrite(processLogList);
+        }
+        List<BuildLog> buildLogList = buildLogService.list(new LambdaQueryWrapper<BuildLog>().eq(BuildLog::getSceneNum, num));
+        if(CollUtil.isNotEmpty(buildLogList)){
+            EasyExcel.write(logPath.concat("buildLog.xlsx"), BuildLog.class).sheet("buildLog").doWrite(buildLogList);
+        }
+
+        //上传日志,删除本地压缩包
+        ZipUtil.zip(logPath, zipPath, false);
+        fYunFileService.uploadFile(zipPath, "build_log/");
+
+    }
+
+    private void copyLog(String serverPath, String tmpPath, String... levels){
+        level: for (String level : levels) {
+            String infoPath = serverPath + File.separator + level + File.separator;
+            List<File> fileList = FileUtil.loopFiles(infoPath);
+            if(CollUtil.isEmpty(fileList)){
+                continue;
+            }
+            CollUtil.reverse(fileList);
+            for (File file : fileList) {
+                int i = fileList.indexOf(file);
+                if(i > 7){
+                    continue level;
+                }
+                FileUtil.copy(file.getAbsolutePath(), file.getAbsolutePath().replace(FileUtil.getParent(serverPath, 1), tmpPath), true);
+            }
+        }
+    }
 }
 }

+ 136 - 0
src/main/java/com/fdkankan/contro/service/impl/MjServiceImpl.java

@@ -0,0 +1,136 @@
+package com.fdkankan.contro.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.ZipUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.common.constant.CommonSuccessStatus;
+import com.fdkankan.common.constant.RecStatus;
+import com.fdkankan.common.constant.SceneStatus;
+import com.fdkankan.common.util.CmdUtils;
+import com.fdkankan.common.util.SnowflakeIdGenerator;
+import com.fdkankan.contro.entity.SceneFileBuild;
+import com.fdkankan.contro.entity.SceneOrigBd;
+import com.fdkankan.contro.entity.ScenePlus;
+import com.fdkankan.contro.httpclient.CustomHttpClient;
+import com.fdkankan.contro.service.*;
+import com.fdkankan.fyun.config.FYunFileConfig;
+import com.fdkankan.fyun.local.constant.LocalConstants;
+import com.fdkankan.model.constants.ConstantFilePath;
+import com.fdkankan.model.utils.SceneUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+import java.util.UUID;
+
+@Slf4j
+@Service
+public class MjServiceImpl implements MjService {
+
+    @Resource
+    private FYunFileConfig fYunFileConfig;
+    @Autowired
+    private ISceneFileBuildService sceneFileBuildService;
+    @Autowired
+    private ISceneOrigBdService sceneOrigBdService;
+    @Autowired
+    private IScenePlusService scenePlusService;
+    @Autowired
+    private ISceneFilenameService sceneFilenameService;
+    @Resource
+    private CustomHttpClient httpClient;
+
+
+    @Override
+    public void bd() {
+
+        List<SceneOrigBd> list = sceneOrigBdService.list(new LambdaQueryWrapper<SceneOrigBd>().eq(SceneOrigBd::getStatus, CommonSuccessStatus.WAITING.code()));
+
+        if (CollUtil.isEmpty(list)) {
+            return;
+        }
+        for (SceneOrigBd v : list) {
+
+            String uuid = UUID.randomUUID().toString();
+            String fileUrl = v.getFileUrl();
+            String zipName = FileUtil.getName(fileUrl);
+            String zipDir = ConstantFilePath.BUILD_MODEL_PATH + "bd/" + uuid + "/";
+            String taskId = v.getTaskId();
+            String kNo = v.getKNo();
+
+            try {
+
+                ScenePlus scenePlus = scenePlusService.getByTaskId(taskId);
+                if(Objects.nonNull(scenePlus) && scenePlus.getSceneStatus() == SceneStatus.wait.code()){
+                    continue;
+                }
+
+                FileUtil.mkdir(zipDir);
+                String downloadCmd = "wget -O " + zipDir + zipName + " " + fileUrl;
+                CmdUtils.callLineSh(downloadCmd);
+//                httpClient.downloadFile(fileUrl, zipDir, zipName);
+//                String unzipCmd = "unzip -O GBK " + zipDir + zipName + " -d " + zipDir;
+
+//                CmdUtils.callLine(unzipCmd);
+
+                ZipUtil.unzip(new File(zipDir + zipName), new File(zipDir));
+                //解压后删除压缩包
+                FileUtil.del(zipDir + zipName);
+
+                String dataFdagePath = zipDir + "data.fdage";
+                JSONObject dataFdageJson = JSON.parseObject(FileUtil.readUtf8String(dataFdagePath));
+
+                JSONObject camJson = dataFdageJson.getJSONObject("cam");
+                String snCode = camJson.getString("uuid");
+                String uuidtime = dataFdageJson.getString("uuidtime");
+                String unicode = snCode + "_" + uuidtime;
+
+                SceneFileBuild sceneFileBuild = sceneFileBuildService.getOne(new LambdaQueryWrapper<SceneFileBuild>().eq(SceneFileBuild::getTaskId, taskId));
+                String fileId = null;
+                if (Objects.isNull(sceneFileBuild)) {
+                    fileId = String.valueOf(new SnowflakeIdGenerator(0, 0).nextId());
+                    sceneFileBuild = new SceneFileBuild();
+                    sceneFileBuild.setFileId(fileId);
+                    sceneFileBuild.setUnicode(unicode);
+                    sceneFileBuild.setChildName(snCode);
+                    sceneFileBuild.setCreateTime(new Date());
+                    sceneFileBuild.setRecStatus(RecStatus.VALID.code());
+                    sceneFileBuild.setTaskId(taskId);
+                    sceneFileBuild.setKNo(kNo);
+                    sceneFileBuildService.save(sceneFileBuild);
+                } else {
+                    fileId = sceneFileBuild.getFileId();
+                }
+                String realDataSource = ConstantFilePath.BUILD_MODEL_PATH + snCode + "/" + fileId + "/" + unicode;
+                String realOssHomePath = SceneUtil.getHomePath(realDataSource);
+                String realOssHomeAbsolutePath = LocalConstants.BASE_PATH + fYunFileConfig.getBucket() + "/" + realOssHomePath;
+                FileUtil.loopFiles(zipDir).stream().forEach(file -> {
+                    FileUtil.copy(file.getAbsolutePath(), file.getAbsolutePath().replace(zipDir, realOssHomeAbsolutePath), true);
+                });
+
+                sceneFileBuildService.noticeBuild(unicode, v.getId(), realDataSource, "zip");
+                v.setStatus(CommonSuccessStatus.SUCCESS.code());
+            } catch (Exception e) {
+                v.setStatus(CommonSuccessStatus.FAIL.code());
+            }
+            sceneOrigBdService.updateById(v);
+        }
+    }
+
+    public static void main(String[] args) {
+//        ZipUtil.unzip(new File("D:\\Downloads\\916ed6689_202501101516307030\\916ed6689_202501101516307030.zip"), new File("D:\\Downloads\\aaa\\bbb"));
+        String substring = "/mnt/data/bd/0ef1b470-4f3a-49b4-bd66-7e0584cce660/".substring(0, "/mnt/data/bd/0ef1b470-4f3a-49b4-bd66-7e0584cce660/".lastIndexOf("/"));
+        System.out.println(substring);
+    }
+
+}
+
+

+ 5 - 1
src/main/java/com/fdkankan/contro/service/impl/OrigFileUploadServiceImpl.java

@@ -28,7 +28,11 @@ public class OrigFileUploadServiceImpl extends ServiceImpl<IOrigFileUploadMapper
 
 
     @Override
     @Override
     public OrigFileUpload getByBatchIdAndFileName(String batchId, String fileName) {
     public OrigFileUpload getByBatchIdAndFileName(String batchId, String fileName) {
-        List<OrigFileUpload> list = this.list(new LambdaQueryWrapper<OrigFileUpload>().eq(OrigFileUpload::getBatchId, batchId).eq(OrigFileUpload::getFileName, fileName).orderByDesc(OrigFileUpload::getId));
+        List<OrigFileUpload> list = this.list(
+                new LambdaQueryWrapper<OrigFileUpload>()
+                .eq(OrigFileUpload::getBatchId, batchId)
+                .eq(OrigFileUpload::getFileName, fileName)
+                .orderByDesc(OrigFileUpload::getId));
         if(CollUtil.isEmpty(list)){
         if(CollUtil.isEmpty(list)){
             return null;
             return null;
         }
         }

+ 7 - 1
src/main/java/com/fdkankan/contro/service/impl/SceneBuildProcessLogServiceImpl.java

@@ -1,12 +1,13 @@
 package com.fdkankan.contro.service.impl;
 package com.fdkankan.contro.service.impl;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fdkankan.contro.entity.SceneBuildProcessLog;
 import com.fdkankan.contro.entity.SceneBuildProcessLog;
 import com.fdkankan.contro.mapper.ISceneBuildProcessLogMapper;
 import com.fdkankan.contro.mapper.ISceneBuildProcessLogMapper;
 import com.fdkankan.contro.service.ISceneBuildProcessLogService;
 import com.fdkankan.contro.service.ISceneBuildProcessLogService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import java.util.List;
 import java.util.Objects;
 import java.util.Objects;
 
 
 /**
 /**
@@ -47,4 +48,9 @@ public class SceneBuildProcessLogServiceImpl extends ServiceImpl<ISceneBuildProc
         log.setReason(reason);
         log.setReason(reason);
         this.saveOrUpdate(log);
         this.saveOrUpdate(log);
     }
     }
+
+    @Override
+    public List<SceneBuildProcessLog> listByNum(String num) {
+        return this.getBaseMapper().listByNum(num);
+    }
 }
 }

+ 105 - 55
src/main/java/com/fdkankan/contro/service/impl/SceneFileBuildServiceImpl.java

@@ -10,6 +10,7 @@ import cn.hutool.core.lang.UUID;
 import cn.hutool.core.thread.ThreadUtil;
 import cn.hutool.core.thread.ThreadUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.ZipUtil;
 import cn.hutool.core.util.ZipUtil;
+import cn.hutool.crypto.digest.MD5;
 import cn.hutool.extra.qrcode.QrCodeUtil;
 import cn.hutool.extra.qrcode.QrCodeUtil;
 import cn.hutool.extra.qrcode.QrConfig;
 import cn.hutool.extra.qrcode.QrConfig;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.http.HttpUtil;
@@ -89,6 +90,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
 
 
     private static final String sendCallAlgorithmPath = "/mnt/sendCallAlgorithm/";
     private static final String sendCallAlgorithmPath = "/mnt/sendCallAlgorithm/";
 
 
+    private static final String zipPassword = "a3ad34136de359536af553f9e7f3cefd";
+
+    private static final String URL_ADD_UCENTER_USER = "/service/manage/inner/addUcenterUser";
+
     @Value("${main.url}")
     @Value("${main.url}")
     private String mainUrl;
     private String mainUrl;
     @Value("${fyun.type}")
     @Value("${fyun.type}")
@@ -244,6 +249,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
 
 
     @Autowired
     @Autowired
     private IJmgaService jmgaService;
     private IJmgaService jmgaService;
+
+    @Autowired
+    private ISceneOrigBdService sceneOrigBdService;
+    @Autowired
+    private ISceneFilenameService sceneFilenameService;
     @Autowired
     @Autowired
     private UploadShootingService uploadShootingService;
     private UploadShootingService uploadShootingService;
 
 
@@ -988,6 +998,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         }else {
         }else {
             scenePlusExt.setSceneScheme(SceneScheme.BM.code());
             scenePlusExt.setSceneScheme(SceneScheme.BM.code());
         }
         }
+        if(cameraType == 6){
+            scenePlusVO.setThreeCamType("yzl");
+        }
 
 
         //转台相机用4k图
         //转台相机用4k图
         if(cameraType.longValue() == 13){
         if(cameraType.longValue() == 13){
@@ -1680,9 +1693,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
 
 
     private ScenePlusVO buildScenePost(String dataSource, JSONObject jsonObject, String buildType, long cameraType,
     private ScenePlusVO buildScenePost(String dataSource, JSONObject jsonObject, String buildType, long cameraType,
                                        String sceneNum, Camera camera, CameraDetail cameraDetail, int rebuild,String icon,User user, String customUserId, String uploadType) throws Exception {
                                        String sceneNum, Camera camera, CameraDetail cameraDetail, int rebuild,String icon,User user, String customUserId, String uploadType) throws Exception {
-        String localDataPath = String.format(ConstantFilePath.DATABUFFER_FORMAT, sceneNum);
         String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
         String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, sceneNum);
-        String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, sceneNum);
 
 
         JSONObject firmwareVersion = new JSONObject();
         JSONObject firmwareVersion = new JSONObject();
         if (!ObjectUtils.isEmpty(jsonObject.getString("camSoftwareVersion"))) {
         if (!ObjectUtils.isEmpty(jsonObject.getString("camSoftwareVersion"))) {
@@ -1697,13 +1708,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
 
 
         //重算的场景,先移除该场景对应的容量
         //重算的场景,先移除该场景对应的容量
         if (rebuild == 1) {
         if (rebuild == 1) {
-//            try {
-//                scenePlusService.resetSpace(sceneNum);
-//            }catch (Exception e){
-//                log.error("重置容量失败", e);
-//            }
-//            //删除oss的houst_floor.json(国际版可能会卡住)
-//            fYunFileService.deleteFile(dataViewPath + "houst_floor.json");
+            ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneNum);
+            ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
+            scenePlusExt.setSpace(0L);
+            scenePlusExt.setUpdateTime(null);
+            scenePlusExtService.updateById(scenePlusExt);
         } else {
         } else {
             //上传log-main.png
             //上传log-main.png
             fYunFileService.uploadFile(ConstantFilePath.LOGO_PATH + "logo-main.png", imgViewPath + "logo-main.png");
             fYunFileService.uploadFile(ConstantFilePath.LOGO_PATH + "logo-main.png", imgViewPath + "logo-main.png");
@@ -1719,13 +1728,15 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
                 jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, cameraDetail.getCooperationUser());
                 jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, cameraDetail.getCooperationUser());
 
 
         ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneNum);
         ScenePlus scenePlus = scenePlusService.getScenePlusByNum(sceneNum);
+        scenePlus.setTaskId(jsonObject.getString("taskId"));
+        scenePlus.setKNo(jsonObject.getString("kNo"));
+        scenePlusService.updateById(scenePlus);
         ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
         ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
         boolean isObj = jsonObject.containsKey("exportMeshObj") && jsonObject.getIntValue("exportMeshObj") == 1;
         boolean isObj = jsonObject.containsKey("exportMeshObj") && jsonObject.getIntValue("exportMeshObj") == 1;
         scenePlusExt.setIsObj(isObj ? CommonStatus.YES.code() : CommonStatus.NO.code());
         scenePlusExt.setIsObj(isObj ? CommonStatus.YES.code() : CommonStatus.NO.code());
         scenePlusExtService.updateById(scenePlusExt);
         scenePlusExtService.updateById(scenePlusExt);
 
 
-        BuildSceneCallMessage mqMessage = getBuildSceneMqMessage(sceneNum, cameraType, algorithm, jsonObject, buildType,
-                scenePlusVO.getDataSource());
+        BuildSceneCallMessage mqMessage = getBuildSceneMqMessage(sceneNum, cameraType, algorithm, jsonObject, buildType, scenePlusVO.getDataSource());
 
 
         if (cameraDetail.getCompanyId() != null) {
         if (cameraDetail.getCompanyId() != null) {
             Company company = companyService.getById(cameraDetail.getCompanyId());
             Company company = companyService.getById(cameraDetail.getCompanyId());
@@ -1733,6 +1744,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
                 mqMessage.setFlexibility(-1);
                 mqMessage.setFlexibility(-1);
             }
             }
         }
         }
+
         mqMessage.getExt().put("deleteExtras", true);
         mqMessage.getExt().put("deleteExtras", true);
         mqMessage.getExt().put("customUserId", customUserId);
         mqMessage.getExt().put("customUserId", customUserId);
         mqMessage.getExt().put("gps", jsonObject.getString("gps"));
         mqMessage.getExt().put("gps", jsonObject.getString("gps"));
@@ -1745,11 +1757,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             OrigFileUploadBatch origFileUploadBatch = origFileUploadBatchService.getByCondition(condition);
             OrigFileUploadBatch origFileUploadBatch = origFileUploadBatchService.getByCondition(condition);
             origFileUploadBatch.setStatus(4);//修改为等待通知计算状态,由定时任务统一分配计算
             origFileUploadBatch.setStatus(4);//修改为等待通知计算状态,由定时任务统一分配计算
             origFileUploadBatch.setMqContent(JSON.toJSONString(mqMessage));
             origFileUploadBatch.setMqContent(JSON.toJSONString(mqMessage));
-//            origFileUploadBatch.setNoticeTimes(origFileUploadBatch.getNoticeTimes() + 1);
-//            mqMessage.getExt().put("batchId", origFileUploadBatch.getBatchId());
-//            mqMessage.getExt().put("noticeTimes", origFileUploadBatch.getNoticeTimes());
             origFileUploadBatchService.updateById(origFileUploadBatch);
             origFileUploadBatchService.updateById(origFileUploadBatch);
             redisUtil.del("single:upload:uuid:" + unicode);
             redisUtil.del("single:upload:uuid:" + unicode);
+        }else{
+            rabbitMqProducer.sendByWorkQueue(queueModelingPre, mqMessage);
         }
         }
 
 
         Map<String, Object> param = new HashMap<>();
         Map<String, Object> param = new HashMap<>();
@@ -1770,8 +1781,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             log.info("推送事件失败,param:{}", param);
             log.info("推送事件失败,param:{}", param);
         }
         }
 
 
-//        rabbitMqProducer.sendByWorkQueue(queueModelingPre, mqMessage);
-
         return scenePlusVO;
         return scenePlusVO;
     }
     }
 
 
@@ -2376,9 +2385,13 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
 //        System.out.println(s);
 //        System.out.println(s);
 //        System.out.println(UUID.fastUUID());
 //        System.out.println(UUID.fastUUID());
 
 
-        String test = "bpvt00017#1396877795149217792#";
-        String[] split = test.split("#");
-        System.out.println(split);
+//        String test = "bpvt00017#1396877795149217792#";
+//        String[] split = test.split("#");
+//        System.out.println(split);
+        String password = MD5.create().digestHex("Aa123456");
+        System.out.println(password);
+         password = MD5.create().digestHex16("Aa123456");
+        System.out.println(password);
 
 
     }
     }
 
 
@@ -2392,15 +2405,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             throw new BusinessException(ErrorCode.PARAM_REQUIRED.code(), "filePath不能为空");
             throw new BusinessException(ErrorCode.PARAM_REQUIRED.code(), "filePath不能为空");
         }
         }
         SendCallAlgorithmDetail detail = param.getDetails();
         SendCallAlgorithmDetail detail = param.getDetails();
-
-//        //边拍边上传逻辑处理
-//        String callType = param.getDetails().getCallType();
-//        if(StrUtil.isNotEmpty(callType) && callType.equals("UPLOAD_WHILE_SHOOTING")){
-//            String localPath = ConstantFilePath.BUILD_MODEL_PATH + "upload_while_shooting/" + detail.getUuid() + "/" + detail.getIndex() + "/" + detail.getFileName();
-//            HttpUtilExt.downloadFileAndCheck(filePath, localPath, 600000);
-//            return ResultData.ok();
-//        }
-
         String uploadType = detail.getUploadType();
         String uploadType = detail.getUploadType();
         if(StrUtil.isNotEmpty(uploadType) && "log".equals(uploadType)){
         if(StrUtil.isNotEmpty(uploadType) && "log".equals(uploadType)){
             return ResultData.ok();
             return ResultData.ok();
@@ -2470,17 +2474,29 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
     }
     }
 
 
     @Override
     @Override
-    public ResultData noticeBuild(String uuid) throws Exception {
+    public ResultData noticeBuild(String uuid, Long bdId, String dataSource, String uploadType) throws Exception {
         log.info("通知计算,uuid:{} " + uuid);
         log.info("通知计算,uuid:{} " + uuid);
 
 
         String sceneNum = null;
         String sceneNum = null;
+        SceneOrigBd sceneOrigBd = null;
         try {
         try {
             String[] uuidArr = uuid.split("_");
             String[] uuidArr = uuid.split("_");
-
             String snCode = uuidArr[0];
             String snCode = uuidArr[0];
-
-            JSONObject fdageData = JSONObject.parseObject(FileUtils.readFile(sendCallAlgorithmPath.concat(uuid).concat("/data.fdage")));
+            JSONObject fdageData = null;
+            if(StrUtil.isNotEmpty(dataSource)){
+                String homePath = SceneUtil.getHomePath(dataSource);
+                fdageData = JSONObject.parseObject(fYunFileService.getFileContent(homePath + "data.fdage"));
+            }else{
+                fdageData = JSONObject.parseObject(FileUtils.readFile(sendCallAlgorithmPath.concat(uuid).concat("/data.fdage")));
+            }
             int camType = fdageData.getJSONObject("cam").getIntValue("type");
             int camType = fdageData.getJSONObject("cam").getIntValue("type");
+            if(Objects.nonNull(bdId)){
+                sceneOrigBd = sceneOrigBdService.getById(bdId);
+                fdageData.put("taskId", sceneOrigBd.getTaskId());
+                fdageData.put("kNo", sceneOrigBd.getKNo());
+            }
+
+            //相机入库
             String cameraInStoreUrl = fdServiceUrl + ApiConstant.URL_CAMERA_INSTORE;
             String cameraInStoreUrl = fdServiceUrl + ApiConstant.URL_CAMERA_INSTORE;
             Map<String, Object> cameraInStoreParams = new HashMap<>();
             Map<String, Object> cameraInStoreParams = new HashMap<>();
             cameraInStoreParams.put("cameraType", camType);
             cameraInStoreParams.put("cameraType", camType);
@@ -2509,31 +2525,52 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
                 cameraType = 10L;//看看
                 cameraType = 10L;//看看
             }
             }
 
 
-            String fileId = this.getFileId(snCode, uuid);
-            String subFolder = snCode.concat(File.separator).concat(fileId).concat(File.separator).concat(uuid);
-            String dataSource = ConstantFilePath.BUILD_MODEL_PATH.concat(subFolder);
-            log.info("dataSource 为:{}", dataSource);
-
-            JSONObject configJson = JSONObject.parseObject(FileUtils.readFile(sendCallAlgorithmPath.concat(uuid).concat("/config.json")));
-            String folderName = configJson.getString("id");
-            String customUserId = configJson.getString("customUserId");
-            String customUserName = configJson.getString("customUserName");
-            String customUserPwd = configJson.getString("customUserPwd");
-            if(StrUtil.isBlank(folderName) || StrUtil.isBlank(snCode)){
-                throw new RuntimeException("config.json 文件有误!");
+            String ryId = null;
+            String ryNo = null;
+            String password = null;
+            String phone = null;
+            String idCard = null;
+            String jyNo = null;
+            String nickName = null;
+            if(uploadType != null && uploadType.equals("single")){
+                String fileId = this.getFileId(snCode, uuid);
+                String subFolder = snCode.concat(File.separator).concat(fileId).concat(File.separator).concat(uuid);
+                dataSource = ConstantFilePath.BUILD_MODEL_PATH.concat(subFolder);
+                log.info("dataSource 为:{}", dataSource);
+
+                JSONObject configJson = JSONObject.parseObject(FileUtils.readFile(sendCallAlgorithmPath.concat(uuid).concat("/config.json")));
+                String folderName = configJson.getString("id");
+                ryId = configJson.getString("customUserId");
+                ryNo = configJson.getString("customUserName");
+//                password =  AesUtil.encryptCBC(configJson.getString("customUserPwd"), userPasswordKey, userPasswordIv, AesUtil.ALMODE_CBC_NOPADDING);
+                password = MD5.create().digestHex(configJson.getString("customUserPwd"));
+                if(StrUtil.isBlank(folderName) || StrUtil.isBlank(snCode)){
+                    throw new RuntimeException("config.json 文件有误!");
+                }
+            }else{
+                ryId = sceneOrigBd.getRyId();
+                ryNo = sceneOrigBd.getRyId();
+                password = sceneOrigBd.getPassword();
+                phone = sceneOrigBd.getRyPhone();
+                idCard = sceneOrigBd.getRyCid();
+                jyNo = sceneOrigBd.getRyNo();
+                nickName = sceneOrigBd.getRyName();
             }
             }
-
             //推送开始上传状态
             //推送开始上传状态
 
 
             //调注册用户接口
             //调注册用户接口
             Map<String, Object> params = new HashMap<>();
             Map<String, Object> params = new HashMap<>();
-            params.put("ryId", customUserId);
-            params.put("ryNo", customUserName);
-//        params.put("nickName", customUserName);//去掉昵称,又燕海的接口进行判断
-            params.put("password", AesUtil.encryptCBC(customUserPwd, userPasswordKey, userPasswordIv, AesUtil.ALMODE_CBC_NOPADDING));
+            params.put("ryId", ryId);
+            params.put("ryNo", ryNo);
+            params.put("password", password);
+            params.put("phone", phone);
+            params.put("idCard", idCard);
+            params.put("jyNo", jyNo);
+            params.put("nickName", nickName);
             String url = fdServiceUrl.concat(ApiConstant.URL_ADD_UCENTER_USER);
             String url = fdServiceUrl.concat(ApiConstant.URL_ADD_UCENTER_USER);
-            myClient.post(url, params);
-            JyUser jyUser = jyUserService.getByRyId(customUserId);
+            ResultData post1 = myClient.post(url, params);
+            log.info("---------registerUser result:{}-----------", post1);
+            JyUser jyUser = jyUserService.getByRyId(ryId);
             User user = userService.getById(jyUser.getUserId());
             User user = userService.getById(jyUser.getUserId());
             if(Objects.isNull(jyUser)){
             if(Objects.isNull(jyUser)){
                 throw new RuntimeException("注册用户失败");
                 throw new RuntimeException("注册用户失败");
@@ -2549,19 +2586,32 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
                 sceneNum = scene3dNumService.generateSceneNum(cameraDetail.getType());
                 sceneNum = scene3dNumService.generateSceneNum(cameraDetail.getType());
             }
             }
 
 
-            buildScenePost(dataSource, fdageData, "V3", cameraType, sceneNum, camera, cameraDetail, rebuild, "", user, customUserId, "single");
+            buildScenePost(dataSource, fdageData, "V3", cameraType, sceneNum, camera, cameraDetail, rebuild, "", user, ryId, uploadType);
 
 
             scenePlus = scenePlusService.getScenePlusByNum(sceneNum);
             scenePlus = scenePlusService.getScenePlusByNum(sceneNum);
+
             if(cameraType == 14){
             if(cameraType == 14){
                 fdkkLaserService.saveScene(scenePlus,fdageData,camera,user.getUserName(),rebuild == 1 ? true : false, scenePlus.getPayStatus());
                 fdkkLaserService.saveScene(scenePlus,fdageData,camera,user.getUserName(),rebuild == 1 ? true : false, scenePlus.getPayStatus());
             }
             }
+            if(sceneOrigBd != null){
+                sceneOrigBd.setStatus(CommonSuccessStatus.SUCCESS.code());
+                sceneOrigBd.setUpdateTime(null);
+                sceneOrigBdService.updateById(sceneOrigBd);
+            }
 
 
         }catch (Exception e){
         }catch (Exception e){
+            if(sceneOrigBd != null){
+                sceneOrigBd.setStatus(CommonSuccessStatus.FAIL.code());
+                sceneOrigBd.setReason(ExceptionUtil.stacktraceToString(e,5000));
+                sceneOrigBd.setUpdateTime(null);
+                sceneOrigBdService.updateById(sceneOrigBd);
+            }
+
             log.error("通知计算报错,uuid:{}", uuid, e);
             log.error("通知计算报错,uuid:{}", uuid, e);
             if(StrUtil.isNotEmpty(sceneNum)){
             if(StrUtil.isNotEmpty(sceneNum)){
-                scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
-                        .set(ScenePlus::getSceneStatus, SceneStatus.FAILD.code())
-                        .eq(ScenePlus::getNum, sceneNum));
+
+                jmgaService.updateSceneFailAndZipLog(sceneNum, "通知计算报错");
+
                 String buildLogPath = String.format(UploadFilePath.BUILD_LOG_PATH, sceneNum);
                 String buildLogPath = String.format(UploadFilePath.BUILD_LOG_PATH, sceneNum);
                 String preLogPath = buildLogPath + "noticeBuild-error-" + DateUtil.format(new Date(), DatePattern.PURE_DATETIME_PATTERN) + ".log";
                 String preLogPath = buildLogPath + "noticeBuild-error-" + DateUtil.format(new Date(), DatePattern.PURE_DATETIME_PATTERN) + ".log";
                 fYunFileService.uploadFile(ExceptionUtil.stacktraceToString(e).getBytes(StandardCharsets.UTF_8), preLogPath);
                 fYunFileService.uploadFile(ExceptionUtil.stacktraceToString(e).getBytes(StandardCharsets.UTF_8), preLogPath);

+ 20 - 0
src/main/java/com/fdkankan/contro/service/impl/SceneFilenameServiceImpl.java

@@ -0,0 +1,20 @@
+package com.fdkankan.contro.service.impl;
+
+import com.fdkankan.contro.entity.SceneFilename;
+import com.fdkankan.contro.mapper.ISceneFilenameMapper;
+import com.fdkankan.contro.service.ISceneFilenameService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2025-05-07
+ */
+@Service
+public class SceneFilenameServiceImpl extends ServiceImpl<ISceneFilenameMapper, SceneFilename> implements ISceneFilenameService {
+
+}

+ 1 - 1
src/main/java/com/fdkankan/contro/service/impl/SceneMarkShapeServiceImpl.java

@@ -7,7 +7,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.contro.controller.DetectType;
+import com.fdkankan.contro.constant.DetectType;
 import com.fdkankan.contro.entity.SceneMarkShape;
 import com.fdkankan.contro.entity.SceneMarkShape;
 import com.fdkankan.contro.entity.SceneShapeEnum;
 import com.fdkankan.contro.entity.SceneShapeEnum;
 import com.fdkankan.contro.mapper.MarkShapeMapper;
 import com.fdkankan.contro.mapper.MarkShapeMapper;

+ 24 - 0
src/main/java/com/fdkankan/contro/service/impl/SceneOrigBdServiceImpl.java

@@ -0,0 +1,24 @@
+package com.fdkankan.contro.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.contro.entity.SceneOrigBd;
+import com.fdkankan.contro.mapper.ISceneOrigBdMapper;
+import com.fdkankan.contro.service.ISceneOrigBdService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2025-05-07
+ */
+@Service
+public class SceneOrigBdServiceImpl extends ServiceImpl<ISceneOrigBdMapper, SceneOrigBd> implements ISceneOrigBdService {
+
+//    @Override
+//    public SceneOrigBd getEnableOne(String filename) {
+//        return this.getOne(new LambdaQueryWrapper<SceneOrigBd>().eq(SceneOrigBd::getFilename, filename).eq(SceneOrigBd::getStatus, CommonSuccessStatus.WAITING.code()));
+//    }
+}

+ 5 - 0
src/main/java/com/fdkankan/contro/service/impl/ScenePlusServiceImpl.java

@@ -161,4 +161,9 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
         ScenePlus scenePlus = scenePlusService.getById(scenePlusExt.getPlusId());
         ScenePlus scenePlus = scenePlusService.getById(scenePlusExt.getPlusId());
         return scenePlus;
         return scenePlus;
     }
     }
+
+    @Override
+    public ScenePlus getByTaskId(String taskId) {
+        return this.getOne(new LambdaQueryWrapper<ScenePlus>().eq(ScenePlus::getTaskId, taskId));
+    }
 }
 }

+ 11 - 9
src/main/java/com/fdkankan/contro/service/impl/UploadShootingServiceImpl.java

@@ -47,8 +47,8 @@ public class UploadShootingServiceImpl implements UploadShootingService {
     private String userPasswordKey;
     private String userPasswordKey;
     @Value("${user.password.iv:pwel781esd6wglxm}")
     @Value("${user.password.iv:pwel781esd6wglxm}")
     private String userPasswordIv;
     private String userPasswordIv;
-    @Value("${scene.pro.new.url}")
-    private String sceneProNewUrl;
+    @Value("${scene.pro.preview.url}")
+    private String sceneProPreviewUrl;
 
 
     @Resource
     @Resource
     private RedisLockUtil redisLockUtil;
     private RedisLockUtil redisLockUtil;
@@ -92,7 +92,7 @@ public class UploadShootingServiceImpl implements UploadShootingService {
         String uuid = details.getUuid();
         String uuid = details.getUuid();
 
 
         String lockKey = RedisConstants.LOCK_UPLOAD_SHOOTING.replace("@uuid@", details.getUuid()).replace("@index@", String.valueOf(details.getIndex()));
         String lockKey = RedisConstants.LOCK_UPLOAD_SHOOTING.replace("@uuid@", details.getUuid()).replace("@index@", String.valueOf(details.getIndex()));
-        boolean lock = redisLockUtil.lock(lockKey, uuid, 1);
+        boolean lock = redisLockUtil.lock(lockKey, uuid, 2000);
         if (!lock) {//如果拿不到锁,证明
         if (!lock) {//如果拿不到锁,证明
             Thread.sleep(2000L);
             Thread.sleep(2000L);
         }
         }
@@ -137,6 +137,11 @@ public class UploadShootingServiceImpl implements UploadShootingService {
     @Override
     @Override
     public void build(SendCallAlgorithmDetail detail) throws Exception {
     public void build(SendCallAlgorithmDetail detail) throws Exception {
 
 
+        //有点位数据的时候,app会传index,所以这里置空
+        if(detail.getIndex() != null && detail.getIndex() != -1){
+            detail.setIndex(null);
+        }
+
         OrigFileUploadBatch condition = new OrigFileUploadBatch();
         OrigFileUploadBatch condition = new OrigFileUploadBatch();
         condition.setUuid(detail.getUuid());
         condition.setUuid(detail.getUuid());
         condition.setStatus(0);
         condition.setStatus(0);
@@ -157,12 +162,9 @@ public class UploadShootingServiceImpl implements UploadShootingService {
         String title = dataFdage.getString("name");
         String title = dataFdage.getString("name");
 
 
         OrigFileUploadBatch origFileUploadBatch = batches.get(0);
         OrigFileUploadBatch origFileUploadBatch = batches.get(0);
-        if(detail.getIndex() == null || detail.getIndex() != -1){//没有新增点位
-
-        }else{//有新增点位
-
+        if(detail.getIndex() == null || detail.getIndex() != -1){
             OrigFileUpload origFileUpload = origFileUploadService.getByBatchIdAndFileName(origFileUploadBatch.getBatchId(), "config.json");
             OrigFileUpload origFileUpload = origFileUploadService.getByBatchIdAndFileName(origFileUploadBatch.getBatchId(), "config.json");
-            String localPath = ConstantFilePath.BUILD_MODEL_PATH + "upload_while_shooting/" + detail.getUuid() + "/" + detail.getIndex() + "/" + detail.getFileName();
+            String localPath = ConstantFilePath.BUILD_MODEL_PATH + "upload_while_shooting/" + detail.getUuid() + "/" + origFileUploadBatch.getPtIndex() + "/" + detail.getFileName();
             HttpUtilExt.downloadFileAndCheck(origFileUpload.getFileUrl(), localPath, 300000);
             HttpUtilExt.downloadFileAndCheck(origFileUpload.getFileUrl(), localPath, 300000);
 
 
             //入库相机
             //入库相机
@@ -248,7 +250,7 @@ public class UploadShootingServiceImpl implements UploadShootingService {
         scenePlusService.saveOrUpdate(scenePlus);
         scenePlusService.saveOrUpdate(scenePlus);
 
 
         scenePlusExt.setPlusId(scenePlus.getId());
         scenePlusExt.setPlusId(scenePlus.getId());
-        scenePlusExt.setWebSite("/" + sceneProNewUrl + sceneNum);
+        scenePlusExt.setWebSite("/" + sceneProPreviewUrl + sceneNum);
         scenePlusExtService.saveOrUpdate(scenePlusExt);
         scenePlusExtService.saveOrUpdate(scenePlusExt);
 
 
         sceneEditInfo.setTitle(scenePlus.getTitle());
         sceneEditInfo.setTitle(scenePlus.getTitle());

+ 16 - 0
src/main/java/com/fdkankan/contro/util/ExcelUtil.java

@@ -0,0 +1,16 @@
+package com.fdkankan.contro.util;
+
+import com.alibaba.excel.EasyExcel;
+
+import java.util.List;
+
+public class ExcelUtil {
+
+    public static <T> void simpleWrite(List<T> list, String fileName, Class<T> clazz) {
+        // 注意 simpleWrite在数据量不大的情况下可以使用(5000以内,具体也要看实际情况),数据量大参照 重复多次写入
+        // 这里 需要指定写用哪个class去写,然后写到第一个sheet,名字为模板 然后文件流会自动关闭
+        // 如果这里想使用03 则 传入excelType参数即可
+        EasyExcel.write(fileName, clazz).sheet("模板").doWrite(list);
+    }
+
+}

+ 2 - 2
src/main/resources/logback-nacos.xml

@@ -17,9 +17,9 @@
 	<!-- 定义日志保留天数 -->
 	<!-- 定义日志保留天数 -->
 	<property name="MAX_HISTORY" value="180"/>
 	<property name="MAX_HISTORY" value="180"/>
 	<!-- 定义日志文件总大小 -->
 	<!-- 定义日志文件总大小 -->
-	<property name="TOTAL_SIZE_CAP" value="10GB"/>
+	<property name="TOTAL_SIZE_CAP" value="20GB"/>
 	<!-- 定义单个日志文件大小 -->
 	<!-- 定义单个日志文件大小 -->
-	<property name="MAX_FILE_SIZE" value="100MB"/>
+	<property name="MAX_FILE_SIZE" value="200MB"/>
 
 
 
 
 	<!-- 输出到控制台 -->
 	<!-- 输出到控制台 -->

+ 4 - 0
src/main/resources/mapper/contro/SceneBuildProcessLogMapper.xml

@@ -2,4 +2,8 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fdkankan.contro.mapper.ISceneBuildProcessLogMapper">
 <mapper namespace="com.fdkankan.contro.mapper.ISceneBuildProcessLogMapper">
 
 
+
+    <select id="listByNum" resultType="com.fdkankan.contro.entity.SceneBuildProcessLog">
+        select * from t_scene_build_process_log where num = #{num}
+    </select>
 </mapper>
 </mapper>

+ 5 - 0
src/main/resources/mapper/contro/SceneFilenameMapper.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.contro.mapper.ISceneFilenameMapper">
+
+</mapper>

+ 5 - 0
src/main/resources/mapper/contro/SceneOrigBdMapper.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.contro.mapper.ISceneOrigBdMapper">
+
+</mapper>