springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/AnalyticStatisticsController.java
@@ -72,15 +72,16 @@ } wrapper.eq(Complaint::getSuperiorId, query.getDistrictCode()); } if(query.getStreetId()!=null){ if(query.getStreetId()!=null && query.getCommunityId()==null){ // 获取街道上一级查看是否有上级权限 ComStreet comStreet = comStreetService.getById(query.getStreetId()); if(comStreet==null){ throw new ServiceException("没有该街道权限"); } // 没有市级 上级区县 本级街道权限 if(accountLevel==2 || (accountLevel==3 && systemUser.getDistrictsCode().equals(query.getDistrictCode().toString()))){ wrapper.eq(Complaint::getSuperiorId, query.getStreetId()); if(accountLevel==2 || (accountLevel==3 && systemUser.getStreetId().equals(query.getStreetId().toString()))){ List<Long> collect = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, comStreet.getStreetId())).stream().map(ComAct::getCommunityId).collect(Collectors.toList()); wrapper.eq(Complaint::getSuperiorId, query.getStreetId()).or().eq(Complaint::getLastSuperiorId,query.getStreetId()).or(w->w.in(Complaint::getSuperiorId,collect).eq(Complaint::getNowLevel,4)).or(w->w.in(Complaint::getLastSuperiorId,collect).eq(Complaint::getLastLevel,4)); }else { throw new ServiceException("没有该街道权限"); } @@ -94,7 +95,7 @@ } // 判断是否有上面的4个权限 if(accountLevel==2 || (accountLevel==3 && systemUser.getDistrictsCode().equals(comAct.getStreetId().toString()) || accountLevel==4 && systemUser.getCommunityId().equals(comAct.getCommunityId()))){ if(accountLevel==2 || (accountLevel==3 && systemUser.getStreetId().equals(comAct.getStreetId().toString()) || accountLevel==4 && systemUser.getCommunityId().equals(comAct.getCommunityId()))){ wrapper.eq(Complaint::getSuperiorId, query.getCommunityId()); }else { throw new ServiceException("没有该社区权限"); @@ -105,15 +106,15 @@ if(query.getCityCode()==null && query.getDistrictCode()==null && query.getStreetId()==null && query.getCommunityId()==null){ if(systemUser.getSystemRoleId()==1 || systemUser.getSystemRoleId()==2){ if(systemUser.getSystemRoleId()==1){ wrapper.ne(Complaint::getProblemType,"纪委").or(w->w.isNull(Complaint::getProblemType)); wrapper.and(w->w.ne(Complaint::getProblemType,"检举控告").or().isNull(Complaint::getProblemType)); } if(accountLevel==3){ String streetId = systemUser.getStreetId(); List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, streetId)).stream().map(ComAct::getCommunityId).collect(Collectors.toList()); wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()).or(wrapper1 ->wrapper1.in(Complaint::getSuperiorId,ids).eq(Complaint::getNowLevel,4)); wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()).eq(Complaint::getSuperiorId,streetId).or(wrapper1 ->wrapper1.in(Complaint::getSuperiorId,ids).eq(Complaint::getNowLevel,4)); } if(accountLevel==4){ wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()); wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()).eq(Complaint::getSuperiorId,systemUser.getCommunityId()); } }else { wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()) springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/DepartmentController.java
@@ -108,6 +108,15 @@ return R.ok(new ArrayList<>()); } level=loginUserInfoWest.getAccountLevel(); if(level==2){ code="510403"; } if(level==3){ code = loginUserInfoWest.getStreetId(); } if(level==4){ code = loginUserInfoWest.getCommunityId().toString(); } type=2; } List<Department> list4=new ArrayList<>(); @@ -116,15 +125,15 @@ }else if(level==2 && type==2){ list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).ge( Department::getTier, 2)); }else if(level==3 && type==1){ list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 3).eq(Department::getStreetId, loginUserInfoWest.getStreetId())); list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 3).eq(Department::getStreetId, code)); }else if(level==3 && type==2){ List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, loginUserInfoWest.getStreetId())).stream().map(ComAct::getCommunityId).collect(Collectors.toList()); list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 3).eq(Department::getStreetId, loginUserInfoWest.getStreetId()) List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, code)).stream().map(ComAct::getCommunityId).collect(Collectors.toList()); list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 3).eq(Department::getStreetId, code) .or(w->w.eq(Department::getTier,4).in(Department::getCommunityId,ids))); }else if(level==4 && type==1){ list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 4).eq(Department::getCommunityId,loginUserInfoWest.getCommunityId())); list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq( Department::getTier, 4).eq(Department::getCommunityId,code)); }else if(level==4 && type==2){ list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq(Department::getTier, 4).eq(Department::getCommunityId,loginUserInfoWest.getCommunityId())); list4 = departmentService.list(new LambdaQueryWrapper<Department>().like(StringUtils.isNotEmpty(name), Department::getName, name).eq(Department::getTier, 4).eq(Department::getCommunityId,code)); } return R.ok(list4); springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/MgtComplaintController.java
@@ -362,4 +362,17 @@ } @DeleteMapping("/delete/{id}") @ApiOperation(value = "删除诉求") public R<?> delete(@PathVariable("id") Long id) { SystemUserVo loginUserInfoWest = getLoginUserInfoWest(); if (loginUserInfoWest.getSystemRoleId()>2) { return R.fail("无权限"); } complaintService.removeById(id); return R.ok(); } } springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/api/SystemUserController.java
@@ -183,6 +183,8 @@ tokenVo.setCommunityId(systemUser.getCommunityId().toString()); break; } tokenVo.setOneDepartmentId(systemUser.getOneDepartmentId()); tokenVo.setSystemRoleId(systemUser.getSystemRoleId()); return R.ok(tokenVo); } @@ -205,7 +207,7 @@ public R<IPage<SystemUserListVo>> list(SystemUserList query){ Integer id = this.getLoginUserInfoWest().getId(); SystemUser user = systemUserService.getById(id); if(user.getSystemRoleId()!=1){ if(user.getSystemRoleId()>2){ return R.ok(new Page<>()); } IPage<SystemUserListVo> list = systemUserService.list(user, query); springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/controller/StaticsController.java
@@ -100,18 +100,20 @@ } wrapper.eq(Complaint::getSuperiorId, query.getDistrictCode()); } if(query.getStreetId()!=null){ if(query.getStreetId()!=null && query.getCommunityId()==null){ // 获取街道上一级查看是否有上级权限 ComStreet comStreet = comStreetService.getById(query.getStreetId()); if(comStreet==null){ throw new ServiceException("没有该街道权限"); } // 没有市级 上级区县 本级街道权限 if(accountLevel==2 || (accountLevel==3 && systemUser.getDistrictsCode().equals(query.getDistrictCode().toString()))){ wrapper.eq(Complaint::getSuperiorId, query.getStreetId()); if(accountLevel==2 || (accountLevel==3 && systemUser.getStreetId().equals(query.getStreetId().toString()))){ List<Long> collect = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, comStreet.getStreetId())).stream().map(ComAct::getCommunityId).collect(Collectors.toList()); wrapper.eq(Complaint::getSuperiorId, query.getStreetId()).or().eq(Complaint::getLastSuperiorId,query.getStreetId()).or(w->w.in(Complaint::getSuperiorId,collect).eq(Complaint::getNowLevel,4)).or(w->w.in(Complaint::getLastSuperiorId,collect).eq(Complaint::getLastLevel,4)); }else { throw new ServiceException("没有该街道权限"); } } if(query.getCommunityId()!=null){ @@ -122,7 +124,7 @@ } // 判断是否有上面的4个权限 if(accountLevel==2 || (accountLevel==3 && systemUser.getDistrictsCode().equals(comAct.getStreetId().toString()) || accountLevel==4 && systemUser.getCommunityId().equals(comAct.getCommunityId()))){ if(accountLevel==2 || (accountLevel==3 && systemUser.getStreetId().equals(comAct.getStreetId().toString()) || accountLevel==4 && systemUser.getCommunityId().equals(comAct.getCommunityId()))){ wrapper.eq(Complaint::getSuperiorId, query.getCommunityId()); }else { throw new ServiceException("没有该社区权限"); @@ -133,15 +135,15 @@ if(query.getCityCode()==null && query.getDistrictCode()==null && query.getStreetId()==null && query.getCommunityId()==null){ if(systemUser.getSystemRoleId()==1 || systemUser.getSystemRoleId()==2){ if(systemUser.getSystemRoleId()==1){ wrapper.ne(Complaint::getProblemType,"纪委").or(w->w.isNull(Complaint::getProblemType)); wrapper.and(w->w.ne(Complaint::getProblemType,"检举控告").or().isNull(Complaint::getProblemType)); } if(accountLevel==3){ String streetId = systemUser.getStreetId(); List<Long> ids = comActService.list(new LambdaQueryWrapper<ComAct>().eq(ComAct::getStreetId, streetId)).stream().map(ComAct::getCommunityId).collect(Collectors.toList()); wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()).or(wrapper1 ->wrapper1.in(Complaint::getSuperiorId,ids).eq(Complaint::getNowLevel,4)); wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()).eq(Complaint::getSuperiorId,streetId).or(wrapper1 ->wrapper1.in(Complaint::getSuperiorId,ids).eq(Complaint::getNowLevel,4)); } if(accountLevel==4){ wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()); wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()).eq(Complaint::getSuperiorId,systemUser.getCommunityId()); } }else { wrapper.eq(Complaint::getNowLevel,systemUser.getAccountLevel()) springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/scheduled/ComplaintTasks.java
@@ -127,7 +127,7 @@ List<String> districtPhoneList1 = districtUserList.stream().filter(e->e.getSystemRoleId()==2).map(SystemUser::getPhone).collect(Collectors.toList()); collect.forEach(complaintTimeout -> { // 发送短信 if(!districtPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("纪委")){ if(!districtPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){ AliSmsUtil.sendTimeoutMessageAdmin(districtPhoneList,complaintTimeout.getSerialNumber()); } if(!districtPhoneList1.isEmpty()){ @@ -151,7 +151,7 @@ List<String> districtPhoneList2 = systemUsers.stream().filter(e->e.getSystemRoleId()==1).map(SystemUser::getPhone).collect(Collectors.toList()); List<String> districtPhoneList3 = systemUsers.stream().filter(e->e.getSystemRoleId()==2).map(SystemUser::getPhone).collect(Collectors.toList()); // 发送短信 if(!districtPhoneList2.isEmpty() && !complaintTimeout.getProblemType().equals("纪委")){ if(!districtPhoneList2.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){ AliSmsUtil.sendTimeoutMessageAdmin(districtPhoneList2,complaintTimeout.getSerialNumber()); } if(!districtPhoneList3.isEmpty()){ @@ -159,7 +159,7 @@ } }else { // 发送短信 if(!districtPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("纪委")){ if(!districtPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){ AliSmsUtil.sendTimeoutMessageAdmin(districtPhoneList,complaintTimeout.getSerialNumber()); } if(!districtPhoneList1.isEmpty()){ @@ -186,7 +186,7 @@ List<String> streetPhoneList = streetUserList.stream().filter(e->e.getSystemRoleId()==1 && e.getStreetId().equals(complaintTimeout.getSuperiorId().toString())).map(SystemUser::getPhone).collect(Collectors.toList()); List<String> streetPhoneList1 = streetUserList.stream().filter(e->e.getSystemRoleId()==2 && e.getStreetId().equals(complaintTimeout.getSuperiorId().toString())).map(SystemUser::getPhone).collect(Collectors.toList()); // 发送短信 if(!streetPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("纪委")){ if(!streetPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){ AliSmsUtil.sendTimeoutMessageAdmin(streetPhoneList,complaintTimeout.getSerialNumber()); } if(!streetPhoneList1.isEmpty()){ @@ -206,7 +206,7 @@ List<String> streetPhoneList2 = systemUsers.stream().filter(e->e.getSystemRoleId()==1).map(SystemUser::getPhone).collect(Collectors.toList()); List<String> streetPhoneList3 = systemUsers.stream().filter(e->e.getSystemRoleId()==2).map(SystemUser::getPhone).collect(Collectors.toList()); // 发送短信 if(!streetPhoneList2.isEmpty() && !complaintTimeout.getProblemType().equals("纪委")){ if(!streetPhoneList2.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){ AliSmsUtil.sendTimeoutMessageAdmin(streetPhoneList2,complaintTimeout.getSerialNumber()); } if(!streetPhoneList3.isEmpty()){ @@ -216,7 +216,7 @@ List<String> streetPhoneList = streetUserList.stream().filter(e->e.getSystemRoleId()==1 && e.getStreetId().equals(complaintTimeout.getSuperiorId().toString())).map(SystemUser::getPhone).collect(Collectors.toList()); List<String> streetPhoneList1 = streetUserList.stream().filter(e->e.getSystemRoleId()==2 && e.getStreetId().equals(complaintTimeout.getSuperiorId().toString())).map(SystemUser::getPhone).collect(Collectors.toList()); // 发送短信 if(!streetPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("纪委")){ if(!streetPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){ AliSmsUtil.sendTimeoutMessageAdmin(streetPhoneList,complaintTimeout.getSerialNumber()); } if(!streetPhoneList1.isEmpty()){ @@ -246,7 +246,7 @@ List<String> communityPhoneList1 = communityUserList.stream().filter(e->e.getSystemRoleId()==2 && e.getCommunityId().equals(complaintTimeout.getSuperiorId())).map(SystemUser::getPhone).collect(Collectors.toList()); // 发送短信 if(!communityPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("纪委")){ if(!communityPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){ AliSmsUtil.sendTimeoutMessageAdmin(communityPhoneList, complaintTimeout.getSerialNumber()); } if(!communityPhoneList1.isEmpty()){ @@ -266,7 +266,7 @@ List<String> communityPhoneList2 = systemUsers.stream().filter(e->e.getSystemRoleId()==1).map(SystemUser::getPhone).collect(Collectors.toList()); List<String> communityPhoneList3 = systemUsers.stream().filter(e->e.getSystemRoleId()==2).map(SystemUser::getPhone).collect(Collectors.toList()); // 发送短信 if(!communityPhoneList2.isEmpty() && !complaintTimeout.getProblemType().equals("纪委")){ if(!communityPhoneList2.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){ AliSmsUtil.sendTimeoutMessageAdmin(communityPhoneList2, complaintTimeout.getSerialNumber()); } if(!communityPhoneList3.isEmpty()){ @@ -276,7 +276,7 @@ List<String> communityPhoneList = communityUserList.stream().filter(e->e.getSystemRoleId()==1 && e.getCommunityId().equals(complaintTimeout.getSuperiorId())).map(SystemUser::getPhone).collect(Collectors.toList()); List<String> communityPhoneList1 = communityUserList.stream().filter(e->e.getSystemRoleId()==2 && e.getCommunityId().equals(complaintTimeout.getSuperiorId())).map(SystemUser::getPhone).collect(Collectors.toList()); // 发送短信 if(!communityPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("纪委")){ if(!communityPhoneList.isEmpty() && !complaintTimeout.getProblemType().equals("检举控告")){ AliSmsUtil.sendTimeoutMessageAdmin(communityPhoneList, complaintTimeout.getSerialNumber()); } if(!communityPhoneList1.isEmpty()){ springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/service/impl/ComplaintServiceImpl.java
@@ -116,6 +116,7 @@ SystemUser systemUser = identityInformationVO.getSystemUser(); Integer identity = identityInformationVO.getIdentity(); if (identity == 2) { loginUserInfoVO.setUserId(Long.valueOf(systemUser.getId())); accountLevel = systemUser.getAccountLevel(); switch (accountLevel) { case 2: @@ -124,8 +125,6 @@ complaint.setDistrictsCode(Integer.valueOf(systemUser.getDistrictsCode())); complaint.setReportUserName(systemUser.getName()); complaint.setReportUserPhone(systemUser.getPhone()); complaint.setSuperiorId(Long.valueOf(systemUser.getDistrictsCode())); break; case 3: @@ -287,6 +286,7 @@ if (systemUserByPhone.isPresent() && null != identity && identity == 2) { systemUser = systemUserByPhone.get(); accountLevel = systemUser.getAccountLevel(); query.setUserId(Long.valueOf(systemUser.getId())); switch (accountLevel) { case 2: //区县级 @@ -716,6 +716,10 @@ } }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); } @@ -731,7 +735,13 @@ } }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 )) { @@ -743,7 +753,13 @@ } }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) { @@ -1914,11 +1930,11 @@ // 诉求单量总计 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); // 正在办理 @@ -1942,11 +1958,11 @@ 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); // 平均处理时长 @@ -1955,13 +1971,13 @@ 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); @@ -1981,7 +1997,7 @@ 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(); // 当月的评价数 @@ -1991,7 +2007,7 @@ 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(); // 当月的评价数 @@ -2023,7 +2039,7 @@ 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) { @@ -2033,7 +2049,7 @@ 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(); @@ -2041,7 +2057,7 @@ 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(); @@ -2054,12 +2070,12 @@ 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()); @@ -2077,7 +2093,7 @@ @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 -> { @@ -2295,7 +2311,7 @@ complaint.setSuperiorId(systemUser.getCommunityId()); break; } complaint.setCreateBy(Long.valueOf(systemUser.getId())); complaint.setReportType(accountLevel); complaint.setNowLevel(accountLevel); complaint.setLastLevel(accountLevel); @@ -2337,6 +2353,7 @@ String code = null; switch (accountLevel) { case 2: code ="510403"; break; case 3: code =systemUser.getStreetId(); springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/utils/BaiduMapUtil.java
@@ -10,6 +10,7 @@ import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import java.net.URLEncoder; import java.util.LinkedHashMap; import java.util.Map; @@ -36,6 +37,8 @@ // // //requestGetAK(URL, params); JSONArray jsonArray = searchLocation("天安门", "39.909,116.39742"); System.out.println(jsonArray.size()); System.out.println(geoconv("116.390838,39.916245").toJSONString()); } @@ -104,6 +107,9 @@ } return jsonArray; } public static JSONObject requestGetAKObject(String strUrl, Map<String, String> param) throws Exception { if (strUrl == null || strUrl.length() <= 0 || param == null || param.size() <= 0) { return new JSONObject(); springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/java/com/panzhihua/westcommittee/warpper/TokenVo.java
@@ -40,4 +40,8 @@ @ApiModelProperty("市编号") private String cityCode; private Long userId; @ApiModelProperty("单位id") private Integer oneDepartmentId; @ApiModelProperty("角色 1管理员 2纪委 3工作人员") private Integer systemRoleId; } springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/resources/mapper/ComplaintMapper.xml
@@ -184,6 +184,7 @@ sc.description_content, sc.images, sc.videos, sc.assign_person_id, 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 @@ -390,7 +391,7 @@ and t1.tier =4 and t1.code3=#{query.code} </if> <if test="loginUserInfo.systemRoleId !=2 "> and t1.problem_type != '纪委' or t1.problem_type is null and (t1.problem_type != '检举控告' or t1.problem_type is null) </if> ORDER BY t1.create_time DESC @@ -519,7 +520,7 @@ and t1.tier =4 and t1.code3=#{query.code} </if> <if test="loginUserInfo.systemRoleId !=2 "> and t1.problem_type != '纪委' or t1.problem_type is null and (t1.problem_type != '检举控告' or t1.problem_type is null) </if> ORDER BY t1.create_time DESC @@ -1084,7 +1085,7 @@ and t1.status = #{query.status} </if> <if test="roleId !=2"> and t1.problem_type != '纪委' or t1.problem_type is null and (t1.problem_type != '检举控告' or t1.problem_type is null) </if> ORDER BY t1.create_time DESC @@ -1105,12 +1106,19 @@ sc.images, sc.videos, case -- WHEN (sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 7 -- WHEN ((sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0) or ((sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and sc.first_status = 0) THEN 5 -- WHEN (sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and scar.audit_status = 2 and scar.audit_type = 2 THEN 6 -- WHEN sc.`status` =8 THEN 3 -- WHEN sc.`status` =3 THEN 3 -- WHEN sc.now_level = 3 and sc.assign_status =0 and (scar.audit_status=1 or scar.audit_status=3 or scar.audit_status is null) and sc.`status` !=8 and sc.`status` !=3 THEN -1 -- ELSE 0 WHEN sc.now_level = 3 and sc.assign_status = 0 and (scar.audit_status=1 or scar.audit_status=3 or scar.audit_status is null) and sc.`status` !=8 and sc.`status` !=3 THEN -1 WHEN (sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 7 WHEN ((sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0) or ((sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and sc.first_status = 0) THEN 5 WHEN (sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and scar.audit_status = 2 and scar.audit_type = 2 THEN 6 WHEN sc.`status` =8 THEN 3 WHEN sc.`status` =3 THEN 3 WHEN sc.now_level = 3 and sc.assign_status =0 and (scar.audit_status=1 or scar.audit_status=3 or scar.audit_status is null) and sc.`status` !=8 and sc.`status` !=3 THEN -1 ELSE 0 END AS status, CASE @@ -1163,7 +1171,7 @@ and t1.status = #{query.status} </if> <if test="roleId !=2"> and t1.problem_type != '纪委' or t1.problem_type is null and (t1.problem_type != '检举控告' or t1.problem_type is null) </if> ORDER BY t1.create_time DESC @@ -1183,6 +1191,7 @@ sc.description_content, sc.images, sc.videos, sc.assign_person_id, 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 @@ -1229,7 +1238,7 @@ sc.assign_status AS assignStatus FROM west_complaint sc LEFT JOIN west_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1 WHERE sc.assign_person_id =#{oneDepartmentId} WHERE (sc.assign_person_id =#{oneDepartmentId} or sc.create_by =#{query.userId}) ) as t1 where 1=1 <if test="query.status !=null"> and t1.status = #{query.status} @@ -1308,7 +1317,7 @@ and t1.status = #{query.status} </if> <if test="roleId !=2"> and t1.problem_type != '纪委' or t1.problem_type is null and (t1.problem_type != '检举控告' or t1.problem_type is null) </if> @@ -1407,6 +1416,7 @@ sc.description_content, sc.images, sc.videos, sc.assign_person_id, 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 @@ -1468,7 +1478,7 @@ FROM west_complaint sc LEFT JOIN west_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1 LEFT JOIN west_department wd ON wd.id = sc.assign_person_id WHERE sc.assign_person_id =#{loginUserInfo.oneDepartmentId} WHERE (sc.assign_person_id =#{loginUserInfo.oneDepartmentId} or sc.create_by =#{loginUserInfo.id}) ) as t1 where 1=1 <if test="query.status !=null"> and t1.status = #{query.status} @@ -1513,7 +1523,7 @@ and t1.tier =4 and t1.code3=#{query.code} </if> <if test="loginUserInfo.systemRoleId !=2 "> and t1.problem_type != '纪委' or t1.problem_type is null and (t1.problem_type != '检举控告' or t1.problem_type is null) </if> ORDER BY t1.create_time DESC @@ -1535,12 +1545,12 @@ sc.images, sc.videos, case WHEN sc.now_level = 3 and sc.assign_status = 0 and (scar.audit_status=1 or scar.audit_status=3 or scar.audit_status is null) and sc.`status` !=8 and sc.`status` !=3 THEN -1 WHEN (sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and scar.audit_type = 1 AND scar.audit_status = 0 THEN 7 WHEN ((sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and scar.audit_type = 2 AND scar.audit_status = 0) or ((sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and sc.first_status = 0) THEN 5 WHEN (sc.now_level = 3 or sc.last_level = 3) and sc.status = 0 and scar.audit_status = 2 and scar.audit_type = 2 THEN 6 WHEN sc.`status` =8 THEN 3 WHEN sc.`status` =3 THEN 3 WHEN sc.now_level = 3 and sc.assign_status =0 and (scar.audit_status=1 or scar.audit_status=3 or scar.audit_status is null) and sc.`status` !=8 and sc.`status` !=3 THEN -1 ELSE 0 END AS status, CASE @@ -1647,7 +1657,7 @@ and t1.tier =4 and t1.code3=#{query.code} </if> <if test="loginUserInfo.systemRoleId !=2 "> and t1.problem_type != '纪委' or t1.problem_type is null and (t1.problem_type != '检举控告' or t1.problem_type is null) </if> ORDER BY t1.create_time DESC </select> @@ -1778,7 +1788,7 @@ and t1.tier =4 and t1.code3=#{query.code} </if> <if test="loginUserInfo.systemRoleId !=2 "> and t1.problem_type != '纪委' or t1.problem_type is null and (t1.problem_type != '检举控告' or t1.problem_type is null) </if> ORDER BY t1.create_time DESC </select> @@ -1904,7 +1914,7 @@ and t1.tier =4 and t1.code3=#{query.code} </if> <if test="loginUserInfo.systemRoleId !=2 "> and t1.problem_type != '纪委' or t1.problem_type is null and (t1.problem_type != '检举控告' or t1.problem_type is null) </if> ORDER BY t1.create_time DESC @@ -2038,7 +2048,7 @@ and t1.tier =4 and t1.code3=#{query.code} </if> <if test="loginUserInfo.systemRoleId !=2 "> and t1.problem_type != '纪委' or t1.problem_type is null and (t1.problem_type != '检举控告' or t1.problem_type is null) </if> ORDER BY t1.create_time DESC </select> @@ -2169,7 +2179,7 @@ and t1.tier =4 and t1.code3=#{query.code} </if> <if test="loginUserInfo.systemRoleId !=2 "> and t1.problem_type != '纪委' or t1.problem_type is null and (t1.problem_type != '检举控告' or t1.problem_type is null) </if> ORDER BY t1.create_time DESC </select> @@ -2179,17 +2189,15 @@ sc.id, sc.problem_type, case WHEN sc.now_level = #{accountLevel} and sc.assign_status =0 and (scar.audit_status=1 or scar.audit_status is null) THEN -1 WHEN sc.now_level = #{accountLevel} and sc.status !=3 and sc.status !=8 and sc.assign_status =0 and (scar.audit_status=1 or scar.audit_status is null) THEN -1 ELSE 0 END AS status, sc.now_level, sc.superior_id FROM west_complaint sc LEFT JOIN west_complaint_audit_record scar ON scar.complaint_id = sc.id and scar.latest_flag = 1 ) as t1 where t1.status = -1 and (t1.problem_type != '纪委' or t1.problem_type is null) <if test="accountLevel!=2"> and t1.superior_id = #{code} </if> ) as t1 where t1.status = -1 and t1.status!=8 and t1.status!=3 and (t1.problem_type != '检举控告' or t1.problem_type is null) and t1.superior_id = #{code} and t1.now_level = #{accountLevel} </select> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_westcommittee/src/main/resources/mapper/ComplaintRejectMapper.xml
@@ -41,7 +41,7 @@ and t3.audit_time between #{examineStartTime} and #{examineEndTime} </if> <if test="roleId !=2"> and t2.problem_type != '纪委' or t2.problem_type is null and (t2.problem_type != '检举控告' or t2.problem_type is null) </if> @@ -59,7 +59,7 @@ <where> t3.audit_status=2 <if test="roleId !=2"> and t2.problem_type != '纪委' or t2.problem_type is null and (t2.problem_type != '检举控告' or t2.problem_type is null) </if> <if test="query.serialNumber != null and query.serialNumber != ''"> and t2.serial_number = #{query.serialNumber} @@ -133,7 +133,7 @@ and t3.audit_time between #{examineStartTime} and #{examineEndTime} </if> <if test="role !=2"> and t2.problem_type != '纪委' or t2.problem_type is null and (t2.problem_type != '检举控告' or t2.problem_type is null) </if>