huanghongfa
2021-07-15 20265a287301b45ff7bb7de6a197b8110feaa853
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));
    }
}