浏览代码

场景库模块代码

wangzhiqiang 3 年之前
父节点
当前提交
e50099c422
共有 39 个文件被更改,包括 2674 次插入0 次删除
  1. 35 0
      api-common/src/main/java/api/common/pojo/param/scene/SceneAccidentParam.java
  2. 64 0
      api-common/src/main/java/api/common/pojo/param/scene/SceneNaturalParam.java
  3. 25 0
      api-common/src/main/java/api/common/pojo/param/scene/ScenePackageParam.java
  4. 39 0
      api-common/src/main/java/api/common/pojo/param/scene/ScoringRulesParam.java
  5. 32 0
      api-common/src/main/java/api/common/pojo/param/scene/StandardsRegulationsParam.java
  6. 63 0
      api-common/src/main/java/api/common/pojo/po/scene/SceneAccidentPO.java
  7. 94 0
      api-common/src/main/java/api/common/pojo/po/scene/SceneNaturalPO.java
  8. 58 0
      api-common/src/main/java/api/common/pojo/po/scene/ScenePackagePO.java
  9. 67 0
      api-common/src/main/java/api/common/pojo/po/scene/ScenePackageSublistPO.java
  10. 55 0
      api-common/src/main/java/api/common/pojo/po/scene/ScoringRulesPO.java
  11. 60 0
      api-common/src/main/java/api/common/pojo/po/scene/StandardsRegulationsPO.java
  12. 27 0
      api-common/src/main/java/api/common/pojo/vo/scene/SceneAccidentVO.java
  13. 64 0
      api-common/src/main/java/api/common/pojo/vo/scene/SceneNaturalVO.java
  14. 30 0
      api-common/src/main/java/api/common/pojo/vo/scene/ScenePackageSublistVO.java
  15. 28 0
      api-common/src/main/java/api/common/pojo/vo/scene/ScenePackageVO.java
  16. 44 0
      api-common/src/main/java/api/common/pojo/vo/scene/ScoringRulesVO.java
  17. 25 0
      api-common/src/main/java/api/common/pojo/vo/scene/StandardsRegulationsVO.java
  18. 75 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/SceneAccidentController.java
  19. 66 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/SceneNaturalController.java
  20. 79 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/ScenePackageController.java
  21. 100 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/ScoringRulesController.java
  22. 82 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/StandardsRegulationsController.java
  23. 20 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SceneAccidentMapper.java
  24. 21 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SceneNaturalMapper.java
  25. 27 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/ScenePackageMapper.java
  26. 21 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/ScenePackageSublistMapper.java
  27. 22 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/ScoringRulesMapper.java
  28. 19 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/StandardsRegulationsMapper.java
  29. 174 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneAccidentService.java
  30. 200 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneNaturalService.java
  31. 111 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/ScenePackageService.java
  32. 53 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/ScoringRulesService.java
  33. 103 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/StandardsRegulationsService.java
  34. 74 0
      simulation-resource-server/src/main/resources/mapper/scene/SceneAccidentMapper.xml
  35. 303 0
      simulation-resource-server/src/main/resources/mapper/scene/SceneNaturalMapper.xml
  36. 108 0
      simulation-resource-server/src/main/resources/mapper/scene/ScenePackageMapper.xml
  37. 70 0
      simulation-resource-server/src/main/resources/mapper/scene/ScenePackageSublistMapper.xml
  38. 89 0
      simulation-resource-server/src/main/resources/mapper/scene/ScoringRulesMapper.xml
  39. 47 0
      simulation-resource-server/src/main/resources/mapper/scene/StandardsRegulationsMapper.xml

+ 35 - 0
api-common/src/main/java/api/common/pojo/param/scene/SceneAccidentParam.java

@@ -0,0 +1,35 @@
+package api.common.pojo.param.scene;
+
+import api.common.pojo.common.PageVO;
+import lombok.*;
+
+import java.io.Serializable;
+
+/**
+ * 交通事故场景
+ */
+@EqualsAndHashCode()
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SceneAccidentParam extends PageVO implements Serializable {
+
+    private String accidentId;              // (唯一)
+    private String sceneName;  //场景名称
+    private String[] selfDriving;  //自车驾驶行为
+    private String[] targetDriving;  //目标驾驶行为
+    private String[] selfReaction ; //自车反应行为
+    private String[] conflictBehavior ; //冲突行为
+    private String[] conflictType ; //冲突类型
+
+    private String path ; //文件所在文件夹路径
+
+    private String videoAddress ; //视频地址
+    private String osgbAddress  ;//
+    private String xmlAddress ; //
+    private String xodrAddress ; //
+    private String jsonAddress ; //
+
+
+}

+ 64 - 0
api-common/src/main/java/api/common/pojo/param/scene/SceneNaturalParam.java

@@ -0,0 +1,64 @@
+package api.common.pojo.param.scene;
+
+import api.common.pojo.common.PageVO;
+import lombok.*;
+
+import java.io.Serializable;
+
+/**
+ * 自然驾驶场景
+ */
+@EqualsAndHashCode()
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SceneNaturalParam extends PageVO implements Serializable {
+
+    private String naturalId;              // (唯一)
+    private String naturalName;  //场景编号
+    private String[] weather;  //天气
+    private String[] backlight;  //逆光
+    private String[] lightChange;  //隧道光纤变化
+    private String[] roadType ; //道路类型
+    private String[] roadMatrrial ; //路面材质
+    private String[] drivewayNum ; //车道数量
+    private String[] drivewayType ; //车道类型
+    private String[] roadFlatness  ;//道路平坦程度
+    private String[] roadCurvature ; //道路弯曲程度
+    private String[] ramp ; //匝道
+    private String[] intersectionType; //路口类型
+    private String[] planeIntersection ; //道路与铁路平面交叉
+    private String[] bridge  ;//桥梁
+    private String[] tunnel  ;//隧道
+    private String[] speedLimit ; //速度标志
+    private String[] minSpeedLimit ; //最低速度标志
+    private String[] noEntry  ;//禁止通行
+    private String[] noStopping ; //禁止停车
+    private String[] leftLaneLine ; //左侧车道线
+    private String[] rightLaneLine ; //右侧车道线
+    private String[] conductorMarking ; //导线标线及标志
+    private String[] pedestrianCrossing ; //人行横道
+    private String[] trafficLight ; //交通信号灯
+    private String[] decelerationMarking ; //减速标线
+    private String[] pavementCondition ; //路面状况
+    private String[] naturalDisaster ; //自然灾害
+    private String[] roadSafetySigns  ;//道路施工安全标识
+    private String[] safetyWarningBoard  ;//三角安全警示牌
+    private String[] trafficAccident ; //交通事故
+    private String[] patency ; //通畅情况
+    private String[] specialVehicleYield  ;//特种车辆让行
+    private String[] violation ; //违规
+    private String[] doubleFlashingCar ; //双闪车辆
+    private String[] selfBehavior  ;//自车行为
+    private String[] targetBehavior ; //目标行为
+    private String share ; //是否分析  1为分享
+
+    private String path ; //文件所在文件夹路径
+    private String videoAddress ; //视频地址
+    private String osgbAddress  ;//
+    private String xodrAddress ; //
+    private String xoscAddress ; //
+    private String jsonAddress ; //
+
+}

+ 25 - 0
api-common/src/main/java/api/common/pojo/param/scene/ScenePackageParam.java

@@ -0,0 +1,25 @@
+package api.common.pojo.param.scene;
+
+import api.common.pojo.common.PageVO;
+import lombok.*;
+
+import java.io.Serializable;
+
+/**
+ * 测试场景包
+ */
+@EqualsAndHashCode()
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ScenePackageParam extends PageVO implements Serializable {
+
+    private String packageId  ;//主键Id
+    private String packageName ; //指标名称
+    private String share ; //是否分析  1为分享
+    public String yearMax;//结束时间
+    public String yearMin;//开始时间
+
+
+}

+ 39 - 0
api-common/src/main/java/api/common/pojo/param/scene/ScoringRulesParam.java

@@ -0,0 +1,39 @@
+package api.common.pojo.param.scene;
+
+import api.common.pojo.common.PageVO;
+import lombok.*;
+
+import java.io.Serializable;
+
+/**
+ * 打分规则
+ */
+@EqualsAndHashCode()
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ScoringRulesParam extends PageVO implements Serializable {
+
+    private String rulesId  ;//打分规则Id
+    private String ruleName ; //规则名称
+    private String ruleDescription ; //打分规则描述
+    private String share ; //是否分析  1为分享
+
+    public String yearMax;//结束时间
+
+    public String yearMin;//开始时间
+
+
+
+
+
+
+
+
+
+
+
+
+
+}

+ 32 - 0
api-common/src/main/java/api/common/pojo/param/scene/StandardsRegulationsParam.java

@@ -0,0 +1,32 @@
+package api.common.pojo.param.scene;
+
+import api.common.pojo.common.PageVO;
+import lombok.*;
+
+import java.io.Serializable;
+
+/**
+ * 标准法规场景
+ */
+@EqualsAndHashCode()
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class StandardsRegulationsParam extends PageVO implements Serializable {
+
+    private String regulationsId;              // (唯一)
+    private String sceneName;  //场景名称
+    private String[]  regulationType;  //法规类型
+    private String standardType;  //标准类型
+    private String share ; //是否分析  1为分享
+    private String path ; //文件所在文件夹路径
+
+    private String videoAddress ; //视频地址
+    private String osgbAddress  ;//
+    private String xmlAddress ; //
+    private String xodrAddress ; //
+    private String jsonAddress ; //
+
+
+}

+ 63 - 0
api-common/src/main/java/api/common/pojo/po/scene/SceneAccidentPO.java

@@ -0,0 +1,63 @@
+package api.common.pojo.po.scene;
+
+import lombok.*;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+/**
+ * 交通事故场景
+ */
+@EqualsAndHashCode()
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SceneAccidentPO implements Serializable {
+
+    private String accidentId;              // (唯一)
+    private String sceneName;  //场景名称
+    private String selfDriving;  //自车驾驶行为
+    private String targetDriving;  //目标驾驶行为
+    private String selfReaction ; //自车反应行为
+    private String conflictBehavior ; //冲突行为
+    private String conflictType ; //冲突类型
+    private String share ; //是否分析  1为分享
+    private String videoAddress ; //视频地址
+    private String osgbAddress  ;//
+    private String xmlAddress ; //
+    private String xodrAddress ; //
+    private String jsonAddress ; //
+    /**
+     * 记录创建时间
+     */
+    public Timestamp createTime;
+    /**
+     * 记录最后更新时间(包括删除)
+     */
+    public Timestamp modifyTime;
+    /**
+     * 记录创建人(用户id)
+     */
+    public String createUserId;
+    /**
+     * 记录最后更新人(包括删除)(用户id)
+     */
+    public String modifyUserId;
+    /**
+     * 是否已删除
+     */
+    public String isDeleted;
+
+
+
+
+
+
+
+
+
+
+
+
+}

+ 94 - 0
api-common/src/main/java/api/common/pojo/po/scene/SceneNaturalPO.java

@@ -0,0 +1,94 @@
+package api.common.pojo.po.scene;
+
+import lombok.*;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+/**
+ * 自然驾驶场景
+ */
+@EqualsAndHashCode()
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SceneNaturalPO  implements Serializable {
+
+    private String naturalId;              // (唯一)
+    private String naturalName;  //场景编号
+    private String weather;  //天气
+    private String backlight;  //逆光
+    private String lightChange;  //隧道光纤变化
+    private String roadType ; //道路类型
+    private String roadMatrrial ; //路面材质
+    private String drivewayNum ; //车道数量
+    private String drivewayType ; //车道类型
+    private String roadFlatness  ;//道路平坦程度
+    private String roadCurvature ; //道路弯曲程度
+    private String ramp ; //匝道
+    private String intersectionType; //路口类型
+    private String planeIntersection ; //道路与铁路平面交叉
+    private String bridge  ;//桥梁
+    private String tunnel  ;//隧道
+    private String speedLimit ; //速度标志
+    private String minSpeedLimit ; //最低速度标志
+    private String noEntry  ;//禁止通行
+    private String noStopping ; //禁止停车
+    private String leftLaneLine ; //左侧车道线
+    private String rightLaneLine ; //右侧车道线
+    private String conductorMarking ; //导线标线及标志
+    private String pedestrianCrossing ; //人行横道
+    private String trafficLight ; //交通信号灯
+    private String decelerationMarking ; //减速标线
+    private String pavementCondition ; //路面状况
+    private String naturalDisaster ; //自然灾害
+    private String roadSafetySigns  ;//道路施工安全标识
+    private String safetyWarningBoard  ;//三角安全警示牌
+    private String trafficAccident ; //交通事故
+    private String patency ; //通畅情况
+    private String specialVehicleYield  ;//特种车辆让行
+    private String violation ; //违规
+    private String doubleFlashingCar ; //双闪车辆
+    private String selfBehavior  ;//自车行为
+    private String targetBehavior ; //目标行为
+
+    private String share ; //是否分析  1为分享
+    private String videoAddress ; //视频地址
+    private String osgbAddress  ;//
+    private String xodrAddress ; //
+    private String xoscAddress ; //
+    private String jsonAddress ; //
+    /**
+     * 记录创建时间
+     */
+    public Timestamp createTime;
+    /**
+     * 记录最后更新时间(包括删除)
+     */
+    public Timestamp modifyTime;
+    /**
+     * 记录创建人(用户id)
+     */
+    public String createUserId;
+    /**
+     * 记录最后更新人(包括删除)(用户id)
+     */
+    public String modifyUserId;
+    /**
+     * 是否已删除
+     */
+    public String isDeleted;
+
+
+
+
+
+
+
+
+
+
+
+
+}

+ 58 - 0
api-common/src/main/java/api/common/pojo/po/scene/ScenePackagePO.java

@@ -0,0 +1,58 @@
+package api.common.pojo.po.scene;
+
+import lombok.*;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+/**
+ * 测试场景包
+ */
+@EqualsAndHashCode()
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ScenePackagePO implements Serializable {
+
+    private String packageId  ;//主键Id
+    private String packageName ; //指标名称
+    private String weight;//权重
+    private String rulesName ; //规则名称
+    private String packageAndRules;//关联打分规则Id
+    private Integer sceneNum;//场景数量
+    private String remarks;//备注
+    private String share ; //是否分析  1为分享
+    /**
+     * 记录创建时间
+     */
+    public Timestamp createTime;
+    /**
+     * 记录最后更新时间(包括删除)
+     */
+    public Timestamp modifyTime;
+    /**
+     * 记录创建人(用户id)
+     */
+    public String createUserId;
+    /**
+     * 记录最后更新人(包括删除)(用户id)
+     */
+    public String modifyUserId;
+    /**
+     * 是否已删除
+     */
+    public String isDeleted;
+
+
+
+
+
+
+
+
+
+
+
+
+}

+ 67 - 0
api-common/src/main/java/api/common/pojo/po/scene/ScenePackageSublistPO.java

@@ -0,0 +1,67 @@
+package api.common.pojo.po.scene;
+
+import lombok.*;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+/**
+ * 测试场景包
+ */
+@EqualsAndHashCode()
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ScenePackageSublistPO implements Serializable {
+
+    private String sublistId  ;//主键Id
+    private String sublistName ; //指标名称
+    private String weight;//权重
+    private String ruleName ; //规则名称
+    private String packageAndRules;//关联打分规则Id
+    private String sceneNaturalIds;//关联自然场景ids
+    private String sceneTrafficIds;//关联交通事故场景ids
+    private String sceneStatueIds;//关联标准法规ids
+    private String sceneGeneralizationIds;//关联泛化场景ids
+
+    private Integer sceneNum;//场景数量
+    private String parentId;//父节点id
+    private String rootId;//根id
+    private int seq;//在当前层级下的顺序,由小到大
+    private int packageLevel;//级别
+    private String remarks;//备注
+    private String share ; //是否分析  1为分享
+    /**
+     * 记录创建时间
+     */
+    public Timestamp createTime;
+    /**
+     * 记录最后更新时间(包括删除)
+     */
+    public Timestamp modifyTime;
+    /**
+     * 记录创建人(用户id)
+     */
+    public String createUserId;
+    /**
+     * 记录最后更新人(包括删除)(用户id)
+     */
+    public String modifyUserId;
+    /**
+     * 是否已删除
+     */
+    public String isDeleted;
+
+
+
+
+
+
+
+
+
+
+
+
+}

+ 55 - 0
api-common/src/main/java/api/common/pojo/po/scene/ScoringRulesPO.java

@@ -0,0 +1,55 @@
+package api.common.pojo.po.scene;
+
+import lombok.*;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+/**
+ * 打分规则
+ */
+@EqualsAndHashCode()
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ScoringRulesPO implements Serializable {
+
+    private String rulesId  ;//打分规则Id
+    private String ruleName ; //规则名称
+    private String ruleDescription ; //打分规则描述
+    private String ruleDetails;//打分规则详情
+    private String share ; //是否分析  1为分享
+    /**
+     * 记录创建时间
+     */
+    public Timestamp createTime;
+    /**
+     * 记录最后更新时间(包括删除)
+     */
+    public Timestamp modifyTime;
+    /**
+     * 记录创建人(用户id)
+     */
+    public String createUserId;
+    /**
+     * 记录最后更新人(包括删除)(用户id)
+     */
+    public String modifyUserId;
+    /**
+     * 是否已删除
+     */
+    public String isDeleted;
+
+
+
+
+
+
+
+
+
+
+
+
+}

+ 60 - 0
api-common/src/main/java/api/common/pojo/po/scene/StandardsRegulationsPO.java

@@ -0,0 +1,60 @@
+package api.common.pojo.po.scene;
+
+import lombok.*;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+/**
+ * 标准法规场景
+ */
+@EqualsAndHashCode()
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class StandardsRegulationsPO implements Serializable {
+
+    private String regulationsId;              // (唯一)
+    private String sceneName;  //场景名称
+    private String regulationType;  //法规类型
+    private String standardType;  //标准类型
+    private String share ; //是否分析  1为分享
+    private String videoAddress ; //视频地址
+    private String osgbAddress  ;//
+    private String xmlAddress ; //
+    private String xodrAddress ; //
+    private String jsonAddress ; //
+    /**
+     * 记录创建时间
+     */
+    public Timestamp createTime;
+    /**
+     * 记录最后更新时间(包括删除)
+     */
+    public Timestamp modifyTime;
+    /**
+     * 记录创建人(用户id)
+     */
+    public String createUserId;
+    /**
+     * 记录最后更新人(包括删除)(用户id)
+     */
+    public String modifyUserId;
+    /**
+     * 是否已删除
+     */
+    public String isDeleted;
+
+
+
+
+
+
+
+
+
+
+
+
+}

+ 27 - 0
api-common/src/main/java/api/common/pojo/vo/scene/SceneAccidentVO.java

@@ -0,0 +1,27 @@
+package api.common.pojo.vo.scene;
+
+import api.common.pojo.common.PageVO;
+import lombok.*;
+
+import java.io.Serializable;
+
+/**
+ * 交通事故场景
+ */
+@EqualsAndHashCode()
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SceneAccidentVO extends PageVO implements Serializable {
+
+    private String accidentId;              // (唯一)
+    private String sceneName;  //场景名称
+    private String selfDriving;  //自车驾驶行为
+    private String targetDriving;  //目标驾驶行为
+    private String selfReaction ; //自车反应行为
+    private String conflictBehavior ; //冲突行为
+    private String conflictType ; //冲突类型
+    private String videoAddress ; //视频地址
+
+}

+ 64 - 0
api-common/src/main/java/api/common/pojo/vo/scene/SceneNaturalVO.java

@@ -0,0 +1,64 @@
+package api.common.pojo.vo.scene;
+
+import api.common.pojo.common.PageVO;
+import lombok.*;
+
+import java.io.Serializable;
+
+/**
+ * 自然驾驶场景
+ */
+@EqualsAndHashCode()
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SceneNaturalVO extends PageVO implements Serializable {
+
+    private String naturalId;              // (唯一)
+    private String naturalName;  //场景编号
+    private String weather;  //天气
+    private String backlight;  //逆光
+    private String lightChange;  //隧道光纤变化
+    private String roadType ; //道路类型
+    private String roadMatrrial ; //路面材质
+    private String drivewayNum ; //车道数量
+    private String drivewayType ; //车道类型
+    private String roadFlatness  ;//道路平坦程度
+    private String roadCurvature ; //道路弯曲程度
+    private String ramp ; //匝道
+    private String intersectionType; //路口类型
+    private String planeIntersection ; //道路与铁路平面交叉
+    private String bridge  ;//桥梁
+    private String tunnel  ;//隧道
+    private String speedLimit ; //速度标志
+    private String minSpeedLimit ; //最低速度标志
+    private String noEntry  ;//禁止通行
+    private String noStopping ; //禁止停车
+    private String leftLaneLine ; //左侧车道线
+    private String rightLaneLine ; //右侧车道线
+    private String conductorMarking ; //导线标线及标志
+    private String pedestrianCrossing ; //人行横道
+    private String trafficLight ; //交通信号灯
+    private String decelerationMarking ; //减速标线
+    private String pavementCondition ; //路面状况
+    private String naturalDisaster ; //自然灾害
+    private String roadSafetySigns  ;//道路施工安全标识
+    private String safetyWarningBoard  ;//三角安全警示牌
+    private String trafficAccident ; //交通事故
+    private String patency ; //通畅情况
+    private String specialVehicleYield  ;//特种车辆让行
+    private String violation ; //违规
+    private String doubleFlashingCar ; //双闪车辆
+    private String selfBehavior  ;//自车行为
+    private String targetBehavior ; //目标行为
+
+    private String share ; //是否分析  1为分享
+    private String videoAddress ; //视频地址
+    private String osgbAddress  ;//
+    private String xodrAddress ; //
+    private String xoscAddress ; //
+    private String jsonAddress ; //
+
+
+}

+ 30 - 0
api-common/src/main/java/api/common/pojo/vo/scene/ScenePackageSublistVO.java

@@ -0,0 +1,30 @@
+package api.common.pojo.vo.scene;
+
+import lombok.*;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 测试场景包
+ */
+@EqualsAndHashCode()
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ScenePackageSublistVO implements Serializable {
+
+    private String sublistId  ;//主键Id
+    private String sublistName ; //指标名称
+    private String weight;//权重
+    private String ruleName ; //规则名称
+    private Integer sceneNum;//场景数量
+    private String parentId;//父节点id
+    private String rootId;//根id
+    private int packageLevel;//级别
+    private String remarks;//备注
+    private int seq;//在当前层级下的顺序,由小到大
+    private List<ScenePackageSublistVO>  list;
+
+}

+ 28 - 0
api-common/src/main/java/api/common/pojo/vo/scene/ScenePackageVO.java

@@ -0,0 +1,28 @@
+package api.common.pojo.vo.scene;
+
+import api.common.pojo.common.PageVO;
+import lombok.*;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+/**
+ * 测试场景包
+ */
+@EqualsAndHashCode()
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ScenePackageVO extends PageVO implements Serializable {
+
+    private String packageId  ;//主键Id
+    private String packageName ; //指标名称
+    private Integer sceneNum;//场景数量
+    private String share ; //是否分析  1为分享
+    /**
+     * 记录创建时间
+     */
+    public Timestamp createTime;
+
+}

+ 44 - 0
api-common/src/main/java/api/common/pojo/vo/scene/ScoringRulesVO.java

@@ -0,0 +1,44 @@
+package api.common.pojo.vo.scene;
+
+import api.common.pojo.common.PageVO;
+import lombok.*;
+
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+/**
+ * 打分规则
+ */
+@EqualsAndHashCode()
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ScoringRulesVO extends PageVO implements Serializable {
+
+    private String rulesId  ;//打分规则Id
+    private String ruleName ; //规则名称
+    private String ruleDescription ; //打分规则描述
+    private String share ; //是否分析  1为分享
+    /**
+     * 记录创建时间
+     */
+    public Timestamp createTime;
+    /**
+     * 记录创建人(用户id)
+     */
+    public String createUserId;
+
+
+
+
+
+
+
+
+
+
+
+
+
+}

+ 25 - 0
api-common/src/main/java/api/common/pojo/vo/scene/StandardsRegulationsVO.java

@@ -0,0 +1,25 @@
+package api.common.pojo.vo.scene;
+
+import api.common.pojo.common.PageVO;
+import lombok.*;
+
+import java.io.Serializable;
+
+/**
+ * 标准法规场景
+ */
+@EqualsAndHashCode()
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class StandardsRegulationsVO extends PageVO implements Serializable {
+
+    private String regulationsId;              // (唯一)
+    private String sceneName;  //场景名称
+    private String regulationType;  //法规类型
+    private String standardType;  //标准类型
+    private String share ; //是否分析  1为分享
+    private String videoAddress ; //视频地址
+
+}

+ 75 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/SceneAccidentController.java

@@ -0,0 +1,75 @@
+package com.css.simulation.resource.scene.ctrl;
+
+import api.common.pojo.common.ResponseBodyVO;
+import api.common.pojo.param.scene.SceneAccidentParam;
+import api.common.pojo.po.scene.SceneAccidentPO;
+import api.common.pojo.vo.scene.SceneAccidentVO;
+import com.css.simulation.resource.common.utils.PageUtil;
+import com.css.simulation.resource.feign.FileDownService;
+import com.css.simulation.resource.scene.service.SceneAccidentService;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.BeanUtils;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+//交通事故场景
+@RestController
+@RequestMapping("/SceneAccident")
+public class SceneAccidentController {
+
+    @Resource
+    SceneAccidentService sceneAccidentService;
+
+//查询列表
+    @PostMapping("/querySceneAccidentList")
+    @ResponseBody
+    public ResponseBodyVO<List<SceneAccidentVO>> querySceneAccidentList(@RequestBody SceneAccidentParam parms) {
+        PageUtil.setPageInfo(parms);
+        List<SceneAccidentPO> list=sceneAccidentService.querySceneAccidentList(parms);
+        PageInfo<SceneAccidentPO> objectPageInfo = new PageInfo<>(list);
+        List<SceneAccidentVO> list1=new ArrayList<>();
+        for (SceneAccidentPO po: list) {
+            SceneAccidentVO vo=new SceneAccidentVO();
+            BeanUtils.copyProperties(po,vo);
+            list1.add(vo);
+        }
+        PageInfo pageInfo=new PageInfo<>(list1);
+        pageInfo.setTotal(objectPageInfo.getTotal());
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,pageInfo);
+    }
+
+
+    //新增交通事故
+    @PostMapping("/saveSceneAccident")
+    @ResponseBody
+    public ResponseBodyVO<String> saveSceneAccident(@RequestBody SceneAccidentParam parms) {
+        sceneAccidentService.importJtSg(parms);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
+    }
+
+    //新增交通事故
+    @PostMapping("/saveSceneAccidentCS")
+    @ResponseBody
+    public ResponseBodyVO<String> saveSceneAccidentCS(@RequestBody SceneAccidentParam parms) {
+        sceneAccidentService.importJtSgCS(parms);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
+    }
+    @Resource
+    private FileDownService fileDownService;
+
+    @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    public ResponseBodyVO<String> upload(@RequestPart("file") MultipartFile file,
+                                         @RequestParam("objectName") String objectName) {
+
+        objectName=objectName+"/"+file.getOriginalFilename();
+        System.out.println("上传文件名称--------"+objectName);
+        return fileDownService.upload(file,objectName);
+    }
+
+
+}

+ 66 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/SceneNaturalController.java

@@ -0,0 +1,66 @@
+package com.css.simulation.resource.scene.ctrl;
+
+import api.common.pojo.common.ResponseBodyVO;
+import api.common.pojo.param.scene.SceneNaturalParam;
+import api.common.pojo.po.scene.SceneNaturalPO;
+import api.common.pojo.vo.scene.SceneNaturalVO;
+import com.css.simulation.resource.common.utils.PageUtil;
+import com.css.simulation.resource.feign.FileDownService;
+import com.css.simulation.resource.scene.service.SceneNaturalService;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.BeanUtils;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+//自然场景
+@RestController
+@RequestMapping("/SceneNatural")
+public class SceneNaturalController {
+
+    @Resource
+    SceneNaturalService sceneNaturalService;
+
+//查询列表
+    @PostMapping("/querySceneNaturalList")
+    @ResponseBody
+    public ResponseBodyVO<List<SceneNaturalVO>> querySceneNaturalList(@RequestBody SceneNaturalParam parms) {
+        PageUtil.setPageInfo(parms);
+        List<SceneNaturalPO> list=sceneNaturalService.querySceneNaturalList(parms);
+        PageInfo<SceneNaturalPO> objectPageInfo = new PageInfo<>(list);
+        List<SceneNaturalVO> list1=new ArrayList<>();
+        for (SceneNaturalPO po: list) {
+            SceneNaturalVO vo=new SceneNaturalVO();
+            BeanUtils.copyProperties(po,vo);
+            list1.add(vo);
+        }
+        PageInfo pageInfo=new PageInfo<>(list1);
+        pageInfo.setTotal(objectPageInfo.getTotal());
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,pageInfo);
+    }
+
+
+    //新增标准法规
+    @PostMapping("/saveSceneAccident")
+    @ResponseBody
+    public ResponseBodyVO<String> saveSceneAccident(@RequestBody SceneNaturalParam parms) {
+        sceneNaturalService.importZrjsSceneCicv(parms);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
+    }
+
+    @Resource
+    private FileDownService fileDownService;
+
+    @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    public ResponseBodyVO<String> upload(@RequestPart("file") MultipartFile file,
+                                         @RequestParam("objectName") String objectName) {
+        System.out.println("上传文件名称--------"+file.getOriginalFilename());
+        return fileDownService.upload(file,file.getOriginalFilename());
+    }
+
+
+}

+ 79 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/ScenePackageController.java

@@ -0,0 +1,79 @@
+package com.css.simulation.resource.scene.ctrl;
+
+import api.common.pojo.common.ResponseBodyVO;
+import api.common.pojo.param.scene.ScenePackageParam;
+import api.common.pojo.po.scene.ScenePackagePO;
+import api.common.pojo.vo.scene.ScenePackageSublistVO;
+import api.common.pojo.vo.scene.ScenePackageVO;
+import com.css.simulation.resource.common.utils.PageUtil;
+import com.css.simulation.resource.scene.service.ScenePackageService;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.BeanUtils;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+//测试包
+@RestController
+@RequestMapping("/ScenePackage")
+public class ScenePackageController {
+
+    @Resource
+    ScenePackageService scenePackageService;
+
+//查询主表列表
+    @PostMapping("/queryScenePackageList")
+    @ResponseBody
+    public ResponseBodyVO<List<ScenePackageVO>> queryScenePackageList(@RequestBody ScenePackageParam parms) {
+        PageUtil.setPageInfo(parms);
+        List<ScenePackagePO> list=scenePackageService.queryScenePackageList(parms);
+        PageInfo<ScenePackagePO> objectPageInfo = new PageInfo<>(list);
+        List<ScenePackageVO> list1=new ArrayList<>();
+        for (ScenePackagePO po: list) {
+            ScenePackageVO vo=new ScenePackageVO();
+            BeanUtils.copyProperties(po,vo);
+            list1.add(vo);
+        }
+        PageInfo pageInfo=new PageInfo<>(list1);
+        pageInfo.setTotal(objectPageInfo.getTotal());
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,pageInfo);
+    }
+
+    //查询测试包详情
+    @PostMapping("/queryScenePackage")
+    @ResponseBody
+    public ResponseBodyVO<ScenePackageVO> queryScenePackage(@RequestBody ScenePackageParam parms) {
+       ScenePackagePO po=scenePackageService.queryScenePackage(parms);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,po);
+    }
+
+
+    //新增打分规则
+    @PostMapping("/saveScenePackage")
+    @ResponseBody
+    public ResponseBodyVO<String> saveScoringRules(@RequestBody ScenePackagePO parms) {
+        scenePackageService.saveScenePackage(parms);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
+    }
+
+    //修改打分规则
+    @PostMapping("/updateScenePackage")
+    @ResponseBody
+    public ResponseBodyVO<String> updateScenePackage(@RequestBody ScenePackagePO params)  {
+        scenePackageService.updateScenePackage(params);
+        return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);
+    }
+
+    //查询一个测试包列表
+    @PostMapping("/queryScenePackageSublistList")
+    @ResponseBody
+    public ResponseBodyVO<ScenePackageSublistVO> queryScenePackageSublistList(@RequestBody ScenePackageParam parms) {
+        ScenePackageSublistVO po=  scenePackageService.queryScenePackageSublistList(parms);
+
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,po);
+    }
+
+
+}

+ 100 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/ScoringRulesController.java

@@ -0,0 +1,100 @@
+package com.css.simulation.resource.scene.ctrl;
+
+import api.common.pojo.common.ResponseBodyVO;
+import api.common.pojo.param.MinioParameter;
+import api.common.pojo.param.scene.ScoringRulesParam;
+import api.common.pojo.po.scene.ScoringRulesPO;
+import api.common.pojo.vo.scene.ScoringRulesVO;
+import api.common.util.FileUtil;
+import com.css.simulation.resource.common.utils.PageUtil;
+import com.css.simulation.resource.feign.FileDownService;
+import com.css.simulation.resource.scene.service.ScoringRulesService;
+import com.github.pagehelper.PageInfo;
+import feign.Response;
+import org.springframework.beans.BeanUtils;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+//打分规则
+@RestController
+@RequestMapping("/ScoringRules")
+public class ScoringRulesController {
+
+    @Resource
+    ScoringRulesService scoringRulesService;
+
+//查询列表
+    @PostMapping("/queryScoringRulesList")
+    @ResponseBody
+    public ResponseBodyVO<List<ScoringRulesVO>> queryScoringRulesList(@RequestBody ScoringRulesParam parms) {
+        PageUtil.setPageInfo(parms);
+        List<ScoringRulesPO> list=scoringRulesService.queryScoringRulesList(parms);
+        PageInfo<ScoringRulesPO> scoringRulesPOPageInfo = new PageInfo<>(list);
+        List<ScoringRulesVO> list1=new ArrayList<>();
+        for (ScoringRulesPO po: list) {
+            ScoringRulesVO vo=new ScoringRulesVO();
+            BeanUtils.copyProperties(po,vo);
+            list1.add(vo);
+        }
+        PageInfo pageInfo = new PageInfo(list1);
+        pageInfo.setTotal(scoringRulesPOPageInfo.getTotal());
+
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,pageInfo);
+    }
+
+     //查询详情
+    @PostMapping("/queryScoringRules")
+    @ResponseBody
+    public ResponseBodyVO<List<ScoringRulesPO>> queryScoringRules(@RequestBody ScoringRulesParam parms)  {
+        ScoringRulesPO po=scoringRulesService.queryScoringRules(parms);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,po);
+    }
+
+    //新增打分规则
+    @PostMapping("/saveScoringRules")
+    @ResponseBody
+    public ResponseBodyVO<String> saveScoringRules(@RequestBody ScoringRulesPO parms) {
+        scoringRulesService.saveScoringRules(parms);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
+    }
+
+    //修改打分规则
+    @PostMapping("/updateScoringRules")
+    @ResponseBody
+    public ResponseBodyVO<String> updateScoringRules(@RequestBody ScoringRulesPO params)  {
+       scoringRulesService.updateScoringRules(params);
+        return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);
+    }
+
+
+    @Resource
+    private FileDownService fileDownService;
+
+    @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    public ResponseBodyVO<String> upload(@RequestPart("file") MultipartFile file,
+                                         @RequestParam("objectName") String objectName) {
+        System.out.println("上传文件名称--------"+file.getOriginalFilename());
+        return fileDownService.upload(file,file.getOriginalFilename());
+    }
+
+@GetMapping(value = "/download")
+    public void download(
+            HttpServletResponse response
+    ) throws IOException {
+    MinioParameter parms=new MinioParameter();
+    parms.setObjectName("new4.txt");
+        Response download = fileDownService.download(parms);
+        Response.Body body = download.body();
+        InputStream inputStream = body.asInputStream();
+        FileUtil.downloadForHttp(parms.getObjectName(), inputStream, response, 1024);
+    }
+
+}

+ 82 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/StandardsRegulationsController.java

@@ -0,0 +1,82 @@
+package com.css.simulation.resource.scene.ctrl;
+
+import api.common.pojo.common.ResponseBodyVO;
+import api.common.pojo.param.MinioParameter;
+import api.common.pojo.param.scene.StandardsRegulationsParam;
+import api.common.pojo.po.scene.StandardsRegulationsPO;
+import api.common.pojo.vo.scene.StandardsRegulationsVO;
+import api.common.util.FileUtil;
+import com.css.simulation.resource.common.utils.PageUtil;
+import com.css.simulation.resource.feign.FileDownService;
+import com.css.simulation.resource.scene.service.StandardsRegulationsService;
+import com.github.pagehelper.PageInfo;
+import feign.Response;
+import org.springframework.beans.BeanUtils;
+import org.springframework.http.MediaType;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+//标准法规
+@RestController
+@RequestMapping("/StandardsRegulations")
+public class StandardsRegulationsController {
+
+    @Resource
+    StandardsRegulationsService standardsRegulationsService;
+
+//查询列表
+    @PostMapping("/queryStandardsRegulationsList")
+    @ResponseBody
+    public ResponseBodyVO<List<StandardsRegulationsVO>> queryStandardsRegulationsList(@RequestBody StandardsRegulationsParam parms) {
+        PageUtil.setPageInfo(parms);
+        List<StandardsRegulationsPO> list=standardsRegulationsService.querySceneNaturalList(parms);
+        PageInfo<StandardsRegulationsPO> objectPageInfo = new PageInfo<>(list);
+        List<StandardsRegulationsVO> list1=new ArrayList<>();
+        for (StandardsRegulationsPO po: list) {
+            StandardsRegulationsVO vo=new StandardsRegulationsVO();
+            BeanUtils.copyProperties(po,vo);
+            list1.add(vo);
+        }
+        PageInfo pageInfo=new PageInfo<>(list1);
+        pageInfo.setTotal(objectPageInfo.getTotal());
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,pageInfo);
+    }
+
+
+    //新增标准法规
+    @PostMapping("/saveStandardsRegulations")
+    @ResponseBody
+    public ResponseBodyVO<String> saveStandardsRegulations(@RequestBody StandardsRegulationsParam parms) {
+        standardsRegulationsService.importBzFg(parms);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
+    }
+
+    @Resource
+    private FileDownService fileDownService;
+
+    @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    public ResponseBodyVO<String> upload(@RequestPart("file") MultipartFile file,
+                                         @RequestParam("objectName") String objectName) {
+        System.out.println("上传文件名称--------"+file.getOriginalFilename());
+        return fileDownService.upload(file,file.getOriginalFilename());
+    }
+
+@PostMapping(value = "/download")
+    public void download(
+            HttpServletResponse response,@RequestBody @Validated MinioParameter parms
+    ) throws IOException {
+        Response download = fileDownService.download(parms);
+        Response.Body body = download.body();
+        InputStream inputStream = body.asInputStream();
+        FileUtil.downloadForHttp(parms.getObjectName(), inputStream, response, 1024);
+    }
+
+}

+ 20 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SceneAccidentMapper.java

@@ -0,0 +1,20 @@
+package com.css.simulation.resource.scene.mapper;
+
+
+import api.common.pojo.param.scene.SceneAccidentParam;
+import api.common.pojo.po.scene.SceneAccidentPO;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+
+@Mapper
+@Repository
+public interface SceneAccidentMapper {
+
+   void saveSceneAccident(SceneAccidentPO params);
+
+   List<SceneAccidentPO> querySceneAccidentList(SceneAccidentParam params);
+
+}

+ 21 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SceneNaturalMapper.java

@@ -0,0 +1,21 @@
+package com.css.simulation.resource.scene.mapper;
+
+
+import api.common.pojo.param.scene.SceneNaturalParam;
+import api.common.pojo.po.scene.SceneNaturalPO;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+
+
+@Mapper
+@Repository
+public interface SceneNaturalMapper {
+
+   void saveSceneNatural(SceneNaturalPO params);
+
+   List<SceneNaturalPO> querySceneNaturalList(SceneNaturalParam params);
+
+}

+ 27 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/ScenePackageMapper.java

@@ -0,0 +1,27 @@
+package com.css.simulation.resource.scene.mapper;
+
+
+import api.common.pojo.param.scene.ScenePackageParam;
+import api.common.pojo.po.scene.ScenePackagePO;
+import api.common.pojo.vo.scene.ScenePackageSublistVO;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+
+@Mapper
+@Repository
+public interface ScenePackageMapper {
+
+   void saveScenePackage(ScenePackagePO params);
+   void updateScenePackage(ScenePackagePO params);
+   //查询详情
+   ScenePackagePO queryScenePackage(ScenePackageParam params);
+
+   List<ScenePackagePO> queryScenePackageList(ScenePackageParam params);
+
+   //单独给查询一个测试包的列表用
+   ScenePackageSublistVO queryScenePackageBySublist(String packageId);
+
+}

+ 21 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/ScenePackageSublistMapper.java

@@ -0,0 +1,21 @@
+package com.css.simulation.resource.scene.mapper;
+
+import api.common.pojo.po.scene.ScenePackageSublistPO;
+import api.common.pojo.vo.scene.ScenePackageSublistVO;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+
+@Mapper
+@Repository
+public interface ScenePackageSublistMapper {
+
+   void saveScenePackageSublist(ScenePackageSublistPO params);
+   void saveScenePackageSublistAll(List<ScenePackageSublistPO> list);
+   void updateScenePackageSublist(String  rootId);
+
+   List<ScenePackageSublistVO> queryScenePackageSublistList(ScenePackageSublistPO params);
+
+}

+ 22 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/ScoringRulesMapper.java

@@ -0,0 +1,22 @@
+package com.css.simulation.resource.scene.mapper;
+
+
+import api.common.pojo.param.scene.ScoringRulesParam;
+import api.common.pojo.po.scene.ScoringRulesPO;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+
+@Mapper
+@Repository
+public interface ScoringRulesMapper {
+
+   void saveScoringRules(ScoringRulesPO params);
+
+   List<ScoringRulesPO> queryScoringRulesList(ScoringRulesParam params);
+   ScoringRulesPO queryScoringRules(ScoringRulesParam params);
+   void updateScoringRules(ScoringRulesPO params);
+
+}

+ 19 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/StandardsRegulationsMapper.java

@@ -0,0 +1,19 @@
+package com.css.simulation.resource.scene.mapper;
+
+import api.common.pojo.param.scene.StandardsRegulationsParam;
+import api.common.pojo.po.scene.StandardsRegulationsPO;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+
+@Mapper
+@Repository
+public interface StandardsRegulationsMapper {
+
+   void saveStandardsRegulations(StandardsRegulationsPO params);
+
+   List<StandardsRegulationsPO> queryStandardsRegulationsList(StandardsRegulationsParam params);
+
+}

+ 174 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneAccidentService.java

@@ -0,0 +1,174 @@
+package com.css.simulation.resource.scene.service;
+
+import api.common.pojo.param.MinioParameter;
+import api.common.pojo.param.scene.SceneAccidentParam;
+import api.common.pojo.po.scene.SceneAccidentPO;
+import api.common.util.FileUtil;
+import api.common.util.StringUtil;
+import api.common.util.TimeUtil;
+import com.css.simulation.resource.common.utils.AuthUtil;
+import com.css.simulation.resource.feign.FileDownService;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import feign.Response;
+import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+@Slf4j
+@Service
+public class SceneAccidentService {
+
+    @Resource
+    com.css.simulation.resource.scene.mapper.SceneAccidentMapper SceneAccidentMapper;
+
+
+    @Resource
+    private FileDownService fileDownService;
+    /**
+     * 获取交通事故场景数据:
+     */
+    @SneakyThrows
+    public void importJtSgCS(SceneAccidentParam param) {
+
+        String fileName = null;
+        try {
+            MinioParameter MI=new MinioParameter();
+            MI.setObjectName(param.getJsonAddress());
+            Response download = fileDownService.download(MI);
+            Response.Body body = download.body();
+                // -------------------------------- label.json --------------------------------
+                String json = download.body().toString();;
+                    ObjectMapper objMap = new ObjectMapper();
+                    JsonNode root = objMap.readTree(json);
+
+                    SceneAccidentPO sceneAccidentPO = null;
+                    sceneAccidentPO = sceneAccidentPO.builder()
+                        .accidentId(StringUtil.getRandomUUID())
+                        .sceneName(root.path("场景名称").asText())
+                        .selfDriving(root.path("自车驾驶行为").asText())
+                        .targetDriving(root.path("目标驾驶行为").asText())
+                        .selfReaction(root.path("自车反应行为").asText())
+                        .conflictBehavior(root.path("冲突行为").asText())
+                        .conflictType(root.path("冲突类型").asText())
+                        .isDeleted("0")
+                        .build();
+                // -------------------------------- 保存数据到 mysql --------------------------------
+                    sceneAccidentPO.setCreateTime(TimeUtil.getNowForMysql());
+                    sceneAccidentPO.setCreateUserId(AuthUtil.getCurrentUserId());
+                    sceneAccidentPO.setModifyTime(TimeUtil.getNowForMysql());
+
+                    if(null!=param.getJsonAddress()&&!param.getJsonAddress().equals("")){
+                        sceneAccidentPO.setJsonAddress(param.getJsonAddress());
+                    }
+                    if(null!=param.getXmlAddress()&&!param.getXmlAddress().equals("")){
+                        sceneAccidentPO.setXmlAddress(param.getXmlAddress());
+                    }
+                    if(null!=param.getXodrAddress()&&!param.getXodrAddress().equals("")){
+                        sceneAccidentPO.setXodrAddress(param.getXodrAddress());
+                    }
+                    if(null!=param.getOsgbAddress()&&!param.getOsgbAddress().equals("")){
+                        sceneAccidentPO.setOsgbAddress(param.getOsgbAddress());
+                    }
+                    if(null!=param.getVideoAddress()&&!param.getVideoAddress().equals("")){
+                        sceneAccidentPO.setVideoAddress(param.getVideoAddress());
+                    }
+
+                    SceneAccidentMapper.saveSceneAccident(sceneAccidentPO);
+
+
+
+
+        } catch (Exception e) {
+            log.error("标准法规场景" + fileName + " 解析出错:", e);
+        }
+
+
+    }
+
+    /**
+     * 获取交通事故场景数据:
+     */
+    @SneakyThrows
+    public void importJtSg(SceneAccidentParam param) {
+        //1 获取所有目录下所有场景
+        // String dataUrl0 ="C:\\Users\\CSS\\Desktop\\GQ\\仿真云平台\\测试场景样例数据\\交通事故场景\\China_Expressway_002";     // 场景数据根路径
+        String dataUrl0 =param.getPath();
+        System.out.println("--------"+param.getPath());
+        File[] scenes = FileUtil.getDirectory(dataUrl0).listFiles();
+        if (scenes == null) {
+            throw new RuntimeException("目录:" + dataUrl0 + " 下没有文件!");
+        }
+
+        String fileName = null;
+        try {
+
+            for (File scene : scenes) {
+                String dataUrl = scene.getAbsolutePath();
+                if(dataUrl.indexOf(".json")!=-1){
+                    //获取文件名
+                    File tempFile =new File( dataUrl.trim());
+                    fileName = tempFile.getName();
+                    fileName=  fileName.substring(0,fileName.lastIndexOf("."));
+                    // -------------------------------- 读取结构化数据文件 --------------------------------
+                    List<String> exceptionList = new ArrayList<>();     // 异常列表
+                    // -------------------------------- label.json --------------------------------
+                    String json = FileUtil.readFile(dataUrl);
+                    ObjectMapper objMap = new ObjectMapper();
+                    JsonNode root = objMap.readTree(json);
+
+                    SceneAccidentPO sceneAccidentPO = null;
+                    sceneAccidentPO = sceneAccidentPO.builder()
+                            .accidentId(StringUtil.getRandomUUID())
+                            .sceneName(root.path("场景名称").asText())
+                            .selfDriving(root.path("自车驾驶行为").asText())
+                            .targetDriving(root.path("目标驾驶行为").asText())
+                            .selfReaction(root.path("自车反应行为").asText())
+                            .conflictBehavior(root.path("冲突行为").asText())
+                            .conflictType(root.path("冲突类型").asText())
+                            .isDeleted("0")
+                            .build();
+                    // -------------------------------- 保存数据到 mysql --------------------------------
+                    sceneAccidentPO.setCreateTime(TimeUtil.getNowForMysql());
+                    sceneAccidentPO.setCreateUserId(AuthUtil.getCurrentUserId());
+                    sceneAccidentPO.setModifyTime(TimeUtil.getNowForMysql());
+
+                    if(null!=param.getJsonAddress()&&!param.getJsonAddress().equals("")){
+                        sceneAccidentPO.setJsonAddress(param.getJsonAddress());
+                    }
+                    if(null!=param.getXmlAddress()&&!param.getXmlAddress().equals("")){
+                        sceneAccidentPO.setXmlAddress(param.getXmlAddress());
+                    }
+                    if(null!=param.getXodrAddress()&&!param.getXodrAddress().equals("")){
+                        sceneAccidentPO.setXodrAddress(param.getXodrAddress());
+                    }
+                    if(null!=param.getOsgbAddress()&&!param.getOsgbAddress().equals("")){
+                        sceneAccidentPO.setOsgbAddress(param.getOsgbAddress());
+                    }
+                    if(null!=param.getVideoAddress()&&!param.getVideoAddress().equals("")){
+                        sceneAccidentPO.setVideoAddress(param.getVideoAddress());
+                    }
+
+                    SceneAccidentMapper.saveSceneAccident(sceneAccidentPO);
+
+                }
+
+            }
+        } catch (Exception e) {
+            log.error("标准法规场景" + fileName + " 解析出错:", e);
+        }
+
+
+    }
+
+
+    public   List<SceneAccidentPO> querySceneAccidentList(SceneAccidentParam params) {
+        List<SceneAccidentPO> list = SceneAccidentMapper.querySceneAccidentList(params);
+        return list;
+    }
+}

+ 200 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneNaturalService.java

@@ -0,0 +1,200 @@
+package com.css.simulation.resource.scene.service;
+
+import api.common.pojo.param.scene.SceneNaturalParam;
+import api.common.pojo.po.scene.SceneNaturalPO;
+import api.common.util.FileUtil;
+import api.common.util.TimeUtil;
+import com.css.simulation.resource.common.utils.AuthUtil;
+import com.css.simulation.resource.scene.mapper.SceneNaturalMapper;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.github.pagehelper.util.StringUtil;
+import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+
+
+@Slf4j
+@Service
+public class SceneNaturalService {
+
+    @Resource
+    private SceneNaturalMapper sceneNaturalMapper;
+
+
+
+    /**
+     * 获取自然驾驶场景数据:包括切分数据和标注数据
+     */
+    @SneakyThrows
+    public void importZrjsSceneCicv(SceneNaturalParam param) {
+        //1 获取所有目录下所有场景
+     //  String dataUrl0 ="C:\\Users\\CSS\\Desktop\\GQ\\仿真云平台\\场景数据样例\\测试\\2021-08-06-08-40-47_2";     // 场景数据根路径
+       String dataUrl0 = param.getPath();
+
+        File[] scenes = FileUtil.getDirectory(dataUrl0).listFiles();
+        if (scenes == null) {
+            throw new RuntimeException("目录:" + dataUrl0 + " 下没有文件!");
+        }
+
+        String fileName = null;
+        try {
+
+            for (File scene : scenes) {
+                String dataUrl = scene.getAbsolutePath();
+                if(dataUrl.indexOf(".json")!=-1){
+                    //获取文件名
+                    File tempFile =new File( dataUrl.trim());
+                    fileName = tempFile.getName();
+                    fileName=  fileName.substring(0,fileName.lastIndexOf("."));
+                // -------------------------------- 读取结构化数据文件 --------------------------------
+                List<String> exceptionList = new ArrayList<>();     // 异常列表
+                // -------------------------------- label.json --------------------------------
+                String json = FileUtil.readFile(dataUrl);
+                    ObjectMapper objMap = new ObjectMapper();
+                    JsonNode root = objMap.readTree(json);
+                // -------------------------------- 自然环境 --------------------------------
+                JsonNode naturalEnvironment =  root.path("自然环境");
+                // -------------------------------- 道路 --------------------------------
+                JsonNode road =  root.path("道路");
+                // -------------------------------- 基础设施 --------------------------------
+                JsonNode infrastructure =  root.path("基础设施");
+                // -------------------------------- 临时性操纵 --------------------------------
+                JsonNode temporaryManipulation = root.path("临时性操纵");
+                // -------------------------------- 交通状况 --------------------------------
+                JsonNode traffic =  root.path("交通状况");
+                // -------------------------------- 自车行为 --------------------------------
+                JsonNode selfDrivingBehavior = root.path("自车行为");
+                // -------------------------------- 目标行为 --------------------------------
+                JsonNode targetBehavior =  root.path("目标行为");
+               SceneNaturalPO sceneNaturalPO = null;
+                sceneNaturalPO = sceneNaturalPO.builder()
+                        .naturalId(api.common.util.StringUtil.getRandomUUID())
+                        .naturalName(fileName)
+                        .weather(getSequenceNew(naturalEnvironment, "天气情况"))
+                        .backlight(getSequenceNew(naturalEnvironment, "逆光"))
+                        .lightChange(getSequenceNew(naturalEnvironment, "隧道光线变化"))
+                        .roadType(getSequenceNew(road, "道路类型"))
+                        .roadMatrrial(getSequenceNew(road, "路面材质"))
+                        .drivewayNum(getSequenceNew(road, "车道数量"))
+                        .drivewayType(getSequenceNew(road, "车道类型"))
+                        .roadFlatness(getSequenceNew(road, "道路平坦程度"))
+                        .roadCurvature(getSequenceNew(road, "道路弯曲度"))
+                        .ramp(getSequenceNew(road, "匝道"))
+                        .intersectionType(getSequenceNew(road, "路口类型"))
+                        .planeIntersection(getSequenceNew(road, "道路与铁路平面交叉"))
+                        .bridge(getSequenceNew(road, "桥梁"))
+                        .tunnel(getSequenceNew(road, "隧道"))
+                        .speedLimit(getSequenceNew(infrastructure, "限速标志"))
+                        .minSpeedLimit(getSequenceNew(infrastructure, "最低限速标志"))
+                        .noEntry(getSequenceNew(infrastructure, "禁止通行"))
+                        .noStopping(getSequenceNew(infrastructure, "禁止停车"))
+                        .leftLaneLine(getSequenceNew(infrastructure, "左侧车道线"))
+                        .rightLaneLine(getSequenceNew(infrastructure, "右侧车道线"))
+                        .conductorMarking(getSequenceNew(infrastructure, "导线标线及标志"))
+                        .pedestrianCrossing(getSequenceNew(infrastructure, "人行横道"))
+                        .trafficLight(getSequenceNew(infrastructure, "交通信号灯"))
+                        .decelerationMarking(getSequenceNew(infrastructure, "减速标线"))
+                        .pavementCondition(getSequenceNew(temporaryManipulation, "路面状况"))
+                        .naturalDisaster(getSequenceNew(temporaryManipulation, "自然灾害"))
+                        .roadSafetySigns(getSequenceNew(temporaryManipulation, "道路施工安全标识"))
+                        .safetyWarningBoard(getSequenceNew(temporaryManipulation, "三角安全警示牌"))
+                        .trafficAccident(getSequenceNew(traffic, "交通事故"))
+                        .violation(getSequenceNew(traffic, "违规"))
+                        .specialVehicleYield(getSequenceNew(traffic, "特种车辆让行"))
+                        .patency(getSequenceNew(traffic, "通畅情况"))
+                        .doubleFlashingCar(getSequenceNew(traffic, "双闪车辆"))
+                        .selfBehavior(getSequenceNew(selfDrivingBehavior))
+                        .targetBehavior(getSequenceNew(targetBehavior))
+                        .isDeleted("0")
+                        .build();
+                // -------------------------------- 保存数据到 mysql --------------------------------
+                sceneNaturalPO.setCreateTime(TimeUtil.getNowForMysql());
+                    sceneNaturalPO.setCreateUserId(AuthUtil.getCurrentUserId());
+                sceneNaturalPO.setModifyTime(TimeUtil.getNowForMysql());
+
+                    if(null!=param.getJsonAddress()&&!param.getJsonAddress().equals("")){
+                        sceneNaturalPO.setJsonAddress(param.getJsonAddress());
+                    }
+                    if(null!=param.getXoscAddress()&&!param.getXoscAddress().equals("")){
+                        sceneNaturalPO.setXoscAddress(param.getXoscAddress());
+                    }
+                    if(null!=param.getXodrAddress()&&!param.getXodrAddress().equals("")){
+                        sceneNaturalPO.setXodrAddress(param.getXodrAddress());
+                    }
+                    if(null!=param.getOsgbAddress()&&!param.getOsgbAddress().equals("")){
+                        sceneNaturalPO.setOsgbAddress(param.getOsgbAddress());
+                    }
+                    if(null!=param.getVideoAddress()&&!param.getVideoAddress().equals("")){
+                        sceneNaturalPO.setVideoAddress(param.getVideoAddress());
+                    }
+
+                    sceneNaturalMapper.saveSceneNatural(sceneNaturalPO);
+
+            }
+
+            }
+        } catch (Exception e) {
+            log.error("场景" + fileName + " 解析出错:", e);
+        }
+
+
+    }
+
+    public String getSequenceNew(JsonNode jsonObject, String field) throws Exception {
+        if (jsonObject == null) {
+            return "无法确定";
+        }
+        JsonNode jsonArray = jsonObject.path(field);
+        StringBuilder sequence = new StringBuilder();
+        for (int i = 0; i < jsonArray.size(); i++) {
+            String type_ = jsonArray.path(i).path("type_").asText();
+            if (StringUtil.isNotEmpty(type_)) {
+                if (i == 0) {
+                    sequence.append(type_);
+                    continue;
+                }
+                if (!sequence.toString().contains(type_))
+                    sequence.append(",").append(type_);
+            }
+        }
+        String s = sequence.toString();
+        if (StringUtil.isEmpty(s))
+            return "无法确定";
+        else
+            return s;
+    }
+
+    public String getSequenceNew(JsonNode jsonArray) throws Exception {
+        if (jsonArray == null) {
+            return "无法确定";
+        }
+        StringBuilder sequence = new StringBuilder();
+        for (int i = 0; i < jsonArray.size(); i++) {
+            String type_ = jsonArray.path(i).path("type_").asText();
+            if (StringUtil.isNotEmpty(type_)) {
+                if (i == 0) {
+                    sequence.append(type_);
+                    continue;
+                }
+                if (!sequence.toString().contains(type_))
+                    sequence.append(",").append(type_);
+            }
+        }
+        String s = sequence.toString();
+        if (StringUtil.isEmpty(s))
+            return "无法确定";
+        else
+            return s;
+    }
+    public   List<SceneNaturalPO> querySceneNaturalList(SceneNaturalParam params) {
+        List<SceneNaturalPO> list = sceneNaturalMapper.querySceneNaturalList(params);
+        return list;
+    }
+}

+ 111 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/ScenePackageService.java

@@ -0,0 +1,111 @@
+package com.css.simulation.resource.scene.service;
+
+import api.common.pojo.param.scene.ScenePackageParam;
+import api.common.pojo.po.scene.ScenePackagePO;
+import api.common.pojo.po.scene.ScenePackageSublistPO;
+import api.common.pojo.vo.scene.ScenePackageSublistVO;
+import api.common.util.StringUtil;
+
+import api.common.util.TimeUtil;
+import com.css.simulation.resource.common.utils.AuthUtil;
+import com.css.simulation.resource.scene.mapper.ScenePackageMapper;
+import com.css.simulation.resource.scene.mapper.ScenePackageSublistMapper;
+import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Slf4j
+@Service
+public class ScenePackageService {
+
+    @Resource
+    private ScenePackageMapper scenePackageMapper;
+    @Resource
+    private ScenePackageSublistMapper scenePackageSublistMapper;
+
+
+
+
+    /**
+     * 测试包数据录入:
+     */
+    @SneakyThrows
+    public void saveScenePackage(ScenePackagePO params){
+        params.setCreateTime(TimeUtil.getNowForMysql());
+        params.setModifyTime(TimeUtil.getNowForMysql());
+        params.setCreateUserId(AuthUtil.getCurrentUserId());
+        params.setPackageId(StringUtil.getRandomUUID());
+        params.setIsDeleted("0");
+        scenePackageMapper.saveScenePackage(params);
+    }
+    //查询测试包主表列表
+    @SneakyThrows
+    public   List<ScenePackagePO> queryScenePackageList(ScenePackageParam params){
+        List<ScenePackagePO> list = scenePackageMapper.queryScenePackageList(params);
+        return list;
+    }
+    //查询测试包主表一条数据详情
+    @SneakyThrows
+    public   ScenePackagePO queryScenePackage(ScenePackageParam params){
+
+        return  scenePackageMapper.queryScenePackage(params);
+    }
+    //修改主表数据
+    @SneakyThrows
+    public   void updateScenePackage(ScenePackagePO params) {
+        params.setModifyUserId(StringUtil.getRandomUUID());
+        params.setModifyTime(TimeUtil.getNowForMysql());
+        scenePackageMapper.updateScenePackage(params);
+    }
+
+    //查询一个测试包的指标列表
+    @SneakyThrows
+    public ScenePackageSublistVO queryScenePackageSublistList(ScenePackageParam params){
+        ScenePackageSublistPO po=new ScenePackageSublistPO();
+        po.setParentId(params.getPackageId());
+        ScenePackageSublistVO vo= scenePackageMapper.queryScenePackageBySublist(params.getPackageId());
+        List<ScenePackageSublistVO> list =selectScenePackageSubListTree(null,true,params.getPackageId());
+
+        vo.setList(list);
+        return vo;
+    }
+
+    /**
+     * 级联获取场景指标
+     * @param parentVoList 首次传null
+     * @param isRoot 首次传true
+     * @param scenePackageId 场景包id
+     * @return
+     */
+    public List<ScenePackageSublistVO> selectScenePackageSubListTree(List<ScenePackageSublistVO> parentVoList,
+                                                                     boolean isRoot,String scenePackageId){
+        ScenePackageSublistPO params=new ScenePackageSublistPO();
+        params.setParentId(scenePackageId);
+        if(isRoot){
+            //查找一级节点
+            parentVoList = scenePackageSublistMapper.queryScenePackageSublistList(params);
+            if(parentVoList != null && parentVoList.size() > 0){
+                selectScenePackageSubListTree(parentVoList, false, null);
+            }
+        }else{
+            //获取子节点集合
+            for(ScenePackageSublistVO pvo : parentVoList){
+                params.setParentId(pvo.getSublistId());
+                List<ScenePackageSublistVO> cvoList = scenePackageSublistMapper.queryScenePackageSublistList(params);
+                if(cvoList != null && cvoList.size() > 0){
+                    //存入父节点集合中
+                    pvo.setList(cvoList);
+                    //继续查找下一节点
+                    selectScenePackageSubListTree(cvoList,false, null);
+                }
+            }
+        }
+        return parentVoList;
+    }
+
+
+
+}

+ 53 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/ScoringRulesService.java

@@ -0,0 +1,53 @@
+package com.css.simulation.resource.scene.service;
+
+import api.common.pojo.param.scene.ScoringRulesParam;
+import api.common.pojo.po.scene.ScoringRulesPO;
+import api.common.util.StringUtil;
+import api.common.util.TimeUtil;
+import com.css.simulation.resource.common.utils.AuthUtil;
+import com.css.simulation.resource.scene.mapper.ScoringRulesMapper;
+import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Slf4j
+@Service
+public class ScoringRulesService {
+
+    @Resource
+    private ScoringRulesMapper scoringRulesMapper;
+
+
+
+    /**
+     * 打分规则数据录入:
+     */
+    @SneakyThrows
+    public void saveScoringRules(ScoringRulesPO params){
+        params.setCreateTime(TimeUtil.getNowForMysql());
+        params.setModifyTime(TimeUtil.getNowForMysql());
+        params.setRulesId(StringUtil.getRandomUUID());
+        params.setCreateUserId(AuthUtil.getCurrentUserId());
+        params.setIsDeleted("0");
+        scoringRulesMapper.saveScoringRules(params);
+    }
+    @SneakyThrows
+    public   List<ScoringRulesPO> queryScoringRulesList(ScoringRulesParam params){
+        List<ScoringRulesPO> list = scoringRulesMapper.queryScoringRulesList(params);
+        return list;
+    }
+    @SneakyThrows
+    public   ScoringRulesPO queryScoringRules(ScoringRulesParam params) {
+        ScoringRulesPO Po = scoringRulesMapper.queryScoringRules(params);
+        return Po;
+    }
+    @SneakyThrows
+    public   void updateScoringRules(ScoringRulesPO params) {
+        params.setModifyTime(TimeUtil.getNowForMysql());
+        params.setModifyUserId(AuthUtil.getCurrentUserId());
+         scoringRulesMapper.updateScoringRules(params);
+    }
+}

+ 103 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/StandardsRegulationsService.java

@@ -0,0 +1,103 @@
+package com.css.simulation.resource.scene.service;
+
+import api.common.pojo.param.scene.StandardsRegulationsParam;
+import api.common.pojo.po.scene.StandardsRegulationsPO;
+import api.common.util.FileUtil;
+import api.common.util.StringUtil;
+import api.common.util.TimeUtil;
+import com.css.simulation.resource.common.utils.AuthUtil;
+import com.css.simulation.resource.scene.mapper.StandardsRegulationsMapper;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+@Slf4j
+@Service
+public class StandardsRegulationsService {
+
+    @Resource
+    private StandardsRegulationsMapper standardsRegulationsMapper;
+
+
+
+    /**
+     * 获取标准法规场景数据:
+     */
+    @SneakyThrows
+    public void importBzFg(StandardsRegulationsParam param) {
+        //1 获取所有目录下所有场景
+     //  String dataUrl0 ="C:\\Users\\CSS\\Desktop\\GQ\\仿真云平台\\场景数据样例\\标准法规场景\\ENCAP_001_left25%_stop30";     // 场景数据根路径
+        String dataUrl0=param.getPath();
+        File[] scenes = FileUtil.getDirectory(dataUrl0).listFiles();
+        if (scenes == null) {
+            throw new RuntimeException("目录:" + dataUrl0 + " 下没有文件!");
+        }
+
+        String fileName = null;
+        try {
+
+            for (File scene : scenes) {
+                String dataUrl = scene.getAbsolutePath();
+                if(dataUrl.indexOf(".json")!=-1){
+                    //获取文件名
+                    File tempFile =new File( dataUrl.trim());
+                    fileName = tempFile.getName();
+                    fileName=  fileName.substring(0,fileName.lastIndexOf("."));
+                // -------------------------------- 读取结构化数据文件 --------------------------------
+                List<String> exceptionList = new ArrayList<>();     // 异常列表
+                // -------------------------------- label.json --------------------------------
+                String json = FileUtil.readFile(dataUrl);
+                    ObjectMapper objMap = new ObjectMapper();
+                    JsonNode root = objMap.readTree(json);
+
+                    StandardsRegulationsPO standardsRegulationsPO = null;
+                    standardsRegulationsPO = standardsRegulationsPO.builder()
+                        .regulationsId(StringUtil.getRandomUUID())
+                        .sceneName(root.path("场景名称").asText())
+                        .regulationType(root.path("法规类型").asText())
+                        .standardType(root.path("标准类型").asText())
+                        .isDeleted("0")
+                        .build();
+                // -------------------------------- 保存数据到 mysql --------------------------------
+                    standardsRegulationsPO.setCreateTime(TimeUtil.getNowForMysql());
+                    standardsRegulationsPO.setModifyTime(TimeUtil.getNowForMysql());
+                    standardsRegulationsPO.setCreateUserId(AuthUtil.getCurrentUserId());
+                    if(null!=param.getJsonAddress()&&!param.getJsonAddress().equals("")){
+                        standardsRegulationsPO.setJsonAddress(param.getJsonAddress());
+                    }
+                    if(null!=param.getXmlAddress()&&!param.getXmlAddress().equals("")){
+                        standardsRegulationsPO.setXmlAddress(param.getXmlAddress());
+                    }
+                    if(null!=param.getXodrAddress()&&!param.getXodrAddress().equals("")){
+                        standardsRegulationsPO.setXodrAddress(param.getXodrAddress());
+                    }
+                    if(null!=param.getOsgbAddress()&&!param.getOsgbAddress().equals("")){
+                        standardsRegulationsPO.setOsgbAddress(param.getOsgbAddress());
+                    }
+                    if(null!=param.getVideoAddress()&&!param.getVideoAddress().equals("")){
+                        standardsRegulationsPO.setVideoAddress(param.getVideoAddress());
+                    }
+                    standardsRegulationsMapper.saveStandardsRegulations(standardsRegulationsPO);
+
+            }
+
+            }
+        } catch (Exception e) {
+            log.error("标准法规场景" + fileName + " 解析出错:", e);
+        }
+
+
+    }
+//查看列表
+    public   List<StandardsRegulationsPO> querySceneNaturalList(StandardsRegulationsParam params) {
+        List<StandardsRegulationsPO> list = standardsRegulationsMapper.queryStandardsRegulationsList(params);
+        return list;
+    }
+}

+ 74 - 0
simulation-resource-server/src/main/resources/mapper/scene/SceneAccidentMapper.xml

@@ -0,0 +1,74 @@
+<?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.css.simulation.resource.scene.mapper.SceneAccidentMapper" >
+
+    <insert id="saveSceneAccident" parameterType="api.common.pojo.po.scene.SceneAccidentPO">
+        insert into simulation.scene_accident
+        (accident_id,scene_name,self_driving,target_driving,
+        self_reaction,conflict_behavior,conflict_type,
+       create_user_id,create_time,modify_user_id,modify_time,
+         is_deleted,share,video_address,osgb_address,xml_address,xodr_address,
+        json_address)
+        values (#{accidentId,jdbcType=VARCHAR},#{sceneName,jdbcType=VARCHAR},#{selfDriving,jdbcType=VARCHAR}, #{targetDriving,jdbcType=VARCHAR},
+        #{selfReaction,jdbcType=VARCHAR}, #{conflictBehavior,jdbcType=VARCHAR},#{conflictType,jdbcType=VARCHAR},
+
+       #{createUserId,jdbcType=VARCHAR},#{createTime},#{modifyUserId,jdbcType=VARCHAR},#{modifyTime},
+        #{isDeleted,jdbcType=VARCHAR}, #{share,jdbcType=VARCHAR},#{videoAddress,jdbcType=VARCHAR},#{osgbAddress,jdbcType=VARCHAR},
+        #{xmlAddress,jdbcType=VARCHAR}, #{xodrAddress,jdbcType=VARCHAR},#{jsonAddress,jdbcType=VARCHAR})
+    </insert>
+
+
+    <select id="querySceneAccidentList" parameterType="api.common.pojo.param.scene.SceneAccidentParam" resultType="api.common.pojo.po.scene.SceneNaturalPO">
+        select
+        accident_id,scene_name,self_driving,target_driving,
+        self_reaction,conflict_behavior,conflict_type,
+        create_user_id,create_time,modify_user_id,modify_time,
+        is_deleted,share,video_address,osgb_address,xml_address,xodr_address,
+        json_address
+        from simulation.scene_accident
+        <where>
+            is_deleted = '0'
+            <if test="sceneName != null and sceneName != ''">
+                and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
+            </if>
+
+            <if test="selfDriving != null and selfDriving != ''">
+            and   self_driving  in
+            <foreach collection="selfDriving" item="item" index="index"
+                     separator="," open="(" close=")">
+                #{item}
+            </foreach>
+            </if>
+            <if test="targetDriving != null and targetDriving != ''">
+               and   target_driving  in
+                <foreach collection="targetDriving" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="selfReaction != null and selfReaction != ''">
+                and  self_reaction  in
+                <foreach collection="selfReaction" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="conflictBehavior != null and conflictBehavior != ''">
+                and   conflict_behavior  in
+                <foreach collection="conflictBehavior" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="conflictType != null and conflictType != ''">
+                and   conflict_type  in
+                <foreach collection="conflictType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            order by create_time desc
+        </where>
+    </select>
+
+</mapper>

+ 303 - 0
simulation-resource-server/src/main/resources/mapper/scene/SceneNaturalMapper.xml

@@ -0,0 +1,303 @@
+<?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.css.simulation.resource.scene.mapper.SceneNaturalMapper" >
+
+    <insert id="saveSceneNatural" parameterType="api.common.pojo.po.scene.SceneNaturalPO">
+        insert into simulation.scene_natural
+        (natural_id,natural_name,weather,backlight,
+        light_change,road_type,road_matrrial,driveway_num,
+        driveway_type,road_flatness,road_curvature,ramp,
+        intersection_type,plane_intersection,bridge,tunnel,
+        speed_limit,min_speed_limit,no_entry,no_stopping,
+        left_lane_line,right_lane_line,conductor_marking,pedestrian_crossing,
+        traffic_light,deceleration_marking,pavement_condition,natural_disaster,
+        road_safety_signs,safety_warning_board,traffic_accident,patency,
+        special_vehicle_yield,violation,double_flashing_car,self_behavior,
+        target_behavior,create_user_id,create_time,modify_user_id,modify_time,
+         is_deleted,share,video_address,osgb_address,xodr_address,xosc_address,
+        json_address)
+        values (#{naturalId,jdbcType=VARCHAR},#{naturalName,jdbcType=VARCHAR},#{weather,jdbcType=VARCHAR}, #{backlight,jdbcType=VARCHAR},
+        #{lightChange,jdbcType=VARCHAR}, #{roadType,jdbcType=VARCHAR},#{roadMatrrial,jdbcType=VARCHAR},#{drivewayNum,jdbcType=VARCHAR},
+        #{drivewayType,jdbcType=VARCHAR}, #{roadFlatness,jdbcType=VARCHAR},#{roadCurvature,jdbcType=VARCHAR},#{ramp,jdbcType=VARCHAR},
+        #{intersectionType,jdbcType=VARCHAR}, #{planeIntersection,jdbcType=VARCHAR},#{bridge,jdbcType=VARCHAR},#{tunnel,jdbcType=VARCHAR},
+        #{speedLimit,jdbcType=VARCHAR}, #{minSpeedLimit,jdbcType=VARCHAR},#{noEntry,jdbcType=VARCHAR},#{noStopping,jdbcType=VARCHAR},
+        #{leftLaneLine,jdbcType=VARCHAR}, #{rightLaneLine,jdbcType=VARCHAR},#{conductorMarking,jdbcType=VARCHAR},#{pedestrianCrossing,jdbcType=VARCHAR},
+        #{trafficLight,jdbcType=VARCHAR}, #{decelerationMarking,jdbcType=VARCHAR},#{pavementCondition,jdbcType=VARCHAR},#{naturalDisaster,jdbcType=VARCHAR},
+        #{roadSafetySigns,jdbcType=VARCHAR}, #{safetyWarningBoard,jdbcType=VARCHAR},#{trafficAccident,jdbcType=VARCHAR},#{patency,jdbcType=VARCHAR},
+        #{specialVehicleYield,jdbcType=VARCHAR}, #{violation,jdbcType=VARCHAR},#{doubleFlashingCar,jdbcType=VARCHAR},#{selfBehavior,jdbcType=VARCHAR},
+
+        #{targetBehavior,jdbcType=VARCHAR}, #{createUserId,jdbcType=VARCHAR},#{createTime},#{modifyUserId,jdbcType=VARCHAR},#{modifyTime},
+
+        #{isDeleted,jdbcType=VARCHAR}, #{share,jdbcType=VARCHAR},#{videoAddress,jdbcType=VARCHAR},#{osgbAddress,jdbcType=VARCHAR},
+        #{xodrAddress,jdbcType=VARCHAR}, #{xoscAddress,jdbcType=VARCHAR},#{jsonAddress,jdbcType=VARCHAR})
+    </insert>
+
+
+    <select id="querySceneNaturalList" parameterType="api.common.pojo.param.scene.SceneNaturalParam" resultType="api.common.pojo.po.scene.SceneNaturalPO">
+        select
+        natural_id,natural_name,weather,backlight,light_change,road_type,
+        road_matrrial,driveway_num,driveway_type,road_flatness,road_curvature,
+        ramp,intersection_type,plane_intersection,bridge,tunnel,speed_limit,
+        min_speed_limit,no_entry,no_stopping,left_lane_line,right_lane_line,
+        conductor_marking,pedestrian_crossing,traffic_light,deceleration_marking,
+        pavement_condition,natural_disaster,road_safety_signs,safety_warning_board,
+        traffic_accident,patency,special_vehicle_yield,violation,double_flashing_car,
+        self_behavior,target_behavior,create_user_id,create_time,modify_user_id,
+        modify_time,is_deleted,share,video_address,osgb_address,
+        xodr_address,xosc_address,json_address
+        from simulation.scene_natural
+        <where>
+            is_deleted = '0'
+            <if test="naturalName != null and naturalName != ''">
+                and natural_name like CONCAT('%',#{naturalName,jdbcType=VARCHAR},'%')
+            </if>
+            <if test="weather != null and weather != ''">
+                and   weather  in
+                <foreach collection="weather" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="backlight != null and backlight != ''">
+                and   backlight  in
+                <foreach collection="backlight" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="lightChange != null and lightChange != ''">
+                and   light_change  in
+                <foreach collection="lightChange" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="roadType != null and roadType != ''">
+                and   road_type  in
+                <foreach collection="roadType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="roadMatrrial != null and roadMatrrial != ''">
+                and   road_matrrial  in
+                <foreach collection="roadMatrrial" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="drivewayNum != null and drivewayNum != ''">
+                and   driveway_num  in
+                <foreach collection="drivewayNum" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="drivewayType != null and drivewayType != ''">
+                and   driveway_type  in
+                <foreach collection="drivewayType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="roadFlatness != null and roadFlatness != ''">
+                and   road_flatness  in
+                <foreach collection="roadFlatness" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="roadCurvature != null and roadCurvature != ''">
+                and   road_curvature  in
+                <foreach collection="roadCurvature" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="ramp != null and ramp != ''">
+                and   ramp  in
+                <foreach collection="ramp" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="intersectionType != null and intersectionType != ''">
+                and   intersection_type  in
+                <foreach collection="intersectionType" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="planeIntersection != null and planeIntersection != ''">
+                and   plane_intersection  in
+                <foreach collection="planeIntersection" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="bridge != null and bridge != ''">
+                and   bridge  in
+                <foreach collection="bridge" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="tunnel != null and tunnel != ''">
+                and   tunnel  in
+                <foreach collection="tunnel" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="speedLimit != null and speedLimit != ''">
+                and   speed_limit  in
+                <foreach collection="speedLimit" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="minSpeedLimit != null and minSpeedLimit != ''">
+                and   min_speed_limit  in
+                <foreach collection="minSpeedLimit" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="noEntry != null and noEntry != ''">
+                and   no_entry  in
+                <foreach collection="noEntry" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="noStopping != null and noStopping != ''">
+                and   no_stopping  in
+                <foreach collection="noStopping" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="leftLaneLine != null and leftLaneLine != ''">
+                and   left_lane_line  in
+                <foreach collection="leftLaneLine" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="rightLaneLine != null and rightLaneLine != ''">
+                and   right_lane_line  in
+                <foreach collection="rightLaneLine" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="conductorMarking != null and conductorMarking != ''">
+                and   conductor_marking  in
+                <foreach collection="conductorMarking" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="pedestrianCrossing != null and pedestrianCrossing != ''">
+                and   pedestrian_crossing  in
+                <foreach collection="pedestrianCrossing" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="trafficLight != null and trafficLight != ''">
+                and   traffic_light  in
+                <foreach collection="trafficLight" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="decelerationMarking != null and decelerationMarking != ''">
+                and   deceleration_marking  in
+                <foreach collection="decelerationMarking" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="pavementCondition != null and pavementCondition != ''">
+                and   pavement_condition  in
+                <foreach collection="pavementCondition" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="naturalDisaster != null and naturalDisaster != ''">
+                and   natural_disaster  in
+                <foreach collection="naturalDisaster" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="roadSafetySigns != null and roadSafetySigns != ''">
+                and   road_safety_signs  in
+                <foreach collection="roadSafetySigns" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="safetyWarningBoard != null and safetyWarningBoard != ''">
+                and   safety_warning_board  in
+                <foreach collection="safetyWarningBoard" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="trafficAccident != null and trafficAccident != ''">
+                and   traffic_accident  in
+                <foreach collection="trafficAccident" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="patency != null and patency != ''">
+                and   patency  in
+                <foreach collection="patency" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="specialVehicleYield != null and specialVehicleYield != ''">
+                and   special_vehicle_yield  in
+                <foreach collection="specialVehicleYield" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="violation != null and violation != ''">
+                and   violation  in
+                <foreach collection="violation" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="doubleFlashingCar != null and doubleFlashingCar != ''">
+                and   double_flashing_car  in
+                <foreach collection="doubleFlashingCar" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="selfBehavior != null and selfBehavior != ''">
+                and   self_behavior  in
+                <foreach collection="selfBehavior" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="targetBehavior != null and targetBehavior != ''">
+                and   target_behavior  in
+                <foreach collection="targetBehavior" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            order by create_time desc
+        </where>
+    </select>
+
+</mapper>

+ 108 - 0
simulation-resource-server/src/main/resources/mapper/scene/ScenePackageMapper.xml

@@ -0,0 +1,108 @@
+<?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.css.simulation.resource.scene.mapper.ScenePackageMapper" >
+
+
+    <insert id="saveScenePackage" parameterType="api.common.pojo.po.scene.ScenePackagePO">
+        insert into simulation.scene_package
+        (package_id,package_name,weight,
+        package_and_rules,scene_num,remarks,
+        create_user_id,create_time,modify_user_id,modify_time,
+         is_deleted,share)
+        values (#{packageId,jdbcType=VARCHAR},#{packageName,jdbcType=VARCHAR},#{weight,jdbcType=VARCHAR},
+        #{packageAndRules,jdbcType=VARCHAR},#{sceneNum},#{remarks,jdbcType=VARCHAR},
+         #{createUserId,jdbcType=VARCHAR},#{createTime},#{modifyUserId,jdbcType=VARCHAR},#{modifyTime},
+        #{isDeleted,jdbcType=VARCHAR}, #{share,jdbcType=VARCHAR})
+    </insert>
+
+
+    <select id="queryScenePackageList" parameterType="api.common.pojo.param.scene.ScenePackageParam" resultType="api.common.pojo.po.scene.ScenePackagePO">
+        select
+        a.package_id,a.package_name,a.weight,
+        a.package_and_rules,a.scene_num,a.remarks,
+        a.create_user_id,a.create_time,a.modify_user_id,a.modify_time,
+        a.is_deleted,a.share
+        from simulation.scene_package as a
+        <where>
+            a.is_deleted = '0'
+            <if test="packageId != null and packageId != ''">
+                and a.package_id  = #{packageId,jdbcType=VARCHAR}
+            </if>
+            <if test="share != null and share != ''">
+                and a.share  = #{share,jdbcType=VARCHAR}
+            </if>
+            <if test="packageName != null and packageName != ''">
+                and a.package_name like CONCAT('%',#{packageName,jdbcType=VARCHAR},'%')
+            </if>
+            <if test="yearMax != null and yearMax != ''">
+                and #{yearMax,jdbcType=VARCHAR} &gt; a.CREATE_TIME and #{yearMin,jdbcType=VARCHAR} &lt; a.CREATE_TIME
+            </if>
+            order by a.create_time desc
+        </where>
+    </select>
+
+
+    <select id="queryScenePackage" parameterType="api.common.pojo.param.scene.ScenePackageParam" resultType="api.common.pojo.po.scene.ScenePackagePO">
+        select
+        a.package_id,a.package_name,a.weight,
+        a.package_and_rules,a.scene_num,a.remarks,
+        a.create_user_id,a.create_time,a.modify_user_id,a.modify_time,
+        a.is_deleted,a.share
+        from simulation.scene_package as a
+        <where>
+            a.is_deleted = '0'
+            <if test="packageId != null and packageId != ''">
+                and a.package_id  = #{packageId,jdbcType=VARCHAR}
+            </if>
+            <if test="packageName != null and packageName != ''">
+                and a.package_name like CONCAT('%',#{packageName,jdbcType=VARCHAR},'%')
+            </if>
+            <if test="yearMax != null and yearMax != ''">
+                and #{yearMax,jdbcType=VARCHAR} &gt; a.CREATE_TIME and #{yearMin,jdbcType=VARCHAR} &lt; a.CREATE_TIME
+            </if>
+            order by a.create_time desc
+        </where>
+    </select>
+
+    <select id="queryScenePackageBySublist" parameterType="java.lang.String" resultType="api.common.pojo.vo.scene.ScenePackageSublistVO">
+        select
+        a.package_id as sublistId,a.package_name as sublistName,a.weight,
+        a.scene_num,a.remarks
+        from simulation.scene_package as a
+        <where>
+            a.is_deleted = '0'
+            <if test="packageId != null and packageId != ''">
+                and a.package_id  = #{packageId,jdbcType=VARCHAR}
+            </if>
+        </where>
+    </select>
+    <update id="updateScenePackage" parameterType="api.common.pojo.po.scene.ScenePackagePO">
+        update simulation.scene_package
+        <set>
+            <if test="isDeleted != null and isDeleted!=''">
+                is_deleted = #{isDeleted,jdbcType=VARCHAR},
+            </if>
+            <if test="packageName != null and packageName!=''">
+                package_name = #{share,jdbcType=VARCHAR},
+            </if>
+            <if test="weight != null and weight!=''">
+                weight = #{weight,jdbcType=VARCHAR},
+            </if>
+            <if test="sceneNum != null and sceneNum!=''">
+                scene_num = #{sceneNum},
+            </if>
+            <if test="remarks != null and remarks!=''">
+                remarks = #{ruleDetails},
+            </if>
+
+            <if test="modifyUserId != null and modifyUserId!=''">
+                modify_user_id = #{modifyUserId},
+            </if>
+            <if test="modifyTime != null ">
+                modify_time = #{modifyTime},
+            </if>
+
+        </set>
+        where package_id = #{packageId,jdbcType=VARCHAR}
+    </update>
+</mapper>

+ 70 - 0
simulation-resource-server/src/main/resources/mapper/scene/ScenePackageSublistMapper.xml

@@ -0,0 +1,70 @@
+<?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.css.simulation.resource.scene.mapper.ScenePackageSublistMapper" >
+
+    <insert id="saveScenePackageSublist" parameterType="api.common.pojo.po.scene.ScenePackageSublistPO">
+        insert into simulation.scene_package_sublist
+        (sublist_id,sublist_name,weight,rules_name,package_and_rules,
+        scene_natural_ids,scene_traffic_ids,scene_statue_ids,scene_generalization_ids
+        scene_num,parent_id,root_id,seq,package_level,remarks,
+        create_user_id,create_time,modify_user_id,modify_time,
+         is_deleted,share)
+        values (#{sublistId,jdbcType=VARCHAR},#{sublistName,jdbcType=VARCHAR},#{weight,jdbcType=VARCHAR},#{rulesName,jdbcType=VARCHAR},
+        #{packageAndRules,jdbcType=VARCHAR},
+        #{sceneNaturalIds}, #{sceneTrafficIds}, #{sceneStatueIds}, #{sceneGeneralizationIds},
+        #{sceneNum},#{parentId,jdbcType=VARCHAR},#{rootId,jdbcType=VARCHAR},#{seq},
+         #{packageLevel},#{remarks,jdbcType=VARCHAR},
+         #{createUserId,jdbcType=VARCHAR},#{createTime},#{modifyUserId,jdbcType=VARCHAR},#{modifyTime},
+        #{isDeleted,jdbcType=VARCHAR}, #{share,jdbcType=VARCHAR})
+    </insert>
+
+
+    <insert id="saveScenePackageSublistAll" parameterType="java.util.List">
+        <foreach collection="list" index="index" item="item" separator=";">
+        insert into simulation.scene_package_sublist
+        (sublist_id,sublist_name,weight,rules_name,package_and_rules,
+        scene_natural_ids,scene_traffic_ids,scene_statue_ids,scene_generalization_ids
+        scene_num,parent_id,root_id,seq,package_level,remarks,
+        create_user_id,create_time,modify_user_id,modify_time,
+         is_deleted,share)
+        values (#{sublistId,jdbcType=VARCHAR},#{sublistName,jdbcType=VARCHAR},#{weight,jdbcType=VARCHAR},#{rulesName,jdbcType=VARCHAR},
+        #{packageAndRules,jdbcType=VARCHAR},
+        #{sceneNaturalIds}, #{sceneTrafficIds}, #{sceneStatueIds}, #{sceneGeneralizationIds},
+        #{sceneNum},#{parentId,jdbcType=VARCHAR},#{rootId,jdbcType=VARCHAR},#{seq},
+         #{packageLevel},#{remarks,jdbcType=VARCHAR},
+         #{createUserId,jdbcType=VARCHAR},#{createTime},#{modifyUserId,jdbcType=VARCHAR},#{modifyTime},
+        #{isDeleted,jdbcType=VARCHAR}, #{share,jdbcType=VARCHAR})
+        </foreach>
+    </insert>
+
+    <select id="queryScenePackageSublistList" parameterType="api.common.pojo.po.scene.ScenePackageSublistPO" resultType="api.common.pojo.vo.scene.ScenePackageSublistVO">
+        select
+        a.sublist_id,a.sublist_name,a.weight,b.rule_name,
+        a.scene_num,a.parent_id,a.root_id,a.package_level,a.remarks,a.seq
+        from simulation.scene_package_sublist as a  left join simulation.scoring_rules as b on a.package_and_rules=b.rules_id
+        <where>
+            a.is_deleted = '0'
+            <if test="sublistId != null and sublistId != ''">
+                and a.sublist_id  = #{sublistId,jdbcType=VARCHAR}
+            </if>
+            <if test="sublistName != null and sublistName != ''">
+                and a.sublist_name  = #{sublistName,jdbcType=VARCHAR}
+            </if>
+
+            <if test="parentId != null and parentId != ''">
+                and a.parent_id = #{parentId}
+            </if>
+            <if test="rootId != null and rootId != ''">
+                and a.root_id = #{rootId}
+            </if>
+            order by a.seq
+        </where>
+    </select>
+
+
+    <update id="updateScenePackageSublist" parameterType="java.lang.String">
+        update simulation.scene_package_sublist
+        set is_deleted='1'
+        where root_id = #{rootId,jdbcType=VARCHAR}
+    </update>
+</mapper>

+ 89 - 0
simulation-resource-server/src/main/resources/mapper/scene/ScoringRulesMapper.xml

@@ -0,0 +1,89 @@
+<?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.css.simulation.resource.scene.mapper.ScoringRulesMapper" >
+
+    <insert id="saveScoringRules" parameterType="api.common.pojo.po.scene.ScoringRulesPO">
+        insert into simulation.scoring_rules
+        (rules_id,rule_name,rule_description,rule_details,
+        create_user_id,create_time,modify_user_id,modify_time,
+         is_deleted,share)
+        values (#{rulesId,jdbcType=VARCHAR},#{ruleName,jdbcType=VARCHAR},#{ruleDescription,jdbcType=VARCHAR},#{ruleDetails},
+         #{createUserId,jdbcType=VARCHAR},#{createTime},#{modifyUserId,jdbcType=VARCHAR},#{modifyTime},
+        #{isDeleted,jdbcType=VARCHAR}, #{share,jdbcType=VARCHAR})
+    </insert>
+
+
+    <select id="queryScoringRulesList" parameterType="api.common.pojo.param.scene.ScoringRulesParam" resultType="api.common.pojo.po.scene.ScoringRulesPO">
+        select
+        rules_id,rule_name,rule_description,rule_details,
+        create_user_id,create_time,modify_user_id,modify_time,
+        is_deleted,share
+        from simulation.scoring_rules
+        <where>
+            is_deleted = '0'
+            <if test="rulesId != null and rulesId != ''">
+                and rules_id  = #{rulesId,jdbcType=VARCHAR}
+            </if>
+            <if test="share != null and share!=''">
+               and share = #{share,jdbcType=VARCHAR}
+            </if>
+            <if test="ruleName != null and ruleName != ''">
+                and rule_name like CONCAT('%',#{ruleName,jdbcType=VARCHAR},'%')
+            </if>
+            <if test="ruleDescription != null and ruleDescription != ''">
+                and rule_description like  CONCAT('%',#{ruleDescription},'%')
+            </if>
+            <if test="yearMax != null and yearMax != ''">
+                and #{yearMax,jdbcType=VARCHAR} <![CDATA[ >= ]]> CREATE_TIME and #{yearMin,jdbcType=VARCHAR}  <![CDATA[ <= ]]> CREATE_TIME
+            </if>
+            order by create_time desc
+        </where>
+    </select>
+    <select id="queryScoringRules" parameterType="api.common.pojo.param.scene.ScoringRulesParam" resultType="api.common.pojo.po.scene.ScoringRulesPO">
+        select
+        rules_id,rule_name,rule_description,rule_details,
+        create_user_id,create_time,modify_user_id,modify_time,
+        is_deleted,share
+        from simulation.scoring_rules
+        <where>
+            is_deleted = '0'
+            <if test="rulesId != null and rulesId != ''">
+                and rules_id  = #{rulesId,jdbcType=VARCHAR}
+            </if>
+            <if test="ruleName != null and ruleName != ''">
+                and rule_name like CONCAT('%',#{ruleName,jdbcType=VARCHAR},'%')
+            </if>
+            order by create_time desc
+        </where>
+    </select>
+
+
+    <update id="updateScoringRules" parameterType="api.common.pojo.po.scene.ScoringRulesPO">
+        update simulation.scoring_rules
+        <set>
+            <if test="isDeleted != null and isDeleted!=''">
+                is_deleted = #{isDeleted,jdbcType=VARCHAR},
+            </if>
+            <if test="share != null and share!=''">
+                share = #{share,jdbcType=VARCHAR},
+            </if>
+            <if test="ruleName != null and ruleName!=''">
+                rule_name = #{ruleName,jdbcType=VARCHAR},
+            </if>
+            <if test="ruleDescription != null and ruleDescription!=''">
+                rule_description = #{ruleDescription,jdbcType=VARCHAR},
+            </if>
+            <if test="ruleDetails != null and ruleDetails!=''">
+                rule_details = #{ruleDetails,jdbcType=VARCHAR},
+            </if>
+            <if test="modifyUserId != null and modifyUserId!=''">
+                modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
+            </if>
+            <if test="modifyTime != null">
+                modify_time = #{modifyTime},
+            </if>
+
+        </set>
+        where rules_id = #{rulesId,jdbcType=VARCHAR}
+    </update>
+</mapper>

+ 47 - 0
simulation-resource-server/src/main/resources/mapper/scene/StandardsRegulationsMapper.xml

@@ -0,0 +1,47 @@
+<?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.css.simulation.resource.scene.mapper.StandardsRegulationsMapper" >
+
+
+    <insert id="saveStandardsRegulations" parameterType="api.common.pojo.po.scene.StandardsRegulationsPO">
+        insert into simulation.scene_standards_regulations
+        (regulations_id,scene_name,regulation_type,standard_type,
+       create_user_id,create_time,modify_user_id,modify_time,
+         is_deleted,share,video_address,osgb_address,xml_address,xodr_address,
+        json_address)
+        values (#{regulationsId,jdbcType=VARCHAR},#{sceneName,jdbcType=VARCHAR},#{regulationType,jdbcType=VARCHAR}, #{standardType,jdbcType=VARCHAR},
+
+       #{createUserId,jdbcType=VARCHAR},#{createTime},#{modifyUserId,jdbcType=VARCHAR},#{modifyTime},
+        #{isDeleted,jdbcType=VARCHAR}, #{share,jdbcType=VARCHAR},#{videoAddress,jdbcType=VARCHAR},#{osgbAddress,jdbcType=VARCHAR},
+        #{xmlAddress,jdbcType=VARCHAR}, #{xodrAddress,jdbcType=VARCHAR},#{jsonAddress,jdbcType=VARCHAR})
+    </insert>
+
+
+    <select id="queryStandardsRegulationsList" parameterType="api.common.pojo.param.scene.StandardsRegulationsParam" resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
+        select
+        regulations_id,scene_name,regulation_type,standard_type,
+        create_user_id,create_time,modify_user_id,
+        modify_time,is_deleted,share,video_address,osgb_address,
+        xml_address,xodr_address,json_address
+        from simulation.scene_standards_regulations
+        <where>
+            is_deleted = '0'
+            <if test="sceneName != null and sceneName != ''">
+                and scene_name like CONCAT('%',#{sceneName,jdbcType=VARCHAR},'%')
+            </if>
+
+            <if test="regulationType != null and regulationType != ''">
+            and  regulation_type  in
+            <foreach collection="regulationType" item="item" index="index"
+                     separator="," open="(" close=")">
+                #{item}
+            </foreach>
+            </if>
+            <if test="standardType != null and standardType != ''">
+                and standard_type like CONCAT('%',#{standardType,jdbcType=VARCHAR},'%')
+            </if>
+            order by create_time desc
+        </where>
+    </select>
+
+</mapper>