From 0261d270c9f9b5282d923e585c307aee44b0612c Mon Sep 17 00:00:00 2001
From: baizonghao <1719256278@qq.com>
Date: 星期四, 23 三月 2023 14:23:39 +0800
Subject: [PATCH] 删除警员,对应案件
---
src/main/java/com/example/jz/controller/WxAppController.java | 40 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 39 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/example/jz/controller/WxAppController.java b/src/main/java/com/example/jz/controller/WxAppController.java
index 207acea..6c9b5bd 100644
--- a/src/main/java/com/example/jz/controller/WxAppController.java
+++ b/src/main/java/com/example/jz/controller/WxAppController.java
@@ -246,10 +246,11 @@
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);
@@ -260,6 +261,29 @@
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")
@@ -362,17 +386,25 @@
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());
messageMap.put("idcard", user.getUserIdcard());
+ messageMap.put("sex", user.getSex());
messageMap.put("pic", user.getPic());
messageMap.put("role", 0);
} 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());
messageMap.put("role", 1);
}
message.add(messageMap);
@@ -523,6 +555,10 @@
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);
@@ -552,6 +588,8 @@
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());
--
Gitblit v1.8.0