Quellcode durchsuchen

预警debug 时间条件

master
PoffyZhang vor 1 Jahr
Ursprung
Commit
e00736d402
2 geänderte Dateien mit 6 neuen und 5 gelöschten Zeilen
  1. +3
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java
  2. +3
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/EarlyWarningManage.java

+ 3
- 3
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java Datei anzeigen

@@ -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;
}


+ 3
- 2
pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/EarlyWarningManage.java Datei anzeigen

@@ -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;


Laden…
Abbrechen
Speichern