From 2d46e7bdebd6845c3291ef4faed8ed8fa7911cd9 Mon Sep 17 00:00:00 2001
From: fengjin <1435304038@qq.com>
Date: 星期五, 30 九月 2022 14:40:35 +0800
Subject: [PATCH] 修改bug 获取所属地区

---
 flower_city/src/main/java/com/dg/core/service/impl/AreaCodeServiceImpl.java |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/flower_city/src/main/java/com/dg/core/service/impl/AreaCodeServiceImpl.java b/flower_city/src/main/java/com/dg/core/service/impl/AreaCodeServiceImpl.java
index f1ba531..e92397a 100644
--- a/flower_city/src/main/java/com/dg/core/service/impl/AreaCodeServiceImpl.java
+++ b/flower_city/src/main/java/com/dg/core/service/impl/AreaCodeServiceImpl.java
@@ -46,6 +46,7 @@
            return baseMapper.selectByIdSet(areaCodes);
     }
 
+
     public  List<String> getAreaCodeIds(List<String> areaCodes, OrganizationChartEntity organizationChartEntity){
        List<OrganizationChartEntity>  organizationChartEntitys= organizationChartMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda()
                 .eq(OrganizationChartEntity::getParentId, organizationChartEntity.getId()));
@@ -61,5 +62,15 @@
         return  areaCodes;
     }
 
+    @Override
+    public  List<AreaCode2022> getListByPCode(String id){
+        List<AreaCode2022> areaCode2022s = baseMapper.selectList(new QueryWrapper<AreaCode2022>().lambda().eq(AreaCode2022::getPcode, id));
+        for (AreaCode2022 areaCode2022:areaCode2022s) {
+            if (areaCode2022.getLevel()!=4)
+              areaCode2022.setChild(this.getListByPCode(areaCode2022.getCode().toString()));
+        }
+      return  areaCode2022s;
+    }
+
 
 }

--
Gitblit v1.7.1