wangxianzhang 3 years ago
parent
commit
e3e9320cc3
  1. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  2. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  3. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  4. 1
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

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

@ -395,7 +395,7 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
* @param endDate 截止日期也即查询截止改日期有多少社区在使用
* @return
*/
List<String> getUsingCommunityList(@Param("agencyId") String agencyId, @Param("agencyOrgIdPath") String agencyOrgIdPath, @Param("endDate") Date endDate);
List<String> getUsingCommunityList(@Param("customerId") String customerId, @Param("agencyId") String agencyId, @Param("agencyOrgIdPath") String agencyOrgIdPath, @Param("endDate") Date endDate);
List<String> getCommunitysByOrgIdPath(@Param("customerId") String customerId, @Param("orgId") String orgId, @Param("orgIdPath") String orgIdPath);
}

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

@ -1145,8 +1145,8 @@ public class AgencyServiceImpl implements AgencyService {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId);
agencyOrgIdPath = getOrgIdPath(agencyInfo.getPids(), agencyInfo.getId());
List<String> currentUsingCommunityList = customerAgencyDao.getUsingCommunityList(orgId, agencyOrgIdPath, null);
List<String> preferUsingCommunityList = customerAgencyDao.getUsingCommunityList(orgId, agencyOrgIdPath, endTime);
List<String> currentUsingCommunityList = customerAgencyDao.getUsingCommunityList(customerId, orgId, agencyOrgIdPath, null);
List<String> preferUsingCommunityList = customerAgencyDao.getUsingCommunityList(customerId, orgId, agencyOrgIdPath, endTime);
return new UsingCommunityStatsResultDTO(currentUsingCommunityList.size(), currentUsingCommunityList.size() - preferUsingCommunityList.size());
} else if ("grid".equals(orgType)) {
// 网格下不会有该数据,给个0

15
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -1398,8 +1398,21 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
String customerId = EpmetRequestHolder.getLoginUserCustomerId();
if (StringUtils.isBlank(orgId)) {
// 没有传参数,使用当前登录人员所属的组织去查询
String userId = EpmetRequestHolder.getLoginUserId();
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId);
if (staffInfo == null) {
String errorMsg = String.format("查询当前工作人员信息失败。staffId:%s", userId);
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), errorMsg, errorMsg);
}
orgId = staffInfo.getAgencyId();
orgType = "agency";
}
PageHelper.startPage(pageNo, pageSize);
List<String> communityIds = customerAgencyDao.getUsingCommunityList(orgId, CustomerOrgRedis.getOrgIdPath(orgId, orgType), null);
List<String> communityIds = customerAgencyDao.getUsingCommunityList(customerId, orgId, CustomerOrgRedis.getOrgIdPath(orgId, orgType), null);
// List<String> communityIds = customerAgencyDao.getCommunitysByOrgIdPath(customerId, orgId, CustomerOrgRedis.getOrgIdPath(orgId, orgType));

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

@ -1029,6 +1029,7 @@
from customer_agency ca
inner join customer_staff_agency csa on (ca.ID = csa.AGENCY_ID and csa.DEL_FLAG = 0)
where ca.DEL_FLAG = 0
and ca.CUSTOMER_ID=${customerId}
and ca.LEVEL = 'community'
<if test="endDate != null">
and csa.CREATED_TIME <![CDATA[<]]> #{endDate}

Loading…
Cancel
Save