From e7821f087f3d1d39c945fb9772ca97f6ef24de95 Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期五, 19 七月 2024 11:41:47 +0800
Subject: [PATCH] 作物相关接口、作物灌溉制度相关接口、轮灌组相关接口、灌溉单元相关接口修改完善失败响应信息并配置相应枚举类

---
 pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/result/IrrigateResultCode.java                 |   31 ++++++++++++++-
 pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateUnit/IrrigateUnitCtrl.java             |   10 ++--
 pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/crop/CropCtrl.java                             |    8 ++--
 pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateScheduling/IrrigateSchedulingCtrl.java |    8 ++--
 pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateGroup/IrrigateGroupCtrl.java           |   12 +++---
 5 files changed, 48 insertions(+), 21 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/crop/CropCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/crop/CropCtrl.java
index 544ad1c..9bffcda 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/crop/CropCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/crop/CropCtrl.java
@@ -74,7 +74,7 @@
         try {
             Integer rec = Optional.ofNullable(cropSv.addCrop(po)).orElse(0);
             if (rec == 0) {
-                return BaseResponseUtils.buildFail(IrrigateResultCode.ADD_PROJECT_FAIL.getMessage());
+                return BaseResponseUtils.buildFail(IrrigateResultCode.ADD_CROP_FAIL.getMessage());
             }
         } catch (Exception e) {
             log.error("娣诲姞浣滅墿寮傚父", e);
@@ -102,13 +102,13 @@
     @SsoAop()
     public BaseResponse<Boolean> delete(@RequestBody Map map) {
         if (map == null || map.size() <= 0) {
-            BaseResponseUtils.buildFail(IrrigateResultCode.PLEASE_INPUT_PROJECT_ID.getMessage());
+            BaseResponseUtils.buildFail(IrrigateResultCode.PLEASE_INPUT_CROP_ID.getMessage());
         }
         Long cropId = Long.parseLong(map.get("id").toString());
         try {
             Integer rows = cropSv.deleteCrop(cropId);
             if (rows == 0) {
-                return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_PROJECT_FAIL.getMessage());
+                return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_CROP_FAIL.getMessage());
             }
         } catch (Exception e) {
             log.error("鍒犻櫎浣滅墿寮傚父", e);
@@ -142,7 +142,7 @@
         try {
             Integer rec = Optional.ofNullable(cropSv.updateCrop(po)).orElse(0);
             if (rec == 0) {
-                return BaseResponseUtils.buildFail(IrrigateResultCode.UPDATE_PROJECT_FAIL.getMessage());
+                return BaseResponseUtils.buildFail(IrrigateResultCode.UPDATE_CROP_FAIL.getMessage());
             }
         } catch (Exception e) {
             log.error("淇敼浣滅墿寮傚父", e);
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateGroup/IrrigateGroupCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateGroup/IrrigateGroupCtrl.java
index e3d4abe..aaed9d3 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateGroup/IrrigateGroupCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateGroup/IrrigateGroupCtrl.java
@@ -71,7 +71,7 @@
         try {
             Integer rec = Optional.ofNullable(irrigateGroupSv.addIrrigateGroup(po)).orElse(0);
             if (rec == 0) {
-                return BaseResponseUtils.buildFail(IrrigateResultCode.ADD_PROJECT_FAIL.getMessage());
+                return BaseResponseUtils.buildFail(IrrigateResultCode.ADD_GROUP_FAIL.getMessage());
             }
         } catch (Exception e) {
             log.error("鍒涘缓杞亴缁勫紓甯�", e);
@@ -100,13 +100,13 @@
     @SsoAop()
     public BaseResponse<Boolean> delete(@RequestBody Map map) {
         if (map == null || map.size() <= 0) {
-            BaseResponseUtils.buildFail(IrrigateResultCode.PLEASE_INPUT_PROJECT_ID.getMessage());
+            BaseResponseUtils.buildFail(IrrigateResultCode.PLEASE_INPUT_GROUP_ID.getMessage());
         }
         Long groupId = Long.parseLong(map.get("id").toString());
         try {
             Integer rows = irrigateGroupSv.deleteIrrigateGroup(groupId);
             if (rows == 0) {
-                return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_PROJECT_FAIL.getMessage());
+                return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_GROUP_FAIL.getMessage());
             }
         } catch (Exception e) {
             log.error("鍒犻櫎杞亴缁勫紓甯�", e);
@@ -134,7 +134,7 @@
             try {
                 Integer rows = irrigateGroupSv.deleteIrrigateGroup(groupId);
                 if (rows == 0) {
-                    return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_PROJECT_FAIL.getMessage());
+                    return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_GROUP_FAIL.getMessage());
                 }
             } catch (Exception e) {
                 log.error("鍒犻櫎杞亴缁勫紓甯�", e);
@@ -170,7 +170,7 @@
         try {
             Integer rec = Optional.ofNullable(irrigateGroupSv.updateIrrigateGroup(po)).orElse(0);
             if (rec == 0) {
-                return BaseResponseUtils.buildFail(IrrigateResultCode.UPDATE_PROJECT_FAIL.getMessage());
+                return BaseResponseUtils.buildFail(IrrigateResultCode.UPDATE_GROUP_FAIL.getMessage());
             }
         } catch (Exception e) {
             log.error("淇敼杞亴缁勫紓甯�", e);
@@ -264,7 +264,7 @@
                 irGroupUnit.setOperator(operator);
                 Integer rec = Optional.ofNullable(irrigateGroupSv.addGroupUnit(irGroupUnit)).orElse(0);
                 if (rec == 0) {
-                    return BaseResponseUtils.buildFail(IrrigateResultCode.ADD_PROJECT_FAIL.getMessage());
+                    return BaseResponseUtils.buildFail(IrrigateResultCode.GROUP_ADD_UNIT_FAIL.getMessage());
                 }
             }
         } catch (Exception e) {
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateScheduling/IrrigateSchedulingCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateScheduling/IrrigateSchedulingCtrl.java
index 8874125..50cdabe 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateScheduling/IrrigateSchedulingCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateScheduling/IrrigateSchedulingCtrl.java
@@ -71,7 +71,7 @@
         try {
             Integer rec = Optional.ofNullable(irIrrigateSchedulingSv.addScheduling(po)).orElse(0);
             if (rec == 0) {
-                return BaseResponseUtils.buildFail(IrrigateResultCode.ADD_PROJECT_FAIL.getMessage());
+                return BaseResponseUtils.buildFail(IrrigateResultCode.ADD_SCHEDULING_FAIL.getMessage());
             }
         } catch (Exception e) {
             log.error("娣诲姞浣滅墿鐏屾簤鍒跺害寮傚父", e);
@@ -98,13 +98,13 @@
     @SsoAop()
     public BaseResponse<Boolean> delete(@RequestBody Map map) {
         if (map == null || map.size() <= 0) {
-            BaseResponseUtils.buildFail(IrrigateResultCode.PLEASE_INPUT_PROJECT_ID.getMessage());
+            BaseResponseUtils.buildFail(IrrigateResultCode.PLEASE_INPUT_SCHEDULING_ID.getMessage());
         }
         Long schedulingId = Long.parseLong(map.get("id").toString());
         try {
             Integer rows = irIrrigateSchedulingSv.deleteScheduling(schedulingId);
             if (rows == 0) {
-                return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_PROJECT_FAIL.getMessage());
+                return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_SCHEDULING_FAIL.getMessage());
             }
         } catch (Exception e) {
             log.error("鍒犻櫎浣滅墿鐏屾簤鍒跺害寮傚父", e);
@@ -138,7 +138,7 @@
         try {
             Integer rec = Optional.ofNullable(irIrrigateSchedulingSv.updateScheduling(po)).orElse(0);
             if (rec == 0) {
-                return BaseResponseUtils.buildFail(IrrigateResultCode.UPDATE_PROJECT_FAIL.getMessage());
+                return BaseResponseUtils.buildFail(IrrigateResultCode.UPDATE_SCHEDULING_FAIL.getMessage());
             }
         } catch (Exception e) {
             log.error("淇敼浣滅墿鐏屾簤鍒跺害寮傚父", e);
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateUnit/IrrigateUnitCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateUnit/IrrigateUnitCtrl.java
index 496e055..80700e6 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateUnit/IrrigateUnitCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateUnit/IrrigateUnitCtrl.java
@@ -71,7 +71,7 @@
         try {
             Integer rec = Optional.ofNullable(irrigateUnitSv.addIrrigateUnit(po)).orElse(0);
             if (rec == 0) {
-                return BaseResponseUtils.buildFail(IrrigateResultCode.ADD_PROJECT_FAIL.getMessage());
+                return BaseResponseUtils.buildFail(IrrigateResultCode.ADD_UNIT_FAIL.getMessage());
             }
         } catch (Exception e) {
             log.error("鍒涘缓鐏屾簤鍗曞厓寮傚父", e);
@@ -99,13 +99,13 @@
     @SsoAop()
     public BaseResponse<Boolean> delete(@RequestBody Map map) {
         if (map == null || map.size() <= 0) {
-            BaseResponseUtils.buildFail(IrrigateResultCode.PLEASE_INPUT_PROJECT_ID.getMessage());
+            BaseResponseUtils.buildFail(IrrigateResultCode.PLEASE_INPUT_UNIT_ID.getMessage());
         }
         Long unitId = Long.parseLong(map.get("id").toString());
         try {
             Integer rows = irrigateUnitSv.deleteUnit(unitId);
             if (rows == 0) {
-                return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_PROJECT_FAIL.getMessage());
+                return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_UNIT_FAIL.getMessage());
             }
         } catch (Exception e) {
             log.error("鍒犻櫎鐏屾簤鍗曞厓寮傚父", e);
@@ -132,7 +132,7 @@
             try {
                 Integer rows = irrigateUnitSv.deleteUnit(unitId);
                 if (rows == 0) {
-                    return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_PROJECT_FAIL.getMessage());
+                    return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_UNIT_FAIL.getMessage());
                 }
             } catch (Exception e) {
                 log.error("鍒犻櫎鐏屾簤鍗曞厓寮傚父", e);
@@ -167,7 +167,7 @@
         try {
             Integer rec = Optional.ofNullable(irrigateUnitSv.updateUnit(po)).orElse(0);
             if (rec == 0) {
-                return BaseResponseUtils.buildFail(IrrigateResultCode.UPDATE_PROJECT_FAIL.getMessage());
+                return BaseResponseUtils.buildFail(IrrigateResultCode.UPDATE_UNIT_FAIL.getMessage());
             }
         } catch (Exception e) {
             log.error("淇敼鐏屾簤鍗曞厓寮傚父", e);
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/result/IrrigateResultCode.java b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/result/IrrigateResultCode.java
index da259a9..c13d4b1 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/result/IrrigateResultCode.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/result/IrrigateResultCode.java
@@ -26,13 +26,40 @@
      * 鐏屾簤鍗曞厓
      */
     UNIT_ASSOCIATE_CLIENT_FAIL(20001, "鐏屾簤鍗曞厓鍒嗛厤澶辫触"),
+    ADD_UNIT_FAIL(20002, "鐏屾簤鍗曞厓娣诲姞澶辫触"),
+    PLEASE_INPUT_UNIT_ID(20003, "璇疯緭鍏ョ亴婧夊崟鍏僆D"),
+    DELETE_UNIT_FAIL(20004, "鐏屾簤鍗曞厓鍒犻櫎澶辫触"),
+    UPDATE_UNIT_FAIL(20005, "鐏屾簤鍗曞厓淇敼澶辫触"),
 
     /**
      * 杞亴缁�
      */
-    GRPUP_ASSOCIATE_CLIENT_FAIL(30001, "杞亴缁勫叧鑱斿啘鎴峰け璐�");
+    GRPUP_ASSOCIATE_CLIENT_FAIL(30001, "杞亴缁勫叧鑱斿啘鎴峰け璐�"),
+    ADD_GROUP_FAIL(30002, "杞亴缁勬坊鍔犲け璐�"),
+    PLEASE_INPUT_GROUP_ID(30003, "璇疯緭鍏ヨ疆鐏岀粍ID"),
+    DELETE_GROUP_FAIL(30004, "杞亴缁勫垹闄ゅけ璐�"),
+    UPDATE_GROUP_FAIL(30005, "杞亴缁勪慨鏀瑰け璐�"),
+    GROUP_ADD_UNIT_FAIL(30006, "杞亴缁勬坊鍔犵亴婧夊崟鍏冨け璐�"),
+    GROUP_DELETE_UNIT_FAIL(30007, "杞亴缁勭Щ闄ょ亴婧夊崟鍏冨け璐�"),
+    UPDATE_GROUP_BIND_UNIT_FAIL(30008, "淇敼杞亴缁勭粦瀹氱殑鐏屾簤鍗曞厓澶辫触"),
 
-//    ADD_IRRIGATE_UNIT_FAIL(20001, "鍒涘缓鐏屾簤鍗曞厓澶辫触"),
+    /**
+     * 浣滅墿
+     */
+    ADD_CROP_FAIL(40001, "浣滅墿娣诲姞澶辫触"),
+    PLEASE_INPUT_CROP_ID(40002, "璇疯緭鍏ヤ綔鐗㊣D"),
+    DELETE_CROP_FAIL(40003, "浣滅墿鍒犻櫎澶辫触"),
+    UPDATE_CROP_FAIL(40004, "浣滅墿淇敼澶辫触"),
+
+    /**
+     * 浣滅墿鐏屾簤鍒跺害
+     */
+    ADD_SCHEDULING_FAIL(50001, "浣滅墿鐏屾簤鍒跺害娣诲姞澶辫触"),
+    PLEASE_INPUT_SCHEDULING_ID(50002, "璇疯緭鍏ヤ綔鐗╃亴婧夊埗搴D"),
+    DELETE_SCHEDULING_FAIL(50003, "浣滅墿鐏屾簤鍒跺害鍒犻櫎澶辫触"),
+    UPDATE_SCHEDULING_FAIL(50004, "浣滅墿鐏屾簤鍒跺害淇敼澶辫触");
+
+
 
     private final Integer code;
     private final String message;

--
Gitblit v1.8.0