diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/service/ApiGatewayService.java b/renren-admin/src/main/java/io/renren/modules/processForm/service/ApiGatewayService.java index 521e3181..f0078fbd 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/service/ApiGatewayService.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/service/ApiGatewayService.java @@ -21,6 +21,7 @@ import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; import java.util.HashMap; +import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -60,7 +61,7 @@ public class ApiGatewayService { throw new IllegalArgumentException(String.format("未找到对应的资源id:%s", resourceId)); } String apiUrl = resourceEntity.getApiUrl(); - String methods = resourceEntity.getApiMethodType().toUpperCase(); + String methods = resourceEntity.getApiMethodType(); if (StringUtils.isBlank(apiUrl) || StringUtils.isBlank(methods)){ String msg = String.format("注册api参数为空,跳过 apiUrl:%s, methods:%s, resourceId:%s", apiUrl, methods, resourceId); @@ -68,7 +69,7 @@ public class ApiGatewayService { log.info(msg); return; } - + methods = methods.toUpperCase(Locale.ROOT); //建group String domain = getIP(apiUrl); String uris = apiUrl.substring(apiUrl.indexOf(domain) + domain.length()); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 95d7ad13..52a5a346 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -69,15 +69,18 @@ public class ResourceServiceImpl extends CrudServiceImpl resourceMap = new HashMap<>(); resourceMap.put("type", "全部能力目录"); QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("del_flag", 0).eq("type", jsonObject.getString("type")); + queryWrapper.eq("del_flag", 0).eq(StringUtils.isNotBlank(jsonObject.getString("type")),"type", jsonObject.getString("type")); resourceMap.put("total", resourceDao.selectCount(queryWrapper)); //resourceMap.put("dataList", resourceDao.selectList(queryWrapper)); resultList.add(resourceMap); @@ -313,6 +316,9 @@ public class ResourceServiceImpl extends CrudServiceImpl map = new HashMap<>(); map.put("type", item.getKey()); map.put("total", resourceDao.selectTypeCountByDept(item.getKey(), jsonObject.getString("type"))); + item.getValue().stream().forEach(item1 -> { + item1.remove("type"); + }); map.put("dataList", item.getValue()); resultList.add(map); }); diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index edf30e1d..332ee1ec 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -330,7 +330,11 @@ sd.id AS "deptId" FROM sys_dept sd - LEFT JOIN ( SELECT dept_id, COUNT( id ) AS "deptCount" FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 AND type = #{type} GROUP BY dept_id ) tdr ON sd.id = tdr.dept_id + LEFT JOIN ( SELECT dept_id, COUNT( id ) AS "deptCount" FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 + + AND type = #{type} + + GROUP BY dept_id ) tdr ON sd.id = tdr.dept_id ) temp1 WHERE 1 = 1 @@ -352,7 +356,10 @@ IFNULL( tdr.deptCount, 0 ) AS "deptCount" FROM sys_dept sd - LEFT JOIN ( SELECT dept_id, COUNT( id ) AS "deptCount" FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 AND type = #{resourceType} GROUP BY dept_id ) tdr ON sd.id = tdr.dept_id + LEFT JOIN ( SELECT dept_id, COUNT( id ) AS "deptCount" FROM tb_data_resource WHERE 1 = 1 AND del_flag = 0 + + AND type = #{resourceType} + GROUP BY dept_id ) tdr ON sd.id = tdr.dept_id ) temp1 WHERE 1 = 1