| | |
| | | import com.panzhihua.sangeshenbian.model.entity.SystemMenu; |
| | | import com.panzhihua.sangeshenbian.model.entity.SystemRoleMenu; |
| | | import com.panzhihua.sangeshenbian.model.entity.SystemUser; |
| | | import com.panzhihua.sangeshenbian.model.vo.RegionVO; |
| | | import com.panzhihua.sangeshenbian.service.ISystemMenuService; |
| | | import com.panzhihua.sangeshenbian.service.ISystemRoleMenuService; |
| | | import com.panzhihua.sangeshenbian.service.ISystemUserService; |
| | |
| | | @ApiImplicitParam(name = "tier", value = "数据层级(2=区县,3=街道,4=社区)", required = true, dataType = "int"), |
| | | }) |
| | | @OperLog(operModul = "三个身边后台",operType = 0,businessType = "获取行政区划层级联动数据") |
| | | public R<List<Map<String, String>>> getAdministrativeDivision(@PathVariable("id") String id, @PathVariable("tier") Integer tier){ |
| | | List<Map<String, String>> list = new ArrayList<>(); |
| | | public R<List<RegionVO>> getAdministrativeDivision(@PathVariable("id") String id, @PathVariable("tier") Integer tier){ |
| | | List<RegionVO> list = new ArrayList<>(); |
| | | //区县 |
| | | if(2 == tier){ |
| | | list = systemUserService.getRegion("510400"); |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.sangeshenbian.model.entity.SystemUser; |
| | | import com.panzhihua.sangeshenbian.model.vo.RegionVO; |
| | | import com.panzhihua.sangeshenbian.warpper.SystemUserList; |
| | | import com.panzhihua.sangeshenbian.warpper.SystemUserListVo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | * @param pcode |
| | | * @return |
| | | */ |
| | | List<Map<String, String>> getRegion(@Param("pcode") String pcode); |
| | | List<RegionVO> getRegion(@Param("pcode") String pcode); |
| | | |
| | | /** |
| | | * 获取街道数据 |
| | | * @param areaCode |
| | | * @return |
| | | */ |
| | | List<Map<String, String>> getStreet(@Param("areaCode") String areaCode); |
| | | List<RegionVO> getStreet(@Param("areaCode") String areaCode); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param streetId |
| | | * @return |
| | | */ |
| | | List<Map<String, String>> getCommunity(@Param("streetId") String streetId); |
| | | List<RegionVO> getCommunity(@Param("streetId") String streetId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.sangeshenbian.model.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2025/2/28 |
| | | */ |
| | | @Data |
| | | @ApiModel("区域视图对象") |
| | | public class RegionVO { |
| | | @ApiModelProperty("主键id") |
| | | private String id; |
| | | @ApiModelProperty("名称") |
| | | private String name; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.sangeshenbian.model.entity.SystemUser; |
| | | import com.panzhihua.sangeshenbian.model.vo.RegionVO; |
| | | import com.panzhihua.sangeshenbian.warpper.SystemUserList; |
| | | import com.panzhihua.sangeshenbian.warpper.SystemUserListVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | |
| | | * @param pcode |
| | | * @return |
| | | */ |
| | | List<Map<String, String>> getRegion(String pcode); |
| | | List<RegionVO> getRegion(String pcode); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param areaCode |
| | | * @return |
| | | */ |
| | | List<Map<String, String>> getStreet(String areaCode); |
| | | List<RegionVO> getStreet(String areaCode); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param streetId |
| | | * @return |
| | | */ |
| | | List<Map<String, String>> getCommunity(String streetId); |
| | | List<RegionVO> getCommunity(String streetId); |
| | | } |
| | |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.sangeshenbian.dao.SystemUserMapper; |
| | | import com.panzhihua.sangeshenbian.model.entity.SystemUser; |
| | | import com.panzhihua.sangeshenbian.model.vo.RegionVO; |
| | | import com.panzhihua.sangeshenbian.service.ISystemUserService; |
| | | import com.panzhihua.sangeshenbian.warpper.SystemUserList; |
| | | import com.panzhihua.sangeshenbian.warpper.SystemUserListVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, String>> getRegion(String pcode) { |
| | | public List<RegionVO> getRegion(String pcode) { |
| | | return this.baseMapper.getRegion(pcode); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, String>> getStreet(String areaCode) { |
| | | public List<RegionVO> getStreet(String areaCode) { |
| | | return this.baseMapper.getStreet(areaCode); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, String>> getCommunity(String streetId) { |
| | | public List<RegionVO> getCommunity(String streetId) { |
| | | return this.baseMapper.getCommunity(streetId); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | <select id="getRegion" resultType="map"> |
| | | <select id="getRegion" resultType="com.panzhihua.sangeshenbian.model.vo.RegionVO"> |
| | | select region_code as id, region_name as name from bc_region where parent_id = #{pcode} |
| | | </select> |
| | | |
| | | |
| | | <select id="getStreet" resultType="map"> |
| | | <select id="getStreet" resultType="com.panzhihua.sangeshenbian.model.vo.RegionVO"> |
| | | select CAST(street_id AS CHAR) as id, name as name from com_street where area_code = #{areaCode} |
| | | </select> |
| | | |
| | | |
| | | <select id="getCommunity" resultType="map"> |
| | | <select id="getCommunity" resultType="com.panzhihua.sangeshenbian.model.vo.RegionVO"> |
| | | select CAST(Scommunity_id AS CHAR) as id, name as name from com_act where street_id = #{streetId} |
| | | </select> |
| | | |