diff --git a/src/main/java/com/zcloud/service/depository/impl/TextLibraryServiceImpl.java b/src/main/java/com/zcloud/service/depository/impl/TextLibraryServiceImpl.java index 7b802460..0be87697 100644 --- a/src/main/java/com/zcloud/service/depository/impl/TextLibraryServiceImpl.java +++ b/src/main/java/com/zcloud/service/depository/impl/TextLibraryServiceImpl.java @@ -183,7 +183,7 @@ public class TextLibraryServiceImpl implements TextLibraryService { PageData corp_condition = new PageData(); corp_condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); PageData corp = corpInfoMapper.getInfo(corp_condition); - + // 国民经济类型 List specificationTypes = Warden.initSpecificationTypes(corp); list.addAll(specificationTypes); List labels = Warden.getList(condition.getString("labels")); diff --git a/src/main/java/com/zcloud/util/Warden.java b/src/main/java/com/zcloud/util/Warden.java index 5ad9d29b..3de3e253 100644 --- a/src/main/java/com/zcloud/util/Warden.java +++ b/src/main/java/com/zcloud/util/Warden.java @@ -331,29 +331,37 @@ public class Warden { public static List initSpecificationTypes(PageData corp) { List list = new ArrayList<>(); - PageData one = new PageData(); - one.put("CATEGORY","SPECIFICATION_TYPES"); - one.put("CATEGORY_ID",corp.getString("CORP_TYPE")); - one.put("CATEGORY_NAME",corp.getString("CORP_TYPE_ONE_NAME")); - list.add(one); + if (corp.get("CORP_TYPE_ONE_NAME") != null && StringUtils.isNotBlank(corp.getString("CORP_TYPE_ONE_NAME"))){ + PageData one = new PageData(); + one.put("CATEGORY","SPECIFICATION_TYPES"); + one.put("CATEGORY_ID",corp.getString("CORP_TYPE")); + one.put("CATEGORY_NAME",corp.getString("CORP_TYPE_ONE_NAME")); + list.add(one); + } - PageData two = new PageData(); - two.put("CATEGORY","SPECIFICATION_TYPES"); - two.put("CATEGORY_ID",corp.getString("CORP_TYPE2")); - two.put("CATEGORY_NAME",corp.getString("CORP_TYPE_TWO_NAME")); - list.add(two); + if (corp.get("CORP_TYPE_TWO_NAME") != null && StringUtils.isNotBlank(corp.getString("CORP_TYPE_TWO_NAME"))) { + PageData two = new PageData(); + two.put("CATEGORY", "SPECIFICATION_TYPES"); + two.put("CATEGORY_ID", corp.getString("CORP_TYPE2")); + two.put("CATEGORY_NAME", corp.getString("CORP_TYPE_TWO_NAME")); + list.add(two); + } - PageData three = new PageData(); - three.put("CATEGORY","SPECIFICATION_TYPES"); - three.put("CATEGORY_ID",corp.getString("CORP_TYPE3")); - three.put("CATEGORY_NAME",corp.getString("CORP_TYPE_THREE_NAME")); - list.add(three); + if (corp.get("CORP_TYPE_THREE_NAME") != null && StringUtils.isNotBlank(corp.getString("CORP_TYPE_THREE_NAME"))) { + PageData three = new PageData(); + three.put("CATEGORY", "SPECIFICATION_TYPES"); + three.put("CATEGORY_ID", corp.getString("CORP_TYPE3")); + three.put("CATEGORY_NAME", corp.getString("CORP_TYPE_THREE_NAME")); + list.add(three); + } - PageData four = new PageData(); - four.put("CATEGORY","SPECIFICATION_TYPES"); - four.put("CATEGORY_ID",corp.getString("CORP_TYPE4")); - four.put("CATEGORY_NAME",corp.getString("CORP_TYPE_FOUR_NAME")); - list.add(four); + if (corp.get("CORP_TYPE_FOUR_NAME") != null && StringUtils.isNotBlank(corp.getString("CORP_TYPE_FOUR_NAME"))) { + PageData four = new PageData(); + four.put("CATEGORY", "SPECIFICATION_TYPES"); + four.put("CATEGORY_ID", corp.getString("CORP_TYPE4")); + four.put("CATEGORY_NAME", corp.getString("CORP_TYPE_FOUR_NAME")); + list.add(four); + } return list; }