From aee3158d47cd5ffd258188a68233cf9c72a4274d Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期四, 23 五月 2024 15:18:00 +0800
Subject: [PATCH] 田间灌溉项目管理 轮灌组 实现获取未绑定轮灌组的灌溉单元id 接口
---
pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/irrigateGroup/IrrigateGroupCtrl.java | 34 +++++++++++++++++++++++++++++-----
1 files changed, 29 insertions(+), 5 deletions(-)
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 092c73d..fd7145e 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
@@ -100,16 +100,16 @@
schema = @Schema(implementation = Boolean.class))}
)
})
- @GetMapping(path = "delete")
+ @PostMapping(path = "delete")
@Transactional(rollbackFor = Exception.class)
@SsoAop()
- public BaseResponse<Boolean> delete( Long id) {
- if (id == null ) {
+ public BaseResponse<Boolean> delete(@RequestBody Map map) {
+ if (map == null || map.size() <= 0) {
BaseResponseUtils.buildFail(IrrigateResultCode.PLEASE_INPUT_PROJECT_ID.getMessage());
}
-// Long groupId = Long.parseLong(map.get("id").toString());
+ Long groupId = Long.parseLong(map.get("id").toString());
try {
- Integer rows = irrigateGroupSv.deleteIrrigateGroup(id);
+ Integer rows = irrigateGroupSv.deleteIrrigateGroup(groupId);
if (rows == 0) {
return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_PROJECT_FAIL.getMessage());
}
@@ -298,4 +298,28 @@
}
return BaseResponseUtils.buildSuccess(true);
}
+
+ @GetMapping(path = "bind_units")
+ @SsoAop()
+ public BaseResponse<List<Long>> getGroupBindUnits(Long id) {
+ try {
+ List<Long> res = irrigateGroupSv.getGroupBindUnits(id);
+ return BaseResponseUtils.buildSuccess(res);
+ } catch (Exception e) {
+ log.error("鑾峰彇涓�涓疆鐏岀粍缁戝畾鐏屾簤鍗曞厓璁板綍寮傚父", e);
+ return BaseResponseUtils.buildException(e.getMessage());
+ }
+ }
+
+ @GetMapping(path = "notBind_units")
+ @SsoAop()
+ public BaseResponse<List<Long>> getNotBindUnits() {
+ try {
+ List<Long> res = irrigateGroupSv.getNotBindUnits();
+ return BaseResponseUtils.buildSuccess(res);
+ } catch (Exception e) {
+ log.error("鑾峰彇鏈粦瀹氳疆鐏岀粍鐨勭亴婧夊崟鍏僫d璁板綍寮傚父", e);
+ return BaseResponseUtils.buildException(e.getMessage());
+ }
+ }
}
--
Gitblit v1.8.0