| | |
| | | public R addReport(@RequestBody ReportVXVO reportVXVO) { |
| | | User user = userService.getOne(new QueryWrapper<User>().eq("id", reportVXVO.getUserId())); |
| | | user.setRealName(reportVXVO.getRealName()); |
| | | user.setSex(reportVXVO.getSex()); |
| | | user.setUserIdcard(reportVXVO.getUserIdCard()); |
| | | user.setLocation(reportVXVO.getLocation()); |
| | | user.setSex(reportVXVO.getSex()); |
| | | user.setWorkingLocation(reportVXVO.getWorkingLocation()); |
| | | |
| | | userService.update(user, new LambdaQueryWrapper<User>().eq(User::getId, user.getId())); |
| | | Report report = new Report(); |
| | | BeanUtils.copyProperties(reportVXVO, report); |
| | |
| | | report.setStatus(0); |
| | | report.setReportMethod("扫码报案"); |
| | | return R.ok(reportService.save(report)); |
| | | } |
| | | |
| | | @PutMapping ("/user/addReport") |
| | | public R addReport1(@RequestBody ReportVXVO reportVXVO) { |
| | | User user = userService.getOne(new QueryWrapper<User>().eq("id", reportVXVO.getUserId())); |
| | | user.setRealName(reportVXVO.getRealName()); |
| | | user.setSex(reportVXVO.getSex()); |
| | | user.setUserIdcard(reportVXVO.getUserIdCard()); |
| | | user.setLocation(reportVXVO.getLocation()); |
| | | user.setWorkingLocation(reportVXVO.getWorkingLocation()); |
| | | |
| | | userService.update(user, new LambdaQueryWrapper<User>().eq(User::getId, user.getId())); |
| | | Report report = new Report(); |
| | | BeanUtils.copyProperties(reportVXVO, report); |
| | | report.setAmountInvolved(reportVXVO.getAmountInvolved()); |
| | | report.setPic(user.getPic()); |
| | | report.setIsInGroup(0); |
| | | report.setCtime(new Date()); |
| | | report.setStatus(0); |
| | | report.setReportMethod("扫码报案"); |
| | | |
| | | reportService.update(report, new LambdaQueryWrapper<Report>().eq(Report::getId, report.getId())); |
| | | return R.ok("修改成功"); |
| | | } |
| | | |
| | | @PostMapping("/user/add") |
| | |
| | | if (item.getUserId() != null) { |
| | | Report report = reportService.getOne(new QueryWrapper<Report>().eq("id", item.getUserId())); |
| | | User user = userService.getOne(new QueryWrapper<User>().eq("id", report.getUserId())); |
| | | if (Objects.isNull(user)) { |
| | | return; |
| | | } |
| | | messageMap.put("id", user.getId()); |
| | | messageMap.put("name", item.getReportName()); |
| | | messageMap.put("mobile", user.getUserMobile()); |
| | |
| | | } else { |
| | | messageMap.put("id", item.getCopId()); |
| | | User user = userService.getOne(new QueryWrapper<User>().eq("id", item.getCopId())); |
| | | if (Objects.isNull(user)) { |
| | | return; |
| | | } |
| | | messageMap.put("name", user.getRealName()); |
| | | messageMap.put("mobile", user.getUserMobile()); |
| | | messageMap.put("sex", user.getSex()); |
| | |
| | | if (StringUtils.isBlank(msg)) { |
| | | return R.failed("msg is blank"); |
| | | } |
| | | GroupUser one = groupUserService.getOne(new LambdaQueryWrapper<GroupUser>().eq(GroupUser::getUserId, id).eq(GroupUser::getGroupId, groupId)); |
| | | if (one.getBanSpeech() == 1){ |
| | | return R.failed("该用户已经被禁言"); |
| | | } |
| | | Message message = new Message(); |
| | | message.setUserId(id); |
| | | message.setText(msg); |
| | |
| | | ReportVo reportVo = new ReportVo(); |
| | | BeanUtils.copyProperties(item, reportVo); |
| | | User user = userDao.selectOne(new LambdaQueryWrapper<User>().eq(User::getId, item.getUserId())); |
| | | Cause one = causeService.getOne(new LambdaQueryWrapper<Cause>().eq(Cause::getId, item.getCauseId())); |
| | | reportVo.setReportDescription(one.getName()); |
| | | reportVo.setReporterName(user.getRealName()); |
| | | reportVo.setMobile(user.getUserMobile()); |
| | | reportVo.setIdcard(user.getUserIdcard()); |