diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/GisDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/GisDTO.java index a30978e77..5257a0b7e 100644 --- a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/GisDTO.java +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/GisDTO.java @@ -39,6 +39,11 @@ public class GisDTO implements Serializable { */ private String id; + /** + * 网格编码 + */ + private String gridId; + /** * 网格名称 */ diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/GisFormDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/GisFormDTO.java new file mode 100644 index 000000000..919057bdc --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/GisFormDTO.java @@ -0,0 +1,56 @@ +/** + * 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; +import java.util.Date; + +/** + * 北上诉办GIS坐标系统 + * + * @author zhy qu@elink-cn.com + * @since v1.0.0 2022-09-04 + */ +@Data +public class GisFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格编码 + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/GisGridDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/GisGridDTO.java new file mode 100644 index 000000000..26b96cebd --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/GisGridDTO.java @@ -0,0 +1,91 @@ +/** + * 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 java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * gis地图网格与平台网格对应关系表 + * + * @author zhy elink@elink-cn.com + * @since v1.0.0 2022-09-05 + */ +@Data +public class GisGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * gis地图网格ID + */ + private String gisGridId; + + /** + * gis地图网格名称 + */ + private String gisGridName; + + /** + * 逻辑删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/GisGridFormDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/GisGridFormDTO.java new file mode 100644 index 000000000..d4addab73 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/GisGridFormDTO.java @@ -0,0 +1,57 @@ +/** + * 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; +import java.util.Date; + + +/** + * gis地图网格与平台网格对应关系表 + * + * @author zhy elink@elink-cn.com + * @since v1.0.0 2022-09-05 + */ +@Data +public class GisGridFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * gis地图网格ID + */ + private String gisGridId; + + /** + * gis地图网格名称 + */ + private String gisGridName; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/GisGridResultDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/GisGridResultDTO.java new file mode 100644 index 000000000..a671972f2 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/GisGridResultDTO.java @@ -0,0 +1,56 @@ +/** + * 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; + + +/** + * gis地图网格与平台网格对应关系表 + * + * @author zhy elink@elink-cn.com + * @since v1.0.0 2022-09-05 + */ +@Data +public class GisGridResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * gis地图网格ID + */ + private String gisGridId; + + /** + * gis地图网格名称 + */ + private String gisGridName; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysDeptDTO.java b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysDeptDTO.java index 8f2381470..43fce73f5 100644 --- a/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysDeptDTO.java +++ b/esua-epdc/epdc-admin/epdc-admin-client/src/main/java/com/elink/esua/epdc/dto/SysDeptDTO.java @@ -67,6 +67,19 @@ public class SysDeptDTO extends TreeNode implements Serializable { */ private String partyCode; + /** + * 测绘院网格 + */ + private String gisGridName; + + public String getGisGridName() { + return gisGridName; + } + + public void setGisGridName(String gisGridName) { + this.gisGridName = gisGridName; + } + @ApiModelProperty(value = "地址") private String address; diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java index e996128c4..8341271fe 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java @@ -28,6 +28,7 @@ import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; import com.elink.esua.epdc.dto.epdc.result.ExportKpiResultDTO; import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; import com.elink.esua.epdc.entity.SysDeptEntity; +import com.elink.esua.epdc.service.GisService; import com.elink.esua.epdc.service.SysDeptService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -52,6 +53,8 @@ import java.util.Map; public class SysDeptController { @Autowired private SysDeptService sysDeptService; + @Autowired + private GisService gisService; @Resource private SysDeptDao sysDeptDao; @@ -439,7 +442,25 @@ public class SysDeptController { */ @GetMapping("gis/update") public Result getCoordinate() { - sysDeptService.getCoordinate(); + sysDeptService.getCoordinates(null); return new Result(); } + + @PostMapping("gis/getGrid") + public Result getGrid(@RequestBody GisFormDTO formDTO) { + return new Result().ok(sysDeptService.getCoordinate(formDTO)); + } + + /** + * 北上诉办gis坐标下拉 + * + * @param dto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author zhy + * @date 2022/9/5 14:59 + */ + @PostMapping("gis/options") + public Result> getOptions(@RequestBody GisGridFormDTO dto) { + return new Result>().ok(gisService.listGridOption(dto)); + } } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/GisDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/GisDao.java index 412d7c469..0d990b298 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/GisDao.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/GisDao.java @@ -18,9 +18,13 @@ package com.elink.esua.epdc.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.GisGridFormDTO; +import com.elink.esua.epdc.dto.GisGridResultDTO; import com.elink.esua.epdc.entity.GisEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 北上诉办GIS坐标系统 * @@ -39,4 +43,14 @@ public interface GisDao extends BaseDao { * @date 2022/9/4 19:01 */ void clearAll(); + + /** + * 获取GIS网格列表 + * + * @param + * @return java.util.List + * @author zhy + * @date 2022/9/5 10:08 + */ + List listGridOption(GisGridFormDTO 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/GisGridDao.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/GisGridDao.java new file mode 100644 index 000000000..bc6f9904e --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/GisGridDao.java @@ -0,0 +1,43 @@ +/** + * 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.GisGridDTO; +import com.elink.esua.epdc.entity.GisGridEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * gis地图网格与平台网格对应关系表 + * + * @author zhy elink@elink-cn.com + * @since v1.0.0 2022-09-05 + */ +@Mapper +public interface GisGridDao extends BaseDao { + + /** + * 删除历史记录 + * + * @param dto + * @return + * @author zhy + * @date 2022/9/5 10:54 + */ + void deleteByGridName(GisGridDTO 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/GisEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/GisEntity.java index cbfe5305f..67aba34b1 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/GisEntity.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/GisEntity.java @@ -39,6 +39,11 @@ public class GisEntity extends BaseEpdcEntity { private static final long serialVersionUID = 1L; + /** + * 网格编码 + */ + private String gridId; + /** * 网格名称 */ diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/GisGridEntity.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/GisGridEntity.java new file mode 100644 index 000000000..2a2abf83c --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/entity/GisGridEntity.java @@ -0,0 +1,56 @@ +/** + * 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 com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * gis地图网格与平台网格对应关系表 + * + * @author zhy elink@elink-cn.com + * @since v1.0.0 2022-09-05 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_gis_grid") +public class GisGridEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * gis地图网格名称 + */ + private String gisGridName; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/GisGridRedis.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/GisGridRedis.java new file mode 100644 index 000000000..563e47a5b --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/redis/GisGridRedis.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; + +/** + * gis地图网格与平台网格对应关系表 + * + * @author zhy elink@elink-cn.com + * @since v1.0.0 2022-09-05 + */ +@Component +public class GisGridRedis { + @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/GisGridService.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/GisGridService.java new file mode 100644 index 000000000..050df7d05 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/GisGridService.java @@ -0,0 +1,126 @@ +/** + * 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.dto.GisGridDTO; +import com.elink.esua.epdc.dto.SysDeptDTO; +import com.elink.esua.epdc.entity.GisGridEntity; + +import java.util.List; +import java.util.Map; + +/** + * gis地图网格与平台网格对应关系表 + * + * @author zhy elink@elink-cn.com + * @since v1.0.0 2022-09-05 + */ +public interface GisGridService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-09-05 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-09-05 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GisGridDTO + * @author generator + * @date 2022-09-05 + */ + GisGridDTO get(String id); + + /** + * 单条查询 + * + * @param gridName + * @return GisGridDTO + * @author generator + * @date 2022-09-05 + */ + GisGridDTO getByGridName(String gridName); + + /** + * 单条查询 + * + * @param gisGridName + * @return GisGridDTO + * @author generator + * @date 2022-09-05 + */ + GisGridDTO getByGisGridName(String gisGridName); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-09-05 + */ + void save(GisGridDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-09-05 + */ + void update(GisGridDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-09-05 + */ + void delete(String[] ids); + + /** + * 系统网格与gis网格关系存储 + * + * @param dto + * @return void + * @author zhy + * @date 2022/9/5 10:47 + */ + void saveRelation(SysDeptDTO 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/GisService.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/GisService.java index cc1cc2be3..a6c23766b 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/GisService.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/GisService.java @@ -20,6 +20,8 @@ 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.dto.GisDTO; +import com.elink.esua.epdc.dto.GisGridFormDTO; +import com.elink.esua.epdc.dto.GisGridResultDTO; import com.elink.esua.epdc.entity.GisEntity; import java.util.List; @@ -102,4 +104,14 @@ public interface GisService extends BaseService { * @date 2022-09-04 */ void clearAll(); + + /** + * 获取GIS网格列表 + * + * @param + * @return java.util.List + * @author zhy + * @date 2022/9/5 10:08 + */ + List listGridOption(GisGridFormDTO 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/SysDeptService.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java index 5e218652e..414b284f2 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/SysDeptService.java @@ -279,19 +279,19 @@ public interface SysDeptService extends BaseService { /** * @Description: 获取全部的部门基本信息 * @Param: [userSysDeptInfoFormDTO] - * @return: com.elink.esua.epdc.commons.tools.utils.Result> + * @return: com.elink.esua.epdc.commons.tools.utils.Result> * @Author: zy * @Date: 2020-04-14 */ List listAllDeptInfo(UserSysDeptInfoFormDTO formDTO); /** - * @describe: 获得部门类型 - * @author wangtong - * @date 2020/5/15 14:46 - * @param [deptId] - * @return com.elink.esua.epdc.commons.tools.utils.Result - */ + * @param [deptId] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @describe: 获得部门类型 + * @author wangtong + * @date 2020/5/15 14:46 + */ Result getDeptTypeKey(Long deptId); /** @@ -322,39 +322,49 @@ public interface SysDeptService extends BaseService { List getKpiGridIds(KpiGridIdsFormDTO dto); /** - * @describe: 根据网格id获取 社区、街道第三方编码信息 - * @author wangtong - * @date 2020/12/16 16:31 - * @params [deptId] - * @return com.elink.esua.epdc.commons.tools.utils.Result - */ + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @describe: 根据网格id获取 社区、街道第三方编码信息 + * @author wangtong + * @date 2020/12/16 16:31 + * @params [deptId] + */ Result getDeptInfoCode(Long gridId); /** + * @return com.elink.esua.epdc.commons.tools.utils.Result * @describe: 获取所有部门的树状列表 街道-社区-网格 * @author wangtong * @date 2022/8/29 11:01 * @params [gridId] - * @return com.elink.esua.epdc.commons.tools.utils.Result */ Result> getAllDeptTree(); /** + * @return com.elink.esua.epdc.commons.tools.utils.Result * @describe: 通过经纬度获取社区及街道id * @author wangtong * @date 2022/8/31 11:19 * @params [dto] - * @return com.elink.esua.epdc.commons.tools.utils.Result */ Result getDeptIdByItude(DeptItudeFormDTO dto); /** * 获取地理坐标 * - * @param + * @param formDTO * @return void * @author zhy * @date 2022/9/4 18:48 */ - void getCoordinate(); + void getCoordinates(GisFormDTO formDTO); + + /** + * 获取地理坐标 + * + * @param formDTO + * @return com.elink.esua.epdc.dto.GisGridDTO + * @author zhy + * @date 2022/9/5 15:35 + */ + GisGridDTO getCoordinate(GisFormDTO formDTO); } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/GisGridServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/GisGridServiceImpl.java new file mode 100644 index 000000000..7bb1fae84 --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/GisGridServiceImpl.java @@ -0,0 +1,145 @@ +/** + * 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.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dao.GisGridDao; +import com.elink.esua.epdc.dto.GisGridDTO; +import com.elink.esua.epdc.dto.SysDeptDTO; +import com.elink.esua.epdc.entity.GisGridEntity; +import com.elink.esua.epdc.redis.GisGridRedis; +import com.elink.esua.epdc.service.GisGridService; +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.HashMap; +import java.util.List; +import java.util.Map; + +/** + * gis地图网格与平台网格对应关系表 + * + * @author zhy elink@elink-cn.com + * @since v1.0.0 2022-09-05 + */ +@Service +public class GisGridServiceImpl extends BaseServiceImpl implements GisGridService { + + @Autowired + private GisGridRedis gisGridRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GisGridDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GisGridDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + String gridId = (String) params.get("gridId"); + String gridName = (String) params.get("gridName"); + String gisGridId = (String) params.get("gisGridId"); + String gisGridName = (String) params.get("gisGridName"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(gridId), "GRID_ID", gridId); + wrapper.eq(StringUtils.isNotBlank(gridName), "GRID_NAME", gridName); + wrapper.eq(StringUtils.isNotBlank(gisGridId), "GIS_GRID_ID", gisGridId); + wrapper.eq(StringUtils.isNotBlank(gisGridName), "GIS_GRID_NAME", gisGridName); + + return wrapper; + } + + @Override + public GisGridDTO get(String id) { + GisGridEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GisGridDTO.class); + } + + @Override + public GisGridDTO getByGridName(String gridName) { + Map params = new HashMap<>(2); + params.put("gridName", gridName); + GisGridEntity entity = baseDao.selectOne(getWrapper(params)); + return ConvertUtils.sourceToTarget(entity, GisGridDTO.class); + } + + @Override + public GisGridDTO getByGisGridName(String gisGridName) { + Map params = new HashMap<>(2); + params.put("gisGridName", gisGridName); + GisGridEntity entity = baseDao.selectOne(getWrapper(params)); + return ConvertUtils.sourceToTarget(entity, GisGridDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GisGridDTO dto) { + GisGridEntity entity = ConvertUtils.sourceToTarget(dto, GisGridEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GisGridDTO dto) { + GisGridEntity entity = ConvertUtils.sourceToTarget(dto, GisGridEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveRelation(SysDeptDTO dto) { + if (StringUtils.isNotBlank(dto.getGisGridName())) { + GisGridDTO gisGridDTO = new GisGridDTO(); + gisGridDTO.setGridId(dto.getId()); + gisGridDTO.setGridName(dto.getName()); + gisGridDTO.setGisGridName(dto.getGisGridName()); + baseDao.deleteByGridName(gisGridDTO); + + GisGridEntity entity = ConvertUtils.sourceToTarget(gisGridDTO, GisGridEntity.class); + insert(entity); + } + } + +} \ 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/GisServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/GisServiceImpl.java index db28d1529..70e386162 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/GisServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/GisServiceImpl.java @@ -20,11 +20,13 @@ 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.constant.FieldConstant; import com.elink.esua.epdc.dao.GisDao; import com.elink.esua.epdc.dto.GisDTO; +import com.elink.esua.epdc.dto.GisGridFormDTO; +import com.elink.esua.epdc.dto.GisGridResultDTO; import com.elink.esua.epdc.entity.GisEntity; import com.elink.esua.epdc.redis.GisRedis; import com.elink.esua.epdc.service.GisService; @@ -65,8 +67,8 @@ public class GisServiceImpl extends BaseServiceImpl implement return ConvertUtils.sourceToTarget(entityList, GisDTO.class); } - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + 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); @@ -107,4 +109,9 @@ public class GisServiceImpl extends BaseServiceImpl implement baseDao.clearAll(); } + @Override + public List listGridOption(GisGridFormDTO dto) { + return baseDao.listGridOption(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/SysDeptServiceImpl.java b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java index 5bbe10aaa..5fe31ba21 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java @@ -43,6 +43,7 @@ import com.elink.esua.epdc.entity.*; import com.elink.esua.epdc.feign.GroupFeignClient; import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; import com.elink.esua.epdc.rocketmq.producer.OrganizationModifyProducer; +import com.elink.esua.epdc.service.GisGridService; import com.elink.esua.epdc.service.GisService; import com.elink.esua.epdc.service.SysDeptService; import com.elink.esua.epdc.service.SysUserService; @@ -104,6 +105,9 @@ public class SysDeptServiceImpl extends BaseServiceImpl list = new ArrayList<>(); + Map urlParams = new HashMap<>(); - String resultStr = arcGISUtil.getGisStr(); + String resultStr = arcGISUtil.getGisStr(urlParams); JSONObject toResult = JSON.parseObject(resultStr); JSONArray jsonArray = JSON.parseArray(toResult.get("features").toString()); @@ -1374,6 +1389,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl urlParams = new HashMap<>(); + String geometryStr = "point(" + formDTO.getLatitude() + "," + formDTO.getLongitude() + ")"; + urlParams.put("geometry", geometryStr); + + String resultStr = arcGISUtil.getGisStr(urlParams); + JSONObject toResult = JSON.parseObject(resultStr); + JSONArray jsonArray = JSON.parseArray(toResult.get("features").toString()); + + if (jsonArray.size() == NumConstant.ZERO) { + throw new RenException("该坐标不在任何网格内,请重新选择"); + } else if (jsonArray.size() > NumConstant.ONE) { + throw new RenException("该坐标处于多个网格交界处,请重新选择"); + } else { + JSONObject feature = JSON.parseObject(jsonArray.get(0).toString()); + JSONObject attributes = JSON.parseObject(feature.get("attributes").toString()); + String gridName = attributes.get("网格名称").toString(); + String gridId = attributes.get("网格编码").toString(); + + GisGridDTO gisGridDTO = gisGridService.getByGisGridName(gridName); + if (gisGridDTO == null) { + throw new RenException(gridName + "尚未绑定系统网格,请联系管理员"); + } else { + return gisGridDTO; + } + + } + + } + /** * @return java.lang.String * @describe: 访问外部接口获取部门(社区)地区编码 @@ -1486,4 +1534,18 @@ public class SysDeptServiceImpl extends BaseServiceImpl urlParams) { +// String key = RedisKeys.getArcGISKey(); +// Object obj = redisUtils.get(key); +// if (null != obj) { +// return (String) obj; +// } Map paramsMap = new HashMap<>(4); - String data = httpClientUtils.sendPostByJSONAndHeader(GET_GIS_COORDINATE_URL, StringUtils.EMPTY, paramsMap).getResult(); + String url = GET_GIS_COORDINATE_URL; + if (urlParams.containsKey("geometry")) { + url = url + "&geometry=" + urlParams.get("geometry"); + } + String data = httpClientUtils.sendPostByJSONAndHeader(url, StringUtils.EMPTY, paramsMap).getResult(); if (null == data) { throw new RenException("地理坐标获取失败"); } - redisUtils.set(key, data, RedisUtils.DEFAULT_EXPIRE); +// redisUtils.set(key, data, RedisUtils.DEFAULT_EXPIRE); return data; } diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/GisDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/GisDao.xml index 351210fe3..403389520 100644 --- a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/GisDao.xml +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/GisDao.xml @@ -19,4 +19,12 @@ truncate table epdc_gis; + + + \ No newline at end of file diff --git a/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/GisGridDao.xml b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/GisGridDao.xml new file mode 100644 index 000000000..9733f719b --- /dev/null +++ b/esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/GisGridDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + DELETE + FROM + epdc_gis_grid + WHERE + GRID_NAME = '2' + OR GIS_GRID_NAME = '1' + + OR GRID_ID = '1' + + + \ No newline at end of file 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 3d9f6d639..aec4910ee 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 @@ -91,4 +91,5 @@ public class ApiAdminController { ValidatorUtils.validateEntity(dto); return adminService.getDeptIdByItude(dto); } + } diff --git a/renren-cloud-generator/src/main/resources/application.yml b/renren-cloud-generator/src/main/resources/application.yml index a682d3403..b5b99c072 100644 --- a/renren-cloud-generator/src/main/resources/application.yml +++ b/renren-cloud-generator/src/main/resources/application.yml @@ -9,9 +9,9 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://rm-bp1l2b53j508j1176xo.mysql.rds.aliyuncs.com:3306/esua_epdc_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai - username: root - password: Abc@123456 + url: jdbc:mysql://rm-m5eguiv2827bdye798o.mysql.rds.aliyuncs.com:10001/sb_esua_epdc_admin?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai + username: shibei_test + password: Elink@833066 #oracle配置 # driverClassName: oracle.jdbc.OracleDriver # url: jdbc:oracle:thin:@192.168.10.10:1521:helowin