Browse Source

Merge branch 'feature/someupdate_zhy'

master
zhangyuan 3 years ago
parent
commit
a55509a500
  1. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultDTO.java
  2. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java
  3. 15
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/BuildingResultDTO.java

@ -28,4 +28,10 @@ public class BuildingResultDTO implements Serializable {
private String label;
private String allParentName;
private String agencyName;
private String customerId;
}

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcNeighborHoodServiceImpl.java

@ -191,7 +191,7 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
log.info("agencyId与gridId都为空时,默认查询当前工作人员所属组织下的小区");
CustomerStaffInfoCacheResult result= CustomerStaffRedis.getStaffInfo(customerId,staffId);
if (null == result || StringUtils.isBlank(result.getAgencyId())) {
log.error(String.format("staffId:%s,工作人员缓存信息查询异常"));
log.error(String.format("staffId:%s,工作人员缓存信息查询异常", staffId));
return Collections.emptyList();
}
agencyId=result.getAgencyId();
@ -214,15 +214,15 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao
public List<BuildingResultDTO> getNeighborhoodList(TokenDto tokenDto, IcNeighborHoodDTO dto) {
dto.setCustomerId(tokenDto.getCustomerId());
if (StringUtils.isBlank(dto.getAgencyId()) && StringUtils.isEmpty(dto.getGridId())) {
log.info("agencyId与gridId都为空时,默认查询当前工作人员所属组织下的小区");
CustomerStaffInfoCacheResult result= CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == result || StringUtils.isBlank(result.getAgencyId())) {
log.error(String.format("staffId:%s,工作人员缓存信息查询异常"));
return Collections.emptyList();
}
dto.setAgencyId(result.getAgencyId());
}
// if (StringUtils.isBlank(dto.getAgencyId()) && StringUtils.isEmpty(dto.getGridId())) {
// log.info("agencyId与gridId都为空时,默认查询当前工作人员所属组织下的小区");
// CustomerStaffInfoCacheResult result= CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
// if (null == result || StringUtils.isBlank(result.getAgencyId())) {
// log.error(String.format("staffId:%s,工作人员缓存信息查询异常", tokenDto.getUserId()));
// return Collections.emptyList();
// }
// dto.setAgencyId(result.getAgencyId());
// }
return icBuildingDao.listBuildingInfo(dto);
}

15
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml

@ -458,15 +458,20 @@
n.id AS neighborhoodId,
n.NEIGHBOR_HOOD_NAME AS neighborhoodName,
n.GRID_ID,
g.GRID_NAME
g.GRID_NAME,
a.ALL_PARENT_NAME,
a.ORGANIZATION_NAME AS AGENCY_NAME,
n.CUSTOMER_ID
FROM
ic_building b
LEFT JOIN ic_neighbor_hood n ON b.NEIGHBOR_HOOD_ID = n.id
LEFT JOIN customer_grid g ON n.GRID_ID = g.id
LEFT JOIN customer_agency a ON a.id = g.pid
WHERE
n.DEL_FLAG = '0'
AND b.DEL_FLAG = '0'
AND g.DEL_FLAG = '0'
AND a.DEL_FLAG = '0'
AND n.CUSTOMER_ID = #{customerId}
<if test="gridId != null and gridId != ''">
AND n.GRID_ID = #{gridId}
@ -474,9 +479,11 @@
<if test="buildingName != null and buildingName != ''">
AND (n.NEIGHBOR_HOOD_NAME LIKE CONCAT('%', #{buildingName}, '%') OR b.BUILDING_NAME LIKE CONCAT('%', #{buildingName}, '%'))
</if>
AND (
n.AGENCY_ID = #{agencyId}
OR n.AGENCY_PIDS LIKE CONCAT('%', #{agencyId}, '%'))
<if test="agencyId != null and agencyId != ''">
AND (
n.AGENCY_ID = #{agencyId}
OR n.AGENCY_PIDS LIKE CONCAT('%', #{agencyId}, '%'))
</if>
</select>
<select id="getBuildingInfoByName" resultType="com.epmet.entity.IcBuildingEntity"

Loading…
Cancel
Save