From e4bc4f97e837fcf1cb976e92a022c0791c9360a4 Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期二, 15 十月 2024 14:05:39 +0800
Subject: [PATCH] 优化代码 控制器查询 最近未报数的取水口 修改密码

---
 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intakeController/IntakeControllerCtrl.java |   36 ++++++++++++++++++++++++++----------
 1 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intakeController/IntakeControllerCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intakeController/IntakeControllerCtrl.java
index 8bc4a6b..5c481f2 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intakeController/IntakeControllerCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intakeController/IntakeControllerCtrl.java
@@ -1,7 +1,6 @@
 package com.dy.pipIrrProject.intakeController;
 
 
-import cn.hutool.core.date.DateTime;
 import com.dy.common.aop.SsoAop;
 import com.dy.common.webUtil.BaseResponse;
 import com.dy.common.webUtil.BaseResponseUtils;
@@ -284,16 +283,15 @@
     @GetMapping(path = "/getTrampControllers")
     @SsoAop()
     public BaseResponse<QueryResultVo<List<PrControllerTramp>>> getTrampControllers(TrampControllerQueryVo vo) {
-
         try {
-            QueryResultVo<List<PrControllerTramp>> res = intakeControllerSv.getTrampControllers(vo);
-            if (res.itemTotal != null && res.itemTotal > 0) {
-                return BaseResponseUtils.buildSuccess(res);
-            } else {
-                //璇锋眰鎴愬姛浣嗘暟鎹负绌�
-                return BaseResponseUtils.buildSuccess(res);
-            }
-            //return BaseResponseUtils.buildSuccess(res);
+            //QueryResultVo<List<PrControllerTramp>> res = intakeControllerSv.getTrampControllers(vo);
+            //if (res.itemTotal != null && res.itemTotal > 0) {
+            //    return BaseResponseUtils.buildSuccess(res);
+            //} else {
+            //    //璇锋眰鎴愬姛浣嗘暟鎹负绌�
+            //    return BaseResponseUtils.buildSuccess(res);
+            //}
+            return BaseResponseUtils.buildSuccess(intakeControllerSv.getTrampControllers(vo));
         } catch (Exception e) {
             log.error("鑾峰彇娴佹氮鎺у埗鍣ㄨ褰曞紓甯�", e);
             return BaseResponseUtils.buildException(e.getMessage());
@@ -339,4 +337,22 @@
         }
         return BaseResponseUtils.buildSuccess(true);
     }
+
+    /**
+     * 娓呯┖娴佹氮鎺у埗鍣�
+     *
+     * @param
+     * @return
+     */
+    @PostMapping("emptyTrampController")
+    @Transactional(rollbackFor = Exception.class)
+    @SsoAop()
+    public BaseResponse<Boolean> emptyTrampController() {
+
+        Integer rows = intakeControllerSv.emptyTrampController();
+        if (rows == 0) {
+            return BaseResponseUtils.buildFail(ProjectResultCode.DELETE_TRAMP_CONTROLLER_FAIL.getMessage());
+        }
+        return BaseResponseUtils.buildSuccess(true);
+    }
 }

--
Gitblit v1.8.0