Ver Fonte

泛化模板修改

wangzhiqiang há 2 anos atrás
pai
commit
8cd1bf6f55

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

@@ -7,7 +7,7 @@ import java.io.Serializable;
 import java.util.List;
 
 /**
- * 交通事故场景
+ * 泛化模板
  */
 @EqualsAndHashCode()
 @Data
@@ -22,7 +22,7 @@ public class SceneGeneralTemplateParam extends PageVO implements Serializable {
     private String scenarioTime;  //场景发生时间
     private List<String> fileName;//模块名称
     private String version;//版本号
-
+    private String obsType;//目标物类型
     private String userId;//用户id
 
     private String[] ids ; //回显数组

+ 1 - 0
api-common/src/main/java/api/common/pojo/po/scene/SceneGeneralExamplePO.java

@@ -43,6 +43,7 @@ public class SceneGeneralExamplePO implements Serializable {
     private String obsDurationTime;//目标车轨迹持续时间
     private String obsVelocityTime;//目标速度分段持续时间(s)
     private String obsTrailTime;//目标车轨迹形态分段持续时间
+    private String obsType;//目标物类型
     private String generalizationType;//泛化标志位
     private String scenarioResume;//场景简述
     private String sceneDetailedDescription;//场景详细描述

+ 1 - 0
api-common/src/main/java/api/common/pojo/po/scene/SceneGeneralTemplatePO.java

@@ -44,6 +44,7 @@ public class SceneGeneralTemplatePO implements Serializable {
     private String obsDurationTime;//目标车轨迹持续时间
     private String obsVelocityTime;//目标速度分段持续时间(s)
     private String obsTrailTime;//目标车轨迹形态分段持续时间
+    private String obsType;//目标物类型
     private String generalizationType;//泛化标志位
     private String scenarioResume;//场景简述
     private String sceneDetailedDescription;//场景详细描述

+ 1 - 0
api-common/src/main/java/api/common/pojo/vo/scene/SceneGeneralTemplateMbVO.java

@@ -28,6 +28,7 @@ public class SceneGeneralTemplateMbVO implements Serializable {
     private String obsVelocityTime;//目标速度分段持续时间(s)
     private String obsTrailTime;//目标车轨迹形态分段持续时间
     private String generalizationType;//泛化标志位
+    private String obsType;//目标物类型
 
 
 

+ 0 - 4
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneGeneralExampleService.java

@@ -2,7 +2,6 @@ package com.css.simulation.resource.scene.service;
 
 
 import api.common.pojo.common.ResponseBodyVO;
-import api.common.pojo.param.scene.SceneGeneralTemplateParam;
 import api.common.pojo.po.scene.SceneGeneralDataPO;
 import api.common.pojo.po.scene.SceneGeneralExamplePO;
 import api.common.pojo.po.scene.SceneGeneralTemplatePO;
@@ -13,14 +12,11 @@ import com.css.simulation.resource.common.utils.AuthUtil;
 import com.css.simulation.resource.scene.mapper.SceneGeneralDataMapper;
 import com.css.simulation.resource.scene.mapper.SceneGeneralExampleMapper;
 import com.css.simulation.resource.scene.mapper.SceneGeneralTemplateMapper;
-import com.css.simulation.resource.system.service.DictService;
-import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.http.client.config.RequestConfig;
-import org.apache.poi.ss.usermodel.*;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 

+ 16 - 3
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneGeneralTemplateService.java

@@ -80,7 +80,7 @@ public class SceneGeneralTemplateService {
                             if (r > 0 && c == 3) {
                                 Date aaa = cell.getDateCellValue();
                                 cellValue = TimeUtil.getToStringDate(aaa, 4);
-                            } else {
+                            } else if(cell!=null){
                                 //在读取单元格内容前,设置所有单元格中内容都是字符串类型
                                 cell.setCellType(CellType.STRING);
                                 //按照字符串类型读取单元格内数据
@@ -98,9 +98,18 @@ public class SceneGeneralTemplateService {
                                 parameterTypes[0] = field[a].getType();
                                 Method getOrSet = po.getClass().getDeclaredMethod("set" + name, parameterTypes);
                                 getOrSet.invoke(po, cellValue);
+
+                                if("BSD".equals(sheetName) &&"BSD_3-3".equals(cellValue)){
+                                    System.out.println(
+                                            "111"
+                                    );
+
+                                }
+                                System.out.println(name+"---测试--"+sheetName+"---"+cellValue);
+
                             }
                         }
-                        System.out.println();
+                        System.out.println("--------999-----------");
                         if (r > 0) {
                             po.setCreateTime(TimeUtil.getNowForMysql());
                             po.setCreateUserId(AuthUtil.getCurrentUserId());
@@ -117,6 +126,7 @@ public class SceneGeneralTemplateService {
                 }
                 //}
             }
+            System.out.println("--------888-----------");
             if (ObjectUtil.isNotNull(list)) {
                 SceneGeneralTemplatePO po = list.get(0);
                 po.setFileNameAll(fileNameAll);
@@ -125,6 +135,7 @@ public class SceneGeneralTemplateService {
 
             }
         }catch (Exception e){
+            e.printStackTrace();
         }
 
     }
@@ -167,7 +178,7 @@ public class SceneGeneralTemplateService {
                             if (r > 0 && c == 3) {
                                 Date aaa = cell.getDateCellValue();
                                 cellValue = TimeUtil.getToStringDate(aaa, 4);
-                            } else {
+                            } else  if(cell!=null){
                                 //在读取单元格内容前,设置所有单元格中内容都是字符串类型
                                 cell.setCellType(CellType.STRING);
                                 //按照字符串类型读取单元格内数据
@@ -286,6 +297,7 @@ public class SceneGeneralTemplateService {
         String[]  obsDurationTime= po.getObsDurationTime().split(";");
         String[]  obsVelocityTime= po.getObsVelocityTime().split(";");
         String[]  obsTrailTime= po.getObsTrailTime().split(";");
+        String[]  obsType= po.getObsType().split(";");
 
         String generalizationType=po.getGeneralizationType();
         List<String> list= Arrays.asList(obsStartX);
@@ -302,6 +314,7 @@ public class SceneGeneralTemplateService {
             mbVO.setObsDurationTime(obsDurationTime[i]);
             mbVO.setObsVelocityTime(obsVelocityTime[i]);
             mbVO.setObsTrailTime(obsTrailTime[i]);
+            mbVO.setObsType(obsType[i]);
             Map<String,Integer> map=JsonUtil.jsonToMap(generalizationType);
             for(Map.Entry<String,Integer> entry:map.entrySet()){
                 String value= entry.getValue().toString();

+ 5 - 7
simulation-resource-server/src/main/resources/mapper/scene/SceneGeneralExampleMapper.xml

@@ -14,7 +14,7 @@
         obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
         video_link,file_name,template_id,sublist_id,
         create_user_id,create_time,modify_time,
-        is_deleted) values
+        is_deleted,obs_type) values
         <foreach collection="list" index="index" item="item" separator=",">
             (#{item.id,jdbcType=VARCHAR},#{item.sceneId,jdbcType=VARCHAR},#{item.scenarioName,jdbcType=VARCHAR},#{item.scenarioWeather,jdbcType=VARCHAR},#{item.scenarioTime,jdbcType=VARCHAR},
             #{item.scenarioVehicleModel,jdbcType=VARCHAR}, #{item.scenarioRoadType,jdbcType=VARCHAR}, #{item.scenarioRadiusCurvature,jdbcType=VARCHAR},#{item.egoStartX,jdbcType=VARCHAR}, #{item.egoStartY,jdbcType=VARCHAR},
@@ -26,7 +26,7 @@
             #{item.videoLink},#{item.fileName},#{item.templateId},#{item.sublistId},
 
             #{item.createUserId,jdbcType=VARCHAR},#{item.createTime},#{item.modifyTime},
-            #{item.isDeleted,jdbcType=VARCHAR})
+            #{item.isDeleted,jdbcType=VARCHAR},#{item.obsType})
         </foreach>
     </insert>
 
@@ -42,7 +42,7 @@
         obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
         video_link,file_name,template_id,sublist_id,
         create_user_id,create_time,modify_time,
-        is_deleted) values
+        is_deleted,obs_type) values
           (#{id,jdbcType=VARCHAR},#{sceneId,jdbcType=VARCHAR},#{scenarioName,jdbcType=VARCHAR},#{scenarioWeather,jdbcType=VARCHAR},#{scenarioTime,jdbcType=VARCHAR},
             #{scenarioVehicleModel,jdbcType=VARCHAR}, #{scenarioRoadType,jdbcType=VARCHAR}, #{scenarioRadiusCurvature,jdbcType=VARCHAR},#{egoStartX,jdbcType=VARCHAR}, #{egoStartY,jdbcType=VARCHAR},
             #{egoStartVelocity,jdbcType=VARCHAR}, #{egoHeadingAngle,jdbcType=VARCHAR},#{egoVelocityStatus,jdbcType=VARCHAR},#{egoTrajectory,jdbcType=VARCHAR},#{egoDurationTime,jdbcType=VARCHAR},
@@ -53,13 +53,12 @@
             #{videoLink},#{fileName},#{templateId},#{sublistId},
 
             #{createUserId,jdbcType=VARCHAR},#{createTime},#{modifyTime},
-            #{isDeleted,jdbcType=VARCHAR})
+            #{isDeleted,jdbcType=VARCHAR},#{obsType})
     </insert>
 
 
     <select id="querySceneGeneralExampleById" parameterType="java.lang.String"
             resultType="api.common.pojo.po.scene.SceneGeneralExamplePO">
-
         select
         id,scene_id,scenario_name,scenario_weather,scenario_time,
         scenario_vehicle_model,scenario_road_type,scenario_radius_curvature,ego_start_x,ego_start_y,
@@ -69,10 +68,9 @@
         obs_heading_angle_rel,obs_velocity_status,obs_trajectory,obs_duration_time,obs_velocity_time,
         obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
         video_link,file_name,template_id,sublist_id,
-        create_user_id,create_time,modify_time
+        create_user_id,create_time,modify_time,obs_type
         from simulation.scene_general_example
         where id =#{id,jdbcType=VARCHAR}
-
     </select>
 
 

+ 7 - 4
simulation-resource-server/src/main/resources/mapper/scene/SceneGeneralTemplateMapper.xml

@@ -13,7 +13,7 @@
         obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
         video_link,file_name,version,
         create_user_id,create_time,modify_time,
-        is_deleted) values
+        is_deleted,obs_type) values
         <foreach collection="list" index="index" item="item" separator=",">
             (#{item.id,jdbcType=VARCHAR},#{item.sceneId,jdbcType=VARCHAR},#{item.scenarioName,jdbcType=VARCHAR},#{item.scenarioWeather,jdbcType=VARCHAR},#{item.scenarioTime,jdbcType=VARCHAR},
             #{item.scenarioVehicleModel,jdbcType=VARCHAR}, #{item.scenarioRoadType,jdbcType=VARCHAR}, #{item.scenarioRadiusCurvature,jdbcType=VARCHAR},#{item.egoStartX,jdbcType=VARCHAR}, #{item.egoStartY,jdbcType=VARCHAR},
@@ -25,7 +25,7 @@
             #{item.videoLink},#{item.fileName},#{item.version},
 
             #{item.createUserId,jdbcType=VARCHAR},#{item.createTime},#{item.modifyTime},
-            #{item.isDeleted,jdbcType=VARCHAR})
+            #{item.isDeleted,jdbcType=VARCHAR},#{item.obsType})
         </foreach>
     </insert>
 
@@ -40,7 +40,7 @@
         obs_heading_angle_rel,obs_velocity_status,obs_trajectory,obs_duration_time,obs_velocity_time,
         obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
         video_link,file_name,version,
-        create_user_id,create_time,modify_time
+        create_user_id,create_time,modify_time,obs_type
         from simulation.scene_general_template
         <where>
         is_deleted = '0'
@@ -70,6 +70,9 @@
             <if test="version != null and version != ''">
                 and version= #{version}
             </if>
+            <if test="obsType != null and obsType != ''">
+                and obs_type= #{obsType}
+            </if>
             <if test="allSceneNames != null and allSceneNames.length>0">
                 and scene_id in
                 <foreach collection="allSceneNames" item="item" index="index"
@@ -91,7 +94,7 @@
         obs_heading_angle_rel,obs_velocity_status,obs_trajectory,obs_duration_time,obs_velocity_time,
         obs_trail_time,generalization_type,scenario_resume,scene_detailed_description,evaluating_indicator,
         video_link,file_name,version,is_deleted,
-        create_user_id,create_time,modify_time
+        create_user_id,create_time,modify_time,obs_type
         from simulation.scene_general_template
         where id = #{id,jdbcType=VARCHAR}