diff --git a/src/main/java/neatlogic/module/deploy/api/activeversion/SearchDeployActiveVersionApi.java b/src/main/java/neatlogic/module/deploy/api/activeversion/SearchDeployActiveVersionApi.java index e3483a804e2334abb691b6937e531aff1d785b03..332b9e4a69f8bef718682381f60930f2a6c83b6e 100644 --- a/src/main/java/neatlogic/module/deploy/api/activeversion/SearchDeployActiveVersionApi.java +++ b/src/main/java/neatlogic/module/deploy/api/activeversion/SearchDeployActiveVersionApi.java @@ -1,5 +1,6 @@ package neatlogic.module.deploy.api.activeversion; +import com.alibaba.fastjson.JSONObject; import neatlogic.framework.auth.core.AuthAction; import neatlogic.framework.cmdb.crossover.IResourceCrossoverMapper; import neatlogic.framework.cmdb.dto.resourcecenter.ResourceSearchVo; @@ -23,9 +24,9 @@ import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; import neatlogic.framework.util.TableResultUtil; import neatlogic.module.deploy.dao.mapper.DeployAppConfigMapper; +import neatlogic.module.deploy.dao.mapper.DeployAppSystemMapper; import neatlogic.module.deploy.dao.mapper.DeployEnvVersionMapper; import neatlogic.module.deploy.dao.mapper.DeployVersionMapper; -import com.alibaba.fastjson.JSONObject; import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; @@ -44,6 +45,9 @@ public class SearchDeployActiveVersionApi extends PrivateApiComponentBase { @Resource DeployAppConfigMapper deployAppConfigMapper; + @Resource + DeployAppSystemMapper deployAppSystemMapper; + @Resource DeployEnvVersionMapper deployEnvVersionMapper; @@ -75,7 +79,7 @@ public class SearchDeployActiveVersionApi extends PrivateApiComponentBase { public Object myDoService(JSONObject paramObj) throws Exception { DeployResourceSearchVo searchVo = paramObj.toJavaObject(DeployResourceSearchVo.class); // 按系统分页 - Integer systemIdListCount = deployAppConfigMapper.getAppSystemIdListCount(searchVo); + Integer systemIdListCount = deployAppSystemMapper.getAppSystemIdListCount(searchVo); searchVo.setRowNum(systemIdListCount); List result = new ArrayList<>(); if (systemIdListCount > 0) { diff --git a/src/main/java/neatlogic/module/deploy/api/appconfig/system/SearchDeployAppConfigAppSystemApi.java b/src/main/java/neatlogic/module/deploy/api/appconfig/system/SearchDeployAppConfigAppSystemApi.java index d10595c567fa9cf1145391a02a76ca89c51fe686..e3586f8318d1a9ddd9e0f3e82662675e5d6e3e05 100644 --- a/src/main/java/neatlogic/module/deploy/api/appconfig/system/SearchDeployAppConfigAppSystemApi.java +++ b/src/main/java/neatlogic/module/deploy/api/appconfig/system/SearchDeployAppConfigAppSystemApi.java @@ -36,6 +36,7 @@ import neatlogic.framework.restful.constvalue.OperationTypeEnum; import neatlogic.framework.restful.core.privateapi.PrivateApiComponentBase; import neatlogic.framework.util.TableResultUtil; import neatlogic.module.deploy.dao.mapper.DeployAppConfigMapper; +import neatlogic.module.deploy.dao.mapper.DeployAppSystemMapper; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -56,6 +57,9 @@ public class SearchDeployAppConfigAppSystemApi extends PrivateApiComponentBase { @Resource private DeployAppConfigMapper deployAppConfigMapper; + @Resource + DeployAppSystemMapper deployAppSystemMapper; + @Resource private GlobalLockMapper globalLockMapper; @@ -97,14 +101,14 @@ public class SearchDeployAppConfigAppSystemApi extends PrivateApiComponentBase { if (CollectionUtils.isNotEmpty(defaultValue)) { List idList = defaultValue.toJavaList(Long.class); searchVo.setAppSystemIdList(idList); - List tbodyList = deployAppConfigMapper.getAppSystemListByIdList(searchVo, UserContext.get().getUserUuid()); + List tbodyList = deployAppSystemMapper.getAppSystemListByIdList(searchVo, UserContext.get().getUserUuid()); return TableResultUtil.getResult(tbodyList, searchVo); } if(CollectionUtils.isNotEmpty(searchVo.getAuthorityActionList()) && searchVo.getAuthorityActionList().contains(DeployAppConfigAction.VIEW.getValue())){ searchVo.getAuthorityActionList().addAll(Arrays.asList(DeployAppConfigAction.EXECUTE.getValue(), DeployAppConfigAction.EDIT.getValue(), DeployAppConfigAction.AUTH.getValue())); } List returnAppSystemList = new ArrayList<>(); - Integer count = deployAppConfigMapper.getAppSystemIdListCount(searchVo); + Integer count = deployAppSystemMapper.getAppSystemIdListCount(searchVo); if (count > 0) { searchVo.setRowNum(count); //过滤出有查看权限的系统 @@ -115,9 +119,9 @@ public class SearchDeployAppConfigAppSystemApi extends PrivateApiComponentBase { searchVo.setAppSystemIdList(appSystemIdList); //补充上述系统的所有权限 if (StringUtils.isNotEmpty(searchVo.getKeyword())) { - returnAppSystemList = deployAppConfigMapper.getAppSystemListIncludeModuleByIdList(searchVo, UserContext.get().getUserUuid()); + returnAppSystemList = deployAppSystemMapper.getAppSystemListIncludeModuleByIdList(searchVo, UserContext.get().getUserUuid()); } else { - returnAppSystemList = deployAppConfigMapper.getAppSystemListByIdList(searchVo, UserContext.get().getUserUuid()); + returnAppSystemList = deployAppSystemMapper.getAppSystemListByIdList(searchVo, UserContext.get().getUserUuid()); } /*补充系统是否有模块、是否有环境、是否有配置权限 ,补充模块是否配置、是否有环境、是否含有资源锁*/ diff --git a/src/main/java/neatlogic/module/deploy/dao/mapper/DeployAppConfigMapper.java b/src/main/java/neatlogic/module/deploy/dao/mapper/DeployAppConfigMapper.java index 009434563a2b3357e0f0cdde4c603135d55b2671..f1834bd6b61c617e2387d8611e44b6c3b3374cf8 100644 --- a/src/main/java/neatlogic/module/deploy/dao/mapper/DeployAppConfigMapper.java +++ b/src/main/java/neatlogic/module/deploy/dao/mapper/DeployAppConfigMapper.java @@ -23,10 +23,6 @@ public interface DeployAppConfigMapper extends IDeployAppConfigCrossoverMapper { List searchAppSystemList(DeployResourceSearchVo searchVo); - List getAppSystemListIncludeModuleByIdList(@Param("searchVo") DeployResourceSearchVo searchVo, @Param("userUuid") String userUuid); - - List getAppSystemListByIdList(@Param("searchVo") DeployResourceSearchVo searchVo, @Param("userUuid") String userUuid); - List getAppSystemModuleListBySystemIdList(@Param("idList") List idList, @Param("isConfig") Integer isConfig, @Param("userUuid") String userUuid); List getAppSystemListByUserUuid(@Param("userUuid") String userUuid, @Param("searchVo") DeployResourceSearchVo searchVo); @@ -196,8 +192,6 @@ public interface DeployAppConfigMapper extends IDeployAppConfigCrossoverMapper { Integer deleteAppConfigDraft(DeployAppConfigVo deployAppConfigDraftVo); - Integer getAppSystemIdListCount(DeployResourceSearchVo searchVo); - Long getAppSystemLimitMaxId(DeployResourceSearchVo searchVo); String getAppSystemNotifyPolicyConfigByAppSystemId(Long appSystemId); diff --git a/src/main/java/neatlogic/module/deploy/dao/mapper/DeployAppConfigMapper.xml b/src/main/java/neatlogic/module/deploy/dao/mapper/DeployAppConfigMapper.xml index 058aeece76717aed02521fa667909501f62a0701..42115139b770bdee3893b88ac8483ddaf952273f 100644 --- a/src/main/java/neatlogic/module/deploy/dao/mapper/DeployAppConfigMapper.xml +++ b/src/main/java/neatlogic/module/deploy/dao/mapper/DeployAppConfigMapper.xml @@ -14,7 +14,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see .--> - + @@ -132,93 +132,6 @@ along with this program. If not, see .--> - - - - - - - - (daca.app_system_id is null - OR - (daca.action_type = 'operation' - AND daca.action IN - ('all' - , - - #{item} - - - ) - AND daca.auth_uuid IN - ( - 'alluser' - - , - - #{item} - - - ) - ) - ) - - + select + saa.id as appSystemId, + saa.`name` as appSystemName, + saa.`abbr_name` as appSystemNameAbbrName, + saa.app_module_id as appModuleId, + saa.`app_module_name` as appModuleName, + saa.`app_module_abbr_name` as appModuleNameAbbrName, + if(dacu.user_uuid is null,0,1) as isFavorite, + if(dac.config is null,0,1) as isConfig, + if( daca.app_system_id IS NULL, 0, 1 ) AS isConfigAuthority, + daca.auth_type as authType, + daca.auth_uuid as authUuid, + daca.`action` as authAction, + daca.action_type authActionType + from @{DATA_SCHEMA}.`scence_appsystem_appmodule` saa + left join deploy_app_config_user dacu on saa.id = dacu.app_system_id and dacu.user_uuid = #{userUuid} + left join deploy_app_config dac on saa.id = dac.app_system_id and dac.app_module_id = 0 and dac.env_id = 0 + LEFT JOIN deploy_app_config_authority daca ON daca.app_system_id = saa.id + + saa.id in + + #{id} + + + AND + (daca.app_system_id is null + OR daca.auth_uuid IN + ( + 'alluser' + + , + + #{item} + + + ) + ) + + + + order by if(dacu.user_uuid = #{userUuid},1,0) desc, + CONVERT(saa.abbr_name USING gbk) COLLATE gbk_chinese_ci ASC, + CONVERT(saa.app_module_abbr_name USING gbk) COLLATE gbk_chinese_ci ASC + + + + + + (daca.app_system_id is null + OR + (daca.action_type = 'operation' + AND daca.action IN + ('all' + , + + #{item} + + + ) + AND daca.auth_uuid IN + ( + 'alluser' + + , + + #{item} + + + ) + ) + ) + + + + + \ No newline at end of file