Browse Source

【新增功能】查询所有社区

national_dev
Bill 2 years ago
parent
commit
281abc0003
  1. 11
      code/smart-community/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CommunityFormDTO.java
  2. 14
      code/smart-community/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListByAgencyNameResultDTO.java
  3. 13
      code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
  4. 2
      code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  5. 9
      code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
  6. 11
      code/smart-community/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  7. 12
      code/smart-community/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

11
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;
}

14
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;
}

13
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<List<CommunityListResultDTO>>().ok(agencyService.communityListByCustomerId(tokenDto));
}
/**
* Desc: 查询所有社区
*
* @author Bill
* @date 2023/09/26 14:41
*/
@PostMapping("communityList")
public Result<List<CommunityListByAgencyNameResultDTO>> communityList(@RequestBody CommunityFormDTO formDTO) {
return new Result<List<CommunityListByAgencyNameResultDTO>>().ok(agencyService.communityList(formDTO));
}
/**
* Desc: 查询客户下的所有街道社区
*
@ -576,7 +588,6 @@ public class AgencyController {
* 通讯录树状结构
*
* @param name
* @param tokenDto
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.AgencyAddressBookTreeResultDTO>>
* @author LZN
* @date 2022/5/16 10:42

2
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<CustomerAgencyEntity> {
List<CommunityListResultDTO> communityListByCustomerId(@Param("customerId") String customerId);
List<CommunityListByAgencyNameResultDTO> listCommunity(@Param("agencyName") String agencyName);
List<SubOrgResDTO> selectSubOrg(String agencyId);
/**

9
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<CommunityListResultDTO> communityListByCustomerId(TokenDto tokenDto);
/**
* Desc: 查询所有社区
*
* @author Bill
* @date 2023/9/23
*/
List<CommunityListByAgencyNameResultDTO> communityList(CommunityFormDTO formDTO);
/**
* Desc: 查询客户下的所有街道社区

11
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<CommunityListByAgencyNameResultDTO> communityList(CommunityFormDTO dto) {
// if (null == tokenDto.getCustomerId()) {
// throw new EpmetException("未查询到客户信息");
// }
PageHelper.startPage(dto.getPageNo(), dto.getPageSize());
return customerAgencyDao.listCommunity(dto.getAgencyName());
}
@Override
public List<OrgListTreeResultDTO> getOrgTreeListByCustomerId(TokenDto tokenDto) {
if (null == tokenDto.getCustomerId()) {

12
code/smart-community/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -806,6 +806,18 @@
AND CUSTOMER_ID = #{customerId}
</select>
<select id="listCommunity" resultType="com.epmet.dto.result.CommunityListByAgencyNameResultDTO">
SELECT
ID AS agencyId,
ORGANIZATION_NAME AS agencyName
FROM customer_agency
WHERE DEL_FLAG = '0'
AND `LEVEL` = 'community'
<if test="agencyName != null and agencyName != ''">
AND ORGANIZATION_NAME LIKE '%${agencyName}%'
</if>
</select>
<select id="getOrgTreeListByCustomerId" resultType="com.epmet.dto.result.OrgListTreeResultDTO">
select
ID,

Loading…
Cancel
Save