From c5c5691c962f384d1433ee02cf8d3d5b3da7a8e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=90=A6=E6=B6=9B?= Date: Thu, 9 Mar 2023 12:01:09 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90fix=20sonar=E3=80=91ProvinceCityArea?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jero/common/constant/ProvinceCityArea.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/ProvinceCityArea.java b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/ProvinceCityArea.java index 59d6d9ff..392ae679 100644 --- a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/ProvinceCityArea.java +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/ProvinceCityArea.java @@ -66,10 +66,7 @@ public class ProvinceCityArea { //第三层 区 JSONObject areaJson = baseJson.getJSONObject(cityKey); if(areaJson!=null){ - for(String areaKey:areaJson.keySet()){ - Area area = new Area(areaKey,areaJson.getString(areaKey),cityKey); - this.areaList.add(area); - } + addArea(cityKey, areaJson); } } } @@ -80,6 +77,13 @@ public class ProvinceCityArea { } + private void addArea(String cityKey, JSONObject areaJson) { + for(String areaKey:areaJson.keySet()){ + Area area = new Area(areaKey,areaJson.getString(areaKey),cityKey); + this.areaList.add(area); + } + } + private String jsonRead(File file){ StringBuilder buffer = new StringBuilder();