From 12b4a1b101755de3ff430454b67350cd102b1667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=BE=E5=AF=8C=E6=96=8C?= Date: Tue, 26 Aug 2025 17:29:48 +0800 Subject: [PATCH] =?UTF-8?q?feat=20(farm):=20=E6=A8=A1=E5=9E=8B=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 生命周期字段 --- .../CropFarmingCenterController.java | 2 +- .../modelmanagement/vo/ModelManagementRespVO.java | 4 ++++ .../yudao/module/farm/enums/CommonConstants.java | 14 ++++++++++---- .../ModelManagementServiceImpl.java | 4 ++-- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/cropFarmingCenter/CropFarmingCenterController.java b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/cropFarmingCenter/CropFarmingCenterController.java index 7b1de431..297311b7 100644 --- a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/cropFarmingCenter/CropFarmingCenterController.java +++ b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/cropFarmingCenter/CropFarmingCenterController.java @@ -77,7 +77,7 @@ public class CropFarmingCenterController { @DeleteMapping("/production-plan/delete") - @Operation(summary = "删除种植中心-生产计划-生产计划") + @Operation(summary = "生产计划-删除") @Parameter(name = "id", description = "编号", required = true) public CommonResult deleteProductionPlan(@RequestParam("id") String id) { cropFarmingCenterService.deleteProductionPlan(id); diff --git a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/modelmanagement/vo/ModelManagementRespVO.java b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/modelmanagement/vo/ModelManagementRespVO.java index b56297f6..d462e37d 100644 --- a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/modelmanagement/vo/ModelManagementRespVO.java +++ b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/modelmanagement/vo/ModelManagementRespVO.java @@ -40,6 +40,10 @@ public class ModelManagementRespVO { @ExcelProperty("生命周期") private String cycle; + @Schema(description = "生命周期-名称") + @ExcelProperty("生命周期-名称") + private String cycleName; + @Schema(description = "产量参考") @ExcelProperty("产量参考") private String harvest; diff --git a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/enums/CommonConstants.java b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/enums/CommonConstants.java index d5ed636b..33b19b3f 100644 --- a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/enums/CommonConstants.java +++ b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/enums/CommonConstants.java @@ -18,8 +18,6 @@ public class CommonConstants { public final static Integer NO_CODE = 0; public final static String NO_NAME = "否"; - - // 1:未开始;2:进行中;3:已完成;4:逾期 public final static Integer PLAN_STATUS_1 = 1; public final static Integer PLAN_STATUS_2 = 2; public final static Integer PLAN_STATUS_3 = 3; @@ -28,8 +26,13 @@ public class CommonConstants { public final static Integer PLAN_STATUS_6 = 6; public final static Integer PLAN_STATUS_7 = 7; - public static Map PLAN_MAP = new HashMap<>(); - static{ + public final static Integer LIFE_CYCLE_NAME_1 = 1; + public final static Integer LIFE_CYCLE_NAME_2 = 10; + + public static Map PLAN_MAP = new HashMap<>(); + public static Map LIFE_CYCLE_MAP = new HashMap<>(); + + static { PLAN_MAP.put(PLAN_STATUS_1, "未开始"); PLAN_MAP.put(PLAN_STATUS_2, "进行中"); PLAN_MAP.put(PLAN_STATUS_3, "已完成"); @@ -37,6 +40,9 @@ public class CommonConstants { PLAN_MAP.put(PLAN_STATUS_5, "逾期未开始"); PLAN_MAP.put(PLAN_STATUS_6, "逾期未结束"); PLAN_MAP.put(PLAN_STATUS_7, "已结束"); + + LIFE_CYCLE_MAP.put("1", "一年生"); + LIFE_CYCLE_MAP.put("10", "多年生"); } // 模型类型 (1:模型模板; 2:引用案例) diff --git a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/modelmanagement/ModelManagementServiceImpl.java b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/modelmanagement/ModelManagementServiceImpl.java index 0759f098..a25e4148 100644 --- a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/modelmanagement/ModelManagementServiceImpl.java +++ b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/modelmanagement/ModelManagementServiceImpl.java @@ -43,8 +43,7 @@ import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser; -import static cn.iocoder.yudao.module.farm.enums.CommonConstants.COMMON_DISASTER; -import static cn.iocoder.yudao.module.farm.enums.CommonConstants.WEATHER_DISASTER; +import static cn.iocoder.yudao.module.farm.enums.CommonConstants.*; import static cn.iocoder.yudao.module.farm.enums.ErrorCodeConstants.MODEL_MANAGEMENT_NOT_EXISTS; /** @@ -263,6 +262,7 @@ public class ModelManagementServiceImpl implements ModelManagementService { // 使用统一的转换方法 ModelManagementRespVO bean = ModelManagementConvertUtil.convertToRespVO(modelManagementDO); + bean.setCycleName(LIFE_CYCLE_MAP.get(bean.getCycle())); // 设置模型周期信息 List vos = new ArrayList<>();