Przeglądaj źródła

场景库模块代码格式化

wangzhiqiang 3 lat temu
rodzic
commit
f4f4580b16
23 zmienionych plików z 654 dodań i 720 usunięć
  1. 28 34
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/FileController.java
  2. 8 21
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/SceneAccidentController.java
  3. 8 19
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/SceneNaturalController.java
  4. 30 33
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/ScenePackageController.java
  5. 40 40
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/ScoringRulesController.java
  6. 9 29
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/StandardsRegulationsController.java
  7. 4 6
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SceneAccidentMapper.java
  8. 5 7
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SceneNaturalMapper.java
  9. 13 13
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/ScenePackageMapper.java
  10. 8 10
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/ScenePackageSublistMapper.java
  11. 10 8
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/ScoringRulesMapper.java
  12. 4 5
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/StandardsRegulationsMapper.java
  13. 65 73
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneAccidentService.java
  14. 121 126
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneNaturalService.java
  15. 85 93
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/ScenePackageService.java
  16. 14 12
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/ScoringRulesService.java
  17. 48 52
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/StandardsRegulationsService.java
  18. 37 36
      simulation-resource-server/src/main/resources/mapper/scene/SceneAccidentMapper.xml
  19. 50 48
      simulation-resource-server/src/main/resources/mapper/scene/SceneNaturalMapper.xml
  20. 16 12
      simulation-resource-server/src/main/resources/mapper/scene/ScenePackageMapper.xml
  21. 18 15
      simulation-resource-server/src/main/resources/mapper/scene/ScenePackageSublistMapper.xml
  22. 13 10
      simulation-resource-server/src/main/resources/mapper/scene/ScoringRulesMapper.xml
  23. 20 18
      simulation-resource-server/src/main/resources/mapper/scene/StandardsRegulationsMapper.xml

+ 28 - 34
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/FileController.java

@@ -3,7 +3,6 @@ package com.css.simulation.resource.scene.ctrl;
 import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.constants.DictConstants;
 import api.common.pojo.param.MinioParameter;
-import api.common.util.FileUtil;
 import api.common.util.TimeUtil;
 import com.css.simulation.resource.feign.FileDownService;
 import feign.Response;
@@ -33,58 +32,53 @@ public class FileController {
     private FileDownService fileDownService;
 
     @PostMapping(value = "/uploadWj", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
-    public ResponseBodyVO<Map>  uploadWj(@RequestParam( "file") MultipartFile multipartFile, HttpServletRequest request)  {
+    public ResponseBodyVO<Map> uploadWj(@RequestParam("file") MultipartFile multipartFile, HttpServletRequest request) {
         //获取文件类型
         String type = request.getParameter("type");
         String objectPath = request.getParameter("objectPath");
         if (multipartFile != null) {
-            String fileName="";
-            Integer nowTime= TimeUtil.getRq(new Date(),0);
-            if(type.equals(DictConstants.SCENE_NATURAL)){
-                fileName="自然驾驶场景/"+nowTime+"/"+objectPath+"/"+multipartFile.getOriginalFilename();
-            }else if(type.equals(DictConstants.SCENE_STANDARD)){
-                fileName="标准法规场景/"+nowTime+"/"+objectPath+"/"+multipartFile.getOriginalFilename();
-            }else if(type.equals(DictConstants.SCENE_ACCIDENT)){
-                fileName="交通事故场景/"+nowTime+"/"+objectPath+"/"+multipartFile.getOriginalFilename();
-            }else if(type.equals(DictConstants.SCENE_GENERAL)){
-                fileName="泛化场景/"+nowTime+"/"+objectPath+"/"+multipartFile.getOriginalFilename();
-            }else if(type.equals(DictConstants.ALGORITHM_FILE)){
-                fileName="algorithm/"+ nowTime +"/" + multipartFile.getOriginalFilename();
-            }else{
-                fileName=multipartFile.getOriginalFilename();
+            String fileName = "";
+            Integer nowTime = TimeUtil.getRq(new Date(), 0);
+            if (type.equals(DictConstants.SCENE_NATURAL)) {
+                fileName = "自然驾驶场景/" + nowTime + "/" + objectPath + "/" + multipartFile.getOriginalFilename();
+            } else if (type.equals(DictConstants.SCENE_STANDARD)) {
+                fileName = "标准法规场景/" + nowTime + "/" + objectPath + "/" + multipartFile.getOriginalFilename();
+            } else if (type.equals(DictConstants.SCENE_ACCIDENT)) {
+                fileName = "交通事故场景/" + nowTime + "/" + objectPath + "/" + multipartFile.getOriginalFilename();
+            } else if (type.equals(DictConstants.SCENE_GENERAL)) {
+                fileName = "泛化场景/" + nowTime + "/" + objectPath + "/" + multipartFile.getOriginalFilename();
+            } else if (type.equals(DictConstants.ALGORITHM_FILE)) {
+                fileName = "algorithm/" + nowTime + "/" + multipartFile.getOriginalFilename();
+            } else {
+                fileName = multipartFile.getOriginalFilename();
             }
-            log.info("上传文件名称--------"+fileName);
-            log.info("文件类型--------"+multipartFile.getContentType());
+            ResponseBodyVO<String> respon = fileDownService.upload(multipartFile, fileName);
+            String videoPreview = respon.getMessage();
+            Map map = new HashMap();
+            map.put("videoPreview", videoPreview);
+            map.put("fileName", fileName);
 
-            ResponseBodyVO<String> respon=fileDownService.upload(multipartFile,fileName);
-            String videoPreview=  respon.getMessage();
-            Map map=new HashMap();
-            map.put("videoPreview",videoPreview);
-            map.put("fileName",fileName);
-
-            log.info("上穿成功--------"+fileName);
-
-            return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,map);
+            return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, map);
         }
-        return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"文件流file为空,请检查!");
+        return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "文件流file为空,请检查!");
     }
 
     @PostMapping(value = "/download")
     public void download(
-            HttpServletResponse response,@RequestBody @Validated MinioParameter parms
+            HttpServletResponse response, @RequestBody @Validated MinioParameter parms
     ) throws IOException {
         Response download = fileDownService.download(parms);
         Response.Body body = download.body();
         InputStream inputStream = body.asInputStream();
-       downloadForHttp(parms.getObjectName(), inputStream, response, 1024);
+        downloadForHttp(parms.getObjectName(), inputStream, response, 1024);
     }
 
 
-    public  void downloadForHttp(String fileName, InputStream in, HttpServletResponse response, int bufferSize) throws IOException {
-        int idx=fileName.lastIndexOf("/");
-        fileName=fileName.substring(idx+1,fileName.length());
+    public void downloadForHttp(String fileName, InputStream in, HttpServletResponse response, int bufferSize) throws IOException {
+        int idx = fileName.lastIndexOf("/");
+        fileName = fileName.substring(idx + 1, fileName.length());
 
-        log.info("下载----"+fileName);
+        log.info("下载----" + fileName);
         response.setContentType("application/octet-stream;charset=utf-8");
         response.setHeader("Content-Disposition", "attachment;filename=\"" + fileName + "\"");
         copyBytes(in, response.getOutputStream(), bufferSize);

+ 8 - 21
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/SceneAccidentController.java

@@ -25,22 +25,22 @@ 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);
+        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);
+        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 pageInfo = new PageInfo<>(list1);
         pageInfo.setTotal(objectPageInfo.getTotal());
-        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,pageInfo);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, pageInfo);
     }
 
 
@@ -60,17 +60,4 @@ public class SceneAccidentController {
         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);
-    }
-
-
 }

+ 8 - 19
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/SceneNaturalController.java

@@ -23,22 +23,22 @@ public class SceneNaturalController {
     @Resource
     SceneNaturalService sceneNaturalService;
 
-//查询列表
+    //查询列表
     @PostMapping("/querySceneNaturalList")
     @ResponseBody
     public ResponseBodyVO<List<SceneNaturalVO>> querySceneNaturalList(@RequestBody SceneNaturalNewParam parms) {
         PageUtil.setPageInfo(parms);
-        List<SceneNaturalPO> list=sceneNaturalService.querySceneNaturalList(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);
+        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 pageInfo = new PageInfo<>(list1);
         pageInfo.setTotal(objectPageInfo.getTotal());
-        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,pageInfo);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, pageInfo);
     }
 
 
@@ -58,15 +58,4 @@ public class SceneNaturalController {
         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());
-    }*/
-
-
 }

+ 30 - 33
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/ScenePackageController.java

@@ -1,11 +1,8 @@
 package com.css.simulation.resource.scene.ctrl;
 
 import api.common.pojo.common.ResponseBodyVO;
-import api.common.pojo.param.scene.ScenePackageNewParam;
 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.ScenePackageNewVO;
 import api.common.pojo.vo.scene.ScenePackageSublistVO;
 import api.common.pojo.vo.scene.ScenePackageVO;
 import api.common.util.ObjectUtil;
@@ -14,7 +11,6 @@ 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;
@@ -28,59 +24,59 @@ 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);
+        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);
+        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 pageInfo = new PageInfo<>(list1);
         pageInfo.setTotal(objectPageInfo.getTotal());
-        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,pageInfo);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, pageInfo);
     }
 
 
     //新增测试包
     @PostMapping("/saveScenePackage")
     @ResponseBody
-    public ResponseBodyVO<String> saveScoringRules(@RequestBody Map<String,List<ScenePackageSublistVO>> map) {
+    public ResponseBodyVO<String> saveScoringRules(@RequestBody Map<String, List<ScenePackageSublistVO>> map) {
 
-        List<ScenePackageSublistVO> params= map.get("params");
-        if(params==null||params.size()<1) {
-            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"参数不能为空,请检查");
-                }else if(params.get(0).getId()==null || params.get(0).getPackageLevel()==1){
-                        params.get(0).setId("");
-                        return scenePackageService.saveScenePackage(params);
-                 }else{
-                return  scenePackageService.updateScenePackage(params);
-            }
+        List<ScenePackageSublistVO> params = map.get("params");
+        if (params == null || params.size() < 1) {
+            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "参数不能为空,请检查");
+        } else if (params.get(0).getId() == null || params.get(0).getPackageLevel() == 1) {
+            params.get(0).setId("");
+            return scenePackageService.saveScenePackage(params);
+        } else {
+            return scenePackageService.updateScenePackage(params);
+        }
     }
 
     //修改
     @PostMapping("/updateScenePackage")
     @ResponseBody
-    public ResponseBodyVO<String> updateScenePackage(@RequestBody Map<String,List<ScenePackageSublistVO>> map)  {
-        List<ScenePackageSublistVO> params= map.get("params");
-        return  scenePackageService.updateScenePackage(params);
+    public ResponseBodyVO<String> updateScenePackage(@RequestBody Map<String, List<ScenePackageSublistVO>> map) {
+        List<ScenePackageSublistVO> params = map.get("params");
+        return scenePackageService.updateScenePackage(params);
     }
 
     //查询一个测试包列表
     @PostMapping("/queryScenePackageSublistList")
     @ResponseBody
     public ResponseBodyVO<List<ScenePackageSublistVO>> queryScenePackageSublistList(@RequestBody ScenePackageParam parms) {
-        if(ObjectUtil.isNull(parms.getPackageId())){
-            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"参数PackageId不能为空,请检查");
+        if (ObjectUtil.isNull(parms.getPackageId())) {
+            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "参数PackageId不能为空,请检查");
         }
-        List<ScenePackageSublistVO> list =  scenePackageService.queryScenePackageSublistList(parms);
+        List<ScenePackageSublistVO> list = scenePackageService.queryScenePackageSublistList(parms);
 
-        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,list);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, list);
     }
 
 
@@ -88,18 +84,19 @@ public class ScenePackageController {
     @PostMapping("/instShareList")
     @ResponseBody
     public ResponseBodyVO<String> instShareList(@RequestBody ScenePackageParam parms) {
-        if(ObjectUtil.isNull(parms.getPackageId())){
-            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"参数PackageId不能为空,请检查");
+        if (ObjectUtil.isNull(parms.getPackageId())) {
+            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "参数PackageId不能为空,请检查");
         }
 
         return scenePackageService.instShareList(parms);
     }
+
     //测试包删除
     @PostMapping("/deleteList")
     @ResponseBody
     public ResponseBodyVO<String> deleteList(@RequestBody ScenePackageParam parms) {
-        if(ObjectUtil.isNull(parms.getPackageId())){
-            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"参数PackageId不能为空,请检查");
+        if (ObjectUtil.isNull(parms.getPackageId())) {
+            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "参数PackageId不能为空,请检查");
         }
         scenePackageService.deleteList(parms);
         return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);

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

@@ -11,6 +11,7 @@ import com.css.simulation.resource.scene.service.ScoringRulesService;
 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;
@@ -23,82 +24,82 @@ 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);
+        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);
+        List<ScoringRulesVO> list1 = new ArrayList<>();
+        //po转vo
+        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);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, pageInfo);
     }
 
-     //查询详情
+    //查询详情
     @PostMapping("/queryScoringRules")
     @ResponseBody
-    public ResponseBodyVO<List<ScoringRulesPO>> queryScoringRules(@RequestBody ScoringRulesParam parms)  {
-        if(ObjectUtil.isNull(parms.getRulesId())){
-            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"参数RulesId不能为空,请检查");
+    public ResponseBodyVO<List<ScoringRulesPO>> queryScoringRules(@RequestBody ScoringRulesParam parms) {
+        if (ObjectUtil.isNull(parms.getRulesId())) {
+            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "参数RulesId不能为空,请检查");
         }
-        ScoringRulesPO po=scoringRulesService.queryScoringRules(parms);
-        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,po);
+        ScoringRulesPO po = scoringRulesService.queryScoringRules(parms);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, po);
 
     }
 
     //查唯一
     @PostMapping("/queryScoringRulesCount")
     @ResponseBody
-    public ResponseBodyVO<List<ScoringRulesPO>> queryScoringRulesCount(@RequestBody ScoringRulesParam parms)  {
-        if(ObjectUtil.isNull(parms.getRuleName())){
-            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"参数RulesName不能为空,请检查");
+    public ResponseBodyVO<List<ScoringRulesPO>> queryScoringRulesCount(@RequestBody ScoringRulesParam parms) {
+        if (ObjectUtil.isNull(parms.getRuleName())) {
+            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "参数RulesName不能为空,请检查");
         }
-        List<ScoringRulesPO> list=scoringRulesService.queryScoringRulesByRuleName(parms);
-        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,list);
-
+        List<ScoringRulesPO> list = scoringRulesService.queryScoringRulesByRuleName(parms);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, list);
     }
+
     //新增打分规则
     @PostMapping("/saveScoringRules")
     @ResponseBody
     public ResponseBodyVO<String> saveScoringRules(@RequestBody ScoringRulesPO parms) {
-        ScoringRulesParam vo=new ScoringRulesParam();
-        BeanUtils.copyProperties(parms,vo);
+        ScoringRulesParam vo = new ScoringRulesParam();
+        BeanUtils.copyProperties(parms, vo);
         vo.setShare("0");
         vo.setCreateUserId(AuthUtil.getCurrentUserId());
-        List<ScoringRulesPO> list=scoringRulesService.queryScoringRulesByRuleName(vo);
-        if(list!=null && list.size()>0){
-            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"规则名称ruleName已存在,请重新命名");
+        List<ScoringRulesPO> list = scoringRulesService.queryScoringRulesByRuleName(vo);
+        if (list != null && list.size() > 0) {
+            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "规则名称ruleName已存在,请重新命名");
         }
-        if(ObjectUtil.isNull(parms.getRulesId())){
+        if (ObjectUtil.isNull(parms.getRulesId())) {
             scoringRulesService.saveScoringRules(parms);
-        }else{
+        } else {
             scoringRulesService.updateScoringRules(parms);
         }
-
         return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
     }
 
     //分享
     @PostMapping("/fxScoringRules")
     @ResponseBody
-    public ResponseBodyVO<String> fxScoringRules(@RequestBody ScoringRulesParam params)  {
-        if(ObjectUtil.isNull(params.getRulesId())){
-            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"参数RulesId不能为空,请检查");
+    public ResponseBodyVO<String> fxScoringRules(@RequestBody ScoringRulesParam params) {
+        if (ObjectUtil.isNull(params.getRulesId())) {
+            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "参数RulesId不能为空,请检查");
         }
-        ScoringRulesPO po=scoringRulesService.queryScoringRules(params);
+        ScoringRulesPO po = scoringRulesService.queryScoringRules(params);
         params.setShare("1");
         params.setRuleName(po.getRuleName());
-        List<ScoringRulesPO> list=scoringRulesService.queryScoringRulesByRuleName(params);
-        if(list!=null && list.size()>0){
-            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"规则名称ruleName已存在,请重新命名");
+        List<ScoringRulesPO> list = scoringRulesService.queryScoringRulesByRuleName(params);
+        if (list != null && list.size() > 0) {
+            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "规则名称ruleName已存在,请重新命名");
         }
         po.setShare("1");
         scoringRulesService.saveScoringRules(po);
@@ -108,20 +109,19 @@ public class ScoringRulesController {
     //删除
     @PostMapping("/deleteScoringRules")
     @ResponseBody
-    public ResponseBodyVO<String> deleteScoringRules(@RequestBody ScoringRulesPO params)  {
+    public ResponseBodyVO<String> deleteScoringRules(@RequestBody ScoringRulesPO params) {
         scoringRulesService.deleteScoringRules(params);
         return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);
     }
 
-
-    //测试包查询列表
+    //测试包里面对应查询打分规则列表
     @PostMapping("/queryCsb")
     @ResponseBody
     public ResponseBodyVO<List<ScoringRulesPO>> queryCsb() {
-        ScoringRulesParam params=new ScoringRulesParam();
+        ScoringRulesParam params = new ScoringRulesParam();
         params.setShare("0");
         params.setCreateUserId(AuthUtil.getCurrentUserId());
-        List<ScoringRulesPO> list=scoringRulesService.queryScoringRulesList(params);
-        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,list);
+        List<ScoringRulesPO> list = scoringRulesService.queryScoringRulesList(params);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, list);
     }
 }

+ 9 - 29
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/StandardsRegulationsController.java

@@ -32,22 +32,22 @@ 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);
+        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);
+        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 pageInfo = new PageInfo<>(list1);
         pageInfo.setTotal(objectPageInfo.getTotal());
-        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,pageInfo);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, pageInfo);
     }
 
 
@@ -56,7 +56,7 @@ public class StandardsRegulationsController {
     @ResponseBody
     public ResponseBodyVO<String> saveStandardsRegulations(@RequestBody StandardsRegulationsParam parms) {
 
-        return  standardsRegulationsService.importBzFg(parms);
+        return standardsRegulationsService.importBzFg(parms);
 
     }
 
@@ -68,24 +68,4 @@ public class StandardsRegulationsController {
         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);
-    }
-
 }

+ 4 - 6
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SceneAccidentMapper.java

@@ -1,22 +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);
+    void saveSceneAccident(SceneAccidentPO params);
+
+    List<SceneAccidentPO> querySceneAccidentList(SceneAccidentParam params);
 
-   List<SceneAccidentPO> querySceneAccidentList(SceneAccidentParam params);
-  void deleteSceneAccidentList(SceneAccidentPO params);
+    void deleteSceneAccidentList(SceneAccidentPO params);
 
     List<SceneAccidentPO> querySceneAccidentByNmae(SceneAccidentParam params);
 

+ 5 - 7
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SceneNaturalMapper.java

@@ -1,6 +1,5 @@
 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;
@@ -8,17 +7,16 @@ import org.springframework.stereotype.Repository;
 
 import java.util.List;
 
-
-
 @Mapper
 @Repository
 public interface SceneNaturalMapper {
 
-   void saveSceneNatural(SceneNaturalPO params);
+    void saveSceneNatural(SceneNaturalPO params);
+
+    List<SceneNaturalPO> querySceneNaturalList(SceneNaturalParam params);
 
-   List<SceneNaturalPO> querySceneNaturalList(SceneNaturalParam params);
+    void deleteSceneNatural(SceneNaturalPO params);
 
-   void deleteSceneNatural(SceneNaturalPO params);
-   List<SceneNaturalPO> querySceneNaturaByName(SceneNaturalParam params);
+    List<SceneNaturalPO> querySceneNaturaByName(SceneNaturalParam params);
 
 }

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

@@ -1,13 +1,10 @@
 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.ScenePackageNewVO;
-import api.common.pojo.vo.scene.ScenePackageSublistVO;
 import org.apache.ibatis.annotations.Mapper;
 import org.springframework.stereotype.Repository;
-
 import java.util.List;
 
 
@@ -15,18 +12,21 @@ import java.util.List;
 @Repository
 public interface ScenePackageMapper {
 
-   void saveScenePackage(ScenePackagePO params);
-   void updateScenePackage(ScenePackagePO params);
-   void deleteScenePackage(ScenePackagePO params);
-   //查询详情
-   ScenePackagePO queryScenePackage(ScenePackageParam params);
+    void saveScenePackage(ScenePackagePO params);
+
+    void updateScenePackage(ScenePackagePO params);
+
+    void deleteScenePackage(ScenePackagePO params);
+
+    //查询详情
+    ScenePackagePO queryScenePackage(ScenePackageParam params);
 
-   List<ScenePackagePO> queryScenePackageList(ScenePackageParam params);
+    List<ScenePackagePO> queryScenePackageList(ScenePackageParam params);
 
-   //单独给查询一个测试包的列表用
-   ScenePackageNewVO queryScenePackageBySublist(String packageId);
+    //单独给查询一个测试包的列表用
+    ScenePackageNewVO queryScenePackageBySublist(String packageId);
 
-   //测试包名查唯一
-   List<ScenePackageNewVO> queryByPackageName(ScenePackagePO params);
+    //测试包名查唯一
+    List<ScenePackageNewVO> queryByPackageName(ScenePackagePO params);
 
 }

+ 8 - 10
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/ScenePackageSublistMapper.java

@@ -1,27 +1,25 @@
 package com.css.simulation.resource.scene.mapper;
 
 import api.common.pojo.po.scene.ScenePackageSublistPO;
-import api.common.pojo.vo.scene.ScenePackageNewVO;
 import api.common.pojo.vo.scene.ScenePackageSublistVO;
 import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
-
 import java.util.List;
-import java.util.Map;
 
 
 @Mapper
 @Repository
 public interface ScenePackageSublistMapper {
 
-   void saveScenePackageSublist(ScenePackageSublistPO params);
-   void saveScenePackageSublistAll(List<ScenePackageSublistPO> treeList);
-   void deleteScenePackageSublist(String  rootId);
+    void saveScenePackageSublist(ScenePackageSublistPO params);
+
+    void saveScenePackageSublistAll(List<ScenePackageSublistPO> treeList);
+
+    void deleteScenePackageSublist(String rootId);
 
-   List<ScenePackageSublistVO> queryScenePackageSublistList(ScenePackageSublistPO params);
+    List<ScenePackageSublistVO> queryScenePackageSublistList(ScenePackageSublistPO params);
 
-   //指标名查唯一
-   List<ScenePackageSublistVO> queryBySublistName(ScenePackageSublistPO params);
+    //指标名查唯一
+    List<ScenePackageSublistVO> queryBySublistName(ScenePackageSublistPO params);
 
 }

+ 10 - 8
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/ScoringRulesMapper.java

@@ -1,11 +1,9 @@
 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;
 
 
@@ -13,12 +11,16 @@ import java.util.List;
 @Repository
 public interface ScoringRulesMapper {
 
-   void saveScoringRules(ScoringRulesPO params);
-   List<ScoringRulesPO> queryScoringRulesByRuleName(ScoringRulesParam params);
+    void saveScoringRules(ScoringRulesPO params);
+
+    List<ScoringRulesPO> queryScoringRulesByRuleName(ScoringRulesParam params);
+
+    List<ScoringRulesPO> queryScoringRulesList(ScoringRulesParam params);
+
+    ScoringRulesPO queryScoringRules(ScoringRulesParam params);
+
+    void updateScoringRules(ScoringRulesPO params);
 
-   List<ScoringRulesPO> queryScoringRulesList(ScoringRulesParam params);
-   ScoringRulesPO queryScoringRules(ScoringRulesParam params);
-   void updateScoringRules(ScoringRulesPO params);
-   void deleteScoringRules(ScoringRulesPO params);
+    void deleteScoringRules(ScoringRulesPO params);
 
 }

+ 4 - 5
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/StandardsRegulationsMapper.java

@@ -4,7 +4,6 @@ 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;
 
 
@@ -12,13 +11,13 @@ import java.util.List;
 @Repository
 public interface StandardsRegulationsMapper {
 
-   void saveStandardsRegulations(StandardsRegulationsPO params);
+    void saveStandardsRegulations(StandardsRegulationsPO params);
 
-   List<StandardsRegulationsPO> queryStandardsRegulationsList(StandardsRegulationsParam params);
+    List<StandardsRegulationsPO> queryStandardsRegulationsList(StandardsRegulationsParam params);
 
-   void deleteStandardsRegulations(StandardsRegulationsPO params);
+    void deleteStandardsRegulations(StandardsRegulationsPO params);
 
-   List<StandardsRegulationsPO> queryStandardsRegulationsByName(StandardsRegulationsParam params);
+    List<StandardsRegulationsPO> queryStandardsRegulationsByName(StandardsRegulationsParam params);
 
 
 }

+ 65 - 73
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneAccidentService.java

@@ -15,7 +15,6 @@ 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;
@@ -31,66 +30,66 @@ public class SceneAccidentService {
 
     @Resource
     private FileDownService fileDownService;
+
     /**
      * 获取交通事故场景数据:
      */
     @SneakyThrows
     public ResponseBodyVO<String> importJtSg(SceneAccidentParam param) {
 
-            MinioParameter MI=new MinioParameter();
-            MI.setObjectName(param.getJsonAddress());
-            Response download = fileDownService.download(MI);
-                // -------------------------------- label.json --------------------------------
-                String json = download.body().toString();;
-                    ObjectMapper objMap = new ObjectMapper();
-                    JsonNode root = objMap.readTree(json);
-                    //判断场景名称唯一
-                    String sceneName=  root.path("场景名称").asText();
-            param.setSceneName(sceneName);
-            List<SceneAccidentPO> list=  SceneAccidentMapper.querySceneAccidentByNmae(param);
-            if(list!=null && list.size()>0){
-                return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"该场景名称"+ sceneName+"已存在,请检查");
-            }
-
-                    SceneAccidentPO sceneAccidentPO = null;
-                    sceneAccidentPO = sceneAccidentPO.builder()
-                        .accidentId(StringUtil.getRandomUUID())
-                        .sceneName(sceneName)
-                        .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());
-                    }
-                    if(null!=param.getVideoPreview()&&!param.getVideoPreview().equals("")){
-                        sceneAccidentPO.setVideoPreview(param.getVideoPreview());
-                    }
-
-                    SceneAccidentMapper.saveSceneAccident(sceneAccidentPO);
+        MinioParameter MI = new MinioParameter();
+        MI.setObjectName(param.getJsonAddress());
+        Response download = fileDownService.download(MI);
+        // -------------------------------- label.json --------------------------------
+        String json = download.body().toString();
+        ;
+        ObjectMapper objMap = new ObjectMapper();
+        JsonNode root = objMap.readTree(json);
+        //判断场景名称唯一
+        String sceneName = root.path("场景名称").asText();
+        param.setSceneName(sceneName);
+        List<SceneAccidentPO> list = SceneAccidentMapper.querySceneAccidentByNmae(param);
+        if (list != null && list.size() > 0) {
+            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "该场景名称" + sceneName + "已存在,请检查");
+        }
 
+        SceneAccidentPO sceneAccidentPO = null;
+        sceneAccidentPO = sceneAccidentPO.builder()
+                .accidentId(StringUtil.getRandomUUID())
+                .sceneName(sceneName)
+                .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());
+        }
+        if (null != param.getVideoPreview() && !param.getVideoPreview().equals("")) {
+            sceneAccidentPO.setVideoPreview(param.getVideoPreview());
+        }
+        SceneAccidentMapper.saveSceneAccident(sceneAccidentPO);
 
-                return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
 
 
     }
@@ -101,8 +100,8 @@ public class SceneAccidentService {
     @SneakyThrows
     public void testCS(SceneAccidentParam param) {
         //1 获取所有目录下所有场景
-         String dataUrl0 ="C:\\Users\\CSS\\Desktop\\GQ\\仿真云平台\\测试场景样例数据\\交通事故场景\\China_Expressway_002";     // 场景数据根路径
-      //  System.out.println("--------"+param.getPath());
+        String dataUrl0 = "C:\\Users\\CSS\\Desktop\\GQ\\仿真云平台\\测试场景样例数据\\交通事故场景\\China_Expressway_002";     // 场景数据根路径
+        //  System.out.println("--------"+param.getPath());
         File[] scenes = FileUtil.getDirectory(dataUrl0).listFiles();
         if (scenes == null) {
             throw new RuntimeException("目录:" + dataUrl0 + " 下没有文件!");
@@ -113,11 +112,11 @@ public class SceneAccidentService {
             SceneAccidentPO sceneAccidentPO = null;
             for (File scene : scenes) {
                 String dataUrl = scene.getAbsolutePath();
-                if(dataUrl.indexOf(".json")!=-1){
+                if (dataUrl.indexOf(".json") != -1) {
                     //获取文件名
-                    File tempFile =new File( dataUrl.trim());
+                    File tempFile = new File(dataUrl.trim());
                     fileName = tempFile.getName();
-                    fileName=  fileName.substring(0,fileName.lastIndexOf("."));
+                    fileName = fileName.substring(0, fileName.lastIndexOf("."));
                     // -------------------------------- 读取结构化数据文件 --------------------------------
                     List<String> exceptionList = new ArrayList<>();     // 异常列表
                     // -------------------------------- label.json --------------------------------
@@ -139,46 +138,39 @@ public class SceneAccidentService {
                     sceneAccidentPO.setCreateUserId(AuthUtil.getCurrentUserId());
                     sceneAccidentPO.setModifyTime(TimeUtil.getNowForMysql());
 
-                    if(null!=param.getJsonAddress()&&!param.getJsonAddress().equals("")){
+                    if (null != param.getJsonAddress() && !param.getJsonAddress().equals("")) {
                         sceneAccidentPO.setJsonAddress(param.getJsonAddress());
                     }
-                    if(null!=param.getXmlAddress()&&!param.getXmlAddress().equals("")){
+                    if (null != param.getXmlAddress() && !param.getXmlAddress().equals("")) {
                         sceneAccidentPO.setXmlAddress(param.getXmlAddress());
                     }
-                    if(null!=param.getXodrAddress()&&!param.getXodrAddress().equals("")){
+                    if (null != param.getXodrAddress() && !param.getXodrAddress().equals("")) {
                         sceneAccidentPO.setXodrAddress(param.getXodrAddress());
                     }
-                    if(null!=param.getOsgbAddress()&&!param.getOsgbAddress().equals("")){
+                    if (null != param.getOsgbAddress() && !param.getOsgbAddress().equals("")) {
                         sceneAccidentPO.setOsgbAddress(param.getOsgbAddress());
                     }
-                    if(null!=param.getVideoAddress()&&!param.getVideoAddress().equals("")){
+                    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) {
+    public List<SceneAccidentPO> querySceneAccidentList(SceneAccidentParam params) {
 
         List<SceneAccidentPO> list = SceneAccidentMapper.querySceneAccidentList(params);
         return list;
     }
 
-    public   void deleteSceneAccidentList(SceneAccidentPO params) {
+    public void deleteSceneAccidentList(SceneAccidentPO params) {
         params.setIsDeleted("1");
         params.setModifyTime(TimeUtil.getNowForMysql());
         params.setModifyUserId(AuthUtil.getCurrentUserId());
-      SceneAccidentMapper.deleteSceneAccidentList(params);
+        SceneAccidentMapper.deleteSceneAccidentList(params);
     }
 }

+ 121 - 126
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneNaturalService.java

@@ -5,7 +5,6 @@ import api.common.pojo.param.MinioParameter;
 import api.common.pojo.param.scene.SceneNaturalNewParam;
 import api.common.pojo.param.scene.SceneNaturalParam;
 import api.common.pojo.po.scene.SceneNaturalPO;
-import api.common.util.FileUtil;
 import api.common.util.ObjectUtil;
 import api.common.util.ParamUtil;
 import api.common.util.TimeUtil;
@@ -21,11 +20,8 @@ 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.Arrays;
 import java.util.List;
-import java.util.stream.IntStream;
 
 
 @Slf4j
@@ -38,107 +34,107 @@ public class SceneNaturalService {
 
     @Resource
     private FileDownService fileDownService;
+
     /**
      * 获取自然驾驶场景数据:包括切分数据和标注数据
      */
     @SneakyThrows
     public ResponseBodyVO<String> importZrjsSceneCicv(SceneNaturalParam param) {
-        MinioParameter MI=new MinioParameter();
+        MinioParameter MI = new MinioParameter();
         MI.setObjectName(param.getJsonAddress());
-        int idx=param.getJsonAddress().lastIndexOf("/");
-        int end=param.getJsonAddress().lastIndexOf(".");
-       String  fileName=param.getJsonAddress().substring(idx+1,end);
+        int idx = param.getJsonAddress().lastIndexOf("/");
+        int end = param.getJsonAddress().lastIndexOf(".");
+        String fileName = param.getJsonAddress().substring(idx + 1, end);
         param.setNaturalName(fileName);
-          List<SceneNaturalPO> list=  sceneNaturalMapper.querySceneNaturaByName(param);
-          if(list!=null && list.size()>0){
-              return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"该场景编号"+ fileName+"已存在,请检查");
-          }
+        List<SceneNaturalPO> list = sceneNaturalMapper.querySceneNaturaByName(param);
+        if (list != null && list.size() > 0) {
+            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "该场景编号" + fileName + "已存在,请检查");
+        }
         Response download = fileDownService.download(MI);
-                String json =download.body().toString();
-                    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());
-                    }
-                    if(null!=param.getVideoPreview()&&!param.getVideoPreview().equals("")){
-                        sceneNaturalPO.setVideoPreview(param.getVideoPreview());
-                    }
+        String json = download.body().toString();
+        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());
+        }
+        if (null != param.getVideoPreview() && !param.getVideoPreview().equals("")) {
+            sceneNaturalPO.setVideoPreview(param.getVideoPreview());
+        }
 
-                    sceneNaturalMapper.saveSceneNatural(sceneNaturalPO);
+        sceneNaturalMapper.saveSceneNatural(sceneNaturalPO);
         return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
-
     }
 
     public String getSequenceNew(JsonNode jsonObject, String field) throws Exception {
@@ -187,65 +183,64 @@ public class SceneNaturalService {
         else
             return s;
     }
-    public   List<SceneNaturalPO> querySceneNaturalList(SceneNaturalNewParam params) {
-        SceneNaturalParam  po=new SceneNaturalParam();
-         String naturalName=params.getNaturalName();      // 场景编号
-      String[][] naturalEnvironment=params.getNaturalEnvironment() ; //自然环境
-         String[][] road =params.getRoad(); //道路
-         String[][] infrastructure =params.getInfrastructure(); //基础设施
-       String[][] temporaryOperation =params.getTemporaryOperation(); //临时性操作
-        String[][] trafficCondition =params.getTrafficCondition(); //交通状况
-         String[][] selfBehavior =params.getSelfBehavior() ;//自车行为
-        String[][] targetBehavior =params.getTargetBehavior(); //目标行为
-        if(ObjectUtil.isNotNull(params.getIds()))   {
+
+    public List<SceneNaturalPO> querySceneNaturalList(SceneNaturalNewParam params) {
+        SceneNaturalParam po = new SceneNaturalParam();
+        String naturalName = params.getNaturalName();      // 场景编号
+        String[][] naturalEnvironment = params.getNaturalEnvironment(); //自然环境
+        String[][] road = params.getRoad(); //道路
+        String[][] infrastructure = params.getInfrastructure(); //基础设施
+        String[][] temporaryOperation = params.getTemporaryOperation(); //临时性操作
+        String[][] trafficCondition = params.getTrafficCondition(); //交通状况
+        String[][] selfBehavior = params.getSelfBehavior();//自车行为
+        String[][] targetBehavior = params.getTargetBehavior(); //目标行为
+        if (ObjectUtil.isNotNull(params.getIds())) {
             po.setIds(params.getIds());
         }
-        if(ObjectUtil.isNotNull(naturalName))   {
+        if (ObjectUtil.isNotNull(naturalName)) {
             po.setNaturalName(naturalName);
         }
-      if(naturalEnvironment!=null&&naturalEnvironment.length>0)   {
+        if (naturalEnvironment != null && naturalEnvironment.length > 0) {
             ParamUtil.arrConvertObj(naturalEnvironment, po);
         }
-        if(road!=null&&road.length>0)   {
+        if (road != null && road.length > 0) {
             ParamUtil.arrConvertObj(road, po);
         }
-        if(infrastructure!=null&&infrastructure.length>0)   {
+        if (infrastructure != null && infrastructure.length > 0) {
             ParamUtil.arrConvertObj(infrastructure, po);
         }
-        if(temporaryOperation!=null&&temporaryOperation.length>0)   {
+        if (temporaryOperation != null && temporaryOperation.length > 0) {
             ParamUtil.arrConvertObj(temporaryOperation, po);
         }
-        if(trafficCondition!=null&&trafficCondition.length>0)   {
+        if (trafficCondition != null && trafficCondition.length > 0) {
             ParamUtil.arrConvertObj(trafficCondition, po);
         }
-        if(selfBehavior!=null&&selfBehavior.length>0)   {
+        if (selfBehavior != null && selfBehavior.length > 0) {
             ParamUtil.arrConvertObj(selfBehavior, po);
-            for (String [] arr : selfBehavior) {
-                if(arr != null && arr.length ==1 ){
-                    List list=po.getSelfBehavior();
-                    if(list==null){
-                        List newList=new ArrayList();
+            for (String[] arr : selfBehavior) {
+                if (arr != null && arr.length == 1) {
+                    List list = po.getSelfBehavior();
+                    if (list == null) {
+                        List newList = new ArrayList();
                         newList.add(arr[0]);
-                        po.setSelfBehavior(newList);  ;
-                    }else{
+                        po.setSelfBehavior(newList);
+                        ;
+                    } else {
 
                         list.add(arr[0]);
-                        po.setSelfBehavior(list);  ;
+                        po.setSelfBehavior(list);
                     }
-
-
                 }
             }
-
         }
-        if(targetBehavior!=null&&targetBehavior.length>0)   {
+        if (targetBehavior != null && targetBehavior.length > 0) {
             ParamUtil.arrConvertObj(targetBehavior, po);
         }
         List<SceneNaturalPO> list = sceneNaturalMapper.querySceneNaturalList(po);
         return list;
     }
 
-    public   void deleteSceneNatural(SceneNaturalPO params) {
+    public void deleteSceneNatural(SceneNaturalPO params) {
         params.setIsDeleted("1");
         params.setModifyTime(TimeUtil.getNowForMysql());
         params.setModifyUserId(AuthUtil.getCurrentUserId());

+ 85 - 93
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/ScenePackageService.java

@@ -7,7 +7,6 @@ import api.common.pojo.po.scene.ScenePackageSublistPO;
 import api.common.pojo.vo.scene.ScenePackageNewVO;
 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;
@@ -16,12 +15,9 @@ import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
-
 import javax.annotation.Resource;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 @Slf4j
 @Service
@@ -33,83 +29,80 @@ public class ScenePackageService {
     private ScenePackageSublistMapper scenePackageSublistMapper;
 
 
-
-
     /**
      * 测试包数据录入大保存:
      */
     @SneakyThrows
-    public ResponseBodyVO<String> saveScenePackage(List<ScenePackageSublistVO> params){
-        List<ScenePackageSublistVO> listSublictTree=new ArrayList<>();
-        ScenePackagePO po=new ScenePackagePO();
-        for (ScenePackageSublistVO vo:params) {
-             po.setPackageName(vo.getSublistName());
+    public ResponseBodyVO<String> saveScenePackage(List<ScenePackageSublistVO> params) {
+        List<ScenePackageSublistVO> listSublictTree = new ArrayList<>();
+        ScenePackagePO po = new ScenePackagePO();
+        for (ScenePackageSublistVO vo : params) {
+            po.setPackageName(vo.getSublistName());
             po.setCreateUserId(AuthUtil.getCurrentUserId());
             po.setShare("0");
-            List<ScenePackageNewVO> listName=scenePackageMapper.queryByPackageName(po);
-            if(listName!=null && listName.size()>0){
-                return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"测试包名称packName="+po.getPackageName()+"已存在,请重新命名");
+            List<ScenePackageNewVO> listName = scenePackageMapper.queryByPackageName(po);
+            if (listName != null && listName.size() > 0) {
+                return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "测试包名称packName=" + po.getPackageName() + "已存在,请重新命名");
             }
-             po.setWeight(vo.getWeight());
-             po.setRemarks(vo.getRemarks());
-             po.setSceneNum(vo.getSceneNum());
-            listSublictTree= vo.getChildren();
+            po.setWeight(vo.getWeight());
+            po.setRemarks(vo.getRemarks());
+            po.setSceneNum(vo.getSceneNum());
+            listSublictTree = vo.getChildren();
         }
-
         po.setCreateTime(TimeUtil.getNowForMysql());
         po.setModifyTime(TimeUtil.getNowForMysql());
         po.setPackageCode(StringUtil.getRandomCode());
-        String uuId=StringUtil.getRandomUUID();
+        String uuId = StringUtil.getRandomUUID();
         po.setPackageId(uuId);
         po.setIsDeleted("0");
         po.setCreateUserId(AuthUtil.getCurrentUserId());
 
-        List<ScenePackageSublistPO>  poList=new ArrayList<>();
-        List<ScenePackageSublistPO> treeList =instShareListTree(listSublictTree,uuId,uuId,poList,"0");
-        if(treeList==null||treeList.size()<1){
-            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"指标数据为空,请检查");
+        List<ScenePackageSublistPO> poList = new ArrayList<>();
+        List<ScenePackageSublistPO> treeList = instShareListTree(listSublictTree, uuId, uuId, poList, "0");
+        if (treeList == null || treeList.size() < 1) {
+            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "指标数据为空,请检查");
         }
         scenePackageMapper.saveScenePackage(po);
         scenePackageSublistMapper.saveScenePackageSublistAll(treeList);
         return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
     }
+
     //查询测试包主表列表
     @SneakyThrows
-    public   List<ScenePackagePO> queryScenePackageList(ScenePackageParam params){
+    public List<ScenePackagePO> queryScenePackageList(ScenePackageParam params) {
         List<ScenePackagePO> list = scenePackageMapper.queryScenePackageList(params);
         return list;
     }
 
     //修改主表数据
     @SneakyThrows
-    public   ResponseBodyVO<String> updateScenePackage(List<ScenePackageSublistVO> params) {
-        List<ScenePackageSublistVO> listSublictTree=new ArrayList<>();
-        ScenePackagePO po=new ScenePackagePO();
-        for (ScenePackageSublistVO vo:params) {
+    public ResponseBodyVO<String> updateScenePackage(List<ScenePackageSublistVO> params) {
+        List<ScenePackageSublistVO> listSublictTree = new ArrayList<>();
+        ScenePackagePO po = new ScenePackagePO();
+        for (ScenePackageSublistVO vo : params) {
             //判断唯一
             po.setPackageName(vo.getSublistName());
             po.setCreateUserId(AuthUtil.getCurrentUserId());
             po.setShare("0");
             po.setPackageId(vo.getId());
-            List<ScenePackageNewVO> listName=scenePackageMapper.queryByPackageName(po);
-            if(listName!=null && listName.size()>0){
-                return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"测试包名称packName="+po.getPackageName()+"已存在,请重新命名");
+            List<ScenePackageNewVO> listName = scenePackageMapper.queryByPackageName(po);
+            if (listName != null && listName.size() > 0) {
+                return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "测试包名称packName=" + po.getPackageName() + "已存在,请重新命名");
             }
             po.setWeight(vo.getWeight());
             po.setRemarks(vo.getRemarks());
             po.setSceneNum(vo.getSceneNum());
-            listSublictTree= vo.getChildren();
+            listSublictTree = vo.getChildren();
         }
 
-
         po.setModifyTime(TimeUtil.getNowForMysql());
         po.setModifyUserId(AuthUtil.getCurrentUserId());
         po.setIsDeleted("0");
         po.setShare("0");
-        List<ScenePackageSublistPO>  poList=new ArrayList<>();
-        List<ScenePackageSublistPO> treeList =instShareListTree(listSublictTree,po.getPackageId(),po.getPackageId(),poList,"0");
-        if(treeList==null||treeList.size()<1){
-            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"指标数据为空,请检查");
+        List<ScenePackageSublistPO> poList = new ArrayList<>();
+        List<ScenePackageSublistPO> treeList = instShareListTree(listSublictTree, po.getPackageId(), po.getPackageId(), poList, "0");
+        if (treeList == null || treeList.size() < 1) {
+            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "指标数据为空,请检查");
         }
         scenePackageMapper.updateScenePackage(po);
         scenePackageSublistMapper.deleteScenePackageSublist(po.getPackageId());
@@ -119,8 +112,8 @@ public class ScenePackageService {
 
     //删除测试包
     @SneakyThrows
-    public   void deleteList(ScenePackageParam params) {
-        ScenePackagePO po=new ScenePackagePO();
+    public void deleteList(ScenePackageParam params) {
+        ScenePackagePO po = new ScenePackagePO();
         po.setModifyUserId(AuthUtil.getCurrentUserId());
         po.setModifyTime(TimeUtil.getNowForMysql());
         po.setIsDeleted("1");
@@ -131,10 +124,8 @@ public class ScenePackageService {
 
     //查询一个测试包的指标列表
     @SneakyThrows
-    public List<ScenePackageSublistVO> queryScenePackageSublistList(ScenePackageParam params){
+    public List<ScenePackageSublistVO> queryScenePackageSublistList(ScenePackageParam params) {
         ScenePackageNewVO vo = scenePackageMapper.queryScenePackageBySublist(params.getPackageId());
-        log.info(params.getPackageId()+"------params.getPackageId()");
-        log.info(vo+"------vo-----)"+vo.getPackageId());
         ScenePackageSublistPO po = new ScenePackageSublistPO();
         po.setRootId(params.getPackageId());
         List<ScenePackageSublistVO> scenePackageSublistVOS = scenePackageSublistMapper.queryScenePackageSublistList(po);
@@ -146,7 +137,7 @@ public class ScenePackageService {
         root.setWeight(vo.getWeight());
         root.setSceneNum(vo.getSceneNum());
         root.setRemarks(vo.getRemarks());
-        scenePackageSublistVOS.add(0,root);
+        scenePackageSublistVOS.add(0, root);
         //list转tree
         List<ScenePackageSublistVO> tree = listToTree(scenePackageSublistVOS);
         return tree;
@@ -157,9 +148,9 @@ public class ScenePackageService {
      */
     public static List<ScenePackageSublistVO> listToTree(List<ScenePackageSublistVO> list) {
         List<ScenePackageSublistVO> treeList = new ArrayList<ScenePackageSublistVO>();
-        for (ScenePackageSublistVO vo: list) {
-            if("0".equals(vo.getParentId())){
-                treeList.add(findChildren(vo,list));
+        for (ScenePackageSublistVO vo : list) {
+            if ("0".equals(vo.getParentId())) {
+                treeList.add(findChildren(vo, list));
             }
         }
         return treeList;
@@ -169,12 +160,12 @@ public class ScenePackageService {
      * list转tree 递归
      */
     private static ScenePackageSublistVO findChildren(ScenePackageSublistVO vo, List<ScenePackageSublistVO> list) {
-        for (ScenePackageSublistVO node: list) {
-            if(vo.getId().equals(node.getParentId())){
-                if(vo.getChildren() == null || vo.getChildren().size() == 0){
+        for (ScenePackageSublistVO node : list) {
+            if (vo.getId().equals(node.getParentId())) {
+                if (vo.getChildren() == null || vo.getChildren().size() == 0) {
                     vo.setChildren(new ArrayList<ScenePackageSublistVO>());
                 }
-                vo.getChildren().add(findChildren(node,list));
+                vo.getChildren().add(findChildren(node, list));
             }
         }
         return vo;
@@ -182,32 +173,33 @@ public class ScenePackageService {
 
     /**
      * 级联获取场景指标
-     * @param parentVoList 首次传null
-     * @param isRoot 首次传true
+     *
+     * @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();
+                                                                     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{
+        if (isRoot) {
+                //查找一级节点
+                parentVoList = scenePackageSublistMapper.queryScenePackageSublistList(params);
+                if (parentVoList != null && parentVoList.size() > 0) {
+                    selectScenePackageSubListTree(parentVoList, false, null);
+                }
+            } else {
             //获取子节点集合
-            for(ScenePackageSublistVO pvo : parentVoList){
+            for (ScenePackageSublistVO pvo : parentVoList) {
                 params.setParentId(pvo.getId());
                 List<ScenePackageSublistVO> cvoList = scenePackageSublistMapper.queryScenePackageSublistList(params);
-                if(cvoList != null && cvoList.size() > 0){
+                if (cvoList != null && cvoList.size() > 0) {
                     //存入父节点集合中
                     pvo.setChildren(cvoList);
-                  //  pvo.setHasChildren(true);
+                    //  pvo.setHasChildren(true);
                     //继续查找下一节点
-                    selectScenePackageSubListTree(cvoList,false, null);
+                    selectScenePackageSubListTree(cvoList, false, null);
                 }
             }
         }
@@ -215,67 +207,67 @@ public class ScenePackageService {
     }
 
 
-//分享
+    //分享
     @SneakyThrows
-    public ResponseBodyVO<String> instShareList(ScenePackageParam params){
+    public ResponseBodyVO<String> instShareList(ScenePackageParam params) {
         //查询测试包主表
-
-        ScenePackagePO scenePackagePO=scenePackageMapper.queryScenePackage(params);
-
-        ScenePackagePO po=new ScenePackagePO();
+        ScenePackagePO scenePackagePO = scenePackageMapper.queryScenePackage(params);
+        ScenePackagePO po = new ScenePackagePO();
         po.setShare("1");
         po.setPackageName(scenePackagePO.getPackageName());
-        List<ScenePackageNewVO> listName=scenePackageMapper.queryByPackageName(po);
-        if(listName!=null && listName.size()>0){
-            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"公有列表名称packName="+listName.get(0).getPackageName()+"的测试包已存在,请检查");
+        List<ScenePackageNewVO> listName = scenePackageMapper.queryByPackageName(po);
+        if (listName != null && listName.size() > 0) {
+            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "公有列表名称packName=" + listName.get(0).getPackageName() + "的测试包已存在,请检查");
         }
-        BeanUtils.copyProperties(scenePackagePO,po);
+        BeanUtils.copyProperties(scenePackagePO, po);
         po.setCreateTime(TimeUtil.getNowForMysql());
         po.setModifyTime(TimeUtil.getNowForMysql());
         po.setCreateUserId(AuthUtil.getCurrentUserId());
         po.setPackageCode(StringUtil.getRandomCode());
-        String uuId=StringUtil.getRandomUUID();
+        String uuId = StringUtil.getRandomUUID();
         po.setPackageId(uuId);
         po.setIsDeleted("0");
         po.setShare("1");
         scenePackageMapper.saveScenePackage(po);
-        List<ScenePackageSublistPO>  poList=new ArrayList<>();
-        List<ScenePackageSublistVO> listSublist =selectScenePackageSubListTree(null,true,params.getPackageId());
-        List<ScenePackageSublistPO> treeList =instShareListTree(listSublist,uuId,uuId,poList,"1");
-       scenePackageSublistMapper.saveScenePackageSublistAll(treeList);
+        List<ScenePackageSublistPO> poList = new ArrayList<>();
+        List<ScenePackageSublistVO> listSublist = selectScenePackageSubListTree(null, true, params.getPackageId());
+        List<ScenePackageSublistPO> treeList = instShareListTree(listSublist, uuId, uuId, poList, "1");
+        scenePackageSublistMapper.saveScenePackageSublistAll(treeList);
         return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
     }
+
     /**
      * 根据级联结果转化为单级list
-     * @param parentVoList 首次传null
+     *
+     * @param parentVoList   首次传null
      * @param scenePackageId 场景包id
      * @return
      */
     public List<ScenePackageSublistPO> instShareListTree(List<ScenePackageSublistVO> parentVoList,
-                                                                    String scenePackageId,String rootId,List<ScenePackageSublistPO>  poList
-                                                                ,String share){
+                                       String scenePackageId, String rootId, List<ScenePackageSublistPO> poList
+            , String share) {
         {
             //获取子节点集合
-                int a=1;
-                for (int i=0;i< parentVoList.size() ;i++) {
-                ScenePackageSublistPO params=new ScenePackageSublistPO();
-                BeanUtils.copyProperties(parentVoList.get(i),params);
+            int a = 1;
+            for (int i = 0; i < parentVoList.size(); i++) {
+                ScenePackageSublistPO params = new ScenePackageSublistPO();
+                BeanUtils.copyProperties(parentVoList.get(i), params);
                 params.setParentId(scenePackageId);
                 params.setRootId(rootId);
                 params.setSublistName(parentVoList.get(i).getSublistName());
                 params.setCreateTime(TimeUtil.getNowForMysql());
                 params.setModifyTime(TimeUtil.getNowForMysql());
                 params.setCreateUserId(AuthUtil.getCurrentUserId());
-                String uuId= StringUtil.getRandomUUID();
+                String uuId = StringUtil.getRandomUUID();
                 params.setId(uuId);   //主键ID
                 params.setIsDeleted("0");
                 params.setShare(share);
                 params.setSeq(a);
                 List<ScenePackageSublistVO> cvoList = parentVoList.get(i).getChildren();
                 poList.add(params);
-                if(cvoList != null && cvoList.size() > 0){
+                if (cvoList != null && cvoList.size() > 0) {
                     //继续查找下一节点
-                    instShareListTree(cvoList, uuId,rootId,poList,share);
+                    instShareListTree(cvoList, uuId, rootId, poList, share);
                 }
                 parentVoList.remove(parentVoList.get(i));
                 i--;
@@ -287,8 +279,8 @@ public class ScenePackageService {
     }
 
     //测试包名查唯一
-    public List<ScenePackageNewVO> queryByPackageName(ScenePackagePO params){
-        return   scenePackageMapper.queryByPackageName(params);
+    public List<ScenePackageNewVO> queryByPackageName(ScenePackagePO params) {
+        return scenePackageMapper.queryByPackageName(params);
     }
 
 }

+ 14 - 12
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/ScoringRulesService.java

@@ -9,7 +9,6 @@ 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;
 
@@ -20,13 +19,11 @@ public class ScoringRulesService {
     @Resource
     private ScoringRulesMapper scoringRulesMapper;
 
-
-
     /**
      * 打分规则数据录入:
      */
     @SneakyThrows
-    public void saveScoringRules(ScoringRulesPO params){
+    public void saveScoringRules(ScoringRulesPO params) {
         params.setCreateTime(TimeUtil.getNowForMysql());
         params.setModifyTime(TimeUtil.getNowForMysql());
         params.setRulesId(StringUtil.getRandomUUID());
@@ -35,34 +32,39 @@ public class ScoringRulesService {
         params.setIsDeleted("0");
         scoringRulesMapper.saveScoringRules(params);
     }
+
     @SneakyThrows
-    public   List<ScoringRulesPO> queryScoringRulesList(ScoringRulesParam params){
-        if(params!=null &&params.getShare()!=null&&params.getShare().equals("0")){
+    public List<ScoringRulesPO> queryScoringRulesList(ScoringRulesParam params) {
+        if (params != null && params.getShare() != null && params.getShare().equals("0")) {
             params.setCreateUserId(AuthUtil.getCurrentUserId());
         }
         List<ScoringRulesPO> list = scoringRulesMapper.queryScoringRulesList(params);
         return list;
     }
+
     @SneakyThrows
-    public   ScoringRulesPO queryScoringRules(ScoringRulesParam params) {
+    public ScoringRulesPO queryScoringRules(ScoringRulesParam params) {
         ScoringRulesPO Po = scoringRulesMapper.queryScoringRules(params);
         return Po;
     }
+
     @SneakyThrows
-    public  List<ScoringRulesPO> queryScoringRulesByRuleName(ScoringRulesParam params) {
-        if(params.getShare().equals("0")){
+    public List<ScoringRulesPO> queryScoringRulesByRuleName(ScoringRulesParam params) {
+        if (params.getShare().equals("0")) {
             params.setCreateUserId(AuthUtil.getCurrentUserId());
         }
         return scoringRulesMapper.queryScoringRulesByRuleName(params);
     }
+
     @SneakyThrows
-    public   void updateScoringRules(ScoringRulesPO params) {
+    public void updateScoringRules(ScoringRulesPO params) {
         params.setModifyTime(TimeUtil.getNowForMysql());
         params.setModifyUserId(AuthUtil.getCurrentUserId());
-         scoringRulesMapper.updateScoringRules(params);
+        scoringRulesMapper.updateScoringRules(params);
     }
+
     @SneakyThrows
-    public   void deleteScoringRules(ScoringRulesPO params) {
+    public void deleteScoringRules(ScoringRulesPO params) {
         params.setIsDeleted("1");
         params.setModifyTime(TimeUtil.getNowForMysql());
         params.setModifyUserId(AuthUtil.getCurrentUserId());

+ 48 - 52
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/StandardsRegulationsService.java

@@ -4,7 +4,6 @@ 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.util.FileUtil;
 import api.common.util.StringUtil;
 import api.common.util.TimeUtil;
 import com.css.simulation.resource.common.utils.AuthUtil;
@@ -16,10 +15,7 @@ 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
@@ -38,61 +34,61 @@ public class StandardsRegulationsService {
     @SneakyThrows
     public ResponseBodyVO<String> importBzFg(StandardsRegulationsParam param) {
 
-                    MinioParameter MI=new MinioParameter();
-                    MI.setObjectName(param.getJsonAddress());
-                    Response download = fileDownService.download(MI);
-                    String json =download.body().toString();
-                    ObjectMapper objMap = new ObjectMapper();
-                    JsonNode root = objMap.readTree(json);
-                    String sceneName=root.path("场景名称").asText();
-                    param.setSceneName(sceneName);
-                    List<StandardsRegulationsPO> list=  standardsRegulationsMapper.queryStandardsRegulationsByName(param);
-                    if(list!=null && list.size()>0){
-                        return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE,"该场景名称"+ sceneName+"已存在,请检查");
-                    }
+        MinioParameter MI = new MinioParameter();
+        MI.setObjectName(param.getJsonAddress());
+        Response download = fileDownService.download(MI);
+        String json = download.body().toString();
+        ObjectMapper objMap = new ObjectMapper();
+        JsonNode root = objMap.readTree(json);
+        String sceneName = root.path("场景名称").asText();
+        param.setSceneName(sceneName);
+        List<StandardsRegulationsPO> list = standardsRegulationsMapper.queryStandardsRegulationsByName(param);
+        if (list != null && list.size() > 0) {
+            return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "该场景名称" + sceneName + "已存在,请检查");
+        }
 
-                    StandardsRegulationsPO standardsRegulationsPO = null;
-                    standardsRegulationsPO = standardsRegulationsPO.builder()
-                        .regulationsId(StringUtil.getRandomUUID())
-                        .sceneName(sceneName)
-                        .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());
-                    }
-                    if(null!=param.getVideoPreview()&&!param.getVideoPreview().equals("")){
-                        standardsRegulationsPO.setVideoPreview(param.getVideoPreview());
-                    }
-                    standardsRegulationsMapper.saveStandardsRegulations(standardsRegulationsPO);
+        StandardsRegulationsPO standardsRegulationsPO = null;
+        standardsRegulationsPO = standardsRegulationsPO.builder()
+                .regulationsId(StringUtil.getRandomUUID())
+                .sceneName(sceneName)
+                .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());
+        }
+        if (null != param.getVideoPreview() && !param.getVideoPreview().equals("")) {
+            standardsRegulationsPO.setVideoPreview(param.getVideoPreview());
+        }
+        standardsRegulationsMapper.saveStandardsRegulations(standardsRegulationsPO);
 
-                return   new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
+        return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
     }
-//查看列表
-    public   List<StandardsRegulationsPO> querySceneNaturalList(StandardsRegulationsParam params) {
+
+    //查看列表
+    public List<StandardsRegulationsPO> querySceneNaturalList(StandardsRegulationsParam params) {
         List<StandardsRegulationsPO> list = standardsRegulationsMapper.queryStandardsRegulationsList(params);
         return list;
     }
 
-
-    public   void deleteStandardsRegulations(StandardsRegulationsPO params) {
+    public void deleteStandardsRegulations(StandardsRegulationsPO params) {
         params.setIsDeleted("1");
         params.setModifyTime(TimeUtil.getNowForMysql());
         params.setModifyUserId(AuthUtil.getCurrentUserId());

+ 37 - 36
simulation-resource-server/src/main/resources/mapper/scene/SceneAccidentMapper.xml

@@ -1,6 +1,6 @@
 <?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" >
+<mapper namespace="com.css.simulation.resource.scene.mapper.SceneAccidentMapper">
 
     <insert id="saveSceneAccident" parameterType="api.common.pojo.po.scene.SceneAccidentPO">
         insert into simulation.scene_accident
@@ -18,7 +18,8 @@
     </insert>
 
 
-    <select id="querySceneAccidentList" parameterType="api.common.pojo.param.scene.SceneAccidentParam" resultType="api.common.pojo.po.scene.SceneAccidentPO">
+    <select id="querySceneAccidentList" parameterType="api.common.pojo.param.scene.SceneAccidentParam"
+            resultType="api.common.pojo.po.scene.SceneAccidentPO">
         select
         accident_id,scene_name,self_driving,target_driving,
         self_reaction,conflict_behavior,conflict_type,
@@ -33,42 +34,42 @@
             </if>
 
             <if test="selfDriving != null and selfDriving.length != 0 ">
-            and   self_driving  in
-            <foreach collection="selfDriving" item="item" index="index"
-                     separator="," open="(" close=")">
-                #{item}
-            </foreach>
+                and self_driving in
+                <foreach collection="selfDriving" item="item" index="index"
+                         separator="," open="(" close=")">
+                    #{item}
+                </foreach>
             </if>
             <if test="targetDriving != null and targetDriving.length != 0">
-               and   target_driving  in
+                and target_driving in
                 <foreach collection="targetDriving" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
             <if test="selfReaction != null and selfReaction.length != 0">
-                and  self_reaction  in
+                and self_reaction in
                 <foreach collection="selfReaction" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
             <if test="conflictBehavior != null and conflictBehavior.length != 0">
-                and   conflict_behavior  in
+                and conflict_behavior in
                 <foreach collection="conflictBehavior" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
             <if test="conflictType != null and conflictType.length != 0">
-                and   conflict_type  in
+                and conflict_type in
                 <foreach collection="conflictType" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
             <if test="ids != null and ids.length>0">
-                and   accident_id  in
+                and accident_id in
                 <foreach collection="ids" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
@@ -79,32 +80,32 @@
     </select>
 
     <update id="deleteSceneAccidentList" parameterType="api.common.pojo.po.scene.SceneAccidentPO">
-    update simulation.scene_accident
-    <set>
-        <if test="isDeleted != null and isDeleted!=''">
-            is_deleted = #{isDeleted,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 accident_id = #{accidentId,jdbcType=VARCHAR}
+        update simulation.scene_accident
+        <set>
+            <if test="isDeleted != null and isDeleted!=''">
+                is_deleted = #{isDeleted,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 accident_id = #{accidentId,jdbcType=VARCHAR}
     </update>
 
 
-
-    <select id="querySceneAccidentByNmae" parameterType="api.common.pojo.param.scene.SceneAccidentParam" resultType="api.common.pojo.po.scene.SceneAccidentPO">
-    select
-    accident_id,scene_name
-    from simulation.scene_accident
-    <where>
-    is_deleted = '0'
-    <if test="sceneName != null and sceneName != ''">
-        and scene_name =#{sceneName,jdbcType=VARCHAR}
-    </if>
-    </where>
+    <select id="querySceneAccidentByNmae" parameterType="api.common.pojo.param.scene.SceneAccidentParam"
+            resultType="api.common.pojo.po.scene.SceneAccidentPO">
+        select
+        accident_id,scene_name
+        from simulation.scene_accident
+        <where>
+            is_deleted = '0'
+            <if test="sceneName != null and sceneName != ''">
+                and scene_name =#{sceneName,jdbcType=VARCHAR}
+            </if>
+        </where>
     </select>
 </mapper>

+ 50 - 48
simulation-resource-server/src/main/resources/mapper/scene/SceneNaturalMapper.xml

@@ -1,6 +1,6 @@
 <?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" >
+<mapper namespace="com.css.simulation.resource.scene.mapper.SceneNaturalMapper">
 
     <insert id="saveSceneNatural" parameterType="api.common.pojo.po.scene.SceneNaturalPO">
         insert into simulation.scene_natural
@@ -33,7 +33,8 @@
     </insert>
 
 
-    <select id="querySceneNaturalList" parameterType="api.common.pojo.param.scene.SceneNaturalParam" resultType="api.common.pojo.po.scene.SceneNaturalPO">
+    <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,
@@ -52,252 +53,252 @@
                 and natural_name like CONCAT('%',#{naturalName,jdbcType=VARCHAR},'%')
             </if>
             <if test="weather != null and weather != ''">
-                and   weather  in
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                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
+                and target_behavior in
                 <foreach collection="targetBehavior" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
             <if test="ids != null and ids.length>0">
-                and   natural_id  in
+                and natural_id in
                 <foreach collection="ids" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
@@ -324,15 +325,16 @@
     </update>
 
 
-    <select id="querySceneNaturaByName" parameterType="api.common.pojo.param.scene.SceneNaturalParam" resultType="api.common.pojo.po.scene.SceneNaturalPO">
-    select
-    natural_id,natural_name
-    from simulation.scene_natural
-    <where>
-    is_deleted = '0'
-    <if test="naturalName != null and naturalName != ''">
-        and natural_name =#{naturalName,jdbcType=VARCHAR}
-    </if>
-    </where>
+    <select id="querySceneNaturaByName" parameterType="api.common.pojo.param.scene.SceneNaturalParam"
+            resultType="api.common.pojo.po.scene.SceneNaturalPO">
+        select
+        natural_id,natural_name
+        from simulation.scene_natural
+        <where>
+            is_deleted = '0'
+            <if test="naturalName != null and naturalName != ''">
+                and natural_name =#{naturalName,jdbcType=VARCHAR}
+            </if>
+        </where>
     </select>
 </mapper>

+ 16 - 12
simulation-resource-server/src/main/resources/mapper/scene/ScenePackageMapper.xml

@@ -1,6 +1,6 @@
 <?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" >
+<mapper namespace="com.css.simulation.resource.scene.mapper.ScenePackageMapper">
 
 
     <insert id="saveScenePackage" parameterType="api.common.pojo.po.scene.ScenePackagePO">
@@ -16,7 +16,8 @@
     </insert>
 
 
-    <select id="queryScenePackageList" parameterType="api.common.pojo.param.scene.ScenePackageParam" resultType="api.common.pojo.po.scene.ScenePackagePO">
+    <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_code,
         a.package_and_rules,a.scene_num,a.remarks,
@@ -26,13 +27,13 @@
         <where>
             a.is_deleted = '0'
             <if test="packageId != null and packageId != ''">
-                and a.package_id  = #{packageId,jdbcType=VARCHAR}
+                and a.package_id = #{packageId,jdbcType=VARCHAR}
             </if>
             <if test="packageCode != null and packageCode != ''">
-                and a.package_code  = #{packageCode,jdbcType=VARCHAR}
+                and a.package_code = #{packageCode,jdbcType=VARCHAR}
             </if>
             <if test="share != null and share != ''">
-                and a.share  = #{share,jdbcType=VARCHAR}
+                and a.share = #{share,jdbcType=VARCHAR}
             </if>
             <if test="packageName != null and packageName != ''">
                 and a.package_name like CONCAT('%',#{packageName,jdbcType=VARCHAR},'%')
@@ -49,7 +50,8 @@
     </select>
 
 
-    <select id="queryScenePackage" parameterType="api.common.pojo.param.scene.ScenePackageParam" resultType="api.common.pojo.po.scene.ScenePackagePO">
+    <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.package_code,a.weight,
         a.package_and_rules,a.scene_num,a.remarks,
@@ -59,10 +61,10 @@
         <where>
             a.is_deleted = '0'
             <if test="packageId != null and packageId != ''">
-                and a.package_id  = #{packageId,jdbcType=VARCHAR}
+                and a.package_id = #{packageId,jdbcType=VARCHAR}
             </if>
             <if test="packageCode != null and packageCode != ''">
-                and a.package_code  = #{packageCode,jdbcType=VARCHAR}
+                and a.package_code = #{packageCode,jdbcType=VARCHAR}
             </if>
             <if test="packageName != null and packageName != ''">
                 and a.package_name like CONCAT('%',#{packageName,jdbcType=VARCHAR},'%')
@@ -80,7 +82,8 @@
         </where>
     </select>
 
-    <select id="queryScenePackageBySublist" parameterType="java.lang.String" resultType="api.common.pojo.vo.scene.ScenePackageNewVO">
+    <select id="queryScenePackageBySublist" parameterType="java.lang.String"
+            resultType="api.common.pojo.vo.scene.ScenePackageNewVO">
         select
         a.package_id ,a.package_name ,a.weight,a.package_code,
         a.scene_num,a.remarks
@@ -88,7 +91,7 @@
         <where>
             a.is_deleted = '0'
             <if test="packageId != null and packageId != ''">
-                and a.package_id  = #{packageId,jdbcType=VARCHAR}
+                and a.package_id = #{packageId,jdbcType=VARCHAR}
             </if>
         </where>
     </select>
@@ -142,14 +145,15 @@
     </update>
 
 
-    <select id="queryByPackageName" parameterType="api.common.pojo.po.scene.ScenePackagePO" resultType="api.common.pojo.vo.scene.ScenePackageNewVO">
+    <select id="queryByPackageName" parameterType="api.common.pojo.po.scene.ScenePackagePO"
+            resultType="api.common.pojo.vo.scene.ScenePackageNewVO">
         select
         package_id,package_name,package_code
         from simulation.scene_package
         <where>
             is_deleted = '0'
             <if test="packageId != null and packageId != ''">
-                and package_id  != #{packageId,jdbcType=VARCHAR}
+                and package_id != #{packageId,jdbcType=VARCHAR}
             </if>
             <if test="packageName != null and packageName != ''">
                 and package_name =#{packageName,jdbcType=VARCHAR}

+ 18 - 15
simulation-resource-server/src/main/resources/mapper/scene/ScenePackageSublistMapper.xml

@@ -1,6 +1,6 @@
 <?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" >
+<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
@@ -21,14 +21,14 @@
 
     <insert id="saveScenePackageSublistAll" parameterType="java.util.List">
 
-            insert into simulation.scene_package_sublist
-            (sublist_id,sublist_name,weight,rule_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
+        insert into simulation.scene_package_sublist
+        (sublist_id,sublist_name,weight,rule_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
         <foreach collection="list" index="index" item="item" separator=",">
-              (#{item.id,jdbcType=VARCHAR},#{item.sublistName,jdbcType=VARCHAR},#{item.weight,jdbcType=VARCHAR},#{item.ruleName,jdbcType=VARCHAR},
+            (#{item.id,jdbcType=VARCHAR},#{item.sublistName,jdbcType=VARCHAR},#{item.weight,jdbcType=VARCHAR},#{item.ruleName,jdbcType=VARCHAR},
             #{item.packageAndRules,jdbcType=VARCHAR},
             #{item.sceneNaturalIds}, #{item.sceneTrafficIds}, #{item.sceneStatueIds}, #{item.sceneGeneralizationIds},
             #{item.sceneNum},#{item.parentId,jdbcType=VARCHAR},#{item.rootId,jdbcType=VARCHAR},#{item.seq},
@@ -38,19 +38,21 @@
         </foreach>
     </insert>
 
-    <select id="queryScenePackageSublistList" parameterType="api.common.pojo.po.scene.ScenePackageSublistPO" resultType="api.common.pojo.vo.scene.ScenePackageSublistVO">
+    <select id="queryScenePackageSublistList" parameterType="api.common.pojo.po.scene.ScenePackageSublistPO"
+            resultType="api.common.pojo.vo.scene.ScenePackageSublistVO">
         select
         a.sublist_id 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,a.package_and_rules,
         a.scene_natural_ids,a.scene_traffic_ids,a.scene_statue_ids,a.scene_generalization_ids
-        from simulation.scene_package_sublist as a  left join simulation.scoring_rules as b on a.package_and_rules=b.rules_id
+        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="id != null and id != ''">
-                and a.sublist_id  = #{id,jdbcType=VARCHAR}
+                and a.sublist_id = #{id,jdbcType=VARCHAR}
             </if>
             <if test="sublistName != null and sublistName != ''">
-                and a.sublist_name  = #{sublistName,jdbcType=VARCHAR}
+                and a.sublist_name = #{sublistName,jdbcType=VARCHAR}
             </if>
             <if test="createUserId != null and createUserId != ''">
                 and create_user_id=#{createUserId,jdbcType=VARCHAR}
@@ -72,16 +74,17 @@
         where root_id = #{rootId,jdbcType=VARCHAR}
     </update>
 
-    <select id="queryBySublistName" parameterType="api.common.pojo.po.scene.ScenePackageSublistPO" resultType="api.common.pojo.vo.scene.ScenePackageSublistVO">
+    <select id="queryBySublistName" parameterType="api.common.pojo.po.scene.ScenePackageSublistPO"
+            resultType="api.common.pojo.vo.scene.ScenePackageSublistVO">
         select sublist_id id,sublist_name
         from simulation.scene_package_sublist
         <where>
             is_deleted = '0'
             <if test="id != null and id != ''">
-                and a.sublist_id  != #{id,jdbcType=VARCHAR}
+                and a.sublist_id != #{id,jdbcType=VARCHAR}
             </if>
             <if test="sublistName != null and sublistName != ''">
-                and a.sublist_name  = #{sublistName,jdbcType=VARCHAR}
+                and a.sublist_name = #{sublistName,jdbcType=VARCHAR}
             </if>
             <if test="createUserId != null and createUserId != ''">
                 and create_user_id=#{createUserId,jdbcType=VARCHAR}

+ 13 - 10
simulation-resource-server/src/main/resources/mapper/scene/ScoringRulesMapper.xml

@@ -1,6 +1,6 @@
 <?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" >
+<mapper namespace="com.css.simulation.resource.scene.mapper.ScoringRulesMapper">
 
     <insert id="saveScoringRules" parameterType="api.common.pojo.po.scene.ScoringRulesPO">
         insert into simulation.scoring_rules
@@ -13,7 +13,8 @@
     </insert>
 
 
-    <select id="queryScoringRulesList" parameterType="api.common.pojo.param.scene.ScoringRulesParam" resultType="api.common.pojo.po.scene.ScoringRulesPO">
+    <select id="queryScoringRulesList" parameterType="api.common.pojo.param.scene.ScoringRulesParam"
+            resultType="api.common.pojo.po.scene.ScoringRulesPO">
         select
         rules_id,rules_code,rule_name,rule_description,rule_details,
         create_user_id,create_time,modify_user_id,modify_time,
@@ -22,19 +23,19 @@
         <where>
             is_deleted = '0'
             <if test="rulesId != null and rulesId != ''">
-                and rules_id  = #{rulesId,jdbcType=VARCHAR}
+                and rules_id = #{rulesId,jdbcType=VARCHAR}
             </if>
             <if test="rulesCode != null and rulesCode != ''">
-                and rules_code  = #{rulesCode,jdbcType=VARCHAR}
+                and rules_code = #{rulesCode,jdbcType=VARCHAR}
             </if>
             <if test="share != null and share!=''">
-               and share = #{share,jdbcType=VARCHAR}
+                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},'%')
+                and rule_description like CONCAT('%',#{ruleDescription},'%')
             </if>
             <if test="yearMax != null and yearMax != ''">
                 and #{yearMax,jdbcType=VARCHAR} &gt; create_time and #{yearMin,jdbcType=VARCHAR} &lt; create_time
@@ -46,7 +47,8 @@
             order by modify_time desc
         </where>
     </select>
-    <select id="queryScoringRules" parameterType="api.common.pojo.param.scene.ScoringRulesParam" resultType="api.common.pojo.po.scene.ScoringRulesPO">
+    <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,
@@ -55,7 +57,7 @@
         <where>
             is_deleted = '0'
             <if test="rulesId != null and rulesId != ''">
-                and rules_id  = #{rulesId,jdbcType=VARCHAR}
+                and rules_id = #{rulesId,jdbcType=VARCHAR}
             </if>
             <if test="ruleName != null and ruleName != ''">
                 and rule_name like CONCAT('%',#{ruleName,jdbcType=VARCHAR},'%')
@@ -63,8 +65,9 @@
         </where>
     </select>
 
-    <select id="queryScoringRulesByRuleName" parameterType="api.common.pojo.param.scene.ScoringRulesParam" resultType="api.common.pojo.po.scene.ScoringRulesPO">
-        select   rules_id,rule_name
+    <select id="queryScoringRulesByRuleName" parameterType="api.common.pojo.param.scene.ScoringRulesParam"
+            resultType="api.common.pojo.po.scene.ScoringRulesPO">
+        select rules_id,rule_name
         from simulation.scoring_rules
         <where>
             is_deleted = '0'

+ 20 - 18
simulation-resource-server/src/main/resources/mapper/scene/StandardsRegulationsMapper.xml

@@ -1,6 +1,6 @@
 <?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" >
+<mapper namespace="com.css.simulation.resource.scene.mapper.StandardsRegulationsMapper">
 
 
     <insert id="saveStandardsRegulations" parameterType="api.common.pojo.po.scene.StandardsRegulationsPO">
@@ -17,7 +17,8 @@
     </insert>
 
 
-    <select id="queryStandardsRegulationsList" parameterType="api.common.pojo.param.scene.StandardsRegulationsParam" resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
+    <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,
@@ -31,17 +32,17 @@
             </if>
 
             <if test="regulationType != null and regulationType.length != 0">
-            and  regulation_type  in
-            <foreach collection="regulationType" item="item" index="index"
-                     separator="," open="(" close=")">
-                #{item}
-            </foreach>
+                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>
             <if test="ids != null and ids.length>0">
-                and   regulations_id  in
+                and regulations_id in
                 <foreach collection="ids" item="item" index="index"
                          separator="," open="(" close=")">
                     #{item}
@@ -67,15 +68,16 @@
         where regulations_id = #{regulationsId,jdbcType=VARCHAR}
     </update>
 
-    <select id="queryStandardsRegulationsByName" parameterType="api.common.pojo.param.scene.StandardsRegulationsParam" resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
-    select
-    regulations_id,scene_name
-    from simulation.scene_standards_regulations
-    <where>
-    is_deleted = '0'
-    <if test="sceneName != null and sceneName != ''">
-        and scene_name =#{sceneName,jdbcType=VARCHAR}
-    </if>
-    </where>
+    <select id="queryStandardsRegulationsByName" parameterType="api.common.pojo.param.scene.StandardsRegulationsParam"
+            resultType="api.common.pojo.po.scene.StandardsRegulationsPO">
+        select
+        regulations_id,scene_name
+        from simulation.scene_standards_regulations
+        <where>
+            is_deleted = '0'
+            <if test="sceneName != null and sceneName != ''">
+                and scene_name =#{sceneName,jdbcType=VARCHAR}
+            </if>
+        </where>
     </select>
 </mapper>