From 3ce3aec59dfa9f5981d3cee7a95e2e636456feb1 Mon Sep 17 00:00:00 2001 From: guyuliang Date: Sat, 24 Aug 2024 18:28:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=9F=A5=E8=AF=A2=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ams/service/module/impl/ModuleServiceImpl.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bocloud.ams.service/src/main/java/com/bocloud/ams/service/module/impl/ModuleServiceImpl.java b/bocloud.ams.service/src/main/java/com/bocloud/ams/service/module/impl/ModuleServiceImpl.java index a343ce5..2df4d5a 100644 --- a/bocloud.ams.service/src/main/java/com/bocloud/ams/service/module/impl/ModuleServiceImpl.java +++ b/bocloud.ams.service/src/main/java/com/bocloud/ams/service/module/impl/ModuleServiceImpl.java @@ -430,7 +430,7 @@ public class ModuleServiceImpl implements ModuleService { List nameList = Arrays.asList("网络设备", "物理服务器", "安全设备"); //查询根节点 List rootGroups = moduleGroupRepository.queryRootInName(nameList); - log.info("moduleGroups:{}", JSON.toJSONString("moduleGroups")); + log.info("moduleGroups:{}", JSON.toJSONString(rootGroups)); //查询出所有根节点下的子节点 @@ -452,11 +452,16 @@ public class ModuleServiceImpl implements ModuleService { param.setSign(Sign.EQ); paramList.add(param); pager.setParams(paramList); - GeneralResult list = cmpInternalService.list(pager.toMap()); - log.info("list:{}", JSON.toJSONString(list)); + GeneralResult result = cmpInternalService.list(pager.toMap()); + if(result.isFailed()){ + log.info("list:{}", JSON.toJSONString(result)); + return new GeneralResult(false,"查询失败"); + } + Map resultMap = new HashMap<>(); + resultMap.put("vm",result.getData().getInteger("total")); - return new GeneralResult<>(true, "查询成功"); + return new GeneralResult<>(true, resultMap,"查询成功"); } catch (Exception e) { log.info("查询失败", e); return new GeneralResult<>(false, "查询失败");