Prechádzať zdrojové kódy

车辆配置,传感器、gps等公有私有分组

wangzhiqiang 2 rokov pred
rodič
commit
43f6265403
19 zmenil súbory, kde vykonal 302 pridanie a 5 odobranie
  1. 1 0
      api-common/src/main/java/api/common/pojo/param/scene/SceneGeneralTemplateParam.java
  2. 2 0
      api-common/src/main/java/api/common/pojo/vo/model/ConfigSensorVO.java
  3. 17 0
      api-common/src/main/java/api/common/pojo/vo/model/SensorNewVO.java
  4. 10 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/controller/ModelConfigController.java
  5. 16 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/controller/SensorController.java
  6. 3 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/mapper/CameraMapper.java
  7. 1 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/mapper/GpsMapper.java
  8. 1 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/mapper/LidarMapper.java
  9. 36 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/CameraService.java
  10. 17 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/ConfigService.java
  11. 38 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/GpsService.java
  12. 38 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/LidarService.java
  13. 39 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/OgtService.java
  14. 1 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java
  15. 36 0
      simulation-resource-server/src/main/resources/mapper/model/CameraMapper.xml
  16. 4 0
      simulation-resource-server/src/main/resources/mapper/model/ConfigMapper.xml
  17. 16 0
      simulation-resource-server/src/main/resources/mapper/model/GpsMapper.xml
  18. 20 0
      simulation-resource-server/src/main/resources/mapper/model/LidarMapper.xml
  19. 6 0
      simulation-resource-server/src/main/resources/mapper/scene/SceneGeneralTemplateMapper.xml

+ 1 - 0
api-common/src/main/java/api/common/pojo/param/scene/SceneGeneralTemplateParam.java

@@ -32,5 +32,6 @@ public class SceneGeneralTemplateParam extends PageVO implements Serializable {
     private String share;
 
     private List<String> fhNameList;// 用于批量删除的名称列表
+    private String scenarioResume;//场景简述
 
 }

+ 2 - 0
api-common/src/main/java/api/common/pojo/vo/model/ConfigSensorVO.java

@@ -33,4 +33,6 @@ public class ConfigSensorVO {
     private BigDecimal sensorR;
     //传感器端口
     private int sensorPort;
+    //1公有   0私有
+    private String share;
 }

+ 17 - 0
api-common/src/main/java/api/common/pojo/vo/model/SensorNewVO.java

@@ -0,0 +1,17 @@
+package api.common.pojo.vo.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class SensorNewVO {
+    private List camera;
+    private List gps;
+    private List lidar;
+    private List ogt;
+}

+ 10 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/model/controller/ModelConfigController.java

@@ -45,6 +45,16 @@ public class ModelConfigController {
         response.setInfo(configService.getConfigInfo(configVO));
         return response;
     }
+    /**
+     * 根据id获取详情
+     */
+    @RequestMapping("/getConfigInfoNew")
+    public ResponseBodyVO<ConfigVO> getConfigInfoNew(@RequestBody ConfigVO configVO) {
+        ResponseBodyVO<ConfigVO> response = new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);
+        response.setInfo(configService.getConfigInfoNew(configVO));
+        return response;
+    }
+
 
     /**
      * 新增、修改

+ 16 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/model/controller/SensorController.java

@@ -5,6 +5,7 @@ import api.common.pojo.param.model.CameraParam;
 import api.common.pojo.param.model.GpsParam;
 import api.common.pojo.param.model.LidarParam;
 import api.common.pojo.param.model.OgtParam;
+import api.common.pojo.vo.model.SensorNewVO;
 import api.common.pojo.vo.model.SensorVO;
 import com.css.simulation.resource.model.service.CameraService;
 import com.css.simulation.resource.model.service.GpsService;
@@ -48,5 +49,20 @@ public class SensorController {
         );
     }
 
+    /**
+     * 获取私有列表
+     */
+    @RequestMapping("/getMySensorListNew")
+    public ResponseBodyVO<SensorNewVO> getMySensorListNew() {
+
+        return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS,
+                new SensorNewVO(
+                        cameraService.getMyCameraList1(new CameraParam()),
+                        gpsService.getGpsList1(new GpsParam()),
+                        lidarService.getMyLidarList1(new LidarParam()),
+                        ogtService.getMyOgtList1(new OgtParam())
+                )
+        );
+    }
 
 }

+ 3 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/model/mapper/CameraMapper.java

@@ -23,4 +23,7 @@ public interface CameraMapper {
     void update(CameraPO cameraPO);
 
     void delCameraById(CameraPO cameraPO);
+
+    List<CameraVO> getCameraListGy();
+    List<CameraVO> getCameraListSy(CameraParam cameraParam);
 }

+ 1 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/model/mapper/GpsMapper.java

@@ -14,6 +14,7 @@ import java.util.List;
 public interface GpsMapper {
 
     List<GpsVO> getGpsList(GpsParam gpsParam);
+    List<GpsVO> getGpsListGSy(GpsParam gpsParam);
 
     GpsVO getGpsInfo(GpsParam gpsParam);
 

+ 1 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/model/mapper/LidarMapper.java

@@ -14,6 +14,7 @@ import java.util.List;
 public interface LidarMapper {
 
     List<LidarVO> getLidarList(LidarParam lidarParam);
+    List<LidarVO> getLidarListGSy(LidarParam lidarParam);
 
     LidarVO getLidarInfo(LidarParam lidarParam);
 

+ 36 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/CameraService.java

@@ -16,7 +16,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.sql.Timestamp;
-import java.util.List;
+import java.util.*;
 
 @Service
 public class CameraService {
@@ -44,6 +44,41 @@ public class CameraService {
         });
         return cameraList;
     }
+    public List getMyCameraList1(CameraParam cameraParam) {
+
+        cameraParam.setCreateUserId(AuthUtil.getCurrentUserId());
+        List<CameraVO> cameraListSy = cameraMapper.getCameraListSy(cameraParam);
+        List<CameraVO> cameraListGy = cameraMapper.getCameraListGy();
+        List<Map> treeList = new ArrayList<>();
+        Map typeMap = new HashMap();
+        typeMap.put("code", "公有");
+        typeMap.put("name", "公有");
+        List<Map> colourList = new LinkedList();
+        cameraListGy.forEach(vo -> {
+            Map colourMap = new HashMap();
+            colourMap.put("code", vo.getId());
+            colourMap.put("name", vo.getSensorName());
+            colourMap.put("vo", vo);
+            colourList.add(colourMap);
+        });
+        typeMap.put("children", colourList);
+        Map typeMap1 = new HashMap();
+        typeMap1.put("code", "私有");
+        typeMap1.put("name", "私有");
+        List<Map> colourList1 = new LinkedList();
+        cameraListSy.forEach(vo -> {
+            Map colourMap = new HashMap();
+            colourMap.put("code", vo.getId());
+            colourMap.put("name", vo.getSensorName());
+            colourMap.put("vo", vo);
+            colourList1.add(colourMap);
+        });
+        typeMap1.put("children", colourList1);
+        treeList.add(typeMap);
+        treeList.add(typeMap1);
+
+        return treeList;
+    }
 
     public CameraVO getCameraInfo(CameraParam cameraParam) {
         return cameraMapper.getCameraInfo(cameraParam);

+ 17 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/ConfigService.java

@@ -82,6 +82,23 @@ public class ConfigService {
         }
         return configVO;
     }
+    public ConfigVO getConfigInfoNew(ConfigVO configVO) {
+        configVO = configMapper.getConfigInfo(configVO);
+        List<ConfigSensorVO> sensorList = configMapper.getConfigSensors(configVO);
+        for (ConfigSensorVO vo:sensorList) {
+            if(vo.getShare().equals("0")){
+                vo.setSensorName("私有/"+vo.getSensorName());
+            }else if(vo.getShare().equals("1")){
+                vo.setSensorName("公有/"+vo.getSensorName());
+            }
+        }
+        Map<String, List<ConfigSensorVO>> configSensors = sensorList.stream().collect(Collectors.groupingBy(ConfigSensorVO::getSensorType));
+        configVO.setConfigSensors(configSensors);
+        if (ObjectUtil.isNotNull(configVO.getVehicleArray())) {
+            configVO.setVehicleArrayS(configVO.getVehicleArray().split(","));
+        }
+        return configVO;
+    }
 
     public ConfigPO saveConfig(ConfigVO configVO) {
         // 构建主表对象

+ 38 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/GpsService.java

@@ -17,7 +17,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.sql.Timestamp;
-import java.util.List;
+import java.util.*;
 
 @Service
 public class GpsService {
@@ -48,6 +48,43 @@ public class GpsService {
         gpsParam.setShare(null);
         return gpsMapper.getGpsList(gpsParam);
     }
+    public List getGpsList1(GpsParam gpsParam) {
+        gpsParam.setCreateUserId(AuthUtil.getCurrentUserId());
+        gpsParam.setShare("0");
+        List<GpsVO> listSy= gpsMapper.getGpsListGSy(gpsParam);
+        gpsParam.setCreateUserId("");
+        gpsParam.setShare("1");
+        List<GpsVO> listGy= gpsMapper.getGpsListGSy(gpsParam);
+        List<Map> treeList = new ArrayList<>();
+        Map typeMap = new HashMap();
+        typeMap.put("code", "公有");
+        typeMap.put("name", "公有");
+        List<Map> colourList = new LinkedList();
+        listGy.forEach(vo -> {
+            Map colourMap = new HashMap();
+            colourMap.put("code", vo.getId());
+            colourMap.put("name", vo.getSensorName());
+            colourMap.put("vo", vo);
+            colourList.add(colourMap);
+        });
+        typeMap.put("children", colourList);
+        Map typeMap1 = new HashMap();
+        typeMap1.put("code", "私有");
+        typeMap1.put("name", "私有");
+        List<Map> colourList1 = new LinkedList();
+        listSy.forEach(vo -> {
+            Map colourMap = new HashMap();
+            colourMap.put("code", vo.getId());
+            colourMap.put("name", vo.getSensorName());
+            colourMap.put("vo", vo);
+            colourList1.add(colourMap);
+        });
+        typeMap1.put("children", colourList1);
+        treeList.add(typeMap);
+        treeList.add(typeMap1);
+        return treeList;
+    }
+
 
     public List<GpsVO> getMyGpsList(GpsParam gpsParam) {
         gpsParam.setCreateUserId(AuthUtil.getCurrentUserId());

+ 38 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/LidarService.java

@@ -4,6 +4,7 @@ import api.common.pojo.constants.DictConstants;
 import api.common.pojo.param.model.LidarParam;
 import api.common.pojo.po.model.ConfigPO;
 import api.common.pojo.po.model.LidarPO;
+import api.common.pojo.vo.model.GpsVO;
 import api.common.pojo.vo.model.LidarVO;
 import api.common.util.LogUtil;
 import api.common.util.ObjectUtil;
@@ -16,7 +17,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.sql.Timestamp;
-import java.util.List;
+import java.util.*;
 
 @Service
 public class LidarService {
@@ -63,6 +64,42 @@ public class LidarService {
         });
         return list;
     }
+    public List getMyLidarList1(LidarParam lidarParam) {
+        lidarParam.setCreateUserId(AuthUtil.getCurrentUserId());
+        lidarParam.setShare("0");
+        List<LidarVO> listSy = lidarMapper.getLidarListGSy(lidarParam);
+        lidarParam.setCreateUserId("");
+        lidarParam.setShare("1");
+        List<LidarVO> listGy= lidarMapper.getLidarListGSy(lidarParam);
+        List<Map> treeList = new ArrayList<>();
+        Map typeMap = new HashMap();
+        typeMap.put("code", "公有");
+        typeMap.put("name", "公有");
+        List<Map> colourList = new LinkedList();
+        listGy.forEach(vo -> {
+            Map colourMap = new HashMap();
+            colourMap.put("code", vo.getId());
+            colourMap.put("name", vo.getSensorName());
+            colourMap.put("vo", vo);
+            colourList.add(colourMap);
+        });
+        typeMap.put("children", colourList);
+        Map typeMap1 = new HashMap();
+        typeMap1.put("code", "私有");
+        typeMap1.put("name", "私有");
+        List<Map> colourList1 = new LinkedList();
+        listSy.forEach(vo -> {
+            Map colourMap = new HashMap();
+            colourMap.put("code", vo.getId());
+            colourMap.put("name", vo.getSensorName());
+            colourMap.put("vo", vo);
+            colourList1.add(colourMap);
+        });
+        typeMap1.put("children", colourList1);
+        treeList.add(typeMap);
+        treeList.add(typeMap1);
+        return treeList;
+    }
 
     public LidarVO getLidarInfo(LidarParam lidarParam) {
         return lidarMapper.getLidarInfo(lidarParam);

+ 39 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/OgtService.java

@@ -5,6 +5,7 @@ import api.common.pojo.constants.DictConstants;
 import api.common.pojo.param.model.OgtParam;
 import api.common.pojo.po.model.ConfigPO;
 import api.common.pojo.po.model.OgtPO;
+import api.common.pojo.vo.model.LidarVO;
 import api.common.pojo.vo.model.OgtVO;
 import api.common.util.LogUtil;
 import api.common.util.ObjectUtil;
@@ -17,7 +18,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.sql.Timestamp;
-import java.util.List;
+import java.util.*;
 
 @Service
 public class OgtService {
@@ -64,6 +65,43 @@ public class OgtService {
         });
         return list;
     }
+    public List getMyOgtList1(OgtParam ogtParam) {
+        ogtParam.setCreateUserId(AuthUtil.getCurrentUserId());
+        ogtParam.setShare("0");
+        List<OgtVO> listSy = ogtMapper.getOgtList(ogtParam);
+        ogtParam.setCreateUserId("");
+        ogtParam.setShare("1");
+        List<OgtVO> listGy = ogtMapper.getOgtList(ogtParam);
+        List<Map> treeList = new ArrayList<>();
+        Map typeMap = new HashMap();
+        typeMap.put("code", "公有");
+        typeMap.put("name", "公有");
+        List<Map> colourList = new LinkedList();
+        listGy.forEach(vo -> {
+            Map colourMap = new HashMap();
+            colourMap.put("code", vo.getId());
+            colourMap.put("name", vo.getSensorName());
+            colourMap.put("vo", vo);
+            colourList.add(colourMap);
+        });
+        typeMap.put("children", colourList);
+        Map typeMap1 = new HashMap();
+        typeMap1.put("code", "私有");
+        typeMap1.put("name", "私有");
+        List<Map> colourList1 = new LinkedList();
+        listSy.forEach(vo -> {
+            Map colourMap = new HashMap();
+            colourMap.put("code", vo.getId());
+            colourMap.put("name", vo.getSensorName());
+            colourMap.put("vo", vo);
+            colourList1.add(colourMap);
+        });
+        typeMap1.put("children", colourList1);
+        treeList.add(typeMap);
+        treeList.add(typeMap1);
+        return treeList;
+    }
+
 
     public OgtVO getOgtInfo(OgtParam ogtParam) {
         return ogtMapper.getOgtInfo(ogtParam);

+ 1 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java

@@ -2884,7 +2884,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
             addElement(document, "3. 算法测试评分情况", null, bf4, 16, false, 40, false);
             addElement(document, "       为排除其他因素的干扰,科学评价算法效果,本报告将测试场景分为仿真异常场景、未参与评分场景、未达标场景和达标场景4类:", null, bf3, 15, false, 30, false);
-            addElement(document, "       1. 仿真异常场景指的是在仿真过程中报aborted错误的场景,参与得分权重,测试结果均赋0分;", null, bf3, 15, false, 30, false);
+            addElement(document, "       1. 仿真异常场景指的是在仿真过程中报自动终止错误的场景,参与得分权重,测试结果均赋0分;", null, bf3, 15, false, 30, false);
             addElement(document, "       2. 评分失败场景是指因为场景与评分规则不匹配导致程序报错无法对仿真结果进行打分的场景,参与得分权重,测试结果均赋0分;", null, bf3, 15, false, 30, false);
             addElement(document, "       3. 未达标场景是指仿真测试未得到满分的场景;", null, bf3, 15, false, 30, false);
             addElement(document, "       4. 达标场景是指仿真测试得到满分的场景。", null, bf3, 15, false, 30, false);

+ 36 - 0
simulation-resource-server/src/main/resources/mapper/model/CameraMapper.xml

@@ -43,6 +43,42 @@
         order by share asc
     </select>
 
+
+    <select id="getCameraListGy"  resultMap="CameraVOMap">
+        select
+        id,
+        sensor_name,
+        description,
+        fov_h,
+        fov_v,
+        far_distance,
+        near_distance,
+        share
+        from model_sensor_camera c
+        where c.is_deleted = '0'
+       and c.share = '1'
+        order by c.modify_time desc
+    </select>
+
+    <select id="getCameraListSy" parameterType="api.common.pojo.param.model.CameraParam" resultMap="CameraVOMap">
+        select
+        id,
+        sensor_name,
+        description,
+        fov_h,
+        fov_v,
+        far_distance,
+        near_distance,
+        share
+        from model_sensor_camera c
+        where c.is_deleted = '0'
+        <if test="createUserId != null and createUserId != ''">
+            and c.create_user_id = #{createUserId,jdbcType=VARCHAR}
+            and c.share = '0'
+        </if>
+        order by c.modify_time desc
+    </select>
+
     <select id="getCameraInfo" parameterType="api.common.pojo.param.model.CameraParam" resultMap="CameraVOMap">
         select id,
                sensor_code,

+ 4 - 0
simulation-resource-server/src/main/resources/mapper/model/ConfigMapper.xml

@@ -67,6 +67,7 @@
                r.sensor_id,
                s.sensor_name,
                s.description as sensorDescription,
+                s.share,
                r.sensor_type,
                r.sensor_x,
                r.sensor_y,
@@ -86,6 +87,7 @@
                r.sensor_id,
                s.sensor_name,
                s.description as sensorDescription,
+               s.share,
                r.sensor_type,
                r.sensor_x,
                r.sensor_y,
@@ -105,6 +107,7 @@
                r.sensor_id,
                s.sensor_name,
                s.description as sensorDescription,
+               s.share,
                r.sensor_type,
                r.sensor_x,
                r.sensor_y,
@@ -124,6 +127,7 @@
                r.sensor_id,
                s.sensor_name,
                s.description as sensorDescription,
+               s.share,
                r.sensor_type,
                r.sensor_x,
                r.sensor_y,

+ 16 - 0
simulation-resource-server/src/main/resources/mapper/model/GpsMapper.xml

@@ -26,6 +26,22 @@
         </if>
         order by share asc
     </select>
+    <select id="getGpsListGSy" parameterType="api.common.pojo.param.model.GpsParam" resultMap="GpsVOVOMap">
+        select
+        id,
+        sensor_name,
+        description,
+        share
+        from model_sensor_gps
+        where is_deleted = '0'
+        <if test="createUserId != null and createUserId != ''">
+            and create_user_id = #{createUserId,jdbcType=VARCHAR}
+        </if>
+        <if test="share != null and share != ''">
+            and share =  #{share}
+        </if>
+        order by modify_time desc
+    </select>
 
     <select id="getGpsInfo" parameterType="api.common.pojo.param.model.GpsParam" resultMap="GpsVOVOMap">
         select

+ 20 - 0
simulation-resource-server/src/main/resources/mapper/model/LidarMapper.xml

@@ -30,6 +30,26 @@
         </if>
         order by share asc
     </select>
+    <select id="getLidarListGSy" parameterType="api.common.pojo.param.model.LidarParam" resultMap="LidarVOMap">
+        select
+        id,
+        sensor_name,
+        description,
+        share,
+        fov_h,
+        fov_v,
+        far_distance,
+        near_distance
+        from model_sensor_lidar l
+        where l.is_deleted = '0'
+        <if test="createUserId != null and createUserId != ''">
+            and l.create_user_id = #{createUserId,jdbcType=VARCHAR}
+        </if>
+        <if test="share != null and share != ''">
+            and l.share = #{share}
+        </if>
+        order by l.modify_time desc
+    </select>
 
     <select id="getLidarInfo" parameterType="api.common.pojo.param.model.LidarParam" resultMap="LidarVOMap">
         select

+ 6 - 0
simulation-resource-server/src/main/resources/mapper/scene/SceneGeneralTemplateMapper.xml

@@ -119,6 +119,9 @@
             <if test="userId != null and userId != ''">
                 and create_user_id =#{userId}
             </if>
+            <if test="scenarioResume != null and scenarioResume != ''">
+                and scenario_resume like CONCAT('%',#{scenarioResume,jdbcType=VARCHAR},'%')
+            </if>
         order by modify_time desc
         </where>
     </select>
@@ -253,6 +256,9 @@
                     #{item}
                 </foreach>
             </if>
+            <if test="scenarioResume != null and scenarioResume != ''">
+                and scenario_resume like CONCAT('%',#{scenarioResume,jdbcType=VARCHAR},'%')
+            </if>
             order by modify_time desc
         </where>
     </select>