| | |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private CommandSv commandSv; |
| | | |
| | | @Value("${webchat.irr.plan.delay}") |
| | | private Integer irrPlanDelay ;//轮灌中计划开阀的延迟时长 |
| | | |
| | | private static final Integer irrPlanDelayDefault = 5 ;//轮灌中计划开阀的默认延迟时长 |
| | | |
| | | /** |
| | | * 添加灌溉计划 |
| | |
| | | LocalDateTime startTime = planStartTime.toInstant().atZone(ZoneId.systemDefault()) .toLocalDateTime(); |
| | | if(startupMode == 1){ |
| | | // 测试阶段延后2分钟,正式发布为5分钟 |
| | | startTime = startTime.plusMinutes(2); |
| | | //startTime = startTime.plusMinutes(2); |
| | | //startTime = startTime.plusMinutes(5); |
| | | if(irrPlanDelay == null || irrPlanDelay <= 0) { |
| | | irrPlanDelay = irrPlanDelayDefault ; |
| | | } |
| | | startTime = startTime.plusMinutes(irrPlanDelay); |
| | | } |
| | | planStartTime = Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()); |
| | | LocalDateTime stopTime = startTime.plusMinutes(duration); |
| | |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | private Integer updatePlanTimes(Date planStartTime, Date planEndTime, Long planId){ |
| | | Integer updatePlanTimes(Date planStartTime, Date planEndTime, Long planId){ |
| | | return irrigatePlanMapper.updatePlanTimes(planStartTime, planEndTime, planId); |
| | | } |
| | | |