From 5a3533dca3aae93119c953f97d6dd19aa8456fc8 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Mon, 27 Jun 2022 17:45:42 +0800 Subject: [PATCH 01/31] =?UTF-8?q?=E5=8F=8C=E5=AE=9E=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BD=95=E5=85=A5-=E6=96=B0=E5=A2=9E=E8=A1=A8=E3=80=81?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/IcBuildingDTO.java | 17 +++- .../main/java/com/epmet/dto/IcHouseDTO.java | 6 +- .../java/com/epmet/dto/IcNeighborHoodDTO.java | 15 ++++ .../epmet/dto/IcOrganizationCodeInfoDTO.java | 44 ++++++++++ .../IcOrganizationCodeInfoController.java | 82 +++++++++++++++++ .../epmet/dao/IcOrganizationCodeInfoDao.java | 16 ++++ .../com/epmet/entity/IcBuildingEntity.java | 15 ++++ .../java/com/epmet/entity/IcHouseEntity.java | 5 ++ .../epmet/entity/IcNeighborHoodEntity.java | 15 ++++ .../entity/IcOrganizationCodeInfoEntity.java | 45 ++++++++++ .../excel/IcOrganizationCodeInfoExcel.java | 33 +++++++ .../redis/IcOrganizationCodeInfoRedis.java | 30 +++++++ .../IcOrganizationCodeInfoService.java | 78 +++++++++++++++++ .../IcOrganizationCodeInfoServiceImpl.java | 87 +++++++++++++++++++ .../mapper/IcOrganizationCodeInfoDao.xml | 15 ++++ 15 files changed, 501 insertions(+), 2 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcOrganizationCodeInfoDTO.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcOrganizationCodeInfoController.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcOrganizationCodeInfoDao.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcOrganizationCodeInfoEntity.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcOrganizationCodeInfoExcel.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcOrganizationCodeInfoRedis.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcOrganizationCodeInfoService.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcOrganizationCodeInfoDao.xml diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java index b72e68c723..52567226eb 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcBuildingDTO.java @@ -141,4 +141,19 @@ public class IcBuildingDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file + /** + * 楼栋编码 + */ + private String coding; + + /** + * 楼栋系统编码 + */ + private String sysCoding; + + /** + * 实有人口数 + */ + private Integer realPerson; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java index 42163539ce..8f3918adb9 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java @@ -152,4 +152,8 @@ public class IcHouseDTO implements Serializable { */ private String remark; -} \ No newline at end of file + /** + * 房屋可编辑编码 + */ + private String coding; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java index 14bc28d43b..d50508c522 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcNeighborHoodDTO.java @@ -129,4 +129,19 @@ public class IcNeighborHoodDTO implements Serializable { */ private Date updatedTime; + /** + * 小区编码 + */ + private String coding; + + /** + * 小区系统编码 + */ + private String sysCoding; + + /** + * 实有楼栋数 + */ + private Integer realBuilding; + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcOrganizationCodeInfoDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcOrganizationCodeInfoDTO.java new file mode 100644 index 0000000000..edeca85503 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcOrganizationCodeInfoDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 小区/楼栋/房屋编码辅助表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-27 + */ +@Data +public class IcOrganizationCodeInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 社区id + */ + private String communityId; + + /** + * 该社区下最大的小区编码序列号 + */ + private String neighborMaxNum; + + /** + * 该社区下最大的楼栋编码序列号 + */ + private String buildingMaxNum; + + /** + * 该社区下最大的房屋编码序列号 + */ + private String houseMaxNum; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcOrganizationCodeInfoController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcOrganizationCodeInfoController.java new file mode 100644 index 0000000000..5e20a16ea3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcOrganizationCodeInfoController.java @@ -0,0 +1,82 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcOrganizationCodeInfoDTO; +import com.epmet.excel.IcOrganizationCodeInfoExcel; +import com.epmet.service.IcOrganizationCodeInfoService; +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; + + +/** + * 小区/楼栋/房屋编码辅助表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-27 + */ +@RestController +@RequestMapping("icOrganizationCodeInfo") +public class IcOrganizationCodeInfoController { + + @Autowired + private IcOrganizationCodeInfoService icOrganizationCodeInfoService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icOrganizationCodeInfoService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcOrganizationCodeInfoDTO data = icOrganizationCodeInfoService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcOrganizationCodeInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icOrganizationCodeInfoService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcOrganizationCodeInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icOrganizationCodeInfoService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icOrganizationCodeInfoService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icOrganizationCodeInfoService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcOrganizationCodeInfoExcel.class); + } + + + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcOrganizationCodeInfoDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcOrganizationCodeInfoDao.java new file mode 100644 index 0000000000..c3b0a92d80 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcOrganizationCodeInfoDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcOrganizationCodeInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 小区/楼栋/房屋编码辅助表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-27 + */ +@Mapper +public interface IcOrganizationCodeInfoDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java index 1b0535f803..801267e2dd 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingEntity.java @@ -107,4 +107,19 @@ public class IcBuildingEntity extends BaseEpmetEntity { */ private String coordinatePosition; + /** + * 楼栋编码 + */ + private String coding; + + /** + * 楼栋系统编码 + */ + private String sysCoding; + + /** + * 实有人口数 + */ + private Integer realPerson; + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java index a535667426..1568dee910 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java @@ -117,4 +117,9 @@ public class IcHouseEntity extends BaseEpmetEntity { */ private String houseCode; private String houseQrcodeUrl; + + /** + * 房屋可编辑编码 + */ + private String coding; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java index 8f83a0aba1..f96edb70bb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcNeighborHoodEntity.java @@ -101,4 +101,19 @@ public class IcNeighborHoodEntity extends BaseEpmetEntity { @TableField(exist = false) private String propertyName; + + /** + * 小区编码 + */ + private String coding; + + /** + * 小区系统编码 + */ + private String sysCoding; + + /** + * 实有楼栋数 + */ + private Integer realBuilding; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcOrganizationCodeInfoEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcOrganizationCodeInfoEntity.java new file mode 100644 index 0000000000..f4e9671a73 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcOrganizationCodeInfoEntity.java @@ -0,0 +1,45 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 小区/楼栋/房屋编码辅助表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_organization_code_info") +public class IcOrganizationCodeInfoEntity{ + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 社区id + */ + private String communityId; + + /** + * 该社区下最大的小区编码序列号 + */ + private String neighborMaxNum; + + /** + * 该社区下最大的楼栋编码序列号 + */ + private String buildingMaxNum; + + /** + * 该社区下最大的房屋编码序列号 + */ + private String houseMaxNum; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcOrganizationCodeInfoExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcOrganizationCodeInfoExcel.java new file mode 100644 index 0000000000..3402ef797a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/IcOrganizationCodeInfoExcel.java @@ -0,0 +1,33 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 小区/楼栋/房屋编码辅助表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-27 + */ +@Data +public class IcOrganizationCodeInfoExcel { + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "社区id") + private String communityId; + + @Excel(name = "该社区下最大的小区编码序列号") + private String neighborMaxNum; + + @Excel(name = "该社区下最大的楼栋编码序列号") + private String buildingMaxNum; + + @Excel(name = "该社区下最大的房屋编码序列号") + private String houseMaxNum; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcOrganizationCodeInfoRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcOrganizationCodeInfoRedis.java new file mode 100644 index 0000000000..50860d27ae --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcOrganizationCodeInfoRedis.java @@ -0,0 +1,30 @@ +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 小区/楼栋/房屋编码辅助表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-27 + */ +@Component +public class IcOrganizationCodeInfoRedis { + @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/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcOrganizationCodeInfoService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcOrganizationCodeInfoService.java new file mode 100644 index 0000000000..e98db783b5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcOrganizationCodeInfoService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcOrganizationCodeInfoDTO; +import com.epmet.entity.IcOrganizationCodeInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 小区/楼栋/房屋编码辅助表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-27 + */ +public interface IcOrganizationCodeInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-06-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-06-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcOrganizationCodeInfoDTO + * @author generator + * @date 2022-06-27 + */ + IcOrganizationCodeInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-27 + */ + void save(IcOrganizationCodeInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-27 + */ + void update(IcOrganizationCodeInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-06-27 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java new file mode 100644 index 0000000000..d6eba569b3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java @@ -0,0 +1,87 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcOrganizationCodeInfoDao; +import com.epmet.dto.IcOrganizationCodeInfoDTO; +import com.epmet.entity.IcOrganizationCodeInfoEntity; +import com.epmet.redis.IcOrganizationCodeInfoRedis; +import com.epmet.service.IcOrganizationCodeInfoService; +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; + +/** + * 小区/楼栋/房屋编码辅助表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-27 + */ +@Service +public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl implements IcOrganizationCodeInfoService { + + @Autowired + private IcOrganizationCodeInfoRedis icOrganizationCodeInfoRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcOrganizationCodeInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcOrganizationCodeInfoDTO.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 IcOrganizationCodeInfoDTO get(String id) { + IcOrganizationCodeInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcOrganizationCodeInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcOrganizationCodeInfoDTO dto) { + IcOrganizationCodeInfoEntity entity = ConvertUtils.sourceToTarget(dto, IcOrganizationCodeInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcOrganizationCodeInfoDTO dto) { + IcOrganizationCodeInfoEntity entity = ConvertUtils.sourceToTarget(dto, IcOrganizationCodeInfoEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcOrganizationCodeInfoDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcOrganizationCodeInfoDao.xml new file mode 100644 index 0000000000..b544ba7019 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcOrganizationCodeInfoDao.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file From fa6a99ce19c4cb70a2459625d890b9bdaafb111a Mon Sep 17 00:00:00 2001 From: Jackwang Date: Tue, 28 Jun 2022 09:41:24 +0800 Subject: [PATCH 02/31] =?UTF-8?q?=E9=80=9A=E7=94=A8controller=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HouseInformationController.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java new file mode 100644 index 0000000000..2c71e1f4df --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java @@ -0,0 +1,35 @@ +/** + * 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.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 双实信息相关 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@RestController +@RequestMapping("houseInformation") +public class HouseInformationController { + + +} From e95168c269bad365f5832aabb14cc33243b19c32 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 28 Jun 2022 14:21:46 +0800 Subject: [PATCH 03/31] =?UTF-8?q?=E9=A9=B3=E5=9B=9E=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/IcResiUserConfirmServiceImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserConfirmServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserConfirmServiceImpl.java index 794974e1eb..0ebe094de0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserConfirmServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserConfirmServiceImpl.java @@ -336,6 +336,11 @@ public class IcResiUserConfirmServiceImpl extends BaseServiceImpl Date: Tue, 28 Jun 2022 15:37:07 +0800 Subject: [PATCH 04/31] =?UTF-8?q?=E5=8F=8C=E5=AE=9E=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BD=95=E5=85=A5-flyway=E8=84=9A=E6=9C=AC=E5=8F=8A=E9=83=A8?= =?UTF-8?q?=E5=88=86=E8=AF=A6=E6=83=85=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HouseInformationController.java | 53 +++++++++++++++++++ .../com/epmet/service/IcBuildingService.java | 12 ++++- .../epmet/service/IcBuildingUnitService.java | 12 ++++- .../epmet/service/IcNeighborHoodService.java | 9 ++++ .../service/impl/IcBuildingServiceImpl.java | 8 ++- .../impl/IcBuildingUnitServiceImpl.java | 8 ++- .../impl/IcNeighborHoodServiceImpl.java | 5 ++ .../V0.0.31_add_ic_organization_code_info.sql | 18 +++++++ 8 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.31_add_ic_organization_code_info.sql diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java index 2c71e1f4df..d70f5e9510 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java @@ -17,6 +17,16 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IcBuildingDTO; +import com.epmet.dto.IcBuildingUnitDTO; +import com.epmet.entity.IcNeighborHoodEntity; +import com.epmet.service.IcBuildingService; +import com.epmet.service.IcBuildingUnitService; +import com.epmet.service.IcNeighborHoodService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -31,5 +41,48 @@ import org.springframework.web.bind.annotation.RestController; @RequestMapping("houseInformation") public class HouseInformationController { + @Autowired + private IcNeighborHoodService icNeighborHoodService; + @Autowired + private IcBuildingService icBuildingService; + + @Autowired + private IcBuildingUnitService icBuildingUnitService; + + /** + * @describe: 【双实录入】小区详情 + * @author wangtong + * @date 2022/6/28 10:48 + * @params [neighborhoodId] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("neighborhoodDetail/{neighborhoodId}") + public Result neighborhoodDetail(@PathVariable("neighborhoodId") String neighborhoodId){ + return icNeighborHoodService.neighborhoodDetail(neighborhoodId); + } + + /** + * @describe: 【双实录入】楼栋详情 + * @author wangtong + * @date 2022/6/28 14:30 + * @params [buildingId] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("getBuildingDetail/{buildingId}") + public Result getBuildingDetail(@PathVariable("buildingId") String buildingId){ + return icBuildingService.getBuildingDetail(buildingId); + } + + /** + * @describe: 【双实录入】单元详情 + * @author wangtong + * @date 2022/6/28 15:00 + * @params [unitId] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("getUnitDetail/{unitId}") + public Result getUnitDetail(@PathVariable("unitId") String unitId){ + return icBuildingUnitService.getUnitDetail(unitId); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java index 0822d4805b..038055aa6b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcBuildingDTO; import com.epmet.dto.ImportGeneralDTO; import com.epmet.entity.IcBuildingEntity; @@ -122,4 +123,13 @@ public interface IcBuildingService extends BaseService { * @date 2022/4/27 13:29 */ void updateBuilding(ImportGeneralDTO info); -} \ No newline at end of file + + /** + * @describe: 【双实录入】楼栋详情 + * @author wangtong + * @date 2022/6/28 14:30 + * @params [buildingId] + * @return com.epmet.commons.tools.utils.Result + */ + Result getBuildingDetail(String buildingId); +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java index 0d315539e6..69538e3950 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcBuildingUnitDTO; import com.epmet.entity.IcBuildingUnitEntity; @@ -112,4 +113,13 @@ public interface IcBuildingUnitService extends BaseService * @Date 2022/2/14 15:42 */ IcBuildingUnitDTO getUnitInfo(String buildingId, String unitName); -} \ No newline at end of file + + /** + * @describe: 【双实录入】单元详情 + * @author wangtong + * @date 2022/6/28 15:00 + * @params [unitId] + * @return com.epmet.commons.tools.utils.Result + */ + Result getUnitDetail(String unitId); +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java index 087ab03441..085c363819 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcNeighborHoodService.java @@ -172,4 +172,13 @@ public interface IcNeighborHoodService extends BaseService * @date 2022/4/27 10:33 */ void neighborHoodPropertyUpdate(List updateNeighborHoodAndManagement); + + /** + * @describe: 【双实录入】小区详情 + * @author wangtong + * @date 2022/6/28 15:04 + * @params [neighborhoodId] + * @return com.epmet.commons.tools.utils.Result + */ + Result neighborhoodDetail(String neighborhoodId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java index 351fc95306..610e6f984b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcBuildingDao; import com.epmet.dto.IcBuildingDTO; import com.epmet.dto.ImportGeneralDTO; @@ -166,4 +167,9 @@ public class IcBuildingServiceImpl extends BaseServiceImpl getBuildingDetail(String buildingId) { + return null; + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java index 2e800bbda5..2959397fdd 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcBuildingUnitDao; import com.epmet.dto.IcBuildingUnitDTO; import com.epmet.entity.IcBuildingUnitEntity; @@ -154,4 +155,9 @@ public class IcBuildingUnitServiceImpl extends BaseServiceImpl getUnitDetail(String unitId) { + return null; + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java index c54ea3a436..7c26b4a947 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java @@ -791,4 +791,9 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl neighborhoodDetail(String neighborhoodId) { + return new Result().ok(baseDao.selectById(neighborhoodId)); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.31_add_ic_organization_code_info.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.31_add_ic_organization_code_info.sql new file mode 100644 index 0000000000..64e1a21381 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.31_add_ic_organization_code_info.sql @@ -0,0 +1,18 @@ +CREATE TABLE `ic_organization_code_info` ( + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `COMMUNITY_ID` varchar(64) NOT NULL COMMENT '社区id', + `NEIGHBOR_MAX_NUM` varchar(10) NOT NULL COMMENT '该社区下最大的小区编码序列号', + `BUILDING_MAX_NUM` varchar(10) NOT NULL COMMENT '该社区下最大的楼栋编码序列号', + `HOUSE_MAX_NUM` varchar(10) NOT NULL COMMENT '该社区下最大的房屋编码序列号' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='小区/楼栋/房屋编码辅助表'; + + +alter table ic_neighbor_hood add COLUMN `CODING` varchar(64) DEFAULT NULL COMMENT '小区编码'; +alter table ic_neighbor_hood add COLUMN `SYS_CODING` varchar(64) DEFAULT NULL COMMENT '小区系统编码'; +alter table ic_neighbor_hood add COLUMN `REAL_BUILDING` int(10) DEFAULT NULL COMMENT '实有楼栋'; + +alter table ic_building add COLUMN `CODING` varchar(64) DEFAULT NULL COMMENT '楼栋编码'; +alter table ic_building add COLUMN `SYS_CODING` varchar(64) DEFAULT NULL COMMENT '楼栋系统编码'; +alter table ic_building add COLUMN `REAL_PERSON` int(10) DEFAULT NULL COMMENT '实有人口'; + +alter table ic_neighbor_hood add COLUMN `CODING` varchar(64) DEFAULT NULL COMMENT '房屋可编辑编码'; From c54f2e32569bd5f2b2d41f93d66f9e29ed3481ed Mon Sep 17 00:00:00 2001 From: Jackwang Date: Tue, 28 Jun 2022 15:49:22 +0800 Subject: [PATCH 05/31] =?UTF-8?q?=E5=8F=8C=E5=AE=9E=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BD=95=E5=85=A5-flyway=E8=84=9A=E6=9C=AC=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n_code_info.sql => V0.0.31__add_ic_organization_code_info.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/{V0.0.31_add_ic_organization_code_info.sql => V0.0.31__add_ic_organization_code_info.sql} (100%) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.31_add_ic_organization_code_info.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.31__add_ic_organization_code_info.sql similarity index 100% rename from epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.31_add_ic_organization_code_info.sql rename to epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.31__add_ic_organization_code_info.sql From dc993c8b2e510d6ba19ac1b70e95f98f904906ed Mon Sep 17 00:00:00 2001 From: Jackwang Date: Tue, 28 Jun 2022 16:06:51 +0800 Subject: [PATCH 06/31] =?UTF-8?q?=E5=8F=8C=E5=AE=9E=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BD=95=E5=85=A5-flyway=E8=84=9A=E6=9C=AC=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.31__add_ic_organization_code_info.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.31__add_ic_organization_code_info.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.31__add_ic_organization_code_info.sql index 64e1a21381..c55fc29940 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.31__add_ic_organization_code_info.sql +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.31__add_ic_organization_code_info.sql @@ -15,4 +15,4 @@ alter table ic_building add COLUMN `CODING` varchar(64) DEFAULT NULL COMMENT ' alter table ic_building add COLUMN `SYS_CODING` varchar(64) DEFAULT NULL COMMENT '楼栋系统编码'; alter table ic_building add COLUMN `REAL_PERSON` int(10) DEFAULT NULL COMMENT '实有人口'; -alter table ic_neighbor_hood add COLUMN `CODING` varchar(64) DEFAULT NULL COMMENT '房屋可编辑编码'; +alter table ic_house add COLUMN `CODING` varchar(64) DEFAULT NULL COMMENT '房屋可编辑编码'; From 103fa88d5260815c60d82099fec5da6120596078 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Tue, 28 Jun 2022 17:11:33 +0800 Subject: [PATCH 07/31] =?UTF-8?q?=E5=8F=8C=E5=AE=9E=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BD=95=E5=85=A5-=E5=B0=8F=E5=8C=BA-=E6=A5=BC=E6=A0=8B-?= =?UTF-8?q?=E5=8D=95=E5=85=83=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/IcBulidingDetailDTO.java | 120 ++++++++++++++++++ .../HouseInformationController.java | 8 +- .../java/com/epmet/dao/IcBuildingDao.java | 8 ++ .../java/com/epmet/dao/IcBuildingUnitDao.java | 11 +- .../com/epmet/service/IcBuildingService.java | 3 +- .../epmet/service/IcBuildingUnitService.java | 3 +- .../service/impl/IcBuildingServiceImpl.java | 5 +- .../impl/IcBuildingUnitServiceImpl.java | 6 +- .../main/resources/mapper/IcBuildingDao.xml | 25 ++++ .../resources/mapper/IcBuildingUnitDao.xml | 25 +++- 10 files changed, 202 insertions(+), 12 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBulidingDetailDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBulidingDetailDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBulidingDetailDTO.java new file mode 100644 index 0000000000..e1d16b92d6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBulidingDetailDTO.java @@ -0,0 +1,120 @@ +/** + * 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.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + + +@Data +public class IcBulidingDetailDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + private String buildingId; + + /** + * 组织id + */ + private String agencyId; + + + /** + * 网格id + */ + private String gridId; + + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 楼栋名称 + */ + private String buildingName; + + /** + * 楼栋类型 + */ + private String type; + + + /** + * 排序 + */ + private BigDecimal sort; + + /** + * 总单元数 + */ + private Integer totalUnitNum; + + /** + * 总楼层总数 + */ + private Integer totalFloorNum; + + /** + * 总户数 + */ + private Integer totalHouseNum; + /** + * 坐标位置 + */ + + private String location; + + + /** + * 中心点位:经度 + */ + + private String longitude; + + /** + * 中心点位:纬度 + */ + + private String latitude; + + /** + * 楼长姓名 + */ + private String buildingLeaderName; + + /** + * 楼长电话 + */ + private String buildingLeaderMobile; + + + /** + * 楼栋编码 + */ + private String coding; + + /** + * 实有人口数 + */ + private Integer realPerson; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java index d70f5e9510..44fde8e41f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java @@ -18,8 +18,8 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.IcBuildingDTO; -import com.epmet.dto.IcBuildingUnitDTO; +import com.epmet.dto.result.HouseInfoResultDTO; +import com.epmet.dto.result.IcBulidingDetailDTO; import com.epmet.entity.IcNeighborHoodEntity; import com.epmet.service.IcBuildingService; import com.epmet.service.IcBuildingUnitService; @@ -70,7 +70,7 @@ public class HouseInformationController { * @return com.epmet.commons.tools.utils.Result */ @PostMapping("getBuildingDetail/{buildingId}") - public Result getBuildingDetail(@PathVariable("buildingId") String buildingId){ + public Result getBuildingDetail(@PathVariable("buildingId") String buildingId){ return icBuildingService.getBuildingDetail(buildingId); } @@ -82,7 +82,7 @@ public class HouseInformationController { * @return com.epmet.commons.tools.utils.Result */ @PostMapping("getUnitDetail/{unitId}") - public Result getUnitDetail(@PathVariable("unitId") String unitId){ + public Result getUnitDetail(@PathVariable("unitId") String unitId){ return icBuildingUnitService.getUnitDetail(unitId); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java index 3fd205a48d..a996255750 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java @@ -196,4 +196,12 @@ public interface IcBuildingDao extends BaseDao { */ Integer selectUnitCount(@Param("buildingId")String buildingId); + /** + * @describe: 获取楼栋详情 + * @author wangtong + * @date 2022/6/28 16:16 + * @params [buildingId] + * @return com.epmet.dto.result.IcBulidingDetailDTO + */ + IcBulidingDetailDTO getBuildingDetail(@Param("buildingId") String buildingId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java index 147f25f7d2..ad5e8358a7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.HouseInfoResultDTO; import com.epmet.entity.IcBuildingUnitEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -50,4 +51,12 @@ public interface IcBuildingUnitDao extends BaseDao { */ void delUnit(@Param("ids")List ids); -} \ No newline at end of file + /** + * @describe: 获取单元详情 + * @author wangtong + * @date 2022/6/28 17:03 + * @params [unitId] + * @return com.epmet.dto.result.HouseInfoResultDTO + */ + HouseInfoResultDTO getUnitDetail(@Param("unitId") String unitId); +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java index 038055aa6b..cde64d4da0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingService.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcBuildingDTO; import com.epmet.dto.ImportGeneralDTO; +import com.epmet.dto.result.IcBulidingDetailDTO; import com.epmet.entity.IcBuildingEntity; import java.util.List; @@ -131,5 +132,5 @@ public interface IcBuildingService extends BaseService { * @params [buildingId] * @return com.epmet.commons.tools.utils.Result */ - Result getBuildingDetail(String buildingId); + Result getBuildingDetail(String buildingId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java index 69538e3950..da966fbf6e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcBuildingUnitService.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcBuildingUnitDTO; +import com.epmet.dto.result.HouseInfoResultDTO; import com.epmet.entity.IcBuildingUnitEntity; import java.util.List; @@ -121,5 +122,5 @@ public interface IcBuildingUnitService extends BaseService * @params [unitId] * @return com.epmet.commons.tools.utils.Result */ - Result getUnitDetail(String unitId); + Result getUnitDetail(String unitId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java index 610e6f984b..9059a84eda 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java @@ -29,6 +29,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcBuildingDao; import com.epmet.dto.IcBuildingDTO; import com.epmet.dto.ImportGeneralDTO; +import com.epmet.dto.result.IcBulidingDetailDTO; import com.epmet.entity.IcBuildingEntity; import com.epmet.service.IcBuildingService; import lombok.extern.slf4j.Slf4j; @@ -168,8 +169,8 @@ public class IcBuildingServiceImpl extends BaseServiceImpl getBuildingDetail(String buildingId) { - return null; + public Result getBuildingDetail(String buildingId) { + return new Result().ok(baseDao.getBuildingDetail(buildingId)); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java index 2959397fdd..6b55f20cfd 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java @@ -28,6 +28,8 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcBuildingUnitDao; import com.epmet.dto.IcBuildingUnitDTO; +import com.epmet.dto.result.HouseInfoResultDTO; +import com.epmet.dto.result.IcBulidingDetailDTO; import com.epmet.entity.IcBuildingUnitEntity; import com.epmet.service.IcBuildingUnitService; import lombok.extern.slf4j.Slf4j; @@ -156,8 +158,8 @@ public class IcBuildingUnitServiceImpl extends BaseServiceImpl getUnitDetail(String unitId) { - return null; + public Result getUnitDetail(String unitId) { + return new Result().ok(baseDao.getUnitDetail(unitId)); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml index 92c486f24a..c87edfccd5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml @@ -403,5 +403,30 @@ + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml index 09f334b42d..31b2e4873e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml @@ -17,6 +17,29 @@ + - \ No newline at end of file + From ab07de4b80baebe2635916ce5156028a122ff2e3 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 28 Jun 2022 17:12:22 +0800 Subject: [PATCH 08/31] =?UTF-8?q?=E3=80=90=E5=8F=8C=E5=AE=9E=E5=BD=95?= =?UTF-8?q?=E5=85=A5=E3=80=91=E7=BB=9F=E8=AE=A1=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/HouseInformationFormDTO.java | 24 +++ .../dto/result/BuildingCountResultDTO.java | 22 +++ .../dto/result/BuildingListResultDTO.java | 25 +++ .../dto/result/CommunityCountResultDTO.java | 23 +++ .../dto/result/GridCountListResultDTO.java | 25 +++ .../dto/result/GridStatisticsResultDTO.java | 24 +++ .../epmet/dto/result/HomeListResultDTO.java | 22 +++ .../result/NeighborHoodCountResultDTO.java | 24 +++ .../dto/result/NeighborHoodListResultDTO.java | 25 +++ .../epmet/dto/result/UnitCountResultDTO.java | 17 ++ .../epmet/dto/result/UnitListResultDTO.java | 22 +++ .../HouseInformationController.java | 158 +++++++++++++++++- .../service/HouseInformationService.java | 112 +++++++++++++ .../impl/HouseInformationServiceImpl.java | 157 +++++++++++++++++ 14 files changed, 678 insertions(+), 2 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseInformationFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingCountResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridCountListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStatisticsResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HomeListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodCountResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitCountResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitListResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseInformationService.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseInformationFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseInformationFormDTO.java new file mode 100644 index 0000000000..3533225669 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseInformationFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/28 15:06 + */ +@Data +public class HouseInformationFormDTO extends PageFormDTO implements Serializable { + private static final long serialVersionUID = 2348447479132364176L; + private String staffId; + private String communityId; + private String gridId; + private String neighborHoodId; + private String buildingId; + private String unitId; + private String name; + private String sort; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingCountResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingCountResultDTO.java new file mode 100644 index 0000000000..69f3919b61 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingCountResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/28 16:49 + */ +@NoArgsConstructor +@Data +public class BuildingCountResultDTO { + private String buildingId; + private String buildingType; + private Integer unitCount; + private Integer houseCount; + private Integer personCount; + private Integer unitRealCount; + private Integer houseRealCount; + private Integer personRealCount; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java new file mode 100644 index 0000000000..ed54d7b998 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/28 16:45 + */ +@NoArgsConstructor +@Data +public class BuildingListResultDTO implements Serializable { + private static final long serialVersionUID = -1423424057500044373L; + private String id; + private String name; + private Integer buildingCount; + private Integer houseCount; + private Integer personCount; + private Integer differBuildingCount; + private Integer differHouseCount; + private Integer differPersonCount; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountResultDTO.java new file mode 100644 index 0000000000..2d85e642ca --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/28 15:24 + */ +@NoArgsConstructor +@Data +public class CommunityCountResultDTO implements Serializable { + private static final long serialVersionUID = -1677303397440121269L; + private Integer buildingCount; + private Integer houseCount; + private Integer personCount; + private Integer buildingRealCount; + private Integer houseRealCount; + private Integer personRealCount; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridCountListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridCountListResultDTO.java new file mode 100644 index 0000000000..9a5c6b368c --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridCountListResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/28 15:35 + */ +@NoArgsConstructor +@Data +public class GridCountListResultDTO implements Serializable { + private static final long serialVersionUID = -7938740461257344347L; + private String id; + private String name; + private Integer buildingCount; + private Integer houseCount; + private Integer personCount; + private Integer differBuildingCount; + private Integer differHouseCount; + private Integer differPersonCount; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStatisticsResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStatisticsResultDTO.java new file mode 100644 index 0000000000..d1a74e8847 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStatisticsResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/28 15:37 + */ +@NoArgsConstructor +@Data +public class GridStatisticsResultDTO implements Serializable { + + private static final long serialVersionUID = -2022337690871957027L; + private Integer buildingCount; + private Integer houseCount; + private Integer personCount; + private Integer buildingRealCount; + private Integer houseRealCount; + private Integer personRealCount; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HomeListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HomeListResultDTO.java new file mode 100644 index 0000000000..be5a99c195 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HomeListResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/28 17:00 + */ +@NoArgsConstructor +@Data +public class HomeListResultDTO implements Serializable { + private static final long serialVersionUID = -1098032063828430218L; + private String id; + private String name; + private Double personCount; + private String houseType; + private String houseCode; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodCountResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodCountResultDTO.java new file mode 100644 index 0000000000..9c7d5cfcfd --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodCountResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/28 16:41 + */ +@NoArgsConstructor +@Data +public class NeighborHoodCountResultDTO implements Serializable { + private static final long serialVersionUID = 4148009467129407023L; + private String neighborHoodId; + private Integer buildingCount; + private Integer houseCount; + private Integer personCount; + private Integer buildingRealCount; + private Integer houseRealCount; + private Integer personRealCount; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodListResultDTO.java new file mode 100644 index 0000000000..fa41ac49f8 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodListResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/28 16:21 + */ +@NoArgsConstructor +@Data +public class NeighborHoodListResultDTO implements Serializable { + private static final long serialVersionUID = -5333918463141094854L; + private String id; + private String name; + private Integer buildingCount; + private Integer houseCount; + private Integer personCount; + private Integer differBuildingCount; + private Integer differHouseCount; + private Integer differPersonCount; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitCountResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitCountResultDTO.java new file mode 100644 index 0000000000..548e0c4ef6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitCountResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/28 16:56 + */ +@NoArgsConstructor +@Data +public class UnitCountResultDTO { + private String unitId; + private Integer houseCount; + private Integer personCount; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitListResultDTO.java new file mode 100644 index 0000000000..3d6256a399 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitListResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/28 16:53 + */ +@NoArgsConstructor +@Data +public class UnitListResultDTO implements Serializable { + private static final long serialVersionUID = -8750897881106004416L; + private String id; + private String name; + private Double houseCount; + private Double personCount; + private Double differHouseCount; +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java index 44fde8e41f..1197747f69 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java @@ -18,8 +18,8 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.result.HouseInfoResultDTO; -import com.epmet.dto.result.IcBulidingDetailDTO; +import com.epmet.dto.IcBuildingDTO; +import com.epmet.dto.IcBuildingUnitDTO; import com.epmet.entity.IcNeighborHoodEntity; import com.epmet.service.IcBuildingService; import com.epmet.service.IcBuildingUnitService; @@ -50,6 +50,9 @@ public class HouseInformationController { @Autowired private IcBuildingUnitService icBuildingUnitService; + @Resource + private HouseInformationService houseInformationService; + /** * @describe: 【双实录入】小区详情 * @author wangtong @@ -85,4 +88,155 @@ public class HouseInformationController { public Result getUnitDetail(@PathVariable("unitId") String unitId){ return icBuildingUnitService.getUnitDetail(unitId); } + + /** + * 【双实录入】社区录入数据统计 + * + * @Param tokenDTO + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/6/28 15:32 + */ + @PostMapping("getCommunityCount") + public Result getCommunityCount(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setStaffId(tokenDTO.getUserId()); + return new Result().ok(houseInformationService.getCommunityCount(formDTO)); + } + + /** + * 【双实录入】社区-网格列表 + * + * @Param tokenDTO + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2022/6/28 15:42 + */ + @PostMapping("getGridList") + public Result> getGridList(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setStaffId(tokenDTO.getUserId()); + return new Result>().ok(houseInformationService.getGridList(formDTO)); + } + + /** + * 【双实录入】网格录入数据统计 + * + * @Param tokenDTO + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/6/28 15:42 + */ + @PostMapping("getGridCount") + public Result getGridCount(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setStaffId(tokenDTO.getUserId()); + return new Result().ok(houseInformationService.getGridCount(formDTO)); + } + + /** + * 【双实录入】网格-小区列表 + * + * @Param tokenDTO + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2022/6/28 16:23 + */ + @PostMapping("getNeighborHoodList") + public Result> getNeighborHoodList(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setStaffId(tokenDTO.getUserId()); + return new Result>().ok(houseInformationService.getNeighborHoodList(formDTO)); + } + + /** + * 【双实录入】小区录入数据统计 + * + * @Param tokenDTO + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/6/28 16:44 + */ + @PostMapping("getNeighborHoodCount") + public Result getNeighborHoodCount(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setStaffId(tokenDTO.getUserId()); + return new Result().ok(houseInformationService.getNeighborHoodCount(formDTO)); + } + + /** + * 【双实录入】小区-楼栋列表 + * + * @Param tokenDTO + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2022/6/28 16:47 + */ + @PostMapping("getBuildingList") + public Result> getBuildingList(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setStaffId(tokenDTO.getUserId()); + return new Result>().ok(houseInformationService.getBuildingList(formDTO)); + } + + + /** + * 【双实录入】楼栋录入数据统计 + * + * @Param tokenDTO + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/6/28 16:51 + */ + @PostMapping("getBuildingCount") + public Result getBuildingCount(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setStaffId(tokenDTO.getUserId()); + return new Result().ok(houseInformationService.getBuildingCount(formDTO)); + } + + /** + * 【双实录入】楼栋-单元列表 + * + * @Param tokenDTO + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2022/6/28 16:55 + */ + @PostMapping("getUnitList") + public Result> getUnitList(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setStaffId(tokenDTO.getUserId()); + return new Result>().ok(houseInformationService.getUnitList(formDTO)); + } + + /** + * 【双实录入】单元录入数据统计 + * + * @Param tokenDTO + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/6/28 16:57 + */ + @PostMapping("getUnitCount") + public Result getUnitCount(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setStaffId(tokenDTO.getUserId()); + return new Result().ok(houseInformationService.getUnitCount(formDTO)); + } + + /** + * 【双实录入】单元-房屋列表 + * + * @Param tokenDTO + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2022/6/28 17:02 + */ + @PostMapping("getHouseList") + public Result> getHouseList(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setStaffId(tokenDTO.getUserId()); + return new Result>().ok(houseInformationService.getHouseList(formDTO)); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseInformationService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseInformationService.java new file mode 100644 index 0000000000..ab49566845 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseInformationService.java @@ -0,0 +1,112 @@ +package com.epmet.service; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.form.HouseInformationFormDTO; +import com.epmet.dto.result.*; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/28 15:14 + */ +public interface HouseInformationService { + /** + * 【双实录入】社区录入数据统计 + * + * @Param formDTO + * @Return {@link CommunityCountResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/28 15:31 + */ + CommunityCountResultDTO getCommunityCount(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】社区-网格列表 + * + * @Param formDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2022/6/28 15:41 + */ + PageData getGridList(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】网格录入数据统计 + * + * @Param formDTO + * @Return {@link GridStatisticsResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/28 15:41 + */ + GridStatisticsResultDTO getGridCount(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】网格-小区列表 + * + * @Param formDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2022/6/28 16:24 + */ + PageData getNeighborHoodList(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】小区录入数据统计 + * + * @Param formDTO + * @Return {@link NeighborHoodCountResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/28 16:43 + */ + NeighborHoodCountResultDTO getNeighborHoodCount(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】小区-楼栋列表 + * + * @Param formDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2022/6/28 16:47 + */ + PageData getBuildingList(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】楼栋录入数据统计 + * + * @Param formDTO + * @Return {@link BuildingCountResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/28 16:50 + */ + BuildingCountResultDTO getBuildingCount(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】楼栋-单元列表 + * + * @Param formDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2022/6/28 16:54 + */ + PageData getUnitList(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】单元录入数据统计 + * + * @Param formDTO + * @Return {@link UnitCountResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/28 16:57 + */ + UnitCountResultDTO getUnitCount(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】单元-房屋列表 + * + * @Param formDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2022/6/28 17:01 + */ + PageData getHouseList(HouseInformationFormDTO formDTO); +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java new file mode 100644 index 0000000000..0a03a15f97 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java @@ -0,0 +1,157 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.form.HouseInformationFormDTO; +import com.epmet.dto.result.*; +import com.epmet.service.HouseInformationService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/28 15:14 + */ +@Slf4j +@Service +public class HouseInformationServiceImpl implements HouseInformationService { + /** + * 【双实录入】社区录入数据统计 + * + * @param formDTO + * @Param formDTO + * @Return {@link CommunityCountResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/28 15:31 + */ + @Override + public CommunityCountResultDTO getCommunityCount(HouseInformationFormDTO formDTO) { + return null; + } + + /** + * 【双实录入】社区-网格列表 + * + * @param formDTO + * @Param formDTO + * @Return {@link PageData < GridCountListResultDTO >} + * @Author zhaoqifeng + * @Date 2022/6/28 15:41 + */ + @Override + public PageData getGridList(HouseInformationFormDTO formDTO) { + return null; + } + + /** + * 【双实录入】网格录入数据统计 + * + * @param formDTO + * @Param formDTO + * @Return {@link GridStatisticsResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/28 15:41 + */ + @Override + public GridStatisticsResultDTO getGridCount(HouseInformationFormDTO formDTO) { + return null; + } + + /** + * 【双实录入】网格-小区列表 + * + * @param formDTO + * @Param formDTO + * @Return {@link PageData< NeighborHoodListResultDTO >} + * @Author zhaoqifeng + * @Date 2022/6/28 16:24 + */ + @Override + public PageData getNeighborHoodList(HouseInformationFormDTO formDTO) { + return null; + } + + /** + * 【双实录入】小区录入数据统计 + * + * @param formDTO + * @Param formDTO + * @Return {@link NeighborHoodCountResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/28 16:43 + */ + @Override + public NeighborHoodCountResultDTO getNeighborHoodCount(HouseInformationFormDTO formDTO) { + return null; + } + + /** + * 【双实录入】小区-楼栋列表 + * + * @param formDTO + * @Param formDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2022/6/28 16:47 + */ + @Override + public PageData getBuildingList(HouseInformationFormDTO formDTO) { + return null; + } + + /** + * 【双实录入】楼栋录入数据统计 + * + * @param formDTO + * @Param formDTO + * @Return {@link BuildingCountResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/28 16:50 + */ + @Override + public BuildingCountResultDTO getBuildingCount(HouseInformationFormDTO formDTO) { + return null; + } + + /** + * 【双实录入】楼栋-单元列表 + * + * @param formDTO + * @Param formDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2022/6/28 16:54 + */ + @Override + public PageData getUnitList(HouseInformationFormDTO formDTO) { + return null; + } + + /** + * 【双实录入】单元录入数据统计 + * + * @param formDTO + * @Param formDTO + * @Return {@link UnitCountResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/28 16:57 + */ + @Override + public UnitCountResultDTO getUnitCount(HouseInformationFormDTO formDTO) { + return null; + } + + /** + * 【双实录入】单元-房屋列表 + * + * @param formDTO + * @Param formDTO + * @Return {@link PageData} + * @Author zhaoqifeng + * @Date 2022/6/28 17:01 + */ + @Override + public PageData getHouseList(HouseInformationFormDTO formDTO) { + return null; + } +} From 1d88cceed21778682a21788c6d000c78fa55eb97 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 28 Jun 2022 17:14:20 +0800 Subject: [PATCH 09/31] =?UTF-8?q?=E3=80=90=E5=8F=8C=E5=AE=9E=E5=BD=95?= =?UTF-8?q?=E5=85=A5=E3=80=91=E7=BB=9F=E8=AE=A1=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HouseInformationController.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java index 1197747f69..13bf9edbe5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java @@ -17,18 +17,21 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.IcBuildingDTO; -import com.epmet.dto.IcBuildingUnitDTO; +import com.epmet.dto.form.HouseInformationFormDTO; +import com.epmet.dto.result.*; import com.epmet.entity.IcNeighborHoodEntity; +import com.epmet.service.HouseInformationService; import com.epmet.service.IcBuildingService; import com.epmet.service.IcBuildingUnitService; import com.epmet.service.IcNeighborHoodService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; /** From 3b92febe1580525059186954c8fc1641346f9c2b Mon Sep 17 00:00:00 2001 From: Jackwang Date: Wed, 29 Jun 2022 15:45:40 +0800 Subject: [PATCH 10/31] =?UTF-8?q?=E5=8F=8C=E5=AE=9E=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BD=95=E5=85=A5-=E8=8E=B7=E5=8F=96=E5=B0=8F=E5=8C=BA-?= =?UTF-8?q?=E6=A5=BC=E6=A0=8B-=E6=88=BF=E5=B1=8B=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/OrganizationCodeResultDTO.java | 26 ++ .../dto/result/OrganizationCommunityDTO.java | 24 ++ .../HouseInformationController.java | 44 ++- .../java/com/epmet/dao/CustomerGridDao.java | 9 + .../java/com/epmet/dao/IcBuildingDao.java | 19 ++ .../java/com/epmet/dao/IcBuildingUnitDao.java | 19 ++ .../main/java/com/epmet/dao/IcHouseDao.java | 9 + .../java/com/epmet/dao/IcNeighborHoodDao.java | 19 ++ .../epmet/dao/IcOrganizationCodeInfoDao.java | 50 +++- .../epmet/entity/IcBuildingUnitEntity.java | 10 + .../entity/IcOrganizationCodeInfoEntity.java | 4 + .../IcOrganizationCodeInfoService.java | 40 ++- .../IcOrganizationCodeInfoServiceImpl.java | 262 +++++++++++++++++- ....0.32__alter_ic_organization_code_info.sql | 4 + .../main/resources/mapper/CustomerGridDao.xml | 8 + .../main/resources/mapper/IcBuildingDao.xml | 17 ++ .../resources/mapper/IcBuildingUnitDao.xml | 18 ++ .../src/main/resources/mapper/IcHouseDao.xml | 6 + .../resources/mapper/IcNeighborHoodDao.xml | 16 ++ .../mapper/IcOrganizationCodeInfoDao.xml | 32 ++- 20 files changed, 622 insertions(+), 14 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrganizationCodeResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrganizationCommunityDTO.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.32__alter_ic_organization_code_info.sql diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrganizationCodeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrganizationCodeResultDTO.java new file mode 100644 index 0000000000..c370f5bbe3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrganizationCodeResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @program: epmet-cloud + * @description:小区-楼栋-房屋编码 + * @author: wangtong + * @create: 2022-06-29 09:51 + **/ +@Data +public class OrganizationCodeResultDTO implements Serializable { + + /** + * 可编辑的楼栋编码 + */ + private String coding; + + + /** + * 不可编辑的楼栋编码 + */ + private String sysCoding; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrganizationCommunityDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrganizationCommunityDTO.java new file mode 100644 index 0000000000..1933aeaa66 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrganizationCommunityDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-06-29 10:13 + **/ +@Data +public class OrganizationCommunityDTO implements Serializable { + + private String communityId; + + private String areaCode; + + private String coding; + + private String sysCoding; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java index 13bf9edbe5..ea9b6504a0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java @@ -24,10 +24,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.HouseInformationFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.IcNeighborHoodEntity; -import com.epmet.service.HouseInformationService; -import com.epmet.service.IcBuildingService; -import com.epmet.service.IcBuildingUnitService; -import com.epmet.service.IcNeighborHoodService; +import com.epmet.service.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -56,6 +53,9 @@ public class HouseInformationController { @Resource private HouseInformationService houseInformationService; + @Autowired + private IcOrganizationCodeInfoService icOrganizationCodeInfoService; + /** * @describe: 【双实录入】小区详情 * @author wangtong @@ -242,4 +242,40 @@ public class HouseInformationController { formDTO.setStaffId(tokenDTO.getUserId()); return new Result>().ok(houseInformationService.getHouseList(formDTO)); } + + /** + * @describe: 【双实录入】获取小区编码 + * @author wangtong + * @date 2022/6/29 9:59 + * @params [tokenDTO, gridId] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("getNeighborHoodCoding/{gridId}") + public Result getNeighborHoodCoding(@LoginUser TokenDto tokenDTO, @PathVariable("gridId") String gridId) { + return icOrganizationCodeInfoService.getNeighborHoodCoding(tokenDTO.getCustomerId(),gridId); + } + + /** + * @describe: 【双实录入】获取楼栋编码 + * @author wangtong + * @date 2022/6/29 9:59 + * @params [tokenDTO, neighborhoodId] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("getBuildingCoding/{neighborhoodId}") + public Result getBuildingCoding(@LoginUser TokenDto tokenDTO, @PathVariable("neighborhoodId") String neighborhoodId) { + return icOrganizationCodeInfoService.getBuildingCoding(tokenDTO.getCustomerId(),neighborhoodId); + } + + /** + * @describe: 【双实录入】获取房屋编码 + * @author wangtong + * @date 2022/6/29 9:59 + * @params [tokenDTO, unitId] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("getHouseCoding/{unitId}") + public Result getHouseCoding(@LoginUser TokenDto tokenDTO, @PathVariable("unitId") String unitId) { + return icOrganizationCodeInfoService.getHouseCoding(tokenDTO.getCustomerId(),unitId); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index 737e579fa5..1fb999e0f0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -384,4 +384,13 @@ public interface CustomerGridDao extends BaseDao { int updateTotalUser(@Param("gridId") String gridId, @Param("incrCount") long incrCount); List getDelGridIdList(@Param("agencyId") String agencyId); + + /** + * @describe: 通过网格id获取社区行政编码 + * @author wangtong + * @date 2022/6/29 10:16 + * @params [gridId] + * @return com.epmet.dto.result.OrganizationCommunityDTO + */ + OrganizationCommunityDTO selectCommunityByGridId(@Param("gridId") String gridId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java index a996255750..e38cfbbdda 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java @@ -204,4 +204,23 @@ public interface IcBuildingDao extends BaseDao { * @return com.epmet.dto.result.IcBulidingDetailDTO */ IcBulidingDetailDTO getBuildingDetail(@Param("buildingId") String buildingId); + + /** + * @describe: 查询社区id及楼栋编码 + * @author wangtong + * @date 2022/6/29 14:39 + * @params [buildingId] + * @return com.epmet.dto.result.OrganizationCommunityDTO + */ + OrganizationCommunityDTO selectCommunityByBuildingId(@Param("buildingId") String buildingId); + + /** + * @describe: 通过可编辑编码查询 + * @author wangtong + * @date 2022/6/29 14:57 + * @params [coding] + * @return com.epmet.entity.IcBuildingEntity + */ + IcBuildingEntity selectByCoding(@Param("coding") String coding); + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java index ad5e8358a7..09c40920ed 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingUnitDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.result.HouseInfoResultDTO; +import com.epmet.dto.result.OrganizationCommunityDTO; import com.epmet.entity.IcBuildingUnitEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -59,4 +60,22 @@ public interface IcBuildingUnitDao extends BaseDao { * @return com.epmet.dto.result.HouseInfoResultDTO */ HouseInfoResultDTO getUnitDetail(@Param("unitId") String unitId); + + /** + * @describe: 通过可编辑编码查询 + * @author wangtong + * @date 2022/6/29 14:59 + * @params [coding] + * @return com.epmet.entity.IcBuildingUnitEntity + */ + IcBuildingUnitEntity selectByCoding(@Param("coding") String coding); + + /** + * @describe: 查询社区id及单元编码 + * @author wangtong + * @date 2022/6/29 15:15 + * @params [buildingId] + * @return com.epmet.dto.result.OrganizationCommunityDTO + */ + OrganizationCommunityDTO selectCommunityByUnitId(@Param("unitId") String unitId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java index 8efb45cf92..9779126809 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java @@ -172,4 +172,13 @@ public interface IcHouseDao extends BaseDao { * @return java.util.List */ List searchHouseZipList(IcHouseListFormDTO formDTO); + + /** + * @describe: 通过可编辑的编码查询 + * @author wangtong + * @date 2022/6/29 15:24 + * @params [coding] + * @return com.epmet.entity.IcHouseEntity + */ + IcHouseEntity selectByCoding(@Param("coding") String coding); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java index ca929081cc..0bdd1d770f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java @@ -23,6 +23,7 @@ import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.NeighborHoodAndManagementDTO; import com.epmet.dto.form.IcNeighborHoodListFormDTO; import com.epmet.dto.result.IcNeighborHoodResultDTO; +import com.epmet.dto.result.OrganizationCommunityDTO; import com.epmet.entity.IcHouseEntity; import com.epmet.entity.IcNeighborHoodEntity; import com.epmet.excel.IcNeighborHoodExcel; @@ -91,4 +92,22 @@ public interface IcNeighborHoodDao extends BaseDao { void updateOneNeighborHood(ImportGeneralDTO info); String getAreaCode(@Param("neighborHoodId")String neighborHoodId); + + /** + * @describe: 查询社区id及小区编码 + * @author wangtong + * @date 2022/6/29 13:35 + * @params [neighborhoodId] + * @return com.epmet.dto.result.OrganizationCommunityDTO + */ + OrganizationCommunityDTO selectCommunityByNeiId(@Param("neighborhoodId") String neighborhoodId); + + /** + * @describe: 通过可编辑的编码查询 + * @author wangtong + * @date 2022/6/29 14:08 + * @params [coding] + * @return com.epmet.entity.IcNeighborHoodEntity + */ + IcNeighborHoodEntity selectByCoding(@Param("coding") String coding); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcOrganizationCodeInfoDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcOrganizationCodeInfoDao.java index c3b0a92d80..f2429582e2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcOrganizationCodeInfoDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcOrganizationCodeInfoDao.java @@ -3,6 +3,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.IcOrganizationCodeInfoEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 小区/楼栋/房屋编码辅助表 @@ -12,5 +13,50 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcOrganizationCodeInfoDao extends BaseDao { - -} \ No newline at end of file + + /** + * @describe: 通过客户id和社区id查询 + * @author wangtong + * @date 2022/6/29 10:24 + * @params [customerId, communityId] + * @return com.epmet.entity.IcOrganizationCodeInfoEntity + */ + IcOrganizationCodeInfoEntity selectByCommunityIdAndCustomerId(@Param("customerId") String customerId, + @Param("communityId") String communityId); + + /** + * @describe: 根据客户id和社区id更新小区编号 + * @author wangtong + * @date 2022/6/29 10:53 + * @params [communEntity] + * @return void + */ + void updateNeiByCuIdAndCoId(IcOrganizationCodeInfoEntity communEntity); + + /** + * @describe: 根据客户id和社区id更新楼栋编号 + * @author wangtong + * @date 2022/6/29 14:51 + * @params [buildingEntity] + * @return void + */ + void updateBuildingByCuIdAndCoId(IcOrganizationCodeInfoEntity buildingEntity); + + /** + * @describe: 根据客户id和社区id更新单元编号 + * @author wangtong + * @date 2022/6/29 15:01 + * @params [unitEntity] + * @return void + */ + void updateUnitByCuIdAndCoId(IcOrganizationCodeInfoEntity unitEntity); + + /** + * @describe: 根据客户id和社区id更新房屋编号 + * @author wangtong + * @date 2022/6/29 15:25 + * @params [houseEntity] + * @return void + */ + void updateHouseByCuIdAndCoId(IcOrganizationCodeInfoEntity houseEntity); +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingUnitEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingUnitEntity.java index bce611c47f..02124c90cc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingUnitEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcBuildingUnitEntity.java @@ -55,4 +55,14 @@ public class IcBuildingUnitEntity extends BaseEpmetEntity { */ private String unitName; + /** + * 楼栋编码 + */ + private String coding; + + /** + * 楼栋系统编码 + */ + private String sysCoding; + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcOrganizationCodeInfoEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcOrganizationCodeInfoEntity.java index f4e9671a73..e8c4a6d939 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcOrganizationCodeInfoEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcOrganizationCodeInfoEntity.java @@ -37,6 +37,10 @@ public class IcOrganizationCodeInfoEntity{ */ private String buildingMaxNum; + /** + * 该社区下最大的单元编码序列号 + */ + private String unitMaxNum; /** * 该社区下最大的房屋编码序列号 */ diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcOrganizationCodeInfoService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcOrganizationCodeInfoService.java index e98db783b5..c0e3bb5545 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcOrganizationCodeInfoService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcOrganizationCodeInfoService.java @@ -2,7 +2,9 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcOrganizationCodeInfoDTO; +import com.epmet.dto.result.OrganizationCodeResultDTO; import com.epmet.entity.IcOrganizationCodeInfoEntity; import java.util.List; @@ -75,4 +77,40 @@ public interface IcOrganizationCodeInfoService extends BaseService + */ + Result getNeighborHoodCoding(String customerId, String gridId); + + /** + * @describe: 【双实录入】获取楼栋编码 + * @author wangtong + * @date 2022/6/29 9:59 + * @params [tokenDTO, neighborhoodId] + * @return com.epmet.commons.tools.utils.Result + */ + Result getBuildingCoding(String customerId, String neighborhoodId); + + /** + * @describe: 【双实录入】获取单元编码 + * @author wangtong + * @date 2022/6/29 9:59 + * @params [tokenDTO, neighborhoodId] + * @return com.epmet.commons.tools.utils.Result + */ + Result getUnitCoding(String customerId, String buildingId); + + /** + * @describe: 【双实录入】获取房屋编码 + * @author wangtong + * @date 2022/6/29 9:59 + * @params [tokenDTO, unitId] + * @return com.epmet.commons.tools.utils.Result + */ + Result getHouseCoding(String customerId, String unitId); +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java index d6eba569b3..8cbb9ebbe0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java @@ -3,12 +3,19 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.dao.IcOrganizationCodeInfoDao; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.*; import com.epmet.dto.IcOrganizationCodeInfoDTO; -import com.epmet.entity.IcOrganizationCodeInfoEntity; +import com.epmet.dto.ImportGeneralDTO; +import com.epmet.dto.result.HouseInfoResultDTO; +import com.epmet.dto.result.OrganizationCodeResultDTO; +import com.epmet.dto.result.OrganizationCommunityDTO; +import com.epmet.entity.*; import com.epmet.redis.IcOrganizationCodeInfoRedis; import com.epmet.service.IcOrganizationCodeInfoService; import org.apache.commons.lang3.StringUtils; @@ -32,6 +39,21 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -48,8 +70,8 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl 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); @@ -84,4 +106,232 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl getNeighborHoodCoding(String customerId, String gridId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(gridId)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空"); + } + OrganizationCodeResultDTO result = new OrganizationCodeResultDTO(); + //获取社区id、行政编码 + OrganizationCommunityDTO communResult = customerGridDao.selectCommunityByGridId(gridId); + if (null == communResult || StringUtils.isBlank(communResult.getCommunityId())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关社区信息", "未查到相关社区信息"); + } + //查询该社区下是否存在数据 + IcOrganizationCodeInfoEntity communEntity = baseDao.selectByCommunityIdAndCustomerId(customerId, communResult.getCommunityId()); + if (null == communEntity) { + String neighborCode = getCompleteAreaCode(communResult.getAreaCode()) + "001"; + + result.setCoding(neighborCode); + result.setSysCoding(neighborCode); + //新增该社区辅助数据 + IcOrganizationCodeInfoEntity newEntity = new IcOrganizationCodeInfoEntity(); + newEntity.setCustomerId(customerId); + newEntity.setCommunityId(communResult.getCommunityId()); + newEntity.setNeighborMaxNum("001"); + baseDao.insert(newEntity); + } else { + Integer neighborMaxNum = Integer.valueOf(communEntity.getNeighborMaxNum()) + 1; + //验证可编辑的编码是否有重复 + String neiCode = communResult.getCoding() + getNewMaxIndex(3, neighborMaxNum); + IcNeighborHoodEntity isHaveCoding = icNeighborHoodDao.selectByCoding(neiCode); + while (null != isHaveCoding) { + neighborMaxNum++; + neiCode = communResult.getCoding() + getNewMaxIndex(3, neighborMaxNum); + isHaveCoding = icNeighborHoodDao.selectByCoding(neiCode); + } + //更新该社区下最大的小区编号 + communEntity.setNeighborMaxNum(getNewMaxIndex(3, neighborMaxNum)); + baseDao.updateNeiByCuIdAndCoId(communEntity); + + String neighborCode = getCompleteAreaCode(communResult.getAreaCode()) + getNewMaxIndex(3, neighborMaxNum); + result.setCoding(neiCode); + result.setSysCoding(neighborCode); + } + return new Result().ok(result); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result getBuildingCoding(String customerId, String neighborhoodId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(neighborhoodId)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空"); + } + //组装返回结果 + OrganizationCodeResultDTO result = new OrganizationCodeResultDTO(); + + IcNeighborHoodEntity neighborHood = icNeighborHoodDao.selectById(neighborhoodId); + if (null == neighborHood) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关小区信息", "未查到相关小区信息"); + } + //如果小区编码为空,先生成小区编码并更新 + if (StringUtils.isBlank(neighborHood.getSysCoding())) { + OrganizationCodeResultDTO org = getNeighborHoodCoding(customerId, neighborHood.getGridId()).getData(); + neighborHood.setCoding(org.getCoding()); + neighborHood.setSysCoding(org.getSysCoding()); + icNeighborHoodDao.updateById(neighborHood); + } + + //获取社区id、小区编码 + OrganizationCommunityDTO communResult = icNeighborHoodDao.selectCommunityByNeiId(neighborhoodId); + //查询该社区下是否存在楼栋数据 + IcOrganizationCodeInfoEntity buildingEntity = baseDao.selectByCommunityIdAndCustomerId(customerId, communResult.getCommunityId()); + if (StringUtils.isBlank(buildingEntity.getBuildingMaxNum())) { + result.setCoding(communResult.getCoding() + "001"); + result.setSysCoding(communResult.getSysCoding() + "001"); + //补充该社区的楼栋最大数 + buildingEntity.setBuildingMaxNum("001"); + } else { + Integer buildingMaxNum = Integer.valueOf(buildingEntity.getBuildingMaxNum()) + 1; + //验证可编辑的编码是否有重复 + String buildingCode = communResult.getCoding() + getNewMaxIndex(3, buildingMaxNum); + IcBuildingEntity isHaveCoding = icBuildingDao.selectByCoding(buildingCode); + while (null != isHaveCoding) { + buildingMaxNum++; + buildingCode = communResult.getCoding() + getNewMaxIndex(3, buildingMaxNum); + isHaveCoding = icBuildingDao.selectByCoding(buildingCode); + } + result.setCoding(buildingCode); + result.setSysCoding(communResult.getSysCoding() + getNewMaxIndex(3, buildingMaxNum)); + + //更新该社区下最大的楼栋编号 + buildingEntity.setBuildingMaxNum(getNewMaxIndex(3, buildingMaxNum)); + } + baseDao.updateBuildingByCuIdAndCoId(buildingEntity); + return new Result().ok(result); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result getUnitCoding(String customerId, String buildingId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(buildingId)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空"); + } + //组装返回结果 + OrganizationCodeResultDTO result = new OrganizationCodeResultDTO(); + + IcBuildingEntity buildingEntity = icBuildingDao.selectById(buildingId); + if (null == buildingEntity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关楼栋信息", "未查到相关楼栋信息"); + } + //如果楼栋编码为空,先生成楼栋编码并更新 + if (StringUtils.isBlank(buildingEntity.getSysCoding())) { + ImportGeneralDTO neiInfo = icBuildingDao.selectBuildingById(buildingId); + OrganizationCodeResultDTO org = getBuildingCoding(customerId, neiInfo.getNeighborHoodId()).getData(); + buildingEntity.setCoding(org.getCoding()); + buildingEntity.setSysCoding(org.getSysCoding()); + icBuildingDao.updateById(buildingEntity); + } + + //获取社区id、楼栋编码 + OrganizationCommunityDTO communResult = icBuildingDao.selectCommunityByBuildingId(buildingId); + //查询该社区下是否存在单元数据 + IcOrganizationCodeInfoEntity unitEntity = baseDao.selectByCommunityIdAndCustomerId(customerId, communResult.getCommunityId()); + if (StringUtils.isBlank(unitEntity.getUnitMaxNum())) { + result.setCoding(communResult.getCoding() + "001"); + result.setSysCoding(communResult.getSysCoding() + "001"); + //补充该社区的单元最大数 + unitEntity.setUnitMaxNum("001"); + } else { + Integer unitMaxNum = Integer.valueOf(unitEntity.getUnitMaxNum()) + 1; + //验证可编辑的编码是否有重复 + String unitCode = communResult.getCoding() + getNewMaxIndex(2, unitMaxNum); + IcBuildingUnitEntity isHaveCoding = icBuildingUnitDao.selectByCoding(unitCode); + while (null != isHaveCoding) { + unitMaxNum++; + unitCode = communResult.getCoding() + getNewMaxIndex(2, unitMaxNum); + isHaveCoding = icBuildingUnitDao.selectByCoding(unitCode); + } + result.setCoding(unitCode); + result.setSysCoding(communResult.getSysCoding() + getNewMaxIndex(2, unitMaxNum)); + + //更新该社区下最大的单元编号 + unitEntity.setUnitMaxNum(getNewMaxIndex(2, unitMaxNum)); + } + baseDao.updateUnitByCuIdAndCoId(unitEntity); + return new Result().ok(result); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result getHouseCoding(String customerId, String unitId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(unitId)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空"); + } + //组装返回结果 + OrganizationCodeResultDTO result = new OrganizationCodeResultDTO(); + + IcBuildingUnitEntity unitEntity = icBuildingUnitDao.selectById(unitId); + if (null == unitEntity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关单元信息", "未查到相关单元信息"); + } + //如果单元编码为空,先生成单元编码并更新 + if (StringUtils.isBlank(unitEntity.getSysCoding())) { + HouseInfoResultDTO buildingInfo = icBuildingUnitDao.getUnitDetail(unitId); + OrganizationCodeResultDTO org = getUnitCoding(customerId, buildingInfo.getBuildingId()).getData(); + unitEntity.setCoding(org.getCoding()); + unitEntity.setSysCoding(org.getSysCoding()); + icBuildingUnitDao.updateById(unitEntity); + } + + //获取社区id、单元编码 + OrganizationCommunityDTO communResult = icBuildingUnitDao.selectCommunityByUnitId(unitId); + //查询该社区下是否存在单元数据 + IcOrganizationCodeInfoEntity houseEntity = baseDao.selectByCommunityIdAndCustomerId(customerId, communResult.getCommunityId()); + if (StringUtils.isBlank(houseEntity.getUnitMaxNum())) { + result.setCoding(communResult.getCoding() + "001"); + //补充该社区的单元最大数 + houseEntity.setUnitMaxNum("001"); + } else { + Integer houseMaxNum = Integer.valueOf(houseEntity.getUnitMaxNum()) + 1; + //验证可编辑的编码是否有重复 + String houseCode = communResult.getCoding() + getNewMaxIndex(4, houseMaxNum); + IcHouseEntity isHaveCoding = icHouseDao.selectByCoding(houseCode); + while (null != isHaveCoding) { + houseMaxNum++; + houseCode = communResult.getCoding() + getNewMaxIndex(4, houseMaxNum); + isHaveCoding = icHouseDao.selectByCoding(houseCode); + } + result.setCoding(houseCode); + + //更新该社区下最大的房屋编号 + houseEntity.setUnitMaxNum(getNewMaxIndex(4, houseMaxNum)); + } + baseDao.updateHouseByCuIdAndCoId(houseEntity); + return new Result().ok(result); + } + + /** + * @return java.lang.String + * @describe: 把数字转换成maxLength位的字符串,不够的前面补0 + * @author wangtong + * @date 2022/6/29 10:30 + * @params [maxLength, maxIndex] + */ + private String getNewMaxIndex(Integer maxLength, Integer maxIndex) { + String result = maxIndex.toString(); + while (result.length() < maxLength) { + result = "0" + result; + } + return result; + } + + /** + * @return java.lang.String + * @describe: 补全行政编码,12位 + * @author wangtong + * @date 2022/6/29 10:34 + * @params [areaCode] + */ + private String getCompleteAreaCode(String areaCode) { + if (StringUtils.isBlank(areaCode)) { + areaCode = "0"; + } + while (areaCode.length() < 12) { + areaCode = areaCode + "0"; + } + return areaCode; + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.32__alter_ic_organization_code_info.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.32__alter_ic_organization_code_info.sql new file mode 100644 index 0000000000..aa87d01a3a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.32__alter_ic_organization_code_info.sql @@ -0,0 +1,4 @@ +alter table ic_organization_code_info add COLUMN`UNIT_MAX_NUM` varchar(10) NOT NULL COMMENT '该社区下最大的单元编码序列号'; + +alter table ic_building_unit add COLUMN `CODING` varchar(64) DEFAULT NULL COMMENT '单元编码'; +alter table ic_building_unit add COLUMN `SYS_CODING` varchar(64) DEFAULT NULL COMMENT '单元系统编码'; diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index e428bc42c6..c98c898f26 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -861,5 +861,13 @@ UPDATE customer_grid SET total_user = total_user+#{incrCount} where id = #{gridId} and del_flag = '0' + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml index c87edfccd5..a7ffad3cd8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml @@ -428,5 +428,22 @@ WHERE b.DEL_FLAG = '0' AND b.ID = #{buildingId} + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml index 31b2e4873e..fe5a0ef73b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml @@ -40,6 +40,24 @@ WHERE bu.DEL_FLAG = '0' AND bu.ID = #{unitId} + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index c55f985fc5..326bbc864f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -521,5 +521,11 @@ #{id} ) + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml index 8d6e24b5f7..544451a17c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml @@ -312,4 +312,20 @@ a.del_flag = '0' AND a.ID = #{neighborHoodId} + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcOrganizationCodeInfoDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcOrganizationCodeInfoDao.xml index b544ba7019..c5fea23a4f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcOrganizationCodeInfoDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcOrganizationCodeInfoDao.xml @@ -10,6 +10,36 @@ + + + update ic_organization_code_info + set NEIGHBOR_MAX_NUM=#{neighborMaxNum} + where CUSTOMER_ID = #{customerId} + and COMMUNITY_ID = #{communityId} + + + update ic_organization_code_info + set BUILDING_MAX_NUM=#{buildingMaxNum} + where CUSTOMER_ID = #{customerId} + and COMMUNITY_ID = #{communityId} + + + update ic_organization_code_info + set UNIT_MAX_NUM=#{unitMaxNum} + where CUSTOMER_ID = #{customerId} + and COMMUNITY_ID = #{communityId} + + + update ic_organization_code_info + set HOUSE_MAX_NUM=#{houseMaxNum} + where CUSTOMER_ID = #{customerId} + and COMMUNITY_ID = #{communityId} + - \ No newline at end of file + From a57b5a9940c7a5218d9642eceb7a501d9c4ac654 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Wed, 29 Jun 2022 16:42:16 +0800 Subject: [PATCH 11/31] =?UTF-8?q?=E5=8F=8C=E5=AE=9E=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BD=95=E5=85=A5-=E5=B0=8F=E5=8C=BA=E3=80=81=E6=A5=BC?= =?UTF-8?q?=E6=A0=8B=E3=80=81=E6=88=BF=E5=B1=8B-=E6=96=B0=E5=A2=9E/?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B7=BB=E5=8A=A0=E9=83=A8=E5=88=86=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/IcBulidingAddFormDTO.java | 13 +++++++++++++ .../com/epmet/dto/form/IcHouseAddFormDTO.java | 5 +++++ .../epmet/dto/form/IcNeighborHoodAddFormDTO.java | 13 +++++++++++++ .../com/epmet/dto/result/HouseInfoResultDTO.java | 5 +++++ .../main/java/com/epmet/dao/IcBuildingDao.java | 3 ++- .../java/com/epmet/dao/IcNeighborHoodDao.java | 3 ++- .../epmet/service/impl/BuildingServiceImpl.java | 14 ++++++++++++++ .../com/epmet/service/impl/HouseServiceImpl.java | 8 +++++++- .../impl/IcOrganizationCodeInfoServiceImpl.java | 8 ++++---- .../service/impl/NeighborHoodServiceImpl.java | 15 ++++++++++++++- .../src/main/resources/mapper/IcBuildingDao.xml | 3 +++ .../src/main/resources/mapper/IcHouseDao.xml | 3 ++- .../main/resources/mapper/IcNeighborHoodDao.xml | 3 +++ 13 files changed, 87 insertions(+), 9 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java index 58655da002..e3401fa877 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java @@ -135,7 +135,20 @@ public class IcBulidingAddFormDTO implements Serializable { */ private String buildingLeaderMobile; + /** + * 楼栋编码 + */ + private String coding; + /** + * 楼栋系统编码 + */ + private String sysCoding; + + /** + * 实有人口数 + */ + private Integer realPerson; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java index a07f4fe886..aa4e6a999b 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java @@ -108,4 +108,9 @@ public class IcHouseAddFormDTO implements Serializable { private BigDecimal sort = NumConstant.ZERO_DECIMAL; + /** + * 房屋可编辑编码 + */ + private String coding; + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodAddFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodAddFormDTO.java index 65708da4d3..854462c6e1 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodAddFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodAddFormDTO.java @@ -99,7 +99,20 @@ public class IcNeighborHoodAddFormDTO extends PageFormDTO { private String latitude; + /** + * 小区编码 + */ + private String coding; + /** + * 小区系统编码 + */ + private String sysCoding; + + /** + * 实有楼栋数 + */ + private Integer realBuilding; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoResultDTO.java index e83ec67bf4..ddb4af560e 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoResultDTO.java @@ -103,4 +103,9 @@ public class HouseInfoResultDTO implements Serializable { * 备注 */ private String remark; + + /** + * 房屋可编辑编码 + */ + private String coding; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java index e38cfbbdda..8b0cd3f470 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcBuildingDao.java @@ -221,6 +221,7 @@ public interface IcBuildingDao extends BaseDao { * @params [coding] * @return com.epmet.entity.IcBuildingEntity */ - IcBuildingEntity selectByCoding(@Param("coding") String coding); + IcBuildingEntity selectByCoding(@Param("coding") String coding, + @Param("id") String id); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java index 0bdd1d770f..ac8fc69c10 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java @@ -109,5 +109,6 @@ public interface IcNeighborHoodDao extends BaseDao { * @params [coding] * @return com.epmet.entity.IcNeighborHoodEntity */ - IcNeighborHoodEntity selectByCoding(@Param("coding") String coding); + IcNeighborHoodEntity selectByCoding(@Param("coding") String coding, + @Param("id") String id); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java index 6a95c20596..a32f8489fb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java @@ -100,6 +100,13 @@ public class BuildingServiceImpl implements BuildingService { if (null != count && count > 0) { throw new RenException(EpmetErrorCode.BUILDING_NAME_EXITED.getCode(), EpmetErrorCode.BUILDING_NAME_EXITED.getMsg()); } + //楼栋编码不可重复 + if(org.apache.commons.lang3.StringUtils.isNotBlank(formDTO.getCoding())){ + IcBuildingEntity isHaveCoding = icBuildingDao.selectByCoding(formDTO.getCoding(),null); + if(null != isHaveCoding){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "该楼栋编码已存在,请勿重复!","该楼栋编码已存在,请勿重复!"); + } + } IcBuildingDTO icBuildingDTO = ConvertUtils.sourceToTarget(formDTO, IcBuildingDTO.class); icBuildingDTO.setCustomerId(customerId); IcBuildingEntity entity = ConvertUtils.sourceToTarget(icBuildingDTO, IcBuildingEntity.class); @@ -440,6 +447,13 @@ public class BuildingServiceImpl implements BuildingService { throw new RenException(EpmetErrorCode.ORG_EDIT_FAILED.getCode(), "楼栋单元下存在房屋,无法更新"); } } + //楼栋编码不可重复 + if(org.apache.commons.lang3.StringUtils.isNotBlank(formDTO.getCoding())){ + IcBuildingEntity isHaveCoding = icBuildingDao.selectByCoding(formDTO.getCoding(),formDTO.getBuildingId()); + if(null != isHaveCoding){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "该楼栋编码已存在,请勿重复!","该楼栋编码已存在,请勿重复!"); + } + } IcBuildingDTO icBuildingDTO = ConvertUtils.sourceToTarget(formDTO, IcBuildingDTO.class); icBuildingDTO.setId(formDTO.getBuildingId()); icBuildingDTO.setCustomerId(customerId); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index e329260f69..127eef5f0e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -137,7 +137,13 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { if (null != count && count > 0) { throw new RenException(EpmetErrorCode.DOOR_NAME_EXITED.getCode(), EpmetErrorCode.DOOR_NAME_EXITED.getMsg()); } - + //房屋编码不可重复 + if(org.apache.commons.lang3.StringUtils.isNotBlank(formDTO.getCoding())){ + IcHouseEntity isHaveCoding = icHouseDao.selectByCoding(formDTO.getCoding()); + if(null != isHaveCoding){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "该房屋编码已存在,请勿重复!","该房屋编码已存在,请勿重复!"); + } + } IcHouseEntity icHouseDTO = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); icHouseDTO.setCustomerId(customerId); icHouseDTO.setHouseName(getHouseName(formDTO)); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java index 8cbb9ebbe0..3466b89a3b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java @@ -135,11 +135,11 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl 0) { throw new RenException(EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getCode(), EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg()); } - + //小区编码不可重复 + if(org.apache.commons.lang3.StringUtils.isNotBlank(formDTO.getCoding())){ + IcNeighborHoodEntity isHaveCoding = icNeighborHoodDao.selectByCoding(formDTO.getCoding(),formDTO.getNeighborHoodId()); + if(null != isHaveCoding){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "该小区编码已存在,请勿重复!","该小区编码已存在,请勿重复!"); + } + } IcNeighborHoodDTO icNeighborHoodDTO = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodDTO.class); icNeighborHoodDTO.setId(formDTO.getNeighborHoodId()); icNeighborHoodDTO.setCustomerId(customerId); diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml index a7ffad3cd8..f552de0747 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml @@ -444,6 +444,9 @@ from ic_building where del_flag = '0' and CODING=#{coding} + + and id != #{id} + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index 326bbc864f..b383b938b4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -450,7 +450,8 @@ a.OWNER_PHONE, a.OWNER_ID_CARD, a.REMARK, - c.AGENCY_PIDS + c.AGENCY_PIDS, + a.CODING from ic_house a LEFT JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0' LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0' diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml index 544451a17c..de52475d2a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml @@ -327,5 +327,8 @@ from ic_neighbor_hood where del_flag = '0' and CODING=#{coding} + + and id != #{id} + From 917af2df9c38038ed3ebb4abd961947bac5620c0 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 29 Jun 2022 17:23:26 +0800 Subject: [PATCH 12/31] =?UTF-8?q?=E3=80=90=E5=8F=8C=E5=AE=9E=E5=BD=95?= =?UTF-8?q?=E5=85=A5=E3=80=91=E7=BB=9F=E8=AE=A1=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/HouseInformationFormDTO.java | 3 +- .../dto/result/BuildingCountResultDTO.java | 1 + .../dto/result/BuildingListResultDTO.java | 5 +- .../dto/result/CommunityCountResultDTO.java | 2 + .../dto/result/GridCountListResultDTO.java | 3 + .../dto/result/GridStatisticsResultDTO.java | 2 + .../result/NeighborHoodCountResultDTO.java | 1 + .../dto/result/NeighborHoodListResultDTO.java | 3 + .../epmet/dto/result/UnitCountResultDTO.java | 1 + .../HouseInformationController.java | 10 + .../java/com/epmet/dao/IcNeighborHoodDao.java | 104 +++++- .../impl/HouseInformationServiceImpl.java | 112 ++++++- .../resources/mapper/IcNeighborHoodDao.xml | 313 ++++++++++++++++++ 13 files changed, 543 insertions(+), 17 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseInformationFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseInformationFormDTO.java index 3533225669..8fd3a8358e 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseInformationFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseInformationFormDTO.java @@ -13,6 +13,7 @@ import java.io.Serializable; @Data public class HouseInformationFormDTO extends PageFormDTO implements Serializable { private static final long serialVersionUID = 2348447479132364176L; + private String customerId; private String staffId; private String communityId; private String gridId; @@ -20,5 +21,5 @@ public class HouseInformationFormDTO extends PageFormDTO implements Serializable private String buildingId; private String unitId; private String name; - private String sort; + private String sort = "1"; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingCountResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingCountResultDTO.java index 69f3919b61..c37e19702d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingCountResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingCountResultDTO.java @@ -12,6 +12,7 @@ import lombok.NoArgsConstructor; @Data public class BuildingCountResultDTO { private String buildingId; + private String buildingName; private String buildingType; private Integer unitCount; private Integer houseCount; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java index ed54d7b998..e0f6c7e038 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java @@ -16,10 +16,11 @@ public class BuildingListResultDTO implements Serializable { private static final long serialVersionUID = -1423424057500044373L; private String id; private String name; - private Integer buildingCount; + private Integer unitCount; private Integer houseCount; private Integer personCount; - private Integer differBuildingCount; private Integer differHouseCount; private Integer differPersonCount; + private Integer houseRealCount; + private Integer personRealCount; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountResultDTO.java index 2d85e642ca..50961f3a9f 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountResultDTO.java @@ -14,6 +14,8 @@ import java.io.Serializable; @Data public class CommunityCountResultDTO implements Serializable { private static final long serialVersionUID = -1677303397440121269L; + private String id; + private String name; private Integer buildingCount; private Integer houseCount; private Integer personCount; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridCountListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridCountListResultDTO.java index 9a5c6b368c..99318e3bc5 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridCountListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridCountListResultDTO.java @@ -22,4 +22,7 @@ public class GridCountListResultDTO implements Serializable { private Integer differBuildingCount; private Integer differHouseCount; private Integer differPersonCount; + private Integer buildingRealCount; + private Integer houseRealCount; + private Integer personRealCount; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStatisticsResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStatisticsResultDTO.java index d1a74e8847..ea5ff3634f 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStatisticsResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStatisticsResultDTO.java @@ -15,6 +15,8 @@ import java.io.Serializable; public class GridStatisticsResultDTO implements Serializable { private static final long serialVersionUID = -2022337690871957027L; + private String gridId; + private String gridName; private Integer buildingCount; private Integer houseCount; private Integer personCount; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodCountResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodCountResultDTO.java index 9c7d5cfcfd..610b7d871f 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodCountResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodCountResultDTO.java @@ -15,6 +15,7 @@ import java.io.Serializable; public class NeighborHoodCountResultDTO implements Serializable { private static final long serialVersionUID = 4148009467129407023L; private String neighborHoodId; + private String neighborHoodName; private Integer buildingCount; private Integer houseCount; private Integer personCount; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodListResultDTO.java index fa41ac49f8..ad256b2f9f 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodListResultDTO.java @@ -22,4 +22,7 @@ public class NeighborHoodListResultDTO implements Serializable { private Integer differBuildingCount; private Integer differHouseCount; private Integer differPersonCount; + private Integer buildingRealCount; + private Integer houseRealCount; + private Integer personRealCount; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitCountResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitCountResultDTO.java index 548e0c4ef6..ac8d1d8d03 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitCountResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitCountResultDTO.java @@ -12,6 +12,7 @@ import lombok.NoArgsConstructor; @Data public class UnitCountResultDTO { private String unitId; + private String unitName; private Integer houseCount; private Integer personCount; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java index ea9b6504a0..314940ecf8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java @@ -103,6 +103,7 @@ public class HouseInformationController { */ @PostMapping("getCommunityCount") public Result getCommunityCount(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); formDTO.setStaffId(tokenDTO.getUserId()); return new Result().ok(houseInformationService.getCommunityCount(formDTO)); } @@ -118,6 +119,7 @@ public class HouseInformationController { */ @PostMapping("getGridList") public Result> getGridList(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); formDTO.setStaffId(tokenDTO.getUserId()); return new Result>().ok(houseInformationService.getGridList(formDTO)); } @@ -133,6 +135,7 @@ public class HouseInformationController { */ @PostMapping("getGridCount") public Result getGridCount(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); formDTO.setStaffId(tokenDTO.getUserId()); return new Result().ok(houseInformationService.getGridCount(formDTO)); } @@ -148,6 +151,7 @@ public class HouseInformationController { */ @PostMapping("getNeighborHoodList") public Result> getNeighborHoodList(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); formDTO.setStaffId(tokenDTO.getUserId()); return new Result>().ok(houseInformationService.getNeighborHoodList(formDTO)); } @@ -163,6 +167,7 @@ public class HouseInformationController { */ @PostMapping("getNeighborHoodCount") public Result getNeighborHoodCount(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); formDTO.setStaffId(tokenDTO.getUserId()); return new Result().ok(houseInformationService.getNeighborHoodCount(formDTO)); } @@ -178,6 +183,7 @@ public class HouseInformationController { */ @PostMapping("getBuildingList") public Result> getBuildingList(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); formDTO.setStaffId(tokenDTO.getUserId()); return new Result>().ok(houseInformationService.getBuildingList(formDTO)); } @@ -194,6 +200,7 @@ public class HouseInformationController { */ @PostMapping("getBuildingCount") public Result getBuildingCount(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); formDTO.setStaffId(tokenDTO.getUserId()); return new Result().ok(houseInformationService.getBuildingCount(formDTO)); } @@ -209,6 +216,7 @@ public class HouseInformationController { */ @PostMapping("getUnitList") public Result> getUnitList(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); formDTO.setStaffId(tokenDTO.getUserId()); return new Result>().ok(houseInformationService.getUnitList(formDTO)); } @@ -224,6 +232,7 @@ public class HouseInformationController { */ @PostMapping("getUnitCount") public Result getUnitCount(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); formDTO.setStaffId(tokenDTO.getUserId()); return new Result().ok(houseInformationService.getUnitCount(formDTO)); } @@ -239,6 +248,7 @@ public class HouseInformationController { */ @PostMapping("getHouseList") public Result> getHouseList(@LoginUser TokenDto tokenDTO, @RequestBody HouseInformationFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); formDTO.setStaffId(tokenDTO.getUserId()); return new Result>().ok(houseInformationService.getHouseList(formDTO)); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java index ac8fc69c10..f872338c1e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java @@ -21,9 +21,9 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.NeighborHoodAndManagementDTO; +import com.epmet.dto.form.HouseInformationFormDTO; import com.epmet.dto.form.IcNeighborHoodListFormDTO; -import com.epmet.dto.result.IcNeighborHoodResultDTO; -import com.epmet.dto.result.OrganizationCommunityDTO; +import com.epmet.dto.result.*; import com.epmet.entity.IcHouseEntity; import com.epmet.entity.IcNeighborHoodEntity; import com.epmet.excel.IcNeighborHoodExcel; @@ -111,4 +111,104 @@ public interface IcNeighborHoodDao extends BaseDao { */ IcNeighborHoodEntity selectByCoding(@Param("coding") String coding, @Param("id") String id); + + /** + * 社区录入数据统计 + * + * @Param communityId + * @Return {@link CommunityCountResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/28 17:16 + */ + CommunityCountResultDTO getCommunityCount(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】社区-网格列表 + * + * @Param formDTO + * @Return {@link List< GridCountListResultDTO>} + * @Author zhaoqifeng + * @Date 2022/6/29 11:06 + */ + List getGridList(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】网格录入数据统计 + * + * @Param formDTO + * @Return {@link GridStatisticsResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/29 13:52 + */ + GridStatisticsResultDTO getGridCount(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】网格-小区列表 + * + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2022/6/29 14:11 + */ + List getNeighborHoodList(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】小区录入数据统计 + * + * @Param formDTO + * @Return {@link NeighborHoodCountResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/29 14:27 + */ + NeighborHoodCountResultDTO getNeighborHoodCount(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】小区-楼栋列表 + * + * @Param formDTO + * @Return {@link List< BuildingListResultDTO>} + * @Author zhaoqifeng + * @Date 2022/6/29 14:50 + */ + List getBuildingList(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】楼栋录入数据统计 + * + * @Param formDTO + * @Return {@link BuildingCountResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/29 15:44 + */ + BuildingCountResultDTO getBuildingCount(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】楼栋-单元列表 + * + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2022/6/29 16:07 + */ + List getUnitList(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】单元录入数据统计 + * + * @Param formDTO + * @Return {@link UnitCountResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/29 16:06 + */ + UnitCountResultDTO getUnitCount(HouseInformationFormDTO formDTO); + + /** + * 【双实录入】单元-房屋列表 + * + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2022/6/29 16:48 + */ + List getHouseList(HouseInformationFormDTO formDTO) } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java index 0a03a15f97..66aae8029b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java @@ -1,12 +1,28 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.dao.CustomerAgencyDao; +import com.epmet.dao.IcNeighborHoodDao; import com.epmet.dto.form.HouseInformationFormDTO; import com.epmet.dto.result.*; +import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.enums.HouseRentFlagEnums; import com.epmet.service.HouseInformationService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; + /** * @Description * @Author zhaoqifeng @@ -15,6 +31,12 @@ import org.springframework.stereotype.Service; @Slf4j @Service public class HouseInformationServiceImpl implements HouseInformationService { + + @Resource + private IcNeighborHoodDao icNeighborHoodDao; + @Resource + private CustomerAgencyDao customerAgencyDao; + /** * 【双实录入】社区录入数据统计 * @@ -26,7 +48,31 @@ public class HouseInformationServiceImpl implements HouseInformationService { */ @Override public CommunityCountResultDTO getCommunityCount(HouseInformationFormDTO formDTO) { - return null; + if (StringUtils.isEmpty(formDTO.getCommunityId())) { + //获取工作人员所属组织 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if(null == staffInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取用户信息失败", "获取用户信息失败"); + } + formDTO.setCommunityId(staffInfo.getAgencyId()); + } + String orgName; + CustomerAgencyEntity agency = customerAgencyDao.selectById(formDTO.getCommunityId()); + if (null == agency) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "社区不存在", "社区不存在"); + } + CustomerAgencyEntity parentAgency = customerAgencyDao.selectById(agency.getPid()); + if (null == parentAgency) { + orgName = agency.getOrganizationName(); + } else { + orgName = parentAgency.getOrganizationName() + agency.getOrganizationName(); + } + //获取工作人员信息 + CommunityCountResultDTO result = icNeighborHoodDao.getCommunityCount(formDTO); + result.setId(agency.getId()); + result.setName(orgName); + //TODO 获取录入人口数 + return result; } /** @@ -34,13 +80,17 @@ public class HouseInformationServiceImpl implements HouseInformationService { * * @param formDTO * @Param formDTO - * @Return {@link PageData < GridCountListResultDTO >} + * @Return {@link PageData} * @Author zhaoqifeng * @Date 2022/6/28 15:41 */ @Override public PageData getGridList(HouseInformationFormDTO formDTO) { - return null; + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = icNeighborHoodDao.getGridList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + //TODO 获取录入人口数 + return new PageData<>(list, pageInfo.getTotal()); } /** @@ -54,7 +104,9 @@ public class HouseInformationServiceImpl implements HouseInformationService { */ @Override public GridStatisticsResultDTO getGridCount(HouseInformationFormDTO formDTO) { - return null; + GridStatisticsResultDTO result = icNeighborHoodDao.getGridCount(formDTO); + //TODO 获取录入人口数 + return result; } /** @@ -62,13 +114,17 @@ public class HouseInformationServiceImpl implements HouseInformationService { * * @param formDTO * @Param formDTO - * @Return {@link PageData< NeighborHoodListResultDTO >} + * @Return {@link PageData} * @Author zhaoqifeng * @Date 2022/6/28 16:24 */ @Override public PageData getNeighborHoodList(HouseInformationFormDTO formDTO) { - return null; + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = icNeighborHoodDao.getNeighborHoodList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + //TODO 获取录入人口数 + return new PageData<>(list, pageInfo.getTotal()); } /** @@ -82,7 +138,9 @@ public class HouseInformationServiceImpl implements HouseInformationService { */ @Override public NeighborHoodCountResultDTO getNeighborHoodCount(HouseInformationFormDTO formDTO) { - return null; + NeighborHoodCountResultDTO result = icNeighborHoodDao.getNeighborHoodCount(formDTO); + //TODO 获取录入人口数 + return result; } /** @@ -96,7 +154,20 @@ public class HouseInformationServiceImpl implements HouseInformationService { */ @Override public PageData getBuildingList(HouseInformationFormDTO formDTO) { - return null; + List list; + long total = 0; + //TODO 获取录入人口数 + if (NumConstant.FIVE_STR.equals(formDTO.getSort())) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + list = icNeighborHoodDao.getBuildingList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + total = pageInfo.getTotal(); + } else { + list = icNeighborHoodDao.getBuildingList(formDTO); + total = list.size(); + } + + return new PageData<>(list, total); } /** @@ -110,7 +181,9 @@ public class HouseInformationServiceImpl implements HouseInformationService { */ @Override public BuildingCountResultDTO getBuildingCount(HouseInformationFormDTO formDTO) { - return null; + BuildingCountResultDTO result = icNeighborHoodDao.getBuildingCount(formDTO); + //TODO 获取录入人口数 + return result; } /** @@ -124,7 +197,11 @@ public class HouseInformationServiceImpl implements HouseInformationService { */ @Override public PageData getUnitList(HouseInformationFormDTO formDTO) { - return null; + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = icNeighborHoodDao.getUnitList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + //TODO 获取录入人口数 + return new PageData<>(list, pageInfo.getTotal()); } /** @@ -138,7 +215,9 @@ public class HouseInformationServiceImpl implements HouseInformationService { */ @Override public UnitCountResultDTO getUnitCount(HouseInformationFormDTO formDTO) { - return null; + UnitCountResultDTO result = icNeighborHoodDao.getUnitCount(formDTO); + //TODO 获取录入人口数 + return result; } /** @@ -152,6 +231,15 @@ public class HouseInformationServiceImpl implements HouseInformationService { */ @Override public PageData getHouseList(HouseInformationFormDTO formDTO) { - return null; + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = icNeighborHoodDao.getHouseList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + //TODO 获取录入人口数 + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + item.setHouseType(HouseRentFlagEnums.getTypeValue(item.getHouseType())); + }); + } + return new PageData<>(list, pageInfo.getTotal()); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml index de52475d2a..2ac839f1ce 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml @@ -331,4 +331,317 @@ and id != #{id} + + + + + + + + + + + + + + + + + + + From bce6914e12a378e47446c88c4aa2a8f22602bad7 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Wed, 29 Jun 2022 17:56:17 +0800 Subject: [PATCH 13/31] =?UTF-8?q?=E5=8F=8C=E5=AE=9E=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BD=95=E5=85=A5-=E8=A1=A8=E5=BF=85=E5=A1=AB=E9=A1=B9?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dao/IcNeighborHoodDao.java | 2 +- .../impl/IcOrganizationCodeInfoServiceImpl.java | 10 +++++----- .../V0.0.32__alter_ic_organization_code_info.sql | 7 ++++++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java index f872338c1e..a1999a0ee6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java @@ -210,5 +210,5 @@ public interface IcNeighborHoodDao extends BaseDao { * @Author zhaoqifeng * @Date 2022/6/29 16:48 */ - List getHouseList(HouseInformationFormDTO formDTO) + List getHouseList(HouseInformationFormDTO formDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java index 3466b89a3b..a992a25e31 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java @@ -229,10 +229,10 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl().ok(result); diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.32__alter_ic_organization_code_info.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.32__alter_ic_organization_code_info.sql index aa87d01a3a..ee6e1fc7a1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.32__alter_ic_organization_code_info.sql +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.32__alter_ic_organization_code_info.sql @@ -1,4 +1,9 @@ -alter table ic_organization_code_info add COLUMN`UNIT_MAX_NUM` varchar(10) NOT NULL COMMENT '该社区下最大的单元编码序列号'; +alter table ic_organization_code_info add COLUMN `UNIT_MAX_NUM` varchar(10) NOT NULL COMMENT '该社区下最大的单元编码序列号'; alter table ic_building_unit add COLUMN `CODING` varchar(64) DEFAULT NULL COMMENT '单元编码'; alter table ic_building_unit add COLUMN `SYS_CODING` varchar(64) DEFAULT NULL COMMENT '单元系统编码'; + +ALTER TABLE ic_organization_code_info MODIFY COLUMN `NEIGHBOR_MAX_NUM` varchar(10) DEFAULT NULL COMMENT '该社区下最大的小区编码序列号'; +ALTER TABLE ic_organization_code_info MODIFY COLUMN `BUILDING_MAX_NUM` varchar(10) DEFAULT NULL COMMENT '该社区下最大的楼栋编码序列号'; +ALTER TABLE ic_organization_code_info MODIFY COLUMN `UNIT_MAX_NUM` varchar(10) DEFAULT NULL COMMENT '该社区下最大的单元编码序列号'; +ALTER TABLE ic_organization_code_info MODIFY COLUMN `HOUSE_MAX_NUM` varchar(10) DEFAULT NULL COMMENT '该社区下最大的房屋编码序列号'; From 061c51aaf80f7946b522c5bb997620b6afaa2015 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Thu, 30 Jun 2022 10:29:03 +0800 Subject: [PATCH 14/31] =?UTF-8?q?=E5=8F=8C=E5=AE=9E=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BD=95=E5=85=A5-=E6=A5=BC=E6=A0=8B=E6=96=B0=E5=A2=9E/?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B0=83=E6=95=B4=E5=9C=B0=E5=9D=80=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java | 2 +- .../main/java/com/epmet/dto/result/IcBulidingDetailDTO.java | 2 +- .../epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java | 4 ++-- .../src/main/resources/mapper/IcBuildingDao.xml | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java index e3401fa877..91b93b2569 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcBulidingAddFormDTO.java @@ -110,7 +110,7 @@ public class IcBulidingAddFormDTO implements Serializable { * 坐标位置 */ - private String location; + private String coordinatePosition; /** diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBulidingDetailDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBulidingDetailDTO.java index e1d16b92d6..910044f9cb 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBulidingDetailDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/IcBulidingDetailDTO.java @@ -81,7 +81,7 @@ public class IcBulidingDetailDTO implements Serializable { * 坐标位置 */ - private String location; + private String coordinatePosition; /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java index a992a25e31..80fce6a6a6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java @@ -134,11 +134,11 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl Date: Thu, 30 Jun 2022 10:31:30 +0800 Subject: [PATCH 15/31] =?UTF-8?q?=E3=80=90=E5=8F=8C=E5=AE=9E=E5=BD=95?= =?UTF-8?q?=E5=85=A5=E3=80=91=E7=BB=9F=E8=AE=A1=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/BuildingCountResultDTO.java | 12 +- .../dto/result/BuildingListResultDTO.java | 14 +- .../dto/result/CommunityCountResultDTO.java | 12 +- .../dto/result/GridCountListResultDTO.java | 18 +- .../epmet/dto/result/HomeListResultDTO.java | 2 +- .../epmet/dto/result/UnitCountResultDTO.java | 4 +- .../epmet/dto/result/UnitListResultDTO.java | 6 +- .../impl/HouseInformationServiceImpl.java | 198 ++++++++++++++++-- .../resources/mapper/IcNeighborHoodDao.xml | 8 +- .../epmet/dto/form/IcUserCountFormDTO.java | 24 +++ .../dto/result/IcUserCountResultDTO.java | 17 ++ .../epmet/feign/EpmetUserOpenFeignClient.java | 11 + .../EpmetUserOpenFeignClientFallback.java | 14 ++ .../controller/IcResiUserController.java | 13 ++ .../java/com/epmet/dao/IcResiUserDao.java | 15 +- .../com/epmet/service/IcResiUserService.java | 10 + .../service/impl/IcResiUserServiceImpl.java | 18 ++ .../main/resources/mapper/IcResiUserDao.xml | 64 ++++++ 18 files changed, 400 insertions(+), 60 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserCountFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserCountResultDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingCountResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingCountResultDTO.java index c37e19702d..c6a09dd2ab 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingCountResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingCountResultDTO.java @@ -14,10 +14,10 @@ public class BuildingCountResultDTO { private String buildingId; private String buildingName; private String buildingType; - private Integer unitCount; - private Integer houseCount; - private Integer personCount; - private Integer unitRealCount; - private Integer houseRealCount; - private Integer personRealCount; + private Integer unitCount = 0; + private Integer houseCount = 0; + private Integer personCount = 0; + private Integer unitRealCount = 0; + private Integer houseRealCount = 0; + private Integer personRealCount = 0; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java index e0f6c7e038..67b4642640 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingListResultDTO.java @@ -16,11 +16,11 @@ public class BuildingListResultDTO implements Serializable { private static final long serialVersionUID = -1423424057500044373L; private String id; private String name; - private Integer unitCount; - private Integer houseCount; - private Integer personCount; - private Integer differHouseCount; - private Integer differPersonCount; - private Integer houseRealCount; - private Integer personRealCount; + private Integer unitCoun = 0; + private Integer houseCount = 0; + private Integer personCount = 0; + private Integer differHouseCount = 0; + private Integer differPersonCount = 0; + private Integer houseRealCount = 0; + private Integer personRealCount = 0; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountResultDTO.java index 50961f3a9f..393d6d5b2e 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityCountResultDTO.java @@ -16,10 +16,10 @@ public class CommunityCountResultDTO implements Serializable { private static final long serialVersionUID = -1677303397440121269L; private String id; private String name; - private Integer buildingCount; - private Integer houseCount; - private Integer personCount; - private Integer buildingRealCount; - private Integer houseRealCount; - private Integer personRealCount; + private Integer buildingCount = 0; + private Integer houseCount = 0; + private Integer personCount = 0; + private Integer buildingRealCount = 0; + private Integer houseRealCount = 0; + private Integer personRealCount = 0; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridCountListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridCountListResultDTO.java index 99318e3bc5..6863f4cf49 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridCountListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridCountListResultDTO.java @@ -16,13 +16,13 @@ public class GridCountListResultDTO implements Serializable { private static final long serialVersionUID = -7938740461257344347L; private String id; private String name; - private Integer buildingCount; - private Integer houseCount; - private Integer personCount; - private Integer differBuildingCount; - private Integer differHouseCount; - private Integer differPersonCount; - private Integer buildingRealCount; - private Integer houseRealCount; - private Integer personRealCount; + private Integer buildingCount = 0; + private Integer houseCount = 0; + private Integer personCount = 0; + private Integer differBuildingCount = 0; + private Integer differHouseCount = 0; + private Integer differPersonCount = 0; + private Integer buildingRealCount = 0; + private Integer houseRealCount = 0; + private Integer personRealCount = 0; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HomeListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HomeListResultDTO.java index be5a99c195..9dbf8bfcac 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HomeListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HomeListResultDTO.java @@ -16,7 +16,7 @@ public class HomeListResultDTO implements Serializable { private static final long serialVersionUID = -1098032063828430218L; private String id; private String name; - private Double personCount; + private Integer personCount = 0; private String houseType; private String houseCode; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitCountResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitCountResultDTO.java index ac8d1d8d03..f9a634f59d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitCountResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitCountResultDTO.java @@ -13,6 +13,6 @@ import lombok.NoArgsConstructor; public class UnitCountResultDTO { private String unitId; private String unitName; - private Integer houseCount; - private Integer personCount; + private Integer houseCount = 0; + private Integer personCount = 0; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitListResultDTO.java index 3d6256a399..4deeb9dd66 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/UnitListResultDTO.java @@ -16,7 +16,7 @@ public class UnitListResultDTO implements Serializable { private static final long serialVersionUID = -8750897881106004416L; private String id; private String name; - private Double houseCount; - private Double personCount; - private Double differHouseCount; + private Integer houseCount = 0; + private Integer personCount = 0; + private Integer differHouseCount = 0; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java index 66aae8029b..ddd609fd47 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java @@ -6,12 +6,15 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.IcNeighborHoodDao; import com.epmet.dto.form.HouseInformationFormDTO; +import com.epmet.dto.form.IcUserCountFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.enums.HouseRentFlagEnums; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.HouseInformationService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -21,7 +24,11 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.Collections; +import java.util.Comparator; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * @Description @@ -36,6 +43,8 @@ public class HouseInformationServiceImpl implements HouseInformationService { private IcNeighborHoodDao icNeighborHoodDao; @Resource private CustomerAgencyDao customerAgencyDao; + @Resource + private EpmetUserOpenFeignClient userOpenFeignClient; /** * 【双实录入】社区录入数据统计 @@ -71,7 +80,15 @@ public class HouseInformationServiceImpl implements HouseInformationService { CommunityCountResultDTO result = icNeighborHoodDao.getCommunityCount(formDTO); result.setId(agency.getId()); result.setName(orgName); - //TODO 获取录入人口数 + //获取录入人口数 + IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO(); + countFormDTO.setOrgType(NumConstant.ZERO_STR); + countFormDTO.setOrgId(formDTO.getCommunityId()); + countFormDTO.setType(NumConstant.ZERO_STR); + Map map = getMapResult(countFormDTO); + if (map.containsKey(formDTO.getCommunityId())) { + result.setPersonCount(map.get(formDTO.getCommunityId())); + } return result; } @@ -89,7 +106,22 @@ public class HouseInformationServiceImpl implements HouseInformationService { PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); List list = icNeighborHoodDao.getGridList(formDTO); PageInfo pageInfo = new PageInfo<>(list); - //TODO 获取录入人口数 + if (CollectionUtils.isNotEmpty(list)) { + //获取录入人口数 + IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO(); + countFormDTO.setOrgType(NumConstant.ZERO_STR); + countFormDTO.setOrgId(formDTO.getCommunityId()); + countFormDTO.setType(NumConstant.ONE_STR); + Map map = getMapResult(countFormDTO); + + list.forEach(item -> { + if (map.containsKey(item.getId())) { + item.setPersonCount(map.get(item.getId())); + } + item.setDifferPersonCount(item.getPersonRealCount() - item.getPersonCount()); + }); + + } return new PageData<>(list, pageInfo.getTotal()); } @@ -105,7 +137,15 @@ public class HouseInformationServiceImpl implements HouseInformationService { @Override public GridStatisticsResultDTO getGridCount(HouseInformationFormDTO formDTO) { GridStatisticsResultDTO result = icNeighborHoodDao.getGridCount(formDTO); - //TODO 获取录入人口数 + //获取录入人口数 + IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO(); + countFormDTO.setOrgType(NumConstant.ONE_STR); + countFormDTO.setOrgId(formDTO.getGridId()); + countFormDTO.setType(NumConstant.ZERO_STR); + Map map = getMapResult(countFormDTO); + if (map.containsKey(formDTO.getGridId())) { + result.setPersonCount(map.get(formDTO.getGridId())); + } return result; } @@ -123,7 +163,20 @@ public class HouseInformationServiceImpl implements HouseInformationService { PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); List list = icNeighborHoodDao.getNeighborHoodList(formDTO); PageInfo pageInfo = new PageInfo<>(list); - //TODO 获取录入人口数 + if (CollectionUtils.isNotEmpty(list)) { + //获取录入人口数 + IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO(); + countFormDTO.setOrgType(NumConstant.ONE_STR); + countFormDTO.setOrgId(formDTO.getGridId()); + countFormDTO.setType(NumConstant.ONE_STR); + Map map = getMapResult(countFormDTO); + list.forEach(item -> { + if (map.containsKey(item.getId())) { + item.setPersonCount(map.get(item.getId())); + } + item.setDifferPersonCount(item.getPersonRealCount() - item.getPersonCount()); + }); + } return new PageData<>(list, pageInfo.getTotal()); } @@ -139,7 +192,15 @@ public class HouseInformationServiceImpl implements HouseInformationService { @Override public NeighborHoodCountResultDTO getNeighborHoodCount(HouseInformationFormDTO formDTO) { NeighborHoodCountResultDTO result = icNeighborHoodDao.getNeighborHoodCount(formDTO); - //TODO 获取录入人口数 + //获取录入人口数 + IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO(); + countFormDTO.setOrgType(NumConstant.TWO_STR); + countFormDTO.setOrgId(formDTO.getNeighborHoodId()); + countFormDTO.setType(NumConstant.ZERO_STR); + Map map = getMapResult(countFormDTO); + if (map.containsKey(formDTO.getNeighborHoodId())) { + result.setPersonCount(map.get(formDTO.getNeighborHoodId())); + } return result; } @@ -156,17 +217,47 @@ public class HouseInformationServiceImpl implements HouseInformationService { public PageData getBuildingList(HouseInformationFormDTO formDTO) { List list; long total = 0; - //TODO 获取录入人口数 - if (NumConstant.FIVE_STR.equals(formDTO.getSort())) { + + //获取录入人口数 + IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO(); + countFormDTO.setOrgType(NumConstant.TWO_STR); + countFormDTO.setOrgId(formDTO.getNeighborHoodId()); + countFormDTO.setType(NumConstant.ONE_STR); + Map map = getMapResult(countFormDTO); + + if (!NumConstant.FIVE_STR.equals(formDTO.getSort())) { PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); list = icNeighborHoodDao.getBuildingList(formDTO); PageInfo pageInfo = new PageInfo<>(list); total = pageInfo.getTotal(); + + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + if (map.containsKey(item.getId())) { + item.setPersonCount(map.get(item.getId())); + } + item.setDifferPersonCount(item.getPersonRealCount() - item.getPersonCount()); + }); + } } else { list = icNeighborHoodDao.getBuildingList(formDTO); - total = list.size(); + if (CollectionUtils.isNotEmpty(list)) { + total = list.size(); + list.forEach(item -> { + if (map.containsKey(item.getId())) { + item.setPersonCount(map.get(item.getId())); + } + item.setDifferPersonCount(item.getPersonRealCount() - item.getPersonCount()); + }); + + //排序 + list = list.stream().sorted(Comparator.comparing(BuildingListResultDTO::getDifferPersonCount).reversed()).collect(Collectors.toList()); + //分页 + list = list.stream().skip((long)(formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList()); + } } + return new PageData<>(list, total); } @@ -182,7 +273,15 @@ public class HouseInformationServiceImpl implements HouseInformationService { @Override public BuildingCountResultDTO getBuildingCount(HouseInformationFormDTO formDTO) { BuildingCountResultDTO result = icNeighborHoodDao.getBuildingCount(formDTO); - //TODO 获取录入人口数 + //获取录入人口数 + IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO(); + countFormDTO.setOrgType(NumConstant.THREE_STR); + countFormDTO.setOrgId(formDTO.getBuildingId()); + countFormDTO.setType(NumConstant.ZERO_STR); + Map map = getMapResult(countFormDTO); + if (map.containsKey(formDTO.getBuildingId())) { + result.setPersonCount(map.get(formDTO.getBuildingId())); + } return result; } @@ -200,7 +299,19 @@ public class HouseInformationServiceImpl implements HouseInformationService { PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); List list = icNeighborHoodDao.getUnitList(formDTO); PageInfo pageInfo = new PageInfo<>(list); - //TODO 获取录入人口数 + if (CollectionUtils.isNotEmpty(list)) { + //获取录入人口数 + IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO(); + countFormDTO.setOrgType(NumConstant.THREE_STR); + countFormDTO.setOrgId(formDTO.getBuildingId()); + countFormDTO.setType(NumConstant.ONE_STR); + Map map = getMapResult(countFormDTO); + list.forEach(item -> { + if (map.containsKey(item.getId())) { + item.setPersonCount(map.get(item.getId())); + } + }); + } return new PageData<>(list, pageInfo.getTotal()); } @@ -216,7 +327,15 @@ public class HouseInformationServiceImpl implements HouseInformationService { @Override public UnitCountResultDTO getUnitCount(HouseInformationFormDTO formDTO) { UnitCountResultDTO result = icNeighborHoodDao.getUnitCount(formDTO); - //TODO 获取录入人口数 + //获取录入人口数 + IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO(); + countFormDTO.setOrgType(NumConstant.FOUR_STR); + countFormDTO.setOrgId(formDTO.getUnitId()); + countFormDTO.setType(NumConstant.ZERO_STR); + Map map = getMapResult(countFormDTO); + if (map.containsKey(formDTO.getUnitId())) { + result.setPersonCount(map.get(formDTO.getUnitId())); + } return result; } @@ -231,15 +350,54 @@ public class HouseInformationServiceImpl implements HouseInformationService { */ @Override public PageData getHouseList(HouseInformationFormDTO formDTO) { - PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); - List list = icNeighborHoodDao.getHouseList(formDTO); - PageInfo pageInfo = new PageInfo<>(list); - //TODO 获取录入人口数 - if (CollectionUtils.isNotEmpty(list)) { - list.forEach(item -> { - item.setHouseType(HouseRentFlagEnums.getTypeValue(item.getHouseType())); - }); + List list = null; + long total = 0; + //获取录入人口数 + IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO(); + countFormDTO.setOrgType(NumConstant.FOUR_STR); + countFormDTO.setOrgId(formDTO.getUnitId()); + countFormDTO.setType(NumConstant.ONE_STR); + Map map = getMapResult(countFormDTO); + + if (!NumConstant.TWO_STR.equals(formDTO.getSort())) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + list = icNeighborHoodDao.getHouseList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + total = pageInfo.getTotal(); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + if (map.containsKey(item.getId())) { + item.setHouseType(HouseRentFlagEnums.getTypeValue(item.getHouseType())); + item.setPersonCount(map.get(item.getId())); + } + }); + } + } else { + list = icNeighborHoodDao.getHouseList(formDTO); + if (CollectionUtils.isNotEmpty(list)) { + total = list.size(); + list.forEach(item -> { + if (map.containsKey(item.getId())) { + item.setHouseType(HouseRentFlagEnums.getTypeValue(item.getHouseType())); + item.setPersonCount(map.get(item.getId())); + } + }); + //排序 + list = list.stream().sorted(Comparator.comparing(HomeListResultDTO::getPersonCount).reversed()).collect(Collectors.toList()); + //分页 + list = list.stream().skip((long)(formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList()); + } } - return new PageData<>(list, pageInfo.getTotal()); + + return new PageData<>(list, total); + } + + private Map getMapResult(IcUserCountFormDTO countFormDTO) { + Result> result = userOpenFeignClient.getIcUserCount(countFormDTO); + if (!result.success()) { + log.warn("查询录入人数失败"); + return Collections.emptyMap(); + } + return result.getData(); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml index 2ac839f1ce..fefb061e7d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml @@ -381,7 +381,9 @@ SUM(IFNULL( houseRealCount, 0 )) AS houseRealCount, SUM(IFNULL( personRealCount, 0 )) AS personRealCount, SUM(IFNULL( buildingCount, 0 )) AS buildingCount, - SUM(IFNULL( houseCount, 0 )) AS houseCount + SUM(IFNULL( houseCount, 0 )) AS houseCount, + SUM(IFNULL( buildingRealCount, 0 )) - SUM(IFNULL( buildingCount, 0 )) AS differBuildingCount, + SUM(IFNULL( houseRealCount, 0 )) - SUM(IFNULL( houseCount, 0 )) AS differHouseCount FROM customer_grid grid LEFT JOIN ( @@ -472,7 +474,9 @@ SUM( IFNULL( b.TOTAL_HOUSE_NUM, 0 ) ) AS houseRealCount, SUM( IFNULL( b.REAL_PERSON, 0 ) ) AS personRealCount, COUNT( DISTINCT b.ID ) AS buildingCount, - IFNULL(c.houseCount, 0) AS houseCount + IFNULL(c.houseCount, 0) AS houseCount, + IFNULL( a.REAL_BUILDING, 0 ) - COUNT( DISTINCT b.ID ) AS differBuildingCount, + SUM( IFNULL( b.TOTAL_HOUSE_NUM, 0 ) ) - IFNULL(c.houseCount, 0) AS differHouseCount FROM ic_neighbor_hood a LEFT JOIN ic_building b ON a.ID = b.NEIGHBOR_HOOD_ID diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserCountFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserCountFormDTO.java new file mode 100644 index 0000000000..675109ce0c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserCountFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/29 17:27 + */ +@Data +public class IcUserCountFormDTO implements Serializable { + private static final long serialVersionUID = 1303693003176367290L; + private String orgId; + /** + * 0 组织,1 网格,2 小区,3 楼栋,4 单元,5 房屋 + */ + private String orgType; + /** + * 0 本级,1 下级 + */ + private String type; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserCountResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserCountResultDTO.java new file mode 100644 index 0000000000..a1e6e6a482 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserCountResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/29 17:50 + */ +@Data +public class IcUserCountResultDTO implements Serializable { + private static final long serialVersionUID = 2875016989035736971L; + private String id; + private Integer count; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 90b0359881..196debd91f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -816,4 +816,15 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/icresiuser/getUserId/{icUserId}") Result> getUserId(@PathVariable("icUserId") String icUserId); + + /** + * 获取录入居民的数量 + * + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2022/6/30 9:35 + */ + @PostMapping("/epmetuser/icresiuser/getIcUserCount") + Result> getIcUserCount(IcUserCountFormDTO formDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 55083de3a2..be1b2903c2 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -611,4 +611,18 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserId", icUserId); } + /** + * 获取录入居民的数量 + * + * @param formDTO + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2022/6/30 9:35 + */ + @Override + public Result> getIcUserCount(IcUserCountFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getIcUserCount", formDTO); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index 8e9e6a41c7..3541d2f4ad 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -1188,4 +1188,17 @@ public class IcResiUserController implements ResultDataResolver { public Result> getUserId(@PathVariable("icUserId") String icUserId) { return new Result>().ok(icResiUserService.getUserId(icUserId)); } + + /** + * 获取录入居民的数量 + * + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2022/6/30 9:35 + */ + @PostMapping("getIcUserCount") + public Result> getIcUserCount(IcUserCountFormDTO formDTO) { + return new Result>().ok(icResiUserService.getIcUserCount(formDTO)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index f145fadd97..712537df0c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -22,10 +22,7 @@ import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.dto.IcResiUserConfirmDTO; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.IcVolunteerPolyDTO; -import com.epmet.dto.form.EpidemicPreventionFormDTO; -import com.epmet.dto.form.MoveOutMemberFormDTO; -import com.epmet.dto.form.RentTenantDataFormDTO; -import com.epmet.dto.form.ResiUserQueryValueDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.IcResiUserEntity; import org.apache.ibatis.annotations.MapKey; @@ -370,4 +367,14 @@ public interface IcResiUserDao extends BaseDao { * @return com.epmet.entity.IcResiUserEntity */ IcResiUserEntity selectResiUserEntityByIdCard(@Param("idCard") String idCard,@Param("customerId") String customerId); + + /** + * 获取录入居民的数量 + * + * @Param formDTO + * @Return {@link Map} + * @Author zhaoqifeng + * @Date 2022/6/29 17:37 + */ + List getIcUserCount(IcUserCountFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 1abd65036f..31091ff3a6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -436,4 +436,14 @@ public interface IcResiUserService extends BaseService { * @Date 2022/6/16 15:30 */ List getUserId(String icResiUserId); + + /** + * 获取录入居民的数量 + * + * @Param formDTO + * @Return {@link Map} + * @Author zhaoqifeng + * @Date 2022/6/29 17:32 + */ + Map getIcUserCount(IcUserCountFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 981abb643a..bfbc25808f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -2572,6 +2572,24 @@ public class IcResiUserServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2022/6/29 17:32 + */ + @Override + public Map getIcUserCount(IcUserCountFormDTO formDTO) { + List list = baseDao.getIcUserCount(formDTO); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.toMap(IcUserCountResultDTO::getId, IcUserCountResultDTO::getCount, (key1 , key2)-> key2))); + } + /** * 根据身份证获取居民角色(目前只有是否是志愿者) * diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 57f23f9898..6fb49d35c0 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -1133,4 +1133,68 @@ AND customer_id = #{customerId} AND DEL_FLAG = '0' + From f686c75a760e42afe00024ad101e2f76a65f8c27 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 30 Jun 2022 10:49:53 +0800 Subject: [PATCH 16/31] =?UTF-8?q?=E3=80=90=E5=8F=8C=E5=AE=9E=E5=BD=95?= =?UTF-8?q?=E5=85=A5=E3=80=91=E7=BB=9F=E8=AE=A1=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/IcResiUserServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index bfbc25808f..0fb0d6d0ae 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -2587,7 +2587,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl key2))); + return list.stream().collect(Collectors.toMap(IcUserCountResultDTO::getId, IcUserCountResultDTO::getCount, (key1 , key2)-> key2)); } /** From af198d329a4216f6bffa3faf9050e62371377571 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 30 Jun 2022 13:59:07 +0800 Subject: [PATCH 17/31] =?UTF-8?q?=E3=80=90=E5=8F=8C=E5=AE=9E=E5=BD=95?= =?UTF-8?q?=E5=85=A5=E3=80=91=E7=BB=9F=E8=AE=A1=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/GridStatisticsResultDTO.java | 12 ++++++------ .../dto/result/NeighborHoodCountResultDTO.java | 12 ++++++------ .../dto/result/NeighborHoodListResultDTO.java | 18 +++++++++--------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStatisticsResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStatisticsResultDTO.java index ea5ff3634f..d855740dca 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStatisticsResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridStatisticsResultDTO.java @@ -17,10 +17,10 @@ public class GridStatisticsResultDTO implements Serializable { private static final long serialVersionUID = -2022337690871957027L; private String gridId; private String gridName; - private Integer buildingCount; - private Integer houseCount; - private Integer personCount; - private Integer buildingRealCount; - private Integer houseRealCount; - private Integer personRealCount; + private Integer buildingCount = 0; + private Integer houseCount = 0; + private Integer personCount = 0; + private Integer buildingRealCount = 0; + private Integer houseRealCount = 0; + private Integer personRealCount = 0; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodCountResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodCountResultDTO.java index 610b7d871f..6795bbb9f3 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodCountResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodCountResultDTO.java @@ -16,10 +16,10 @@ public class NeighborHoodCountResultDTO implements Serializable { private static final long serialVersionUID = 4148009467129407023L; private String neighborHoodId; private String neighborHoodName; - private Integer buildingCount; - private Integer houseCount; - private Integer personCount; - private Integer buildingRealCount; - private Integer houseRealCount; - private Integer personRealCount; + private Integer buildingCount = 0; + private Integer houseCount = 0; + private Integer personCount = 0; + private Integer buildingRealCount = 0; + private Integer houseRealCount = 0; + private Integer personRealCount = 0; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodListResultDTO.java index ad256b2f9f..e947b2e385 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/NeighborHoodListResultDTO.java @@ -16,13 +16,13 @@ public class NeighborHoodListResultDTO implements Serializable { private static final long serialVersionUID = -5333918463141094854L; private String id; private String name; - private Integer buildingCount; - private Integer houseCount; - private Integer personCount; - private Integer differBuildingCount; - private Integer differHouseCount; - private Integer differPersonCount; - private Integer buildingRealCount; - private Integer houseRealCount; - private Integer personRealCount; + private Integer buildingCount = 0; + private Integer houseCount = 0; + private Integer personCount = 0; + private Integer differBuildingCount = 0; + private Integer differHouseCount = 0; + private Integer differPersonCount = 0; + private Integer buildingRealCount = 0; + private Integer houseRealCount = 0; + private Integer personRealCount = 0; } From 1a51a609015b103d8929b3580ed299f63e8efa87 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 30 Jun 2022 14:24:07 +0800 Subject: [PATCH 18/31] =?UTF-8?q?=E3=80=90=E5=8F=8C=E5=AE=9E=E5=BD=95?= =?UTF-8?q?=E5=85=A5=E3=80=91=E7=BB=9F=E8=AE=A1=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcNeighborHoodDao.xml | 3 ++- .../main/java/com/epmet/feign/EpmetUserOpenFeignClient.java | 2 +- .../main/java/com/epmet/controller/IcResiUserController.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml index fefb061e7d..33600cf2e6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml @@ -435,7 +435,7 @@ ( SELECT a.GRID_ID, - a.GRID_NAME, + d.GRID_NAME, IFNULL( a.REAL_BUILDING, 0 ) AS buildingRealCount, SUM( IFNULL( b.TOTAL_HOUSE_NUM, 0 ) ) AS houseRealCount, SUM( IFNULL( b.REAL_PERSON, 0 ) ) AS personRealCount, @@ -456,6 +456,7 @@ GROUP BY NEIGHBOR_HOOD_ID ) c ON a.ID = c.NEIGHBOR_HOOD_ID + INNER JOIN customer_grid d ON a.GRID_ID = d.ID WHERE a.DEL_FLAG = '0' AND a.GRID_ID = #{gridId} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 196debd91f..e270ca5178 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -826,5 +826,5 @@ public interface EpmetUserOpenFeignClient { * @Date 2022/6/30 9:35 */ @PostMapping("/epmetuser/icresiuser/getIcUserCount") - Result> getIcUserCount(IcUserCountFormDTO formDTO); + Result> getIcUserCount(@RequestBody IcUserCountFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index 3541d2f4ad..4fe8b5b0ae 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -1198,7 +1198,7 @@ public class IcResiUserController implements ResultDataResolver { * @Date 2022/6/30 9:35 */ @PostMapping("getIcUserCount") - public Result> getIcUserCount(IcUserCountFormDTO formDTO) { + public Result> getIcUserCount(@RequestBody IcUserCountFormDTO formDTO) { return new Result>().ok(icResiUserService.getIcUserCount(formDTO)); } } From ccef2a36489a3fa56a07096006723fd5d88f6852 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 30 Jun 2022 14:42:03 +0800 Subject: [PATCH 19/31] =?UTF-8?q?=E3=80=90=E5=8F=8C=E5=AE=9E=E5=BD=95?= =?UTF-8?q?=E5=85=A5=E3=80=91=E7=BB=9F=E8=AE=A1=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcResiUserDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 6fb49d35c0..98c379394d 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -1136,7 +1136,7 @@ @@ -635,7 +638,7 @@ DOOR_NAME AS "name", RENT_FLAG AS houseType, HOUSE_CODE, - 0 AS houseCount + 0 AS personCount FROM ic_house WHERE From ad7a9189c0bb2def66012ea65e196a3d62e71dfc Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 4 Jul 2022 14:30:11 +0800 Subject: [PATCH 27/31] =?UTF-8?q?=E3=80=90=E5=8F=8C=E5=AE=9E=E5=BD=95?= =?UTF-8?q?=E5=85=A5=E3=80=91=E7=BB=9F=E8=AE=A1=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcNeighborHoodDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml index cf599c8986..ba47187e06 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml @@ -607,7 +607,7 @@ LEFT JOIN ( SELECT BUILDING_UNIT_ID, COUNT( ID ) AS houseCount FROM ic_house WHERE DEL_FLAG = '0' AND BUILDING_ID = #{buildingId} - GROUP BY BUILDING_ID ) b ON a.ID = b.BUILDING_UNIT_ID + GROUP BY BUILDING_UNIT_ID ) b ON a.ID = b.BUILDING_UNIT_ID WHERE a.DEL_FLAG = '0' AND a.BUILDING_ID = #{buildingId} From 34e3f8c1a46efb8780d5da4dfe3a02cd0ff7a37c Mon Sep 17 00:00:00 2001 From: Jackwang Date: Tue, 5 Jul 2022 14:54:30 +0800 Subject: [PATCH 28/31] =?UTF-8?q?=E5=8F=8C=E5=AE=9E=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BD=95=E5=85=A5-=E6=96=B0=E5=A2=9E=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E5=88=A9=E7=94=A8=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HouseInformationController.java | 6 +- .../IcOrganizationCodeInfoService.java | 8 +-- .../service/impl/BuildingServiceImpl.java | 36 +++++++++++- .../epmet/service/impl/HouseServiceImpl.java | 33 +++++++++++ .../IcOrganizationCodeInfoServiceImpl.java | 58 ++++++++++++------- .../service/impl/NeighborHoodServiceImpl.java | 43 +++++++++++++- 6 files changed, 154 insertions(+), 30 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java index 314940ecf8..21ca6fb933 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseInformationController.java @@ -262,7 +262,7 @@ public class HouseInformationController { */ @PostMapping("getNeighborHoodCoding/{gridId}") public Result getNeighborHoodCoding(@LoginUser TokenDto tokenDTO, @PathVariable("gridId") String gridId) { - return icOrganizationCodeInfoService.getNeighborHoodCoding(tokenDTO.getCustomerId(),gridId); + return icOrganizationCodeInfoService.getNeighborHoodCoding(tokenDTO.getCustomerId(),gridId,false); } /** @@ -274,7 +274,7 @@ public class HouseInformationController { */ @PostMapping("getBuildingCoding/{neighborhoodId}") public Result getBuildingCoding(@LoginUser TokenDto tokenDTO, @PathVariable("neighborhoodId") String neighborhoodId) { - return icOrganizationCodeInfoService.getBuildingCoding(tokenDTO.getCustomerId(),neighborhoodId); + return icOrganizationCodeInfoService.getBuildingCoding(tokenDTO.getCustomerId(),neighborhoodId,false); } /** @@ -286,6 +286,6 @@ public class HouseInformationController { */ @PostMapping("getHouseCoding/{unitId}") public Result getHouseCoding(@LoginUser TokenDto tokenDTO, @PathVariable("unitId") String unitId) { - return icOrganizationCodeInfoService.getHouseCoding(tokenDTO.getCustomerId(),unitId); + return icOrganizationCodeInfoService.getHouseCoding(tokenDTO.getCustomerId(),unitId,false); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcOrganizationCodeInfoService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcOrganizationCodeInfoService.java index c0e3bb5545..58791b1b44 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcOrganizationCodeInfoService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcOrganizationCodeInfoService.java @@ -85,7 +85,7 @@ public interface IcOrganizationCodeInfoService extends BaseService */ - Result getNeighborHoodCoding(String customerId, String gridId); + Result getNeighborHoodCoding(String customerId, String gridId,Boolean updateFlag); /** * @describe: 【双实录入】获取楼栋编码 @@ -94,7 +94,7 @@ public interface IcOrganizationCodeInfoService extends BaseService */ - Result getBuildingCoding(String customerId, String neighborhoodId); + Result getBuildingCoding(String customerId, String neighborhoodId,Boolean updateFlag); /** * @describe: 【双实录入】获取单元编码 @@ -103,7 +103,7 @@ public interface IcOrganizationCodeInfoService extends BaseService */ - Result getUnitCoding(String customerId, String buildingId); + Result getUnitCoding(String customerId, String buildingId,Boolean updateFlag); /** * @describe: 【双实录入】获取房屋编码 @@ -112,5 +112,5 @@ public interface IcOrganizationCodeInfoService extends BaseService */ - Result getHouseCoding(String customerId, String unitId); + Result getHouseCoding(String customerId, String unitId,Boolean updateFlag); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java index cdcb22272a..981e1f10b4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java @@ -90,6 +90,10 @@ public class BuildingServiceImpl implements BuildingService { private ExecutorService executorService; @Autowired private IcOrganizationCodeInfoService icOrganizationCodeInfoService; + @Autowired + private IcOrganizationCodeInfoDao icOrganizationCodeInfoDao; + @Autowired + private IcOrganizationCodeInfoServiceImpl icOrganizationCodeInfoServiceImpl; @Override @@ -106,6 +110,7 @@ public class BuildingServiceImpl implements BuildingService { if(null != isHaveCoding){ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "该楼栋编码已存在,请勿重复!","该楼栋编码已存在,请勿重复!"); } + updateBuildingMaxNum(customerId,formDTO); } IcBuildingDTO icBuildingDTO = ConvertUtils.sourceToTarget(formDTO, IcBuildingDTO.class); icBuildingDTO.setCustomerId(customerId); @@ -121,7 +126,7 @@ public class BuildingServiceImpl implements BuildingService { icBuildingUnit.setBuildingId(entity.getId()); icBuildingUnit.setUnitName((i + 1) + "单元"); icBuildingUnit.setUnitNum(String.valueOf(i + 1)); - Result codeResult = icOrganizationCodeInfoService.getUnitCoding(customerId,entity.getId()); + Result codeResult = icOrganizationCodeInfoService.getUnitCoding(customerId,entity.getId(),true); if(!codeResult.success() || null == codeResult.getData()){ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "生成单元编码异常,请联系管理员","生成单元编码异常,请联系管理员"); } @@ -133,6 +138,32 @@ public class BuildingServiceImpl implements BuildingService { } + /** + * @describe: 如果编码未改动提交,则最大数+1 + * @author wangtong + * @date 2022/7/5 10:43 + * @params [formDTO] + * @return void + */ + private void updateBuildingMaxNum(String customerId,IcBulidingAddFormDTO formDTO){ + //获取楼栋id、行政编码 + OrganizationCommunityDTO communResult = icNeighborHoodDao.selectCommunityByNeiId(formDTO.getNeighborHoodId()); + //如果是自增的,则最大数+1 + IcOrganizationCodeInfoEntity communEntity = icOrganizationCodeInfoDao.selectByCommunityIdAndCustomerId(customerId, communResult.getCommunityId()); + Integer buildMaxNum = org.apache.commons.lang3.StringUtils.isBlank(communEntity.getBuildingMaxNum())?1:Integer.valueOf(communEntity.getBuildingMaxNum()) + 1; + Integer submitMaxNum = null; + try { + submitMaxNum = Integer.valueOf(formDTO.getCoding().substring(formDTO.getCoding().length()-3)); + }catch (Exception e){ + e.printStackTrace(); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "编码转换失败", "编码转换失败"); + } + if(buildMaxNum.intValue() == submitMaxNum.intValue()){ + communEntity.setBuildingMaxNum(icOrganizationCodeInfoServiceImpl.getNewMaxIndex(3, buildMaxNum)); + icOrganizationCodeInfoDao.updateBuildingByCuIdAndCoId(communEntity); + } + } + @Override public List treeList(String customerId, String staffId) { CustomerStaffInfoCacheResult agency = CustomerStaffRedis.getStaffInfo(customerId, staffId); @@ -460,6 +491,7 @@ public class BuildingServiceImpl implements BuildingService { if(null != isHaveCoding){ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "该楼栋编码已存在,请勿重复!","该楼栋编码已存在,请勿重复!"); } + updateBuildingMaxNum(customerId,formDTO); } IcBuildingDTO icBuildingDTO = ConvertUtils.sourceToTarget(formDTO, IcBuildingDTO.class); icBuildingDTO.setId(formDTO.getBuildingId()); @@ -502,7 +534,7 @@ public class BuildingServiceImpl implements BuildingService { icBuildingUnit.setCustomerId(customerId); icBuildingUnit.setUnitName(unitNum + "单元"); icBuildingUnit.setUnitNum(unitNum); - Result codeResult = icOrganizationCodeInfoService.getUnitCoding(customerId,icBuilding.getId()); + Result codeResult = icOrganizationCodeInfoService.getUnitCoding(customerId,icBuilding.getId(),true); if(!codeResult.success() || null == codeResult.getData()){ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "生成单元编码异常,请联系管理员","生成单元编码异常,请联系管理员"); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index 127eef5f0e..78dd6ce923 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -127,6 +127,12 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { private OssFeignClient ossFeignClient; @Autowired private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; + @Autowired + private IcOrganizationCodeInfoDao icOrganizationCodeInfoDao; + @Autowired + private IcOrganizationCodeInfoServiceImpl icOrganizationCodeInfoServiceImpl; + @Autowired + private IcBuildingUnitDao icBuildingUnitDao; @Override @@ -143,6 +149,7 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { if(null != isHaveCoding){ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "该房屋编码已存在,请勿重复!","该房屋编码已存在,请勿重复!"); } + updateHouseMaxNum(customerId,formDTO); } IcHouseEntity icHouseDTO = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class); icHouseDTO.setCustomerId(customerId); @@ -164,6 +171,32 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { icHouseDao.updateById(entity); } + /** + * @describe: 如果编码未改动提交,则最大数+1 + * @author wangtong + * @date 2022/7/5 10:53 + * @params [customerId, formDTO] + * @return void + */ + private void updateHouseMaxNum(String customerId, IcHouseAddFormDTO formDTO){ + //获取社区id、单元编码 + OrganizationCommunityDTO communResult = icBuildingUnitDao.selectCommunityByUnitId(formDTO.getBuildingUnitId()); + //如果是自增的,则最大数+1 + IcOrganizationCodeInfoEntity communEntity = icOrganizationCodeInfoDao.selectByCommunityIdAndCustomerId(customerId, communResult.getCommunityId()); + Integer houseMaxNum = org.apache.commons.lang3.StringUtils.isBlank(communEntity.getHouseMaxNum())?1:Integer.valueOf(communEntity.getHouseMaxNum()) + 1; + Integer submitMaxNum = null; + try { + submitMaxNum = Integer.valueOf(formDTO.getCoding().substring(formDTO.getCoding().length()-4)); + }catch (Exception e){ + e.printStackTrace(); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "编码转换失败", "编码转换失败"); + } + if(houseMaxNum.intValue() == submitMaxNum.intValue()){ + communEntity.setHouseMaxNum(icOrganizationCodeInfoServiceImpl.getNewMaxIndex(4, houseMaxNum)); + icOrganizationCodeInfoDao.updateHouseByCuIdAndCoId(communEntity); + } + } + private String getHouseName(IcHouseAddFormDTO formDTO) { //设置房间名 楼栋-单元号-门牌号 IcBuildingDTO icBuilding = icBuildingService.get(formDTO.getBuildingId()); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java index 992cf837c4..803a73cde8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcOrganizationCodeInfoServiceImpl.java @@ -108,7 +108,7 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl getNeighborHoodCoding(String customerId, String gridId) { + public Result getNeighborHoodCoding(String customerId, String gridId,Boolean updateFlag) { if (StringUtils.isBlank(customerId) || StringUtils.isBlank(gridId)) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空"); } @@ -137,7 +137,9 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl getBuildingCoding(String customerId, String neighborhoodId) { + public Result getBuildingCoding(String customerId, String neighborhoodId,Boolean updateFlag) { if (StringUtils.isBlank(customerId) || StringUtils.isBlank(neighborhoodId)) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空"); } @@ -175,7 +181,7 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl().ok(result); } @Override @Transactional(rollbackFor = Exception.class) - public Result getUnitCoding(String customerId, String buildingId) { + public Result getUnitCoding(String customerId, String buildingId,Boolean updateFlag) { if (StringUtils.isBlank(customerId) || StringUtils.isBlank(buildingId)) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空"); } @@ -226,7 +239,7 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl().ok(result); @@ -263,7 +278,7 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl getHouseCoding(String customerId, String unitId) { + public Result getHouseCoding(String customerId, String unitId,Boolean updateFlag) { if (StringUtils.isBlank(customerId) || StringUtils.isBlank(unitId)) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空"); } @@ -277,7 +292,7 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl().ok(result); } @@ -317,7 +335,7 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl Date: Tue, 5 Jul 2022 17:51:17 +0800 Subject: [PATCH 29/31] =?UTF-8?q?=E5=8F=8C=E5=AE=9E=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BD=95=E5=85=A5-=E7=BC=96=E7=A0=81=E8=BE=85=E5=8A=A9?= =?UTF-8?q?=E8=A1=A8=E7=BB=93=E6=9E=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/enums/OrganizationTypeEnums.java | 32 ++++ .../epmet/dao/IcOrganizationCodeInfoDao.java | 59 +++---- .../entity/IcOrganizationCodeInfoEntity.java | 28 ++-- .../service/impl/BuildingServiceImpl.java | 11 +- .../epmet/service/impl/HouseServiceImpl.java | 15 +- .../IcOrganizationCodeInfoServiceImpl.java | 146 ++++++++++-------- .../service/impl/NeighborHoodServiceImpl.java | 9 +- ....0.34__alter_ic_organization_code_info.sql | 8 + .../mapper/IcOrganizationCodeInfoDao.xml | 55 +++---- 9 files changed, 210 insertions(+), 153 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/OrganizationTypeEnums.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.34__alter_ic_organization_code_info.sql diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/OrganizationTypeEnums.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/OrganizationTypeEnums.java new file mode 100644 index 0000000000..5a35712ac7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/enums/OrganizationTypeEnums.java @@ -0,0 +1,32 @@ +package com.epmet.enums; + +public enum OrganizationTypeEnums { + COMM("community","社区"), + NEI("neighbor","小区"), + BUI("building","楼栋"), + UNIT("unit","单元"); + + private String code; + private String name; + + OrganizationTypeEnums(String code, String name) { + this.code = code; + this.name = name; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcOrganizationCodeInfoDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcOrganizationCodeInfoDao.java index f2429582e2..d217c69a5a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcOrganizationCodeInfoDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcOrganizationCodeInfoDao.java @@ -21,8 +21,9 @@ public interface IcOrganizationCodeInfoDao extends BaseDao getNeighborHoodCoding(String customerId, String gridId,Boolean updateFlag) { + public Result getNeighborHoodCoding(String customerId, String gridId, Boolean updateFlag) { if (StringUtils.isBlank(customerId) || StringUtils.isBlank(gridId)) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空"); } @@ -119,16 +120,16 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl getBuildingCoding(String customerId, String neighborhoodId,Boolean updateFlag) { + public Result getBuildingCoding(String customerId, String neighborhoodId, Boolean updateFlag) { if (StringUtils.isBlank(customerId) || StringUtils.isBlank(neighborhoodId)) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空"); } @@ -181,7 +183,7 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl().ok(result); } @Override @Transactional(rollbackFor = Exception.class) - public Result getUnitCoding(String customerId, String buildingId,Boolean updateFlag) { + public Result getUnitCoding(String customerId, String buildingId, Boolean updateFlag) { if (StringUtils.isBlank(customerId) || StringUtils.isBlank(buildingId)) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空"); } @@ -238,8 +246,8 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl().ok(result); } @Override @Transactional(rollbackFor = Exception.class) - public Result getHouseCoding(String customerId, String unitId,Boolean updateFlag) { + public Result getHouseCoding(String customerId, String unitId, Boolean updateFlag) { if (StringUtils.isBlank(customerId) || StringUtils.isBlank(unitId)) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所有字段不可为空", "所有字段不可为空"); } @@ -291,8 +307,8 @@ public class IcOrganizationCodeInfoServiceImpl extends BaseServiceImpl().ok(result); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java index 57cc4646d7..65eb7c90e2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java @@ -28,6 +28,7 @@ import com.epmet.entity.IcHouseEntity; import com.epmet.entity.IcNeighborHoodEntity; import com.epmet.entity.IcNeighborHoodPropertyEntity; import com.epmet.entity.IcOrganizationCodeInfoEntity; +import com.epmet.enums.OrganizationTypeEnums; import com.epmet.excel.IcNeighborHoodExcel; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; @@ -128,8 +129,8 @@ public class NeighborHoodServiceImpl extends BaseServiceImpl - - - - + + + - select * from ic_organization_code_info where CUSTOMER_ID=#{customerId} - and COMMUNITY_ID = #{communityId} + and SYS_ID = #{sysId} + AND SYS_TYPE = #{sysType} - + update ic_organization_code_info - set NEIGHBOR_MAX_NUM=#{neighborMaxNum} + set MAX_NUM=#{maxNum} where CUSTOMER_ID = #{customerId} - and COMMUNITY_ID = #{communityId} - - - update ic_organization_code_info - set BUILDING_MAX_NUM=#{buildingMaxNum} - where CUSTOMER_ID = #{customerId} - and COMMUNITY_ID = #{communityId} - - - update ic_organization_code_info - set UNIT_MAX_NUM=#{unitMaxNum} - where CUSTOMER_ID = #{customerId} - and COMMUNITY_ID = #{communityId} - - - update ic_organization_code_info - set HOUSE_MAX_NUM=#{houseMaxNum} - where CUSTOMER_ID = #{customerId} - and COMMUNITY_ID = #{communityId} + and SYS_ID = #{sysId} + AND SYS_TYPE = #{sysType} + + + + + + + + + + + + + + + + + + From cbd741c165d348b382674173cbb14bc9e1c1a2ba Mon Sep 17 00:00:00 2001 From: Jackwang Date: Tue, 5 Jul 2022 17:52:30 +0800 Subject: [PATCH 30/31] =?UTF-8?q?=E5=8F=8C=E5=AE=9E=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BD=95=E5=85=A5-=E8=84=9A=E6=9C=AC=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...code_info.sql => V0.0.35__alter_ic_organization_code_info.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/{V0.0.34__alter_ic_organization_code_info.sql => V0.0.35__alter_ic_organization_code_info.sql} (100%) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.34__alter_ic_organization_code_info.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.35__alter_ic_organization_code_info.sql similarity index 100% rename from epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.34__alter_ic_organization_code_info.sql rename to epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.35__alter_ic_organization_code_info.sql From 529cdaa328aabfd956ff39b55e8e5cc0f229eda9 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Wed, 6 Jul 2022 10:49:12 +0800 Subject: [PATCH 31/31] =?UTF-8?q?=E9=80=9A=E8=BF=87=E6=88=BF=E5=B1=8B?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E8=8E=B7=E5=8F=96=E4=BF=A1=E6=81=AF-?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/HouseServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index 7d3f52f944..f0b1a76711 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -1084,6 +1084,10 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { public Result getHomeInfoByHouseCode(HouseInfoFormDTO dto) { HouseInfoResultDTO house = icHouseDao.selectHomeInfoByHouseCode(dto.getHouseCode()); + if(null == house){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"未获取到房屋信息,请核对房屋编码","未获取到房屋信息,请核对房屋编码"); + } + HouseInfoCache cache = CustomerIcHouseRedis.getHouseInfo(house.getCustomerId(), house.getHouseId()); BeanUtils.copyProperties(cache,house);