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 9bfd025a37a402032f308e0c7706b27a947150b5..82203c411b6dfe10dc5edec57548c7c12b217de8 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 6c7314f7ee32a83a2bcb9df9f42fe52349b46f60..48c2f8653156a544e9a0405a1ee5f5646c724e35 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 50ff73a554f6696d2261a31c6f6ca362e72983c0..22e9b36cc93c0b349ce99d13d430bd7617bea507 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 39a674b994c1f5220a146d2e236bc8d804bd78ae..3ea90b3682e751db3218dee6c13eb0ca1bd70f62 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 442a62f5dcaf0cdc3c9afe2a30cb85441de096ee..506b05026af154ef59f86e09caa97d974037912c 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 f1c9010eeb5f7bc2f81aed37ddb7296b85c28ac1..dd68742e4f9d6124f7c457724f09ba57566e372c 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 1c7cc878e22ff6ca63a77bf1ae6d2f4c1952c0d0..79626282255795de6ff1107b293819a0900d31a2 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 eebe8920109fa309fd5da7493581cc9addb46038..255ec600e5a04b76d52dfab9abc3824138b40837 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 0fb097e4dcd130d5d3b74390c2652ecf8c873cd0..f3c6a0c82537a6090323213b9d2c17beb090b1ae 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 6c40ac8c58668e57a0fdb5a45d2116821c113942..6fa87db044b17cc42646e15a31bf65454772d231 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 15d9bd94cbde7486a144c410f03c7e64fc98d763..962658e86df835be1841e449e73358033b7f4bc2 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 5dff3302ddbc7ae9191780a254f698039fa47b06..36b94a0524dd2484b7bdf2ac95b8912a004ccfb4 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 79904cf8b216a4a03d0fde38b61a30bd683460d9..dbec4243a014464f940b60b497a41c00b04d9119 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); }