| | |
| | | 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(); |
| | | //} |
| | |
| | | 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()); |