diff --git a/src/main/java/neatlogic/module/cmdb/api/ci/SaveCiApi.java b/src/main/java/neatlogic/module/cmdb/api/ci/SaveCiApi.java index 8b3b168a04318c38e0bf4559e1cd23a719993860..01b6ca310c3cbf0ce65b2497f3d6b50af0b139a0 100644 --- a/src/main/java/neatlogic/module/cmdb/api/ci/SaveCiApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/ci/SaveCiApi.java @@ -74,7 +74,7 @@ public class SaveCiApi extends PrivateApiComponentBase { @Param(name = "description", type = ApiParamType.STRING, desc = "common.memo", maxLength = 500, xss = true), @Param(name = "icon", type = ApiParamType.STRING, isRequired = true, desc = "common.icon"), @Param(name = "typeId", type = ApiParamType.LONG, desc = "common.typeid", isRequired = true), - @Param(name = "catalogId", type = ApiParamType.LONG, desc = "common.catalogid", isRequired = true), + @Param(name = "catalogId", type = ApiParamType.LONG, desc = "common.catalogid"), @Param(name = "parentCiId", type = ApiParamType.LONG, desc = "term.cmdb.parentcientityid"), @Param(name = "fileId", type = ApiParamType.LONG, desc = "term.cmdb.virtualcifileid"), @Param(name = "expiredDay", type = ApiParamType.INTEGER, desc = "common.expireddays"), diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/config/getResourceEntityViewDataListApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/config/getResourceEntityViewDataListApi.java index 1417aa3be22486110477a0cba916ff3c3efd74d1..fe95451d66dc4c91caf614327b2b1fdd4e9ccd91 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/config/getResourceEntityViewDataListApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/config/getResourceEntityViewDataListApi.java @@ -13,6 +13,7 @@ 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.ResourceEntityMapper; +import neatlogic.module.cmdb.utils.ResourceEntityFactory; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -47,13 +48,16 @@ public class getResourceEntityViewDataListApi extends PrivateApiComponentBase { @Override public Object myDoService(JSONObject paramObj) throws Exception { String name = paramObj.getString("name"); + List fieldNameList = ResourceEntityFactory.getFieldNameListByViewName(name); JSONArray theadList = new JSONArray(); List columnNameList = schemaMapper.getTableOrViewAllColumnNameList(TenantContext.get().getDataDbName(), name); - for (String columnName : columnNameList) { - JSONObject thead = new JSONObject(); - thead.put("key", columnName); - thead.put("title", columnName); - theadList.add(thead); + for (String fieldName : fieldNameList) { + if (columnNameList.contains(fieldName)) { + JSONObject thead = new JSONObject(); + thead.put("key", fieldName); + thead.put("title", fieldName); + theadList.add(thead); + } } BasePageVo basePageVo = paramObj.toJavaObject(BasePageVo.class); int rowNum = resourceEntityMapper.getResourceEntityViewDataCount(name); diff --git a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml index bc7c12a95dae90b0fc8ed9d61c47226f05f01221..e4052f33e88399145d62881e0a18cc2b6c23426c 100644 --- a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml +++ b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml @@ -1515,7 +1515,7 @@ limitations under the License. `app_system_id` AS appSystemId FROM @{DATA_SCHEMA}.`scence_appmodule_appsystem` WHERE `app_system_id` = #{value} - ORDER BY CONVERT (`abbr_name` USING gbk) COLLATE gbk_chinese_ci ASC +