Browse Source

治理指数数据查询接口修改

master
zhaoqifeng 4 years ago
parent
commit
990dc80584
  1. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java
  2. 23
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  3. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java
  4. 13
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java
  5. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml

9
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java

@ -67,4 +67,13 @@ public interface EvaluationIndexDao {
* @return java.util.List<com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO>
*/
ScreenGovernRankDataDailyDTO getGovernRankList(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId);
/**
* 获取组织信息
* @author zhaoqifeng
* @date 2021/6/29 13:58
* @param agencyId
* @return com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO
*/
ScreenCustomerAgencyDTO getAgencyInfo(@Param("agencyId") String agencyId);
}

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

@ -19,6 +19,7 @@ import com.epmet.dataaggre.entity.datastats.DimGridEntity;
import com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService;
import com.epmet.dataaggre.service.opercrm.CustomerRelation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -46,6 +47,8 @@ public class DataStatsServiceImpl implements DataStatsService {
private DataStatsDao dataStatsDao;
@Autowired
private EvaluationIndexService indexService;
@Autowired
private CustomerRelation customerRelation;
/**
@ -1127,10 +1130,10 @@ public class DataStatsServiceImpl implements DataStatsService {
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
formDTO.setDateId(format.format(yesterday));
}
if (OrgConstant.PROVINCE.equals(formDTO.getLevel()) || OrgConstant.CITY.equals(formDTO.getLevel()) || OrgConstant.DISTRICT.equals(formDTO.getLevel())) {
if (StringUtils.isNotBlank(formDTO.getAreaCode())) {
ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getAgencyId());
if (customerRelation.haveSubCustomer(agencyDTO.getCustomerId())) {
List<String> subAgencyIds = indexService.getAgencyByAreaCodeAgencyId(formDTO.getAgencyId(), formDTO.getAreaCode());
List<String> subAgencyIds = indexService.getAgencyByAreaCodeAgencyId(formDTO.getAgencyId(), agencyDTO.getAreaCode());
if (CollectionUtils.isEmpty(subAgencyIds)) {
subAgencyIds = new ArrayList<>();
}
@ -1162,7 +1165,6 @@ public class DataStatsServiceImpl implements DataStatsService {
return resultDTO;
}
}
}
//1.按日期查询当前组织事件治理指数
List<String> agencyIds = new ArrayList<>();
agencyIds.add(formDTO.getAgencyId());
@ -1201,8 +1203,9 @@ public class DataStatsServiceImpl implements DataStatsService {
return resultList;
}
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList());
if (StringUtils.isNotBlank(formDTO.getAreaCode())) {
List<ScreenCustomerAgencyDTO> subAgencies = indexService.getSubAgencyList(formDTO.getAgencyId(), formDTO.getAreaCode());
ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getAgencyId());
if (customerRelation.haveSubCustomer(agencyDTO.getCustomerId())) {
List<ScreenCustomerAgencyDTO> subAgencies = indexService.getSubAgencyList(formDTO.getAgencyId(), agencyDTO.getAreaCode());
agencyIds = subAgencies.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList());
subAgencyList = subAgencies.stream().map(item -> {
DimAgencyEntity entity = new DimAgencyEntity();
@ -1377,10 +1380,10 @@ public class DataStatsServiceImpl implements DataStatsService {
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
formDTO.setDateId(format.format(yesterday));
}
if (OrgConstant.PROVINCE.equals(formDTO.getLevel()) || OrgConstant.CITY.equals(formDTO.getLevel()) || OrgConstant.DISTRICT.equals(formDTO.getLevel())) {
if (StringUtils.isNotBlank(formDTO.getAreaCode())) {
ScreenGovernRankDataDailyDTO governData = indexService.getGovernRank(formDTO.getOrgId(), formDTO.getAreaCode(), formDTO.getDateId());
if (OrgConstant.AGENCY.equals(formDTO.getOrgType())) {
ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getOrgId());
if (customerRelation.haveSubCustomer(agencyDTO.getCustomerId())) {
ScreenGovernRankDataDailyDTO governData = indexService.getGovernRank(formDTO.getOrgId(), agencyDTO.getAreaCode(), formDTO.getDateId());
resultDTO.setGovernRatio(getPercentage(governData.getGovernCount(), governData.getClosedCount()));
resultDTO.setResolvedRatio(getPercentage(governData.getResolvedCount(), governData.getClosedCount()));
resultDTO.setResponseRatio(getPercentage(governData.getResponseCount(), governData.getTransferCount()));

9
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java

@ -49,4 +49,13 @@ public interface EvaluationIndexService {
* @return java.util.List<com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO>
*/
ScreenGovernRankDataDailyDTO getGovernRank(String agencyId, String areaCode, String dateId);
/**
* 获取组织信息
* @author zhaoqifeng
* @date 2021/6/29 13:57
* @param agencyId
* @return com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO
*/
ScreenCustomerAgencyDTO getAgencyInfo(String agencyId);
}

13
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java

@ -90,4 +90,17 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService {
return evaluationIndexDao.getGovernRankList(agencyIdList, dateId);
}
/**
* 获取组织信息
*
* @param agencyId
* @return com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO
* @author zhaoqifeng
* @date 2021/6/29 13:57
*/
@Override
public ScreenCustomerAgencyDTO getAgencyInfo(String agencyId) {
return evaluationIndexDao.getAgencyInfo(agencyId);
}
}

14
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml

@ -96,5 +96,19 @@
AND ORG_TYPE = 'agency'
AND DATE_ID = #{dateId}
</select>
<select id="getAgencyInfo" resultType="com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO">
SELECT
customer_id,
agency_id ,
agency_name,
level,
area_code,
parent_area_code
FROM
SCREEN_CUSTOMER_AGENCY
WHERE
del_flag = '0'
and AGENCY_ID = #{agencyId}
</select>
</mapper>
Loading…
Cancel
Save