zhubaomin
2025-03-26 4c78c3a6fc3fe5fbbcabc85465612a799d98587d
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanCtrl.java
@@ -2,9 +2,13 @@
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.pipIrrGlobal.pojoIr.*;
import com.dy.pipIrrGlobal.pojoIr.IrIrrigatePlan;
import com.dy.pipIrrGlobal.pojoIr.IrIrrigateSchedule;
import com.dy.pipIrrGlobal.pojoIr.IrPlanOperate;
import com.dy.pipIrrGlobal.pojoIr.IrPlanSchedule;
import com.dy.pipIrrGlobal.voIr.VoIrrigateSchedule;
import com.dy.pipIrrGlobal.voIr.VoPlanSimple;
import com.dy.pipIrrGlobal.voIr.VoPlans;
import com.dy.pipIrrWechat.command.CommandSv;
import com.dy.pipIrrWechat.command.dto.AutomaticClose;
import com.dy.pipIrrWechat.irrigatePlan.dto.IrrigatePlan;
@@ -17,10 +21,7 @@
import org.springframework.http.MediaType;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.time.ZoneId;
@@ -141,6 +142,36 @@
    }
    /**
     * 获取未完成的计划列表,小程序计划列表页使用
     * @return
     */
    @GetMapping(path = "/getNotCompletePlans")
    public BaseResponse<List<VoPlans>> getNotCompletePlans() {
        try {
            List<VoPlans> res = irrigatePlanSv.getNotCompletePlans();
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取未完的计划异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
    /**
     * 获取已完成的计划列表,小程序计划列表页使用
     * @return
     */
    @GetMapping(path = "/getCompletedPlans")
    public BaseResponse<List<VoPlans>> getCompletedPlans() {
        try {
            List<VoPlans> res = irrigatePlanSv.getCompletedPlans();
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取项目记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
    /**
     * 发布灌溉计划
     * 1. 修改灌溉计划状态为发布状态
     * 2. 添加灌溉计划操作记录