posttion
This commit is contained in:
parent
09f0918482
commit
4dcaa92f63
2 changed files with 21 additions and 9 deletions
|
|
@ -8,7 +8,12 @@ import { ProfileEmployee } from "../entities/ProfileEmployee";
|
||||||
import { ProfileGovernment, UpdateProfileGovernment } from "../entities/ProfileGovernment";
|
import { 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, calculateGovAge, calculateRetireDate, setLogDataDiff } from "../interfaces/utils";
|
import {
|
||||||
|
calculateAge,
|
||||||
|
calculateGovAge,
|
||||||
|
calculateRetireDate,
|
||||||
|
setLogDataDiff,
|
||||||
|
} from "../interfaces/utils";
|
||||||
import permission from "../interfaces/permission";
|
import permission from "../interfaces/permission";
|
||||||
import { OrgRevision } from "../entities/OrgRevision";
|
import { OrgRevision } from "../entities/OrgRevision";
|
||||||
@Route("api/v1/org/profile-employee/government")
|
@Route("api/v1/org/profile-employee/government")
|
||||||
|
|
@ -103,15 +108,16 @@ export class ProfileGovernmentEmployeeController extends Controller {
|
||||||
const data = {
|
const data = {
|
||||||
org: org, //สังกัด
|
org: org, //สังกัด
|
||||||
position: record.position, //ตำแหน่ง
|
position: record.position, //ตำแหน่ง
|
||||||
posLevel: record.posType == null && record.posLevel == null
|
posLevel:
|
||||||
? null
|
record.posType == null && record.posLevel == null
|
||||||
: `${record.posType.posTypeShortName}${record.posLevel.posLevelName}`, //ระดับ
|
? null
|
||||||
|
: `${record.posType.posTypeShortName}${record.posLevel.posLevelName}`, //ระดับ
|
||||||
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),
|
||||||
dateRetireLaw: record.dateRetireLaw ?? null,
|
dateRetireLaw: record.dateRetireLaw ?? null,
|
||||||
// govAge: record.dateStart == null ? null : calculateAge(record.dateStart),
|
// govAge: record.dateStart == null ? null : calculateAge(record.dateStart),
|
||||||
govAge: await calculateGovAge(profile.id,"EMPLOYEE"),
|
govAge: await calculateGovAge(profile.id, "EMPLOYEE"),
|
||||||
dateAppoint: record.dateAppoint,
|
dateAppoint: record.dateAppoint,
|
||||||
dateStart: record.dateStart,
|
dateStart: record.dateStart,
|
||||||
govAgeAbsent: record.govAgeAbsent,
|
govAgeAbsent: record.govAgeAbsent,
|
||||||
|
|
@ -206,7 +212,10 @@ export class ProfileGovernmentEmployeeController extends Controller {
|
||||||
const data = {
|
const data = {
|
||||||
org: org, //สังกัด
|
org: org, //สังกัด
|
||||||
position: record.position, //ตำแหน่ง
|
position: record.position, //ตำแหน่ง
|
||||||
posLevel: record.posLevel == null ? null : record.posLevel.posLevelName, //ระดับ
|
posLevel:
|
||||||
|
record.posLevel == null
|
||||||
|
? null
|
||||||
|
: `${record.posType.posTypeShortName}${record.posLevel.posLevelName}`, //ระดับ
|
||||||
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), //วันเกษียณ
|
||||||
|
|
@ -215,7 +224,7 @@ export class ProfileGovernmentEmployeeController extends Controller {
|
||||||
reasonSameDate: record.reasonSameDate, //เหตุผลที่วันที่ไม่ตรงกัน
|
reasonSameDate: record.reasonSameDate, //เหตุผลที่วันที่ไม่ตรงกัน
|
||||||
dateRetire: record.dateRetire ?? null, //วันครบเกษียณอายุ
|
dateRetire: record.dateRetire ?? null, //วันครบเกษียณอายุ
|
||||||
// govAge: record.dateStart == null ? null : calculateAge(record.dateStart), //อายุราชการ
|
// govAge: record.dateStart == null ? null : calculateAge(record.dateStart), //อายุราชการ
|
||||||
govAge: await calculateGovAge(profileEmployeeId,"EMPLOYEE"),
|
govAge: await calculateGovAge(profileEmployeeId, "EMPLOYEE"),
|
||||||
govAgeAbsent: record.govAgeAbsent ?? null, // ขาดราชการ
|
govAgeAbsent: record.govAgeAbsent ?? null, // ขาดราชการ
|
||||||
govAgePlus: record.govAgePlus, // อายุราชการเกื้อกูล
|
govAgePlus: record.govAgePlus, // อายุราชการเกื้อกูล
|
||||||
dateRetireLaw: record.dateRetireLaw ?? null, // วันที่เกษียฯอายุราชการตามกฎหมาย
|
dateRetireLaw: record.dateRetireLaw ?? null, // วันที่เกษียฯอายุราชการตามกฎหมาย
|
||||||
|
|
@ -299,7 +308,7 @@ export class ProfileGovernmentEmployeeController extends Controller {
|
||||||
reasonSameDate: record.reasonSameDate, //เหตุผลที่วันที่ไม่ตรงกัน
|
reasonSameDate: record.reasonSameDate, //เหตุผลที่วันที่ไม่ตรงกัน
|
||||||
dateRetire: record.dateRetire ?? null, //วันครบเกษียณอายุ
|
dateRetire: record.dateRetire ?? null, //วันครบเกษียณอายุ
|
||||||
// govAge: record.dateStart == null ? null : calculateAge(record.dateStart), //อายุราชการ
|
// govAge: record.dateStart == null ? null : calculateAge(record.dateStart), //อายุราชการ
|
||||||
govAge: await calculateGovAge(profileEmployeeId,"EMPLOYEE"),
|
govAge: await calculateGovAge(profileEmployeeId, "EMPLOYEE"),
|
||||||
govAgeAbsent: record.govAgeAbsent ?? null, // ขาดราชการ
|
govAgeAbsent: record.govAgeAbsent ?? null, // ขาดราชการ
|
||||||
govAgePlus: record.govAgePlus, // อายุราชการเกื้อกูล
|
govAgePlus: record.govAgePlus, // อายุราชการเกื้อกูล
|
||||||
dateRetireLaw: record.dateRetireLaw ?? null, // วันที่เกษียฯอายุราชการตามกฎหมาย
|
dateRetireLaw: record.dateRetireLaw ?? null, // วันที่เกษียฯอายุราชการตามกฎหมาย
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,10 @@ export class ProfileGovernmentEmployeeTempController extends Controller {
|
||||||
const data = {
|
const data = {
|
||||||
org: org, //สังกัด
|
org: org, //สังกัด
|
||||||
position: record.position, //ตำแหน่ง
|
position: record.position, //ตำแหน่ง
|
||||||
posLevel: record.posLevel == null ? null : record.posLevel.posLevelName, //ระดับ
|
posLevel:
|
||||||
|
record.posLevel == null
|
||||||
|
? null
|
||||||
|
: `${record.posType.posTypeShortName}${record.posLevel.posLevelName}`, //ระดับ
|
||||||
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), //วันเกษียณ
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue