From 1d6f0a78549c9c02f05cdfd3e63bbeb19df314a5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 6 May 2023 15:25:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=A5=BC=E6=A0=8B=E5=8D=95=E5=85=83?= =?UTF-8?q?=E9=95=BFfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/yt/CommunityBuildingManagerResultDTO.java | 3 --- .../service/impl/CommunityBuildingManagerServiceImpl.java | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityBuildingManagerResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityBuildingManagerResultDTO.java index 1d2df38f08..ffb2fc69c8 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityBuildingManagerResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/yt/CommunityBuildingManagerResultDTO.java @@ -78,9 +78,6 @@ public class CommunityBuildingManagerResultDTO implements Serializable { * 所属小区id */ private String viliageId; - /** - * 所属小区id - */ private String viliageName; /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CommunityBuildingManagerServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CommunityBuildingManagerServiceImpl.java index 4693ce14b3..0d7593f50c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CommunityBuildingManagerServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CommunityBuildingManagerServiceImpl.java @@ -65,7 +65,7 @@ public class CommunityBuildingManagerServiceImpl extends BaseServiceImpl pageInfo = new PageInfo<>(resList); - return new PageData<>(resList, pageInfo.getTotal()); + return new PageData<>(resList, pageInfo.getTotal(),formDTO.getPageSize()); } /** From 6453e1c29626c844a9a89ee3e0ad4bfefafa47ef Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 6 May 2023 15:43:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8C=BA=E5=8E=BF=E3=80=81=E8=A1=97?= =?UTF-8?q?=E9=81=93=E3=80=81=E7=A4=BE=E5=8C=BA=E4=B8=8B=E6=8B=89=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CustomerAgencyController.java | 54 +++++++++++++++++++ .../impl/CustomerAgencyServiceImpl.java | 20 +++---- 2 files changed, 65 insertions(+), 9 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 3d26395c0e..fad4233d80 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -19,6 +19,9 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.enums.OrgLevelEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; @@ -41,6 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -564,4 +568,54 @@ public class CustomerAgencyController { return new Result>().ok(customerAgencyService.getCommunityList(dto)); } + /** + * 返回区县列表 + * @param tokenDto + * @return + */ + @PostMapping("districtList") + public Result> districtList(@LoginUser TokenDto tokenDto){ + Map params=new HashMap<>(); + params.put("CUSTOMER_ID",tokenDto.getCustomerId()); + params.put("LEVEL",OrgLevelEnum.DISTRICT.getCode()); + params.put("PID",null); + return new Result>().ok(customerAgencyService.list(params)); + } + + /** + * 返回街道列表,必传区县 + * @param tokenDto + * @param districtId + * @return + */ + @PostMapping("streetList/{districtId}") + public Result> streetList(@LoginUser TokenDto tokenDto,@PathVariable("districtId")String districtId){ + if(StringUtils.isBlank(districtId)){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"districtId为空","请先选择区县"); + } + Map params=new HashMap<>(); + params.put("CUSTOMER_ID",tokenDto.getCustomerId()); + params.put("LEVEL",OrgLevelEnum.STREET.getCode()); + params.put("PID",districtId); + return new Result>().ok(customerAgencyService.list(params)); + } + + /** + * 返回社区列表,街道必传 + * @param tokenDto + * @param streetId + * @return + */ + @PostMapping("communityList/{streetId}") + public Result> communityList(@LoginUser TokenDto tokenDto,@PathVariable("streetId")String streetId){ + if(StringUtils.isBlank(streetId)){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"streetId为空","请先选择街道"); + } + Map params=new HashMap<>(); + params.put("CUSTOMER_ID",tokenDto.getCustomerId()); + params.put("LEVEL",OrgLevelEnum.COMMUNITY.getCode()); + params.put("PID",streetId); + return new Result>().ok(customerAgencyService.list(params)); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 4585f7481d..87f0555690 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -18,7 +18,6 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -45,7 +44,6 @@ import com.epmet.constant.CustomerGridConstant; import com.epmet.dao.*; import com.epmet.dto.*; import com.epmet.dto.form.*; -import com.epmet.dto.region.LogOperationResultDTO; import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerDepartmentEntity; @@ -136,12 +134,16 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl getWrapper(Map params) { - String id = (String) params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - + private LambdaQueryWrapper getWrapper(Map map) { + String id = map.containsKey(FieldConstant.ID_HUMP) ? (String) map.get(FieldConstant.ID_HUMP) : null; + String customerId = map.containsKey("CUSTOMER_ID") ? (String) map.get("CUSTOMER_ID") : null; + String level = map.containsKey("LEVEL") ? (String) map.get("LEVEL") : null; + String pid = map.containsKey("PID") ? (String) map.get("PID") : null; + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), CustomerAgencyEntity::getId, id) + .eq(StringUtils.isNotBlank(customerId), CustomerAgencyEntity::getCustomerId, customerId) + .eq(StringUtils.isNotBlank(level), CustomerAgencyEntity::getLevel, level) + .eq(StringUtils.isNotBlank(pid), CustomerAgencyEntity::getPid, pid); return wrapper; } @@ -1244,7 +1246,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl agencyList, List gridList) {