From 1cf88d43994ec7ec403319032a9d118b39fe3571 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期五, 25 四月 2025 14:35:35 +0800 Subject: [PATCH] 登录代码优化 --- pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanSv.java | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanSv.java index e9c674f..cdc76d5 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanSv.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-wechat/src/main/java/com/dy/pipIrrWechat/irrigatePlan/IrrigatePlanSv.java @@ -18,6 +18,7 @@ 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; @@ -67,6 +68,11 @@ @Autowired private CommandSv commandSv; + + @Value("${webchat.irr.plan.delay}") + private Integer irrPlanDelay ;//杞亴涓鍒掑紑闃�鐨勫欢杩熸椂闀� + + private static final Integer irrPlanDelayDefault = 5 ;//杞亴涓鍒掑紑闃�鐨勯粯璁ゅ欢杩熸椂闀� /** * 娣诲姞鐏屾簤璁″垝 @@ -179,8 +185,12 @@ 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); @@ -527,7 +537,7 @@ } @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); } -- Gitblit v1.8.0