|
|
|
@ -7,10 +7,7 @@ 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.analysis.pc.screen.form.ScreenJobFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.analysis.pc.screen.result.ScreenAgencyGovernDailyResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.analysis.pc.screen.result.ScreenGovernRankDataDailyResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.analysis.pc.screen.result.ScreenGovernanceResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.analysis.pc.screen.result.ScreenGridGovernDailyResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.analysis.pc.screen.result.*; |
|
|
|
import com.elink.esua.epdc.modules.screen.dao.ScreenGovernanceDao; |
|
|
|
import com.elink.esua.epdc.modules.screen.service.ScreenGovernanceService; |
|
|
|
import com.elink.esua.epdc.utils.EpmetUtils; |
|
|
|
@ -50,6 +47,16 @@ public class ScreenGovernanceServiceImpl extends BaseServiceImpl<ScreenGovernanc |
|
|
|
List<ScreenGovernRankDataDailyResultDTO> agencyData = baseDao.governrankdatadailyAgency(); |
|
|
|
List<ScreenGovernRankDataDailyResultDTO> noRespData = baseDao.governrankdatadailyNoResp(); |
|
|
|
List<SysDeptDTO> streetList = baseDao.getStreetList(); |
|
|
|
// 保存每个社区和街道的项目总数用于将来的占比统计
|
|
|
|
List<ScreenGovernItemInfoResultDTO> agencyItemInfoList = baseDao.getAgencyItemInfoList(); |
|
|
|
int itemTotal = agencyItemInfoList.stream().mapToInt(ScreenGovernItemInfoResultDTO::getItemTotal).sum(); |
|
|
|
int itemSettleTotal = agencyItemInfoList.stream().mapToInt(ScreenGovernItemInfoResultDTO::getItemSettleTotal).sum(); |
|
|
|
agencyItemInfoList.forEach(item -> { |
|
|
|
if (!"grid_party".equals(item.getTypeKey())) { |
|
|
|
item.setItemTotal(itemTotal); |
|
|
|
item.setItemSettleTotal(itemSettleTotal); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
// 处理未响应和项目转入次数
|
|
|
|
noRespHandle(data, noRespData); |
|
|
|
@ -62,6 +69,10 @@ public class ScreenGovernanceServiceImpl extends BaseServiceImpl<ScreenGovernanc |
|
|
|
ScreenGovernRankDataDailyResultDTO agencyResult = agencyOptional.get(); |
|
|
|
agencyResult.setResponseCount(agencyResult.getResponseCount() + item.getResponseCount()); |
|
|
|
agencyResult.setTransferCount(agencyResult.getTransferCount() + item.getTransferCount()); |
|
|
|
agencyResult.setResolvedCount(agencyResult.getResolvedCount() + item.getResolvedCount()); |
|
|
|
agencyResult.setClosedCount(agencyResult.getClosedCount() + item.getResolvedCount()); |
|
|
|
agencyResult.setGovernCount(agencyResult.getGovernCount() + item.getGovernCount()); |
|
|
|
agencyResult.setSatisfactionCount(agencyResult.getSatisfactionCount() + item.getSatisfactionCount()); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
@ -73,8 +84,17 @@ public class ScreenGovernanceServiceImpl extends BaseServiceImpl<ScreenGovernanc |
|
|
|
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(); |
|
|
|
Integer resolvedCount = agencyResult.getResolvedCount() + agencyData.stream().filter(agency -> agency.getParentId().equals(streetId)).mapToInt(ScreenGovernRankDataDailyResultDTO::getResolvedCount).sum(); |
|
|
|
Integer closedCount = agencyResult.getClosedCount() + agencyData.stream().filter(agency -> agency.getParentId().equals(streetId)).mapToInt(ScreenGovernRankDataDailyResultDTO::getClosedCount).sum(); |
|
|
|
Integer governCount = agencyResult.getGovernCount() + agencyData.stream().filter(agency -> agency.getParentId().equals(streetId)).mapToInt(ScreenGovernRankDataDailyResultDTO::getGovernCount).sum(); |
|
|
|
Integer satisfactionCount = agencyResult.getSatisfactionCount() + agencyData.stream().filter(agency -> agency.getParentId().equals(streetId)).mapToInt(ScreenGovernRankDataDailyResultDTO::getSatisfactionCount).sum(); |
|
|
|
agencyResult.setResponseCount(responseCount); |
|
|
|
agencyResult.setResponseCount(responseCount); |
|
|
|
agencyResult.setTransferCount(transferCount); |
|
|
|
agencyResult.setResolvedCount(resolvedCount); |
|
|
|
agencyResult.setClosedCount(closedCount); |
|
|
|
agencyResult.setGovernCount(governCount); |
|
|
|
agencyResult.setSatisfactionCount(satisfactionCount); |
|
|
|
} |
|
|
|
}); |
|
|
|
// 合并网格社区街道数据
|
|
|
|
@ -87,6 +107,22 @@ public class ScreenGovernanceServiceImpl extends BaseServiceImpl<ScreenGovernanc |
|
|
|
DecimalFormat df = new DecimalFormat("0.0000"); |
|
|
|
item.setResponseRatio(df.format((float) item.getResponseCount() / item.getTransferCount())); |
|
|
|
} |
|
|
|
if ("agency".equals(item.getOrgType())) { |
|
|
|
int itemTotalNum = agencyItemInfoList.stream().filter(agency -> agency.getOrgId().equals(item.getOrgId())).findFirst().get().getItemTotal(); |
|
|
|
int itemSettleNum = agencyItemInfoList.stream().filter(agency -> agency.getOrgId().equals(item.getOrgId())).findFirst().get().getItemSettleTotal(); |
|
|
|
if (itemTotal != 0) { |
|
|
|
DecimalFormat df = new DecimalFormat("0.0000"); |
|
|
|
if (item.getGovernCount() != 0) { |
|
|
|
item.setGovernRatio(df.format((float) item.getGovernCount() / itemTotalNum)); |
|
|
|
} |
|
|
|
if (item.getResolvedCount() != 0) { |
|
|
|
item.setResolvedRatio(df.format((float) item.getResolvedCount() / itemTotalNum)); |
|
|
|
} |
|
|
|
if (itemSettleNum != 0 && item.getSatisfactionCount() != 0) { |
|
|
|
item.setSatisfactionRatio(df.format((float) item.getSatisfactionCount() / itemSettleNum)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|