|
|
@ -5,6 +5,7 @@ import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.EpmetConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.DateUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.dto.SysDeptDTO; |
|
|
|
import com.elink.esua.epdc.dto.screen.form.ScreenJobFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.screen.result.ScreenAgencyGovernDailyResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.screen.result.ScreenGovernRankDataDailyResultDTO; |
|
|
@ -39,11 +40,6 @@ public class ScreenGovernanceServiceImpl extends BaseServiceImpl<ScreenGovernanc |
|
|
|
@Value("${epmet.config.customerId}") |
|
|
|
private String EPMET_CONFIG_CUSTOMER_ID; |
|
|
|
|
|
|
|
/** |
|
|
|
* 锦水街道DEPT_ID |
|
|
|
*/ |
|
|
|
private final String STREET_ID = "1215437824174608386"; |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result governrankdatadaily(ScreenJobFormDTO formDto) { |
|
|
|
String yearMonthDay = DateUtils.formatNoSplit(DateUtils.addDateDays(new Date(), -1)); |
|
|
@ -53,6 +49,7 @@ public class ScreenGovernanceServiceImpl extends BaseServiceImpl<ScreenGovernanc |
|
|
|
List<ScreenGovernRankDataDailyResultDTO> data = baseDao.governrankdatadaily(); |
|
|
|
List<ScreenGovernRankDataDailyResultDTO> agencyData = baseDao.governrankdatadailyAgency(); |
|
|
|
List<ScreenGovernRankDataDailyResultDTO> noRespData = baseDao.governrankdatadailyNoResp(); |
|
|
|
List<SysDeptDTO> streetList = baseDao.getStreetList(); |
|
|
|
|
|
|
|
// 处理未响应和项目转入次数
|
|
|
|
noRespHandle(data, noRespData); |
|
|
@ -67,15 +64,19 @@ public class ScreenGovernanceServiceImpl extends BaseServiceImpl<ScreenGovernanc |
|
|
|
agencyResult.setTransferCount(agencyResult.getTransferCount() + item.getTransferCount()); |
|
|
|
} |
|
|
|
}); |
|
|
|
// 街道数据需要在本身基础上再加上社区的合计
|
|
|
|
Optional<ScreenGovernRankDataDailyResultDTO> agencyOptional = agencyData.stream().filter(agency -> agency.getOrgId().equals(STREET_ID)).findFirst(); |
|
|
|
if (agencyOptional.isPresent()) { |
|
|
|
ScreenGovernRankDataDailyResultDTO agencyResult = agencyOptional.get(); |
|
|
|
Integer responseCount = agencyResult.getResponseCount() + agencyData.stream().filter(agency -> agency.getParentId().equals(STREET_ID)).mapToInt(ScreenGovernRankDataDailyResultDTO::getResponseCount).sum(); |
|
|
|
Integer transferCount = agencyResult.getTransferCount() + agencyData.stream().filter(agency -> agency.getParentId().equals(STREET_ID)).mapToInt(ScreenGovernRankDataDailyResultDTO::getTransferCount).sum(); |
|
|
|
agencyResult.setResponseCount(responseCount); |
|
|
|
agencyResult.setTransferCount(transferCount); |
|
|
|
} |
|
|
|
|
|
|
|
streetList.forEach(street -> { |
|
|
|
String streetId = street.getId().toString(); |
|
|
|
// 街道数据需要在本身基础上再加上社区的合计
|
|
|
|
Optional<ScreenGovernRankDataDailyResultDTO> agencyOptional = agencyData.stream().filter(agency -> agency.getOrgId().equals(streetId)).findFirst(); |
|
|
|
if (agencyOptional.isPresent()) { |
|
|
|
ScreenGovernRankDataDailyResultDTO agencyResult = agencyOptional.get(); |
|
|
|
Integer responseCount = agencyResult.getResponseCount() + agencyData.stream().filter(agency -> agency.getParentId().equals(streetId)).mapToInt(ScreenGovernRankDataDailyResultDTO::getResponseCount).sum(); |
|
|
|
Integer transferCount = agencyResult.getTransferCount() + agencyData.stream().filter(agency -> agency.getParentId().equals(streetId)).mapToInt(ScreenGovernRankDataDailyResultDTO::getTransferCount).sum(); |
|
|
|
agencyResult.setResponseCount(responseCount); |
|
|
|
agencyResult.setTransferCount(transferCount); |
|
|
|
} |
|
|
|
}); |
|
|
|
// 合并网格社区街道数据
|
|
|
|
data.addAll(agencyData); |
|
|
|
// 计算响应率
|
|
|
|