From 8a6375edade9f1edc194a0381369fe94e56c13c7 Mon Sep 17 00:00:00 2001 From: tangxiaobao <303826152@qq.com> Date: 星期五, 13 八月 2021 13:16:36 +0800 Subject: [PATCH] Merge branch 'txb' --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActServiceImpl.java | 61 +++++++++++++++++++++++++++++- 1 files changed, 59 insertions(+), 2 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActServiceImpl.java index 489a2e7..68ddeaf 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActServiceImpl.java @@ -4,12 +4,18 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.dtos.community.PageComActDTO; +import com.panzhihua.common.model.dtos.community.switchs.SearchCommunityDTO; +import com.panzhihua.common.model.dtos.user.PageFeedBackDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComActVO; -import com.panzhihua.common.utlis.Snowflake; +import com.panzhihua.common.model.vos.community.ComMngStructOtherBuildVO; +import com.panzhihua.common.model.vos.community.switchs.CommunitySwitchAllAppletsVO; +import com.panzhihua.common.model.vos.community.switchs.StreetAllAppletsVO; import com.panzhihua.service_community.dao.ComActDAO; +import com.panzhihua.service_community.dao.ComActVillageDAO; import com.panzhihua.service_community.dao.ComStreetDAO; import com.panzhihua.service_community.model.dos.ComActDO; +import com.panzhihua.service_community.model.dos.ComMngVillageDO; import com.panzhihua.service_community.model.dos.ComStreetDO; import com.panzhihua.service_community.service.ComActService; import org.springframework.beans.BeanUtils; @@ -19,7 +25,10 @@ import javax.annotation.Resource; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.List; +import java.util.stream.Collectors; /** * @program: springcloud_k8s_panzhihuazhihuishequ @@ -54,7 +63,6 @@ if (integer > 0) { return R.fail("社区已经存在"); } - comActDO.setCommunityId(Snowflake.getId()); BeanUtils.copyProperties(comActVO, comActDO); int insert = comActDAO.insert(comActDO); if (insert > 0) { @@ -193,5 +201,54 @@ return R.fail(); } + /** + * 综治后台-查询社区列表 + * @return 社区列表 + */ + @Override + public R getCommunityLists(){ + return R.ok(this.comActDAO.getCommunityLists()); + } + + /** + * 查询社区所有列表 + * @return 社区列表 + */ + @Override + public R getCommunityAllList(){ + //查询街道列表 + List<StreetAllAppletsVO> streetList = this.comActDAO.getStreetList(); + streetList.forEach(street -> { + //查询街道下社区列表 + List<CommunitySwitchAllAppletsVO> communityList = this.comActDAO.getCommunityListByStreetId(street.getStreetId()); + if(!communityList.isEmpty()){ + street.setChildList(communityList); + street.setCount(communityList.size()); + } + }); + streetList = streetList.stream().sorted(Comparator.comparing(StreetAllAppletsVO::getCount).reversed()).collect(Collectors.toList()); + return R.ok(streetList); + } + + /** + * 根据名字查询所有社区列表 + * @param name 社区名字 + * @return 社区列表 + */ + @Override + public R communitySwitchSearchList(String name){ + return R.ok(this.comActDAO.getCommunityListByName(name)); + } + + /** + * 根据经纬度以及距离搜索附近社区列表 + * @param communityDTO 请求参数 + * @return 社区列表 + */ + @Override + public R communitySwitchSearchDistanceList(SearchCommunityDTO communityDTO){ + return R.ok(this.comActDAO.getCommunityListByNearby(communityDTO)); + } + } -- Gitblit v1.7.1