diff --git a/code/smart-community/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CommunityFormDTO.java b/code/smart-community/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CommunityFormDTO.java new file mode 100644 index 00000000..e6b6c418 --- /dev/null +++ b/code/smart-community/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CommunityFormDTO.java @@ -0,0 +1,11 @@ +package com.epmet.dto; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +@Data +public class CommunityFormDTO extends PageFormDTO { + private static final long serialVersionUID = -4126418307909816127L; + + private String agencyName; +} diff --git a/code/smart-community/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListByAgencyNameResultDTO.java b/code/smart-community/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListByAgencyNameResultDTO.java new file mode 100644 index 00000000..4497ee48 --- /dev/null +++ b/code/smart-community/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListByAgencyNameResultDTO.java @@ -0,0 +1,14 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CommunityListByAgencyNameResultDTO implements Serializable { + private static final long serialVersionUID = 4336149113821131764L; + + private String agencyId; + + private String agencyName; +} diff --git a/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index 5624c391..d14db1cf 100644 --- a/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -34,6 +34,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.CustomerAgencyConstant; import com.epmet.constant.OrgInfoConstant; +import com.epmet.dto.CommunityFormDTO; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -560,6 +561,17 @@ public class AgencyController { return new Result>().ok(agencyService.communityListByCustomerId(tokenDto)); } + /** + * Desc: 查询所有社区 + * + * @author Bill + * @date 2023/09/26 14:41 + */ + @PostMapping("communityList") + public Result> communityList(@RequestBody CommunityFormDTO formDTO) { + return new Result>().ok(agencyService.communityList(formDTO)); + } + /** * Desc: 查询客户下的所有街道社区 * @@ -576,7 +588,6 @@ public class AgencyController { * 通讯录树状结构 * * @param name - * @param tokenDto * @return com.epmet.commons.tools.utils.Result> * @author LZN * @date 2022/5/16 10:42 diff --git a/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index b17ddb6d..9b48db0a 100644 --- a/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -330,6 +330,8 @@ public interface CustomerAgencyDao extends BaseDao { List communityListByCustomerId(@Param("customerId") String customerId); + List listCommunity(@Param("agencyName") String agencyName); + List selectSubOrg(String agencyId); /** diff --git a/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java b/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java index 5d2a97ba..9d4e460a 100644 --- a/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java +++ b/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java @@ -2,6 +2,7 @@ package com.epmet.service; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CommunityFormDTO; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -158,6 +159,14 @@ public interface AgencyService { * @date 2022/6/23 09:13 */ List communityListByCustomerId(TokenDto tokenDto); + /** + * Desc: 查询所有社区 + * + * @author Bill + * @date 2023/9/23 + */ + + List communityList(CommunityFormDTO formDTO); /** * Desc: 查询客户下的所有街道社区 diff --git a/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index b39c2e9d..25ae193c 100644 --- a/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -42,6 +42,7 @@ import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.CustomerDepartmentDao; import com.epmet.dao.CustomerGridDao; import com.epmet.dao.IcBuildingDao; +import com.epmet.dto.CommunityFormDTO; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerDTO; import com.epmet.dto.GovStaffRoleDTO; @@ -59,6 +60,7 @@ import com.epmet.send.SendMqMsgUtil; import com.epmet.service.AgencyService; import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerOrgParameterService; +import com.github.pagehelper.PageHelper; import com.google.common.base.Joiner; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -904,6 +906,15 @@ public class AgencyServiceImpl implements AgencyService { return customerAgencyDao.communityListByCustomerId(tokenDto.getCustomerId()); } + @Override + public List communityList(CommunityFormDTO dto) { +// if (null == tokenDto.getCustomerId()) { +// throw new EpmetException("未查询到客户信息"); +// } + PageHelper.startPage(dto.getPageNo(), dto.getPageSize()); + return customerAgencyDao.listCommunity(dto.getAgencyName()); + } + @Override public List getOrgTreeListByCustomerId(TokenDto tokenDto) { if (null == tokenDto.getCustomerId()) { diff --git a/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 80058148..2d14c9ee 100644 --- a/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/code/smart-community/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -806,6 +806,18 @@ AND CUSTOMER_ID = #{customerId} + +