diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/CityDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/CityDTO.java new file mode 100644 index 000000000..50e563873 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/CityDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 2019版全国5级信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@Data +public class CityDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 区划代码 + */ + private Long id; + + /** + * 名称 + */ + private String name; + + /** + * 父级区划代码 + */ + private Long pid; + + /** + * 省代码 + */ + private Long provinceCode; + + /** + * 市代码 + */ + private Long cityCode; + + /** + * 区代码 + */ + private Long areaCode; + + /** + * 街道代码 + */ + private Long streetCode; + + /** + * 居委/社区 + */ + private Long committeeCode; + + /** + * 简称 + */ + private String shortName; + + /** + * 区号 + */ + private String cityNo; + + /** + * 纬度 + */ + private String lat; + + /** + * 经度 + */ + private String lng; + + /** + * 排序 + */ + private Integer sort; + + /** + * 级别: 0-国家 ,1-省, 2-市, 3-区/县, 4-街/镇, 5-社区/居委 + */ + private Integer level; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/CityAreaFormDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/CityAreaFormDTO.java new file mode 100644 index 000000000..9b4ca816f --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/CityAreaFormDTO.java @@ -0,0 +1,17 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @program: epdc-cloud-api-yushan + * @description: + * @author: wangtong + * @create: 2021-10-14 09:31 + **/ +@Data +public class CityAreaFormDTO implements Serializable { + + private String pid; +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/SysCityAreaFormDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/SysCityAreaFormDTO.java new file mode 100644 index 000000000..6a1915652 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/SysCityAreaFormDTO.java @@ -0,0 +1,23 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @program: epdc-cloud-admin-yushan + * @description: + * @author: wangtong + * @create: 2021-10-15 10:30 + **/ +@Data +public class SysCityAreaFormDTO implements Serializable { + + private String value; + + + private String label; + + + private String pid; +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/CityController.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/CityController.java new file mode 100644 index 000000000..6dcad4923 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/CityController.java @@ -0,0 +1,119 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.CityDTO; +import com.elink.esua.epdc.dto.epdc.form.CityAreaFormDTO; +import com.elink.esua.epdc.excel.CityExcel; +import com.elink.esua.epdc.service.CityService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 2019版全国5级信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@RestController +@RequestMapping("city") +public class CityController { + + @Autowired + private CityService cityService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = cityService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CityDTO data = cityService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CityDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + cityService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CityDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + cityService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + cityService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = cityService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CityExcel.class); + } + + /** + * @describe: 居民端-行程上报获取省/市/区/街道/社区信息,通过pid + * @author wangtong + * @date 2021/10/14 9:35 + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + @GetMapping("getAreaInfo") + public Result getAreaInfo(@RequestBody CityAreaFormDTO dto) { + return cityService.getAreaInfo(dto); + } + + /** + * @describe: PC端-行程上报获取省/市/区/街道/社区信息,通过pid + * @author wangtong + * @date 2021/10/14 9:35 + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + @GetMapping("getSysAreaInfo") + public Result getSysAreaInfo(CityAreaFormDTO dto) { + return cityService.getSysAreaInfo(dto); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CityDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CityDao.java new file mode 100644 index 000000000..901ae9945 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/CityDao.java @@ -0,0 +1,54 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.epdc.form.CityAreaFormDTO; +import com.elink.esua.epdc.dto.epdc.form.SysCityAreaFormDTO; +import com.elink.esua.epdc.entity.CityEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 2019版全国5级信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@Mapper +public interface CityDao extends BaseDao { + + /** + * @describe: 居民端-行程上报获取省/市/区/街道/社区信息,通过pid + * @author wangtong + * @date 2021/10/14 9:35 + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + List getAreaInfoByPid(CityAreaFormDTO dto); + + /** + * @describe: PC端-行程上报获取省/市/区/街道/社区信息,通过pid + * @author wangtong + * @date 2021/10/14 9:35 + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + List getSysAreaInfo(CityAreaFormDTO dto); +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CityEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CityEntity.java new file mode 100644 index 000000000..1908dd25d --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/CityEntity.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 2019版全国5级信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("city") +public class CityEntity { + + private static final long serialVersionUID = 1L; + + /** + * 区划代码 + */ + private Long id; + + /** + * 名称 + */ + private String name; + + /** + * 父级区划代码 + */ + private Long pid; + + /** + * 省代码 + */ + private Long provinceCode; + + /** + * 市代码 + */ + private Long cityCode; + + /** + * 区代码 + */ + private Long areaCode; + + /** + * 街道代码 + */ + private Long streetCode; + + /** + * 居委/社区 + */ + private Long committeeCode; + + /** + * 简称 + */ + private String shortName; + + /** + * 区号 + */ + private String cityNo; + + /** + * 纬度 + */ + private String lat; + + /** + * 经度 + */ + private String lng; + + /** + * 排序 + */ + private Integer sort; + + /** + * 级别: 0-国家 ,1-省, 2-市, 3-区/县, 4-街/镇, 5-社区/居委 + */ + private Integer level; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/CityExcel.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/CityExcel.java new file mode 100644 index 000000000..603312fca --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/excel/CityExcel.java @@ -0,0 +1,75 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +/** + * 2019版全国5级信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@Data +public class CityExcel { + + @Excel(name = "区划代码") + private Long id; + + @Excel(name = "名称") + private String name; + + @Excel(name = "父级区划代码") + private Long pid; + + @Excel(name = "省代码") + private Long provinceCode; + + @Excel(name = "市代码") + private Long cityCode; + + @Excel(name = "区代码") + private Long areaCode; + + @Excel(name = "街道代码") + private Long streetCode; + + @Excel(name = "居委/社区") + private Long committeeCode; + + @Excel(name = "简称") + private String shortName; + + @Excel(name = "区号") + private String cityNo; + + @Excel(name = "纬度") + private String lat; + + @Excel(name = "经度") + private String lng; + + @Excel(name = "排序") + private Integer sort; + + @Excel(name = "级别: 0-国家 ,1-省, 2-市, 3-区/县, 4-街/镇, 5-社区/居委") + private Integer level; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/CityRedis.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/CityRedis.java new file mode 100644 index 000000000..b68f03937 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/CityRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 2019版全国5级信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@Component +public class CityRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/CityService.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/CityService.java new file mode 100644 index 000000000..e0b26ce34 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/CityService.java @@ -0,0 +1,115 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.CityDTO; +import com.elink.esua.epdc.dto.epdc.form.CityAreaFormDTO; +import com.elink.esua.epdc.entity.CityEntity; + +import java.util.List; +import java.util.Map; + +/** + * 2019版全国5级信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +public interface CityService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-14 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-14 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CityDTO + * @author generator + * @date 2021-10-14 + */ + CityDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-14 + */ + void save(CityDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-14 + */ + void update(CityDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-14 + */ + void delete(String[] ids); + + /** + * @describe: 行程上报获取省/市/区/街道/社区信息,通过pid + * @author wangtong + * @date 2021/10/14 9:35 + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + Result getAreaInfo(CityAreaFormDTO dto); + + /** + * @describe: PC端-行程上报获取省/市/区/街道/社区信息,通过pid + * @author wangtong + * @date 2021/10/14 9:35 + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + Result getSysAreaInfo(CityAreaFormDTO dto); +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/CityServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/CityServiceImpl.java new file mode 100644 index 000000000..62148295b --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/CityServiceImpl.java @@ -0,0 +1,123 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dao.CityDao; +import com.elink.esua.epdc.dto.CityDTO; +import com.elink.esua.epdc.dto.epdc.form.CityAreaFormDTO; +import com.elink.esua.epdc.dto.epdc.form.SysCityAreaFormDTO; +import com.elink.esua.epdc.entity.CityEntity; +import com.elink.esua.epdc.redis.CityRedis; +import com.elink.esua.epdc.service.CityService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 2019版全国5级信息表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-10-14 + */ +@Slf4j +@Service +public class CityServiceImpl extends BaseServiceImpl implements CityService { + + @Autowired + private CityRedis cityRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CityDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CityDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CityDTO get(String id) { + CityEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CityDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CityDTO dto) { + CityEntity entity = ConvertUtils.sourceToTarget(dto, CityEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CityDTO dto) { + CityEntity entity = ConvertUtils.sourceToTarget(dto, CityEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result getAreaInfo(CityAreaFormDTO dto) { + log.info("dto:"+dto); + List result = baseDao.getAreaInfoByPid(dto); + return new Result().ok(result); + } + + @Override + public Result getSysAreaInfo(CityAreaFormDTO dto) { + log.info("dto:"+dto); + List result = baseDao.getSysAreaInfo(dto); + return new Result().ok(result); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CityDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CityDao.xml new file mode 100644 index 000000000..8dc688950 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/CityDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-cloud-commons-shibei b/esua-epdc/epdc-cloud-commons-shibei index 0827892c5..3eb7590cb 160000 --- a/esua-epdc/epdc-cloud-commons-shibei +++ b/esua-epdc/epdc-cloud-commons-shibei @@ -1 +1 @@ -Subproject commit 0827892c5f98b395d5f332eec0d4bbd9ba02e9bf +Subproject commit 3eb7590cbdd89224de0b0a8d7ec9a7a851667e49 diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAdminController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAdminController.java index b7b126091..fe7da306b 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAdminController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAdminController.java @@ -5,6 +5,7 @@ import com.elink.esua.epdc.commons.tools.annotation.LoginUser; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.AppUserIdMenuDTO; import com.elink.esua.epdc.dto.CompleteDeptDTO; +import com.elink.esua.epdc.dto.epdc.form.CityAreaFormDTO; import com.elink.esua.epdc.service.AdminService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -51,4 +52,16 @@ public class ApiAdminController { public Result getAppMenu(@LoginUser TokenDto userDetail, @RequestBody AppUserIdMenuDTO dto) { return adminService.getAppMenu(userDetail,dto); } + + /** + * @describe: 行程上报获取省/市/区/街道/社区信息,通过pid + * @author wangtong + * @date 2021/10/14 9:35 + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + @GetMapping("/city/getAreaInfo") + public Result getAreaInfo(CityAreaFormDTO formDto){ + return adminService.getAreaInfo(formDto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java index dcf8b7b07..7e3f66c99 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AdminFeignClient.java @@ -1,10 +1,10 @@ package com.elink.esua.epdc.feign; -import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.epdc.GridLeaderRegisterDTO; +import com.elink.esua.epdc.dto.epdc.form.CityAreaFormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAppIndexPanelResultDTO; import com.elink.esua.epdc.dto.epdc.result.UserWorkAndAnalyOpenIdDTO; import com.elink.esua.epdc.dto.form.SendMessageFormDTO; @@ -74,12 +74,12 @@ public interface AdminFeignClient { Result getSysUserInfoByOpenId(@PathVariable("openId") String openId); /** - * @describe: 数据端-根据analysisOpenId获取用户信息 - * @author wangtong - * @date 2020/5/26 20:00 - * @param [openId] - * @return com.elink.esua.epdc.commons.tools.utils.Result - */ + * @param analysisOpenId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @describe: 数据端-根据analysisOpenId获取用户信息 + * @author wangtong + * @date 2020/5/26 20:00 + */ @GetMapping("sys/user/getUserInfoBy/{analysisOpenId}") Result getSysUserInfoByAnalysisOpenId(@PathVariable("analysisOpenId") String analysisOpenId); @@ -104,43 +104,43 @@ public interface AdminFeignClient { Result getDeptTreeForEpiDemic(); /** - * @describe: 判断是否更新头像 - * @author wangtong - * @date 2020/3/30 13:43 - * @param [] - * @return com.elink.esua.epdc.commons.tools.utils.Result - */ + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @describe: 判断是否更新头像 + * @author wangtong + * @date 2020/3/30 13:43 + */ @GetMapping("sys/user/checkUpdateAvatar") Result checkUpdateAvatar(); /** - * @describe: 更新头像 - * @author wangtong - * @date 2020/3/30 16:17 - * @param [avatar] - * @return com.elink.esua.epdc.commons.tools.utils.Result - */ - @GetMapping(value="sys/user/updateAvatar", consumes = MediaType.APPLICATION_JSON_VALUE) + * @param avatar + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @describe: 更新头像 + * @author wangtong + * @date 2020/3/30 16:17 + */ + @GetMapping(value = "sys/user/updateAvatar", consumes = MediaType.APPLICATION_JSON_VALUE) Result updateAvatar(@RequestParam("avatar") String avatar); /** + * @param dto + * @return com.elink.esua.epdc.commons.tools.utils.Result * @describe: 修改用户密码 * @author wangtong * @date 2020/5/7 10:04 - * @param [dto] - * @return com.elink.esua.epdc.commons.tools.utils.Result */ - @PostMapping(value="sys/user/modifyPwd", consumes = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(value = "sys/user/modifyPwd", consumes = MediaType.APPLICATION_JSON_VALUE) Result modifyPwd(ModifyPwdDTO dto); /** - * @describe: 获得部门类型 - * @author wangtong - * @date 2020/5/15 14:41 - * @param [deptId] - * @return com.elink.esua.epdc.commons.tools.utils.Result - */ - @GetMapping(value="sys/dept/getDeptTypeKey", consumes = MediaType.APPLICATION_JSON_VALUE) + * @param deptId + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @describe: 获得部门类型 + * @author wangtong + * @date 2020/5/15 14:41 + */ + @GetMapping(value = "sys/dept/getDeptTypeKey", consumes = MediaType.APPLICATION_JSON_VALUE) Result getDeptTypeKey(@RequestParam("deptId") Long deptId); /** @@ -154,12 +154,22 @@ public interface AdminFeignClient { Result userRelationWorkAndAnalyOpenId(SendMessageFormDTO formDto); /** + * @param dto + * @return com.elink.esua.epdc.commons.tools.utils.Result * @describe: 获取小程序菜单 * @author wgf * @date 2022/3/7 9:44 - * @param dto - * @return com.elink.esua.epdc.commons.tools.utils.Result */ - @PostMapping(value="sys/user/getAppMenu", consumes = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(value = "sys/user/getAppMenu", consumes = MediaType.APPLICATION_JSON_VALUE) Result getAppMenu(AppUserIdMenuDTO dto); + + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @describe: 行程上报获取省/市/区/街道/社区信息,通过pid + * @author wangtong + * @date 2021/10/14 9:35 + * @params [formDto] + */ + @GetMapping(value = "sys/city/getAreaInfo", consumes = MediaType.APPLICATION_JSON_VALUE) + Result getAreaInfo(CityAreaFormDTO formDto); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java index 013e1d47e..b8a7892a8 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AdminFeignClientFallback.java @@ -6,6 +6,7 @@ import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.*; import com.elink.esua.epdc.dto.epdc.GridLeaderRegisterDTO; +import com.elink.esua.epdc.dto.epdc.form.CityAreaFormDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcAppIndexPanelResultDTO; import com.elink.esua.epdc.dto.form.SendMessageFormDTO; import com.elink.esua.epdc.feign.AdminFeignClient; @@ -85,4 +86,9 @@ public class AdminFeignClientFallback implements AdminFeignClient { public Result getAppMenu(AppUserIdMenuDTO dto) { return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getAppMenu",dto); } + + @Override + public Result getAreaInfo(CityAreaFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getAreaInfo", formDto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AdminService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AdminService.java index 12b3db282..ce445219b 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AdminService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AdminService.java @@ -4,6 +4,7 @@ import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.AppUserIdMenuDTO; import com.elink.esua.epdc.dto.CompleteDeptDTO; +import com.elink.esua.epdc.dto.epdc.form.CityAreaFormDTO; /** * 管理端相关接口 @@ -41,4 +42,13 @@ public interface AdminService { * @return com.elink.esua.epdc.commons.tools.utils.Result */ Result getAppMenu(TokenDto userDetail, AppUserIdMenuDTO dto); + + /** + * @describe: 行程上报获取省/市/区/街道/社区信息,通过pid + * @author wangtong + * @date 2021/10/14 9:35 + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + Result getAreaInfo(CityAreaFormDTO formDto); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AdminServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AdminServiceImpl.java index fa134c5e5..1538e1fec 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AdminServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AdminServiceImpl.java @@ -4,6 +4,7 @@ import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.AppUserIdMenuDTO; import com.elink.esua.epdc.dto.CompleteDeptDTO; +import com.elink.esua.epdc.dto.epdc.form.CityAreaFormDTO; import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.service.AdminService; import lombok.extern.slf4j.Slf4j; @@ -50,4 +51,10 @@ public class AdminServiceImpl implements AdminService { dto.setGridId(userDetail.getGridId()); return adminFeignClient.getAppMenu(dto); } + + @Override + public Result getAreaInfo(CityAreaFormDTO formDto) { + log.info("formDto:"+formDto); + return adminFeignClient.getAreaInfo(formDto); + } }