zhubaomin
2025-02-21 1f19230e00b543b58f03853df1a38ebd8b508e55
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanSv.java
@@ -1,11 +1,11 @@
package com.dy.pipIrrWechat.irrigatePlan;
import com.dy.pipIrrGlobal.daoIr.IrIrrigateGroupMapper;
import com.dy.pipIrrGlobal.daoIr.IrIrrigatePlanMapper;
import com.dy.pipIrrGlobal.daoIr.IrIrrigateScheduleMapper;
import com.dy.pipIrrGlobal.daoIr.IrIrrigateUnitMapper;
import com.dy.pipIrrGlobal.daoIr.*;
import com.dy.pipIrrGlobal.pojoIr.IrIrrigatePlan;
import com.dy.pipIrrGlobal.pojoIr.IrIrrigateSchedule;
import com.dy.pipIrrGlobal.pojoIr.IrOpeningSchedule;
import com.dy.pipIrrGlobal.pojoIr.IrPlanOperate;
import com.dy.pipIrrGlobal.voIr.VoIrrigateSchedule;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -26,7 +26,13 @@
    private IrIrrigatePlanMapper irrigatePlanMapper;
    @Autowired
    private IrPlanOperateMapper irPlanOperateMapper;
    @Autowired
    private IrIrrigateScheduleMapper irIrrigateScheduleMapper;
    @Autowired
    private IrOpeningScheduleMapper irOpeningScheduleMapper;
    @Autowired
    private IrIrrigateGroupMapper irIrrigateGroupMapper;
@@ -35,12 +41,31 @@
    private IrIrrigateUnitMapper irIrrigateUnitMapper;
    /**
     * 添加灌溉计划记录
     * 添加灌溉计划
     * @param po
     * @return
     */
    public Long addIrrigatePlan(IrIrrigatePlan po) {
        irrigatePlanMapper.insert(po);
        return po.getId();
    }
    /**
     * 发布指定的灌溉计划
     * @param planId
     * @return
     */
    public Integer publishIrrigatePlan(Long planId) {
        return irrigatePlanMapper.publishIrrigatePlan(planId);
    }
    /**
     * 添加灌溉计划操作记录
     * @param po
     * @return
     */
    public Long addPlanOperate(IrPlanOperate po) {
        irPlanOperateMapper.insert(po);
        return po.getId();
    }
@@ -55,6 +80,25 @@
    }
    /**
     * 根据计划ID获取灌溉次序
     * @param planId
     * @return
     */
    public List<VoIrrigateSchedule> getIrrigateSchedules(Long planId) {
        return irIrrigateScheduleMapper.getIrrigateSchedules(planId);
    }
    /**
     * 添加开阀计划
     * @param po
     * @return
     */
    public Long addOpeningSchedule(IrOpeningSchedule po) {
        irOpeningScheduleMapper.insert(po);
        return po.getId();
    }
    /**
     * 根据轮灌组ID获取取水口ID列表
     * @param groupId
     * @return