|
|
@@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.pms.dal.dataobject.qhse.cert.IotMeasureCertDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.qhse.measure.IotMeasureBookDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.qhse.measure.IotMeasureDetectDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.qhse.cert.IotMeasureCertMapper;
|
|
|
+import cn.iocoder.yudao.module.pms.dal.mysql.qhse.cert.QhseOrgCertMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.qhse.devicecert.QhseDeviceCertMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.qhse.emergency.QhseEmergencyCertMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.qhse.measure.IotMeasureBookMapper;
|
|
|
@@ -45,6 +46,8 @@ public class CertJob implements JobHandler {
|
|
|
private QhseDeviceCertMapper qhseDeviceCertMapper;
|
|
|
@Autowired
|
|
|
private QhseEmergencyCertMapper qhseEmergencyCertMapper;
|
|
|
+ @Autowired
|
|
|
+ private QhseOrgCertMapper qhseOrgCertMapper;
|
|
|
|
|
|
@Override
|
|
|
@TenantIgnore
|
|
|
@@ -134,7 +137,21 @@ public class CertJob implements JobHandler {
|
|
|
}
|
|
|
qhseEmergencyCertMapper.updateById(item);
|
|
|
});
|
|
|
-
|
|
|
+ //处理QHSE体系证书是否过期
|
|
|
+ qhseOrgCertMapper.selectList().forEach(item -> {
|
|
|
+ LocalDateTime certExpire = item.getCertExpire();
|
|
|
+ if (certExpire.isBefore(LocalDateTime.now())) {
|
|
|
+ item.setExpired(true);
|
|
|
+ } else {
|
|
|
+ item.setExpired(false);
|
|
|
+ }
|
|
|
+ //如果相差不到90天了就进行预警
|
|
|
+ if (certExpire.isAfter(LocalDateTime.now()) && ChronoUnit.DAYS.between(LocalDateTime.now(), certExpire) < 60) {
|
|
|
+ item.setAlertWarn(true);
|
|
|
+ item.setExpired(false);
|
|
|
+ }
|
|
|
+ qhseOrgCertMapper.updateById(item);
|
|
|
+ });
|
|
|
|
|
|
return "执行成功";
|
|
|
}
|