Selaa lähdekoodia

Merge branch 'feature-点云校准' into release

# Conflicts:
#	src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java
dsx 2 vuotta sitten
vanhempi
commit
745b47420c

+ 2 - 6
src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java

@@ -76,12 +76,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
     @Value("${queue.modeling.single.modeling-call}")
     private String singleModelingCall;
 
-    @Value("${queue.modeling.modeling-pre}")
-    private String queueModelingPre;
-
-    @Value("${queue.modeling.modeling-post}")
-    private String queueModelingPost;
-
     @Value("${model.type:#{null}}")
     private String modelType;
 
@@ -324,6 +318,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
                 sceneEditControlsService.update(new LambdaUpdateWrapper<SceneEditControls>().set(SceneEditControls::getShowMap,0)
                         .eq(SceneEditControls::getEditInfoId,sceneEditInfo.getId()));
                 sceneEditControls.setShowMap(0);
+            } else if (new File(path + "/results/laserData/vision_edit.txt").exists()) {
+                fdkkLaserService.cloudPointBuild(sceneCode,path);
             }
 
             log.info("生成scene.json上传oss并设置缓存,num:{}", sceneCode);

+ 2 - 58
src/main/java/com/fdkankan/contro/mq/service/impl/BuildV3SceneServiceImpl.java

@@ -67,9 +67,6 @@ public class BuildV3SceneServiceImpl implements IBuildSceneService {
     @Value("${queue.modeling.v3.modeling-post}")
     private String queueV3ModelingPost;
 
-    @Value("${queue.modeling.v3.modeling-pre}")
-    private String queueV3ModelingPre;
-
     @Value("${model.type:#{null}}")
     private String modelSceneKind;
 
@@ -107,8 +104,6 @@ public class BuildV3SceneServiceImpl implements IBuildSceneService {
 
     @Autowired
     private ISceneProEditService sceneProEditService;
-    @Autowired
-    private ISceneBuildProcessLogService sceneBuildProcessLogService;
 
     @Override
     public void buildScenePre(BuildSceneCallMessage message) {
@@ -276,6 +271,8 @@ public class BuildV3SceneServiceImpl implements IBuildSceneService {
                 //计算成功  激光转台相机 同步 请求
                 fdkkLaserService.syncBuildResult(scenePro.getNum(), scenePro.getDataSource(),scenePro.getCreateTime());
                 sceneProEdit.setMapVisi(0);
+            }else if (new File(path + "/results/laserData/vision_edit.txt").exists()) {
+                fdkkLaserService.cloudPointBuild(sceneCode,path);
             }
             sceneProEditService.updateById(sceneProEdit);
 
@@ -376,32 +373,6 @@ public class BuildV3SceneServiceImpl implements IBuildSceneService {
             map.put(path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam.lzma", imagesPath + ConstantFileName.modelUUID + "_50k.dam.lzma");
             map.put(path + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam", imagesPath + ConstantFileName.modelUUID + "_50k.dam");
         }
-        // TODO: 2023/1/12 3dtiles临时上激光场景
-        //这里适配旧算法和新算法,生成obj|上传3dtiles
-//        if (!ObjectUtils.isEmpty(cameraType) && (!cameraType.equals(14))){
-//            if(this.modelKind.equals(ModelKind.DAM.code())){
-//                CreateObjUtil.convertTxtToDam(resultsPath + "tex" + File.separator + "modeldata.txt", resultsPath + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam");
-//                CreateObjUtil.convertDamToLzma(resultsPath + File.separator + "results/");
-//                CreateObjUtil.convertTxtToDam(resultsPath + File.separator + "results" + File.separator + "tex" + File.separator + "modeldata.txt", resultsPath + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam");
-//                File file = new File(resultsPath + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam.lzma");
-//                while (!file.exists()) {
-//                    Thread.sleep(60000);
-//                }
-//                fYunFileService.uploadFile(resultsPath + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam.lzma", imagesPath + ConstantFileName.modelUUID + "_50k.dam.lzma");
-//                fYunFileService.uploadFile(resultsPath + File.separator + "results" + File.separator + ConstantFileName.modelUUID + "_50k.dam", imagesPath + ConstantFileName.modelUUID + "_50k.dam");
-//            }
-//            if(this.modelKind.equals(ModelKind.THREE_D_TILE.code())){
-//                String threedtilesPath = resultsPath + ModelKind.THREE_D_TILE.code();
-//                String oss3dtilesPath = imagesPath + ModelKind.THREE_D_TILE.code();
-//                List<String> list = FileUtils.list(new File(threedtilesPath));
-//                if(CollUtil.isEmpty(list)){
-//                    log.error("3dtiles目录异常,3dtiles地址:{}", new File(path + File.separator + "results" + File.separator + ModelKind.THREE_D_TILE.code()));
-//                    throw new Exception("3dtiles目录异常");
-//                }
-//                //上传3dtiles文件
-//                fYunFileService.uploadFileByCommand(threedtilesPath, oss3dtilesPath);
-//            }
-//        }
 
         CreateObjUtil.convertTxtToVisionmodeldata(resultsPath + "vision.txt", resultsPath + "vision.modeldata");
         map.put(resultsPath + "vision.txt", imagesPath + "vision.txt");
@@ -595,33 +566,6 @@ public class BuildV3SceneServiceImpl implements IBuildSceneService {
         return uploadFile.keySet().stream().map(File::new).filter(File::exists).mapToLong(File::length).sum();
     }
 
-    /**
-     * <p>
-     双目场景更新数据库
-     * </p>
-     * @author dengsixing
-     * @date 2022/3/21
-     * @param num
-     * @param space
-     **/
-    private void updateDb4Sm(String num, long space){
-        List<ScenePro> ScenePlusList = sceneProService.list(
-            new LambdaQueryWrapper<ScenePro>().select(ScenePro::getId).eq(ScenePro::getNum, num));
-
-        if(CollUtil.isEmpty(ScenePlusList)){
-            return ;
-        }
-
-        List<Long> sceneIds = ScenePlusList.stream().map(ScenePro::getId).collect(Collectors.toList());
-
-        //更新场景创建时间
-        sceneProService.update(new LambdaUpdateWrapper<ScenePro>().in(ScenePro::getId, sceneIds)
-            .set(ScenePro::getStatus, SceneStatus.NO_DISPLAY.code())
-                .set(ScenePro::getSpace,space)
-                .set(ScenePro::getCreateTime,new Date())
-        );
-    }
-
     private ScenePro updateDbPlus(String num, Long space, String videosJson, Long computeTime,boolean isObj){
         sceneProService.update(new LambdaUpdateWrapper<ScenePro>()
                 .eq(ScenePro::getNum, num)

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

@@ -23,4 +23,6 @@ public interface IFdkkLaserService {
     void saveScene(ScenePlus scenePlus, String scenePassword, Camera cameraEntity, String userName, boolean b);
 
     void saveScene(ScenePro scenePro, String scenePassword, Camera cameraEntity, String phone, boolean rebuild);
+
+    void cloudPointBuild(String sceneCode, String visionEditFilePath);
 }

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

@@ -9,6 +9,7 @@ import com.fdkankan.contro.entity.ScenePro;
 import com.fdkankan.contro.service.IFdkkLaserService;
 import com.fdkankan.contro.service.IScenePlusService;
 import com.fdkankan.contro.service.ISceneProService;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
 import com.fdkankan.rabbitmq.util.RabbitMqProducer;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,6 +18,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.ObjectUtils;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
@@ -40,6 +42,18 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
     @Value("${queue.application.laser.update-build-status}")
     private String updateBuildStatus;
 
+    @Value("${queue.application.laser.cloud-point-build}")
+    private String cloudPointBuild;
+
+    @Value("${4dkk.laserService.bucket}")
+    private String bucket;
+
+    @Value("${4dkk.laserService.cloud-point-fyun-path}")
+    private String cloudPointFyunPath;
+
+    @Autowired
+    private FYunFileServiceInterface fYunFileService;
+
 
     public void updateSceneStatus(String sceneCode, int sceneStatus, String path, Date createTime) {
         Map<String, Object> params = new HashMap<>();
@@ -150,4 +164,25 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
         return version;
     }
 
+    @Override
+    public void cloudPointBuild(String sceneCode, String path) {
+        log.info("开始同步点云编辑文件");
+        // 删除旧的文件及目录
+        try {
+            fYunFileService.deleteFile(cloudPointFyunPath + "vision_edit.txt");
+            fYunFileService.deleteFolder(cloudPointFyunPath + "uuidcloud");
+        } catch (IOException e) {
+            log.error("删除文件失败", e);
+            e.printStackTrace();
+        }
+
+        // 上传点云编辑文件,并通知激光系统
+        fYunFileService.uploadFile(bucket,path + "/results/laserData/vision_edit.txt", String.format(cloudPointFyunPath,sceneCode,sceneCode) + "vision_edit.txt");
+        fYunFileService.uploadFileByCommand(bucket,path + "/results/laserData/uuidcloud", String.format(cloudPointFyunPath,sceneCode,sceneCode) + "uuidcloud");
+
+        Map<String, Object> params = new HashMap<>();
+        params.put("sceneNum", sceneCode);
+        params.put("businessType", 0);
+        rabbitMqProducer.sendByWorkQueue(cloudPointBuild, params);
+    }
 }