| | |
| | | // 区县账号 找出code |
| | | districtsCodes = systemUserLevels2.stream().map(SystemUserLevel::getDistrictsCode).collect(Collectors.toList()); |
| | | }else { |
| | | districtsCodes.add("0"); |
| | | districtsCodes.add("-1"); |
| | | } |
| | | |
| | | List<SystemUserLevel> systemUserLevels3 = listBySystemUsers.stream().filter(e -> e.getLevel() == 3).collect(Collectors.toList()); |
| | |
| | | List<String> finalDistrictsCodes1 = districtsCodes; |
| | | streetIds = systemUserLevels3.stream().filter(e -> !finalDistrictsCodes1.contains(e.getDistrictsCode())).map(SystemUserLevel::getStreetId).collect(Collectors.toList()); |
| | | if(streetIds.isEmpty()){ |
| | | streetIds.add("0"); |
| | | streetIds.add("-1"); |
| | | } |
| | | }else { |
| | | streetIds.add("0"); |
| | | streetIds.add("-1"); |
| | | } |
| | | |
| | | List<SystemUserLevel> systemUserLevels4 = listBySystemUsers.stream().filter(e -> e.getLevel() == 4).collect(Collectors.toList()); |
| | |
| | | List<String> finalDistrictsCodes2 = districtsCodes; |
| | | communityIds = systemUserLevels4.stream().filter(e -> !finalStreetIds1.contains(e.getStreetId()) && !finalDistrictsCodes2.contains(e.getDistrictsCode())).map(SystemUserLevel::getCommunityId).collect(Collectors.toList()); |
| | | }else { |
| | | communityIds.add(0L); |
| | | communityIds.add(-1L); |
| | | } |
| | | List<String> finalDistrictsCodes = districtsCodes; |
| | | List<String> finalStreetIds = streetIds; |
| | |
| | | // 拥有的区县code |
| | | List<String> collect = systemUserLevels.stream().map(SystemUserLevel::getDistrictsCode).collect(Collectors.toList()); |
| | | if(collect.size()==0){ |
| | | collect.add("0"); |
| | | collect.add("-1"); |
| | | } |
| | | // 找出这个区县的 |
| | | List<BcRegion> list = bcRegionService.list(new LambdaQueryWrapper<BcRegion>().eq(BcRegion::getParentId, 510400).in(BcRegion::getRegionCode, collect)); |
| | |
| | | List<SystemUserLevel> systemUserLevels1 = listBySystemUsers.stream().filter(e -> e.getLevel() == 3 && !collect.contains(e.getDistrictsCode())).collect(Collectors.toList()); |
| | | List<String> collect1 = systemUserLevels1.stream().map(SystemUserLevel::getStreetId).collect(Collectors.toList()); |
| | | if(collect1.size()==0){ |
| | | collect1.add("0"); |
| | | collect1.add("-1"); |
| | | } |
| | | |
| | | // 区县街道 |
| | |
| | | List<SystemUserLevel> systemUserLevels2 = listBySystemUsers.stream().filter(e -> e.getLevel() == 4 && !collect.contains(e.getDistrictsCode()) && !collect1.contains(e.getStreetId())).collect(Collectors.toList()); |
| | | List<Long> collect2 = systemUserLevels2.stream().map(SystemUserLevel::getCommunityId).collect(Collectors.toList()); |
| | | if(collect2.size()==0){ |
| | | collect2.add(0l); |
| | | collect2.add(-1l); |
| | | } |
| | | |
| | | // 区县社区 |
| | |
| | | List<RegionVO> dispatchVOList = new ArrayList<>(); |
| | | for (BcRegion bcRegion : list1) { |
| | | RegionVO regionVO = new RegionVO(); |
| | | regionVO.setTier(1); |
| | | regionVO.setTier(2); |
| | | regionVO.setId(bcRegion.getRegionCode()); |
| | | regionVO.setName(bcRegion.getRegionName()); |
| | | List<RegionVO> dispatchVOList1 = new ArrayList<>(); |
| | |
| | | for (ComStreet street : collect) { |
| | | List<RegionVO> dispatchVOList2 = new ArrayList<>(); |
| | | RegionVO regionVO1 = new RegionVO(); |
| | | regionVO1.setTier(2); |
| | | regionVO1.setTier(3); |
| | | regionVO1.setId(street.getStreetId()); |
| | | regionVO1.setName(street.getName()); |
| | | List<ComAct> collect1 = list2.stream().filter(e -> e.getStreetId().toString().equals(street.getStreetId())).collect(Collectors.toList()); |
| | | for (ComAct comAct : collect1) { |
| | | RegionVO regionVO2 = new RegionVO(); |
| | | regionVO2.setTier(3); |
| | | regionVO2.setTier(4); |
| | | regionVO2.setId(comAct.getCommunityId().toString()); |
| | | regionVO2.setName(comAct.getName()); |
| | | dispatchVOList2.add(regionVO2); |
| | |
| | | // 党员审核 |
| | | case 9: |
| | | if(opLog.operatorCategory().contains("诉求导出")){ |
| | | sysLog.setOperatorCategory(opLog.operatorCategory()); |
| | | sysLog.setOperatorName(opLog.operatorCategory()); |
| | | }else { |
| | | JSONObject auditData = jsonResult.getJSONObject("data"); |
| | |
| | | @Param("accountLevel") Integer accountLevel, @Param("targetId") Long targetId); |
| | | |
| | | List<Complaint> queryCompliantList(@Param("targetId") Long targetId, @Param("accountLevel") Integer accountLevel, @Param("loginUserInfo") LoginUserInfoVO loginUserInfo, @Param("query")AppStaticsQuery query); |
| | | |
| | | List<Complaint> getStatusForList(@Param("ids") List<Long> ids); |
| | | |
| | | |
| | | } |
| | |
| | | } else { |
| | | lastYearMonth = LocalDate.now().minusMonths(1).getYear() + "-" + LocalDate.now().minusMonths(1).getMonth().getValue(); |
| | | } |
| | | |
| | | |
| | | // 要根据驳回表来改状态 |
| | | List<Long> ids = complaints.stream().map(Complaint::getId).collect(Collectors.toList()); |
| | | complaints = this.baseMapper.getStatusForList(ids); |
| | | AnalyticStatisticsOneVo vo = new AnalyticStatisticsOneVo(); |
| | | |
| | | // 诉求单量总计 |
| | |
| | | BigDecimal lastMonthAverageTime1 = BigDecimal.valueOf(lastMonthAverageTime).setScale(2, RoundingMode.HALF_UP); |
| | | |
| | | vo.setLastMonthCompareAverageTime( new BigDecimal(vo.getThisMonthAverageTime()).subtract(lastMonthAverageTime1).setScale(2,RoundingMode.HALF_UP).doubleValue()); |
| | | }else { |
| | | vo.setLastMonthCompareAverageTime( new BigDecimal(vo.getThisMonthAverageTime()).setScale(2,RoundingMode.HALF_UP).doubleValue()); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | return vo; |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | String time = "2022-02-02 - 2023-02-02"; |
| | |
| | | // 近7天数据 |
| | | complaints = complaints.stream().filter(e -> e.getCreateTime().getTime() <= new Date().getTime() && e.getCreateTime().getTime() >= parse.getTime()).collect(Collectors.toList()); |
| | | |
| | | for (int i = 6; i > 0; i--) { |
| | | 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()); |
| | |
| | | long count3 = complaints.stream().filter(e -> e.getCommentRate() != null && e.getCommentRate() == 3).count(); |
| | | vo.setGreatSatisfactionNum((int) count3); |
| | | if (complaints.size() > 0) { |
| | | vo.setDissatisfactionRate(BigDecimal.valueOf(count).divide(BigDecimal.valueOf(complaints.size()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).doubleValue()); |
| | | vo.setGeneralSatisfactionRate(BigDecimal.valueOf(count1).divide(BigDecimal.valueOf(complaints.size()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).doubleValue()); |
| | | vo.setSatisfactionRate(BigDecimal.valueOf(count2).divide(BigDecimal.valueOf(complaints.size()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).doubleValue()); |
| | | vo.setGreatSatisfactionRate(BigDecimal.valueOf(count3).divide(BigDecimal.valueOf(complaints.size()), 2, RoundingMode.HALF_UP).multiply(new BigDecimal("100")).doubleValue()); |
| | | vo.setDissatisfactionRate(BigDecimal.valueOf(count).divide(BigDecimal.valueOf(complaints.size()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2,RoundingMode.HALF_UP).doubleValue()); |
| | | vo.setGeneralSatisfactionRate(BigDecimal.valueOf(count1).divide(BigDecimal.valueOf(complaints.size()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2,RoundingMode.HALF_UP).doubleValue()); |
| | | vo.setSatisfactionRate(BigDecimal.valueOf(count2).divide(BigDecimal.valueOf(complaints.size()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2,RoundingMode.HALF_UP).doubleValue()); |
| | | vo.setGreatSatisfactionRate(BigDecimal.valueOf(count3).divide(BigDecimal.valueOf(complaints.size()),4,RoundingMode.HALF_UP).multiply(new BigDecimal("100")).setScale(2,RoundingMode.HALF_UP).doubleValue()); |
| | | } |
| | | return vo; |
| | | } |
| | |
| | | </where> |
| | | ORDER BY sc.create_time DESC |
| | | </select> |
| | | |
| | | <select id="getStatusForList" resultType="com.panzhihua.sangeshenbian.model.entity.Complaint"> |
| | | select sc.id, |
| | | sc.serial_number, |
| | | sc.time, |
| | | sc.problem_type, |
| | | sc.name, |
| | | sc.contact_number, |
| | | sc.location, |
| | | sc.detailed_address, |
| | | sc.description_title, |
| | | sc.description_content, |
| | | sc.images, |
| | | sc.videos, |
| | | CASE |
| | | WHEN sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 7 |
| | | WHEN sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0 THEN 5 |
| | | WHEN sc.status = 0 and scar.audit_status = 2 THEN 6 |
| | | ELSE sc.status |
| | | END AS status, |
| | | sc.superior_type, |
| | | sc.superior_id, |
| | | sc.report_user_name, |
| | | sc.report_user_phone, |
| | | sc.report_type, |
| | | sc.voice_file, |
| | | sc.city_code, |
| | | sc.districts_code, |
| | | sc.street_id, |
| | | sc.community_id, |
| | | sc.party_member_id, |
| | | sc.create_time, |
| | | sc.create_by, |
| | | sc.update_time, |
| | | sc.update_by, |
| | | sc.completion_description, |
| | | sc.completion_images, |
| | | sc.completion_videos, |
| | | sc.completion_other_description, |
| | | sc.completion_time, |
| | | sc.completion_user_id, |
| | | sc.completion_username, |
| | | sc.completion_user_phone, |
| | | sc.closing_time, |
| | | sc.over_time_days, |
| | | sc.longitude, |
| | | sc.latitude, |
| | | sc.completion_user_level, |
| | | sc.handling_day, |
| | | sc.comment_rate |
| | | FROM sgsb_complaint sc |
| | | LEFT JOIN sgsb_complaint_audit_record scar ON scar.complaint_id = sc.id |
| | | where scar.audit_status!=1 and sc.id in |
| | | <foreach item="item" collection="ids" index="index" close=")" open="(" separator=","> |
| | | #{item} |
| | | </foreach> |
| | | |
| | | </select> |
| | | </mapper> |