From f9a89f158a9624d27fec314315a8b7f7dcb28af1 Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期二, 27 十二月 2022 15:34:30 +0800
Subject: [PATCH] fix: 查询取消脱敏

---
 src/main/java/com/example/jz/controller/CauseController.java |   58 ++++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 36 insertions(+), 22 deletions(-)

diff --git a/src/main/java/com/example/jz/controller/CauseController.java b/src/main/java/com/example/jz/controller/CauseController.java
index a5cde56..8ba9def 100644
--- a/src/main/java/com/example/jz/controller/CauseController.java
+++ b/src/main/java/com/example/jz/controller/CauseController.java
@@ -16,6 +16,7 @@
 import io.swagger.annotations.ApiResponse;
 import lombok.SneakyThrows;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -49,51 +50,57 @@
     }
 
 
-    @ApiOperation(httpMethod = "POST", value = "娣诲姞妗堜欢")
+    @ApiOperation(httpMethod = "POST", value = "妗堜欢鍙�-妗堜欢褰曞叆-娣诲姞妗堜欢")
     @PostMapping("/addCause")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
-    public R addCause(@RequestBody CauseDto causeDto) {
+    public R addCause(@RequestBody @Validated CauseDto causeDto) {
         causeService.addCause(causeDto);
         return R.ok();
     }
 
-    @ApiOperation(httpMethod = "PUT", value = "淇敼妗堜欢")
+    @ApiOperation(httpMethod = "PUT", value = "妗堜欢鍙�-妗堜欢褰曞叆-淇敼妗堜欢")
     @PutMapping("/updateCause")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
-    public R updateCause(@RequestBody CauseDto causeDto, Integer id) {
+    public R updateCause(@RequestBody @Validated CauseDto causeDto, Integer id) {
         return R.ok(causeService.updateCause(causeDto, id));
     }
 
 
-    @ApiOperation(httpMethod = "GET", value = "妗堜欢褰曞叆鍒楄〃")
+    @ApiOperation(httpMethod = "GET", value = "妗堜欢鍙�-妗堜欢褰曞叆-妗堜欢褰曞叆鍒楄〃")
     @GetMapping("/getCauseList")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
     public R getCauseList(String cause, Integer status, Integer size, Integer current) {
         return R.ok(causeService.getCauserListByCondition(cause, status, size, current));
     }
 
-    @ApiOperation(httpMethod = "GET", value = "璐熻矗浜烘煡璇�")
+    @ApiOperation(httpMethod = "GET", value = "妗堜欢鍙�-妗堜欢褰曞叆-妗堜欢褰曞叆鍒楄〃")
+    @GetMapping("/getCause")
+    @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
+    public R getCause(String cause, Integer status, Integer size, Integer current,Integer id) {
+        return R.ok(causeService.getCauserListByCondition(cause, status, size, current,id));
+    }
+    @ApiOperation(httpMethod = "GET", value = "妗堜欢鍙�-妗堜欢褰曞叆-璐熻矗浜烘煡璇�")
     @GetMapping("/getManagerList")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
     public R getManagerList() {
         return R.ok(causeService.getManagerList());
     }
 
-    @ApiOperation(httpMethod = "GET", value = "鑾峰彇鎶ユ浜哄憳")
+    @ApiOperation(httpMethod = "GET", value = "妗堜欢鍙�-妗堜欢褰曞叆-鑾峰彇妗堜欢鎶ユ浜哄憳")
     @GetMapping("/getReporterList")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
     public R getReporterList(Integer causeId) {
         return R.ok(causeService.getReporterList(causeId));
     }
 
-    @ApiOperation(httpMethod = "GET", value = "鑾峰彇妗堜欢缇ゅ叕鍛�")
+    @ApiOperation(httpMethod = "GET", value = "妗堜欢鍙�-妗堜欢褰曞叆-鑾峰彇妗堜欢缇ゅ叕鍛�")
     @GetMapping("/getGroupAnnouncement")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
     public R getGroupAnnouncement(Integer groupId) {
         return R.ok(causeService.getGroupAnnouncement(groupId));
     }
 
-    @ApiOperation(httpMethod = "DELETE", value = "妗堜欢鍒犻櫎")
+    @ApiOperation(httpMethod = "DELETE", value = "妗堜欢鍙�-妗堜欢褰曞叆-妗堜欢鍒犻櫎")
     @DeleteMapping("/deleteCause")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
     public R deleteCause(@RequestParam(value = "id") Integer id) {
@@ -101,7 +108,7 @@
         return R.ok();
     }
 
-    @ApiOperation(httpMethod = "POST", value = "妗堜欢瀵煎叆")
+    @ApiOperation(httpMethod = "POST", value = "妗堜欢鍙�-妗堜欢褰曞叆-妗堜欢瀵煎叆")
     @PostMapping("/upload")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
     @SneakyThrows
@@ -110,27 +117,34 @@
         return R.ok();
     }
 
+    @ApiOperation(httpMethod = "POST", value = "妗堜欢鍙�-妗堜欢褰曞叆-鎶ユ浜哄憳-鎶ユ浜哄厓瀵煎叆")
+    @PostMapping("/reporterUpload")
+    @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
+    @SneakyThrows
+    public R uploadReporter(@RequestParam(value = "multipartFile") MultipartFile multipartFile,Integer causeId) {
+        causeService.loadFileReport(multipartFile,causeId);
+        return R.ok();
+    }
+
     @ApiOperation(httpMethod = "GET", value = "鏍规嵁缇ょ粍id鏌ヨ妗堜欢鍒嗛〉")
     @GetMapping("/getAllReportList")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
-    public R<IPage<ReportListVo>> get(Page<ReportListVo> page, ReportParamDto reportParamDto, Integer groupId) {
-        return R.ok(reportService.getPageByGroupId(page, reportParamDto, groupId));
+    public R<IPage<ReportListVo>> get(Page<ReportListVo> page, ReportParamDto reportParamDto, Integer causeId) {
+        return R.ok(reportService.getPageByGroupId(page, reportParamDto, causeId));
     }
 
     @ApiOperation(httpMethod = "POST", value = "娣诲姞浜哄憳")
     @PostMapping("/addReporter")
     @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
-    public R<Boolean> get(AddReportDto addReportDto) {
-        if (addReportDto.getReporterName() == null || addReportDto.getReporterName().equals("")) {
-            return R.failed("鎶ユ浜哄憳涓嶈兘涓虹┖");
-        }
-        if (addReportDto.getMobile() == null || addReportDto.getMobile().equals("")) {
-            return R.failed("鎶ユ浜哄憳鐢佃瘽涓嶈兘涓虹┖");
-        }
-        if (addReportDto.getIdcard() == null || addReportDto.getIdcard().equals("")) {
-            return R.failed("鎶ユ浜哄憳韬唤璇佷笉鑳戒负绌�");
-        }
+    public R<Boolean> get(@RequestBody AddReportDto addReportDto) {
         return R.ok(causeService.addReportPeople(addReportDto));
     }
+
+    @ApiOperation(httpMethod = "GET", value = "鑾峰彇妗堜欢鐨刬d鍜屽悕绉板垪琛�")
+    @GetMapping("/getCauseIdAndName")
+    @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
+    public R getCauseIdAndName() {
+        return R.ok(causeService.getCauseIdAndName());
+    }
 }
 

--
Gitblit v1.8.0