root 2 éve
szülő
commit
dd3db66f40

+ 1 - 1
simulation-resource-server/src/main/java/com/css/simulation/resource/algorithm/service/AlgorithmService.java

@@ -29,5 +29,5 @@ public interface AlgorithmService {
 
     String getGitVersion(String algorithmId);
 
-    Map<String,Integer> selectDetailsBySy();
+    Map<String,String> selectDetailsBySy();
 }

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

@@ -401,7 +401,7 @@ public class AlgorithmServiceImpl implements AlgorithmService {
     }
 
     @Override
-    public Map selectDetailsBySy() {
+    public Map<String, String> selectDetailsBySy() {
         AlgorithmParameter param = new AlgorithmParameter();
         param.setUploadMode("1");
         param.setShare("0");
@@ -409,9 +409,9 @@ public class AlgorithmServiceImpl implements AlgorithmService {
         int fileNum = algorithmMapper.selectDetailsBySy(param);
         param.setUploadMode("2");
         int pathNum = algorithmMapper.selectDetailsBySy(param);
-        Map map = new HashMap();
-        map.put("fileNum", fileNum);
-        map.put("pathNum", pathNum);
+        Map<String, String> map = new HashMap<>();
+        map.put("fileNum", fileNum + "");
+        map.put("pathNum", pathNum + "");
         return map;
     }
 

+ 10 - 18
simulation-resource-server/src/main/java/com/css/simulation/resource/home/ctrl/HomePageCtrl.java

@@ -17,7 +17,6 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
@@ -47,14 +46,16 @@ public class HomePageCtrl {
      * 首页 -- 系统监控 -- 数据概览
      */
     @PostMapping("/queryAllNum")
-    @ResponseBody
-    public ResponseBodyVO<Map<String, Integer>> queryAllNum() {
-        Map<String, Integer> map = algorithmService.selectDetailsBySy();     //算法文件数量
-        map.put("SySceneNum", sceneNaturalService.querySceneNumBySy());//私有场景数量
-        map.put("GySceneNum", sceneNaturalService.querySceneNumByGy());//共有场景数量
-        map.put("ConfigTotal", configService.getConfigTotal());             //车辆配置数量
-        map.put("maxConcurrency", clusterService.getLicenseNum());          //最大并发数量
-        map.put("currentConcurrency", homePageService.getRunningTask());    //当前并发数量
+    public ResponseBodyVO<Map<String, String>> queryAllNum() {
+        Map<String, String> map = algorithmService.selectDetailsBySy();     //算法文件数量
+        map.put("SySceneNum", sceneNaturalService.querySceneNumBySy() + "");//私有场景数量
+        map.put("GySceneNum", sceneNaturalService.querySceneNumByGy() + "");//共有场景数量
+        map.put("ConfigTotal", configService.getConfigTotal() + "");             //车辆配置数量
+        final int licenseNum = clusterService.getLicenseNum();
+        if (licenseNum == -1) {
+            map.put("maxConcurrency", "无限");          //最大并发数量
+        }
+        map.put("currentConcurrency", homePageService.getRunningTask() + "");    //当前并发数量
         return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, map);
     }
 
@@ -62,7 +63,6 @@ public class HomePageCtrl {
      * 近一周运行运行项目数量
      */
     @RequestMapping("selectRunProjectBySy")
-    @ResponseBody
     public ResponseBodyVO<List<LineChartVO>> selectRunProjectBySy() {
         List<LineChartVO> list = homePageService.selectRunProjectChart();
         return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, list);
@@ -72,7 +72,6 @@ public class HomePageCtrl {
      * 近一周运行任务数量
      */
     @RequestMapping("selectRunTaskBySy")
-    @ResponseBody
     public ResponseBodyVO<List<LineChartVO>> selectRunTaskBySy() {
         List<LineChartVO> list = homePageService.selectRunTaskChart();
         return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS, list);
@@ -83,7 +82,6 @@ public class HomePageCtrl {
      * 项目运行状态统计-饼图
      */
     @RequestMapping("selectRunProjectByState")
-    @ResponseBody
     public ResponseBodyVO selectRunProjectByState() {
         return simulationProjectService.selectRunProjectByState();
     }
@@ -92,7 +90,6 @@ public class HomePageCtrl {
      * 任务运行状态统计-饼图
      */
     @RequestMapping("selectRunTaskByState")
-    @ResponseBody
     public ResponseBodyVO selectRunTaskByState() {
         return simulationProjectService.selectRunTaskByState();
     }
@@ -102,7 +99,6 @@ public class HomePageCtrl {
      * 评测等级分布-饼图
      */
     @RequestMapping("selectEvaluationLevel")
-    @ResponseBody
     public ResponseBodyVO selectEvaluationLevel() {
         return simulationProjectService.selectEvaluationLevel();
     }
@@ -112,7 +108,6 @@ public class HomePageCtrl {
      * 硬件监控
      */
     @RequestMapping("selectHardware")
-    @ResponseBody
     @PreAuthorize("@AuthorityCheck.admin()")
     public ResponseBodyVO<HardwareVO> selectHardware() {
         return homePageService.selectHardware();
@@ -122,7 +117,6 @@ public class HomePageCtrl {
      * 服务监控
      */
     @RequestMapping("selectService")
-    @ResponseBody
     @PreAuthorize("@AuthorityCheck.admin()")
     public ResponseBodyVO<ServiceVO> selectService() {
         return homePageService.selectService();
@@ -132,7 +126,6 @@ public class HomePageCtrl {
      * 日访问人数
      */
     @RequestMapping("selectAccess")
-    @ResponseBody
     @PreAuthorize("@AuthorityCheck.admin()")
     public ResponseBodyVO<List<LineChartVO>> selectAccess() {
         List<LineChartVO> list = homePageService.selectAccess();
@@ -144,7 +137,6 @@ public class HomePageCtrl {
      * 服务器监控
      */
     @RequestMapping("selectServer")
-    @ResponseBody
     @PreAuthorize("@AuthorityCheck.admin()")
     public ResponseBodyVO<PageInfo<SystemServerVO>> selectServer(PageVO pageVO) {
         return homePageService.selectServer(pageVO);