feat: (REQ-3540) 开通管理根据过期时间更新状态

This commit is contained in:
xudawei 2025-04-01 10:45:32 +08:00
parent eafa5e9626
commit 6ff07072b9
4 changed files with 18 additions and 5 deletions

View File

@ -85,4 +85,13 @@ public class FileDatabaseDao extends ServiceImpl<FileDatabaseMapper, FileDatabas
.update();
}
public void expire() {
lambdaUpdate() //
.eq(FileDatabase::getState, FileDatabaseState.ACTIVATED) //
.isNotNull(FileDatabase::getExpireDate)
.le(FileDatabase::getExpireDate, new Date()) //
.set(FileDatabase::getState, FileDatabaseState.EXPIRED)
.update();
}
}

View File

@ -21,14 +21,11 @@ import lombok.RequiredArgsConstructor;
@SuppressWarnings({ "unused", "used by job" })
public class FileDatabaseExpireJob {
private final FileDatabaseDao fileDatabaseDao;
private final FileDatabaseService fileDatabaseService;
@XxlJob("fileDatabaseExpireJob")
public ReturnT<String> exec(String paramStr) {
fileDatabaseDao.lambdaUpdate() //
.eq(FileDatabase::getState, FileDatabaseState.ACTIVATED) //
.le(FileDatabase::getExpireDate, new Date()) //
.update();
fileDatabaseService.expire();
return ReturnT.SUCCESS;
}

View File

@ -308,4 +308,8 @@ public class FileDatabaseService {
.collect(toList());
return Page.toPage(request.getPage(), request.getPageSize(), page.getTotal(), records);
}
public void expire() {
this.fileDatabaseDao.expire();
}
}

View File

@ -73,6 +73,8 @@ public class FeignConfig implements RequestInterceptor, EnvironmentAware {
private String thorUrl;
@Value("${orgGateway:http://dev-app.axzo.cn/org-gateway}")
private String orgGatewayUrl;
@Value("${ossEnvUrl:http://dev-app.axzo.cn/oss}")
private String ossEnvUrl;
private static String POD_NAMESPACE;
@ -114,6 +116,7 @@ public class FeignConfig implements RequestInterceptor, EnvironmentAware {
url = url.replace("http://attendance:8080", attendanceApi);
url = url.replace("http://thor:8080", thorUrl);
url = url.replace("http://org-gateway:8080", orgGatewayUrl);
url = url.replace("http://oss:9123", ossEnvUrl);
String profile = environment.getProperty("spring.profiles.active");
if(Objects.equals(profile, "test") && url.contains("dev-app.axzo.cn")) {
url = url.replace("dev-app", "test-api");