From ec57bc14382f8e933064494481e4bb9bb6716e8a Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 24 十月 2024 10:20:20 +0800
Subject: [PATCH] log4j2配置文件中,修改特例输出日志项的配置

---
 pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/FeedbackCtrl.java |   78 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 75 insertions(+), 3 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/FeedbackCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/FeedbackCtrl.java
index 9dd9134..7308978 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/FeedbackCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/FeedbackCtrl.java
@@ -7,6 +7,7 @@
 import com.dy.pipIrrGlobal.pojoOp.OpeFeedback;
 import com.dy.pipIrrGlobal.pojoOp.OpeFeedbackReply;
 import com.dy.pipIrrGlobal.voOp.Vofeedback;
+import com.dy.pipIrrGlobal.voOp.VofeedbackReply;
 import io.swagger.v3.oas.annotations.Parameter;
 import jakarta.validation.Valid;
 import lombok.RequiredArgsConstructor;
@@ -148,13 +149,84 @@
         if (bindingResult != null && bindingResult.hasErrors()) {
             return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
         }
-        if (reply.getFeedbackId() == null){
-            return BaseResponseUtils.buildFail("璇蜂紶鍏ュ弽棣堢紪鍙穒d");
-        }
         Integer rec = Optional.ofNullable(feedbackSv.addReply(reply)).orElse(0);
         if (rec == 0) {
             return BaseResponseUtils.buildFail("娣诲姞鍥炲澶辫触");
         }
         return BaseResponseUtils.buildSuccess(true);
     }
+
+    /**
+     * 淇敼闂鍙嶉鍥炲
+     * @param reply
+     * @param bindingResult
+     * @return
+     */
+    @PostMapping(path = "updateReply", consumes = MediaType.APPLICATION_JSON_VALUE)
+    @Transactional(rollbackFor = Exception.class)
+    @SsoAop()
+    public BaseResponse<Boolean> updateReply(@RequestBody @Parameter(description = "form琛ㄥ崟json鏁版嵁", required = true) @Valid OpeFeedbackReply reply, @Parameter(hidden = true) BindingResult bindingResult) {
+        if (bindingResult != null && bindingResult.hasErrors()) {
+            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
+        }
+        int count ;
+        try {
+            count = feedbackSv.updateReply(reply);
+        } catch (Exception e) {
+            log.error("淇敼闂鍙嶉鍥炲寮傚父", e);
+            return BaseResponseUtils.buildException(e.getMessage());
+        }
+        if (count <= 0) {
+            return BaseResponseUtils.buildFail("淇敼鍙嶉鍥炲澶辫触");
+        } else {
+            return BaseResponseUtils.buildSuccess(true);
+        }
+    }
+
+    /**
+     * 鍒犻櫎闂鍙嶉鍥炲
+     * @param map
+     * @return
+     */
+    @PostMapping(path = "deleteReply")
+    @Transactional(rollbackFor = Exception.class)
+    @SsoAop()
+    public BaseResponse<Boolean> deleteReply(@RequestBody Map map) {
+        if (map == null || map.size() <= 0) {
+            return BaseResponseUtils.buildFail("璇蜂紶鍏d");
+        }
+        Long id = Long.parseLong(map.get("id").toString());
+        try {
+            Integer recordCount = Optional.ofNullable(feedbackSv.deleteReply(id)).orElse(0);
+            if (recordCount == 0) {
+                return BaseResponseUtils.buildFail("鍒犻櫎澶辫触");
+            } else {
+                return BaseResponseUtils.buildSuccess(true);
+            }
+        } catch (Exception e) {
+            log.error("鍒犻櫎寮傚父", e);
+            return BaseResponseUtils.buildException(e.getMessage());
+        }
+    }
+
+
+    /**
+     * 鍒嗛〉鏌ヨ闂鍙嶉鍥炲
+     * @param qo
+     * @return
+     */
+    @GetMapping(path = "getFeedbackReply")
+    @SsoAop()
+    public BaseResponse<QueryResultVo<List<VofeedbackReply>>> getFeedbackReply(ReplyQueryVo qo) {
+        try {
+            QueryResultVo<List<VofeedbackReply>> res = feedbackSv.getFeedbackReply(qo);
+            if (res == null) {
+                return BaseResponseUtils.buildFail("鏌ヨ澶辫触");
+            }
+            return BaseResponseUtils.buildSuccess(res);
+        } catch (Exception e) {
+            log.error("鏌ヨ寮傚父", e);
+            return BaseResponseUtils.buildException(e.getMessage());
+        }
+    }
 }

--
Gitblit v1.8.0