feat (farm): 定时器: 种植中心-生产计划
- 更新任务状态 - 更新地块面积 - 创建农事记录
This commit is contained in:
@@ -8,7 +8,7 @@ import java.lang.annotation.Target;
|
||||
/**
|
||||
* 多租户 Job 注解
|
||||
*/
|
||||
@Target({ElementType.METHOD})
|
||||
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface TenantJob {
|
||||
}
|
||||
|
||||
@@ -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:引用案例)
|
||||
|
||||
@@ -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() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user