From e00736d4027f608b45339059bd5fcd169f8fff90 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 7 Aug 2023 14:40:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E8=AD=A6debug=20=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java | 6 +++--- .../java/com/ningdatech/pmapi/sys/manage/EarlyWarningManage.java | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java index b680eec..33e3224 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java @@ -129,7 +129,7 @@ public class EarlyWarningInstanceNotStartTask { } } - if(Duration.between(LocalDateTime.now(),p.getUpdateOn()).toMinutes() >= time || //time * 60 + if(Duration.between(LocalDateTime.now(),p.getUpdateOn()).toMinutes() >= time && //time * 60 Duration.between(LocalDateTime.now(),p.getUpdateOn()).toMinutes() <= time + 1){ //time * 60 return Boolean.TRUE; } @@ -246,13 +246,13 @@ public class EarlyWarningInstanceNotStartTask { Operation operation = operationMap.get(p.getProjectCode()); if(WarningOperationTypeEnum.CHUYAN.getCode().equals(biz)){ //初验 - if(Duration.between(LocalDateTime.now(),operation.getInitialInspectionDate()).toMinutes() >= time || //time * 60 + if(Duration.between(LocalDateTime.now(),operation.getInitialInspectionDate()).toMinutes() >= time && //time * 60 Duration.between(LocalDateTime.now(),operation.getInitialInspectionDate()).toMinutes() <= time + 1){ //time * 60 return Boolean.TRUE; } }else if(WarningOperationTypeEnum.ZHONGYAN.getCode().equals(biz)){ //终验 - if(Duration.between(LocalDateTime.now(),operation.getFinalInspectionDate()).toMinutes() >= time || //time * 60 + if(Duration.between(LocalDateTime.now(),operation.getFinalInspectionDate()).toMinutes() >= time && //time * 60 Duration.between(LocalDateTime.now(),operation.getFinalInspectionDate()).toMinutes() <= time + 1){ //time * 60 return Boolean.TRUE; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/EarlyWarningManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/EarlyWarningManage.java index d3f896e..4594d50 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/EarlyWarningManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/EarlyWarningManage.java @@ -21,9 +21,7 @@ import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; - import java.time.LocalDateTime; -import java.time.ZoneId; import java.util.Objects; /** @@ -131,6 +129,7 @@ public class EarlyWarningManage { private String convertContent(String noticeContent, String projectName, InstTypeEnum instTypeEnum, Integer timeout) { noticeContent = noticeContent.replace("{projectName}",projectName) .replace("{flowType}",Objects.nonNull(instTypeEnum) ? instTypeEnum.getDesc() : "{flowType}") + .replace("{stepName}",Objects.nonNull(instTypeEnum) ? instTypeEnum.getDesc() : "{stepName}") .replace("{time}",String.valueOf(timeout)); log.info("通知内容 :{}",noticeContent); return noticeContent; @@ -139,6 +138,7 @@ public class EarlyWarningManage { private String convertContent(String noticeContent, String projectName, WarningFlowTypeEnum warningFlowTypeEnum, Integer timeout) { noticeContent = noticeContent.replace("{projectName}",projectName) .replace("{flowType}",Objects.nonNull(warningFlowTypeEnum) ? warningFlowTypeEnum.getDesc() : "{flowType}") + .replace("{stepName}",Objects.nonNull(warningFlowTypeEnum) ? warningFlowTypeEnum.getDesc() : "{stepName}") .replace("{time}",String.valueOf(timeout)); log.info("通知内容 :{}",noticeContent); return noticeContent; @@ -147,6 +147,7 @@ public class EarlyWarningManage { private String convertContent(String noticeContent, String projectName, WarningOperationTypeEnum operationTypeEnum, Integer timeout) { noticeContent = noticeContent.replace("{projectName}",projectName) .replace("{flowType}",Objects.nonNull(operationTypeEnum) ? operationTypeEnum.getDesc() : "{flowType}") + .replace("{stepName}",Objects.nonNull(operationTypeEnum) ? operationTypeEnum.getDesc() : "{stepName}") .replace("{time}",String.valueOf(timeout)); log.info("通知内容 :{}",noticeContent); return noticeContent;