From 29807fea73899a5b775eb2c7d8e1c05ea8bc0c3d Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期五, 02 八月 2024 17:00:31 +0800
Subject: [PATCH] 2024-08-02 朱宝民 优化获取全部取水口接口,包含经纬度及12小时之内的报警信息

---
 pipIrr-platform/pipIrr-web/pipIrr-web-operation/src/main/java/com/dy/pipIrrOperation/feedback/FeedbackCtrl.java |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 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 dcc040c..9dd9134 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
@@ -5,6 +5,7 @@
 import com.dy.common.webUtil.BaseResponseUtils;
 import com.dy.common.webUtil.QueryResultVo;
 import com.dy.pipIrrGlobal.pojoOp.OpeFeedback;
+import com.dy.pipIrrGlobal.pojoOp.OpeFeedbackReply;
 import com.dy.pipIrrGlobal.voOp.Vofeedback;
 import io.swagger.v3.oas.annotations.Parameter;
 import jakarta.validation.Valid;
@@ -132,4 +133,28 @@
             return BaseResponseUtils.buildException(e.getMessage());
         }
     }
+
+
+    /**
+     * 娣诲姞闂鍙嶉鍥炲
+     * @param reply
+     * @param bindingResult
+     * @return
+     */
+    @PostMapping(path = "addReply", consumes = MediaType.APPLICATION_JSON_VALUE)
+    @Transactional(rollbackFor = Exception.class)
+    @SsoAop
+    public BaseResponse<Boolean> addReply(@RequestBody @Valid OpeFeedbackReply reply, @Parameter(hidden = true) BindingResult bindingResult){
+        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);
+    }
 }

--
Gitblit v1.8.0