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 7914bf7f..e785aefc 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 @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo.ProductionPlanUpdateReqVO; import cn.iocoder.yudao.module.farm.controller.admin.farmingrecord.vo.FarmingRecordPageReqVO; import cn.iocoder.yudao.module.farm.controller.admin.farmingrecord.vo.FarmingRecordRespVO; import cn.iocoder.yudao.module.farm.controller.admin.farmingrecord.vo.FarmingRecordSaveReqVO; @@ -40,14 +41,11 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; public class CropFarmingCenterController { private final CropFarmingCenterService cropFarmingCenterService; - private final ProductionPlanService productionPlanService; private final FarmingRecordService farmingRecordService; public CropFarmingCenterController(CropFarmingCenterService cropFarmingCenterService, - ProductionPlanService productionPlanService, FarmingRecordService farmingRecordService) { this.cropFarmingCenterService = cropFarmingCenterService; - this.productionPlanService = productionPlanService; this.farmingRecordService = farmingRecordService; } @@ -56,9 +54,9 @@ public class CropFarmingCenterController { // 生产计划 @GetMapping("/production-plan/page") @Operation(summary = "生产计划-分页") - public CommonResult> getProductionPlanPage(@Valid ProductionPlanPageReqVO pageReqVO) { - PageResult pageResult = productionPlanService.getProductionPlanPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, ProductionPlanRespVO.class)); + public CommonResult> getProductionPlanPage(@Valid cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo.ProductionPlanPageReqVO pageReqVO) { + PageResult pageResult = cropFarmingCenterService.getProductionPlanPage(pageReqVO); + return success(pageResult); } @GetMapping("/production-plan/get/{id}") @@ -77,15 +75,12 @@ public class CropFarmingCenterController { @PutMapping("/production-plan/update") @Operation(summary = "生产计划-编辑") - public CommonResult updateProductionPlan(@Valid @RequestBody ProductionPlanSaveReqVO updateReqVO) { - productionPlanService.updateProductionPlan(updateReqVO); + public CommonResult updateProductionPlan(@Valid @RequestBody ProductionPlanUpdateReqVO updateReqVO) { + cropFarmingCenterService.updateProductionPlan(updateReqVO); return success(true); } - - - // 农事记录 @GetMapping("/farming-record/page") @Operation(summary = "农事记录-分页") diff --git a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/cropFarmingCenter/vo/ProductionPlanPageReqVO.java b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/cropFarmingCenter/vo/ProductionPlanPageReqVO.java index bae6e2fd..bf228b24 100644 --- a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/cropFarmingCenter/vo/ProductionPlanPageReqVO.java +++ b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/cropFarmingCenter/vo/ProductionPlanPageReqVO.java @@ -1,6 +1,13 @@ package cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDate; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; /** * @description: 分页请求实体 @@ -8,11 +15,19 @@ import lombok.Data; * @date: 2025/8/20 17:58 */ @Data -public class ProductionPlanPageReqVO { - +public class ProductionPlanPageReqVO extends PageParam { + @Schema(description = "基地id", example = "29734") + private String baseId; + @Schema(description = "地块ID", example = "19246") + private String plotId; + @Schema(description = "排产开始日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDate[] productionStartDate; + @Schema(description = "计划执行状态") + private Integer planStatus; } diff --git a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/cropFarmingCenter/vo/ProductionPlanRespVO.java b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/cropFarmingCenter/vo/ProductionPlanRespVO.java index 49f0bb41..ee1f4fca 100644 --- a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/cropFarmingCenter/vo/ProductionPlanRespVO.java +++ b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/cropFarmingCenter/vo/ProductionPlanRespVO.java @@ -37,6 +37,8 @@ public class ProductionPlanRespVO { @Schema(description = "计划执行状态") private Integer planStatus; + @Schema(description = "计划执行状态-名称") + private String planStatusName; @Schema(description = "租户ID") diff --git a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/dict/DictController.java b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/dict/DictController.java index 6918045e..8ebab719 100644 --- a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/dict/DictController.java +++ b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/dict/DictController.java @@ -28,6 +28,7 @@ import cn.iocoder.yudao.module.farm.dal.dataobject.inputlibrary.InputLibraryDO; import cn.iocoder.yudao.module.farm.dal.dataobject.speciesclassifylibrary.SpeciesClassifyLibraryDO; import cn.iocoder.yudao.module.farm.dal.dataobject.specieslibrary.SpeciesLibraryDO; import cn.iocoder.yudao.module.farm.dal.mysql.sysDict.SysDictDO; +import cn.iocoder.yudao.module.farm.enums.CommonConstants; import cn.iocoder.yudao.module.farm.service.disasterdata.DisasterDataService; import cn.iocoder.yudao.module.farm.service.farmingnamemaintenance.FarmingNameMaintenanceService; import cn.iocoder.yudao.module.farm.service.farmingtypemaintenance.FarmingTypeMaintenanceService; @@ -36,13 +37,15 @@ import cn.iocoder.yudao.module.farm.service.speciesclassifylibrary.SpeciesClassi import cn.iocoder.yudao.module.farm.service.specieslibrary.SpeciesLibraryService; import cn.iocoder.yudao.module.farm.service.sysDict.SysDictService; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; +import org.redisson.misc.Hash; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.Arrays; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @@ -190,9 +193,6 @@ public class DictController { return success(true); } - // 物种类别维护 todo 后续 - - // 投入品维护 @Operation(summary = "字典数据维护-投入品-分页") @GetMapping("/invest-goods/page") @@ -275,10 +275,35 @@ public class DictController { @Operation(summary = "字典数据维护-下拉框列表-物种类别") @GetMapping("/list/species-classify-library") public CommonResult> getSpeciesClassifyLibraryList() { - List res = speciesClassifyLibraryService.getSpeciesClassifyLibraryList(); - return success(BeanUtils.toBean(res, SpeciesClassifyLibraryRespVO.class)); + + List list = sysDictService.getByTypeCode(CommonConstants.DICT_TYPE_CODE_3); + Map parentMap = list.stream() + .collect(Collectors.toMap( + SysDictDO::getField1Code, // key: field1Code + SysDictDO::getField1Name, // value: field1Name + (existing, replacement) -> existing // 处理重复key,保留现有值 + )); + + List parentList = new ArrayList<>(); + for (Map.Entry entry : parentMap.entrySet()) { + String key = entry.getKey(); + SpeciesClassifyLibraryRespVO pVO = new SpeciesClassifyLibraryRespVO(key, entry.getValue()); + + List childList = new ArrayList<>(); + for (SysDictDO e : list) { + if (e.getField1Code().equals(key)) { + childList.add(new SpeciesClassifyLibraryRespVO(e.getField2Code(),e.getField2Name())); + } + } + pVO.setChildren(childList); + parentList.add(pVO); + } + + return success(parentList); } + + @Operation(summary = "字典数据维护-下拉框列表-通用字典分类查询") @GetMapping("/list/{dictTypeCode}") public CommonResult> getSysDictList(@PathVariable("dictTypeCode") String dictTypeCode) { diff --git a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/dict/vo/SpeciesClassifyLibraryRespVO.java b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/dict/vo/SpeciesClassifyLibraryRespVO.java index e0e71dfe..43e368bc 100644 --- a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/dict/vo/SpeciesClassifyLibraryRespVO.java +++ b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/dict/vo/SpeciesClassifyLibraryRespVO.java @@ -1,7 +1,11 @@ package cn.iocoder.yudao.module.farm.controller.admin.dict.vo; import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; /** * @description: 物种分类 @@ -9,17 +13,22 @@ import lombok.Data; * @date: 2025/8/17 16:43 */ @Data +@AllArgsConstructor +@NoArgsConstructor public class SpeciesClassifyLibraryRespVO { @Schema(description = "ID") private String id; @Schema(description = "一级分类-编码") - private String primaryClassCode; + private String SpeciesClassCode; @Schema(description = "一级分类-名称") - private String primaryClassName; - @Schema(description = "二级分类-编码") - private String secondaryClassCode; - @Schema(description = "二级分类-名称") - private String secondaryClassName; + private String SpeciesClassName; @Schema(description = "使用状态") private String useStatus; + + private List children; + + public SpeciesClassifyLibraryRespVO(String speciesClassCode, String speciesClassName) { + SpeciesClassCode = speciesClassCode; + SpeciesClassName = speciesClassName; + } } diff --git a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/productionplan/ProductionPlanMapper.java b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/productionplan/ProductionPlanMapper.java index 11650a20..7dbc6035 100644 --- a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/productionplan/ProductionPlanMapper.java +++ b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/productionplan/ProductionPlanMapper.java @@ -18,20 +18,27 @@ public interface ProductionPlanMapper extends BaseMapperX { Double getTotalArea(Long tenantId); -// default PageResult selectPage(ProductionPlanPageReqVO reqVO) { -// return selectPage(reqVO, new LambdaQueryWrapperX() -// .eqIfPresent(ProductionPlanDO::getPlantSpecies, reqVO.getPlantSpecies()) -// .eqIfPresent(ProductionPlanDO::getSpeciesModel, reqVO.getSpeciesModel()) -// .betweenIfPresent(ProductionPlanDO::getProductionStartDate, reqVO.getProductionStartDate()) -// .betweenIfPresent(ProductionPlanDO::getProductionEndDate, reqVO.getProductionEndDate()) -// .betweenIfPresent(ProductionPlanDO::getHarvestStartDate, reqVO.getHarvestStartDate()) -// .eqIfPresent(ProductionPlanDO::getCultivationAreaId, reqVO.getCultivationAreaId()) -// .eqIfPresent(ProductionPlanDO::getBaseId, reqVO.getBaseId()) -// .likeIfPresent(ProductionPlanDO::getBaseName, reqVO.getBaseName()) -// .eqIfPresent(ProductionPlanDO::getPlotId, reqVO.getPlotId()) -// .likeIfPresent(ProductionPlanDO::getPlotName, reqVO.getPlotName()) -// .betweenIfPresent(ProductionPlanDO::getCreateTime, reqVO.getCreateTime()) -// .orderByDesc(ProductionPlanDO::getCreateTime)); -// } + default PageResult selectPage(ProductionPlanPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .betweenIfPresent(ProductionPlanDO::getProductionStartDate, reqVO.getProductionStartDate()) + .betweenIfPresent(ProductionPlanDO::getProductionEndDate, reqVO.getProductionEndDate()) + .betweenIfPresent(ProductionPlanDO::getHarvestStartDate, reqVO.getHarvestStartDate()) + .eqIfPresent(ProductionPlanDO::getBaseId, reqVO.getBaseId()) + .likeIfPresent(ProductionPlanDO::getBaseName, reqVO.getBaseName()) + .eqIfPresent(ProductionPlanDO::getPlotId, reqVO.getPlotId()) + .likeIfPresent(ProductionPlanDO::getPlotName, reqVO.getPlotName()) + .betweenIfPresent(ProductionPlanDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(ProductionPlanDO::getCreateTime) + ); + } + + default PageResult selectPage2(cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo.ProductionPlanPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .betweenIfPresent(ProductionPlanDO::getProductionStartDate, reqVO.getProductionStartDate()) + .eqIfPresent(ProductionPlanDO::getBaseId, reqVO.getBaseId()) + .eqIfPresent(ProductionPlanDO::getPlotId, reqVO.getPlotId()) + .orderByDesc(ProductionPlanDO::getCreateTime) + ); + } } \ No newline at end of file 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 092a24e0..adfd02d0 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 @@ -1,5 +1,8 @@ package cn.iocoder.yudao.module.farm.enums; +import java.util.HashMap; +import java.util.Map; + /** * @description: 通用常量 * @author: binda @@ -20,12 +23,24 @@ public class CommonConstants { public final static Integer PLAN_STATUS_3 = 3; public final static Integer PLAN_STATUS_4 = 4; + public static Map PLAN_MAP = new HashMap<>(); + static{ + PLAN_MAP.put(1, "未开始"); + PLAN_MAP.put(2, "进行中"); + PLAN_MAP.put(3, "已完成"); + PLAN_MAP.put(4, "逾期"); + } + // 模型类型 (1:模型模板; 2:引用案例) public final static Integer MODEL_TYPE_1 = 1; public final static Integer MODEL_TYPE_2 = 1; - - public final static String DICT_TYPE_CODE_1 = "common_disaster"; + /** + * 字典类型名称 + */ + public final static String DICT_TYPE_CODE_1 = "common_disaster"; // 一般灾害 + public final static String DICT_TYPE_CODE_2 = "weather_disaster"; // 气象灾害 + public final static String DICT_TYPE_CODE_3 = "species_classify_library"; // 物种类别 } diff --git a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/cropFarmingCenter/CropFarmingCenterService.java b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/cropFarmingCenter/CropFarmingCenterService.java index 3ef03c6b..7cce31c0 100644 --- a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/cropFarmingCenter/CropFarmingCenterService.java +++ b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/cropFarmingCenter/CropFarmingCenterService.java @@ -1,7 +1,10 @@ package cn.iocoder.yudao.module.farm.service.cropFarmingCenter; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo.ProductionPlanPageReqVO; import cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo.ProductionPlanRespVO; import cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo.ProductionPlanSaveReqVO; +import cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo.ProductionPlanUpdateReqVO; /** * @description: 种植中心 @@ -13,7 +16,8 @@ public interface CropFarmingCenterService { /** * 生产计划-新增 * 1份生产计划 -> n种植区域 (区域: 一个基地的某个地块,划分为多亩地,交叉种植) - * -> 1模型案例(可以修改,不影响原有模版) + * -> 1模型案例(可以修改,不影响原有模版) + * * @param * @return */ @@ -21,7 +25,10 @@ public interface CropFarmingCenterService { ProductionPlanRespVO getProductionPlan(String id); - void updateProductionPlan(ProductionPlanSaveReqVO updateReqVO); + void updateProductionPlan(ProductionPlanUpdateReqVO updateReqVO); + + PageResult getProductionPlanPage(ProductionPlanPageReqVO reqVO); + int getCropCount(Long tenantId); diff --git a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/cropFarmingCenter/CropFarmingCenterServiceImpl.java b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/cropFarmingCenter/CropFarmingCenterServiceImpl.java index 5d236c17..4ff2c592 100644 --- a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/cropFarmingCenter/CropFarmingCenterServiceImpl.java +++ b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/cropFarmingCenter/CropFarmingCenterServiceImpl.java @@ -1,16 +1,17 @@ package cn.iocoder.yudao.module.farm.service.cropFarmingCenter; import cn.hutool.core.util.IdUtil; +import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo.ProductionPlanPageReqVO; import cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo.ProductionPlanRespVO; import cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo.ProductionPlanSaveReqVO; +import cn.iocoder.yudao.module.farm.controller.admin.cropFarmingCenter.vo.ProductionPlanUpdateReqVO; import cn.iocoder.yudao.module.farm.controller.admin.modelmanagement.vo.ModelManagementRespVO; import cn.iocoder.yudao.module.farm.dal.dataobject.productionplan.ProductionPlanDO; import cn.iocoder.yudao.module.farm.dal.mysql.productionplan.ProductionPlanMapper; import cn.iocoder.yudao.module.farm.enums.CommonConstants; -import cn.iocoder.yudao.module.farm.service.cultivationarea.CultivationAreaService; -import cn.iocoder.yudao.module.farm.service.productionplan.ProductionPlanService; import cn.iocoder.yudao.module.farm.service.modelmanagement.ModelManagementService; import cn.iocoder.yudao.module.farm.utils.StrHelperUtil; import lombok.extern.slf4j.Slf4j; @@ -19,7 +20,9 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; +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.ErrorCodeConstants.PRODUCTION_PLAN_NOT_EXISTS; /** * @description: 种植中心 @@ -30,14 +33,10 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti @Slf4j public class CropFarmingCenterServiceImpl implements CropFarmingCenterService { - private final CultivationAreaService cultivationAreaService; - private final ProductionPlanService productionPlanService; private final ProductionPlanMapper productionPlanMapper; private final ModelManagementService modelManagementService; - public CropFarmingCenterServiceImpl(CultivationAreaService cultivationAreaService, ProductionPlanService productionPlanService, ProductionPlanMapper productionPlanMapper, ModelManagementService modelManagementService) { - this.cultivationAreaService = cultivationAreaService; - this.productionPlanService = productionPlanService; + public CropFarmingCenterServiceImpl(ProductionPlanMapper productionPlanMapper, ModelManagementService modelManagementService) { this.productionPlanMapper = productionPlanMapper; this.modelManagementService = modelManagementService; } @@ -80,7 +79,6 @@ public class CropFarmingCenterServiceImpl implements CropFarmingCenterService { obj.setPlotName(e.getPlotName()); obj.setTenantId(e.getTenantId()); - // 随机字符串 + 地块名称 obj.setPlanNumber(StrHelperUtil.generate() +"-"+ e.getPlotName()); obj.setId(taskId); @@ -110,8 +108,24 @@ public class CropFarmingCenterServiceImpl implements CropFarmingCenterService { } @Override - public void updateProductionPlan(ProductionPlanSaveReqVO updateReqVO) { + public void updateProductionPlan(ProductionPlanUpdateReqVO updateReqVO) { + validateProductionPlanExists(updateReqVO.getId()); + productionPlanMapper.updateById(BeanUtils.toBean(updateReqVO, ProductionPlanDO.class)); + } + @Override + public PageResult getProductionPlanPage(ProductionPlanPageReqVO reqVO) { + + PageResult productionPlanDOPageResult = productionPlanMapper.selectPage2(reqVO); + PageResult result = BeanUtils.toBean(productionPlanDOPageResult, ProductionPlanRespVO.class); + result.getList().forEach(e -> { + + ModelManagementRespVO modelManagementRespVO = modelManagementService.getModelManagement(e.getSpeciesModelId()); + e.setModelManagementRespVO(modelManagementRespVO); + + }); + + return result; } @Override @@ -123,4 +137,10 @@ public class CropFarmingCenterServiceImpl implements CropFarmingCenterService { public Double getTotalArea(Long tenantId) { return productionPlanMapper.getTotalArea(tenantId); } + + private void validateProductionPlanExists(String id) { + if (productionPlanMapper.selectById(id) == null) { + throw exception(PRODUCTION_PLAN_NOT_EXISTS); + } + } } diff --git a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/productionplan/ProductionPlanServiceImpl.java b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/productionplan/ProductionPlanServiceImpl.java index 74568351..3e79157c 100644 --- a/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/productionplan/ProductionPlanServiceImpl.java +++ b/yudao-module-farm/src/main/java/cn/iocoder/yudao/module/farm/service/productionplan/ProductionPlanServiceImpl.java @@ -89,7 +89,7 @@ public class ProductionPlanServiceImpl implements ProductionPlanService { @Override public PageResult getProductionPlanPage(ProductionPlanPageReqVO pageReqVO) { -// productionPlanMapper.selectPage(pageReqVO); + productionPlanMapper.selectPage(pageReqVO); return null; }