From 2ccdf3184f80a49284b1137230e17189fa3ff965 Mon Sep 17 00:00:00 2001
From: 张天森 <1292933220@qq.com>
Date: 星期一, 18 七月 2022 18:01:34 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/huacheng_test' into huacheng

---
 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java |   44 ++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
index 826137d..38eea50 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -13,6 +13,8 @@
 
 import javax.annotation.Resource;
 
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.collection.ListUtil;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUnit;
 import cn.hutool.core.date.DateUtil;
@@ -41,6 +43,7 @@
 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 import org.springframework.util.ObjectUtils;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -3567,7 +3570,6 @@
         return R.ok(vo);
     }
 
-
     @Override
     public R uuPush(String washPhone,String phone,String washName,Integer orderStatus) {
         if(StringUtils.isNotEmpty(phone)){
@@ -3599,6 +3601,40 @@
         }
         return R.ok();
     }
+    @Override
+    public R getCommunityList(Integer type) {
+        List<Integer> areaList = areaCodeList();
+        List<AreaVOS> areaVOList=new ArrayList<>();
+        for (Integer code : areaList) {
+            AreaVOS areaVO=new AreaVOS();
+            areaVO.setId(code);
+            areaVO.setName(areaCodeToName(code.longValue()));
+            List<StreetVO> streetVOS = userDao.selectStreetByAreaCode(code);
+            Iterator<StreetVO> iterator = streetVOS.listIterator();
+            while (iterator.hasNext()){
+                StreetVO vo = iterator.next();
+                List<CommunityVO> communityVOS = userDao.selectCommunityByStreetId(vo.getId(), type);
+                vo.setCommunityList(communityVOS);
+                if (type!=3){
+                    if (communityVOS==null || communityVOS.size()==0){
+                        iterator.remove();
+                    }
+                }
+            }
+            List<StreetVOS> list=new ArrayList<>();
+            for (StreetVO streetVO : streetVOS) {
+                StreetVOS vo=new StreetVOS();
+                vo.setId(streetVO.getId());
+                vo.setName(streetVO.getName());
+                vo.setChildList(streetVO.getCommunityList());
+                list.add(vo);
+            }
+            areaVO.setChildList(list);
+            areaVOList.add(areaVO);
+        }
+        return R.ok(areaVOList);
+    }
+
     @Override
     public R getAreaAndStreet() {
         List<Integer> areaCodeList=areaCodeList();
@@ -3739,6 +3775,9 @@
             case "510422":
                 name="盐边县";
                 break;
+            case "510424":
+                name="钒钛新区";
+                break;
         }
         return name;
     }
@@ -3779,11 +3818,12 @@
      * */
     private List<Integer> areaCodeList(){
         List<Integer> list=new ArrayList<>();
-        list.add(510423);
         list.add(510402);
+        list.add(510423);
         list.add(510411);
         list.add(510421);
         list.add(510422);
+        list.add(510424);
         return list;
     }
 

--
Gitblit v1.7.1