Browse Source

预警通知

master
PoffyZhang 1 year ago
parent
commit
01caaf27c8
2 changed files with 19 additions and 1 deletions
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java
  2. +18
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/EarlyWarningManage.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java View File

@@ -394,7 +394,7 @@ public class EarlyWarningInstanceNotStartTask {
//需要发通知的项目 //需要发通知的项目
List<ProjectRenewalFundDeclaration> needToWaringProjects = needNextProjects.stream() List<ProjectRenewalFundDeclaration> needToWaringProjects = needNextProjects.stream()
.filter(p -> { .filter(p -> {
//初验
//超时未审批
if(Duration.between(p.getCreateOn(),LocalDateTime.now()).toMinutes() >= time * 60 && //time * 60 if(Duration.between(p.getCreateOn(),LocalDateTime.now()).toMinutes() >= time * 60 && //time * 60
Duration.between(p.getCreateOn(),LocalDateTime.now()).toMinutes() <= time * 60 + 1){ //time * 60 Duration.between(p.getCreateOn(),LocalDateTime.now()).toMinutes() <= time * 60 + 1){ //time * 60
return Boolean.TRUE; return Boolean.TRUE;


+ 18
- 0
pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/EarlyWarningManage.java View File

@@ -78,6 +78,10 @@ public class EarlyWarningManage {
WarningOperationTypeEnum.getByCode(biz),timeout); WarningOperationTypeEnum.getByCode(biz),timeout);
records.setRuleType(WarningRuleTypeEnum.OPERATION_WARNING.getCode()); records.setRuleType(WarningRuleTypeEnum.OPERATION_WARNING.getCode());
break; break;
case RENEWAL_FUND:
content = convertContent(noticeContent,project.getProjectName(),timeout);
records.setRuleType(WarningRuleTypeEnum.RENEWAL_FUND.getCode());
break;
default: default:
log.info("匹配不到 规则类型"); log.info("匹配不到 规则类型");
return; return;
@@ -124,6 +128,20 @@ public class EarlyWarningManage {
} }


/** /**
* 续建项目资金
* @param noticeContent
* @param projectName
* @param timeout
* @return
*/
private String convertContent(String noticeContent, String projectName, Integer timeout) {
noticeContent = noticeContent.replace("{projectName}",projectName)
.replace("{time}",String.valueOf(timeout));
log.info("通知内容 :{}",noticeContent);
return noticeContent;
}

/**
* 转换出 通知的内容 * 转换出 通知的内容
* @param noticeContent * @param noticeContent
* @param projectName * @param projectName


Loading…
Cancel
Save