feat (farm): 定时器: 种植中心-生产计划

- 更新任务状态
- 更新地块面积
- 创建农事记录
This commit is contained in:
达富斌
2025-08-25 16:31:55 +08:00
parent 6bf1d0a8fa
commit efd19163ed
3 changed files with 68 additions and 1 deletions

View File

@@ -29,6 +29,7 @@ public class CommonConstants {
PLAN_MAP.put(2, "进行中");
PLAN_MAP.put(3, "已完成");
PLAN_MAP.put(4, "逾期");
PLAN_MAP.put(5, "已结束");
}
// 模型类型 (1:模型模板; 2:引用案例)

View File

@@ -0,0 +1,66 @@
package cn.iocoder.yudao.module.farm.scheduled;
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
import cn.iocoder.yudao.module.farm.service.farmingrecord.FarmingRecordService;
import cn.iocoder.yudao.module.farm.service.productionplan.ProductionPlanService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @description: 生产计划
* 表关系
* 模型管理: farm_model_management
* 模型管理-管理周期: farm_model_cycle
* 模型管理-管理周期-环境指标: farm_model_environment_index
* 模型管理-管理周期-病虫草害: farm_model_pest_disease_weed
* 模型管理-管理周期-气象灾害: farm_model_weather_disaster
* 模型管理-管理周期-农事事操: farm_model_farming_operation
* 模型管理-管理周期-农事操作-投入品: farm_model_farming_operation_input
* @author: binda
* @date: 2025/8/22 17:12
*/
@Component
@TenantJob
@Slf4j
public class ProductionPlanJob implements JobHandler {
private final ProductionPlanService productionPlanService;
private final FarmingRecordService farmingRecordService;
public ProductionPlanJob(ProductionPlanService productionPlanService, FarmingRecordService farmingRecordService) {
this.productionPlanService = productionPlanService;
this.farmingRecordService = farmingRecordService;
}
/**
* 1. 更新任务状态
* 2. 更新地块面积
* 3. 创建农事记录
*
* @param param 参数
* @return
* @throws Exception
*/
@Override
public String execute(String param) throws Exception {
this.updatePlanStatusHandler();
this.updatePlanAreaHandler();
this.insertRecordHandler();
return "success";
}
private void updatePlanStatusHandler() {
}
private void updatePlanAreaHandler() {
}
private void insertRecordHandler() {
}
}