lyhzzz 4 месяцев назад
Родитель
Сommit
60dd7bd945

+ 10 - 0
README.md

@@ -75,4 +75,14 @@ fd_fusion_xj-init.sql
     /fuison/caseSettings/saveOrUpdate  添加参数locationModelName  模型名称
 2.设备相关,见接口文档
     http://120.25.146.52:3090/project/193/interface/api/cat_2131 
+~~~~
+
+###**v2.1.0**
+~~~~
+一. 场景列表入参修改
+    1.去掉type
+    2.新增isObj   0点云,1mesh
+    3.searchType  0场景列表,1场景共享,2全部
+    4.新增cameraType  入参下拉框为  /fusion/cameraType/allList GET 
+    
 ~~~~

+ 37 - 0
src/main/java/com/fdkankan/fusion/controller/SceneDeptShareController.java

@@ -0,0 +1,37 @@
+package com.fdkankan.fusion.controller;
+
+
+import com.fdkankan.fusion.common.ResultData;
+import com.fdkankan.fusion.entity.SceneDeptShare;
+import com.fdkankan.fusion.service.ISceneDeptShareService;
+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;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2025-11-11
+ */
+@RestController
+@RequestMapping("/sceneDeptShare")
+public class SceneDeptShareController {
+
+    @Autowired
+    ISceneDeptShareService sceneDeptShareService;
+
+    @PostMapping("/share")
+    public ResultData share(@RequestBody SceneDeptShare param){
+        sceneDeptShareService.share(param);
+        return ResultData.ok();
+    }
+
+
+}
+

+ 51 - 0
src/main/java/com/fdkankan/fusion/entity/SceneDeptShare.java

@@ -0,0 +1,51 @@
+package com.fdkankan.fusion.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2025-11-11
+ */
+@Getter
+@Setter
+@TableName("t_scene_dept_share")
+public class SceneDeptShare implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @TableField("num")
+    private String num;
+
+    @TableField("is_obj")
+    private Integer isObj;
+
+    @TableField("dept_id")
+    private String deptId;
+
+    @TableField("tb_status")
+    @TableLogic
+    private Integer tbStatus;
+
+    @TableField("create_time")
+    private Date createTime;
+
+    @TableField("update_time")
+    private Date updateTime;
+
+
+}

+ 5 - 5
src/main/java/com/fdkankan/fusion/generate/AutoGenerate.java

@@ -18,7 +18,7 @@ public class AutoGenerate {
         String path =System.getProperty("user.dir") ;
 
         generate(path,"fusion", getTables(new String[]{
-               "t_camera_type"
+               "t_scene_dept_share"
         }));
 
 //        generate(path,"goods", getTables(new String[]{
@@ -46,10 +46,10 @@ public class AutoGenerate {
 
 
     public static void  generate(String path,String moduleName,  List<String> tables){
-//        FastAutoGenerator.create("jdbc:mysql://120.25.146.52:13306/fd_fusion",
-//                "root","JK123456%JIK")
-        FastAutoGenerator.create("jdbc:mysql://120.24.144.164:3306/4dkankan_v4",
-                "root","4Dage@4Dage#@168")
+        FastAutoGenerator.create("jdbc:mysql://120.25.146.52:13306/fd_fusion",
+                "root","JK123456%JIK")
+//        FastAutoGenerator.create("jdbc:mysql://120.24.144.164:3306/4dkankan_v4",
+//                "root","4Dage@4Dage#@168")
                 .globalConfig(builder -> {
                     builder.author("")               //作者
                             .outputDir(path+"\\src\\main\\java")    //输出路径(写到java目录)

+ 18 - 0
src/main/java/com/fdkankan/fusion/mapper/ISceneDeptShareMapper.java

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

+ 1 - 1
src/main/java/com/fdkankan/fusion/request/ScenePram.java

@@ -22,7 +22,7 @@ public class ScenePram extends RequestBase {
     private Integer isObj;
     private Integer cameraType;
 
-    private Integer searchType = 0;  //0 场景管理列表,1案件添加场景列表
+    private Integer searchType = 0;  //0场景列表,1场景共享,2全部
 
     private String num;
 

+ 2 - 10
src/main/java/com/fdkankan/fusion/response/SceneVo.java

@@ -30,17 +30,9 @@ public class SceneVo extends Model {
     private Boolean bind = true;
     private String deptId;
     private String deptName;
-
-    /**
-     *      "    Scene_Location_Slam  = 0, //slam\n" +
-     *             "    Scene_Location_SFM 1 ,   //sfm\n" +
-     *             "    Scene_Location_SFMAI  2,     //SFM + AI\n" +
-     *             "    Scene_Location_MutiFloor 3 ,    //多楼层\n" +
-     *             "    Scene_Location_PointCloud 4,    //点云\n" +
-     *             "    Scene_Location_SLAMPoint 5,    //slam实时拍\n" +
-     *             "    Scene_Location_SLAMPointAndSFMAI  6   //slam实时拍+站点\n" +
-     */
     private Integer location;
+    private Integer isObj;
+    private Integer cameraType;
 
     private Boolean inFusion = false;
 

+ 17 - 0
src/main/java/com/fdkankan/fusion/service/ISceneDeptShareService.java

@@ -0,0 +1,17 @@
+package com.fdkankan.fusion.service;
+
+import com.fdkankan.fusion.entity.SceneDeptShare;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2025-11-11
+ */
+public interface ISceneDeptShareService extends IService<SceneDeptShare> {
+
+    void share(SceneDeptShare param);
+}

+ 31 - 0
src/main/java/com/fdkankan/fusion/service/impl/SceneDeptShareServiceImpl.java

@@ -0,0 +1,31 @@
+package com.fdkankan.fusion.service.impl;
+
+import com.fdkankan.fusion.common.ResultCode;
+import com.fdkankan.fusion.entity.SceneDeptShare;
+import com.fdkankan.fusion.exception.BusinessException;
+import com.fdkankan.fusion.mapper.ISceneDeptShareMapper;
+import com.fdkankan.fusion.service.ISceneDeptShareService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2025-11-11
+ */
+@Service
+public class SceneDeptShareServiceImpl extends ServiceImpl<ISceneDeptShareMapper, SceneDeptShare> implements ISceneDeptShareService {
+
+    @Override
+    public void share(SceneDeptShare param) {
+        if(StringUtils.isBlank(param.getNum()) || param.getIsObj() == null || StringUtils.isBlank(param.getDeptId())){
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
+        }
+
+
+    }
+}

+ 15 - 101
src/main/java/com/fdkankan/fusion/service/impl/SceneService.java

@@ -86,111 +86,28 @@ public class SceneService implements ISceneService {
 
     @Override
     public PageInfo pageList(ScenePram param) {
-        if(param.getType() == null){
-           throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
-        }
-        List<TmCamera> tmCameraList = null;
-        String tokenValue = null;
-        try {
-             tokenValue = StpUtil.getTokenValue();
-        }catch (Exception e){
-
-        }
 
-        if(StringUtils.isNotBlank(tokenValue) && StringUtils.isBlank(param.getShare()) ){
-            tmCameraList = tmCameraService.getByDeptIds();
-            List<String> snCodes = tmCameraList.stream().map(TmCamera::getCameraSn).collect(Collectors.toList());
-            if(CollectionUtil.isNotEmpty(snCodes)){
-                param.setSnCodes(snCodes);
-            }
-        }
-        if(StringUtils.isNotBlank(param.getDeptId())){
+        if(param.getSearchType() == 0){  //当前组织下场景
+            String deptId = tmDepartmentService.getDeptId();
             List<String> deptIds = new ArrayList<>();
-            if(param.getSearchType() == 0){
-                List<TmDepartment> sonByDeptId = tmDepartmentService.getSonByDeptId(param.getDeptId());
-                deptIds = sonByDeptId.stream().map(TmDepartment::getId).collect(Collectors.toList());
-            }
-            deptIds.add(param.getDeptId());
-            List<TmCamera> tmCameras = tmCameraService.getByDeptIds(deptIds);
-            Set<String> snCodeSet = tmCameras.parallelStream().map(TmCamera::getCameraSn).collect(Collectors.toSet());
-            List<String> snCodes = param.getSnCodes();
-            if(snCodes == null){
-                snCodes = new ArrayList<>(snCodeSet);
-            }else {
-                snCodes = snCodes.stream().filter(snCodeSet::contains).collect(Collectors.toList());
+            deptIds.add(deptId);
+            if(StpUtil.hasRole("admin-super")){
+                List<TmDepartment> sonByDeptId = tmDepartmentService.getSonByDeptId(deptId);
+                deptIds.addAll(sonByDeptId.stream().map(TmDepartment::getId).collect(Collectors.toList()));
             }
-            param.setSnCodes(snCodes);
+            List<TmCamera> tmCameraList = tmCameraService.getByDeptIds(deptIds);
+            List<String> collect = tmCameraList.stream().map(TmCamera::getCameraSn).collect(Collectors.toList());
+            param.setSnCodes(collect);
         }
-        if(param.getCaseId() !=null){
-            String deptId =  caseService.getDeptId(param.getCaseId());
-            List<TmCamera> tmCameras = tmCameraService.getByDeptIds(Arrays.asList(deptId));
-            List<String> snCodes = param.getSnCodes();
-            List<String> snCodes1 = tmCameras.stream().map(TmCamera::getCameraSn).collect(Collectors.toList());
-            snCodes1.add(param.getSnCode());
-            if(snCodes == null){
-                snCodes = snCodes1;
-            }else {
-                snCodes = snCodes.stream().filter(snCodes1::contains).collect(Collectors.toList());
-            }
-            param.setSnCodes(snCodes);
-        }
-        if(CollectionUtil.isEmpty(param.getSnCodes()) && CollectionUtil.isEmpty(param.getNumList())){
-            return PageInfo.PageInfoEmpty();
+        if(param.getSearchType() == 1){  //下级共享给上级场景
+
         }
+        if(param.getSearchType() == 2){  //下级组织共享的场景数据
 
+        }
         Page<SceneVo> sceneVoPage = scenePlusService.sceneList(param);
 
-        List<SceneVo> sceneVoList = new ArrayList<>();
-        long total = 0;
-        if(param.getType() == 0 || param.getType() == 1 || param.getType() == 4 || param.getType() == 6){      //看看,看见 ,深时obj
-            //获取四维(看看,看见)场景数据
-            FdkkResponse fdkkResponse = fdKKClient.sceneList(param);
-            if(fdkkResponse.getCode() !=0){
-                throw new BusinessException(fdkkResponse.getCode(),fdkkResponse.getMsg());
-            }
-            PageInfo pageInfo = JSONObject.parseObject(JSONObject.toJSONString(fdkkResponse.getData()), PageInfo.class);
-            total =  pageInfo.getTotal();
-            JSONArray list = JSONArray.parseArray(JSONObject.toJSONString( pageInfo.getList()));
-            sceneVoList = overSceneVo(list,param.getType());
-
-        }
-        if(param.getType() == 2 || param.getType() == 5){       //深时
-            //获取激光(深时)场景数据
-            LaserSceneParam laserSceneParam = new LaserSceneParam();
-            laserSceneParam.setPageNum(param.getPageNum());
-            laserSceneParam.setPageSize(param.getPageSize());
-            laserSceneParam.setStatus(param.getStatus());
-            laserSceneParam.setSnCode(param.getSnCode());
-            laserSceneParam.setSnCodes(param.getSnCodes());
-            if(param.getType() == 5){
-                laserSceneParam.setSceneSource(5);
-            }
-            if(StringUtils.isNotBlank(param.getSceneName())){
-                laserSceneParam.setTitle(param.getSceneName());
-            }
-            if(param.getNumList() != null && param.getNumList().size() >0){
-                laserSceneParam.setSceneCodes(param.getNumList());
-            }
-            FdkkResponse fdkkResponse = laserClient.sceneList(laserSceneParam);
-            if(fdkkResponse.getCode() !=200){
-                throw new BusinessException(fdkkResponse.getCode(),fdkkResponse.getMsg());
-            }
-            JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(fdkkResponse.getData()));
-            JSONArray list = jsonObject.getJSONArray("list");
-            total =jsonObject.getLong("total");
-            for (Object o : list) {
-                String res = JSONObject.toJSONString(o);
-                SceneVo vo = JSONObject.parseObject(res,SceneVo.class);
-                if( StringUtils.isEmpty(vo.getPhone())){
-                    vo.setBind(false);
-                }
-                if(vo.getStatus() == 4){    //4生成OBJ中设置为计算中
-                    vo.setStatus(0);
-                }
-                vo.setType(param.getType());
-                sceneVoList.add(vo);
-            }
-        }
+        List<SceneVo> sceneVoList = sceneVoPage.getRecords();
         Set<String> snCodes = sceneVoList.stream().map(SceneVo::getSnCode).collect(Collectors.toSet());
         List<SceneVo> modelingScene = sceneVoList.stream().filter(e -> e.getStatus() == 0).collect(Collectors.toList());
         List<String> numList = modelingScene.stream().map(SceneVo::getNum).collect(Collectors.toList());
@@ -207,10 +124,7 @@ public class SceneService implements ISceneService {
                 sceneVo.setStatus(5);
             }
         }
-        Page<SceneVo> voPage = new Page<>(param.getPageNum(),param.getPageSize());
-        voPage.setRecords(sceneVoList);
-        voPage.setTotal(total);
-        return PageInfo.PageInfo(voPage);
+        return PageInfo.PageInfo(sceneVoPage);
     }
 
     /**

+ 1 - 1
src/main/java/com/fdkankan/fusion/task/TaskService.java

@@ -48,7 +48,7 @@ public class TaskService {
                 redisUtil.del(key);
             }
         }
-        modelToMedia();
+        //modelToMedia();
     }
 
     @Autowired

+ 7 - 1
src/main/resources/application-local.yaml

@@ -53,4 +53,10 @@ spring:
     basePath: http://test.4dkankan.com/qjkankan
   takeLookService:
     basePath: https://v4-test.4dkankan.com
-    port: 80
+    port: 80
+
+
+fusion:
+  sign:
+    appid: 051de32597041e41f73b97d61c67a13b
+    publicKey: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9/sgajow5p92r8pubsD0GS8Mcp3m999zWd3Ozlut2lZn6WixukwKHLquGbtW5ZKPdUoHC5czO9508neOgex7f4tacXUDs2Yh+c5GmxN4IRCLN7QC5U/LszJcQimS0Eo0ZBySU6+Rrt7DujIrn6cnMIjhLBFxjBUUI5yqlQDC38wIDAQAB

+ 5 - 0
src/main/resources/mapper/fusion/SceneDeptShareMapper.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.fusion.mapper.ISceneDeptShareMapper">
+
+</mapper>

+ 2 - 2
src/main/resources/mapper/fusion/ScenePlusMapper.xml

@@ -36,9 +36,9 @@
 
 
     <select id="sceneList" resultType="com.fdkankan.fusion.response.SceneVo">
-        select s.id,s.title as sceneName ,s.num,s.create_time,c.sn_code,e.space as sceneSize
+        select s.id,s.title as title,s.title as name ,s.title as sceneName, s.num,s.create_time,c.sn_code,e.space as sceneSize
         ,u.user_name,e.view_count,s.scene_status as status,s.pay_status,'v4' as scene_version,e.web_site , e.thumb
-        ,e.algorithm_time,s.user_id,s.scene_source,e.is_obj,s.build_fail_reason,s.start_build_time,d.type
+        ,e.algorithm_time,s.user_id,s.scene_source,e.is_obj,d.type as cameraType,e.rtk_location,e.orientation
         from t_scene_plus s
         left join t_scene_plus_ext e on s.id = e.plus_id
         left join t_user u on s.user_id = u.id