เพิ่มฟิว governant
This commit is contained in:
parent
884fe694d0
commit
ae947a48c0
2 changed files with 66 additions and 3 deletions
|
|
@ -1,11 +1,28 @@
|
||||||
import { Body, Controller, Example, Get, Patch, Path, Delete, Post, Request, Route, Security, Tags } from "tsoa";
|
import {
|
||||||
|
Body,
|
||||||
|
Controller,
|
||||||
|
Example,
|
||||||
|
Get,
|
||||||
|
Patch,
|
||||||
|
Path,
|
||||||
|
Delete,
|
||||||
|
Post,
|
||||||
|
Request,
|
||||||
|
Route,
|
||||||
|
Security,
|
||||||
|
Tags,
|
||||||
|
} from "tsoa";
|
||||||
import { AppDataSource } from "../database/data-source";
|
import { AppDataSource } from "../database/data-source";
|
||||||
import HttpSuccess from "../interfaces/http-success";
|
import HttpSuccess from "../interfaces/http-success";
|
||||||
import HttpStatus from "../interfaces/http-status";
|
import HttpStatus from "../interfaces/http-status";
|
||||||
import HttpError from "../interfaces/http-error";
|
import HttpError from "../interfaces/http-error";
|
||||||
import { RequestWithUser } from "../middlewares/user";
|
import { RequestWithUser } from "../middlewares/user";
|
||||||
import { ProfileEmployee } from "../entities/ProfileEmployee";
|
import { ProfileEmployee } from "../entities/ProfileEmployee";
|
||||||
import { CreateProfileEmployeeGovernment, ProfileGovernment, UpdateProfileGovernment } from "../entities/ProfileGovernment";
|
import {
|
||||||
|
CreateProfileEmployeeGovernment,
|
||||||
|
ProfileGovernment,
|
||||||
|
UpdateProfileGovernment,
|
||||||
|
} from "../entities/ProfileGovernment";
|
||||||
import { EmployeePosition } from "../entities/EmployeePosition";
|
import { EmployeePosition } from "../entities/EmployeePosition";
|
||||||
import { EmployeePosMaster } from "../entities/EmployeePosMaster";
|
import { EmployeePosMaster } from "../entities/EmployeePosMaster";
|
||||||
import { calculateAge, calculateRetireDate } from "../interfaces/utils";
|
import { calculateAge, calculateRetireDate } from "../interfaces/utils";
|
||||||
|
|
@ -95,6 +112,14 @@ export class ProfileGovernmentEmployeeController extends Controller {
|
||||||
posMasterNo: posMaster == null ? null : `${orgShortName} ${posMaster.posMasterNo}`, //เลขที่ตำแหน่ง
|
posMasterNo: posMaster == null ? null : `${orgShortName} ${posMaster.posMasterNo}`, //เลขที่ตำแหน่ง
|
||||||
posType: record.posType == null ? null : record.posType.posTypeName, //ประเภท
|
posType: record.posType == null ? null : record.posType.posTypeName, //ประเภท
|
||||||
dateLeave: record.birthDate == null ? null : calculateRetireDate(record.birthDate), //วันเกษียณ
|
dateLeave: record.birthDate == null ? null : calculateRetireDate(record.birthDate), //วันเกษียณ
|
||||||
|
dateAppoint: record.dateAppoint, //วันที่สั่งบรรจุ
|
||||||
|
dateStart: record.dateStart, //วันที่เริ่มปฎิบัติงานราชการ
|
||||||
|
reasonSameDate: record.reasonSameDate, //เหตุผลที่วันที่ไม่ตรงกัน
|
||||||
|
dateRetire: record.dateRetire ?? null, //วันครบเกษียณอายุ
|
||||||
|
govAge: record.dateStart == null ? null : calculateAge(record.dateStart), //อายุราชการ
|
||||||
|
govAgeAbsent: record.govAgeAbsent ?? null, // ขาดราชการ
|
||||||
|
govAgePlus: record.govAgePlus, // อายุราชการเกื้อกูล
|
||||||
|
dateRetireLaw: record.dateRetireLaw ?? null, // วันที่เกษียฯอายุราชการตามกฎหมาย
|
||||||
};
|
};
|
||||||
return new HttpSuccess(data);
|
return new HttpSuccess(data);
|
||||||
}
|
}
|
||||||
|
|
@ -185,4 +210,4 @@ export class ProfileGovernmentEmployeeController extends Controller {
|
||||||
// }
|
// }
|
||||||
// return new HttpSuccess();
|
// return new HttpSuccess();
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,44 @@ export class ProfileEmployee extends EntityBase {
|
||||||
})
|
})
|
||||||
avatarName: string;
|
avatarName: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "datetime",
|
||||||
|
comment: "วันที่บรรจุ",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
dateAppoint: Date;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "datetime",
|
||||||
|
comment: "วันที่เริ่มปฏิบัติราชการ",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
dateStart: Date;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "ขาดราชการ",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
govAgeAbsent: number;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "อายุราชการเกื้อกูล",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
govAgePlus: number;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "เหตุผลกรณีวันไม่ตรงกัน",
|
||||||
|
length: 255,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
reasonSameDate: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "ประเภทลูกจ้าง (perm->ลูกจ้างประจำ temp->ลูกจ้างชั่วคราว)",
|
comment: "ประเภทลูกจ้าง (perm->ลูกจ้างประจำ temp->ลูกจ้างชั่วคราว)",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue