| | |
| | | public PageParam<CauseReportVo> getReporterList(Integer causeId) { |
| | | PageParam<Report> PageParam = new PageParam<>(); |
| | | PageParam<Report> reportPageParam = reportDao.selectPage(PageParam, new QueryWrapper<Report>().eq("cause_id", causeId).orderByDesc("ctime")); |
| | | List<CauseReportVo> causeReportVos = reportPageParam.getRecords().stream() |
| | | .map( |
| | | a -> { |
| | | CauseReportVo causeReportVo = new CauseReportVo(); |
| | | User user = userDao.selectOne(new QueryWrapper<User>().eq("id", a.getUserId())); |
| | | BeanUtils.copyProperties(a, causeReportVo); |
| | | causeReportVo.setMobile(user.getUserMobile()); |
| | | causeReportVo.setIdcard(user.getUserIdcard().replaceAll("(?<=[\\d]{3})\\d(?=[\\d]{4})", "*")); |
| | | causeReportVo.setReporterName(user.getRealName()); |
| | | if (causeReportVo.getIsInGroup()==1) { |
| | | causeReportVo.setGroupId(groupDao.selectOne(new QueryWrapper<Group>().eq("cause_id",causeId)).getId()); |
| | | } |
| | | return causeReportVo; |
| | | } |
| | | ).collect(Collectors.toList()); |
| | | |
| | | PageParam<CauseReportVo> causeReportVoPageParam = new PageParam<>(); |
| | | BeanUtils.copyProperties(reportPageParam, causeReportVoPageParam); |
| | | causeReportVoPageParam.setRecords(causeReportVos); |
| | | if (!reportPageParam.getRecords().isEmpty()){ |
| | | List<CauseReportVo> causeReportVos = reportPageParam.getRecords().stream() |
| | | .map( |
| | | a -> { |
| | | CauseReportVo causeReportVo = new CauseReportVo(); |
| | | User user = userDao.selectOne(new QueryWrapper<User>().eq("id", a.getUserId())); |
| | | BeanUtils.copyProperties(a, causeReportVo); |
| | | causeReportVo.setMobile(user.getUserMobile()); |
| | | causeReportVo.setIdcard(user.getUserIdcard().replaceAll("(?<=[\\d]{3})\\d(?=[\\d]{4})", "*")); |
| | | causeReportVo.setReporterName(user.getRealName()); |
| | | if (causeReportVo.getIsInGroup()==1) { |
| | | causeReportVo.setGroupId(groupDao.selectOne(new QueryWrapper<Group>().eq("cause_id",causeId)).getId()); |
| | | } |
| | | return causeReportVo; |
| | | } |
| | | ).collect(Collectors.toList()); |
| | | causeReportVoPageParam.setRecords(causeReportVos); |
| | | } |
| | | return causeReportVoPageParam; |
| | | } |
| | | |