From 0639f7feede9614a98f64450792cc83f58f80a84 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 14 五月 2025 17:00:54 +0800
Subject: [PATCH] 与测控一体阀兼容
---
pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/crop/CropCtrl.java | 34 ++++++++++++++++++++++++++++------
1 files changed, 28 insertions(+), 6 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 9634945..a3b5ec8 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
@@ -8,9 +8,8 @@
import com.dy.pipIrrGlobal.pojoIr.IrCrop;
import com.dy.pipIrrGlobal.pojoIr.IrProject;
import com.dy.pipIrrGlobal.voIr.VoCrop;
-import com.dy.pipIrrGlobal.voIr.VoProject;
+import com.dy.pipIrrGlobal.voIr.VoCropOne;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
-import com.dy.pipIrrIrrigate.crop.QueryVo;
import com.dy.pipIrrIrrigate.result.IrrigateResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
@@ -72,7 +71,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);
@@ -100,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_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);
@@ -140,7 +139,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);
@@ -174,4 +173,27 @@
return BaseResponseUtils.buildException(e.getMessage());
}
}
+
+ /**
+ * 鑾峰彇涓�涓綔鐗╂暟鎹�
+ *
+ * @return 鑾峰彇涓�涓綔鐗╂暟鎹�
+ */
+ @Operation(summary = "鑾峰彇涓�涓綔鐗╂暟鎹�", description = "鑾峰彇涓�涓綔鐗╂暟鎹�")
+ @ApiResponses(value = {
+ @ApiResponse(
+ responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
+ description = "鑾峰彇涓�涓綔鐗╂暟鎹紙BaseResponse.content:{}锛�",
+ content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
+ schema = @Schema(implementation = IrProject.class))}
+ )
+ })
+ @GetMapping(path = "one")
+ @SsoAop()
+ public BaseResponse<VoCropOne> one(@RequestParam Long id) {
+ VoCropOne irCrop = this.cropSv.selectById(id);
+
+ return BaseResponseUtils.buildSuccess(irCrop);
+
+ }
}
--
Gitblit v1.8.0