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, "查询失败");