| | |
| | | SystemUser systemUser = identityInformationVO.getSystemUser(); |
| | | Integer identity = identityInformationVO.getIdentity(); |
| | | if (identity == 2) { |
| | | loginUserInfoVO.setUserId(Long.valueOf(systemUser.getId())); |
| | | accountLevel = systemUser.getAccountLevel(); |
| | | switch (accountLevel) { |
| | | case 2: |
| | |
| | | complaint.setDistrictsCode(Integer.valueOf(systemUser.getDistrictsCode())); |
| | | complaint.setReportUserName(systemUser.getName()); |
| | | complaint.setReportUserPhone(systemUser.getPhone()); |
| | | |
| | | |
| | | complaint.setSuperiorId(Long.valueOf(systemUser.getDistrictsCode())); |
| | | break; |
| | | case 3: |
| | |
| | | if (systemUserByPhone.isPresent() && null != identity && identity == 2) { |
| | | systemUser = systemUserByPhone.get(); |
| | | accountLevel = systemUser.getAccountLevel(); |
| | | query.setUserId(Long.valueOf(systemUser.getId())); |
| | | switch (accountLevel) { |
| | | case 2: |
| | | //区县级 |
| | |
| | | } |
| | | }else if (detail.getStatus() != 3 && detail.getStatus() != 8 && detail.getFirstStatus() == 0 && detail.getNowLevel()==2) { |
| | | detail.setStatus(5); |
| | | }else if(detail.getStatus()==3 || detail.getStatus()==8){ |
| | | detail.setStatus(detail.getStatus()); |
| | | }else { |
| | | detail.setStatus(0); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | }else if (detail.getStatus() != 3 && detail.getStatus() != 8 && detail.getFirstStatus() == 0 && detail.getNowLevel()==3) { |
| | | detail.setStatus(5); |
| | | }else if(detail.getStatus()==3 || detail.getStatus()==8){ |
| | | detail.setStatus(detail.getStatus()); |
| | | }else { |
| | | detail.setStatus(0); |
| | | } |
| | | |
| | | |
| | | } |
| | | if (systemUser.getAccountLevel() == 4) { |
| | | if (detail.getStatus() != 3 && detail.getStatus() != 8 && detail.getNowLevel() == 4 && detail.getAssignStatus() == 0 && ((one != null && one.getAuditStatus() == 1)||(one != null && one.getAuditStatus() == 3) || one==null )) { |
| | |
| | | } |
| | | }else if (detail.getStatus() != 3 && detail.getStatus() != 8 && detail.getFirstStatus() == 0 && detail.getNowLevel()==4) { |
| | | detail.setStatus(5); |
| | | }else if(detail.getStatus()==3 || detail.getStatus()==8){ |
| | | detail.setStatus(detail.getStatus()); |
| | | }else { |
| | | detail.setStatus(0); |
| | | } |
| | | |
| | | |
| | | } |
| | | } else { |
| | | if (detail.getFirstStatus() == 1 && detail.getStatus() != 3 && detail.getStatus() != 8) { |
| | |
| | | // 诉求单量总计 |
| | | vo.setAllTotal(complaints.size()); |
| | | // 诉求单量本月 |
| | | int thisMonthTotal = (int) complaints.stream().filter(e -> simpleDateFormat.format(e.getCreateTime()).contains(nowYearMonth)).count(); |
| | | int thisMonthTotal = (int) complaints.stream().filter(e -> simpleDateFormat.format(e.getTime()).contains(nowYearMonth)).count(); |
| | | vo.setThisMonthTotal(thisMonthTotal); |
| | | |
| | | // 诉求单量同比上月 |
| | | int lastMonthTotal = (int) complaints.stream().filter(e -> simpleDateFormat.format(e.getCreateTime()).contains(lastYearMonth)).count(); |
| | | int lastMonthTotal = (int) complaints.stream().filter(e -> simpleDateFormat.format(e.getTime()).contains(lastYearMonth)).count(); |
| | | vo.setLastMonthCompareTotal(thisMonthTotal - lastMonthTotal); |
| | | |
| | | // 正在办理 |
| | |
| | | vo.setOvertimeTransactTotal(overtimeComplaints.size()); |
| | | |
| | | // 超时办理本月 |
| | | int thisMonthOvertimeTransactTotal = (int) overtimeComplaints.stream().filter(e -> simpleDateFormat.format(e.getCreateTime()).contains(nowYearMonth)).count(); |
| | | int thisMonthOvertimeTransactTotal = (int) overtimeComplaints.stream().filter(e -> simpleDateFormat.format(e.getTime()).contains(nowYearMonth)).count(); |
| | | vo.setThisMonthOvertimeTransactTotal(thisMonthOvertimeTransactTotal); |
| | | |
| | | // 超时办理同比上月 |
| | | int lastMonthOvertimeTransactTotal = (int) overtimeComplaints.stream().filter(e -> simpleDateFormat.format(e.getCreateTime()).contains(lastYearMonth)).count(); |
| | | int lastMonthOvertimeTransactTotal = (int) overtimeComplaints.stream().filter(e -> simpleDateFormat.format(e.getTime()).contains(lastYearMonth)).count(); |
| | | vo.setLastMonthOvertimeTransactCompareTotal(thisMonthOvertimeTransactTotal - lastMonthOvertimeTransactTotal); |
| | | |
| | | // 平均处理时长 |
| | |
| | | averageDay = BigDecimal.valueOf(averageDay).setScale(2, RoundingMode.HALF_UP).doubleValue(); |
| | | vo.setAverageTime(averageDay); |
| | | |
| | | List<Complaint> thisMonthAverageTimeComplaints = complaints.stream().filter(e -> simpleDateFormat.format(e.getCreateTime()).contains(nowYearMonth)).collect(Collectors.toList()); |
| | | List<Complaint> thisMonthAverageTimeComplaints = complaints.stream().filter(e -> simpleDateFormat.format(e.getTime()).contains(nowYearMonth)).collect(Collectors.toList()); |
| | | if (thisMonthAverageTimeComplaints.size() > 0) { |
| | | double thisMonthAverageTime = thisMonthAverageTimeComplaints.stream().mapToDouble(v -> v.getHandlingDay() == null ? 0 : v.getHandlingDay()).average().getAsDouble(); |
| | | thisMonthAverageTime = BigDecimal.valueOf(thisMonthAverageTime).setScale(2, RoundingMode.HALF_UP).doubleValue(); |
| | | vo.setThisMonthAverageTime(thisMonthAverageTime); |
| | | } |
| | | List<Complaint> lastMonthAverageTimeComplaints = complaints.stream().filter(e -> simpleDateFormat.format(e.getCreateTime()).contains(lastYearMonth)).collect(Collectors.toList()); |
| | | List<Complaint> lastMonthAverageTimeComplaints = complaints.stream().filter(e -> simpleDateFormat.format(e.getTime()).contains(lastYearMonth)).collect(Collectors.toList()); |
| | | if (lastMonthAverageTimeComplaints.size() > 0) { |
| | | double lastMonthAverageTime = lastMonthAverageTimeComplaints.stream().mapToDouble(v -> v.getHandlingDay() == null ? 0 : v.getHandlingDay()).average().getAsDouble(); |
| | | BigDecimal lastMonthAverageTime1 = BigDecimal.valueOf(lastMonthAverageTime).setScale(2, RoundingMode.HALF_UP); |
| | |
| | | BigDecimal multiply = BigDecimal.valueOf(count).divide(new BigDecimal(size), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")); |
| | | vo.setSatisfactionRate(multiply.doubleValue()); |
| | | |
| | | List<Complaint> nowMonth = commentRateComplaints.stream().filter(e -> simpleDateFormat.format(e.getCreateTime()).contains(nowYearMonth)).collect(Collectors.toList()); |
| | | List<Complaint> nowMonth = commentRateComplaints.stream().filter(e -> simpleDateFormat.format(e.getTime()).contains(nowYearMonth)).collect(Collectors.toList()); |
| | | // 当月满意 |
| | | long count1 = nowMonth.stream().filter(e -> e.getCommentRate() > 1).count(); |
| | | // 当月的评价数 |
| | |
| | | vo.setThisMonthSatisfactionRate(multiply1.doubleValue()); |
| | | } |
| | | |
| | | List<Complaint> lastMonth = commentRateComplaints.stream().filter(e -> simpleDateFormat.format(e.getCreateTime()).contains(lastYearMonth)).collect(Collectors.toList()); |
| | | List<Complaint> lastMonth = commentRateComplaints.stream().filter(e -> simpleDateFormat.format(e.getTime()).contains(lastYearMonth)).collect(Collectors.toList()); |
| | | // 当月满意 |
| | | long count2 = lastMonth.stream().filter(e -> e.getCommentRate() > 1).count(); |
| | | // 当月的评价数 |
| | |
| | | String[] split = time.split(" - "); |
| | | Date parse = simpleDateFormat.parse(split[0] + " 00:00:00"); |
| | | Date parse1 = simpleDateFormat.parse(split[1] + " 23:59:59"); |
| | | complaints = complaints.stream().filter(e -> e.getCreateTime().getTime() <= parse1.getTime() && e.getCreateTime().getTime() >= parse.getTime()).collect(Collectors.toList()); |
| | | complaints = complaints.stream().filter(e -> e.getTime().getTime() <= parse1.getTime() && e.getTime().getTime() >= parse.getTime()).collect(Collectors.toList()); |
| | | int day = DateUtils.getDay(parse, parse1); |
| | | |
| | | if (day > 30) { |
| | |
| | | for (int i = 0; i <= day; i++) { |
| | | AnalyticStatisticsTwoVo analyticStatisticsTwoVo = new AnalyticStatisticsTwoVo(); |
| | | if (i == 0) { |
| | | List<Complaint> collect = complaints.stream().filter(e -> simpleDateFormat.format(e.getCreateTime()).contains(split[0])).collect(Collectors.toList()); |
| | | List<Complaint> collect = complaints.stream().filter(e -> simpleDateFormat.format(e.getTime()).contains(split[0])).collect(Collectors.toList()); |
| | | analyticStatisticsTwoVo.setTime(split[0]); |
| | | analyticStatisticsTwoVo.setAllTotal(collect.size()); |
| | | int count = (int) collect.stream().filter(e -> e.getStatus() == 3).count(); |
| | |
| | | list.add(analyticStatisticsTwoVo); |
| | | } else { |
| | | String nextDay = DateUtils.getNextDay(parse, i); |
| | | List<Complaint> collect = complaints.stream().filter(e -> simpleDateFormat.format(e.getCreateTime()).contains(nextDay)).collect(Collectors.toList()); |
| | | List<Complaint> collect = complaints.stream().filter(e -> simpleDateFormat.format(e.getTime()).contains(nextDay)).collect(Collectors.toList()); |
| | | analyticStatisticsTwoVo.setTime(nextDay); |
| | | analyticStatisticsTwoVo.setAllTotal(collect.size()); |
| | | int count = (int) collect.stream().filter(e -> e.getStatus() == 3).count(); |
| | |
| | | time = DateUtils.getBeforeDay(6) + " 00:00:00"; |
| | | Date parse = simpleDateFormat.parse(time); |
| | | // 近7天数据 |
| | | complaints = complaints.stream().filter(e -> e.getCreateTime().getTime() <= new Date().getTime() && e.getCreateTime().getTime() >= parse.getTime()).collect(Collectors.toList()); |
| | | complaints = complaints.stream().filter(e -> e.getTime().getTime() <= new Date().getTime() && e.getTime().getTime() >= parse.getTime()).collect(Collectors.toList()); |
| | | |
| | | for (int i = 6; i >= 0; i--) { |
| | | // 获取前7天的时间 |
| | | String day = DateUtils.getBeforeDay(i); |
| | | List<Complaint> complaintList = complaints.stream().filter(e -> simpleDateFormat.format(e.getCreateTime()).contains(day)).collect(Collectors.toList()); |
| | | List<Complaint> complaintList = complaints.stream().filter(e -> simpleDateFormat.format(e.getTime()).contains(day)).collect(Collectors.toList()); |
| | | AnalyticStatisticsTwoVo analyticStatisticsTwoVo = new AnalyticStatisticsTwoVo(); |
| | | analyticStatisticsTwoVo.setTime(day); |
| | | analyticStatisticsTwoVo.setAllTotal(complaintList.size()); |
| | |
| | | |
| | | @Override |
| | | public List<AnalyticStatisticsThreeVo> analyticStatisticsThree(Integer rank, List<Complaint> complaints) { |
| | | Map<String, List<Complaint>> groupedByProblemType = complaints.stream() |
| | | Map<String, List<Complaint>> groupedByProblemType = complaints.stream().filter(e->e.getProblemType()!=null) |
| | | .collect(Collectors.groupingBy(Complaint::getProblemType)); |
| | | List<AnalyticStatisticsThreeVo> analyticStatisticsThreeVos = groupedByProblemType.entrySet().stream() |
| | | .map(entry -> { |
| | |
| | | complaint.setSuperiorId(systemUser.getCommunityId()); |
| | | break; |
| | | } |
| | | |
| | | complaint.setCreateBy(Long.valueOf(systemUser.getId())); |
| | | complaint.setReportType(accountLevel); |
| | | complaint.setNowLevel(accountLevel); |
| | | complaint.setLastLevel(accountLevel); |
| | |
| | | String code = null; |
| | | switch (accountLevel) { |
| | | case 2: |
| | | code ="510403"; |
| | | break; |
| | | case 3: |
| | | code =systemUser.getStreetId(); |