From f4c91eaedd8ad29f419b39334b5604b9bb2ddece Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 18 Mar 2022 18:25:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=A4=BE=E5=8C=BA=E4=B8=8B?= =?UTF-8?q?=E5=B0=8F=E5=8C=BA=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap.yml | 1 + .../epmet/dto/form/IcNeighborHoodFormDTO.java | 6 ++--- .../controller/IcNeighborHoodController.java | 7 ++++++ .../epmet/service/IcNeighborHoodService.java | 11 +++++++-- .../impl/IcNeighborHoodServiceImpl.java | 24 +++++++++++++++++++ 5 files changed, 44 insertions(+), 5 deletions(-) diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index a5a7127cdd..a17a8f9e26 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -500,6 +500,7 @@ epmet: - /epmet/point/mqCallback/** - /tduck-api/** #查询楼栋,单元,房屋 + - /gov/org/icneighborhood/open/list - /gov/org/icbuilding/buildingoption - /gov/org/icbuildingunit/unitoption - /gov/org/ichouse/houseoption diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java index fbeefeadf5..32eabb2ea6 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcNeighborHoodFormDTO.java @@ -17,17 +17,17 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; -import java.io.Serializable; @Data -public class IcNeighborHoodFormDTO implements Serializable { +public class IcNeighborHoodFormDTO extends PageFormDTO { private static final long serialVersionUID = 1L; @@ -102,4 +102,4 @@ public class IcNeighborHoodFormDTO implements Serializable { -} \ No newline at end of file +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java index 663e48ba6f..24d9d746f0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java @@ -35,6 +35,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.dto.form.IcNeighborHoodFormDTO; import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; @@ -77,6 +78,12 @@ public class IcNeighborHoodController { return new Result>().ok(page); } + @PostMapping("open/list") + public Result> openList(@RequestBody IcNeighborHoodFormDTO params){ + PageData page = icNeighborHoodService.openPage(params); + return new Result>().ok(page); + } + @GetMapping("{id}") public Result get(@PathVariable("id") String id){ IcNeighborHoodDTO data = icNeighborHoodService.get(id); 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 1f32607a65..3dcfaba0da 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 @@ -23,12 +23,12 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcNeighborHoodDTO; import com.epmet.dto.ImportGeneralDTO; +import com.epmet.dto.form.IcNeighborHoodFormDTO; import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.entity.IcNeighborHoodEntity; import com.epmet.entity.IcNeighborHoodPropertyEntity; import com.epmet.entity.IcPropertyManagementEntity; -import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.io.InputStream; @@ -148,4 +148,11 @@ public interface IcNeighborHoodService extends BaseService void neighborHoodPropertyInsert(List entities); String orgGeneralImport(Collection errorRows, Class tClass) throws IOException; -} \ No newline at end of file + + /** + * desc:开发获取小区列表 分页或不分页 + * @param params + * @return + */ + PageData openPage(IcNeighborHoodFormDTO params); +} 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 f2b50748eb..331552e4a3 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 @@ -48,6 +48,7 @@ import com.epmet.dao.IcBuildingDao; import com.epmet.dao.IcNeighborHoodDao; import com.epmet.dao.IcPropertyManagementDao; import com.epmet.dto.*; +import com.epmet.dto.form.IcNeighborHoodFormDTO; import com.epmet.dto.form.ImportInfoFormDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; @@ -61,6 +62,8 @@ import com.epmet.model.ImportNeighborHoodInfoListener; import com.epmet.model.NeighborHoodInfoModel; import com.epmet.redis.IcHouseRedis; import com.epmet.service.*; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.ListUtils; @@ -680,4 +683,25 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl openPage(IcNeighborHoodFormDTO params) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcNeighborHoodEntity::getAgencyId,params.getAgencyId()); + PageData result = null; + List list = null; + if (params.isPage()){ + Page objects = PageHelper.startPage(params.getPageNo(), params.getPageSize()).doSelectPage(() -> { + baseDao.selectList(wrapper); + }); + list = ConvertUtils.sourceToTarget(objects.getResult(),IcNeighborHoodDTO.class); + result = new PageData<>(list,objects.getTotal()); + return result; + } + + List listEntity = baseDao.selectList(wrapper); + list = ConvertUtils.sourceToTarget(listEntity,IcNeighborHoodDTO.class); + result = new PageData<>(list,list.size()); + return result; + } + }