cronjob ส่งข้อมูลผู้เกษียณไปให้ระบบพ้นราชการ #2330
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m17s

This commit is contained in:
harid 2026-05-05 16:43:47 +07:00
parent e6c3e80a3d
commit 93d4857ea1
4 changed files with 175 additions and 12 deletions

View file

@ -104,6 +104,7 @@ import { PostRetireToExprofile } from "./ExRetirementController";
import { LeaveType } from "../entities/LeaveType";
import { KeycloakAttributeService } from "../services/KeycloakAttributeService";
import { reOrderCommandRecivesAndDelete } from "../services/CommandService";
import { RetirementService } from "../services/RetirementService";
@Route("api/v1/org/command")
@Tags("Command")
@Security("bearerAuth")
@ -1608,8 +1609,7 @@ export class CommandController extends Controller {
return new HttpSuccess();
}
// @Get("XXX")
async cronjobUpdateRetirementStatus(/*@Request() request: RequestWithUser*/) {
async cronjobUpdateRetirementStatus() {
const adminToken = (await getToken()) ?? "";
const today = new Date();
today.setUTCHours(0, 0, 0, 0);
@ -1887,6 +1887,21 @@ export class CommandController extends Controller {
return new HttpSuccess();
}
/**
* API cronjobPostRetireToExprofile
* @summary (Exprofile)
*/
@Get("cronjob/cronjobPostRetireToExprofile")
async runCronjobPostRetireToExprofile() {
try {
const retirementService = new RetirementService();
const result = await retirementService.cronjobPostRetireToExprofile();
return new HttpSuccess(result);
} catch (error: any) {
throw new HttpError(HttpStatusCode.INTERNAL_SERVER_ERROR, error.message || "เกิดข้อผิดพลาด");
}
}
/**
* API tab4
*