|
|
@ -6,15 +6,18 @@ import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
|
import com.epmet.constant.OrgTypeConstant; |
|
|
|
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; |
|
|
|
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; |
|
|
|
import com.epmet.dto.extract.result.OrgStatisticsResultDTO; |
|
|
|
import com.epmet.dto.stats.DimAgencyDTO; |
|
|
|
import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO; |
|
|
|
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; |
|
|
|
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; |
|
|
|
import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService; |
|
|
|
import com.epmet.service.evaluationindex.extract.FactOriginProjectMainDailyService; |
|
|
|
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; |
|
|
|
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; |
|
|
|
import com.epmet.service.evaluationindex.indexcoll.IndexCollCommunityService; |
|
|
|
import com.epmet.service.stats.DimAgencyService; |
|
|
|
import com.epmet.service.stats.FactArticlePublishedAgencyDailyService; |
|
|
|
import com.epmet.util.DimIdGenerator; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@ -45,6 +48,10 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService |
|
|
|
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao; |
|
|
|
@Autowired |
|
|
|
private FactOriginProjectMainDailyService factOriginProjectMainDailyService; |
|
|
|
@Autowired |
|
|
|
private FactArticlePublishedAgencyDailyService factArticlePublishedAgencyDailyService; |
|
|
|
@Autowired |
|
|
|
private FactIndexPartyAblityOrgMonthlyService factIndexPartyAblityOrgMonthlyService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public void saveCommunityAbility(String customerId, String dateId) { |
|
|
@ -65,15 +72,15 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService |
|
|
|
entity.setMonthId(dimId.getMonthId()); |
|
|
|
entity.setDataType(OrgTypeConstant.COMMUNITY); |
|
|
|
entity.setTransferedCount(NumConstant.ZERO); |
|
|
|
entity.setClosedProjectCount(NumConstant.ZERO); |
|
|
|
entity.setRespProjectRatio(new BigDecimal(NumConstant.ZERO)); |
|
|
|
entity.setOverdueProjectRatio(new BigDecimal(NumConstant.ZERO)); |
|
|
|
entity.setClosedProjectRatio(new BigDecimal(NumConstant.ZERO)); |
|
|
|
entity.setSatisfactionRatio(new BigDecimal(NumConstant.ZERO)); |
|
|
|
entity.setClosedProjectCount(NumConstant.ZERO); |
|
|
|
entity.setHandleProjectRatio(new BigDecimal(NumConstant.ZERO)); |
|
|
|
return entity; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
|
//1.治理能力
|
|
|
|
//被吹哨次数统计
|
|
|
|
List<OrgStatisticsResultDTO> transferCount = factOriginProjectLogDailyService.getAgencyTransferCount(customerId, dimId.getMonthId(), |
|
|
|
OrgTypeConstant.COMMUNITY); |
|
|
@ -119,18 +126,34 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
|
factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY); |
|
|
|
factIndexGovrnAblityOrgMonthlyService.insertBatch(list); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void saveCommunityPartyAbility(String customerId, String dateId) { |
|
|
|
//当前日期前一天
|
|
|
|
Date date = DateUtils.getBeforeDay(DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMMDD)); |
|
|
|
//获取日期相关维度
|
|
|
|
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); |
|
|
|
//获取社区列表
|
|
|
|
List<DimAgencyDTO>agencyList = dimAgencyService.getAgencyByLevel(customerId, OrgTypeConstant.COMMUNITY); |
|
|
|
//2.党建能力
|
|
|
|
//获取社区发文数量
|
|
|
|
List<FactArticlePublishedAgencyDailyDTO> articles = factArticlePublishedAgencyDailyService.getArticleCount(customerId, dimId.getMonthId(), |
|
|
|
OrgTypeConstant.COMMUNITY); |
|
|
|
|
|
|
|
List<FactIndexPartyAblityOrgMonthlyEntity> partyList = agencyList.stream().map(agency ->{ |
|
|
|
FactIndexPartyAblityOrgMonthlyEntity entity = new FactIndexPartyAblityOrgMonthlyEntity(); |
|
|
|
entity.setCustomerId(customerId); |
|
|
|
entity.setAgencyId(agency.getId()); |
|
|
|
entity.setParentId(agency.getPid()); |
|
|
|
entity.setYearId(dimId.getYearId()); |
|
|
|
entity.setQuarterId(dimId.getQuarterId()); |
|
|
|
entity.setMonthId(dimId.getMonthId()); |
|
|
|
entity.setDataType(OrgTypeConstant.COMMUNITY); |
|
|
|
entity.setPublishArticleCount(NumConstant.ZERO); |
|
|
|
return entity; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
if (null != articles && !articles.isEmpty()) { |
|
|
|
partyList.forEach(entity -> articles.stream().filter(article -> entity.getAgencyId().equals(article.getAgencyId())).forEach(dto -> { |
|
|
|
entity.setPublishArticleCount(dto.getArticleTotalCount()); |
|
|
|
})); |
|
|
|
} |
|
|
|
factIndexPartyAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY); |
|
|
|
factIndexPartyAblityOrgMonthlyService.insertBatch(partyList); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|