From 20265a287301b45ff7bb7de6a197b8110feaa853 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期四, 15 七月 2021 17:38:37 +0800
Subject: [PATCH] 修改bug以及app端登录如果未绑定网格提示接口、首页左上角网格选择接口

---
 springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventGridMemberRelationServiceImpl.java |   31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventGridMemberRelationServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventGridMemberRelationServiceImpl.java
index 2370ba7..b997847 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventGridMemberRelationServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventGridMemberRelationServiceImpl.java
@@ -8,6 +8,7 @@
 import com.panzhihua.common.model.vos.R;
 import com.panzhihua.common.model.vos.grid.EventGridMemberRelationDetailsVO;
 import com.panzhihua.common.model.vos.grid.EventGridMemberRelationVO;
+import com.panzhihua.common.model.vos.grid.EventMapGridVO;
 import com.panzhihua.common.model.vos.grid.admin.GridMemberCascadeVO;
 import com.panzhihua.common.service.user.UserService;
 import com.panzhihua.service_grid.dao.*;
@@ -134,7 +135,35 @@
         if(memberCascadeAddDTO.getType() == null){
             return R.fail("参数错误");
         }
-        return R.ok(this.baseMapper.getGridMemberCascade(memberCascadeAddDTO.getType(),memberCascadeAddDTO.getSuperiorId()));
+        List<GridMemberCascadeVO> memberCascadeList = this.baseMapper.getGridMemberCascade(memberCascadeAddDTO.getType(),memberCascadeAddDTO.getSuperiorId());
+
+        List<GridMemberCascadeVO> result = new ArrayList<>();
+        if(!memberCascadeList.isEmpty()){
+            memberCascadeList.forEach(cascade -> {
+                if(memberCascadeAddDTO.getType().equals(1)){//过滤无小区的社区
+                    Integer count = this.baseMapper.getVillageCount(cascade.getId());
+                    if(count > 0){
+                        result.add(cascade);
+                    }
+                }else if(memberCascadeAddDTO.getType().equals(2)){//过滤无楼栋的小区
+                    Integer count = this.baseMapper.getBuildingCount(cascade.getId());
+                    if(count > 0){
+                        result.add(cascade);
+                    }
+                }else{
+                    if(!cascade.getName().contains("栋")){
+                        cascade.setName(cascade.getName() + "栋");
+                    }
+                    result.add(cascade);
+                }
+            });
+        }
+        return R.ok(result);
+    }
+
+    @Override
+    public R getMapGridListsByApp(EventGridCascadeListDTO cascadeListDTO){
+        return R.ok(eventGridMemberRelationMapper.getMapGridListsByApp(cascadeListDTO));
     }
 
 }

--
Gitblit v1.7.1