| | |
| | | } |
| | | |
| | | @Override |
| | | public PageParam<CauseVo> getCauserListByCondition(String cause, Integer status, Integer size, Integer current,Integer id) { |
| | | QueryWrapper<Cause> causeQueryWrapper = new QueryWrapper<>(); |
| | | if (StringUtils.isNotBlank(cause)) { |
| | | causeQueryWrapper.and(a -> a.like(StringUtils.isNotBlank(cause), "number", cause) |
| | | .or(StringUtils.isNotBlank(cause)) |
| | | .like(StringUtils.isNotBlank(cause), "name", cause)); |
| | | } |
| | | if (status != null) { |
| | | causeQueryWrapper.eq("status", status); |
| | | } |
| | | causeQueryWrapper.eq("user_id",id); |
| | | causeQueryWrapper.orderByDesc("ctime"); |
| | | PageParam<Cause> causePageParam = new PageParam<>(); |
| | | if (size != null) { |
| | | causePageParam.setSize(size); |
| | | } |
| | | if (current != null) { |
| | | causePageParam.setCurrent(current); |
| | | } |
| | | PageParam<Cause> causePage = causeDao.selectPage(causePageParam, causeQueryWrapper); |
| | | List<CauseVo> causeVos = causePage.getRecords().stream().map( |
| | | a -> { |
| | | CauseVo causeVo = new CauseVo(); |
| | | BeanUtils.copyProperties(a, causeVo); |
| | | causeVo.setUserName(userDao.selectOne(new QueryWrapper<User>().eq("id", a.getUserId())).getRealName()); |
| | | causeVo.setReportNumber(reportDao.selectCount(new QueryWrapper<Report>().eq("cause_id", a.getId()))); |
| | | causeVo.setGroupId(groupDao.selectOne(new QueryWrapper<Group>().eq("cause_id", a.getId())).getId()); |
| | | return causeVo; |
| | | }).collect(Collectors.toList()); |
| | | PageParam<CauseVo> causeVoPageParam = new PageParam<>(); |
| | | BeanUtils.copyProperties(causePage, causeVoPageParam); |
| | | causeVoPageParam.setRecords(causeVos); |
| | | return causeVoPageParam; |
| | | } |
| | | |
| | | @Override |
| | | public List<UserVo> getManagerList() { |
| | | return userDao.selectList(new QueryWrapper<User>().eq("role", 1)).stream().map(a -> { |
| | | UserVo userVo = new UserVo(); |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | .setUserId(user.getId()) |
| | | .setCtime(new Date()) |
| | | .setStatus(0) |
| | | .setReportMethod("现场录入") |
| | | .setReportMethod("后台录入") |
| | | .setIsCommission("0").setReportTime(new Date()) |
| | | .setCauseId(addReportDto.getCauseId()); |
| | | reportService.save(report); |