From f2fb4b091c0b5d0aed4fc2a6f006a4b266952872 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 7 Aug 2023 15:58:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E6=96=BD=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scheduler/task/EarlyWarningInstanceNotStartTask.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 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 33e3224..af7e464 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,8 +129,8 @@ public class EarlyWarningInstanceNotStartTask { } } - if(Duration.between(LocalDateTime.now(),p.getUpdateOn()).toMinutes() >= time && //time * 60 - Duration.between(LocalDateTime.now(),p.getUpdateOn()).toMinutes() <= time + 1){ //time * 60 + if(Duration.between(LocalDateTime.now(),p.getUpdateOn()).getSeconds() >= time * 60 && //time * 60 + Duration.between(LocalDateTime.now(),p.getUpdateOn()).getSeconds() <= time * 60 + 119){ //time * 60 return Boolean.TRUE; } return Boolean.FALSE; @@ -217,7 +217,7 @@ public class EarlyWarningInstanceNotStartTask { .eq(Project::getAreaCode, areaCode) .eq(Project::getNewest, Boolean.TRUE) .eq(Project::getStatus,projectStutas)); - + log.info("needNextProjects :{}",needNextProjects.size()); List projectCodes = needNextProjects.stream().map(Project::getProjectCode).collect(Collectors.toList()); List operations = operationService.list(Wrappers.lambdaQuery(Operation.class) @@ -246,14 +246,14 @@ 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 - Duration.between(LocalDateTime.now(),operation.getInitialInspectionDate()).toMinutes() <= time + 1){ //time * 60 + if(Duration.between(LocalDateTime.now(),operation.getInitialInspectionDate()).getSeconds() >= time * 60 && //time * 60 + Duration.between(LocalDateTime.now(),operation.getInitialInspectionDate()).getSeconds() <= time * 60 + 119){ //time * 60 return Boolean.TRUE; } }else if(WarningOperationTypeEnum.ZHONGYAN.getCode().equals(biz)){ //终验 - if(Duration.between(LocalDateTime.now(),operation.getFinalInspectionDate()).toMinutes() >= time && //time * 60 - Duration.between(LocalDateTime.now(),operation.getFinalInspectionDate()).toMinutes() <= time + 1){ //time * 60 + if(Duration.between(LocalDateTime.now(),operation.getFinalInspectionDate()).getSeconds() >= time * 60 && //time * 60 + Duration.between(LocalDateTime.now(),operation.getFinalInspectionDate()).getSeconds() <= time * 60 + 119){ //time * 60 return Boolean.TRUE; } }