Sfoglia il codice sorgente

王耀栋--提交工作模块相关代码

wangyaodong 3 anni fa
parent
commit
f61cada7ca
30 ha cambiato i file con 1161 aggiunte e 104 eliminazioni
  1. 9 0
      api-common/src/main/java/api/common/pojo/param/project/SimulationManualProjectParam.java
  2. 1 0
      api-common/src/main/java/api/common/pojo/po/project/BasePo.java
  3. 48 0
      api-common/src/main/java/api/common/pojo/po/project/SimulationAutomaticSubProjectPo.java
  4. 16 0
      api-common/src/main/java/api/common/pojo/po/project/SimulationMptFirstTargetScorePo.java
  5. 33 0
      api-common/src/main/java/api/common/pojo/vo/project/AutomaticProjectVo.java
  6. 3 0
      api-common/src/main/java/api/common/pojo/vo/project/ProjectDetailsVo.java
  7. 6 0
      api-common/src/main/java/api/common/pojo/vo/project/SimulationManualProjectSingleVo.java
  8. 23 0
      api-common/src/main/java/api/common/pojo/vo/project/SimulationManualProjectVo.java
  9. 3 0
      api-common/src/main/java/api/common/pojo/vo/project/SublistScoreVo.java
  10. 3 0
      simulation-resource-monitor/src/main/java/com/css/simulation/resource/monitor/SimulationResourceMonitorApplication.java
  11. 1 1
      simulation-resource-monitor/src/main/java/com/css/simulation/resource/monitor/scheduler/MyScheduler.java
  12. 4 2
      simulation-resource-monitor/src/main/resources/bootstrap-dev.yaml
  13. 1 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/algorithm/serviceImpl/AlgorithmServiceImpl.java
  14. 1 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/common/config/OAuth2Config.java
  15. 2 2
      simulation-resource-server/src/main/java/com/css/simulation/resource/feign/FileDownService.java
  16. 3 2
      simulation-resource-server/src/main/java/com/css/simulation/resource/feign/RedisService.java
  17. 7 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/constants/ProjectConstants.java
  18. 79 7
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/ctrl/SimulationProjectCtrl.java
  19. 626 78
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java
  20. 12 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationAutomaticProjectMapper.java
  21. 33 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationAutomaticSubProjectMapper.java
  22. 2 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationMptFirstTargetScoreMapper.java
  23. 4 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationProjectMapper.java
  24. 3 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationProjectTaskMapper.java
  25. 17 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/service/SimulationProjectService.java
  26. 65 5
      simulation-resource-server/src/main/resources/mapper/project/SimulationAutomaticProjectMapper.xml
  27. 108 0
      simulation-resource-server/src/main/resources/mapper/project/SimulationAutomaticSubProjectMapper.xml
  28. 9 0
      simulation-resource-server/src/main/resources/mapper/project/SimulationMptFirstTargetScoreMapper.xml
  29. 30 5
      simulation-resource-server/src/main/resources/mapper/project/SimulationProjectMapper.xml
  30. 9 0
      simulation-resource-server/src/main/resources/mapper/project/SimulationProjectTaskMapper.xml

+ 9 - 0
api-common/src/main/java/api/common/pojo/param/project/SimulationManualProjectParam.java

@@ -22,6 +22,9 @@ public class SimulationManualProjectParam extends PageVO {
     //项目id
     private String projectId;
 
+    //周期表达式
+    private String cron;
+
     //项目名称
     private String projectName;
 
@@ -102,6 +105,9 @@ public class SimulationManualProjectParam extends PageVO {
     //算法类型
     private String algorithmType;
 
+    //算法来源1、文件上传,2、仓库地址
+    private String algorithmSource;
+
     //仿真结果地址
     private String runResultFilePath;
 
@@ -127,5 +133,8 @@ public class SimulationManualProjectParam extends PageVO {
     //父级项目id
     private String parentId;
 
+    //项目类型 1.手动;2.自动
+    private String projectType;
+
 
 }

+ 1 - 0
api-common/src/main/java/api/common/pojo/po/project/BasePo.java

@@ -40,6 +40,7 @@ public class BasePo {
         modifyTime = nowForMysql;
         isDeleted = "0";
         createUserId = userId;
+        modifyUserId = userId;
     }
 
     public void updatePo(String userId){

+ 48 - 0
api-common/src/main/java/api/common/pojo/po/project/SimulationAutomaticSubProjectPo.java

@@ -0,0 +1,48 @@
+package api.common.pojo.po.project;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * 自动运行项目子表
+ */
+@Getter
+@Setter
+public class SimulationAutomaticSubProjectPo extends BasePo {
+
+    //主项目表id
+    private String parentId;
+
+    //主项目表项目id
+    private String parentProjectId;
+
+    //项目日期
+    private Integer projectDate;
+
+    //项目序号
+    private Integer projectNum;
+
+    //项目id
+    private String projectId;
+
+    //项目名称
+    private String projectName;
+
+    //当前运行状态
+    private String nowRunState;
+
+    //评测等级
+    private String evaluationLevel;
+
+    //开始时间
+    private Date startTime;
+
+    //完成时间
+    private Date finishTime;
+
+    //算法得分
+    private Double algorithmScore;
+
+}

+ 16 - 0
api-common/src/main/java/api/common/pojo/po/project/SimulationMptFirstTargetScorePo.java

@@ -19,4 +19,20 @@ public class SimulationMptFirstTargetScorePo extends BasePo {
     //得分
     private Double score;
 
+
+    //以下额外的,不在po中
+    //指标名称
+    private String sublistName;
+
+    //场景数量
+    private Integer sceneNum;
+
+    //测试权重
+    private String weight;
+
+    //指标id
+    private String sublistId;
+
+
+
 }

+ 33 - 0
api-common/src/main/java/api/common/pojo/vo/project/AutomaticProjectVo.java

@@ -0,0 +1,33 @@
+package api.common.pojo.vo.project;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 自动运行项目信息
+ */
+@Getter
+@Setter
+public class AutomaticProjectVo {
+
+    //id
+    private String id;
+    //项目名称
+    private String projectName;
+    //项目描述
+    private String projectDescribe;
+    //算法名称
+    private String algorithmName;
+    //车辆
+    private String vehicle;
+    //传感器
+    private String sensor;
+    //场景包名称
+    private String sceneName;
+    //运行周期
+    private String operationCycle;
+    //并行度
+    private String parallelism;
+    //是否选择GPU
+    private String isChoiceGpu;
+}

+ 3 - 0
api-common/src/main/java/api/common/pojo/vo/project/ProjectDetailsVo.java

@@ -84,5 +84,8 @@ public class ProjectDetailsVo {
     //是否选择gpu
     private String isChoiceGpu;
 
+    //是否生成报告
+    private boolean createReport;
+
 
 }

+ 6 - 0
api-common/src/main/java/api/common/pojo/vo/project/SimulationManualProjectSingleVo.java

@@ -38,4 +38,10 @@ public class SimulationManualProjectSingleVo {
     //是否选择gpu(0:是,1:否)
     private String isChoiceGpu;
 
+    //运行周期
+    private String operationCycle;
+
+    //规则查看
+    private String ruleView;
+
 }

+ 23 - 0
api-common/src/main/java/api/common/pojo/vo/project/SimulationManualProjectVo.java

@@ -35,5 +35,28 @@ public class SimulationManualProjectVo {
 
     private Long maxSimulationTime;
 
+    private Date startTime;
+
+    private String startTimeFmt;
+
+    private Date finishTime;
+
+    private String finishTimeFmt;
+
+    private String scene;//场景测试包id
+
+    private String algorithmType;//算法类型
+
+    private String vehicle;//车俩配置id
+
+    private String projectDescribe; //项目描述
+
+    private String parallelism;
+
+    private String isChoiceGpu;
+
+
+
+
 
 }

+ 3 - 0
api-common/src/main/java/api/common/pojo/vo/project/SublistScoreVo.java

@@ -25,4 +25,7 @@ public class SublistScoreVo {
     private String returnSceneId;
     private String runResult;
 
+    private String firTarget;
+    private String lasTarget;
+
 }

+ 3 - 0
simulation-resource-monitor/src/main/java/com/css/simulation/resource/monitor/SimulationResourceMonitorApplication.java

@@ -3,14 +3,17 @@ package com.css.simulation.resource.monitor;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
 @SpringBootApplication
 @EnableScheduling
+@EnableFeignClients
 public class SimulationResourceMonitorApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(SimulationResourceMonitorApplication.class, args);
+        System.out.println("-------------启动成功----------------");
     }
 
 }

+ 1 - 1
simulation-resource-monitor/src/main/java/com/css/simulation/resource/monitor/scheduler/MyScheduler.java

@@ -35,7 +35,7 @@ public class MyScheduler {
 
 
     //    @Scheduled(fixedDelay = 60 * 60 * 1000)
-    @Scheduled(fixedDelay = 2 * 1000)
+    //@Scheduled(fixedDelay = 2 * 1000)
     public void server() throws IOException, InterruptedException, DocumentException {
         List<SystemServerPO> systemServerPOList = new ArrayList<>();
         for (Host host : hostList) {

+ 4 - 2
simulation-resource-monitor/src/main/resources/bootstrap-dev.yaml

@@ -1,10 +1,12 @@
+#nacos配置
 spring:
   cloud:
     nacos:
       discovery:
-        server-addr: 47.94.105.148:8848
+        enabled: false
+        server-addr: 47.93.217.159:8848
         namespace: 3698bfc2-a612-487a-b2a2-aaad16cd9d9d
       config:
-        server-addr: 47.94.105.148:8848
+        server-addr: 47.93.217.159:8848
         namespace: 3698bfc2-a612-487a-b2a2-aaad16cd9d9d
         file-extension: yaml

+ 1 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/algorithm/serviceImpl/AlgorithmServiceImpl.java

@@ -49,7 +49,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
 
     @Autowired
     DictService dictService;
-    
+
     @Override
     public ResponseBodyVO addOrUpdate(AlgorithmParameter param) {
 

+ 1 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/common/config/OAuth2Config.java

@@ -47,6 +47,7 @@ public class OAuth2Config extends ResourceServerConfigurerAdapter {
                 .and()
                 .authorizeRequests()
                 .antMatchers("/**/report/**").access("#oauth2.hasScope('other')")//算法平台接口
+                .antMatchers("/**/monitor/createAutomaticSubProject").permitAll()//定时任务接口
                 .antMatchers("/druid/**").permitAll()
                 .anyRequest().access("#oauth2.hasScope('all')") // 拦截所有请求判断 scope
         ;

+ 2 - 2
simulation-resource-server/src/main/java/com/css/simulation/resource/feign/FileDownService.java

@@ -15,7 +15,7 @@ import org.springframework.web.multipart.MultipartFile;
 import java.util.List;
 
 
-//@FeignClient(name = "test", url = "http://10.15.12.72:8001",path = "/simulation/resource/common", fallback = FileDownServiceFallback.class, configuration = FeignConfiguration.class)
+//@FeignClient(name = "test2", url = "http://47.94.105.148",path = "/simulation/resource/common", fallback = FileDownServiceFallback.class, configuration = FeignConfiguration.class)
 @FeignClient(
         contextId = "file",
         value = "simulation-resource-common",
@@ -38,7 +38,7 @@ public interface FileDownService {
     Response download(@RequestBody @Validated MinioParameter minioParameter);
 
     @PostMapping("/minio/list")
-    ResponseBodyVO<List<String>> list( @RequestBody @Validated MinioParameter minioParameter );
+    ResponseBodyVO<List<String>> list(@RequestBody @Validated MinioParameter minioParameter);
 
     @PostMapping("/minio/listDeepOne")
     ResponseBodyVO<List<String>> listDeepOne( @RequestBody @Validated MinioParameter minioParameter );

+ 3 - 2
simulation-resource-server/src/main/java/com/css/simulation/resource/feign/RedisService.java

@@ -13,11 +13,12 @@ import java.util.List;
 import java.util.Map;
 
 //@FeignClient(name = "test", url = "http://10.15.12.72:8001", fallback = RedisServiceFallback.class, configuration = FeignConfiguration.class)
-@FeignClient(value = "simulation-resource-common",
+@FeignClient(name = "test1", url = "http://47.93.217.159", path = "/simulation/resource/common", fallback = RedisServiceFallback.class, configuration = FeignConfiguration.class)
+/*@FeignClient(value = "simulation-resource-common",
         contextId = "redis",
         path = "/simulation/resource/common",
         fallback = RedisServiceFallback.class,
-        configuration = FeignConfiguration.class)
+        configuration = FeignConfiguration.class)*/
 public interface RedisService {
 
     @PostMapping("/redis/setDictLists")

+ 7 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/project/constants/ProjectConstants.java

@@ -9,7 +9,13 @@ public class ProjectConstants {
     public static final String RUN_TASK_TOPIC = "manualProject";
 
     //任务终止,kafka推送主题
-    public static final String STOP_TASK_TOPPIC = "manualProject-stop";
+    public static final String STOP_TASK_TOPPIC = "stopManualProject";//   manualProject-stop
+
+    //自动任务运行开始
+    public static final String AUTO_PROJECT = "autoProject";
+
+    //自动任务运行中止
+    public static final String STOP_AUTO_PROJECT = "stopAutoProject";
 
     //第三方算法类型(索为)
     public static final String SY_ALGORITHM_TYPE="3";

+ 79 - 7
simulation-resource-server/src/main/java/com/css/simulation/resource/project/ctrl/SimulationProjectCtrl.java

@@ -4,17 +4,10 @@ import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.param.project.DictParam;
 import api.common.pojo.param.project.SimulationManualProjectParam;
 import com.css.simulation.resource.project.service.SimulationProjectService;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.itextpdf.text.DocumentException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
 /**
  * 工作台模块--项目运行
  */
@@ -244,4 +237,83 @@ public class SimulationProjectCtrl {
         return service.deleteAutomaticProjectByids(param);
     }
 
+    /**
+     * 修改自动运行状态
+     */
+    @RequestMapping("updateAutomaticRunState")
+    @ResponseBody
+    public  ResponseBodyVO updateAutomaticRunState(@RequestBody SimulationManualProjectParam param){
+        return service.updateAutomaticRunState(param);
+    };
+
+    /**
+     * 查询自动运行项目列表
+     */
+    @RequestMapping("selectAutomaticProject")
+    @ResponseBody
+    public ResponseBodyVO selectAutomaticProject(@RequestBody SimulationManualProjectParam param){
+        return service.selectAutomaticProject(param);
+    }
+
+    /**
+     * 手动运行自动项目
+     */
+    @RequestMapping("createAutomaticSubProject")
+    @ResponseBody
+    public ResponseBodyVO createAutomaticSubProject(@RequestBody SimulationManualProjectParam param){
+        return service.createAutomaticSubProject(param);
+    }
+
+    /**
+     * 删除自动运行子项目(支持批量删除)
+     */
+    @RequestMapping("deleteAutomaticSubProjectByIds")
+    @ResponseBody
+    public ResponseBodyVO deleteAutomaticSubProjectByIds(@RequestBody SimulationManualProjectParam param){
+
+        return service.deleteAutomaticSubProjectByIds(param);
+    }
+
+    /**
+     * 查询自动运行子工作信息
+     * @return
+     */
+    @RequestMapping("selectSubProjectInfo")
+    @ResponseBody
+    public ResponseBodyVO selectSubProjectInfo(@RequestBody SimulationManualProjectParam param){
+        return service.selectSubProjectInfo(param);
+    }
+
+
+    /**
+     * 查询自动运行子工作列表
+     * @return
+     */
+    @RequestMapping("selectSubProjectList")
+    @ResponseBody
+    public ResponseBodyVO selectSubProjectList(@RequestBody SimulationManualProjectParam param){
+        return service.selectSubProjectList(param);
+    }
+
+    /**
+     * 根据id查询自动运行项目信息
+     */
+    @RequestMapping("selectAutomaticProjectById")
+    @ResponseBody
+    public ResponseBodyVO selectAutomaticProjectById(@RequestBody SimulationManualProjectParam param){
+        return service.selectAutomaticProjectById(param);
+    }
+
+    /**
+     * 修改自动运行子工作运行状态
+     * @param param
+     * @return
+     */
+    @RequestMapping("updateAutoProjectNowRunState")
+    @ResponseBody
+    public ResponseBodyVO updateAutoProjectNowRunState(@RequestBody SimulationManualProjectParam param){
+        return service.updateAutoProjectNowRunState(param);
+    }
+
+
 }

File diff suppressed because it is too large
+ 626 - 78
simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java


+ 12 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationAutomaticProjectMapper.java

@@ -25,6 +25,8 @@ public interface SimulationAutomaticProjectMapper {
 
      SimulationAutomaticProjectPo selectLastProjectId(Integer nowRq);
 
+     List<SimulationManualProjectVo> selecAutomatictProjectList(SimulationManualProjectParam param);
+
      int add(SimulationAutomaticProjectPo po);
 
      int updateById(SimulationAutomaticProjectPo po);
@@ -33,5 +35,15 @@ public interface SimulationAutomaticProjectMapper {
 
      int deleteProject(String[] ids);
 
+     int updateAutomaticRunState(SimulationManualProjectParam param);
+
+     AutomaticProjectVo selectAutomaticProjectInfoById(String id);
+
+     AlgorithmPO getAlgorithmGitVersion(AlgorithmPO po);
+
+     int updateAlgorithmGitVersion(AlgorithmPO po);
+
+     int updateAutomaticRunTimes(SimulationAutomaticProjectPo po);
+
 
 }

+ 33 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationAutomaticSubProjectMapper.java

@@ -0,0 +1,33 @@
+package com.css.simulation.resource.project.mapper;
+
+import api.common.pojo.param.project.SimulationManualProjectParam;
+import api.common.pojo.po.project.SimulationAutomaticProjectPo;
+import api.common.pojo.po.project.SimulationAutomaticSubProjectPo;
+import api.common.pojo.vo.project.SimulationManualProjectVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Mapper
+@Repository
+public interface SimulationAutomaticSubProjectMapper {
+
+     SimulationAutomaticSubProjectPo selectLastProjectId(String id);
+
+     int addAutomaticSubProject(SimulationAutomaticSubProjectPo po);
+
+     List<SimulationAutomaticSubProjectPo> selectProjectNowRunState(String[] ids);
+
+     int deleteProject(String[] ids);
+
+     List<SimulationManualProjectVo> selectList(SimulationManualProjectParam param);
+
+     SimulationAutomaticSubProjectPo selectById(SimulationManualProjectParam param);
+
+     SimulationManualProjectVo selectProjectInfo(SimulationManualProjectParam param);
+
+     int updateNowRunState(SimulationManualProjectParam param);
+
+
+}

+ 2 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationMptFirstTargetScoreMapper.java

@@ -21,5 +21,7 @@ public interface SimulationMptFirstTargetScoreMapper {
 
     SimulationMptFirstTargetScorePo selectFirstTargetScore(SimulationMptFirstTargetScorePo po);
 
+    List<SimulationMptFirstTargetScorePo> selectFirstTargetByPid(SimulationMptFirstTargetScorePo po);
+
 
 }

+ 4 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationProjectMapper.java

@@ -71,6 +71,8 @@ public interface SimulationProjectMapper {
 
     List<ScenePackageSubListVO> selectSubListByPid(String id);
 
+    List<SublistScoreVo> selectsublistByRootId(SimulationManualProjectParam param);
+
     int insertSimulationMptLastTargetScorePo(SimulationMptLastTargetScorePo po);
 
     int insertSimulationMptFirstTargetScorePo(SimulationMptFirstTargetScorePo po);
@@ -87,6 +89,8 @@ public interface SimulationProjectMapper {
 
     List<SublistScoreVo> selectSubScore(SimulationManualProjectParam param);
 
+    List<SublistScoreVo> selectSubScore2(SimulationManualProjectParam param);
+
     Integer selectRunProjectBySy(Map map);
 
     List<Map> selectRunProjectByState(Map map);

+ 3 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationProjectTaskMapper.java

@@ -37,6 +37,9 @@ public interface SimulationProjectTaskMapper {
     //更新仿真结果到数据库
     int updateTaksResult(ManualProjectTaskPo po);
 
+    SceneScoreVo selectRunStateByAborted(SimulationMptSceneScorePo po);
+
+
 
 
 

+ 17 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/project/service/SimulationProjectService.java

@@ -2,6 +2,7 @@ package com.css.simulation.resource.project.service;
 
 import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.param.project.SimulationManualProjectParam;
+import org.springframework.web.bind.annotation.RequestBody;
 
 
 public interface SimulationProjectService {
@@ -61,4 +62,20 @@ public interface SimulationProjectService {
 
     ResponseBodyVO deleteAutomaticProjectByids(SimulationManualProjectParam param);
 
+    ResponseBodyVO updateAutomaticRunState(SimulationManualProjectParam param);
+
+    ResponseBodyVO selectAutomaticProject(SimulationManualProjectParam param);
+
+    ResponseBodyVO createAutomaticSubProject(SimulationManualProjectParam param);
+
+    ResponseBodyVO deleteAutomaticSubProjectByIds(SimulationManualProjectParam param);
+
+    ResponseBodyVO selectSubProjectInfo(SimulationManualProjectParam param);
+
+    ResponseBodyVO selectSubProjectList(SimulationManualProjectParam param);
+
+    ResponseBodyVO selectAutomaticProjectById(SimulationManualProjectParam param);
+
+    ResponseBodyVO updateAutoProjectNowRunState(SimulationManualProjectParam param);
+
 }

+ 65 - 5
simulation-resource-server/src/main/resources/mapper/project/SimulationAutomaticProjectMapper.xml

@@ -13,7 +13,7 @@
     <!--根据条件查询工作信息-->
     <select id="selectAutomaticProjectByQuery" parameterType="api.common.pojo.param.project.SimulationManualProjectParam" resultType="api.common.pojo.po.project.SimulationAutomaticProjectPo">
         select * from simulation_automatic_project
-        is_deleted = '0'
+        where is_deleted = '0'
         <if test="projectName != null and projectName != ''">
             and project_name = #{projectName,jdbcType=VARCHAR}
         </if>
@@ -28,6 +28,30 @@
         limit 1
     </select>
 
+    <!--查询自动项目列表-->
+    <select id="selecAutomatictProjectList" parameterType="api.common.pojo.param.project.SimulationManualProjectParam" resultType="api.common.pojo.vo.project.SimulationManualProjectVo">
+        select * from simulation_automatic_project
+        <where>
+            is_deleted = '0'
+            <if test="projectId != null and projectId != ''">
+                and project_id like CONCAT('%',#{projectId,jdbcType=VARCHAR},'%')
+            </if>
+            <if test="projectName != null and projectName != ''">
+                and project_name like CONCAT('%',#{projectName,jdbcType=VARCHAR},'%')
+            </if>
+            <if test="createTimeStart != null">
+                and create_time &gt;= #{createTimeStart,jdbcType=TIMESTAMP}
+            </if>
+            <if test="createTimeEnd != null">
+                and create_time &lt;= #{createTimeEnd,jdbcType=TIMESTAMP}
+            </if>
+            <if test="createUserId != null and createUserId != ''">
+                and create_user_id = #{createUserId,jdbcType=VARCHAR}
+            </if>
+        </where>
+        order by project_date desc, project_num desc, modify_time desc
+    </select>
+
     <!--创建项目信息-->
     <insert id="add" parameterType="api.common.pojo.po.project.SimulationAutomaticProjectPo">
         insert into simulation_automatic_project
@@ -92,16 +116,19 @@
         algorithm_type = #{algorithmType,jdbcType=VARCHAR},
         vehicle = #{vehicle,jdbcType=VARCHAR},
         scene = #{scene,jdbcType=VARCHAR},
-        operation_cycle = #{operation_cycle,jdbcType=VARCHAR},
+        operation_cycle = #{operationCycle,jdbcType=VARCHAR},
         parallelism = #{parallelism,jdbcType=VARCHAR},
-        is_choice_gpu = #{isChoiceGpu,jdbcType=VARCHAR}
+        rule_view = #{ruleView,jdbcType=VARCHAR},
+        is_choice_gpu = #{isChoiceGpu,jdbcType=VARCHAR},
+        modify_time = #{modifyTime,jdbcType=TIMESTAMP},
+        modify_user_id = #{modifyUserId,jdbcType=VARCHAR}
         where id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
     </update>
 
 
-    <!--查询项目状态-->
+    <!--查询项目自动运行状态-->
     <select id="selectProjectNowRunState" resultType="api.common.pojo.po.project.SimulationAutomaticProjectPo">
-        select now_run_state
+        select automatic_run_state
         from simulation_automatic_project
         where
         is_deleted='0' and
@@ -122,6 +149,39 @@
 
     </update>
 
+    <!--修改自动运行状态-->
+    <update id="updateAutomaticRunState" parameterType="api.common.pojo.param.project.SimulationManualProjectParam">
+        update simulation_automatic_project
+        set automatic_run_state=#{automaticRunState,jdbcType=VARCHAR}
+        where id = #{id,jdbcType=VARCHAR}
+    </update>
+
+    <!--修改自动运行次数-->
+    <update id="updateAutomaticRunTimes" parameterType="api.common.pojo.po.project.SimulationAutomaticProjectPo">
+        update simulation_automatic_project
+        set automatic_Run_Times=#{automaticRunTimes,jdbcType=BIGINT}
+        where id = #{id,jdbcType=VARCHAR}
+    </update>
+
+    <!--自动运行项目详细页面信息-->
+    <select id="selectAutomaticProjectInfoById" parameterType="string" resultType="api.common.pojo.vo.project.AutomaticProjectVo">
+        select p.id, p.project_name, p.project_describe, p.operation_cycle, p.parallelism, p.is_choice_gpu, p.vehicle, a.algorithm_name, s.package_name as sceneName
+        from simulation_automatic_project p
+        left join algorithm a on p.algorithm = a.id
+        left join scene_package s on p.scene = s.package_id
+        where p.id = #{id,jdbcType=VARCHAR} and p.is_deleted = '0'
+    </select>
+
+    <!--根据算法id获取算法git版本号信息-->
+    <select id="getAlgorithmGitVersion" parameterType="api.common.pojo.po.algorithm.AlgorithmPO" resultType="api.common.pojo.po.algorithm.AlgorithmPO">
+        select id,git_version from algorithm where id=#{id}
+    </select>
+
+    <!--更新算法版本号-->
+    <update id="updateAlgorithmGitVersion" parameterType="api.common.pojo.po.algorithm.AlgorithmPO">
+        update algorithm set git_version=#{gitVersion} where id=#{id}
+    </update>
+
 
 
 </mapper>

+ 108 - 0
simulation-resource-server/src/main/resources/mapper/project/SimulationAutomaticSubProjectMapper.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.project.mapper.SimulationAutomaticSubProjectMapper" >
+
+
+
+    <!--查询最新项目id-->
+    <select id="selectLastProjectId" parameterType="string" resultType="api.common.pojo.po.project.SimulationAutomaticSubProjectPo">
+        select project_date, project_num, project_id, parent_project_id
+        from simulation_automatic_subproject
+        where parent_id=#{id,jdbcType=VARCHAR} and is_deleted = '0'
+        order by project_num desc
+        limit 1
+    </select>
+
+    <!--添加自动运行子项目-->
+    <insert id="addAutomaticSubProject" parameterType="api.common.pojo.po.project.SimulationAutomaticSubProjectPo">
+        insert into simulation_automatic_subproject
+        (
+        id,
+        parent_id,
+        parent_project_id,
+        project_num,
+        project_id,
+        project_name,
+        now_run_state,
+        evaluation_level,
+        start_time,
+        finish_time,
+        create_time,
+        create_user_id,
+        modify_time,
+        modify_user_id,
+        is_deleted
+        )
+        values
+        (
+        #{id,jdbcType=VARCHAR},
+        #{parentId,jdbcType=VARCHAR},
+        #{parentProjectId,jdbcType=VARCHAR},
+        #{projectNum,jdbcType=INTEGER},
+        #{projectId,jdbcType=VARCHAR},
+        #{projectName,jdbcType=VARCHAR},
+        #{nowRunState,jdbcType=VARCHAR},
+        #{evaluationLevel,jdbcType=VARCHAR},
+        #{startTime,jdbcType=VARCHAR},
+        #{finishTime,jdbcType=VARCHAR},
+        #{createTime,jdbcType=TIMESTAMP},
+        #{createUserId,jdbcType=VARCHAR},
+        #{modifyTime,jdbcType=TIMESTAMP},
+        #{modifyUserId,jdbcType=VARCHAR},
+        #{isDeleted,jdbcType=VARCHAR}
+        )
+    </insert>
+
+    <!--查询项目状态-->
+    <select id="selectProjectNowRunState" resultType="api.common.pojo.po.project.SimulationAutomaticSubProjectPo">
+        select now_run_state
+        from simulation_automatic_subproject
+        where
+        is_deleted='0' and
+        id in
+        <foreach collection="array" open="(" separator="," close=")" item="id">
+            #{id,jdbcType=VARCHAR}
+        </foreach>
+    </select>
+
+    <!--删除-->
+    <update id="deleteProject">
+        update simulation_automatic_subproject
+        set is_deleted='1'
+        where id in
+        <foreach collection="array" open="(" separator="," close=")" item="id">
+            #{id,jdbcType=VARCHAR}
+        </foreach>
+
+    </update>
+
+    <!--查询列表-->
+    <select id="selectList" parameterType="api.common.pojo.param.project.SimulationManualProjectParam" resultType="api.common.pojo.vo.project.SimulationManualProjectVo" >
+        select * from simulation_automatic_subproject  where parent_id=#{parentId,jdbcType=VARCHAR} and is_deleted='0' order by project_num desc
+    </select>
+
+    <!--根据id查询-->
+    <select id="selectById" parameterType="api.common.pojo.param.project.SimulationManualProjectParam" resultType="api.common.pojo.po.project.SimulationAutomaticSubProjectPo">
+        select * from simulation_automatic_subproject where id = #{id,jdbcType=VARCHAR} and is_deleted='0'
+    </select>
+
+    <!--关联主表查询-->
+    <select id="selectProjectInfo" parameterType="api.common.pojo.param.project.SimulationManualProjectParam" resultType="api.common.pojo.vo.project.SimulationManualProjectVo">
+        select s.id, p.scene, s.project_id, p.project_name, p.algorithm, p.algorithm_type,
+        p.vehicle, p.project_describe, s.start_time, s.finish_time, s.now_run_state,
+        p.parallelism, p.max_simulation_time, p.is_choice_gpu
+        from simulation_automatic_subproject s
+        left join simulation_automatic_project p on s.parent_id = p.id
+        where s.id=#{id,jdbcType=VARCHAR}
+    </select>
+
+    <!--修改任务运行状态-->
+    <update id="updateNowRunState" parameterType="api.common.pojo.param.project.SimulationManualProjectParam">
+        update simulation_automatic_subproject
+        set now_run_state = #{nowRunState,jdbcType=VARCHAR}
+        where id = #{id,jdbcType=VARCHAR}
+    </update>
+
+
+
+</mapper>

+ 9 - 0
simulation-resource-server/src/main/resources/mapper/project/SimulationMptFirstTargetScoreMapper.xml

@@ -9,4 +9,13 @@
         where p_id = #{pId,jdbcType=VARCHAR} and target = #{target,jdbcType=VARCHAR} and is_deleted = '0'
     </select>
 
+    <!--查询项目下所有一级指标-->
+    <select id="selectFirstTargetByPid" parameterType="api.common.pojo.po.project.SimulationMptFirstTargetScorePo" resultType="api.common.pojo.po.project.SimulationMptFirstTargetScorePo">
+        select t.*,s.sublist_name,s.scene_num,s.weight, s.sublist_id
+        from simulation_mpt_first_target_score t
+        left join scene_package_sublist s on  t.target = s.sublist_id
+        where t.p_id = #{pId,jdbcType=VARCHAR} and t.is_deleted = '0'
+        order by s.seq
+    </select>
+
 </mapper>

+ 30 - 5
simulation-resource-server/src/main/resources/mapper/project/SimulationProjectMapper.xml

@@ -237,6 +237,9 @@
         <if test="createUserId != null and createUserId !=''">
             and create_user_id=#{createUserId,jdbcType=VARCHAR}
         </if>
+        <if test="uploadMode != null and uploadMode != ''">
+            and upload_mode = #{uploadMode,jdbcType=VARCHAR}
+        </if>
     </select>
 
     <!--获取车辆基本信息-->
@@ -284,6 +287,7 @@
         <if test="createUserId != null and createUserId !=''">
             and create_user_id=#{createUserId,jdbcType=VARCHAR}
         </if>
+         order by modify_time desc
     </select>
 
     <!--查询车辆与传感器关联信息-->
@@ -368,8 +372,15 @@
     <select id="selectsublistBySublistId" parameterType="string" resultType="api.common.pojo.vo.project.ScenePackageSubListVO">
         select sublist_id,sublist_name,scene_num,weight,parent_id,scene_natural_ids,scene_traffic_ids,scene_statue_ids,scene_generalization_ids
         from scene_package_sublist
-        where sublist_id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
-        order by seq desc
+        where sublist_id = #{id,jdbcType=VARCHAR}
+    </select>
+
+    <!--获取场景包下指标信息-->
+    <select id="selectsublistByRootId" parameterType="api.common.pojo.param.project.SimulationManualProjectParam" resultType="api.common.pojo.vo.project.SublistScoreVo">
+        select sub.sublist_id as id, sub.parent_id, sub.sublist_name,sub.scene_num, sub.package_and_rules
+        from scene_package_sublist sub
+        where sub.root_id = #{packageId,jdbcType=VARCHAR}
+        order by sub.seq
     </select>
 
     <!--查询场景包id下最后一级所有指标和场景-->
@@ -467,10 +478,24 @@
         from scene_package_sublist sub
 				left JOIN simulation_mpt_first_target_score fir on fir.target=sub.sublist_id and fir.p_id=#{id,jdbcType=VARCHAR}
 				left JOIN simulation_mpt_last_target_score las on las.target = sub.sublist_id and las.p_id=#{id,jdbcType=VARCHAR}
-        where sub.root_id = #{packageId,jdbcType=VARCHAR} and sub.is_deleted='0'
-		order by seq
+        where sub.root_id = #{packageId,jdbcType=VARCHAR} and (fir.target is not null or las.target is not null)
+		order by sub.seq
     </select>
 
+    <!--查询所有指标得分-->
+    <select id="selectSubScore2" parameterType="api.common.pojo.param.project.SimulationManualProjectParam" resultType="api.common.pojo.vo.project.SublistScoreVo">
+        select sub.sublist_id as id, sub.parent_id, sub.sublist_name,sub.scene_num,
+        fir.score as firScore,las.score as lasScore, sub.package_and_rules, las.not_standard_scene_num, las.score_explain,
+        fir.target as firTarget, las.target as lasTarget
+        from scene_package_sublist sub
+				left JOIN simulation_mpt_first_target_score fir on fir.target=sub.sublist_id and fir.p_id=#{id,jdbcType=VARCHAR}
+				left JOIN simulation_mpt_last_target_score las on las.target = sub.sublist_id and las.p_id=#{id,jdbcType=VARCHAR}
+        where sub.root_id = #{packageId,jdbcType=VARCHAR}
+		order by sub.seq
+    </select>
+
+
+
     <!--查询某天运行项目数量-->
     <select id="selectRunProjectBySy" parameterType="java.util.Map" resultType="java.lang.Integer">
         select count(id) from simulation_manual_project
@@ -555,7 +580,7 @@
     <!--保存评测等级-->
     <update id="saveEvaluationLevel" parameterType="api.common.pojo.po.project.SimulationManualProjectPo">
         update simulation_manual_project
-        set evaluation_level = #{evaluationLevel}
+        set evaluation_level = #{evaluationLevel,jdbcType=VARCHAR}
         where id = #{id,jdbcType=VARCHAR} and is_deleted = '0'
     </update>
 </mapper>

+ 9 - 0
simulation-resource-server/src/main/resources/mapper/project/SimulationProjectTaskMapper.xml

@@ -125,4 +125,13 @@
     </update>
 
 
+    <!--查询Aborted的数量-->
+    <select id="selectRunStateByAborted" parameterType="api.common.pojo.po.project.SimulationMptSceneScorePo" resultType="api.common.pojo.vo.project.SceneScoreVo">
+        select count(*) as num
+        from simulation_manual_project_task
+        where p_id = #{pId,jdbcType=VARCHAR}
+        and run_state = 'Aborted' and is_deleted = '0'
+    </select>
+
+
 </mapper>

Some files were not shown because too many files changed in this diff