From dc441e5cef48d4f3eaf83a476e36601ab0962a96 Mon Sep 17 00:00:00 2001 From: liujun Date: Tue, 12 Mar 2024 14:45:06 +0800 Subject: [PATCH] =?UTF-8?q?14473=20=E4=B8=89=E9=A1=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E9=83=BD=E6=9C=89=20=E6=B2=A1=E6=9C=89=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E7=B1=BB=E5=9E=8B=E7=9A=84=E4=BC=81=E4=B8=9A=20?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=9A=84=E6=95=B0=E6=8D=AE=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/TextLibraryServiceImpl.java | 2 +- src/main/java/com/zcloud/util/Warden.java | 48 +++++++++++-------- 2 files changed, 29 insertions(+), 21 deletions(-) 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; }