|
@@ -97,18 +97,16 @@ public class CertJob implements JobHandler {
|
|
|
.ifPresent(maxDate -> {
|
|
.ifPresent(maxDate -> {
|
|
|
// 判断:最大日期 是否在 当前时间 之前
|
|
// 判断:最大日期 是否在 当前时间 之前
|
|
|
if (maxDate.isBefore(LocalDateTime.now())) {
|
|
if (maxDate.isBefore(LocalDateTime.now())) {
|
|
|
|
|
+ //证书已过期的话,更新expired为true
|
|
|
item.setExpired(true);
|
|
item.setExpired(true);
|
|
|
- } else {
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (ChronoUnit.DAYS.between(LocalDateTime.now(), maxDate) < 90) {
|
|
|
|
|
+ item.setAlertWarn(true);//设置为60天预警过期
|
|
|
|
|
+ } else {
|
|
|
|
|
+ item.setAlertWarn(false);
|
|
|
|
|
+ }
|
|
|
item.setExpired(false);
|
|
item.setExpired(false);
|
|
|
}
|
|
}
|
|
|
- //如果相差不到90天了就进行预警
|
|
|
|
|
- if (maxDate.isAfter(LocalDateTime.now()) && ChronoUnit.DAYS.between(LocalDateTime.now(), maxDate) < 90) {
|
|
|
|
|
- item.setAlertWarn(true);
|
|
|
|
|
- item.setExpired(false);
|
|
|
|
|
- } else {
|
|
|
|
|
- item.setAlertWarn(false);
|
|
|
|
|
-// item.setExpired(false);
|
|
|
|
|
- }
|
|
|
|
|
iotMeasureBookMapper.updateById(item);
|
|
iotMeasureBookMapper.updateById(item);
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
@@ -117,33 +115,30 @@ public class CertJob implements JobHandler {
|
|
|
qhseDeviceCertMapper.selectList().forEach(item -> {
|
|
qhseDeviceCertMapper.selectList().forEach(item -> {
|
|
|
LocalDateTime certExpire = item.getCertExpire();
|
|
LocalDateTime certExpire = item.getCertExpire();
|
|
|
if (certExpire.isBefore(LocalDateTime.now())) {
|
|
if (certExpire.isBefore(LocalDateTime.now())) {
|
|
|
|
|
+ //证书已过期的话,更新expired为true
|
|
|
item.setExpired(true);
|
|
item.setExpired(true);
|
|
|
- } else {
|
|
|
|
|
- item.setExpired(false);
|
|
|
|
|
- }
|
|
|
|
|
- //如果相差不到90天了就进行预警
|
|
|
|
|
- if (certExpire.isAfter(LocalDateTime.now()) && ChronoUnit.DAYS.between(LocalDateTime.now(), certExpire) < 90) {
|
|
|
|
|
- item.setAlertWarn(true);
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (ChronoUnit.DAYS.between(LocalDateTime.now(), certExpire) < 90) {
|
|
|
|
|
+ item.setAlertWarn(true);//设置为60天预警过期
|
|
|
|
|
+ } else {
|
|
|
|
|
+ item.setAlertWarn(false);
|
|
|
|
|
+ }
|
|
|
item.setExpired(false);
|
|
item.setExpired(false);
|
|
|
- } else {
|
|
|
|
|
- item.setAlertWarn(false);
|
|
|
|
|
}
|
|
}
|
|
|
qhseDeviceCertMapper.updateById(item);
|
|
qhseDeviceCertMapper.updateById(item);
|
|
|
});
|
|
});
|
|
|
qhseEmergencyCertMapper.selectList().forEach(item -> {
|
|
qhseEmergencyCertMapper.selectList().forEach(item -> {
|
|
|
LocalDateTime certExpire = item.getCertExpire();
|
|
LocalDateTime certExpire = item.getCertExpire();
|
|
|
if (certExpire.isBefore(LocalDateTime.now())) {
|
|
if (certExpire.isBefore(LocalDateTime.now())) {
|
|
|
|
|
+ //证书已过期的话,更新expired为true
|
|
|
item.setExpired(true);
|
|
item.setExpired(true);
|
|
|
- } else {
|
|
|
|
|
- item.setExpired(false);
|
|
|
|
|
- }
|
|
|
|
|
- //如果相差不到90天了就进行预警
|
|
|
|
|
- if (certExpire.isAfter(LocalDateTime.now()) && ChronoUnit.DAYS.between(LocalDateTime.now(), certExpire) < 90) {
|
|
|
|
|
- item.setAlertWarn(true);
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (ChronoUnit.DAYS.between(LocalDateTime.now(), certExpire) < 90) {
|
|
|
|
|
+ item.setAlertWarn(true);//设置为60天预警过期
|
|
|
|
|
+ } else {
|
|
|
|
|
+ item.setAlertWarn(false);
|
|
|
|
|
+ }
|
|
|
item.setExpired(false);
|
|
item.setExpired(false);
|
|
|
- } else {
|
|
|
|
|
- item.setAlertWarn(false);
|
|
|
|
|
-// item.setExpired(false);
|
|
|
|
|
}
|
|
}
|
|
|
qhseEmergencyCertMapper.updateById(item);
|
|
qhseEmergencyCertMapper.updateById(item);
|
|
|
});
|
|
});
|
|
@@ -151,16 +146,15 @@ public class CertJob implements JobHandler {
|
|
|
qhseOrgCertMapper.selectList().forEach(item -> {
|
|
qhseOrgCertMapper.selectList().forEach(item -> {
|
|
|
LocalDateTime certExpire = item.getCertExpire();
|
|
LocalDateTime certExpire = item.getCertExpire();
|
|
|
if (certExpire.isBefore(LocalDateTime.now())) {
|
|
if (certExpire.isBefore(LocalDateTime.now())) {
|
|
|
|
|
+ //证书已过期的话,更新expired为true
|
|
|
item.setExpired(true);
|
|
item.setExpired(true);
|
|
|
- } else {
|
|
|
|
|
- item.setExpired(false);
|
|
|
|
|
- }
|
|
|
|
|
- //如果相差不到90天了就进行预警
|
|
|
|
|
- if (certExpire.isAfter(LocalDateTime.now()) && ChronoUnit.DAYS.between(LocalDateTime.now(), certExpire) < 60) {
|
|
|
|
|
- item.setAlertWarn(true);
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (ChronoUnit.DAYS.between(LocalDateTime.now(), certExpire) < 60) {
|
|
|
|
|
+ item.setAlertWarn(true);//设置为60天预警过期
|
|
|
|
|
+ } else {
|
|
|
|
|
+ item.setAlertWarn(false);
|
|
|
|
|
+ }
|
|
|
item.setExpired(false);
|
|
item.setExpired(false);
|
|
|
- } else {
|
|
|
|
|
- item.setAlertWarn(false);
|
|
|
|
|
}
|
|
}
|
|
|
qhseOrgCertMapper.updateById(item);
|
|
qhseOrgCertMapper.updateById(item);
|
|
|
});
|
|
});
|