Browse Source

查询社区list

dev
zxc 3 years ago
parent
commit
f06c7b607f
  1. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListResultDTO.java
  2. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
  3. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  4. 25
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
  5. 16
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  6. 12
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

20
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListResultDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/3/21 15:11
* @DESC
*/
@Data
public class CommunityListResultDTO implements Serializable {
private static final long serialVersionUID = 4336149113821131764L;
private String orgId;
private String orgName;
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java

@ -442,6 +442,14 @@ public class AgencyController {
}
}
/**
* Desc: 查询工作人员所属组织下的所有社区
* @param tokenDto
* @author zxc
* @date 2022/3/21 15:13
*/
@PostMapping("community-list")
public Result<List<CommunityListResultDTO>> getCommunityList(@LoginUser TokenDto tokenDto){
return new Result<List<CommunityListResultDTO>>().ok(agencyService.getCommunityList(tokenDto));
}
}

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -306,5 +306,15 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
OrgMobileResultDTO getAgencyMobile(@Param("gridId") String gridId);
int updateSubAgencyAreaCodeById(@Param("customerId")String customerId, @Param("agencyId")String agencyId, @Param("operateUserId") String operateUserId);
/**
* Desc: 查询组织下的社区
* @param customerId
* @param agencyId
* @author zxc
* @date 2022/3/21 15:23
*/
List<CommunityListResultDTO> getCommunityList(@Param("customerId")String customerId, @Param("agencyId")String agencyId);
}

25
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java

@ -1,20 +1,3 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.tools.security.dto.TokenDto;
@ -156,4 +139,12 @@ public interface AgencyService {
*/
List<SonOrgResultDTO> getSonAgencyId(String orgId,String type);
/**
* Desc: 查询工作人员所属组织下的所有社区
* @param tokenDto
* @author zxc
* @date 2022/3/21 15:13
*/
List<CommunityListResultDTO> getCommunityList(TokenDto tokenDto);
}

16
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -798,6 +798,22 @@ public class AgencyServiceImpl implements AgencyService {
return new ArrayList<>();
}
/**
* Desc: 查询工作人员所属组织下的所有社区
* @param tokenDto
* @author zxc
* @date 2022/3/21 15:13
*/
@Override
public List<CommunityListResultDTO> getCommunityList(TokenDto tokenDto) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo){
throw new EpmetException("未查询到工作人员信息"+staffInfo.getStaffId());
}
String agencyId = staffInfo.getAgencyId();
return customerAgencyDao.getCommunityList(tokenDto.getCustomerId(), agencyId);
}
private CustomerAgencyEntity constructInsertEntity(AddAgencyV2FormDTO formDTO, CustomerAgencyDTO parent) {
CustomerAgencyEntity insertEntity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class);
insertEntity.setOrganizationName(formDTO.getAgencyName());

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

@ -733,6 +733,18 @@
AND cg.id = #{gridId}
</select>
<!-- 查询组织下的社区 -->
<select id="getCommunityList" resultType="com.epmet.dto.result.CommunityListResultDTO">
SELECT
ID AS orgId,
ORGANIZATION_NAME AS orgName
FROM customer_agency
WHERE DEL_FLAG = '0'
AND `LEVEL` = 'community'
AND CUSTOMER_ID = #{customerId}
AND CONCAT(PIDS,':',ID) LIKE CONCAT('%',#{agencyId},'%')
</select>
<update id="updateSubAgencyAreaCodeById" parameterType="map">
UPDATE customer_agency
SET AREA_CODE = '',

Loading…
Cancel
Save