|
|
@ -9,13 +9,11 @@ import com.epmet.dto.stats.DimDepartmentDTO; |
|
|
|
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; |
|
|
|
import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollDistrictDepartmentService; |
|
|
|
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; |
|
|
|
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; |
|
|
|
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyService; |
|
|
|
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; |
|
|
|
import com.epmet.service.stats.DimDepartmentService; |
|
|
|
import com.epmet.service.stats.FactArticlePublishedDepartmentDailyService; |
|
|
|
import com.epmet.util.DimIdGenerator; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
@ -41,12 +39,6 @@ public class IndexCollDistrictDepartmentServiceImpl implements IndexCollDistrict |
|
|
|
private FactOriginProjectLogDailyService factOriginProjectLogDailyService; |
|
|
|
@Autowired |
|
|
|
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao; |
|
|
|
@Autowired |
|
|
|
private FactOriginProjectMainDailyService factOriginProjectMainDailyService; |
|
|
|
@Autowired |
|
|
|
private FactArticlePublishedDepartmentDailyService factArticlePublishedDepartmentDailyService; |
|
|
|
@Autowired |
|
|
|
private FactIndexPartyAblityOrgMonthlyService factIndexPartyAblityOrgMonthlyService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public void saveDepartmentAbility(String customerId, String dateId) { |
|
|
@ -97,7 +89,43 @@ public class IndexCollDistrictDepartmentServiceImpl implements IndexCollDistrict |
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
|
//TODO 区直部门办结项目满意度 暂时无法统计
|
|
|
|
//办结项目数 办结率
|
|
|
|
List<OrgStatisticsResultDTO > closedList = factOriginProjectLogDailyService.getDeptClosedProject(customerId, dimId.getMonthId()); |
|
|
|
if (CollectionUtils.isNotEmpty(closedList)) { |
|
|
|
list.forEach(entity -> closedList.stream().filter(dto -> dto.getOrgId().equals(entity.getDeptId())).forEach(item -> { |
|
|
|
entity.setClosedProjectCount(item.getCount()); |
|
|
|
if (item.getSum() != NumConstant.ZERO) { |
|
|
|
BigDecimal count = new BigDecimal(item.getCount()); |
|
|
|
BigDecimal sum = new BigDecimal(item.getSum()); |
|
|
|
entity.setClosedProjectRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
|
//部门办结项目满意度
|
|
|
|
List<OrgStatisticsResultDTO > satisfactions = factOriginProjectLogDailyService.getDeptSatisfaction(customerId, dimId.getMonthId()); |
|
|
|
if (CollectionUtils.isNotEmpty(satisfactions)) { |
|
|
|
list.forEach(entity -> satisfactions.stream().filter(dto -> dto.getOrgId().equals(entity.getDeptId())).forEach(item -> { |
|
|
|
if (item.getCount() != NumConstant.ZERO) { |
|
|
|
BigDecimal count = new BigDecimal(item.getCount()); |
|
|
|
entity.setClosedProjectRatio(item.getRatio().divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
|
//部门办结项目的处理效率
|
|
|
|
List<OrgStatisticsResultDTO > handle = factOriginProjectOrgPeriodDailyDao.selectDeptHandle(customerId, dimId.getMonthId()); |
|
|
|
if (CollectionUtils.isNotEmpty(handle)) { |
|
|
|
list.forEach(entity -> handle.stream().filter(dto -> dto.getOrgId().equals(entity.getDeptId())).forEach(item -> { |
|
|
|
if (item.getCount() != NumConstant.ZERO) { |
|
|
|
BigDecimal count = new BigDecimal(item.getCount()); |
|
|
|
BigDecimal sum = new BigDecimal(item.getSum()); |
|
|
|
BigDecimal one = new BigDecimal(NumConstant.ONE); |
|
|
|
entity.setClosedProjectRatio(one.divide(sum.divide(count), NumConstant.SIX, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
factIndexGovrnAblityDeptMonthlyService.deleteByCustomer(customerId, dimId.getMonthId()); |
|
|
|
factIndexGovrnAblityDeptMonthlyService.insertBatch(list); |
|
|
|