Browse Source

查询组织、网格改为查询实时数据,不在查询统计数据

master
syc 3 years ago
parent
commit
b55f97f7cc
  1. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java
  2. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java
  3. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  4. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  5. 43
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  6. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml
  7. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java

@ -18,6 +18,7 @@
package com.epmet.dataaggre.dao.govorg; package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -108,4 +109,5 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
List<String> getSubAgencyList(@Param("agencyId") String agencyId); List<String> getSubAgencyList(@Param("agencyId") String agencyId);
List<ScreenCustomerAgencyDTO> getSubAgencyListByAgency(@Param("customerId") String customerId, @Param("agencyId") String agencyId);
} }

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java

@ -18,6 +18,7 @@
package com.epmet.dataaggre.dao.govorg; package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO;
@ -84,4 +85,5 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
*/ */
CustomerGridDTO getGridInfo(@Param("gridId") String gridId); CustomerGridDTO getGridInfo(@Param("gridId") String gridId);
List<ScreenCustomerGridDTO> getSubGridList(@Param("customerId") String customerId, @Param("agencyId") String agencyId);
} }

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -2329,7 +2329,7 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve
} }
//2.查询组织信息,判断要查询下级是组织还是网格数据 //2.查询组织信息,判断要查询下级是组织还是网格数据
ScreenAgencyOrGridListDTO agencyGrid = indexService.getSubAgencyOrGridList(formDTO.getAgencyId(), formDTO.isExport()); ScreenAgencyOrGridListDTO agencyGrid = govOrgService.getSubAgencyOrGridList(formDTO.getCustomerId(), formDTO.getAgencyId());
if (null == agencyGrid) { if (null == agencyGrid) {
return new ArrayList<>(); return new ArrayList<>();
} }

3
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java

@ -5,6 +5,7 @@ import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.StaffSelectResDTO; import com.epmet.dataaggre.dto.epmetuser.result.StaffSelectResDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO; import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO; import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
@ -289,4 +290,6 @@ public interface GovOrgService {
List<ResourceInfoResultDTO> getEnterpriseInfos(CoverageHomeSearchFormDTO formDTO); List<ResourceInfoResultDTO> getEnterpriseInfos(CoverageHomeSearchFormDTO formDTO);
Integer getEnterpriseInfosCount(CoverageHomeSearchFormDTO formDTO); Integer getEnterpriseInfosCount(CoverageHomeSearchFormDTO formDTO);
ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String customerId, String agencyId);
} }

43
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -14,6 +14,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.DingTextBriefNessFormDTO; import com.epmet.commons.tools.dto.form.DingTextBriefNessFormDTO;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.OrgLevelEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.ExceptionUtils;
@ -39,6 +40,9 @@ import com.epmet.dataaggre.dto.epmetuser.result.CustomerStaffResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.StaffSelectResDTO; import com.epmet.dataaggre.dto.epmetuser.result.StaffSelectResDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.*; import com.epmet.dataaggre.dto.govorg.*;
import com.epmet.dataaggre.dto.govorg.form.*; import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.dto.govorg.result.*;
@ -1467,4 +1471,43 @@ public class GovOrgServiceImpl implements GovOrgService {
public Integer getEnterpriseInfosCount(CoverageHomeSearchFormDTO formDTO) { public Integer getEnterpriseInfosCount(CoverageHomeSearchFormDTO formDTO) {
return cityManagementDao.getEnterpriseInfosCount(formDTO); return cityManagementDao.getEnterpriseInfosCount(formDTO);
} }
@Override
public ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String customerId, String agencyId) {
ScreenAgencyOrGridListDTO resultDTO = new ScreenAgencyOrGridListDTO();
List<ScreenAgencyOrGridListDTO.AgencyGrid> agencyGridList = new ArrayList<>();
//1.查询组织信息
CustomerAgencyEntity dto = customerAgencyDao.selectById(agencyId);
if (dto == null) {
log.error(String.format("组织信息不存在,组织Id->%s", agencyId));
return new ScreenAgencyOrGridListDTO();
}
//2.根据组织级别判断查询直属组织或网格列表
List<ScreenCustomerAgencyDTO> agencyList = new ArrayList<>();
List<ScreenCustomerGridDTO> gridList = new ArrayList<>();
if (!"community".equals(dto.getLevel())) {
//2-1.直属下级组织列表
agencyList = customerAgencyDao.getSubAgencyListByAgency(customerId, agencyId);
agencyList.forEach(gr->{
ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid();
org.setOrgId(gr.getAgencyId());
org.setOrgName(gr.getAgencyName());
agencyGridList.add(org);
});
} else {
//2-2.直属下级网格列表
gridList = customerGridDao.getSubGridList(customerId, agencyId);
gridList.forEach(gr->{
ScreenAgencyOrGridListDTO.AgencyGrid org = new ScreenAgencyOrGridListDTO.AgencyGrid();
org.setOrgId(gr.getGridId());
org.setOrgName(gr.getGridName());
agencyGridList.add(org);
});
}
resultDTO.setLevel(dto.getLevel());
resultDTO.setAgencyGridList(agencyGridList);
return resultDTO;
}
} }

17
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml

@ -309,4 +309,21 @@
OR PIDS LIKE CONCAT('%', #{agencyId}, '%')) OR PIDS LIKE CONCAT('%', #{agencyId}, '%'))
</select> </select>
<select id="getSubAgencyListByAgency" resultType="com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO">
SELECT
customer_id AS customerId,
id AS agencyId,
organization_name AS agencyName,
level AS level,
area_code AS areaCode,
parent_area_code AS parentAreaCode,
pids
FROM
customer_agency
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND pid = #{agencyId}
</select>
</mapper> </mapper>

15
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml

@ -181,4 +181,19 @@
AND cg.DEL_FLAG = '0' AND cg.DEL_FLAG = '0'
</select> </select>
<select id="getSubGridList" resultType="com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO">
SELECT
customer_id AS customerId,
id AS gridId,
grid_name AS gridName,
pid AS parentAgencyId,
pids AS allParentIds
FROM
customer_grid
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND pid = #{agencyId}
</select>
</mapper> </mapper>

Loading…
Cancel
Save