| | |
| | | package cn.huge.module.kind.controller.web; |
| | | |
| | | import cn.huge.base.common.utils.ObjectUtils; |
| | | import cn.huge.base.common.utils.ReturnFailUtils; |
| | | import cn.huge.base.common.utils.ReturnSucUtils; |
| | | import cn.huge.module.kind.domain.dto.RegionSelectJSDTO; |
| | | import cn.huge.module.kind.domain.dto.RegionSelectSaveDTO; |
| | | import cn.huge.module.kind.domain.po.SyRegion; |
| | | import cn.huge.module.kind.service.SyRegionService; |
| | | import cn.huge.module.sys.dto.QueAddrBaseDTO; |
| | | import cn.huge.module.sys.dto.QueAreaDTO; |
| | | import cn.huge.module.utils.BaiduMapAddrDTO; |
| | | import cn.huge.module.utils.BaiduMapUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.google.common.collect.Maps; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | |
| | | * @description: 地域字典表接口api-web端 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-28 20:06:20 |
| | | * @time: 2024-09-09 14:31:22 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * js数据入库 |
| | | * @url {ctx}/api/web/syRegion/saveByJS |
| | | * @param regionSelectJSDTO 实体对象 |
| | | * @return Object |
| | | */ |
| | | @PostMapping("/saveByJS") |
| | | public Object saveByJS(@RequestBody RegionSelectSaveDTO regionSelectJSDTO) { |
| | | try { |
| | | service.webSaveByJSTree(regionSelectJSDTO.getRegionList(), regionSelectJSDTO.getStartLevel()); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据百度地图经纬度获取街道 |
| | | * @url {ctx}/api/web/syRegion/getQueAddrByBaiduiLngLat |
| | | * @param lng 经度 |
| | | * @param lat 维度 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getQueAddrByBaiduiLngLat") |
| | | public Object getQueAddrByBaiduiLngLat(@RequestParam(value = "lng") String lng, @RequestParam(value = "lat") String lat) { |
| | | try { |
| | | QueAddrBaseDTO queAddrBaseDTO = service.getQueAddrByBaiduiLngLat(lng, lat); |
| | | return ReturnSucUtils.getRepInfo(queAddrBaseDTO); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据父类ID获取列表 |
| | | * @url {ctx}/api/web/syRegion/listByParentId |
| | | * @return |
| | | */ |
| | | @GetMapping("/listByParentId") |
| | | public Object listByParentId(@RequestParam(value = "parentId") String parentId) { |
| | | try { |
| | | List<QueAreaDTO> list = service.listByParentId(parentId); |
| | | return ReturnSucUtils.getRepInfo(list); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | } |