From 70d2a5d0f9c6951b2d4cac954041ed73582ff7eb Mon Sep 17 00:00:00 2001 From: liujie <1793218484@qq.com> Date: 星期一, 09 六月 2025 11:54:00 +0800 Subject: [PATCH] 6.9新增登录失败冻结逻辑 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngProvinceServiceImpl.java | 86 ++++++++++++++++++++++++++++++++++++++----- 1 files changed, 76 insertions(+), 10 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngProvinceServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngProvinceServiceImpl.java index 1e3589f..110a540 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngProvinceServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngProvinceServiceImpl.java @@ -1,25 +1,24 @@ package com.panzhihua.service_community.service.impl; import java.util.ArrayList; +import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; import javax.annotation.Resource; +import com.google.common.collect.Lists; +import com.panzhihua.common.model.vos.community.*; +import com.panzhihua.common.model.vos.community.switchs.CommunitySwitchAllAppletsVO; +import com.panzhihua.common.model.vos.community.switchs.StreetAllAppletsVO; +import com.panzhihua.service_community.dao.*; +import com.panzhihua.service_community.model.dos.ComStreetDO; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.panzhihua.common.model.vos.R; -import com.panzhihua.common.model.vos.community.ComMngAreaVO; -import com.panzhihua.common.model.vos.community.ComMngCityVO; -import com.panzhihua.common.model.vos.community.ComMngDistrictVO; -import com.panzhihua.common.model.vos.community.ComMngProvinceVO; -import com.panzhihua.service_community.dao.ComMngCityDAO; -import com.panzhihua.service_community.dao.ComMngDistrictDAO; -import com.panzhihua.service_community.dao.ComMngProvinceDAO; -import com.panzhihua.service_community.dao.ComMngStructAreaDAO; import com.panzhihua.service_community.model.dos.ComMngCityDO; import com.panzhihua.service_community.model.dos.ComMngDistrictDO; import com.panzhihua.service_community.model.dos.ComMngProvinceDO; @@ -38,7 +37,11 @@ private ComMngDistrictDAO comMngDistrictDAO; @Resource - private ComMngStructAreaDAO comMngStructAreaDAO; + private ComStreetDAO comStreetDAO; + + + @Resource + private ComActDAO comActDAO; @Override public R getProvince() { @@ -79,10 +82,13 @@ } @Override - public R getCityTreeByProvinceCode(Integer provinceAdcode) { + public R getCityTreeByProvinceCode(Integer provinceAdcode,String areaCode) { + //省份 List<ComMngProvinceDO> provinceDOS = comMngProvinceDAO.selectList( new QueryWrapper<ComMngProvinceDO>().lambda().eq(ComMngProvinceDO::getProvinceAdcode, provinceAdcode)); + //市 List<ComMngCityDO> cityDOS = comMngCityDAO.selectList(new QueryWrapper<>()); + List<ComMngDistrictDO> districtDOS = comMngDistrictDAO.selectList(new QueryWrapper<>()); List<ComMngAreaVO> vos = new ArrayList<>(); provinceDOS.forEach(p -> { @@ -107,4 +113,64 @@ }); return R.ok(vos); } + + @Override + public R getCityTreeByCode(Integer provinceAdcode, String areaCode,String appId) { + //四川省 + List<ComMngProvinceDO> provinceDOS = comMngProvinceDAO.selectList( + new QueryWrapper<ComMngProvinceDO>().lambda().eq(ComMngProvinceDO::getProvinceAdcode, provinceAdcode)); + List<ComMngCityDO> cityDOS = comMngCityDAO.selectList(new QueryWrapper<>()); + List<ComMngDistrictDO> districtDOS = comMngDistrictDAO.selectList(new QueryWrapper<>()); + List<ComMngAreaVO> vos = new ArrayList<>(); + provinceDOS.forEach(p -> { + ComMngAreaVO pvo = new ComMngAreaVO(p.getProvinceAdcode(), p.getProvinceName()); + List<ComMngCityDO> citys = cityDOS.stream().filter( + city -> city.getProvinceAdcode().equals(p.getProvinceAdcode()) && city.getCityAdcode().equals(510400)) + .collect(Collectors.toList()); + citys.forEach(c -> { + ComMngAreaVO cityVo = new ComMngAreaVO(c.getCityAdcode(), c.getCityName()); + BeanUtils.copyProperties(c, cityVo); + pvo.getChildren().add(cityVo); + List<ComMngDistrictDO> districts = + districtDOS.stream().filter(district -> district.getCityAdcode().equals(c.getCityAdcode())) + .collect(Collectors.toList()); + districts.forEach(d -> { + ComMngAreaVO districtVo = new ComMngAreaVO(d.getDistrictAdcode(), d.getDistrictName()); + BeanUtils.copyProperties(d, districtVo); + cityVo.getChildren().add(districtVo); + vos.add(districtVo); + + LambdaQueryWrapper<ComStreetDO> param = new QueryWrapper<ComStreetDO>().lambda(); + ComStreetVO comStreetVO=new ComStreetVO(); + comStreetVO.setAreaCode(d.getDistrictAdcode()); + if (comStreetVO.getAreaCode() != null) { + param.eq(ComStreetDO::getAreaCode, comStreetVO.getAreaCode()) + .eq(ComStreetDO::getAppId, appId); + } + List<ComStreetDO> comStreetDOS = comStreetDAO.selectList(param); + comStreetDOS.forEach(dos -> + { + ComMngAreaVO csd = new ComMngAreaVO(0, dos.getName()); + BeanUtils.copyProperties(dos, csd); + districtVo.getChildren().add(csd); + + // 查询街道下社区列表 + List<CommunitySwitchAllAppletsVO> communityList = comActDAO.getCommunityListByStreetId(dos.getStreetId()); + + communityList.forEach(commItem -> + { + ComMngAreaVO cssd = new ComMngAreaVO(0, commItem.getName(),commItem.getCommunityId()+""); + BeanUtils.copyProperties(commItem, cssd); + csd.getChildren().add(cssd); + }); + + + }); + + + }); + }); + }); + return R.ok(vos); + } } -- Gitblit v1.7.1