LingxinMeng 1 år sedan
förälder
incheckning
75bb49678e

+ 93 - 1
api-common/src/main/java/api/common/pojo/vo/system/MenuVO.java

@@ -7,7 +7,6 @@ import lombok.Data;
 
 import java.util.List;
 
-@Data
 public class MenuVO {
 
     //主键
@@ -28,4 +27,97 @@ public class MenuVO {
     private String visible;
     @WChildren
     private List<MenuVO> children;
+
+
+    public MenuVO() {
+    }
+
+    public MenuVO(String id, String name, String router, String icon, int sort, String parentId, String visible, List<MenuVO> children) {
+        this.id = id;
+        this.name = name;
+        this.router = router;
+        this.icon = icon;
+        this.sort = sort;
+        this.parentId = parentId;
+        this.visible = visible;
+        this.children = children;
+    }
+
+    @Override
+    public String toString() {
+        return "MenuVO{" +
+                "id='" + id + '\'' +
+                ", name='" + name + '\'' +
+                ", router='" + router + '\'' +
+                ", icon='" + icon + '\'' +
+                ", sort=" + sort +
+                ", parentId='" + parentId + '\'' +
+                ", visible='" + visible + '\'' +
+                ", children=" + children +
+                '}';
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getRouter() {
+        return router;
+    }
+
+    public void setRouter(String router) {
+        this.router = router;
+    }
+
+    public String getIcon() {
+        return icon;
+    }
+
+    public void setIcon(String icon) {
+        this.icon = icon;
+    }
+
+    public int getSort() {
+        return sort;
+    }
+
+    public void setSort(int sort) {
+        this.sort = sort;
+    }
+
+    public String getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(String parentId) {
+        this.parentId = parentId;
+    }
+
+    public String getVisible() {
+        return visible;
+    }
+
+    public void setVisible(String visible) {
+        this.visible = visible;
+    }
+
+    public List<MenuVO> getChildren() {
+        return children;
+    }
+
+    public void setChildren(List<MenuVO> children) {
+        this.children = children;
+    }
 }

+ 2 - 4
api-common/src/main/java/api/common/util/ObjectUtil.java

@@ -265,7 +265,6 @@ public class ObjectUtil {
     /**
      * list转tree递归调用
      */
-    @SuppressWarnings("all")
     private static <T, String> T findChildren(T parent, List<T> list, Function<T, String> getId, Function<T, String> getPid, Function<T, List<T>> getChildren, BiConsumer<T, List<T>> setChildren) {
         for (T node : list)
             if (getId.apply(parent).equals(getPid.apply(node))) {
@@ -287,10 +286,9 @@ public class ObjectUtil {
         return listToTree(list, "0");
     }
 
-    @SuppressWarnings("all")
     public static <T> List<T> listToTree(List<T> list, String root) {
         try {
-            List<T> treeList = new LinkedList<T>();
+            List<T> treeList = new LinkedList<>();
             Class<?> tClass = null;
             for (T t : list) {
                 tClass = t.getClass();
@@ -321,7 +319,7 @@ public class ObjectUtil {
             }
             //解析列表
             for (T node : list) {
-                if (root.equals((String) getParentId.invoke(node))) {
+                if (root.equals(getParentId.invoke(node))) {
                     treeList.add(findChildren(node, list, getId, getParentId, getChildren, setChildren));
                 }
             }

+ 5 - 1
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/domain/service/TaskDomainService.java

@@ -164,7 +164,11 @@ public class TaskDomainService {
                             runResultFilePath + "/output_roadMark.csv",
                             runResultFilePath + "/output_roadPos.csv",
                             runResultFilePath + "/output_trafficSignal.csv",
-                            runResultFilePath + "/output_trafficLight.csv"
+                            runResultFilePath + "/output_trafficLight.csv",
+                            runResultFilePath + "/output_trafficLight.csv",
+                            runResultFilePath + "/output_driverCtrl.csv",
+                            runResultFilePath + "/trajectory.txt"
+
                     );
                     for (String csvResultFileMinioPath : csvResultFilePaths) {
                         String csvResultFileLinuxPath = linuxTempPath + csvResultFileMinioPath;

+ 7 - 8
simulation-resource-server/src/main/java/com/css/simulation/resource/server/adapter/controller/MenuController.java

@@ -7,26 +7,26 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
 
 /**
  * 菜单管理
  */
-@Controller
+@RestController
 @RequestMapping("/menu")
 public class MenuController {
 
     @Autowired
-    MenuService menuService;
+    private MenuService menuService;
 
     /**
      * 获取所有菜单树
      */
     @RequestMapping("/getMenuTree")
-    @ResponseBody
-    public ResponseBodyVO getMenuTree() {
-        ResponseBodyVO<List<MenuVO>> response = new ResponseBodyVO<List<MenuVO>>(ResponseBodyVO.Response.SUCCESS);
+    public ResponseBodyVO<List<MenuVO>> getMenuTree() {
+        ResponseBodyVO<List<MenuVO>> response = new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);
         response.setInfo(menuService.getMenuTree());
         return response;
     }
@@ -35,9 +35,8 @@ public class MenuController {
      * 获取当前登录人的菜单列表
      */
     @RequestMapping("/getMyMenuTree")
-    @ResponseBody
-    public ResponseBodyVO getMyMenuTree() {
-        ResponseBodyVO<List<MenuVO>> response = new ResponseBodyVO<List<MenuVO>>(ResponseBodyVO.Response.SUCCESS);
+    public ResponseBodyVO<List<MenuVO>> getMyMenuTree() {
+        ResponseBodyVO<List<MenuVO>> response = new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);
         response.setInfo(menuService.getMyMenuTree());
         return response;
     }

+ 8 - 4
simulation-resource-server/src/main/java/com/css/simulation/resource/server/app/service/MenuService.java

@@ -4,28 +4,32 @@ import api.common.pojo.vo.system.MenuVO;
 import api.common.util.ObjectUtil;
 import com.css.simulation.resource.server.infra.util.AuthUtil;
 import com.css.simulation.resource.server.infra.db.mysql.mapper.MenuMapper;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
 
 @Service
+@Slf4j
 public class MenuService {
 
     @Autowired
-    MenuMapper menuMapper;
+    private MenuMapper menuMapper;
 
     public List<MenuVO> getMenuTree() {
         List<MenuVO> menus = menuMapper.getMenuTree();
         //List<MenuVO> treeList = ObjectUtil.listToTree(menus, "0", MenuVO::getId, MenuVO::getParentId, MenuVO::getChildren, MenuVO::setChildren);
-        List<MenuVO> menuVOS = ObjectUtil.listToTree(menus);//注解方式转tree
-        return menuVOS;
+        return ObjectUtil.listToTree(menus);
     }
 
     public List<MenuVO> getMyMenuTree() {
         String roleCode = AuthUtil.getCurrentUserRoleCode();
+        log.info("当前用户角色为:" + roleCode);
         List<MenuVO> menus = menuMapper.getMyMenuTree(roleCode);
-        List<MenuVO> menuVOS = ObjectUtil.listToTree(menus);//注解方式转tree
+        log.info("当前用户菜单为:" + menus);
+        List<MenuVO> menuVOS = ObjectUtil.listToTree(menus);
+        log.info("当前用户菜单树为:" + menuVOS);
         return menuVOS;
     }
 }

+ 21 - 17
simulation-resource-server/src/main/java/com/css/simulation/resource/server/infra/db/mysql/mapper/SimulationManualProjectTaskMapper.java

@@ -81,23 +81,27 @@ public interface SimulationManualProjectTaskMapper {
             "  and p_id = #{id}\n")
     List<String> selectRunResultPathByProjectId(SimulationManualProjectParam simulationManualProjectParam);
 
-    @Select("select run_result_file_path from simulation_manual_project_task where p_id = 'a6c502fcb3994788910bac9d352f908f' and scene_id = (select CASE\n" +
-            "                                                                                                                                           WHEN scene_natural_ids IS NOT NULL AND scene_natural_ids <> ''\n" +
-            "                                                                                                                                               THEN scene_natural_ids\n" +
-            "                                                                                                                                           WHEN scene_traffic_ids IS NOT NULL AND scene_traffic_ids <> ''\n" +
-            "                                                                                                                                               THEN scene_traffic_ids\n" +
-            "                                                                                                                                           WHEN scene_statue_ids IS NOT NULL AND scene_statue_ids <> ''\n" +
-            "                                                                                                                                               THEN scene_statue_ids\n" +
-            "                                                                                                                                           WHEN scene_generalization_ids IS NOT NULL AND scene_generalization_ids <> ''\n" +
-            "                                                                                                                                               THEN scene_generalization_ids\n" +
-            "                                                                                                                                           END AS scene_id\n" +
-            "                                                                                                                                from scene_package_sublist\n" +
-            "                                                                                                                                where\n" +
-            "                                                                                                                                    root_id =\n" +
-            "                                                                                                                                    (select scene\n" +
-            "                                                                                                                                     from simulation_manual_project\n" +
-            "                                                                                                                                     where id = #{id})\n" +
-            "                                                                                                                                  and sublist_name like '%B%')")
+    @Select("select run_result_file_path\n" +
+            "from simulation_manual_project_task\n" +
+            "where p_id = #{id}\n" +
+            "  and scene_id = (select CASE\n" +
+            "                             WHEN scene_natural_ids IS NOT NULL AND scene_natural_ids <> ''\n" +
+            "                                 THEN scene_natural_ids\n" +
+            "                             WHEN scene_traffic_ids IS NOT NULL AND scene_traffic_ids <> ''\n" +
+            "                                 THEN scene_traffic_ids\n" +
+            "                             WHEN scene_statue_ids IS NOT NULL AND scene_statue_ids <> ''\n" +
+            "                                 THEN scene_statue_ids\n" +
+            "                             WHEN scene_generalization_ids IS NOT NULL AND scene_generalization_ids <> ''\n" +
+            "                                 THEN scene_generalization_ids\n" +
+            "                             END AS scene_id\n" +
+            "                  from scene_package_sublist t2\n" +
+            "                  where t2.is_deleted = 0\n" +
+            "                    and root_id =\n" +
+            "                        (select scene\n" +
+            "                         from simulation_manual_project t1\n" +
+            "                         where id = #{id}\n" +
+            "                           and t1.is_deleted = 0)\n" +
+            "                    and (sublist_name like '%B%' or sublist_name like '%A%'))")
     List<String> selectRunResultPathByProjectIdV202403(SimulationManualProjectParam simulationManualProjectParam);