From 2973a5c9f1b4f5e217388c4803025df6a05949d3 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 25 Sep 2025 08:47:13 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=B0=86=E6=B6=89?= =?UTF-8?q?=E5=8F=8Ascence=5Fipobject=5Fdetail=E8=A7=86=E5=9B=BE=E7=9A=84S?= =?UTF-8?q?QL=E8=AF=AD=E5=8F=A5=E6=94=B9=E6=88=90=E5=8A=A8=E6=80=81sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1469827334504448]将涉及scence_ipobject_detail视图的SQL语句改成动态sql http://192.168.0.96:8090/demo/rdm.html#/task-detail/939050947543040/939050947543050/1469827334504448 --- .../resourcecenter/appenv/AppEnvListApi.java | 6 +++--- .../resource/GetResourceAccountApi.java | 8 ++++++-- .../ResourceAccountAccessTestApi.java | 6 +++++- .../ResourceAccountBatchDeleteApi.java | 6 +++--- .../resource/ResourceAccountListApi.java | 6 +++--- .../resource/ResourceAccountSaveApi.java | 6 +++--- .../ResourceAccountSelectComponentApi.java | 8 ++++---- .../resource/ResourceCheckApi.java | 2 +- .../resource/ResourceTagBatchAddApi.java | 6 +++--- .../resource/ResourceTagBatchDeleteApi.java | 6 +++--- .../resource/ResourceTagSaveApi.java | 6 +++--- .../DefaultResourceCenterDataSourceImpl.java | 20 +++++++++---------- .../ResourceCenterResourceServiceImpl.java | 4 ++-- 13 files changed, 49 insertions(+), 41 deletions(-) diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/appenv/AppEnvListApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/appenv/AppEnvListApi.java index 9bfd025a..82203c41 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/appenv/AppEnvListApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/appenv/AppEnvListApi.java @@ -23,7 +23,7 @@ import neatlogic.framework.common.constvalue.ApiParamType; import neatlogic.framework.restful.annotation.*; import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; -import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceMapper; +import neatlogic.module.cmdb.service.resourcecenter.resource.IResourceCenterResourceService; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -38,7 +38,7 @@ import javax.annotation.Resource; public class AppEnvListApi extends PrivateApiComponentBase { @Resource - private ResourceMapper resourceMapper; + private IResourceCenterResourceService resourceCenterResourceService; @Override public String getToken() { @@ -67,6 +67,6 @@ public class AppEnvListApi extends PrivateApiComponentBase { public Object myDoService(JSONObject paramObj) { Long appSystemId = paramObj.getLong("appSystemId"); Long appModuleId = paramObj.getLong("appModuleId"); - return resourceMapper.getAppEnvListByAppSystemIdAndAppModuleId(appSystemId, appModuleId); + return resourceCenterResourceService.getAppEnvListByAppSystemIdAndAppModuleId(appSystemId, appModuleId); } } diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/GetResourceAccountApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/GetResourceAccountApi.java index 6c7314f7..48c2f865 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/GetResourceAccountApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/GetResourceAccountApi.java @@ -36,6 +36,7 @@ import neatlogic.framework.tagent.dao.mapper.TagentMapper; import neatlogic.framework.tagent.dto.TagentVo; import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceAccountMapper; import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceMapper; +import neatlogic.module.cmdb.service.resourcecenter.resource.IResourceCenterResourceService; import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; @@ -64,6 +65,9 @@ public class GetResourceAccountApi extends PrivateApiComponentBase { @Resource TagentMapper tagentMapper; + @Resource + private IResourceCenterResourceService resourceCenterResourceService; + @Override public String getName() { return "获取账号密码"; @@ -117,12 +121,12 @@ public class GetResourceAccountApi extends PrivateApiComponentBase { //先找到资产 ResourceVo resourceVo = null; if (resourceId == null) { - resourceVo = resourceMapper.getResourceByIpAndPortAndNameAndTypeName(ip, port, nodeName, nodeType); + resourceVo = resourceCenterResourceService.getResourceByIpAndPortAndNameAndTypeName(ip, port, nodeName, nodeType); if (resourceVo == null) { throw new ResourceNotFoundException(ip, port, nodeName, nodeType); } } else { - resourceVo = resourceMapper.getResourceById(resourceId); + resourceVo = resourceCenterResourceService.getResourceById(resourceId); if (resourceVo == null) { throw new ResourceNotFoundException(resourceId); } diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountAccessTestApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountAccessTestApi.java index 50ff73a5..22e9b36c 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountAccessTestApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountAccessTestApi.java @@ -41,6 +41,7 @@ import neatlogic.framework.util.HttpRequestUtil; import neatlogic.framework.util.RegexUtils; import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceAccountMapper; import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceMapper; +import neatlogic.module.cmdb.service.resourcecenter.resource.IResourceCenterResourceService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -66,6 +67,9 @@ public class ResourceAccountAccessTestApi extends PrivateApiComponentBase { @Resource RunnerMapper runnerMapper; + @Resource + private IResourceCenterResourceService resourceCenterResourceService; + @Override public String getToken() { return "resourcecenter/account/accesstest"; @@ -95,7 +99,7 @@ public class ResourceAccountAccessTestApi extends PrivateApiComponentBase { Long resourceId = paramObj.getLong("resourceId"); Long runnerId = paramObj.getLong("runnerId"); List accountIdList = paramObj.getJSONArray("accountIdList").toJavaList(Long.class); - ResourceVo resource = resourceMapper.getResourceById(resourceId); + ResourceVo resource = resourceCenterResourceService.getResourceById(resourceId); if (resource == null) { throw new ResourceNotFoundException(resourceId); } diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountBatchDeleteApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountBatchDeleteApi.java index 39a674b9..3ea90b36 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountBatchDeleteApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountBatchDeleteApi.java @@ -30,7 +30,7 @@ import neatlogic.framework.restful.annotation.Param; import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceAccountMapper; -import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceMapper; +import neatlogic.module.cmdb.service.resourcecenter.resource.IResourceCenterResourceService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.ListUtils; import org.springframework.stereotype.Service; @@ -50,7 +50,7 @@ import java.util.List; public class ResourceAccountBatchDeleteApi extends PrivateApiComponentBase { @Resource - private ResourceMapper resourceMapper; + private IResourceCenterResourceService resourceCenterResourceService; @Resource private ResourceAccountMapper resourceAccountMapper; @@ -86,7 +86,7 @@ public class ResourceAccountBatchDeleteApi extends PrivateApiComponentBase { } List resourceIdList = resourceIdArray.toJavaList(Long.class); - List existResourceIdList = resourceMapper.checkResourceIdListIsExists(resourceIdList); + List existResourceIdList = resourceCenterResourceService.checkResourceIdListIsExists(resourceIdList); if (resourceIdList.size() > existResourceIdList.size()) { List notFoundIdList = ListUtils.removeAll(resourceIdList, existResourceIdList); if (CollectionUtils.isNotEmpty(notFoundIdList)) { diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountListApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountListApi.java index 442a62f5..506b0502 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountListApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountListApi.java @@ -26,7 +26,7 @@ import neatlogic.framework.restful.annotation.*; import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceAccountMapper; -import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceMapper; +import neatlogic.module.cmdb.service.resourcecenter.resource.IResourceCenterResourceService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -42,7 +42,7 @@ import javax.annotation.Resource; public class ResourceAccountListApi extends PrivateApiComponentBase { @Resource - private ResourceMapper resourceMapper; + private IResourceCenterResourceService resourceCenterResourceService; @Resource private ResourceAccountMapper resourceAccountMapper; @@ -72,7 +72,7 @@ public class ResourceAccountListApi extends PrivateApiComponentBase { @Override public Object myDoService(JSONObject paramObj) throws Exception { Long resourceId = paramObj.getLong("resourceId"); - if (resourceMapper.getResourceIdByResourceId(resourceId) == null) { + if (resourceCenterResourceService.getResourceIdByResourceId(resourceId) == null) { throw new ResourceNotFoundException(resourceId); } String protocol = paramObj.getString("protocol"); diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountSaveApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountSaveApi.java index f1c9010e..dd68742e 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountSaveApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountSaveApi.java @@ -27,8 +27,8 @@ import neatlogic.framework.restful.annotation.OperationType; import neatlogic.framework.restful.annotation.Param; import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; -import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceMapper; import neatlogic.module.cmdb.service.resourcecenter.account.ResourceCenterAccountService; +import neatlogic.module.cmdb.service.resourcecenter.resource.IResourceCenterResourceService; import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -48,7 +48,7 @@ import java.util.List; public class ResourceAccountSaveApi extends PrivateApiComponentBase { @Resource - private ResourceMapper resourceMapper; + private IResourceCenterResourceService resourceCenterResourceService; @Resource private ResourceCenterAccountService resourceCenterAccountService; @@ -75,7 +75,7 @@ public class ResourceAccountSaveApi extends PrivateApiComponentBase { @Override public Object myDoService(JSONObject paramObj) throws Exception { Long resourceId = paramObj.getLong("resourceId"); - if (resourceMapper.getResourceIdByResourceId(resourceId) == null) { + if (resourceCenterResourceService.getResourceIdByResourceId(resourceId) == null) { throw new ResourceNotFoundException(resourceId); } List accountIdList = new ArrayList<>(); diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountSelectComponentApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountSelectComponentApi.java index 1c7cc878..79626282 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountSelectComponentApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceAccountSelectComponentApi.java @@ -26,7 +26,7 @@ import neatlogic.framework.restful.annotation.*; import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; import neatlogic.framework.util.TableResultUtil; -import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceMapper; +import neatlogic.module.cmdb.service.resourcecenter.resource.IResourceCenterResourceService; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -38,7 +38,7 @@ import java.util.List; public class ResourceAccountSelectComponentApi extends PrivateApiComponentBase { @Resource - ResourceMapper resourceMapper; + private IResourceCenterResourceService resourceCenterResourceService; @Override public String getToken() { @@ -68,8 +68,8 @@ public class ResourceAccountSelectComponentApi extends PrivateApiComponentBase { @Override public Object myDoService(JSONObject paramObj) throws Exception { AccountComponentVo searchVo = JSON.toJavaObject(paramObj, AccountComponentVo.class); - List accountComponentVoList = resourceMapper.searchAccountComponent(searchVo); - Integer rowNum = resourceMapper.searchAccountComponentCount(searchVo); + List accountComponentVoList = resourceCenterResourceService.searchAccountComponent(searchVo); + Integer rowNum = resourceCenterResourceService.searchAccountComponentCount(searchVo); searchVo.setRowNum(rowNum); return TableResultUtil.getResult(accountComponentVoList, searchVo); diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceCheckApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceCheckApi.java index eebe8920..255ec600 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceCheckApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceCheckApi.java @@ -289,7 +289,7 @@ public class ResourceCheckApi extends PrivateApiComponentBase { ResourceSearchVo searchVo = resourceCenterResourceService.assembleResourceSearchVo(filterJson); searchVo.setIdList(idList); Long getAuthResourceList = System.currentTimeMillis(); - List resourceVoList = resourceMapper.getAuthResourceList(searchVo); + List resourceVoList = resourceCenterResourceService.getAuthResourceList(searchVo); logger.warn((System.currentTimeMillis() - getAuthResourceList) + " ##getAuthResourceList:-------------------------------------------------------------------------------"); System.out.println((System.currentTimeMillis() - getAuthResourceList) + " ##getAuthResourceList:-------------------------------------------------------------------------------"); if (CollectionUtils.isNotEmpty(resourceVoList)) { diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceTagBatchAddApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceTagBatchAddApi.java index 0fb097e4..f3c6a0c8 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceTagBatchAddApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceTagBatchAddApi.java @@ -30,8 +30,8 @@ import neatlogic.framework.restful.annotation.OperationType; import neatlogic.framework.restful.annotation.Param; import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; -import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceMapper; import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceTagMapper; +import neatlogic.module.cmdb.service.resourcecenter.resource.IResourceCenterResourceService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.ListUtils; import org.springframework.stereotype.Service; @@ -53,7 +53,7 @@ import java.util.stream.Collectors; public class ResourceTagBatchAddApi extends PrivateApiComponentBase { @Resource - private ResourceMapper resourceMapper; + private IResourceCenterResourceService resourceCenterResourceService; @Resource private ResourceTagMapper resourceTagMapper; @@ -89,7 +89,7 @@ public class ResourceTagBatchAddApi extends PrivateApiComponentBase { } List resourceIdList = resourceIdArray.toJavaList(Long.class); - List existResourceIdList = resourceMapper.checkResourceIdListIsExists(resourceIdList); + List existResourceIdList = resourceCenterResourceService.checkResourceIdListIsExists(resourceIdList); if (resourceIdList.size() > existResourceIdList.size()) { List notFoundIdList = ListUtils.removeAll(resourceIdList, existResourceIdList); if (CollectionUtils.isNotEmpty(notFoundIdList)) { diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceTagBatchDeleteApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceTagBatchDeleteApi.java index 6c40ac8c..6fa87db0 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceTagBatchDeleteApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceTagBatchDeleteApi.java @@ -28,8 +28,8 @@ import neatlogic.framework.restful.annotation.OperationType; import neatlogic.framework.restful.annotation.Param; import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; -import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceMapper; import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceTagMapper; +import neatlogic.module.cmdb.service.resourcecenter.resource.IResourceCenterResourceService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.ListUtils; import org.springframework.stereotype.Service; @@ -49,7 +49,7 @@ import java.util.List; public class ResourceTagBatchDeleteApi extends PrivateApiComponentBase { @Resource - private ResourceMapper resourceMapper; + private IResourceCenterResourceService resourceCenterResourceService; @Resource private ResourceTagMapper resourceTagMapper; @@ -85,7 +85,7 @@ public class ResourceTagBatchDeleteApi extends PrivateApiComponentBase { } List resourceIdList = resourceIdArray.toJavaList(Long.class); - List existResourceIdList = resourceMapper.checkResourceIdListIsExists(resourceIdList); + List existResourceIdList = resourceCenterResourceService.checkResourceIdListIsExists(resourceIdList); if (resourceIdList.size() > existResourceIdList.size()) { List notFoundIdList = ListUtils.removeAll(resourceIdList, existResourceIdList); if (CollectionUtils.isNotEmpty(notFoundIdList)) { diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceTagSaveApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceTagSaveApi.java index 15d9bd94..962658e8 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceTagSaveApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceTagSaveApi.java @@ -29,8 +29,8 @@ import neatlogic.framework.restful.annotation.OperationType; import neatlogic.framework.restful.annotation.Param; import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; -import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceMapper; import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceTagMapper; +import neatlogic.module.cmdb.service.resourcecenter.resource.IResourceCenterResourceService; import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -51,7 +51,7 @@ import java.util.stream.Collectors; public class ResourceTagSaveApi extends PrivateApiComponentBase { @Resource - private ResourceMapper resourceMapper; + private IResourceCenterResourceService resourceCenterResourceService; @Resource private ResourceTagMapper resourceTagMapper; @@ -83,7 +83,7 @@ public class ResourceTagSaveApi extends PrivateApiComponentBase { if (CollectionUtils.isEmpty(tagArray)) { return null; } - if (resourceMapper.getResourceIdByResourceId(resourceId) == null) { + if (resourceCenterResourceService.getResourceIdByResourceId(resourceId) == null) { throw new ResourceNotFoundException(resourceId); } List tagList = tagArray.toJavaList(String.class); diff --git a/src/main/java/neatlogic/module/cmdb/resourcecenter/datasource/handler/DefaultResourceCenterDataSourceImpl.java b/src/main/java/neatlogic/module/cmdb/resourcecenter/datasource/handler/DefaultResourceCenterDataSourceImpl.java index 5dff3302..36b94a05 100644 --- a/src/main/java/neatlogic/module/cmdb/resourcecenter/datasource/handler/DefaultResourceCenterDataSourceImpl.java +++ b/src/main/java/neatlogic/module/cmdb/resourcecenter/datasource/handler/DefaultResourceCenterDataSourceImpl.java @@ -421,7 +421,7 @@ public class DefaultResourceCenterDataSourceImpl implements IResourceCenterDataS List resultList = new ArrayList<>(); int rowNum = 0; if (searchVo.getRowNum() == 0) { - rowNum = resourceMapper.getAppResourceCount(searchVo); + rowNum = resourceCenterResourceService.getAppResourceCount(searchVo); } else { rowNum = searchVo.getRowNum(); } @@ -436,10 +436,10 @@ public class DefaultResourceCenterDataSourceImpl implements IResourceCenterDataS continue; } searchVo.setCurrentPage(i); - List resourceIdList = resourceMapper.getAppResourceIdList(searchVo); + List resourceIdList = resourceCenterResourceService.getAppResourceIdList(searchVo); if (CollectionUtils.isNotEmpty(resourceIdList)) { searchVo.setIdList(resourceIdList); - List resourceList = resourceMapper.getAppResourceListByIdList(searchVo); + List resourceList = resourceCenterResourceService.getAppResourceListByIdList(searchVo); resultList.addAll(resourceList); } if (needPage) { @@ -453,7 +453,7 @@ public class DefaultResourceCenterDataSourceImpl implements IResourceCenterDataS @Override public List getAppResourceIdList(ResourceSearchVo searchVo, boolean needPage) { List resultList = new ArrayList<>(); - int rowNum = resourceMapper.getAppResourceCount(searchVo); + int rowNum = resourceCenterResourceService.getAppResourceCount(searchVo); if (rowNum > 0) { searchVo.setRowNum(rowNum); if (needPage) { @@ -465,7 +465,7 @@ public class DefaultResourceCenterDataSourceImpl implements IResourceCenterDataS continue; } searchVo.setCurrentPage(i); - List resourceIdList = resourceMapper.getAppResourceIdList(searchVo); + List resourceIdList = resourceCenterResourceService.getAppResourceIdList(searchVo); resultList.addAll(resourceIdList); if (needPage) { break; @@ -701,7 +701,7 @@ public class DefaultResourceCenterDataSourceImpl implements IResourceCenterDataS //先找出所有有权限的配置项的模型idList if (!searchVo.getIsHasAuth()) { Set authCiIdList = ciMapper.getAllAuthCi(UserContext.get().getAuthenticationInfoVo()).stream().map(CiVo::getId).collect(Collectors.toSet()); - authCiIdList.addAll(resourceMapper.getResourceTypeIdListByAuth(searchVo)); + authCiIdList.addAll(resourceCenterResourceService.getResourceTypeIdListByAuth(searchVo)); if (CollectionUtils.isEmpty(authCiIdList)) { return resultList; } @@ -1000,7 +1000,7 @@ public class DefaultResourceCenterDataSourceImpl implements IResourceCenterDataS List appModuleList = resourceMapper.getAppModuleListByAppSystemId(appSystemId); if (CollectionUtils.isNotEmpty(appModuleList)) { Map appEnvCountMap = new HashMap<>(); - List> appEnvCountMapList = resourceMapper.getAppEnvCountMapByAppSystemIdGroupByAppModuleId(appSystemId); + List> appEnvCountMapList = resourceCenterResourceService.getAppEnvCountMapByAppSystemIdGroupByAppModuleId(appSystemId); for (Map map : appEnvCountMapList) { Long count = map.get("count"); Long appModuleId = map.get("appModuleId"); @@ -1073,7 +1073,7 @@ public class DefaultResourceCenterDataSourceImpl implements IResourceCenterDataS Map> appEnvId2AppModuleListMap = new HashMap<>(); List appViewList = getAppViewList(); for (ResourceEntityVo resourceEntityVo : appViewList) { - List appEnvList = resourceMapper.getAppEnvListByViewNameAndAppSystemIdAndAppModuleIdAndInspectStatusList(resourceEntityVo.getName(), appSystemId, appModuleId, inspectStatusList); + List appEnvList = resourceCenterResourceService.getAppEnvListByViewNameAndAppSystemIdAndAppModuleIdAndInspectStatusList(resourceEntityVo.getName(), appSystemId, appModuleId, inspectStatusList); for (AppEnvVo appEnvVo : appEnvList) { appEnvMap.put(appEnvVo.getId(), appEnvVo); List appModuleList = appEnvVo.getAppModuleList(); @@ -1189,7 +1189,7 @@ public class DefaultResourceCenterDataSourceImpl implements IResourceCenterDataS List appViewList = getAppViewList(); if (CollectionUtils.isNotEmpty(appViewList)) { for (ResourceEntityVo resourceEntityVo : appViewList) { - List typeIdList = resourceMapper.getAppResourceTypeIdListByViewNameAndAppSystemId(resourceEntityVo.getName(), appSystemId, appModuleId, envId, inspectStatusList); + List typeIdList = resourceCenterResourceService.getAppResourceTypeIdListByViewNameAndAppSystemId(resourceEntityVo.getName(), appSystemId, appModuleId, envId, inspectStatusList); viewName2TypeIdListMap.put(resourceEntityVo.getName(), typeIdList); } } @@ -1202,7 +1202,7 @@ public class DefaultResourceCenterDataSourceImpl implements IResourceCenterDataS List appViewList = getAppViewList(); if (CollectionUtils.isNotEmpty(appViewList)) { for (ResourceEntityVo resourceEntityVo : appViewList) { - List list = resourceMapper.getAppSystemIdListById(resourceEntityVo.getName(), id); + List list = resourceCenterResourceService.getAppSystemIdListById(resourceEntityVo.getName(), id); appSystemIdList.addAll(list); } } diff --git a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java index 79904cf8..dbec4243 100644 --- a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java +++ b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java @@ -299,11 +299,11 @@ public class ResourceCenterResourceServiceImpl implements IResourceCenterResourc @Override public void setIsIpFieldSortAndIsNameFieldSort(ResourceSearchVo searchVo) { if (StringUtils.isNotBlank(searchVo.getKeyword())) { - int ipKeywordCount = resourceMapper.getResourceCountByIpKeyword(searchVo); + int ipKeywordCount = getResourceCountByIpKeyword(searchVo); if (ipKeywordCount > 0) { searchVo.setIsIpFieldSort(1); } else { - int nameKeywordCount = resourceMapper.getResourceCountByNameKeyword(searchVo); + int nameKeywordCount = getResourceCountByNameKeyword(searchVo); if (nameKeywordCount > 0) { searchVo.setIsNameFieldSort(1); } -- Gitee