Selaa lähdekoodia

海鑫分支、江门分支合并

dengsixing 1 viikko sitten
vanhempi
commit
e431d3f4d7
28 muutettua tiedostoa jossa 860 lisäystä ja 65 poistoa
  1. 1 1
      src/main/java/com/fdkankan/contro/controller/SceneFileController.java
  2. 36 0
      src/main/java/com/fdkankan/contro/controller/SceneOrigBdController.java
  3. 51 0
      src/main/java/com/fdkankan/contro/dto/UploadSceneDTO.java
  4. 6 0
      src/main/java/com/fdkankan/contro/entity/SceneFileBuild.java
  5. 55 0
      src/main/java/com/fdkankan/contro/entity/SceneFilename.java
  6. 93 0
      src/main/java/com/fdkankan/contro/entity/SceneOrigBd.java
  7. 11 0
      src/main/java/com/fdkankan/contro/entity/ScenePlus.java
  8. 39 0
      src/main/java/com/fdkankan/contro/httpclient/CustomHttpClient.java
  9. 19 0
      src/main/java/com/fdkankan/contro/httpclient/HaixinClient.java
  10. 18 0
      src/main/java/com/fdkankan/contro/mapper/ISceneFilenameMapper.java
  11. 18 0
      src/main/java/com/fdkankan/contro/mapper/ISceneOrigBdMapper.java
  12. 18 9
      src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java
  13. 13 0
      src/main/java/com/fdkankan/contro/schedule/ScheduleJob.java
  14. 12 0
      src/main/java/com/fdkankan/contro/service/IHaixinService.java
  15. 1 1
      src/main/java/com/fdkankan/contro/service/ISceneFileBuildService.java
  16. 16 0
      src/main/java/com/fdkankan/contro/service/ISceneFilenameService.java
  17. 19 0
      src/main/java/com/fdkankan/contro/service/ISceneOrigBdService.java
  18. 4 0
      src/main/java/com/fdkankan/contro/service/IScenePlusService.java
  19. 8 0
      src/main/java/com/fdkankan/contro/service/MjService.java
  20. 130 0
      src/main/java/com/fdkankan/contro/service/impl/HaixinServiceImpl.java
  21. 0 5
      src/main/java/com/fdkankan/contro/service/impl/JmgaServiceImpl.java
  22. 136 0
      src/main/java/com/fdkankan/contro/service/impl/MjServiceImpl.java
  23. 97 49
      src/main/java/com/fdkankan/contro/service/impl/SceneFileBuildServiceImpl.java
  24. 20 0
      src/main/java/com/fdkankan/contro/service/impl/SceneFilenameServiceImpl.java
  25. 24 0
      src/main/java/com/fdkankan/contro/service/impl/SceneOrigBdServiceImpl.java
  26. 5 0
      src/main/java/com/fdkankan/contro/service/impl/ScenePlusServiceImpl.java
  27. 5 0
      src/main/resources/mapper/contro/SceneFilenameMapper.xml
  28. 5 0
      src/main/resources/mapper/contro/SceneOrigBdMapper.xml

+ 1 - 1
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")

+ 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);
+    }
+
+
+
+
+}

+ 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识别

+ 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/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> {
+
+}

+ 18 - 9
src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java

@@ -165,6 +165,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目录
@@ -201,10 +202,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());
 
 
@@ -443,6 +440,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);
@@ -465,7 +463,6 @@ 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){
@@ -617,6 +614,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;
@@ -650,19 +651,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<>();
@@ -721,7 +727,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(",")));
             }
             }
-
         }
         }
     }
     }
 
 
@@ -840,6 +845,10 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
             gen3dTiles = false;
             gen3dTiles = false;
         }
         }
 
 
+        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("定时任务推送结束");
+    }
 }
 }

+ 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);
+}

+ 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();
+
+
+}

+ 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}")
+    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);
+    }
+}

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

@@ -95,11 +95,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){

+ 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);
+    }
+
+}
+
+

+ 97 - 49
src/main/java/com/fdkankan/contro/service/impl/SceneFileBuildServiceImpl.java

@@ -89,6 +89,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 +248,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 +997,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){
@@ -1015,6 +1027,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             scenePlusExt.setModelKind(modelKind);
             scenePlusExt.setModelKind(modelKind);
         }
         }
 
 
+        //圆周率相机场景用3dtiles模型是
+        if(cameraType == 6){
+            scenePlusExt.setModelKind(modelKind);
+        }
 
 
         if (pic != null && pic.length() > 5) {
         if (pic != null && pic.length() > 5) {
             scenePlusExt.setThumb(pic);
             scenePlusExt.setThumb(pic);
@@ -1673,9 +1689,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"))) {
@@ -1690,13 +1704,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");
@@ -1712,13 +1724,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());
@@ -1726,6 +1740,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"));
@@ -1738,11 +1753,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<>();
@@ -1763,8 +1777,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             log.info("推送事件失败,param:{}", param);
             log.info("推送事件失败,param:{}", param);
         }
         }
 
 
-//        rabbitMqProducer.sendByWorkQueue(queueModelingPre, mqMessage);
-
         return scenePlusVO;
         return scenePlusVO;
     }
     }
 
 
@@ -2385,15 +2397,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();
@@ -2463,17 +2466,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);
@@ -2502,31 +2517,51 @@ 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);
+                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("注册用户失败");
@@ -2542,14 +2577,27 @@ 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>()
                 scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()

+ 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 {
+
+}

+ 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));
+    }
 }
 }

+ 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>