|
@ -1960,34 +1960,46 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
resultDTO.setTotal(idList.size()); |
|
|
resultDTO.setTotal(idList.size()); |
|
|
|
|
|
|
|
|
//3.查询截止日期用户、群组、话题、议题、项目、巡查数据
|
|
|
//3.查询截止日期用户、群组、话题、议题、项目、巡查数据
|
|
|
|
|
|
formDTO.setSourceType("end"); |
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> userEnd = dataStatsDao.regUserList(formDTO); |
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> userEnd = dataStatsDao.regUserList(formDTO); |
|
|
|
|
|
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> uEndMap = new HashMap<>(); |
|
|
|
|
|
userEnd.stream().forEach(u->uEndMap.put(u.getOrgId(),u)); |
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> groupEnd = dataStatsDao.groupList(formDTO); |
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> groupEnd = dataStatsDao.groupList(formDTO); |
|
|
|
|
|
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> gEndMap = new HashMap<>(); |
|
|
|
|
|
groupEnd.stream().forEach(u->gEndMap.put(u.getOrgId(),u)); |
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> topicEnd = dataStatsDao.topicList(formDTO); |
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> topicEnd = dataStatsDao.topicList(formDTO); |
|
|
|
|
|
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> tEndMap = new HashMap<>(); |
|
|
|
|
|
topicEnd.stream().forEach(u->tEndMap.put(u.getOrgId(),u)); |
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> issueEnd = dataStatsDao.issueList(formDTO); |
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> issueEnd = dataStatsDao.issueList(formDTO); |
|
|
|
|
|
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> iEndMap = new HashMap<>(); |
|
|
|
|
|
issueEnd.stream().forEach(u->iEndMap.put(u.getOrgId(),u)); |
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> projectEnd = dataStatsDao.projectList(formDTO); |
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> projectEnd = dataStatsDao.projectList(formDTO); |
|
|
|
|
|
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> pEndMap = new HashMap<>(); |
|
|
|
|
|
projectEnd.stream().forEach(u->pEndMap.put(u.getOrgId(),u)); |
|
|
//巡查数据不区分区间差值,只计算累计值,人员做去重处理且是有巡查记录的人员
|
|
|
//巡查数据不区分区间差值,只计算累计值,人员做去重处理且是有巡查记录的人员
|
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> patrolEnd = statsStaffPatrolRecordDailyService.patrolList(formDTO); |
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> patrolEnd = statsStaffPatrolRecordDailyService.patrolList(formDTO); |
|
|
|
|
|
|
|
|
//4.判断是否需要查询起始日期用户、群组、话题、议题、项目、巡查数据
|
|
|
//4.判断是否需要查询起始日期用户、群组、话题、议题、项目、巡查数据
|
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> userStart = new ArrayList<>(); |
|
|
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> uStartMap = new HashMap<>(); |
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> groupStart = new ArrayList<>(); |
|
|
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> gStartMap = new HashMap<>(); |
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> topicStart = new ArrayList<>(); |
|
|
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> tStartMap = new HashMap<>(); |
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> issueStart = new ArrayList<>(); |
|
|
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> iStartMap = new HashMap<>(); |
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> projectStart = new ArrayList<>(); |
|
|
HashMap<String, CustomerDataManageResultDTO.CustomerDataManage> pStartMap = new HashMap<>(); |
|
|
if ("Interval".equals(formDTO.getType())) { |
|
|
if ("Interval".equals(formDTO.getType())) { |
|
|
userStart = dataStatsDao.regUserList(formDTO); |
|
|
formDTO.setSourceType("start"); |
|
|
groupStart = dataStatsDao.groupList(formDTO); |
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> userStart = dataStatsDao.regUserList(formDTO); |
|
|
topicStart = dataStatsDao.topicList(formDTO); |
|
|
userStart.stream().forEach(u->uStartMap.put(u.getOrgId(),u)); |
|
|
issueStart = dataStatsDao.issueList(formDTO); |
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> groupStart = dataStatsDao.groupList(formDTO); |
|
|
projectStart = dataStatsDao.projectList(formDTO); |
|
|
groupStart.stream().forEach(u->gStartMap.put(u.getOrgId(),u)); |
|
|
|
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> topicStart = dataStatsDao.topicList(formDTO); |
|
|
|
|
|
topicStart.stream().forEach(u->tStartMap.put(u.getOrgId(),u)); |
|
|
|
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> issueStart = dataStatsDao.issueList(formDTO); |
|
|
|
|
|
issueStart.stream().forEach(u->iStartMap.put(u.getOrgId(),u)); |
|
|
|
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> projectStart = dataStatsDao.projectList(formDTO); |
|
|
|
|
|
projectStart.stream().forEach(u->pStartMap.put(u.getOrgId(),u)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//5.封装数据
|
|
|
//5.封装数据
|
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> finalUserStart = userStart; |
|
|
|
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> finalGroupStart = groupStart; |
|
|
|
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> finalTopicStart = topicStart; |
|
|
|
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> finalIssueStart = issueStart; |
|
|
|
|
|
List<CustomerDataManageResultDTO.CustomerDataManage> finalProjectStart = projectStart; |
|
|
|
|
|
agencyGrid.getAgencyGridList().forEach(org -> { |
|
|
agencyGrid.getAgencyGridList().forEach(org -> { |
|
|
CustomerDataManageResultDTO.CustomerDataManage dto = new CustomerDataManageResultDTO.CustomerDataManage(); |
|
|
CustomerDataManageResultDTO.CustomerDataManage dto = new CustomerDataManageResultDTO.CustomerDataManage(); |
|
|
dto.setOrgId(org.getOrgId()); |
|
|
dto.setOrgId(org.getOrgId()); |
|
@ -1995,75 +2007,45 @@ public class DataStatsServiceImpl implements DataStatsService { |
|
|
int user = 0; |
|
|
int user = 0; |
|
|
int resi = 0; |
|
|
int resi = 0; |
|
|
int part = 0; |
|
|
int part = 0; |
|
|
for (CustomerDataManageResultDTO.CustomerDataManage u : userEnd) { |
|
|
if(uEndMap.containsKey(org.getOrgId())){ |
|
|
if (org.getOrgId().equals(u.getOrgId())) { |
|
|
user = uEndMap.get(org.getOrgId()).getUserCount(); |
|
|
user = u.getUserCount(); |
|
|
resi = uEndMap.get(org.getOrgId()).getResidentCount(); |
|
|
resi = u.getResidentCount(); |
|
|
part = uEndMap.get(org.getOrgId()).getPartyMemberCount(); |
|
|
part = u.getPartyMemberCount(); |
|
|
if ("Interval".equals(formDTO.getType())&&uStartMap.containsKey(org.getOrgId())) { |
|
|
if ("Interval".equals(formDTO.getType())) { |
|
|
user = user - uStartMap.get(org.getOrgId()).getUserCount(); |
|
|
for (CustomerDataManageResultDTO.CustomerDataManage s : finalUserStart) { |
|
|
resi = resi - uStartMap.get(org.getOrgId()).getResidentCount(); |
|
|
if (u.getOrgId().equals(s.getOrgId())) { |
|
|
part = part - uStartMap.get(org.getOrgId()).getPartyMemberCount(); |
|
|
user = user - s.getUserCount(); |
|
|
|
|
|
resi = resi - s.getResidentCount(); |
|
|
|
|
|
part = part - s.getPartyMemberCount(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
int group = 0; |
|
|
int group = 0; |
|
|
for (CustomerDataManageResultDTO.CustomerDataManage u : groupEnd) { |
|
|
if(gEndMap.containsKey(org.getOrgId())){ |
|
|
if (org.getOrgId().equals(u.getOrgId())) { |
|
|
group = gEndMap.get(org.getOrgId()).getGroupCount(); |
|
|
group = u.getGroupCount(); |
|
|
if ("Interval".equals(formDTO.getType())&&gStartMap.containsKey(org.getOrgId())) { |
|
|
if ("Interval".equals(formDTO.getType())) { |
|
|
group = group - gStartMap.get(org.getOrgId()).getGroupCount(); |
|
|
for (CustomerDataManageResultDTO.CustomerDataManage s : finalGroupStart) { |
|
|
|
|
|
if (u.getOrgId().equals(s.getOrgId())) { |
|
|
|
|
|
group = group - s.getGroupCount(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
int topic = 0; |
|
|
int topic = 0; |
|
|
for (CustomerDataManageResultDTO.CustomerDataManage u : topicEnd) { |
|
|
if(tEndMap.containsKey(org.getOrgId())){ |
|
|
if (org.getOrgId().equals(u.getOrgId())) { |
|
|
topic = tEndMap.get(org.getOrgId()).getTopicCount(); |
|
|
topic = u.getTopicCount(); |
|
|
if ("Interval".equals(formDTO.getType())&&tStartMap.containsKey(org.getOrgId())) { |
|
|
if ("Interval".equals(formDTO.getType())) { |
|
|
topic = topic - tStartMap.get(org.getOrgId()).getTopicCount(); |
|
|
for (CustomerDataManageResultDTO.CustomerDataManage s : finalTopicStart) { |
|
|
|
|
|
if (u.getOrgId().equals(s.getOrgId())) { |
|
|
|
|
|
topic = topic - s.getTopicCount(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
int issue = 0; |
|
|
int issue = 0; |
|
|
for (CustomerDataManageResultDTO.CustomerDataManage u : issueEnd) { |
|
|
if(iEndMap.containsKey(org.getOrgId())){ |
|
|
if (org.getOrgId().equals(u.getOrgId())) { |
|
|
issue = iEndMap.get(org.getOrgId()).getIssueCount(); |
|
|
issue = u.getIssueCount(); |
|
|
if ("Interval".equals(formDTO.getType())&&iStartMap.containsKey(org.getOrgId())) { |
|
|
if ("Interval".equals(formDTO.getType())) { |
|
|
issue = issue - iStartMap.get(org.getOrgId()).getIssueCount(); |
|
|
for (CustomerDataManageResultDTO.CustomerDataManage s : finalIssueStart) { |
|
|
|
|
|
if (u.getOrgId().equals(s.getOrgId())) { |
|
|
|
|
|
issue = issue - s.getIssueCount(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
int project = 0; |
|
|
int project = 0; |
|
|
int closed = 0; |
|
|
int closed = 0; |
|
|
for (CustomerDataManageResultDTO.CustomerDataManage u : projectEnd) { |
|
|
if(pEndMap.containsKey(org.getOrgId())){ |
|
|
if (org.getOrgId().equals(u.getOrgId())) { |
|
|
project = pEndMap.get(org.getOrgId()).getProjectCount(); |
|
|
project = u.getProjectCount(); |
|
|
closed = pEndMap.get(org.getOrgId()).getClosedProjectCount(); |
|
|
closed = u.getClosedProjectCount(); |
|
|
if ("Interval".equals(formDTO.getType())&&pStartMap.containsKey(org.getOrgId())) { |
|
|
if ("Interval".equals(formDTO.getType())) { |
|
|
project = project - pStartMap.get(org.getOrgId()).getProjectCount(); |
|
|
for (CustomerDataManageResultDTO.CustomerDataManage s : finalProjectStart) { |
|
|
closed = closed - pStartMap.get(org.getOrgId()).getClosedProjectCount(); |
|
|
if (u.getOrgId().equals(s.getOrgId())) { |
|
|
|
|
|
project = project - s.getProjectCount(); |
|
|
|
|
|
closed = closed - s.getClosedProjectCount(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
int patro = 0; |
|
|
int patro = 0; |
|
|