From 9f87ca56f82c2352adbb7201a190ac944e6deeeb Mon Sep 17 00:00:00 2001
From: XiaoRuby <3114200645@qq.com>
Date: 星期五, 08 九月 2023 17:55:54 +0800
Subject: [PATCH] MOM系统-9-08

---
 inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java b/inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java
index d81715a..4b0c6ad 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java
@@ -8,7 +8,6 @@
 import com.yuanchu.mom.utils.JackSonUtil;
 import com.yuanchu.mom.utils.Jwt;
 import com.yuanchu.mom.utils.MyUtil;
-import com.yuanchu.mom.utils.RedisUtil;
 import com.yuanchu.mom.vo.Result;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -117,11 +116,12 @@
 
     @ApiOperation(value = "缂栬緫鎰忚-->纭畾鎸夐挳", tags = "QMS绠$悊-->涓嶅悎鏍煎搧澶勭疆")
     @PostMapping("/addOpinion")
-    public Result<?> updateOpinion(@RequestHeader("token") String token, @Validated @RequestBody List<Opinion> opinion) throws Exception {
+    public Result<?> updateOpinion(@RequestHeader("token") String token, @RequestBody Map<String, Object> opinion) throws Exception {
+        List<?> opinion1 = JackSonUtil.unmarshal(JackSonUtil.marshal(opinion.get("opinion")), List.class);
         Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class);
         String id = data.get("id").replaceAll("\"", "");
-        opinionService.updateOpinion(id, opinion);
-        return Result.success();
+        opinionService.updateOpinion(id, opinion1);
+        return Result.success("娣诲姞鎴愬姛锛�");
     }
 
     @ApiOperation(value = "鏌ョ湅缂栬緫鎰忚", tags = "QMS绠$悊-->涓嶅悎鏍煎搧澶勭疆")
@@ -140,15 +140,19 @@
     })
     @GetMapping("/descriptionUpdate")
     public Result<?> descriptionUpdate(Integer rawUnacceptedId, String tell) {
-        return Result.success(inspectUnacceptedService.descriptionUpdate(rawUnacceptedId, tell));
+        Integer isUpdateSuccess = inspectUnacceptedService.descriptionUpdate(rawUnacceptedId, tell);
+        if (isUpdateSuccess == 1) {
+            return Result.success("鏇存柊鎴愬姛");
+        }
+        return Result.fail("鏇存柊澶辫触");
     }
 
     @ApiOperation(value = "鐐瑰嚮缂栬緫鎰忚瑙﹀彂鏌ヨ", tags = "QMS绠$悊-->涓嶅悎鏍煎搧澶勭疆")
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "rawUnacceptedId",value = "涓嶅悎鏍煎搧澶勭疆Id",dataTypeClass  = Integer.class,required = true)
     })
-    @PostMapping("/clickEditing")
-    public Result<?> clickEditingTriggerQuery(Integer rawUnacceptedId) {
+    @GetMapping("/clickEditing")
+    public Result<?> clickEditingTriggerQuery(@RequestParam("rawUnacceptedId") Integer rawUnacceptedId) {
         return Result.success(opinionService.clickEditingTriggerQuery(rawUnacceptedId));
     }
 }

--
Gitblit v1.9.3