소스 검색

Merge remote-tracking branch 'origin/master'

martin 2 년 전
부모
커밋
27de008698
54개의 변경된 파일740개의 추가작업 그리고 279개의 파일을 삭제
  1. 2 4
      api-common/src/main/java/api/common/pojo/constants/LogConstants.java
  2. 4 6
      api-common/src/main/java/api/common/pojo/param/log/LogPageParam.java
  3. 6 4
      api-common/src/main/java/api/common/pojo/param/model/VehiclePageParam.java
  4. 0 1
      api-common/src/main/java/api/common/pojo/po/log/LogLoginPO.java
  5. 4 2
      api-common/src/main/java/api/common/pojo/po/model/VehiclePO.java
  6. 3 0
      api-common/src/main/java/api/common/pojo/po/system/ClusterPO.java
  7. 2 0
      api-common/src/main/java/api/common/pojo/vo/model/VehicleDefaultValueVO.java
  8. 5 0
      api-common/src/main/java/api/common/pojo/vo/model/VehicleTempVO.java
  9. 7 4
      api-common/src/main/java/api/common/pojo/vo/model/VehicleVO.java
  10. 7 0
      api-common/src/main/java/api/common/pojo/vo/system/ClusterVO.java
  11. 8 8
      simulation-oauth-client/src/main/java/com/css/simulation/oauth/client/controller/SignController.java
  12. 4 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/log/ctrl/LogCtrl.java
  13. 3 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/log/mapper/LogMapper.java
  14. 65 69
      simulation-resource-server/src/main/java/com/css/simulation/resource/log/service/LogService.java
  15. 2 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/ctrl/CameraCtrl.java
  16. 3 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/ctrl/ConfigCtrl.java
  17. 2 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/ctrl/GpsCtrl.java
  18. 2 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/ctrl/LidarCtrl.java
  19. 2 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/ctrl/OgtCtrl.java
  20. 2 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/ctrl/VehicleCtrl.java
  21. 4 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/ctrl/VehicleTempCtrl.java
  22. 7 16
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/VehicleService.java
  23. 3 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/VehicleTempService.java
  24. 24 4
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/impl/SimulationProjectServiceImpl.java
  25. 1 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/project/mapper/SimulationProjectMapper.java
  26. 16 12
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/SceneGeneralTemplateController.java
  27. 3 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/ScenePackageController.java
  28. 7 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SystemScenePackageMapper.java
  29. 5 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SystemScenePackageSublistMapper.java
  30. 0 8
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneAccidentService.java
  31. 0 5
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SceneNaturalService.java
  32. 0 10
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/StandardsRegulationsService.java
  33. 50 21
      simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SystemScenePackageService.java
  34. 13 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/ClusterCtrl.java
  35. 2 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/DictCtrl.java
  36. 1 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/FileController.java
  37. 4 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/UserCtrl.java
  38. 26 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/UserInfoCtrl.java
  39. 8 1
      simulation-resource-server/src/main/java/com/css/simulation/resource/system/mapper/ClusterMapper.java
  40. 3 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/system/mapper/UserMapper.java
  41. 52 2
      simulation-resource-server/src/main/java/com/css/simulation/resource/system/service/ClusterService.java
  42. 10 0
      simulation-resource-server/src/main/java/com/css/simulation/resource/system/service/SceneImportService.java
  43. 34 2
      simulation-resource-server/src/main/java/com/css/simulation/resource/system/service/UserService.java
  44. 42 12
      simulation-resource-server/src/main/resources/mapper/log/LogMapper.xml
  45. 6 11
      simulation-resource-server/src/main/resources/mapper/model/VehicleMapper.xml
  46. 13 6
      simulation-resource-server/src/main/resources/mapper/model/VehicleTempMapper.xml
  47. 6 0
      simulation-resource-server/src/main/resources/mapper/project/SimulationProjectMapper.xml
  48. 12 21
      simulation-resource-server/src/main/resources/mapper/scene/SceneNaturalMapper.xml
  49. 91 14
      simulation-resource-server/src/main/resources/mapper/scene/SystemScenePackageMapper.xml
  50. 24 4
      simulation-resource-server/src/main/resources/mapper/scene/SystemScenePackageSublistMapper.xml
  51. 30 23
      simulation-resource-server/src/main/resources/mapper/system/ClusterMapper.xml
  52. 3 2
      simulation-resource-server/src/main/resources/mapper/system/SceneImportMapper.xml
  53. 4 1
      simulation-resource-server/src/main/resources/mapper/system/UserMapper.xml
  54. 103 0
      simulation-resource-server/src/main/resources/simulation.sql

+ 2 - 4
api-common/src/main/java/api/common/pojo/constants/LogConstants.java

@@ -29,18 +29,16 @@ public class LogConstants {
     public static final String SYS_LOG_USER_STOP = "0105";//用户管理-停用
     public static final String SYS_LOG_PARAM = "02";//参数管理
     public static final String SYS_LOG_PARAM_INSERT = "0201";//参数管理-编辑即新增
-    public static final String SYS_LOG_PARAM_DELETE = "0202";//集群管理-删除
     public static final String SYS_LOG_CLUSTER = "03";//集群管理
     public static final String SYS_LOG_CLUSTER_INSERT = "0301";//集群管理-编辑即新增
-    public static final String SYS_LOG_CLUSTER_DELETE = "0302";//集群管理-删除
     public static final String SYS_LOG_VEHICLE = "04";//车辆模板管理
     public static final String SYS_LOG_VEHICLE_INSERT = "0401";//车辆模板管理-新增
     public static final String SYS_LOG_VEHICLE_UPDATE = "0402";//车辆模板管理-修改
     public static final String SYS_LOG_VEHICLE_DEL = "0403";//车辆模板管理-删除
     public static final String SYS_LOG_SCENE_TASK = "05";//场景上传
+    public static final String SYS_LOG_SCENE_TASK_INSERT = "0501";//上传场景
     public static final String SYS_LOG_SCENE = "06";//场景库管理
-    public static final String SYS_LOG_SCENE_INSERT = "0601";//场景库管理-编辑即新增
-    public static final String SYS_LOG_SCENE_DELETE = "0602";//场景库管理-删除
+    public static final String SYS_LOG_SCENE_DELETE = "0601";//场景库管理-删除
     public static final String SYS_LOG_PACKAGE = "07";//场景包管理
     public static final String SYS_LOG_PACKAGE_INSERT = "0701";//场景包管理-新增
     public static final String SYS_LOG_PACKAGE_UPDATE = "0702";//场景包管理-修改

+ 4 - 6
api-common/src/main/java/api/common/pojo/param/log/LogPageParam.java

@@ -1,9 +1,7 @@
 package api.common.pojo.param.log;
 
 import api.common.pojo.common.PageVO;
-import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
-import java.sql.Timestamp;
 
 @Data
 public class LogPageParam extends PageVO {
@@ -19,9 +17,9 @@ public class LogPageParam extends PageVO {
     //操作内容
     private String content;
     //操作时间起
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
-    private Timestamp createTimeBegin;
+    //@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
+    private String createTimeBegin;
     //操作时间止
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
-    private Timestamp createTimeEnd;
+    //@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
+    private String createTimeEnd;
 }

+ 6 - 4
api-common/src/main/java/api/common/pojo/param/model/VehiclePageParam.java

@@ -8,11 +8,13 @@ public class VehiclePageParam extends PageVO {
 
     //主键id
     private String id;
-    //车辆编码
-    private String vehicleCode;
-    //车辆名称
-    private String vehicleName;
     //模型标识
     private String modelLabel;
+    //车辆类型
+    private String vehicleType;
+    //车辆型号
+    private String vehicleModel;
+    //车辆颜色
+    private String vehicleColour;
 
 }

+ 0 - 1
api-common/src/main/java/api/common/pojo/po/log/LogLoginPO.java

@@ -1,6 +1,5 @@
 package api.common.pojo.po.log;
 
-import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.sql.Timestamp;

+ 4 - 2
api-common/src/main/java/api/common/pojo/po/model/VehiclePO.java

@@ -18,10 +18,12 @@ public class VehiclePO extends CommonPO {
     private String description;
     //车辆类型(字典代码)
     private String vehicleType;
+    //车辆模型标签
+    private String modelLabel;
     //车辆型号
-    private String vehicleModel;
+    /*private String vehicleModel;
     //车辆颜色
-    private String vehicleColour;
+    private String vehicleColour;*/
     //车辆前视图
     private String vehicleFrontView;
     //车辆俯视图

+ 3 - 0
api-common/src/main/java/api/common/pojo/po/system/ClusterPO.java

@@ -1,6 +1,7 @@
 package api.common.pojo.po.system;
 
 import api.common.pojo.common.CommonPO;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.util.Date;
@@ -12,7 +13,9 @@ public class ClusterPO extends CommonPO {
     private String userId;        // 账户id
     private String userName;      //账户名称
     private int numSimulationLicense;        // 仿真软件license数量
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
     private Date dateSimulationLicense;       // 仿真软件license到期时间
     private int numDynamicLicense;        // 动力学软件license数量
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
     private Date dateDynamicLicense;       // 动力学软件license到期时间
 }

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

@@ -8,6 +8,8 @@ import java.math.BigDecimal;
 @Data
 public class VehicleDefaultValueVO {
 
+    //模型标识
+    private String modelLabel;
     //车辆前视图
     private String vehicleFrontView;
     //车辆俯视图

+ 5 - 0
api-common/src/main/java/api/common/pojo/vo/model/VehicleTempVO.java

@@ -1,8 +1,10 @@
 package api.common.pojo.vo.model;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.math.BigDecimal;
+import java.sql.Timestamp;
 
 @Data
 public class VehicleTempVO {
@@ -65,4 +67,7 @@ public class VehicleTempVO {
     private String valid;
     //序号
     private int sort;
+    //创建时间
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    private Timestamp createTime;
 }

+ 7 - 4
api-common/src/main/java/api/common/pojo/vo/model/VehicleVO.java

@@ -3,7 +3,6 @@ package api.common.pojo.vo.model;
 import lombok.Data;
 
 import java.math.BigDecimal;
-import java.util.List;
 
 @Data
 public class VehicleVO {
@@ -17,13 +16,17 @@ public class VehicleVO {
     //车辆描述
     private String description;
     //车辆模型
-    private List<String> modelLabel;
-    //车辆类型(字典代码)
+    private String[] vehicleType;
+    //车辆模型标签
+    private String modelLabel;
+    //车辆模型字符串
+    private String vehicleTypeStr;
+    /*//车辆类型(字典代码)
     private String vehicleType;
     //车辆型号
     private String vehicleModel;
     //车辆颜色
-    private String vehicleColour;
+    private String vehicleColour;*/
     //车辆前视图
     private String vehicleFrontView;
     //车辆俯视图

+ 7 - 0
api-common/src/main/java/api/common/pojo/vo/system/ClusterVO.java

@@ -1,5 +1,6 @@
 package api.common.pojo.vo.system;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
 import java.util.Date;
@@ -12,9 +13,15 @@ public class ClusterVO {
     private String useType;        // 占用类型
     private String userId;        // 账户id
     private int numSimulationLicense;        // 仿真软件license数量
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
     private Date dateSimulationLicense;       // 仿真软件license到期时间
     private int numDynamicLicense;        // 动力学软件license数量
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
     private Date dateDynamicLicense;       // 动力学软件license到期时间
+
+    private int validNumSimLicense;        // 有效的仿真软件license数量-编辑页面
+    private int validNumDynLicense;        // 有效的动力学软件license数量-编辑页面
+
     private Date modifyTime;        // 操作时间
 
 }

+ 8 - 8
simulation-oauth-client/src/main/java/com/css/simulation/oauth/client/controller/SignController.java

@@ -253,6 +253,14 @@ public class SignController {
         po.setCreateTime(TimeUtil.getNowForMysql());
         String remoteAddress = IpUtil.getRemoteAddress(request);
         po.setIp(remoteAddress);
+        //根据登录日志判断是否锁定账户
+        List<LogLoginPO> log = logLoginMapper.selectLogByUserId(userVO.getId(),oauthParameter.getSimulationLoginRepeatHours(),oauthParameter.getSimulationLoginRepeatCount());
+        if(ObjectUtil.isNotNull(log) && log.size() >= oauthParameter.getSimulationLoginRepeatCount()){
+            int sum = log.stream().mapToInt(m -> m.getState()).sum();
+            if(sum <= 0){
+                return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "登录失败次数过多,账户被锁定,请" + oauthParameter.getSimulationLoginRepeatHours() + "小时后重新登录!");
+            }
+        }
         //登录逻辑判断
         if (userVO == null ) {
             return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "用户名或密码错误!");
@@ -266,14 +274,6 @@ public class SignController {
             logLoginMapper.insertLog(po);
             return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "用户名或密码错误!");
         }
-        //根据登录日志判断是否锁定账户
-        List<LogLoginPO> log = logLoginMapper.selectLogByUserId(userVO.getId(),oauthParameter.getSimulationLoginRepeatHours(),oauthParameter.getSimulationLoginRepeatCount());
-        if(ObjectUtil.isNotNull(log) && log.size() >= oauthParameter.getSimulationLoginRepeatCount()){
-            int sum = log.stream().mapToInt(m -> m.getState()).sum();
-            if(sum <= 0){
-                return new ResponseBodyVO<>(ResponseBodyVO.Response.CLIENT_FAILURE, "登录失败次数过多,账户被锁定,请" + oauthParameter.getSimulationLoginRepeatHours() + "小时后重新登录!");
-            }
-        }
         //3 根据仿真平台用户名密码颁发仿真平台 token,返回给前端
         String simulationTokenUrl = oauthParameter.getSimulationTokenUri() +
                 "?grant_type=password" +

+ 4 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/log/ctrl/LogCtrl.java

@@ -8,6 +8,7 @@ import api.common.pojo.po.log.LogSystemPO;
 import com.css.simulation.resource.log.service.LogService;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -22,6 +23,7 @@ public class LogCtrl {
 
     @RequestMapping("/getLoginLogPageList")
     @ResponseBody
+    @PreAuthorize("@AuthorityCheck.admin()")
     public ResponseBodyVO<PageInfo<LogLoginPO>> getLoginLogPageList(@RequestBody LogPageParam pageParam){
         ResponseBodyVO<PageInfo<LogLoginPO>> response = new ResponseBodyVO<PageInfo<LogLoginPO>>(ResponseBodyVO.Response.SUCCESS);
         response.setInfo(logService.getLoginLogPageList(pageParam));
@@ -30,6 +32,7 @@ public class LogCtrl {
 
     @RequestMapping("/getOperationLogPageList")
     @ResponseBody
+    @PreAuthorize("@AuthorityCheck.adminAndUser()")
     public ResponseBodyVO<PageInfo<LogOperationPO>> getOperationLogPageList(@RequestBody LogPageParam pageParam){
         ResponseBodyVO<PageInfo<LogOperationPO>> response = new ResponseBodyVO<PageInfo<LogOperationPO>>(ResponseBodyVO.Response.SUCCESS);
         response.setInfo(logService.getOperationLogPageList(pageParam));
@@ -38,6 +41,7 @@ public class LogCtrl {
 
     @RequestMapping("/getSystemLogPageList")
     @ResponseBody
+    @PreAuthorize("@AuthorityCheck.admin()")
     public ResponseBodyVO<PageInfo<LogSystemPO>> getSystemLogPageList(@RequestBody LogPageParam pageParam){
         ResponseBodyVO<PageInfo<LogSystemPO>> response = new ResponseBodyVO<PageInfo<LogSystemPO>>(ResponseBodyVO.Response.SUCCESS);
         response.setInfo(logService.getSystemLogPageList(pageParam));

+ 3 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/log/mapper/LogMapper.java

@@ -21,9 +21,12 @@ public interface LogMapper {
 
     List<LogOperationPO> getOperationLogPageList(LogPageParam pageParam);
 
+    List<LogOperationPO> getUserOperationLogPageList(LogPageParam pageParam);
+
     List<LogSystemPO> getSystemLogPageList(LogPageParam pageParam);
 
     void insertSystemLog(LogSystemPO po);
 
     List<LineChartVO> getAccessCount(@Param("dateBegin") String dateBegin);
+
 }

+ 65 - 69
simulation-resource-server/src/main/java/com/css/simulation/resource/log/service/LogService.java

@@ -3,32 +3,36 @@ package com.css.simulation.resource.log.service;
 import api.common.pojo.constants.DictConstants;
 import api.common.pojo.constants.LogConstants;
 import api.common.pojo.param.log.LogPageParam;
+import api.common.pojo.param.model.VehiclePageParam;
 import api.common.pojo.param.scene.SystemUserSceneParam;
 import api.common.pojo.po.log.LogLoginPO;
 import api.common.pojo.po.log.LogOperationPO;
 import api.common.pojo.po.log.LogSystemPO;
 import api.common.pojo.po.model.VehicleTempPO;
 import api.common.pojo.po.scene.SystemScenePackagePO;
-import api.common.pojo.po.scene.SystemUserScenePO;
 import api.common.pojo.po.system.ClusterPO;
 import api.common.pojo.po.system.ParameterPO;
 import api.common.pojo.po.system.UserPO;
+import api.common.pojo.vo.model.VehicleTempVO;
 import api.common.pojo.vo.scene.UserSceneVO;
+import api.common.pojo.vo.system.UserVO;
 import api.common.util.ObjectUtil;
 import api.common.util.StringUtil;
 import api.common.util.TimeUtil;
 import com.css.simulation.resource.common.utils.AuthUtil;
 import com.css.simulation.resource.common.utils.PageUtil;
 import com.css.simulation.resource.log.mapper.LogMapper;
+import com.css.simulation.resource.model.mapper.VehicleTempMapper;
+import com.css.simulation.resource.system.mapper.UserMapper;
 import com.css.simulation.resource.system.service.DictService;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-import java.util.stream.Collectors;
 
 
 @Service
@@ -40,6 +44,12 @@ public class LogService {
     @Autowired
     DictService dictService;
 
+    @Autowired
+    UserMapper userMapper;
+
+    @Autowired
+    VehicleTempMapper vehicleTempMapper;
+
     /**
      * 保存普通操作日志(异步)
      */
@@ -64,7 +74,15 @@ public class LogService {
      */
     public PageInfo<LogOperationPO> getOperationLogPageList(LogPageParam pageParam) {
         PageUtil.setPageInfo(pageParam);
-        List<LogOperationPO> list = logMapper.getOperationLogPageList(pageParam);
+        List<LogOperationPO> list = new ArrayList<>();
+        String roleCode = AuthUtil.getCurrentUserRoleCode();
+        if(DictConstants.ROLE_CODE_UESR.equals(roleCode)){//普通用户
+            String currentUserId = AuthUtil.getCurrentUserId();
+            pageParam.setContent(currentUserId);//借用该字段传递当前用户id
+            list = logMapper.getUserOperationLogPageList(pageParam);
+        }else{//管理员
+            list = logMapper.getOperationLogPageList(pageParam);
+        }
         //字典翻译
         Map<String, Map<String, String>> dictMaps = dictService.getDictMapsByTypes(LogConstants.MODULE_TYPE + "," + LogConstants.OPERATION_TYPE);
         list.forEach(po ->{
@@ -99,7 +117,8 @@ public class LogService {
             String userId = userPO.getId();
             String username = userPO.getUsername();
             if(ObjectUtil.isNull(username)){
-                username = "XX";
+                UserVO userVO = userMapper.getUserInfo(userId);
+                username = userVO.getUsername();
             }
             String content = username + " ( ID: " + userId + " )";
             po.setContent(content);
@@ -116,8 +135,14 @@ public class LogService {
         try {
             LogSystemPO po = getLogSystemPO(LogConstants.SYS_LOG_VEHICLE, operationType);
             String vehicleTempId = vehicleTempPO.getId();
-            String vehicleName = vehicleTempPO.getVehicleName();
-            String content = vehicleName + " ( ID: " + vehicleTempId + " )";
+            String modelLabel = vehicleTempPO.getModelLabel();
+            if(ObjectUtil.isNull(modelLabel)){
+                VehiclePageParam param = new VehiclePageParam();
+                param.setId(vehicleTempId);
+                VehicleTempVO vehicleTempInfo = vehicleTempMapper.getVehicleTempInfo(param);
+                modelLabel = vehicleTempInfo.getModelLabel();
+            }
+            String content = modelLabel + " ( ID: " + vehicleTempId + " )";
             po.setContent(content);
             logMapper.insertSystemLog(po);
         }catch (Exception e){
@@ -159,12 +184,6 @@ public class LogService {
         }
     }
 
-
-
-
-
-
-
     /**
      * 获取系统管理日志对象
      */
@@ -180,70 +199,50 @@ public class LogService {
         return po;
     }
 
-
     /**
      * 记录场景包模块日志
      */
-    public void logScenePackage(String operationType, SystemScenePackagePO systemScenePackagePO,Map map) {
-            try {
-                LogSystemPO po = getLogSystemPO(LogConstants.SYS_LOG_PACKAGE, operationType);
-                //获取当前登录人姓名
-                //String userName= AuthUtil.getCurrentUsername();
-                String content=null;
-                if(operationType.equals(LogConstants.SYS_LOG_PACKAGE_DELETE)){
-                    content = "删除场景包:"+systemScenePackagePO.getPackageName()+"(ID:"+systemScenePackagePO.getId()+")";
-                }else if(operationType.equals(LogConstants.SYS_LOG_PACKAGE_UPDATE)){
-                    content = "编辑场景包:"+systemScenePackagePO.getPackageName()+"(ID:"+systemScenePackagePO.getId()+")";
-                }else if(operationType.equals(LogConstants.SYS_LOG_PACKAGE_INSERT)){
-                    content = "创建场景包:"+systemScenePackagePO.getPackageName()+"(ID:"+systemScenePackagePO.getId()+")";
-                }else if(operationType.equals(LogConstants.SYS_LOG_PACKAGE_DISTRIBUTION)){
-                    SystemUserSceneParam params=(SystemUserSceneParam)map.get("params");
-                   List<UserSceneVO> userIds= params.getUserIds();
-                   String userCount=null;
-                    for (UserSceneVO vo:userIds) {
-                        if (ObjectUtil.isNull(userCount)){
-                            userCount= vo.getUserName() +"(ID:"+vo.getUserId()+")";
-                        }else{
-                            userCount= userCount+"、"+vo.getUserName() +"(ID:"+vo.getUserId()+")";
-                        }
-
-                    }
-                    userCount=userCount+")";
-                    content = "分配场景包:"+params.getPackageName()+"(ID:"+params.getPackageId()+")给用户:"+userCount;
-                }else if(operationType.equals(LogConstants.SYS_LOG_PACKAGE_DISTRIBUTION_DELETE)){
-                    SystemUserSceneParam params=(SystemUserSceneParam)map.get("params");
-                    List<UserSceneVO> userIds= params.getUserIds();
-                    String userCount=null;
-                    for (UserSceneVO vo:userIds) {
-                        if (ObjectUtil.isNull(userCount)){
-                            userCount= vo.getUserName() +"(ID:"+vo.getUserId()+")";
-                        }else{
-                            userCount= userCount+"、"+vo.getUserName() +"(ID:"+vo.getUserId()+")";
-                        }
-
-                    }
-                    userCount=userCount+")";
-                    content = "分配场景包:"+params.getPackageName()+"(ID:"+params.getPackageId()+")时移除用户:"+userCount;
+    public void logScenePackage(String operationType, SystemScenePackagePO packagePO,SystemUserSceneParam params) {
+        try {
+            LogSystemPO po = getLogSystemPO(LogConstants.SYS_LOG_PACKAGE, operationType);
+            //获取当前登录人姓名
+            String content=null;
+            if(operationType.equals(LogConstants.SYS_LOG_PACKAGE_DELETE)){
+                content = "删除场景包:"+packagePO.getPackageName()+"(ID:"+packagePO.getId()+")";
+            }else if(operationType.equals(LogConstants.SYS_LOG_PACKAGE_UPDATE)){
+                content = "编辑场景包:"+packagePO.getPackageName()+"(ID:"+packagePO.getId()+")";
+            }else if(operationType.equals(LogConstants.SYS_LOG_PACKAGE_INSERT)){
+                content = "创建场景包:"+packagePO.getPackageName()+"(ID:"+packagePO.getId()+")";
+            }else if(operationType.equals(LogConstants.SYS_LOG_PACKAGE_DISTRIBUTION)){
+                List<UserSceneVO> users = params.getUserIds();
+                StringBuffer sb = new StringBuffer();
+                for (UserSceneVO vo : users) {
+                    sb.append("、").append(vo.getUserName()).append("((ID:").append(vo.getUserId()).append(")");
+                }
+                sb.deleteCharAt(0);
+                content = "分配场景包:"+params.getPackageName()+"(ID:"+params.getPackageId()+")给用户:"+sb.toString();
+            }else if(operationType.equals(LogConstants.SYS_LOG_PACKAGE_DISTRIBUTION_DELETE)){
+                List<UserSceneVO> users= params.getUserIds();
+                StringBuffer sb = new StringBuffer();
+                for (UserSceneVO vo : users) {
+                    sb.append("、").append(vo.getUserName()).append("((ID:").append(vo.getUserId()).append(")");
                 }
-                System.out.println("记录场景包模块日志:---"+content);
-                po.setContent(content);
-                logMapper.insertSystemLog(po);
-            }catch (Exception e){
-                e.printStackTrace();
+                sb.deleteCharAt(0);
+                content = "分配场景包:"+params.getPackageName()+"(ID:"+params.getPackageId()+")时移除用户:"+sb.toString();
             }
+            po.setContent(content);
+            logMapper.insertSystemLog(po);
+        }catch (Exception e){
+            e.printStackTrace();
         }
+    }
     /**
      * 记录场景包分配模块日志
      */
     public void logSystemUserSceneByPackageId(String operationType, SystemUserSceneParam param,String packageCount) {
         try {
             LogSystemPO po = getLogSystemPO(LogConstants.SYS_LOG_PACKAGE_GRANT, operationType);
-            /*//获取当前登录人姓名
-            String userName= AuthUtil.getCurrentUsername();*/
-            String content=null;
-            content = param.getUserName()+"(ID"+param.getUserId()+")"+"分配场景包:"+packageCount;
-
-            System.out.println("记录场景包分配模块日志:----"+content);
+            String content = param.getUserName()+"(ID"+param.getUserId()+")"+"分配场景包:"+packageCount;
             po.setContent(content);
             logMapper.insertSystemLog(po);
         }catch (Exception e){
@@ -258,10 +257,7 @@ public class LogService {
         try {
             LogSystemPO po = getLogSystemPO(LogConstants.SYS_LOG_SCENE, operationType);
             Map<String,String>  mapType= dictService.getDictMapByType(DictConstants.SCENE_TYPE);
-            //获取当前登录人姓名
-            String userName= AuthUtil.getCurrentUsername();
-            String content=null;
-            content = "删除"+mapType.get(map.get("type"))+":"+map.get("sceneName")+"(ID:"+map.get("sceneId")+")" ;
+            String content = "删除"+mapType.get(map.get("type"))+":"+map.get("sceneName")+"(ID:"+map.get("sceneId")+")" ;
             po.setContent(content);
             logMapper.insertSystemLog(po);
         }catch (Exception e){
@@ -282,4 +278,4 @@ public class LogService {
             e.printStackTrace();
         }
     }
-    }
+}

+ 2 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/model/ctrl/CameraCtrl.java

@@ -8,6 +8,7 @@ import api.common.pojo.vo.model.CameraVO;
 import api.common.util.ObjectUtil;
 import com.css.simulation.resource.model.service.CameraService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -79,6 +80,7 @@ public class CameraCtrl {
      */
     @RequestMapping("/shareCamera")
     @ResponseBody
+    @PreAuthorize("@AuthorityCheck.admin()")
     public ResponseBodyVO<CameraPO> shareCamera(@RequestBody CameraPO cameraPO){
         if(ObjectUtil.isNull(cameraPO)){
             return new ResponseBodyVO(false, 500, "参数必传!",null);

+ 3 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/model/ctrl/ConfigCtrl.java

@@ -11,6 +11,7 @@ import api.common.util.ObjectUtil;
 import com.css.simulation.resource.model.service.ConfigService;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Controller;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -84,6 +85,7 @@ public class ConfigCtrl {
      */
     @RequestMapping("/shareConfigByInfo")
     @ResponseBody
+    @PreAuthorize("@AuthorityCheck.admin()")
     public ResponseBodyVO<ConfigPO> shareConfigByInfo(@RequestBody ConfigVO configVO){
         if(ObjectUtil.isNull(configVO)){
             return new ResponseBodyVO(false, 500, "参数必传!",null);
@@ -102,6 +104,7 @@ public class ConfigCtrl {
      */
     @RequestMapping("/shareConfigById")
     @ResponseBody
+    @PreAuthorize("@AuthorityCheck.admin()")
     public ResponseBodyVO<ConfigPO> shareConfigById(@RequestBody ConfigVO configVO){
         if(ObjectUtil.isNull(configVO) || ObjectUtil.isNull(configVO.getId())){
             return new ResponseBodyVO(false, 500, "参数必传!",null);

+ 2 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/model/ctrl/GpsCtrl.java

@@ -9,6 +9,7 @@ import api.common.pojo.vo.model.GpsVO;
 import api.common.util.ObjectUtil;
 import com.css.simulation.resource.model.service.GpsService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -79,6 +80,7 @@ public class GpsCtrl {
      */
     @RequestMapping("/shareGps")
     @ResponseBody
+    @PreAuthorize("@AuthorityCheck.admin()")
     public ResponseBodyVO<GpsPO> shareGps(@RequestBody GpsPO gpsPO){
         if(ObjectUtil.isNull(gpsPO)){
             return new ResponseBodyVO(false, 500, "参数必传!",null);

+ 2 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/model/ctrl/LidarCtrl.java

@@ -9,6 +9,7 @@ import api.common.pojo.vo.model.LidarVO;
 import api.common.util.ObjectUtil;
 import com.css.simulation.resource.model.service.LidarService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -79,6 +80,7 @@ public class LidarCtrl {
      */
     @RequestMapping("/shareLidar")
     @ResponseBody
+    @PreAuthorize("@AuthorityCheck.admin()")
     public ResponseBodyVO<LidarPO> shareLidar(@RequestBody LidarPO lidarPO){
         if(ObjectUtil.isNull(lidarPO)){
             return new ResponseBodyVO(false, 500, "参数必传!",null);

+ 2 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/model/ctrl/OgtCtrl.java

@@ -8,6 +8,7 @@ import api.common.pojo.vo.model.OgtVO;
 import api.common.util.ObjectUtil;
 import com.css.simulation.resource.model.service.OgtService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -78,6 +79,7 @@ public class OgtCtrl {
      */
     @RequestMapping("/shareOgt")
     @ResponseBody
+    @PreAuthorize("@AuthorityCheck.admin()")
     public ResponseBodyVO<OgtPO> shareOgt(@RequestBody OgtPO ogtPO){
         if(ObjectUtil.isNull(ogtPO)){
             return new ResponseBodyVO(false, 500, "参数必传!",null);

+ 2 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/model/ctrl/VehicleCtrl.java

@@ -9,6 +9,7 @@ import api.common.pojo.vo.model.VehicleVO;
 import api.common.util.ObjectUtil;
 import com.css.simulation.resource.model.service.VehicleService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -79,6 +80,7 @@ public class VehicleCtrl {
      */
     @RequestMapping("/shareVehicle")
     @ResponseBody
+    @PreAuthorize("@AuthorityCheck.admin()")
     public ResponseBodyVO<VehiclePO> shareVehicle(@RequestBody VehicleVO vehicleVO){
         if(ObjectUtil.isNull(vehicleVO)){
             return new ResponseBodyVO(false, 500, "参数必传!",null);

+ 4 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/model/ctrl/VehicleTempCtrl.java

@@ -8,6 +8,7 @@ import api.common.util.ObjectUtil;
 import com.css.simulation.resource.model.service.VehicleTempService;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 @Controller
 @RequestMapping("/vehicleTemp")
+@PreAuthorize("@AuthorityCheck.admin()")
 public class VehicleTempCtrl {
 
     @Autowired
@@ -25,6 +27,7 @@ public class VehicleTempCtrl {
      */
     @RequestMapping("/getVehicleTempTree")
     @ResponseBody
+    @PreAuthorize("true")
     public ResponseBodyVO getVehicleList(){
         ResponseBodyVO response = new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
         response.setInfo(vehicleTempService.getVehicleTempTree());
@@ -65,7 +68,7 @@ public class VehicleTempCtrl {
         ResponseBodyVO<VehicleTempPO> response = new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);
         po = vehicleTempService.saveVehicleTemp(po);
         if(ObjectUtil.isNull(po.getId())){
-            return new ResponseBodyVO(false, 500, "车辆名称重复!",null);
+            return new ResponseBodyVO(false, 500, "车辆类型、型号、颜色重复!",null);
         }
         response.setInfo(po);
         return response;

+ 7 - 16
simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/VehicleService.java

@@ -10,12 +10,12 @@ import api.common.util.StringUtil;
 import com.css.simulation.resource.common.utils.AuthUtil;
 import com.css.simulation.resource.common.utils.PoUtil;
 import com.css.simulation.resource.model.mapper.VehicleMapper;
+import org.apache.tomcat.util.buf.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.bind.annotation.RequestBody;
 
-import java.sql.Timestamp;
-import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 @Service
@@ -41,14 +41,8 @@ public class VehicleService {
     public VehicleVO getVehicleInfo(VehicleParam vehicleParam) {
         VehicleVO vehicleInfo = vehicleMapper.getVehicleInfo(vehicleParam);
         //车辆模型字段解析
-        String vehicleType = vehicleInfo.getVehicleType();
-        String vehicleModel = vehicleInfo.getVehicleModel();
-        String vehicleColour = vehicleInfo.getVehicleColour();
-        List<String> modelLabel = new ArrayList<>();
-        modelLabel.add(vehicleType);
-        modelLabel.add(vehicleModel);
-        modelLabel.add(vehicleColour);
-        vehicleInfo.setModelLabel(modelLabel);
+        String vehicleType = vehicleInfo.getVehicleTypeStr();
+        vehicleInfo.setVehicleType(vehicleType.split(","));
         return vehicleInfo;
     }
 
@@ -56,12 +50,9 @@ public class VehicleService {
         VehiclePO vehiclePO = new VehiclePO();
         ObjectUtil.voToPo(vehicleVO,vehiclePO);
         //车辆模型字段解析
-        List<String> modelLabel = vehicleVO.getModelLabel();
-        if(ObjectUtil.isNotNull(modelLabel) && modelLabel.size() == 3){
-            vehiclePO.setVehicleType(modelLabel.get(0));
-            vehiclePO.setVehicleModel(modelLabel.get(1));
-            vehiclePO.setVehicleColour(modelLabel.get(2));
-        }
+        String[] vehicleType = vehicleVO.getVehicleType();
+        String vehicleTypeStr = StringUtils.join(Arrays.asList(vehicleType),',');
+        vehiclePO.setVehicleType(vehicleTypeStr);
         //常规字段赋值
         PoUtil.initAddPo(vehiclePO);
         vehiclePO.setShare(DictConstants.NO);//私有

+ 3 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/VehicleTempService.java

@@ -35,7 +35,8 @@ public class VehicleTempService {
         typeCollect.forEach((typeKey,typeValue)->{
             Map typeMap = new HashMap();
             typeMap.put("code",typeKey);
-            typeMap.put("name",typeValue.get(0).getVehicleName());
+            typeMap.put("name",typeKey);
+            //typeMap.put("name",typeValue.get(0).getVehicleName());
             List<Map> modelList = new LinkedList();
             Map<String, List<VehicleTempVO>> modelCollect = typeValue.stream().collect(Collectors.groupingBy(VehicleTempVO::getVehicleModel,LinkedHashMap::new, Collectors.toList()));
             modelCollect.forEach((modelKey,modelValue)->{
@@ -84,6 +85,7 @@ public class VehicleTempService {
         if(ObjectUtil.isNull(id)){//新增
             po.setId(StringUtil.getRandomUUID());
             po.setVehicleCode(StringUtil.getRandomCode());
+            po.setValid("1");
             vehicleTempMapper.insert(po);
             logService.logVehicle(LogConstants.SYS_LOG_VEHICLE_INSERT,po);
         }else{//修改

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

@@ -1340,7 +1340,10 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
             }
         }else if(DictConstants.SCENE_GENERAL.equals(sceneType)){
             ///TODO 泛化场景暂不支持
-
+            SceneBaseInfoVo sceneBaseInfoVo = simulationProjectMapper.selectSceneGeneralDataById(sceneId);
+            if(sceneBaseInfoVo != null){
+                resultVo.setCommonSceneName(sceneBaseInfoVo.getSceneName());
+            }
         }
 
         return resultVo;
@@ -1638,6 +1641,10 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
             }
         }else if(DictConstants.SCENE_GENERAL.equals(sceneType)){
             /// TODO 泛化场景暂不支持
+             sceneBaseInfoVo = simulationProjectMapper.selectSceneGeneralDataById(sceneId);
+            if(sceneBaseInfoVo != null){
+                vo.setSceneName(sceneBaseInfoVo.getSceneName());
+            }
 
         }
     }
@@ -1773,6 +1780,13 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
 
                         }else if(DictConstants.SCENE_GENERAL.equals(sceneType)){
                             /// TODO 泛化场景暂不支持
+                            //泛化
+                            sublistScoreVo.setSceneType("泛化");
+                            //获取场景名称
+                            SceneBaseInfoVo sceneBaseInfoVo = simulationProjectMapper.selectSceneGeneralDataById(sc.getSceneId());
+                            if(sceneBaseInfoVo != null){
+                                sceneName = sceneBaseInfoVo.getSceneName();
+                            }
 
                         }
                         sublistScoreVo.setReturnSceneId(sceneName);//显示场景名称
@@ -2243,6 +2257,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         List<SceneScoreVo> StatueSceneScoreVos = setSceneScore(vo, sceneStatueIds, DictConstants.SCENE_STANDARD, pId);
         List<SceneScoreVo> TrafficSceneScoreVos = setSceneScore(vo, sceneTrafficIds, DictConstants.SCENE_ACCIDENT, pId);
         ///TODO 暂不支持泛化场景
+        List<SceneScoreVo> FhSceneScoreVos = setSceneScore(vo, sceneTrafficIds, DictConstants.SCENE_GENERAL, pId);
 
         //合成一个list
         if(!isEmpty(NaturalSceneScoreVos)){
@@ -2254,6 +2269,10 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         if(!isEmpty(TrafficSceneScoreVos)){
             sceneScoreVos.addAll(TrafficSceneScoreVos);
         }
+
+        if(!isEmpty(FhSceneScoreVos)){
+            sceneScoreVos.addAll(FhSceneScoreVos);
+        }
         vo.setSceneScoreList(sceneScoreVos);
     }
     private void setLastTargetScore(ScenePackageSubListVO vo, String pId){
@@ -3990,14 +4009,15 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
         }
 
         //推送消息到kafka
-        autoProjectRunToKafka(po);
+        autoProjectRunToKafka(po, subprojectPo.getId());
 
         return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS,null);
     }
 
-    private void autoProjectRunToKafka(SimulationAutomaticProjectPo po) throws JsonProcessingException {
+    private void autoProjectRunToKafka(SimulationAutomaticProjectPo po, String subId) throws JsonProcessingException {
         SimulationManualProjectKafkaParam kafkaParam = new SimulationManualProjectKafkaParam();
-        kafkaParam.setProjectId(po.getId());
+//        kafkaParam.setProjectId(po.getId());
+        kafkaParam.setProjectId(subId); //子任务id
         kafkaParam.setAlgorithmId(po.getAlgorithm());
         kafkaParam.setVehicleConfigId(po.getVehicle());
         kafkaParam.setScenePackageId(po.getScene());

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

@@ -65,6 +65,7 @@ public interface SimulationProjectMapper {
 
     SceneBaseInfoVo selectSceneNatural(String id);
 
+    SceneBaseInfoVo selectSceneGeneralDataById(String id);
     SceneBaseInfoVo selectSceneStandardsRegulations(String id);
 
     List<ScenePackageSubListVO> selectSubSceneByPid(String id);

+ 16 - 12
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/SceneGeneralTemplateController.java

@@ -4,24 +4,21 @@ import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.constants.DictConstants;
 import api.common.pojo.constants.LogConstants;
 import api.common.pojo.param.scene.SceneGeneralTemplateParam;
-import api.common.pojo.po.scene.SceneGeneralDataPO;
 import api.common.pojo.po.scene.SceneGeneralExamplePO;
 import api.common.pojo.po.scene.SceneGeneralTemplatePO;
 import api.common.pojo.po.system.SceneImportPO;
 import api.common.pojo.vo.scene.SceneGeneralTemplateVO;
-import api.common.util.HttpUtil;
-import api.common.util.JsonUtil;
 import api.common.util.ObjectUtil;
 import api.common.util.TimeUtil;
 import com.css.simulation.resource.common.utils.PageUtil;
 import com.css.simulation.resource.feign.FileDownService;
+import com.css.simulation.resource.log.service.LogService;
 import com.css.simulation.resource.scene.service.SceneGeneralExampleService;
 import com.css.simulation.resource.scene.service.SceneGeneralTemplateService;
+import com.css.simulation.resource.system.service.DictService;
 import com.css.simulation.resource.system.service.SceneImportService;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
 import com.github.pagehelper.PageInfo;
-import org.apache.http.client.config.RequestConfig;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 import javax.annotation.Resource;
@@ -29,9 +26,6 @@ import javax.servlet.http.HttpServletRequest;
 import java.io.File;
 import java.io.IOException;
 import java.lang.reflect.Field;
-import java.security.KeyManagementException;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -50,7 +44,10 @@ public class SceneGeneralTemplateController {
     private FileDownService fileDownService;
     @Resource
     SceneImportService sceneImportService;
-
+    @Autowired
+    LogService logService;
+    @Autowired
+    DictService dictService;
     //查询列表
     @PostMapping("/querySceneGeneralTemplateList")
     @ResponseBody
@@ -181,7 +178,7 @@ public class SceneGeneralTemplateController {
     }
 
 
-    //测试
+   /* //测试
     @PostMapping("/test1")
     @ResponseBody
     public ResponseBodyVO test1(@RequestBody SceneGeneralTemplatePO po) throws IllegalAccessException, IOException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException {
@@ -202,7 +199,7 @@ public class SceneGeneralTemplateController {
         List<SceneGeneralDataPO> list = JsonUtil.jsonToList(newjson, SceneGeneralDataPO.class);
         return new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "参数不能为空,请检查");
     }
-
+*/
     /**
      * 对象转Map
      *
@@ -232,6 +229,13 @@ public class SceneGeneralTemplateController {
         sceneImportPO.setName(taskName);
         sceneImportPO.setSceneType("4");
        sceneImportPO=sceneImportService.saveTask(sceneImportPO);
+       //记录日志
+        Map<String,String>  mapType= dictService.getDictMapByType(DictConstants.SCENE_TYPE);
+        String type= mapType.get(DictConstants.SCENE_GENERAL);
+        String content="创建"+type+"上传任务:"+sceneImportPO.getName()+"(ID:"+sceneImportPO.getId()+")";
+        logService.logSceneUpload(LogConstants.SYS_LOG_SCENE_TASK_INSERT,content);
+
+
         sceneImportPO.setStatus(DictConstants.SCENE_IMPORT_STATUS_2);
 
         File file = null;

+ 3 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/ctrl/ScenePackageController.java

@@ -130,7 +130,9 @@ public class ScenePackageController {
         if(ObjectUtil.isNotNull(list)){
             creatNum=list.size();
         }
-        map.put("creatNum",creatNum);
+        if(ObjectUtil.isNotNull(map)){
+            map.put("creatNum",creatNum);
+        }
         return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS,map);
     }
 }

+ 7 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SystemScenePackageMapper.java

@@ -32,4 +32,11 @@ public interface SystemScenePackageMapper {
     //查询勾选场景数量
     List<Map> querySystemScenePackageListByTJ(SystemScenePackageParam params);
 
+
+    //查询勾选场景中自然数量
+    List<String> querySceneStandardsRegulationsListByTJ(SystemScenePackageParam po);
+    List<String> querySceneNaturalListByTJ(SystemScenePackageParam po);
+    List<String> querySceneAccidentListByTJ(SystemScenePackageParam po);
+    List<String> querySceneGeneralTemplateListByTJ(SystemScenePackageParam po);
+
 }

+ 5 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/mapper/SystemScenePackageSublistMapper.java

@@ -13,6 +13,10 @@ import java.util.List;
 public interface SystemScenePackageSublistMapper {
 
     void saveSystemScenePackageSublist(List<SystemScenePackageSublistPO> list);
-    List<String> querySystemScenePackageSublistList(SystemScenePackageSublistPO po);
+    List<String> querySceneStandardsRegulationsList(SystemScenePackageSublistPO po);
+    List<String> querySceneNaturalList(SystemScenePackageSublistPO po);
+    List<String> querySceneAccidentList(SystemScenePackageSublistPO po);
+    List<String> querySceneGeneralTemplateList(SystemScenePackageSublistPO po);
+
     void deleteSystemScenePackageSublist(SystemScenePackageSublistPO po);
 }

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

@@ -21,14 +21,11 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import feign.Response;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.fileupload.FileItem;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.multipart.MultipartFile;
 
 import java.util.*;
 
 import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.commons.CommonsMultipartFile;
 
 import javax.annotation.Resource;
 import java.io.File;
@@ -761,11 +758,6 @@ public class SceneAccidentService {
             sceneImportPO.setFalseNum(falseNum);
             sceneImportPO.setErrorMessage(errorMessage);
            // sceneImportTaskService.updateSceneImportTask(sceneImportTaskPO);
-            //记录日志
-            Map<String,String>  mapType= dictService.getDictMapByType(DictConstants.SCENE_TYPE);
-            String type= mapType.get(DictConstants.SCENE_ACCIDENT);
-            String content="创建"+type+"上传任务:"+sceneImportPO.getName()+"(ID:"+sceneImportPO.getId()+")";
-            logService.logSceneUpload(LogConstants.SYS_LOG_SCENE_TASK,content);
 
             return sceneImportPO;
         }catch (Exception e){

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

@@ -613,11 +613,6 @@ public class SceneNaturalService {
             sceneImportPO.setSuccessNum(successNum);
             sceneImportPO.setFalseNum(falseNum);
             sceneImportPO.setErrorMessage(errorMessage);
-            //记录日志
-            Map<String,String>  mapType= dictService.getDictMapByType(DictConstants.SCENE_TYPE);
-            String type= mapType.get(DictConstants.SCENE_NATURAL);
-            String content="创建"+type+"上传任务:"+sceneImportPO.getName()+"(ID:"+sceneImportPO.getId()+")";
-            logService.logSceneUpload(LogConstants.SYS_LOG_SCENE_TASK,content);
             return sceneImportPO;
         }catch (Exception e){
             sceneImportPO.setStatus(DictConstants.SCENE_IMPORT_STATUS_2);

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

@@ -100,10 +100,7 @@ public class StandardsRegulationsService {
             standardsRegulationsPO.setModifyTime(TimeUtil.getNowForMysql());
             standardsRegulationsPO.setModifyUserId(AuthUtil.getCurrentUserId());
             standardsRegulationsMapper.updateStandardsRegulations(standardsRegulationsPO);
-
         }
-
-
         return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
     }
 
@@ -117,8 +114,6 @@ public class StandardsRegulationsService {
             params.setBq("1");
         }
         List<StandardsRegulationsPO> list =new ArrayList<>();
-
-
         /*if((params.getXlk().equals("1")&&params.getBq().equals("1"))||(params.getXlk().equals("0")&&params.getBq().equals("0"))||(params.getXlk().equals("1")&&params.getBq().equals("0"))){
             list =  standardsRegulationsMapper.queryStandardsRegulationsList(params);
         }*//*else if(params.getXlk().equals("1")&&params.getBq().equals("0")){
@@ -307,11 +302,6 @@ public class StandardsRegulationsService {
             sceneImportPO.setSuccessNum(successNum);
             sceneImportPO.setFalseNum(falseNum);
             sceneImportPO.setErrorMessage(errorMessage);
-            //记录日志
-            Map<String,String>  mapType= dictService.getDictMapByType(DictConstants.SCENE_TYPE);
-            String type= mapType.get(DictConstants.SCENE_STANDARD);
-            String content="创建"+type+"上传任务:"+sceneImportPO.getName()+"(ID:"+sceneImportPO.getId()+")";
-            logService.logSceneUpload(LogConstants.SYS_LOG_SCENE_TASK,content);
             return sceneImportPO;
         }catch (Exception e){
             sceneImportPO.setStatus(DictConstants.SCENE_IMPORT_STATUS_2);

+ 50 - 21
simulation-resource-server/src/main/java/com/css/simulation/resource/scene/service/SystemScenePackageService.java

@@ -2,11 +2,9 @@ package com.css.simulation.resource.scene.service;
 
 import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.constants.LogConstants;
-import api.common.pojo.param.scene.ScoringRulesParam;
 import api.common.pojo.param.scene.SystemScenePackageParam;
 import api.common.pojo.param.scene.SystemUserSceneParam;
 import api.common.pojo.po.scene.*;
-import api.common.pojo.vo.scene.PackageVO;
 import api.common.pojo.vo.scene.SystemScenePackageVO;
 import api.common.pojo.vo.scene.SystemUserSceneVO;
 import api.common.pojo.vo.scene.UserSceneVO;
@@ -15,14 +13,11 @@ import api.common.util.StringUtil;
 import api.common.util.TimeUtil;
 import com.css.simulation.resource.common.utils.AuthUtil;
 import com.css.simulation.resource.log.service.LogService;
-import com.css.simulation.resource.scene.mapper.ScoringRulesMapper;
 import com.css.simulation.resource.scene.mapper.SystemScenePackageMapper;
 import com.css.simulation.resource.scene.mapper.SystemScenePackageSublistMapper;
 import com.css.simulation.resource.scene.mapper.SystemUserSceneMapper;
-import com.github.pagehelper.PageInfo;
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
-import org.checkerframework.checker.units.qual.A;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -148,6 +143,24 @@ public class SystemScenePackageService {
     @SneakyThrows
     public List<SystemScenePackageVO> querySystemScenePackageList(SystemScenePackageParam params) {
         List<SystemScenePackageVO> list = systemScenePackageMapper.querySystemScenePackageList(params);
+        for (SystemScenePackageVO vo:list) {
+            SystemScenePackageSublistPO sublistPo=new SystemScenePackageSublistPO();
+            sublistPo.setSceneAndPackage(vo.getId());
+            sublistPo.setSceneType("1");
+            List<String>  zrList=systemScenePackageSublistMapper.querySceneNaturalList(sublistPo);
+            sublistPo.setSceneType("2");
+            List<String>  bzList=systemScenePackageSublistMapper.querySceneStandardsRegulationsList(sublistPo);
+            sublistPo.setSceneType("3");
+            List<String>  jtList=systemScenePackageSublistMapper.querySceneAccidentList(sublistPo);
+            sublistPo.setSceneType("4");
+            List<String>  fhList=systemScenePackageSublistMapper.querySceneGeneralTemplateList(sublistPo);
+            vo.setZrCount(zrList.size());
+            vo.setBzCount(bzList.size());
+            vo.setJtCount(jtList.size());
+            vo.setFhCount(fhList.size());
+        }
+
+
         return list;
     }
     //
@@ -158,13 +171,13 @@ public class SystemScenePackageService {
         SystemScenePackageSublistPO sublistPo=new SystemScenePackageSublistPO();
         sublistPo.setSceneAndPackage(params.getId());
         sublistPo.setSceneType("1");
-       List<String>  zrList=systemScenePackageSublistMapper.querySystemScenePackageSublistList(sublistPo);
+       List<String>  zrList=systemScenePackageSublistMapper.querySceneNaturalList(sublistPo);
         sublistPo.setSceneType("2");
-        List<String>  bzList=systemScenePackageSublistMapper.querySystemScenePackageSublistList(sublistPo);
+        List<String>  bzList=systemScenePackageSublistMapper.querySceneStandardsRegulationsList(sublistPo);
         sublistPo.setSceneType("3");
-        List<String>  jtList=systemScenePackageSublistMapper.querySystemScenePackageSublistList(sublistPo);
+        List<String>  jtList=systemScenePackageSublistMapper.querySceneAccidentList(sublistPo);
         sublistPo.setSceneType("4");
-        List<String>  fhList=systemScenePackageSublistMapper.querySystemScenePackageSublistList(sublistPo);
+        List<String>  fhList=systemScenePackageSublistMapper.querySceneGeneralTemplateList(sublistPo);
         BeanUtils.copyProperties(po, newPo);
         newPo.setZrSceneNames(zrList);
         newPo.setBzSceneNames(bzList);
@@ -324,11 +337,8 @@ public class SystemScenePackageService {
             list.add(po);
         }
         systemUserSceneMapper.saveSystemUserScene(list);
-        Map map=new HashMap();
-        map.put("params",params);
-
-        //记录场景包
-       logService.logScenePackage(LogConstants.SYS_LOG_PACKAGE_DISTRIBUTION, null,map);
+        //记录日志
+       logService.logScenePackage(LogConstants.SYS_LOG_PACKAGE_DISTRIBUTION, null,params);
     }
     //根据场景包删除配置账号
     @SneakyThrows
@@ -343,12 +353,8 @@ public class SystemScenePackageService {
             po.setUserId(userScene.getUserId());
             systemUserSceneMapper.deleteSystemUserScene(po);
         }
-       // systemUserSceneMapper.deleteSystemUserSceneList(list);
-        //记录场景包删除
-        Map map=new HashMap();
-        map.put("params",params);
-        //记录场景包
-        logService.logScenePackage(LogConstants.SYS_LOG_PACKAGE_DISTRIBUTION_DELETE, null,map);
+        //记录日志
+        logService.logScenePackage(LogConstants.SYS_LOG_PACKAGE_DISTRIBUTION_DELETE, null,params);
     }
     //人员表查询测试包详情
     @SneakyThrows
@@ -425,7 +431,30 @@ public class SystemScenePackageService {
     //查询勾选场景数量
     @SneakyThrows
     public ResponseBodyVO<List<Map>> querySystemScenePackageListByTJ(SystemScenePackageParam params) {
-        List<Map> list = systemScenePackageMapper.querySystemScenePackageListByTJ(params);
+       // List<Map> list = systemScenePackageMapper.querySystemScenePackageListByTJ(params);
+
+        List<String>  zrList=systemScenePackageMapper.querySceneNaturalListByTJ(params);
+        List<String>  bzList=systemScenePackageMapper.querySceneStandardsRegulationsListByTJ(params);
+        List<String>  jtList=systemScenePackageMapper.querySceneAccidentListByTJ(params);
+        List<String>  fhList=systemScenePackageMapper.querySceneGeneralTemplateListByTJ(params);
+
+        List<Map> list=new ArrayList<>();
+        Map map=new HashMap();
+        map.put("scene_type","1");
+        map.put("aaa",zrList.size());
+        Map map1=new HashMap();
+        map1.put("scene_type","2");
+        map1.put("aaa",bzList.size());
+        Map map2=new HashMap();
+        map2.put("scene_type","3");
+        map2.put("aaa",jtList.size());
+        Map map3=new HashMap();
+        map3.put("scene_type","4");
+        map3.put("aaa",fhList.size());
+        list.add(map1);
+        list.add(map2);
+        list.add(map3);
+        list.add(map);
         return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS, list);
     }
 }

+ 13 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/ClusterCtrl.java

@@ -63,6 +63,8 @@ public class ClusterCtrl {
         return response;
     }
 
+
+
     /**
      * 查询已分配未到期节点数量
      */
@@ -87,4 +89,15 @@ public class ClusterCtrl {
         return response;
     }
 
+
+    /**
+     * 编辑页面查询有效的集群信息
+     */
+    @RequestMapping("/getValidClusterInfo")
+    @ResponseBody
+    public ResponseBodyVO<ClusterVO> getValidClusterInfo(@RequestBody ClusterParam clusterParam){
+        ResponseBodyVO<ClusterVO> response = new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);
+        response.setInfo(clusterService.getValidClusterInfo(clusterParam));
+        return response;
+    }
 }

+ 2 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/DictCtrl.java

@@ -6,6 +6,7 @@ import api.common.pojo.vo.system.DictVO;
 import com.css.simulation.resource.system.service.DictService;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Controller;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -33,6 +34,7 @@ public class DictCtrl {
      */
     @RequestMapping("/refreshDictsByTypes")
     @ResponseBody
+    @PreAuthorize("@AuthorityCheck.admin()")
     public ResponseBodyVO refreshDictsByTypes(@RequestBody @Validated DictParam param) throws JsonProcessingException {
         ResponseBodyVO<String> response = new ResponseBodyVO<String>(ResponseBodyVO.Response.SUCCESS);
         response.setInfo(dictService.refreshDicts(param));

+ 1 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/FileController.java

@@ -43,7 +43,7 @@ public class FileController {
             Integer nowTime = TimeUtil.getRq(new Date(), 0);
             String randomCode = StringUtil.getRandomCode();
             if (type.equals(DictConstants.VEHICLE_IMG_FILE)) {
-                fileName = DictConstants.VEHICLE_IMG_FILE + "/" + objectPath + "/" + nowTime + "/" + randomCode + "/" + multipartFile.getOriginalFilename();
+                fileName = "/" + DictConstants.VEHICLE_IMG_FILE + "/" + nowTime + "/" + randomCode + "/" + multipartFile.getOriginalFilename();
             } else {
                 new ResponseBodyVO(ResponseBodyVO.Response.CLIENT_FAILURE, "文件类型错误!");
             }

+ 4 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/UserCtrl.java

@@ -48,9 +48,12 @@ public class UserCtrl {
         if(ObjectUtil.isNull(userPO)){
             return new ResponseBodyVO(false, 400, "没有创建账户的权限!",null);
         }
-        if(ObjectUtil.isNull(userPO.getId())){
+        if("checkUsername".equals(userPO.getId())){
             return new ResponseBodyVO(false, 400, "账户名重复!",null);
         }
+        if("subUserNum".equals(userPO.getId())){
+            return new ResponseBodyVO(false, 400, "超出可创建子账户数量!",null);
+        }
         response.setInfo(userPO);
         return response;
     }

+ 26 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/system/ctrl/UserInfoCtrl.java

@@ -3,6 +3,7 @@ package com.css.simulation.resource.system.ctrl;
 import api.common.pojo.common.ResponseBodyVO;
 import api.common.pojo.constants.DictConstants;
 import api.common.pojo.param.scene.SystemScenePackageParam;
+import api.common.pojo.po.scene.SystemScenePackageSublistPO;
 import api.common.pojo.po.system.UserPO;
 import api.common.pojo.vo.scene.SystemScenePackageVO;
 import api.common.pojo.vo.system.ClusterVO;
@@ -10,6 +11,7 @@ import api.common.pojo.vo.system.ParameterVO;
 import api.common.pojo.vo.system.UserVO;
 import api.common.util.ObjectUtil;
 import com.css.simulation.resource.common.utils.AuthUtil;
+import com.css.simulation.resource.scene.mapper.SystemScenePackageSublistMapper;
 import com.css.simulation.resource.scene.service.SystemScenePackageService;
 import com.css.simulation.resource.system.service.ClusterService;
 import com.css.simulation.resource.system.service.ParameterService;
@@ -42,6 +44,9 @@ public class UserInfoCtrl {
     @Resource
     SystemScenePackageService systemScenePackageService;
 
+    @Resource
+    SystemScenePackageSublistMapper systemScenePackageSublistMapper;
+
 
     /**
      * 获取当前登录人详情
@@ -96,6 +101,27 @@ public class UserInfoCtrl {
         SystemScenePackageParam param = new SystemScenePackageParam();
         param.setUserId(userId);
         List<SystemScenePackageVO> list = systemScenePackageService.querySystemScenePackageList(param);
+
+        for (SystemScenePackageVO vo:list) {
+
+            SystemScenePackageSublistPO sublistPo=new SystemScenePackageSublistPO();
+            sublistPo.setSceneAndPackage(vo.getId());
+            sublistPo.setSceneType("1");
+            List<String>  zrList=systemScenePackageSublistMapper.querySceneNaturalList(sublistPo);
+            sublistPo.setSceneType("2");
+            List<String>  bzList=systemScenePackageSublistMapper.querySceneStandardsRegulationsList(sublistPo);
+            sublistPo.setSceneType("3");
+            List<String>  jtList=systemScenePackageSublistMapper.querySceneAccidentList(sublistPo);
+            sublistPo.setSceneType("4");
+            List<String>  fhList=systemScenePackageSublistMapper.querySceneGeneralTemplateList(sublistPo);
+            vo.setZrCount(zrList.size());
+            vo.setBzCount(bzList.size());
+            vo.setJtCount(jtList.size());
+            vo.setFhCount(fhList.size());
+            vo.setTotalCount(zrList.size() + bzList.size() + jtList.size() + fhList.size());
+        }
+
+
         long zrTotalCount = list.stream().mapToLong(SystemScenePackageVO::getZrCount).sum();
         long bzTotalCount = list.stream().mapToLong(SystemScenePackageVO::getBzCount).sum();
         long jtTotalCount = list.stream().mapToLong(SystemScenePackageVO::getJtCount).sum();

+ 8 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/system/mapper/ClusterMapper.java

@@ -24,7 +24,14 @@ public interface ClusterMapper {
 
     HashMap<String, Integer> getClusterNum(ClusterParam clusterParam);
 
-    Integer getLicenseNum(@Param("userId") String userId);
+    Integer getSimulationLicenseNum(@Param("userId") String userId);
+
+    Integer getDynamicLicenseNum(@Param("userId") String userId);
+
+    Integer getAssignedSimLicenseNum(ClusterParam clusterParam);
+
+    Integer getAssignedDynLicenseNum(ClusterParam clusterParam);
 
     ClusterVO getClusterByUserId(String userId);
+
 }

+ 3 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/system/mapper/UserMapper.java

@@ -38,4 +38,7 @@ public interface UserMapper {
     List<UserVO> checkPassword(UserVO userVO);
 
     void savePassword(UserPO userPO);
+
+    List<UserPO> getSubUser(@Param("createUserId") String createUserId);
+
 }

+ 52 - 2
simulation-resource-server/src/main/java/com/css/simulation/resource/system/service/ClusterService.java

@@ -39,12 +39,14 @@ public class ClusterService {
         PageUtil.setPageInfo(clusterParam);
         String roleCode = AuthUtil.getCurrentUserRoleCode();
         String useType = AuthUtil.getCurrentUseType();
+        String userId = AuthUtil.getCurrentUserId();
         //当前账户为管理员账户,需要查询普通账户,设置roleCode为2
         if(DictConstants.ROLE_CODE_ADMIN.equals(roleCode) || DictConstants.ROLE_CODE_SYSADMIN.equals(roleCode)){
             clusterParam.setRoleCode(DictConstants.ROLE_CODE_UESR);
         }else if(DictConstants.ROLE_CODE_UESR.equals(roleCode) && DictConstants.USE_TYPE_EXCLUSIVE.equals(useType)){
             // 当前账户为独占使用的普通账户,需要查询该账户创建的普通账户子账户,设置roleCode为3及当前创建用户id
             clusterParam.setRoleCode(DictConstants.ROLE_CODE_SUBUESR);
+            clusterParam.setCreateUserId(userId);
         }else{
             return new PageInfo<>(new ArrayList<>());
         }
@@ -86,17 +88,28 @@ public class ClusterService {
         ClusterParam clusterParam = new ClusterParam();
         String roleCode = AuthUtil.getCurrentUserRoleCode();
         String useType = AuthUtil.getCurrentUseType();
+        String userId = AuthUtil.getCurrentUserId();
+        Integer totalSimulationAll;
+        Integer totalDynamicAll;
         //当前账户为管理员账户,需要查询普通账户,设置roleCode为2
         if(DictConstants.ROLE_CODE_ADMIN.equals(roleCode) || DictConstants.ROLE_CODE_SYSADMIN.equals(roleCode)){
             clusterParam.setRoleCode(DictConstants.ROLE_CODE_UESR);
+            totalSimulationAll = -1;
+            totalDynamicAll = -1;
         }else if(DictConstants.ROLE_CODE_UESR.equals(roleCode) && DictConstants.USE_TYPE_EXCLUSIVE.equals(useType)){
             // 当前账户为独占使用的普通账户,需要查询该账户创建的普通账户子账户,设置roleCode为3及当前创建用户id
             clusterParam.setRoleCode(DictConstants.ROLE_CODE_SUBUESR);
+            clusterParam.setCreateUserId(userId);
+            // 查询该普通账户所有的集群数量
+            totalSimulationAll = clusterMapper.getSimulationLicenseNum(userId);
+            totalDynamicAll = clusterMapper.getDynamicLicenseNum(userId);
         }else{
             return null;
         }
 
         HashMap<String, Integer> resMap = clusterMapper.getClusterNum(clusterParam);
+        resMap.put("totalSimulationAll", totalSimulationAll);
+        resMap.put("totalDynamicAll", totalDynamicAll);
         return resMap;
     }
 
@@ -111,10 +124,17 @@ public class ClusterService {
             //查询父账户
             userId = AuthUtil.getCreateUserId();
         }
-        Integer simulationLicenseNum = clusterMapper.getLicenseNum(userId);
+        Integer simulationLicenseNum = clusterMapper.getSimulationLicenseNum(userId);
         if(simulationLicenseNum == null){
             simulationLicenseNum = 0;
         }
+        if(DictConstants.ROLE_CODE_UESR.equals(roleCode) && simulationLicenseNum != 0){//普通账户需要减去它分配给子账户的
+            ClusterParam clusterParam = new ClusterParam();
+            clusterParam.setCreateUserId(userId);
+            Integer assignedSimulationLicenseNum =  clusterMapper.getAssignedSimLicenseNum(clusterParam);
+            simulationLicenseNum = simulationLicenseNum - assignedSimulationLicenseNum;
+        }
+
         return simulationLicenseNum;
     }
 
@@ -124,11 +144,41 @@ public class ClusterService {
         String userId = AuthUtil.getCurrentUserId();
         if(DictConstants.ROLE_CODE_ADMIN.equals(roleCode) || DictConstants.ROLE_CODE_SYSADMIN.equals(roleCode)){ //管理员账户
             return null;
-        }else if(DictConstants.ROLE_CODE_SUBUESR.equals(roleCode) && DictConstants.USE_TYPE_PUBLIC.equals(useType)){
+        }else if(DictConstants.ROLE_CODE_SUBUESR.equals(roleCode) && DictConstants.USE_TYPE_PUBLIC.equals(useType)){ //公共使用的普通子账户
             //查询父账户
             userId = AuthUtil.getCreateUserId();
         }
         ClusterVO clusterVO = clusterMapper.getClusterByUserId(userId);
         return clusterVO;
     }
+
+
+    public ClusterVO getValidClusterInfo(ClusterParam clusterParam) {
+        String roleCode = AuthUtil.getCurrentUserRoleCode();
+        String useType = AuthUtil.getCurrentUseType();
+        String currentUserId = AuthUtil.getCurrentUserId();
+        if(DictConstants.ROLE_CODE_UESR.equals(roleCode) && DictConstants.USE_TYPE_EXCLUSIVE.equals(useType)){
+            //当前账户为独占使用的普通账户,其集群配置信息
+            ClusterVO clusterVO = clusterMapper.getClusterByUserId(currentUserId);
+
+            //查询当前普通账户分配给其子账户的集群总数量
+            clusterParam.setCreateUserId(currentUserId);
+            Integer assignedSimLicenseNum = clusterMapper.getAssignedSimLicenseNum(clusterParam);
+            Integer assignedDynLicenseNum = clusterMapper.getAssignedDynLicenseNum(clusterParam);
+
+            //当前普通账户的集群总数量减去已分配的数量
+            if(ObjectUtil.isNotNull(clusterVO) && clusterVO.getNumSimulationLicense() > assignedSimLicenseNum && clusterVO.getNumDynamicLicense() > assignedDynLicenseNum){
+                int validSimLicenseNum = clusterVO.getNumSimulationLicense() - assignedSimLicenseNum;
+                int validDynLicenseNum =  clusterVO.getNumDynamicLicense()  - assignedDynLicenseNum;
+
+                clusterVO.setValidNumSimLicense(validSimLicenseNum);
+                clusterVO.setValidNumDynLicense(validDynLicenseNum);
+
+                return clusterVO;
+            }
+
+        }
+        return null;
+    }
+
 }

+ 10 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/system/service/SceneImportService.java

@@ -1,6 +1,7 @@
 package com.css.simulation.resource.system.service;
 
 import api.common.pojo.constants.DictConstants;
+import api.common.pojo.constants.LogConstants;
 import api.common.pojo.param.system.SceneImportPageParam;
 import api.common.pojo.po.system.SceneImportPO;
 import api.common.util.ObjectUtil;
@@ -9,6 +10,7 @@ import api.common.util.TimeUtil;
 import com.css.simulation.resource.common.utils.AuthUtil;
 import com.css.simulation.resource.common.utils.PageUtil;
 import com.css.simulation.resource.common.utils.PoUtil;
+import com.css.simulation.resource.log.service.LogService;
 import com.css.simulation.resource.system.mapper.SceneImportMapper;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,6 +25,9 @@ public class SceneImportService {
     @Autowired
     DictService dictService;
 
+    @Autowired
+    LogService logService;
+
     @Autowired
     SceneImportMapper sceneImportMapper;
 
@@ -40,6 +45,11 @@ public class SceneImportService {
         if(ObjectUtil.isNull(id)) {//新增
             po.setId(StringUtil.getRandomUUID());
             sceneImportMapper.insert(po);
+            //记录日志
+            Map<String,String>  dictMap = dictService.getDictMapByType(DictConstants.SCENE_TYPE);
+            String type= dictMap.get(po.getSceneType());
+            String content = "创建" + type + "上传任务:" + po.getName() + "(ID:" + po.getId() + ")";
+            logService.logSceneUpload(LogConstants.SYS_LOG_SCENE_TASK_INSERT,content);
         }else{
             sceneImportMapper.update(po);
         }

+ 34 - 2
simulation-resource-server/src/main/java/com/css/simulation/resource/system/service/UserService.java

@@ -4,6 +4,7 @@ import api.common.pojo.constants.DictConstants;
 import api.common.pojo.constants.LogConstants;
 import api.common.pojo.param.system.UserParam;
 import api.common.pojo.po.system.UserPO;
+import api.common.pojo.vo.system.ParameterVO;
 import api.common.pojo.vo.system.UserVO;
 import api.common.util.EncryptUtil;
 import api.common.util.ObjectUtil;
@@ -38,6 +39,9 @@ public class UserService {
     @Autowired
     DictService dictService;
 
+    @Autowired
+    ParameterService parameterService;
+
     public UserVO getCurrentUserInfo() {
         String userId = AuthUtil.getCurrentUserId();
         UserVO userVO = userMapper.getUserInfo(userId);
@@ -83,6 +87,21 @@ public class UserService {
         }else if(DictConstants.ROLE_CODE_ADMIN.equals(currentUserRoleCode)){//子管理员
             userPO.setRoleCode(DictConstants.ROLE_CODE_UESR);
         }else if(DictConstants.ROLE_CODE_UESR.equals(currentUserRoleCode)){//普通用户
+            //新增参数校验
+            if(ObjectUtil.isNull(userPO.getId())){
+                ParameterVO parameter = parameterService.getParameterByUserId();
+                int num = parameter.getNumCreateUser();//最大用户数
+                int subUserNum = 0;
+                String userId = AuthUtil.getCurrentUserId();
+                List<UserPO> subUsers = userMapper.getSubUser(userId);
+                if(ObjectUtil.isNotNull(subUsers)){
+                    subUserNum = subUsers.size();
+                }
+                if(subUserNum >= num ){
+                    userPO.setId("subUserNum");
+                    return userPO;
+                }
+            }
             userPO.setRoleCode(DictConstants.ROLE_CODE_SUBUESR);
             //普通用户创建子账户时,占用类型继承
             userPO.setUseType(AuthUtil.getCurrentUseType());
@@ -92,7 +111,7 @@ public class UserService {
         //重名校验
         List<UserPO> list = userMapper.checkUsername(userPO);
         if(ObjectUtil.isNotNull(list)){
-            userPO.setId(null);
+            userPO.setId("checkUsername");
             return userPO;
         }
         PoUtil.initAddPo(userPO);
@@ -125,7 +144,20 @@ public class UserService {
         userMapper.saveVisible(userPO);
         if("1".equals(userPO.getVisible())){
             logService.logUser(LogConstants.SYS_LOG_USER_START,userPO);
-        }else{
+        }else{//停用
+            UserVO userInfo = userMapper.getUserInfo(userPO.getId());
+            String roleCode = userInfo.getRoleCode();
+            if(DictConstants.ROLE_CODE_UESR.equals(roleCode)){//停用普通用户时-停用子账户
+                List<UserPO> subUsers = userMapper.getSubUser(userPO.getId());
+                if(ObjectUtil.isNotNull(subUsers)){
+                    subUsers.forEach(po->{
+                        PoUtil.initUpdatePo(po);
+                        po.setVisible("0");
+                        userMapper.saveVisible(po);
+                    });
+                }
+            }
+            //只记录普通账户日志
             logService.logUser(LogConstants.SYS_LOG_USER_STOP,userPO);
         }
 

+ 42 - 12
simulation-resource-server/src/main/resources/mapper/log/LogMapper.xml

@@ -34,11 +34,11 @@
         <if test="username != null and username != ''">
             and username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
         </if>
-        <if test="createTimeBegin != null">
-            and create_time &gt;= #{createTimeBegin,jdbcType=TIMESTAMP}
+        <if test="createTimeBegin != null and createTimeBegin != ''">
+            and DATE(create_time) &gt;= #{createTimeBegin}
         </if>
-        <if test="createTimeEnd != null">
-            and create_time &lt;= #{createTimeEnd,jdbcType=TIMESTAMP}
+        <if test="createTimeEnd != null and createTimeBegin != ''">
+            and DATE(create_time) &lt;= #{createTimeEnd}
         </if>
         ORDER BY create_time DESC
     </select>
@@ -63,15 +63,45 @@
         <if test="operationType != null and operationType != ''">
             and operation_type = #{operationType,jdbcType=VARCHAR}
         </if>
-        <if test="createTimeBegin != null">
-            and create_time &gt;= #{createTimeBegin,jdbcType=TIMESTAMP}
+        <if test="createTimeBegin != null and createTimeBegin != ''">
+            and DATE(create_time) &gt;= #{createTimeBegin}
         </if>
-        <if test="createTimeEnd != null">
-            and create_time &lt;= #{createTimeEnd,jdbcType=TIMESTAMP}
+        <if test="createTimeEnd != null and createTimeBegin != ''">
+            and DATE(create_time) &lt;= #{createTimeEnd}
         </if>
         ORDER BY create_time DESC
     </select>
 
+    <select id="getUserOperationLogPageList" parameterType="api.common.pojo.param.log.LogPageParam" resultType="api.common.pojo.po.log.LogOperationPO">
+        select
+          o.id,
+          o.user_id,
+          o.username,
+          o.ip,
+          o.module,
+          o.operation_type,
+          o.create_time
+        FROM log_operation o
+        JOIN system_user u ON o.user_id = u.id AND u.create_user_id = #{content,jdbcType=VARCHAR}
+        WHERE 1=1
+        <if test="username != null and username != ''">
+            and o.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
+        </if>
+        <if test="module != null and module != ''">
+            and o.module = #{module,jdbcType=VARCHAR}
+        </if>
+        <if test="operationType != null and operationType != ''">
+            and o.operation_type = #{operationType,jdbcType=VARCHAR}
+        </if>
+        <if test="createTimeBegin != null and createTimeBegin != ''">
+            and DATE(o.create_time) &gt;= #{createTimeBegin}
+        </if>
+        <if test="createTimeEnd != null and createTimeBegin != ''">
+            and DATE(o.create_time) &lt;= #{createTimeEnd}
+        </if>
+        ORDER BY o.create_time DESC
+    </select>
+
     <select id="getSystemLogPageList" parameterType="api.common.pojo.param.log.LogPageParam" resultType="api.common.pojo.po.log.LogSystemPO">
         SELECT
           id,
@@ -96,11 +126,11 @@
         <if test="content != null and content != ''">
             and content like CONCAT('%',#{content,jdbcType=VARCHAR},'%')
         </if>
-        <if test="createTimeBegin != null">
-            and create_time &gt;= #{createTimeBegin,jdbcType=TIMESTAMP}
+        <if test="createTimeBegin != null and createTimeBegin != ''">
+            and DATE(create_time) &gt;= #{createTimeBegin}
         </if>
-        <if test="createTimeEnd != null">
-            and create_time &lt;= #{createTimeEnd,jdbcType=TIMESTAMP}
+        <if test="createTimeEnd != null and createTimeBegin != ''">
+            and DATE(create_time) &lt;= #{createTimeEnd}
         </if>
         ORDER BY create_time DESC
     </select>

+ 6 - 11
simulation-resource-server/src/main/resources/mapper/model/VehicleMapper.xml

@@ -7,9 +7,8 @@
         <result column="vehicle_code" property="vehicleCode" jdbcType="VARCHAR" />
         <result column="vehicle_name" property="vehicleName" jdbcType="VARCHAR" />
         <result column="description" property="description" jdbcType="VARCHAR" />
-        <result column="vehicle_type" property="vehicleType" jdbcType="VARCHAR" />
-        <result column="vehicle_model" property="vehicleModel" jdbcType="VARCHAR" />
-        <result column="vehicle_colour" property="vehicleColour" jdbcType="VARCHAR" />
+        <result column="vehicle_type" property="vehicleTypeStr" jdbcType="VARCHAR" />
+        <result column="model_label" property="modelLabel" jdbcType="VARCHAR" />
         <result column="max_speed" property="maxSpeed" jdbcType="DECIMAL" />
         <result column="engine_power" property="enginePower" jdbcType="DECIMAL" />
         <result column="max_deceleration" property="maxDeceleration" jdbcType="DECIMAL" />
@@ -59,8 +58,7 @@
             vehicle_name,
             description,
             vehicle_type,
-            vehicle_model,
-            vehicle_colour,
+            model_label,
             vehicle_front_view,
             vehicle_top_view,
             max_speed,
@@ -107,8 +105,7 @@
             vehicle_name,
             description,
             vehicle_type,
-            vehicle_model,
-            vehicle_colour,
+            model_label,
             vehicle_front_view,
             vehicle_top_view,
             max_speed,
@@ -141,8 +138,7 @@
             #{vehicleName,jdbcType=VARCHAR},
             #{description,jdbcType=VARCHAR},
             #{vehicleType,jdbcType=VARCHAR},
-            #{vehicleModel,jdbcType=VARCHAR},
-            #{vehicleColour,jdbcType=VARCHAR},
+            #{modelLabel,jdbcType=VARCHAR},
             #{vehicleFrontView,jdbcType=VARCHAR},
             #{vehicleTopView,jdbcType=VARCHAR},
             #{maxSpeed,jdbcType=DECIMAL},
@@ -176,8 +172,7 @@
             vehicle_name = #{vehicleName,jdbcType=VARCHAR},
             description = #{description,jdbcType=VARCHAR},
             vehicle_type = #{vehicleType,jdbcType=VARCHAR},
-            vehicle_model = #{vehicleModel,jdbcType=VARCHAR},
-            vehicle_colour = #{vehicleColour,jdbcType=VARCHAR},
+            model_label = #{modelLabel,jdbcType=VARCHAR},
             vehicle_front_view = #{vehicleFrontView,jdbcType=VARCHAR},
             vehicle_top_view = #{vehicleTopView,jdbcType=VARCHAR},
             max_speed = #{maxSpeed,jdbcType=DECIMAL},

+ 13 - 6
simulation-resource-server/src/main/resources/mapper/model/VehicleTempMapper.xml

@@ -8,6 +8,7 @@
             vehicle_code,
             vehicle_name,
             description,
+            model_label,
             vehicle_type,
             vehicle_model,
             vehicle_colour,
@@ -48,14 +49,18 @@
           vehicle_model,
           vehicle_colour,
           sort,
-          valid
+          valid,
+          create_time
         FROM model_vehicle_template
         WHERE is_deleted = '0'
-        <if test="vehicleCode != null and vehicleCode != ''">
-            and vehicle_code like CONCAT('%',#{vehicleCode,jdbcType=VARCHAR},'%')
+        <if test="vehicleType != null and vehicleType != ''">
+            and vehicle_type like CONCAT('%',#{vehicleType,jdbcType=VARCHAR},'%')
+        </if>
+        <if test="vehicleModel != null and vehicleModel != ''">
+            and vehicle_model like CONCAT('%',#{vehicleModel,jdbcType=VARCHAR},'%')
         </if>
-        <if test="vehicleName != null and vehicleName != ''">
-            and vehicle_name like CONCAT('%',#{vehicleName,jdbcType=VARCHAR},'%')
+        <if test="vehicleColour != null and vehicleColour != ''">
+            and vehicle_colour like CONCAT('%',#{vehicleColour,jdbcType=VARCHAR},'%')
         </if>
         <if test="modelLabel != null and modelLabel != ''">
             and model_label like CONCAT('%',#{modelLabel,jdbcType=VARCHAR},'%')
@@ -104,7 +109,9 @@
         from model_vehicle_template
         where is_deleted = '0'
           and id &lt;&gt; #{id,jdbcType=VARCHAR}
-          and vehicle_name = #{vehicleName,jdbcType=VARCHAR}
+          and vehicle_type = #{vehicleType,jdbcType=VARCHAR}
+          and vehicle_model = #{vehicleModel,jdbcType=VARCHAR}
+          and vehicle_colour = #{vehicleColour,jdbcType=VARCHAR}
     </select>
 
     <insert id="insert" parameterType="api.common.pojo.po.model.VehicleTempPO">

+ 6 - 0
simulation-resource-server/src/main/resources/mapper/project/SimulationProjectMapper.xml

@@ -358,6 +358,12 @@
         where natural_id = #{id,jdbcType=VARCHAR}
 
     </select>
+    <!--查询泛化场景信息-->
+    <select id="selectSceneGeneralDataById" parameterType="string" resultType="api.common.pojo.vo.project.SceneBaseInfoVo">
+        select scene_id
+        from scene_general_data
+        where id = #{id,jdbcType=VARCHAR}
+    </select>
     <!--查询标准法规场景信息-->
     <select id="selectSceneStandardsRegulations" parameterType="string" resultType="api.common.pojo.vo.project.SceneBaseInfoVo">
         select scene_name

+ 12 - 21
simulation-resource-server/src/main/resources/mapper/scene/SceneNaturalMapper.xml

@@ -386,24 +386,15 @@
         where is_deleted = '0' and natural_name =#{naturalName}
     </select>
 
-    <select id="querySceneNumBySy" parameterType="api.common.pojo.param.scene.SceneNaturalParam"
-            resultType="java.lang.Integer">
-      select count(id) from( select
-        natural_id id,share,create_user_id,is_deleted
-        from simulation.scene_natural union all select
-        accident_id id,share,create_user_id,is_deleted
-        from simulation.scene_accident  union all select
-        regulations_id id,share,create_user_id,is_deleted
-        from simulation.scene_standards_regulations ) a
-        <where>
-            is_deleted = '0'
-            <if test="createUserId != null and createUserId != ''">
-                and create_user_id=#{createUserId,jdbcType=VARCHAR}
-            </if>
-            <if test="share != null and share != ''">
-                and share=#{share,jdbcType=VARCHAR}
-            </if>
-        </where>
+    <select id="querySceneNumBySy" parameterType="api.common.pojo.param.scene.SceneNaturalParam" resultType="java.lang.Integer">
+      select SUM(num) from(
+        select COUNT(1) AS num from simulation.scene_natural WHERE is_deleted = '0'
+        union all
+        select COUNT(1) AS num from simulation.scene_accident WHERE is_deleted = '0'
+        union all
+        select COUNT(1) AS num from simulation.scene_standards_regulations WHERE is_deleted = '0'
+        union all
+        select COUNT(1) AS num from simulation.scene_general_template WHERE is_deleted = '0') a
     </select>
 
 
@@ -1686,7 +1677,7 @@
         FROM system_scene_package p
         JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
         JOIN system_scene_package_sublist s on p.id = s.scene_and_package
-        where scene_type='1' and  s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join scene_natural  zr on qx.scene_name=zr.natural_name) dd
+        where scene_type='1' and  s.is_deleted = '0' and user_id=#{po.userId} group by s.scene_name)qx join scene_natural  zr on qx.scene_name=zr.natural_name) dd
         <where>
             <if test="po.naturalName != null and po.naturalName != ''">
                 natural_name like CONCAT('%',#{po.naturalName,jdbcType=VARCHAR},'%')
@@ -1975,7 +1966,7 @@
         FROM system_scene_package p
         JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
         JOIN system_scene_package_sublist s on p.id = s.scene_and_package
-        where scene_type='1' and  s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join scene_natural  zr on qx.scene_name=zr.natural_name) ee
+        where scene_type='1' and  s.is_deleted = '0' and user_id=#{poBq.userId} group by s.scene_name)qx join scene_natural  zr on qx.scene_name=zr.natural_name) ee
         <where>
             <if test="poBq.naturalName != null and poBq.naturalName != ''">
                 or natural_name like CONCAT('%',#{poBq.naturalName,jdbcType=VARCHAR},'%')
@@ -2288,7 +2279,7 @@
         FROM system_scene_package p
         JOIN system_user_scene u on p.id = u.package_id and u.is_deleted = '0' and p.is_deleted = '0'
         JOIN system_scene_package_sublist s on p.id = s.scene_and_package
-        where scene_type='1' and  s.is_deleted = '0' and user_id=#{userId} group by s.scene_name)qx join scene_natural  zr on qx.scene_name=zr.natural_name) dd
+        where scene_type='1' and  s.is_deleted = '0' and user_id=#{poBq.userId} group by s.scene_name)qx join scene_natural  zr on qx.scene_name=zr.natural_name) dd
         <where>
             <if test="poBq.naturalName != null and poBq.naturalName != ''">
                 natural_name like CONCAT('%',#{poBq.naturalName,jdbcType=VARCHAR},'%')

+ 91 - 14
simulation-resource-server/src/main/resources/mapper/scene/SystemScenePackageMapper.xml

@@ -60,14 +60,14 @@
 
     <select id="queryPackageByUserIdList" parameterType="api.common.pojo.param.scene.SystemScenePackageParam"
             resultType="api.common.pojo.vo.scene.SystemScenePackageVO">
-        select a.*,GROUP_CONCAT(DISTINCT(p.package_name)) as package_name from (select u.id user_id,u.is_deleted  ,username userName, company,s.package_id,s.modify_time
+        select a.*,GROUP_CONCAT(DISTINCT(p.package_name)) as package_name from (select u.id user_id,s.is_deleted  ,username userName, company,s.package_id,s.modify_time
         from system_user  u left join system_user_scene s
-        on u.id=s.user_id and u.is_deleted = '0' and s.is_deleted = '0') a
-        left join system_scene_package p on a.package_id = p.id AND p.is_deleted = '0'
+        on u.id=s.user_id where u.is_deleted = '0'  and  u.role_code ='2') a
+        left join system_scene_package p on a.package_id = p.id AND p.is_deleted = '0' and a.is_deleted='0'
         <where>
-            a.is_deleted='0'
+            1=1
             <if test="userName != null and userName != ''">
-                and a.userName =#{userName,jdbcType=VARCHAR}
+                and a.userName  like  CONCAT('%',#{userName,jdbcType=VARCHAR},'%')
             </if>
             <if test="yearMax != null and yearMax != ''">
                 and #{yearMax,jdbcType=VARCHAR} &gt; a.modify_time and #{yearMin,jdbcType=VARCHAR} &lt; a.modify_time
@@ -127,16 +127,39 @@
         where id = #{id,jdbcType=VARCHAR}
     </update>
 
-    <select id="querySceneNum" parameterType="java.lang.String"
-            resultType="java.lang.Integer">
-           SELECT
-            COUNT(DISTINCT c.scene_name)
-        FROM
-            system_user_scene a
-        LEFT JOIN system_scene_package b ON a.package_id = b.id AND b.is_deleted = '0'
+    <select id="querySceneNum" parameterType="java.lang.String" resultType="java.lang.Integer">
+        SELECT SUM(num) FROM
+        (SELECT
+                COUNT(DISTINCT c.scene_name) AS num
+        FROM system_user_scene a
+        JOIN system_scene_package b ON a.package_id = b.id AND b.is_deleted = '0'
         JOIN system_scene_package_sublist c ON b.id = c.scene_and_package AND c.is_deleted = '0'
-        WHERE a.is_deleted = '0' and a.user_id =#{userId}
-
+        JOIN scene_natural d ON d.natural_name = c.scene_name AND d.is_deleted = '0'
+        WHERE a.user_id = #{userId}
+        UNION ALL
+        SELECT
+                COUNT(DISTINCT c.scene_name) AS num
+        FROM system_user_scene a
+        JOIN system_scene_package b ON a.package_id = b.id AND b.is_deleted = '0'
+        JOIN system_scene_package_sublist c ON b.id = c.scene_and_package AND c.is_deleted = '0'
+        JOIN scene_accident d ON d.scene_name = c.scene_name AND d.is_deleted = '0'
+        WHERE a.user_id = #{userId}
+        UNION ALL
+        SELECT
+                COUNT(DISTINCT c.scene_name) AS num
+        FROM system_user_scene a
+        JOIN system_scene_package b ON a.package_id = b.id AND b.is_deleted = '0'
+        JOIN system_scene_package_sublist c ON b.id = c.scene_and_package AND c.is_deleted = '0'
+        JOIN scene_standards_regulations d ON d.scene_name = c.scene_name AND d.is_deleted = '0'
+        WHERE a.user_id = #{userId}
+        UNION ALL
+        SELECT
+                COUNT(DISTINCT c.scene_name) AS num
+        FROM system_user_scene a
+        JOIN system_scene_package b ON a.package_id = b.id AND b.is_deleted = '0'
+        JOIN system_scene_package_sublist c ON b.id = c.scene_and_package AND c.is_deleted = '0'
+        JOIN scene_general_template d ON d.scene_id = c.scene_name AND d.is_deleted = '0'
+        WHERE a.user_id = #{userId}) AS t
     </select>
 
 
@@ -177,4 +200,58 @@
         </where>
         group by c.scene_type
     </select>
+
+
+    <select id="querySceneNaturalListByTJ" parameterType="api.common.pojo.param.scene.SystemScenePackageParam"
+            resultType="java.lang.String">
+        select DISTINCT(a.scene_name) scene_name
+        FROM system_scene_package_sublist a join  scene_natural s on a.scene_name=s.natural_name join system_scene_package b on a.scene_and_package=b.id
+        where
+            a.is_deleted='0' and s.is_deleted='0' and b.is_deleted='0' and a.scene_type='1'
+        and b.package_name in
+        <foreach collection="packageNames" item="item" index="index"
+                 separator="," open="(" close=")">
+            #{item}
+        </foreach>
+
+    </select>
+    <select id="querySceneStandardsRegulationsListByTJ" parameterType="api.common.pojo.param.scene.SystemScenePackageParam"
+            resultType="java.lang.String">
+        select DISTINCT(a.scene_name) scene_name
+        FROM system_scene_package_sublist a join  scene_standards_regulations s on a.scene_name=s.scene_name join system_scene_package b on a.scene_and_package=b.id
+        where
+        a.is_deleted='0' and s.is_deleted='0' and b.is_deleted='0' and a.scene_type='2'
+        and b.package_name in
+        <foreach collection="packageNames" item="item" index="index"
+                 separator="," open="(" close=")">
+            #{item}
+        </foreach>
+    </select>
+
+    <select id="querySceneAccidentListByTJ" parameterType="api.common.pojo.param.scene.SystemScenePackageParam"
+            resultType="java.lang.String">
+        select DISTINCT(a.scene_name) scene_name
+        FROM system_scene_package_sublist a join  scene_accident s on a.scene_name=s.scene_name join system_scene_package b on a.scene_and_package=b.id
+        where
+        a.is_deleted='0' and s.is_deleted='0' and b.is_deleted='0' and a.scene_type='3'
+        and b.package_name in
+        <foreach collection="packageNames" item="item" index="index"
+                 separator="," open="(" close=")">
+            #{item}
+        </foreach>
+    </select>
+
+    <select id="querySceneGeneralTemplateListByTJ" parameterType="api.common.pojo.param.scene.SystemScenePackageParam"
+            resultType="java.lang.String">
+        select DISTINCT(a.scene_name) scene_name
+        FROM system_scene_package_sublist a join  scene_general_template s on a.scene_name=s.scene_id join system_scene_package b on a.scene_and_package=b.id
+        where
+        a.is_deleted='0' and s.is_deleted='0' and b.is_deleted='0' and a.scene_type='4'
+        and b.package_name in
+        <foreach collection="packageNames" item="item" index="index"
+                 separator="," open="(" close=")">
+            #{item}
+        </foreach>
+    </select>
+
 </mapper>

+ 24 - 4
simulation-resource-server/src/main/resources/mapper/scene/SystemScenePackageSublistMapper.xml

@@ -15,11 +15,31 @@
 
 
 
-    <select id="querySystemScenePackageSublistList" parameterType="api.common.pojo.po.scene.SystemScenePackageSublistPO"
+    <select id="querySceneNaturalList" parameterType="api.common.pojo.po.scene.SystemScenePackageSublistPO"
             resultType="java.lang.String">
-        select scene_name
-        FROM system_scene_package_sublist where
-            is_deleted='0' and scene_and_package =#{sceneAndPackage} and scene_type =#{sceneType}
+        select  DISTINCT(a.scene_name) scene_name
+        FROM system_scene_package_sublist a join  scene_natural s on a.scene_name=s.natural_name where
+            a.is_deleted='0' and s.is_deleted='0' and a.scene_and_package =#{sceneAndPackage} and a.scene_type =#{sceneType}
+    </select>
+    <select id="querySceneStandardsRegulationsList" parameterType="api.common.pojo.po.scene.SystemScenePackageSublistPO"
+            resultType="java.lang.String">
+        select  DISTINCT(a.scene_name) scene_name
+        FROM system_scene_package_sublist a join  scene_standards_regulations s on a.scene_name=s.scene_name where
+            a.is_deleted='0' and s.is_deleted='0' and a.scene_and_package =#{sceneAndPackage} and a.scene_type =#{sceneType}
+    </select>
+
+    <select id="querySceneAccidentList" parameterType="api.common.pojo.po.scene.SystemScenePackageSublistPO"
+            resultType="java.lang.String">
+        select  DISTINCT(a.scene_name) scene_name
+        FROM system_scene_package_sublist a join  scene_accident s on a.scene_name=s.scene_name where
+            a.is_deleted='0' and s.is_deleted='0' and a.scene_and_package =#{sceneAndPackage} and a.scene_type =#{sceneType}
+    </select>
+
+    <select id="querySceneGeneralTemplateList" parameterType="api.common.pojo.po.scene.SystemScenePackageSublistPO"
+            resultType="java.lang.String">
+        select  DISTINCT(a.scene_name) scene_name
+        FROM system_scene_package_sublist a join  scene_general_template s on a.scene_name=s.scene_id where
+            a.is_deleted='0' and s.is_deleted='0' and a.scene_and_package =#{sceneAndPackage} and a.scene_type =#{sceneType}
     </select>
 
     <update id="deleteSystemScenePackageSublist" parameterType="api.common.pojo.po.scene.SystemScenePackageSublistPO">

+ 30 - 23
simulation-resource-server/src/main/resources/mapper/system/ClusterMapper.xml

@@ -102,42 +102,49 @@
 
     <!--查询已分配未到期节点数量-->
     <select id="getClusterNum" parameterType="api.common.pojo.param.system.ClusterParam" resultType="java.util.HashMap">
+
         select
-        (
-        select
-        sum(p.num_simulation_license)
-        from system_user u
-        left join system_cluster p on u.id = p.user_id
-        <where>
-            u.is_deleted = '0' and u.visible = '1' and p.is_deleted = '0'
-            and DATE(p.date_simulation_license) >= DATE(NOW())
-            and u.role_code = #{roleCode,jdbcType=VARCHAR}
-        </where>
-        <if test="createUserId != null and createUserId != ''">
-            and u.create_user_id = #{createUserId,jdbcType=VARCHAR}
-        </if>
-        ) as totalSimulation, (
-        select
-        sum(p.num_dynamic_license)
+          IFNULL(SUM(IF(DATE(p.date_simulation_license) >= DATE(NOW()),p.num_simulation_license,0)),0) as totalSimulation,
+          IFNULL(SUM(IF(DATE(p.date_dynamic_license) >= DATE(NOW()),p.num_dynamic_license,0)),0) as totalDynamic
         from system_user u
         left join system_cluster p on u.id = p.user_id
-        <where>
-            u.is_deleted = '0' and u.visible = '1'  and p.is_deleted = '0'
-            and DATE(p.date_dynamic_license) >= DATE(NOW())
-            and u.role_code = #{roleCode,jdbcType=VARCHAR}
-        </where>
+        where u.is_deleted = '0' and p.is_deleted = '0' and u.role_code = #{roleCode,jdbcType=VARCHAR}
         <if test="createUserId != null and createUserId != ''">
             and u.create_user_id = #{createUserId,jdbcType=VARCHAR}
         </if>
-        ) as totalDynamic
     </select>
 
-    <select id="getLicenseNum" parameterType="java.lang.String" resultType="java.lang.Integer">
+    <!--查询根据userId未到期的仿真软件license数量-->
+    <select id="getSimulationLicenseNum" parameterType="java.lang.String" resultType="java.lang.Integer">
         select num_simulation_license from system_cluster
         where is_deleted = '0' and DATE(date_simulation_license) >= DATE(NOW()) and user_id = #{userId,jdbcType=VARCHAR}
     </select>
+
+    <!--查询根据userId未到期的动力学软件license数量-->
+    <select id="getDynamicLicenseNum" resultType="java.lang.Integer">
+        select num_dynamic_license from system_cluster
+        where is_deleted = '0' and DATE(date_dynamic_license) >= DATE(NOW()) and user_id = #{userId,jdbcType=VARCHAR}
+    </select>
+
+
     <select id="getClusterByUserId" parameterType="java.lang.String" resultType="api.common.pojo.vo.system.ClusterVO">
         select num_simulation_license, date_simulation_license, num_dynamic_license, date_dynamic_license from system_cluster
         where is_deleted = '0' and user_id = #{userId,jdbcType=VARCHAR}
     </select>
+
+    <select id="getAssignedSimLicenseNum" parameterType="api.common.pojo.param.system.ClusterParam" resultType="java.lang.Integer">
+        select SUM(num_simulation_license) as AssignedSimLicenseNum from system_cluster
+        where is_deleted = '0' and DATE(date_simulation_license) >= DATE(NOW()) and create_user_id = #{createUserId,jdbcType=VARCHAR}
+        <if test="userId != null and userId != ''">
+            and  user_id != #{userId,jdbcType=VARCHAR}
+        </if>
+    </select>
+    <select id="getAssignedDynLicenseNum" parameterType="api.common.pojo.param.system.ClusterParam" resultType="java.lang.Integer">
+        select SUM(num_dynamic_license) as AssignedDynLicenseNum from system_cluster
+        where is_deleted = '0' and DATE(date_dynamic_license) >= DATE(NOW()) and create_user_id = #{createUserId,jdbcType=VARCHAR}
+        <if test="userId != null and userId != ''">
+            and  user_id != #{userId,jdbcType=VARCHAR}
+        </if>
+    </select>
+
 </mapper>

+ 3 - 2
simulation-resource-server/src/main/resources/mapper/system/SceneImportMapper.xml

@@ -64,8 +64,9 @@
                 success_num = #{successNum},
                 error_message = #{errorMessage},
                 modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
-                total_time = TIMESTAMPDIFF(SECOND,create_time,#{modifyTime}),
-                modify_time=#{modifyTime}
+                 modify_time=#{modifyTime},
+                total_time = TIMESTAMPDIFF(SECOND,create_time,modify_time)
+
         where id = #{id,jdbcType=VARCHAR}
     </update>
 

+ 4 - 1
simulation-resource-server/src/main/resources/mapper/system/UserMapper.xml

@@ -190,5 +190,8 @@
         where id = #{id,jdbcType=VARCHAR}
     </update>
 
-
+    <select id="getSubUser" parameterType="java.lang.String" resultType="api.common.pojo.po.system.UserPO">
+        select * from system_user
+        where is_deleted = '0' AND create_user_id = #{createUserId,jdbcType=VARCHAR};
+    </select>
 </mapper>

+ 103 - 0
simulation-resource-server/src/main/resources/simulation.sql

@@ -0,0 +1,103 @@
+-- ####### 升级部署执行 SQL 文件,迭代更新
+-- 2022-07-07
+
+DROP TABLE IF EXISTS `relation_user_scene`;
+
+ALTER TABLE model_vehicle ADD COLUMN model_label varchar(100) DEFAULT NULL COMMENT '模型标识' AFTER description;
+
+ALTER TABLE model_vehicle_template ADD COLUMN model_label varchar(100) DEFAULT NULL COMMENT '模型标识' AFTER description;
+
+UPDATE model_vehicle_template SET model_label = CONCAT(vehicle_type,'_',vehicle_model,'_',vehicle_colour);
+
+UPDATE model_vehicle v SET v.model_label = (SELECT m.model_label FROM model_vehicle_template m WHERE v.vehicle_type = m.vehicle_type);
+
+UPDATE model_vehicle SET vehicle_type = CONCAT(vehicle_type,',',vehicle_model,',',vehicle_colour);
+
+ALTER TABLE algorithm ADD COLUMN git_version varchar(128) DEFAULT NULL COMMENT 'git算法版本号' AFTER docker_image;
+
+
+DROP TABLE IF EXISTS `simulation_automatic_project`;
+CREATE TABLE `simulation_automatic_project` (
+`id`  varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'id' ,
+`project_date`  int(10) NULL DEFAULT NULL COMMENT '项目日期' ,
+`project_num`  int(10) NULL DEFAULT NULL COMMENT '项目序号' ,
+`project_id`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目id' ,
+`project_name`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目名称' ,
+`project_describe`  varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目描述' ,
+`algorithm`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '算法 id' ,
+`algorithm_type`  varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '算法类型' ,
+`vehicle`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '车辆模型 id' ,
+`scene`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '场景测试包 id' ,
+`operation_cycle`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '运行周期' ,
+`parallelism`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '并行度' ,
+`rule_view`  varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '规则查看' ,
+`max_simulation_time`  bigint(15) NULL DEFAULT NULL COMMENT '最大仿真时间,单位秒' ,
+`is_choice_gpu`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否选择gpu(0:是,1:否)' ,
+`automatic_run_times`  bigint(15) NULL DEFAULT NULL COMMENT '自动运行次数' ,
+`last_run_time`  datetime NULL DEFAULT NULL COMMENT '最近运行时间' ,
+`automatic_run_state`  varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '自动运行状态(0:开启,1:关闭)' ,
+`create_time`  datetime NULL DEFAULT NULL ,
+`create_user_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' ,
+`modify_time`  datetime NULL DEFAULT NULL ,
+`modify_user_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
+`is_deleted`  varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
+PRIMARY KEY (`id`)
+)
+ENGINE=InnoDB
+DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
+COMMENT='自动运行项目表';
+
+DROP TABLE IF EXISTS `simulation_automatic_subproject`;
+CREATE TABLE `simulation_automatic_subproject` (
+`id`  varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'id' ,
+`parent_id`  varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '主项目表id' ,
+`parent_project_id`  varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '主项目表项目id' ,
+`project_date`  int(10) NULL DEFAULT NULL COMMENT '项目日期' ,
+`project_num`  int(10) NULL DEFAULT NULL COMMENT '项目序号' ,
+`project_id`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目id' ,
+`project_name`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目名称' ,
+`now_run_state`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前运行状态(10:未执行,20:执行中,30:执行完成,40:已中止)' ,
+`evaluation_level`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '评测等级(G,A,M,P)' ,
+`start_time`  datetime NULL DEFAULT NULL COMMENT '开始时间' ,
+`finish_time`  datetime NULL DEFAULT NULL COMMENT '完成时间' ,
+`algorithm_score`  double NULL DEFAULT NULL COMMENT '算法得分' ,
+`task_number`  int(11) NULL DEFAULT NULL COMMENT '任务数量' ,
+`task_completed`  int(11) NULL DEFAULT NULL COMMENT '\'Aborted\', \'PendingAnalysis\', \'Terminated\'任务个数' ,
+`create_time`  datetime NULL DEFAULT NULL ,
+`create_user_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' ,
+`modify_time`  datetime NULL DEFAULT NULL ,
+`modify_user_id`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
+`is_deleted`  varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
+PRIMARY KEY (`id`)
+)
+ENGINE=InnoDB
+DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
+COMMENT='自动运行子项目子表';
+
+ALTER TABLE system_menu ADD COLUMN icon varchar(50) DEFAULT NULL COMMENT '图标' AFTER router;
+
+DROP TABLE IF EXISTS `system_parameter`;
+CREATE TABLE `system_parameter` (
+`id`  varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '参数id' ,
+`user_id`  varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '账户id' ,
+`num_create_user`  int(32) NULL DEFAULT NULL COMMENT '可创建子账户数量' ,
+`num_create_scene_package`  int(32) NULL DEFAULT NULL COMMENT '最多可创建场景测试包数量' ,
+`num_scene_per_package`  int(32) NULL DEFAULT NULL COMMENT '场景测试包最大场景数量' ,
+`create_time`  datetime NULL DEFAULT NULL ,
+`modify_time`  datetime NULL DEFAULT NULL ,
+`create_user_id`  varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
+`modify_user_id`  varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
+`is_deleted`  varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
+PRIMARY KEY (`id`)
+)
+ENGINE=InnoDB
+DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci;
+
+
+ALTER TABLE system_role ADD COLUMN sort int(11) DEFAULT NULL COMMENT '排序号' AFTER visible;
+
+INSERT INTO `system_user` (`id`, `username`, `password`, `nickname`, `photo`, `phone`, `company`, `role_code`, `use_type`, `visible`, `openid`, `create_time`, `modify_time`, `create_user_id`, `modify_user_id`, `is_deleted`) VALUES ('510f29c5af754429a7a2a02f8275e506', 'sysadmin', 'e10adc3949ba59abbe56e057f20f883e', '超级管理员', NULL, '12345678912', '国汽', '0', '1', '1', NULL, '2022-5-16 10:19:46', '2022-6-13 10:01:42', '510f29c5af754429a7a2a02f8275e506', '510f29c5af754429a7a2a02f8275e506', '0');
+INSERT INTO `system_user` (`id`, `username`, `password`, `nickname`, `photo`, `phone`, `company`, `role_code`, `use_type`, `visible`, `openid`, `create_time`, `modify_time`, `create_user_id`, `modify_user_id`, `is_deleted`) VALUES ('545d4914865d4a3cb6398fc25ffbc1b5', 'admin', 'e10adc3949ba59abbe56e057f20f883e', '子管理员', NULL, '090-00000000', '国汽', '1', '1', '1', '', '2022-5-10 10:36:11', '2022-7-6 15:11:40', '510f29c5af754429a7a2a02f8275e506', '545d4914865d4a3cb6398fc25ffbc1b5', '0');
+INSERT INTO `system_user` (`id`, `username`, `password`, `nickname`, `photo`, `phone`, `company`, `role_code`, `use_type`, `visible`, `openid`, `create_time`, `modify_time`, `create_user_id`, `modify_user_id`, `is_deleted`) VALUES ('aaaaaaaaaabbbbbbbbbbcccccccc1001', '1001', 'e10adc3949ba59abbe56e057f20f883e', '索为普通用户1', NULL, '112', '国汽', '2', '1', '1', '', '2022-6-15 16:05:53', '2022-6-22 17:15:14', '510f29c5af754429a7a2a02f8275e506', 'aaaaaaaaaabbbbbbbbbbcccccccc1001', '0');
+
+