|
|
@ -5,12 +5,14 @@ import com.epmet.constant.IndexCalConstant; |
|
|
|
import com.epmet.constant.OrgTypeConstant; |
|
|
|
import com.epmet.dto.extract.result.OrgStatisticsResultDTO; |
|
|
|
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; |
|
|
|
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; |
|
|
|
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; |
|
|
|
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; |
|
|
|
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; |
|
|
|
import com.epmet.service.evaluationindex.extract.toscreen.GovernRankDataExtractService; |
|
|
|
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService; |
|
|
|
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; |
|
|
|
import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataDailyService; |
|
|
|
import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -30,6 +32,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe |
|
|
|
@Autowired |
|
|
|
private ScreenGovernRankDataService screenGovernRankDataService; |
|
|
|
@Autowired |
|
|
|
private ScreenGovernRankDataDailyService screenGovernRankDataDailyService; |
|
|
|
@Autowired |
|
|
|
private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService; |
|
|
|
@Autowired |
|
|
|
private FactIndexGovrnAblityGridMonthlyService factIndexGovrnAblityGridMonthlyService; |
|
|
@ -283,4 +287,294 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe |
|
|
|
} |
|
|
|
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 网格治理能力 |
|
|
|
* |
|
|
|
* @param customerId |
|
|
|
* @param dateId |
|
|
|
* @return void |
|
|
|
* @author zhaoqifeng |
|
|
|
* @date 2020/9/24 15:16 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void extractGridDataDaily(String customerId, String dateId) { |
|
|
|
List<ScreenGovernRankDataDailyEntity> list = screenGovernRankDataDailyService.initList(customerId, OrgTypeConstant.GRID, null); |
|
|
|
if (CollectionUtils.isEmpty(list)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); |
|
|
|
list.forEach(entity -> { |
|
|
|
entity.setYearId(dateId.substring(NumConstant.ZERO, NumConstant.FOUR)); |
|
|
|
entity.setMonthId(dateId.substring(NumConstant.ZERO, NumConstant.SIX)); |
|
|
|
entity.setDateId(dateId); |
|
|
|
}); |
|
|
|
//满意率 满意和非常满意占比
|
|
|
|
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getGridSatisfactionDaily(customerId, dateId); |
|
|
|
if (!CollectionUtils.isEmpty(satisfactionList)) { |
|
|
|
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { |
|
|
|
if (dto.getSum() != NumConstant.ZERO) { |
|
|
|
BigDecimal sum = new BigDecimal(dto.getSum()); |
|
|
|
BigDecimal count = new BigDecimal(dto.getCount()); |
|
|
|
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
//自治率
|
|
|
|
List<FactIndexGovrnAblityGridMonthlyEntity> gridList = factIndexGovrnAblityGridMonthlyService.getGridByCustomerDaily(customerId, dateId); |
|
|
|
if (CollectionUtils.isNotEmpty(gridList)) { |
|
|
|
list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getGridId())).forEach(grid -> { |
|
|
|
BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount()); |
|
|
|
BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount()); |
|
|
|
if (grid.getResolveProjectCount() != NumConstant.ZERO) { |
|
|
|
entity.setGovernRatio(selfCount.multiply(hundred).divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
|
//响应率 响应次数/流转到网格的次数
|
|
|
|
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getGridResponseDaily(customerId, dateId); |
|
|
|
if (CollectionUtils.isNotEmpty(responseList)) { |
|
|
|
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getOrgId())).forEach(dto -> { |
|
|
|
if (dto.getSum() != NumConstant.ZERO) { |
|
|
|
BigDecimal sum = new BigDecimal(dto.getSum()); |
|
|
|
BigDecimal count = new BigDecimal(dto.getCount()); |
|
|
|
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
|
//解决率 已解决项目数/办结项目数
|
|
|
|
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getGridResolveProjectDaily(customerId, dateId); |
|
|
|
if (CollectionUtils.isNotEmpty(resolveList)) { |
|
|
|
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getOrgId())).forEach(dto -> { |
|
|
|
if (dto.getSum() != NumConstant.ZERO) { |
|
|
|
BigDecimal sum = new BigDecimal(dto.getSum()); |
|
|
|
BigDecimal count = new BigDecimal(dto.getCount()); |
|
|
|
entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
|
screenGovernRankDataDailyService.delAndSaveRankData(customerId, OrgTypeConstant.GRID, dateId, IndexCalConstant.DELETE_SIZE, list); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 社区治理能力 |
|
|
|
* |
|
|
|
* @param customerId |
|
|
|
* @param dateId |
|
|
|
* @return void |
|
|
|
* @author zhaoqifeng |
|
|
|
* @date 2020/9/24 15:17 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void extractCommunityDataDaily(String customerId, String dateId) { |
|
|
|
List<ScreenGovernRankDataDailyEntity> list = screenGovernRankDataDailyService.initList(customerId, OrgTypeConstant.AGENCY, |
|
|
|
OrgTypeConstant.COMMUNITY); |
|
|
|
if (CollectionUtils.isEmpty(list)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); |
|
|
|
list.forEach(entity -> { |
|
|
|
entity.setYearId(dateId.substring(NumConstant.ZERO, NumConstant.FOUR)); |
|
|
|
entity.setMonthId(dateId.substring(NumConstant.ZERO, NumConstant.SIX)); |
|
|
|
entity.setDateId(dateId); |
|
|
|
}); |
|
|
|
|
|
|
|
//满意率 满意和非常满意占比
|
|
|
|
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfactionDaily(customerId, dateId, |
|
|
|
OrgTypeConstant.COMMUNITY); |
|
|
|
if (CollectionUtils.isNotEmpty(satisfactionList)) { |
|
|
|
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { |
|
|
|
if (dto.getSum() != NumConstant.ZERO) { |
|
|
|
BigDecimal sum = new BigDecimal(dto.getSum()); |
|
|
|
BigDecimal count = new BigDecimal(dto.getCount()); |
|
|
|
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
|
//响应率 响应次数/流转到网格的次数
|
|
|
|
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getOrgResponseDaily(customerId, dateId, OrgTypeConstant.COMMUNITY); |
|
|
|
if (CollectionUtils.isNotEmpty(responseList)) { |
|
|
|
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { |
|
|
|
if (dto.getSum() != NumConstant.ZERO) { |
|
|
|
BigDecimal sum = new BigDecimal(dto.getSum()); |
|
|
|
BigDecimal count = new BigDecimal(dto.getCount()); |
|
|
|
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
//自制率 自治项目数/办结项目数
|
|
|
|
List<OrgStatisticsResultDTO> selfList = factOriginProjectMainDailyService.getSelfProject(customerId, dateId, OrgTypeConstant.COMMUNITY); |
|
|
|
if (CollectionUtils.isNotEmpty(selfList)) { |
|
|
|
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { |
|
|
|
if (dto.getSum() != NumConstant.ZERO) { |
|
|
|
BigDecimal sum = new BigDecimal(dto.getSum()); |
|
|
|
BigDecimal count = new BigDecimal(dto.getCount()); |
|
|
|
entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
//解决率 已解决项目数/办结项目数
|
|
|
|
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getResolveProjectDaily(customerId, dateId, |
|
|
|
OrgTypeConstant.COMMUNITY); |
|
|
|
if (CollectionUtils.isNotEmpty(resolveList)) { |
|
|
|
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { |
|
|
|
if (dto.getSum() != NumConstant.ZERO) { |
|
|
|
BigDecimal sum = new BigDecimal(dto.getSum()); |
|
|
|
BigDecimal count = new BigDecimal(dto.getCount()); |
|
|
|
entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
screenGovernRankDataDailyService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, dateId, IndexCalConstant.DELETE_SIZE, list); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 街道治理能力 |
|
|
|
* |
|
|
|
* @param customerId |
|
|
|
* @param dateId |
|
|
|
* @return void |
|
|
|
* @author zhaoqifeng |
|
|
|
* @date 2020/9/24 15:17 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void extractStreetDataDaily(String customerId, String dateId) { |
|
|
|
List<ScreenGovernRankDataDailyEntity> list = screenGovernRankDataDailyService.initList(customerId, OrgTypeConstant.AGENCY, |
|
|
|
OrgTypeConstant.STREET); |
|
|
|
if (CollectionUtils.isEmpty(list)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); |
|
|
|
list.forEach(entity -> { |
|
|
|
entity.setYearId(dateId.substring(NumConstant.ZERO, NumConstant.FOUR)); |
|
|
|
entity.setMonthId(dateId.substring(NumConstant.ZERO, NumConstant.SIX)); |
|
|
|
entity.setDateId(dateId); |
|
|
|
}); |
|
|
|
|
|
|
|
//满意率 满意和非常满意占比
|
|
|
|
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfactionDaily(customerId, dateId, |
|
|
|
OrgTypeConstant.STREET); |
|
|
|
if (CollectionUtils.isNotEmpty(satisfactionList)) { |
|
|
|
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { |
|
|
|
if (dto.getSum() != NumConstant.ZERO) { |
|
|
|
BigDecimal sum = new BigDecimal(dto.getSum()); |
|
|
|
BigDecimal count = new BigDecimal(dto.getCount()); |
|
|
|
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
|
//响应率 响应次数/流转到网格的次数
|
|
|
|
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getOrgResponseDaily(customerId, dateId, OrgTypeConstant.STREET); |
|
|
|
if (CollectionUtils.isNotEmpty(responseList)) { |
|
|
|
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { |
|
|
|
if (dto.getSum() != NumConstant.ZERO) { |
|
|
|
BigDecimal sum = new BigDecimal(dto.getSum()); |
|
|
|
BigDecimal count = new BigDecimal(dto.getCount()); |
|
|
|
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
//自制率 自治项目数/办结项目数
|
|
|
|
List<OrgStatisticsResultDTO> selfList = factOriginProjectMainDailyService.getSelfProject(customerId, dateId, OrgTypeConstant.STREET); |
|
|
|
if (CollectionUtils.isNotEmpty(selfList)) { |
|
|
|
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { |
|
|
|
if (dto.getSum() != NumConstant.ZERO) { |
|
|
|
BigDecimal sum = new BigDecimal(dto.getSum()); |
|
|
|
BigDecimal count = new BigDecimal(dto.getCount()); |
|
|
|
entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
//解决率 已解决项目数/办结项目数
|
|
|
|
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getResolveProjectDaily(customerId, dateId, |
|
|
|
OrgTypeConstant.STREET); |
|
|
|
if (CollectionUtils.isNotEmpty(resolveList)) { |
|
|
|
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { |
|
|
|
if (dto.getSum() != NumConstant.ZERO) { |
|
|
|
BigDecimal sum = new BigDecimal(dto.getSum()); |
|
|
|
BigDecimal count = new BigDecimal(dto.getCount()); |
|
|
|
entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
screenGovernRankDataDailyService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, dateId, IndexCalConstant.DELETE_SIZE, list); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 全区治理能力 |
|
|
|
* |
|
|
|
* @param customerId |
|
|
|
* @param dateId |
|
|
|
* @return void |
|
|
|
* @author zhaoqifeng |
|
|
|
* @date 2020/9/24 15:17 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void extractDistrictDataDaily(String customerId, String dateId) { |
|
|
|
List<ScreenGovernRankDataDailyEntity> list = screenGovernRankDataDailyService.initList(customerId, OrgTypeConstant.AGENCY, |
|
|
|
OrgTypeConstant.DISTRICT); |
|
|
|
if (CollectionUtils.isEmpty(list)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); |
|
|
|
list.forEach(entity -> { |
|
|
|
entity.setYearId(dateId.substring(NumConstant.ZERO, NumConstant.FOUR)); |
|
|
|
entity.setMonthId(dateId.substring(NumConstant.ZERO, NumConstant.SIX)); |
|
|
|
entity.setDateId(dateId); |
|
|
|
}); |
|
|
|
|
|
|
|
//满意率 满意和非常满意占比
|
|
|
|
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfactionDaily(customerId, dateId, |
|
|
|
OrgTypeConstant.DISTRICT); |
|
|
|
if (CollectionUtils.isNotEmpty(satisfactionList)) { |
|
|
|
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { |
|
|
|
if (dto.getSum() != NumConstant.ZERO) { |
|
|
|
BigDecimal sum = new BigDecimal(dto.getSum()); |
|
|
|
BigDecimal count = new BigDecimal(dto.getCount()); |
|
|
|
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
|
//响应率 响应次数/流转到网格的次数
|
|
|
|
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getOrgResponseDaily(customerId, dateId, OrgTypeConstant.DISTRICT); |
|
|
|
if (CollectionUtils.isNotEmpty(responseList)) { |
|
|
|
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { |
|
|
|
if (dto.getSum() != NumConstant.ZERO) { |
|
|
|
BigDecimal sum = new BigDecimal(dto.getSum()); |
|
|
|
BigDecimal count = new BigDecimal(dto.getCount()); |
|
|
|
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
//自制率 自治项目数/办结项目数
|
|
|
|
List<OrgStatisticsResultDTO> selfList = factOriginProjectMainDailyService.getSelfProject(customerId, dateId, OrgTypeConstant.DISTRICT); |
|
|
|
if (CollectionUtils.isNotEmpty(selfList)) { |
|
|
|
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { |
|
|
|
if (dto.getSum() != NumConstant.ZERO) { |
|
|
|
BigDecimal sum = new BigDecimal(dto.getSum()); |
|
|
|
BigDecimal count = new BigDecimal(dto.getCount()); |
|
|
|
entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
//解决率 已解决项目数/办结项目数
|
|
|
|
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getResolveProjectDaily(customerId, dateId, |
|
|
|
OrgTypeConstant.DISTRICT); |
|
|
|
if (CollectionUtils.isNotEmpty(resolveList)) { |
|
|
|
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { |
|
|
|
if (dto.getSum() != NumConstant.ZERO) { |
|
|
|
BigDecimal sum = new BigDecimal(dto.getSum()); |
|
|
|
BigDecimal count = new BigDecimal(dto.getCount()); |
|
|
|
entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
screenGovernRankDataDailyService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, dateId, IndexCalConstant.DELETE_SIZE, list); |
|
|
|
} |
|
|
|
} |
|
|
|