zhubaomin
2025-03-26 cf23fbd9dc25d7effe6dfb39bf703901369b78b0
pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanCtrl.java
@@ -70,6 +70,20 @@
            duration = duration + schedule.getDuration();
        }
        if(startupMode == 2){
            if(planStartTime == null) {
                return BaseResponseUtils.buildErrorMsg("自动启动模式必须指定计划启动时间");
            }
            LocalDateTime startTime = planStartTime.toInstant().atZone(ZoneId.systemDefault()) .toLocalDateTime();
            LocalDateTime currentTime = LocalDateTime.now();
            currentTime = currentTime.plusHours(8);
            if(!startTime.isAfter(currentTime)) {
                return BaseResponseUtils.buildErrorMsg("启动时间不能在8小时之内");
            }
        }
        //if(startupMode == 1){
        //    planStartTime = new Date();
        //}
@@ -208,7 +222,9 @@
            planStartTime = new Date();
        }
        LocalDateTime startTime = planStartTime.toInstant().atZone(ZoneId.systemDefault()) .toLocalDateTime();
        if(startupMode == 1){
        startTime = startTime.plusMinutes(5);
        }
        planStartTime = Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant());
        LocalDateTime stopTime = startTime.plusMinutes(duration);
        planStopTime = Date.from(stopTime.atZone(ZoneId.systemDefault()).toInstant());