Commit df578f76 authored by huangjiamin's avatar huangjiamin

未来七天到期通知BUG

parent c69cbc93
......@@ -676,7 +676,7 @@ public class IpResourceServiceImpl implements IpResourceService {
x.setStatus(3);
// 1.2 ip资源在未来3天内到期,且 ip 资源的状态不是 3(正在分配)、5(已失效)、6(未分配),则将 ip 资源设置为 2(即将过期)
} else if (x.getValidTime() <= Instant.now().plusSeconds(60 * 60 * 24 * 3).toEpochMilli() && x.getValidTime() > Instant.now().toEpochMilli()) {
} else if (x.getValidTime() <= Instant.now().plusSeconds(60 * 60 * 24 * 7).toEpochMilli() && x.getValidTime() > Instant.now().toEpochMilli()) {
if (x.getStatus() != 5 && x.getStatus() != 3 && x.getStatus() != 6) {
ipResourceRepository.updateStatus(x.getId(), 2);
}
......@@ -856,7 +856,7 @@ public class IpResourceServiceImpl implements IpResourceService {
}
}
if (StringUtils.isNotBlank(ipResource.getAddr())) {
if (ipResource.getValidTime() <= Instant.now().plusSeconds(60 * 60 * 24 * 3).toEpochMilli() && ipResource.getValidTime() > Instant.now().toEpochMilli()) {
if (ipResource.getValidTime() <= Instant.now().plusSeconds(60 * 60 * 24 * 7).toEpochMilli() && ipResource.getValidTime() > Instant.now().toEpochMilli()) {
ipResourceRepository.updateStatus(ipResource.getId(), 2);
} else if (ipResource.getValidTime() <= Instant.now().minusSeconds(60 * 60 * 24 * 3).toEpochMilli()) {
deleteExpiredIp(username, ipResourceRequestDto);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment