feat (farm): 模型管理

- 添加 生命周期字段
This commit is contained in:
达富斌
2025-08-26 17:29:48 +08:00
parent f5227ef6f7
commit 12b4a1b101
4 changed files with 17 additions and 7 deletions

View File

@@ -77,7 +77,7 @@ public class CropFarmingCenterController {
@DeleteMapping("/production-plan/delete") @DeleteMapping("/production-plan/delete")
@Operation(summary = "删除种植中心-生产计划-生产计划") @Operation(summary = "生产计划-删除")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
public CommonResult<Boolean> deleteProductionPlan(@RequestParam("id") String id) { public CommonResult<Boolean> deleteProductionPlan(@RequestParam("id") String id) {
cropFarmingCenterService.deleteProductionPlan(id); cropFarmingCenterService.deleteProductionPlan(id);

View File

@@ -40,6 +40,10 @@ public class ModelManagementRespVO {
@ExcelProperty("生命周期") @ExcelProperty("生命周期")
private String cycle; private String cycle;
@Schema(description = "生命周期-名称")
@ExcelProperty("生命周期-名称")
private String cycleName;
@Schema(description = "产量参考") @Schema(description = "产量参考")
@ExcelProperty("产量参考") @ExcelProperty("产量参考")
private String harvest; private String harvest;

View File

@@ -18,8 +18,6 @@ public class CommonConstants {
public final static Integer NO_CODE = 0; public final static Integer NO_CODE = 0;
public final static String NO_NAME = "否"; public final static String NO_NAME = "否";
// 1:未开始;2:进行中;3:已完成;4:逾期
public final static Integer PLAN_STATUS_1 = 1; public final static Integer PLAN_STATUS_1 = 1;
public final static Integer PLAN_STATUS_2 = 2; public final static Integer PLAN_STATUS_2 = 2;
public final static Integer PLAN_STATUS_3 = 3; public final static Integer PLAN_STATUS_3 = 3;
@@ -28,7 +26,12 @@ public class CommonConstants {
public final static Integer PLAN_STATUS_6 = 6; public final static Integer PLAN_STATUS_6 = 6;
public final static Integer PLAN_STATUS_7 = 7; public final static Integer PLAN_STATUS_7 = 7;
public final static Integer LIFE_CYCLE_NAME_1 = 1;
public final static Integer LIFE_CYCLE_NAME_2 = 10;
public static Map<Integer, String> PLAN_MAP = new HashMap<>(); public static Map<Integer, String> PLAN_MAP = new HashMap<>();
public static Map<String, String> LIFE_CYCLE_MAP = new HashMap<>();
static { static {
PLAN_MAP.put(PLAN_STATUS_1, "未开始"); PLAN_MAP.put(PLAN_STATUS_1, "未开始");
PLAN_MAP.put(PLAN_STATUS_2, "进行中"); PLAN_MAP.put(PLAN_STATUS_2, "进行中");
@@ -37,6 +40,9 @@ public class CommonConstants {
PLAN_MAP.put(PLAN_STATUS_5, "逾期未开始"); PLAN_MAP.put(PLAN_STATUS_5, "逾期未开始");
PLAN_MAP.put(PLAN_STATUS_6, "逾期未结束"); PLAN_MAP.put(PLAN_STATUS_6, "逾期未结束");
PLAN_MAP.put(PLAN_STATUS_7, "已结束"); PLAN_MAP.put(PLAN_STATUS_7, "已结束");
LIFE_CYCLE_MAP.put("1", "一年生");
LIFE_CYCLE_MAP.put("10", "多年生");
} }
// 模型类型 (1:模型模板; 2:引用案例) // 模型类型 (1:模型模板; 2:引用案例)

View File

@@ -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.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser; 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.*;
import static cn.iocoder.yudao.module.farm.enums.CommonConstants.WEATHER_DISASTER;
import static cn.iocoder.yudao.module.farm.enums.ErrorCodeConstants.MODEL_MANAGEMENT_NOT_EXISTS; 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); ModelManagementRespVO bean = ModelManagementConvertUtil.convertToRespVO(modelManagementDO);
bean.setCycleName(LIFE_CYCLE_MAP.get(bean.getCycle()));
// 设置模型周期信息 // 设置模型周期信息
List<ModelCycleRespVO> vos = new ArrayList<>(); List<ModelCycleRespVO> vos = new ArrayList<>();