update commander
This commit is contained in:
parent
38b67ebc38
commit
3d71a22002
3 changed files with 71 additions and 13 deletions
|
|
@ -85,19 +85,19 @@ export class EvaluationController {
|
||||||
})
|
})
|
||||||
.select([
|
.select([
|
||||||
"evaluation.id",
|
"evaluation.id",
|
||||||
"evaluation.dateAnnounce",
|
|
||||||
"evaluation.type",
|
"evaluation.type",
|
||||||
"evaluation.subject",
|
"evaluation.subject",
|
||||||
"evaluation.evaluationResult",
|
"evaluation.evaluationResult",
|
||||||
|
"evaluation.lastUpdatedAt",
|
||||||
])
|
])
|
||||||
.orderBy("evaluation.dateAnnounce", "ASC")
|
.orderBy("evaluation.lastUpdatedAt", "ASC")
|
||||||
.getMany();
|
.getMany();
|
||||||
|
|
||||||
const performance = list.map((item) => ({
|
const performance = list.map((item) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
year: item.dateAnnounce?Extension.ToThaiYear(item.dateAnnounce.getFullYear()):null,
|
year: item.lastUpdatedAt?Extension.ToThaiYear(item.lastUpdatedAt.getFullYear()):null,
|
||||||
type: item.type == "EXPERT" ? "ชำนาญการ" : item.type == "EXPERTISE" ? "เชียวชาญ" : item.type == "SPECIAL_EXPERT" ? "ชำนาญการพิเศษ": null,
|
type: item.type == "EXPERT" ? "ชำนาญการ" : item.type == "EXPERTISE" ? "เชียวชาญ" : item.type == "SPECIAL_EXPERT" ? "ชำนาญการพิเศษ": null,
|
||||||
subject: item.subject,
|
subject: item.subject?item.subject[0]:null,
|
||||||
evaluationResult: item.evaluationResult == "PASS" ? "ผ่าน" : item.evaluationResult == "NOTPASS" ? "ไม่ผ่าน" : null,
|
evaluationResult: item.evaluationResult == "PASS" ? "ผ่าน" : item.evaluationResult == "NOTPASS" ? "ไม่ผ่าน" : null,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
@ -2091,6 +2091,14 @@ export class EvaluationController {
|
||||||
evaluation.commanderPositionDoc2 = evaluation.commanderPosition;
|
evaluation.commanderPositionDoc2 = evaluation.commanderPosition;
|
||||||
evaluation.commanderAboveFullnameDoc2 = evaluation.commanderAboveFullname;
|
evaluation.commanderAboveFullnameDoc2 = evaluation.commanderAboveFullname;
|
||||||
evaluation.commanderAbovePositionDoc2 = evaluation.commanderAbovePosition;
|
evaluation.commanderAbovePositionDoc2 = evaluation.commanderAbovePosition;
|
||||||
|
|
||||||
|
evaluation.commanderOrgDoc2 = evaluation.commanderOrg;
|
||||||
|
evaluation.commanderOrgOldDoc2 = evaluation.commanderOrgOld;
|
||||||
|
evaluation.commanderPositionOldDoc2 = evaluation.commanderPositionOld;
|
||||||
|
evaluation.commanderAboveOrgDoc2 = evaluation.commanderAboveOrg;
|
||||||
|
evaluation.commanderAboveOrgOldDoc2 = evaluation.commanderAboveOrgOld;
|
||||||
|
evaluation.commanderAbovePositionOldDoc2 = evaluation.commanderAbovePositionOld;
|
||||||
|
|
||||||
evaluation.datePrepareDoc2 = new Date();
|
evaluation.datePrepareDoc2 = new Date();
|
||||||
evaluation.lastUpdateUserId = request.user.sub;
|
evaluation.lastUpdateUserId = request.user.sub;
|
||||||
evaluation.lastUpdateFullName = request.user.name;
|
evaluation.lastUpdateFullName = request.user.name;
|
||||||
|
|
@ -2653,9 +2661,15 @@ export class EvaluationController {
|
||||||
"author",
|
"author",
|
||||||
"subject",
|
"subject",
|
||||||
"commanderFullname",
|
"commanderFullname",
|
||||||
|
"commanderOrg",
|
||||||
|
"commanderOrgOld",
|
||||||
"commanderPosition",
|
"commanderPosition",
|
||||||
|
"commanderPositionOld",
|
||||||
"commanderAboveFullname",
|
"commanderAboveFullname",
|
||||||
|
"commanderAboveOrg",
|
||||||
|
"commanderAboveOrgOld",
|
||||||
"commanderAbovePosition",
|
"commanderAbovePosition",
|
||||||
|
"commanderAbovePositionOld",
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -2689,9 +2703,15 @@ export class EvaluationController {
|
||||||
"author",
|
"author",
|
||||||
"subject",
|
"subject",
|
||||||
"commanderFullname",
|
"commanderFullname",
|
||||||
|
"commanderOrg",
|
||||||
|
"commanderOrgOld",
|
||||||
"commanderPosition",
|
"commanderPosition",
|
||||||
|
"commanderPositionOld",
|
||||||
"commanderAboveFullname",
|
"commanderAboveFullname",
|
||||||
|
"commanderAboveOrg",
|
||||||
|
"commanderAboveOrgOld",
|
||||||
"commanderAbovePosition",
|
"commanderAbovePosition",
|
||||||
|
"commanderAbovePositionOld",
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
if (!evaluation) {
|
if (!evaluation) {
|
||||||
|
|
@ -2722,9 +2742,15 @@ export class EvaluationController {
|
||||||
"subjectDoc2",
|
"subjectDoc2",
|
||||||
"assignedPosition",
|
"assignedPosition",
|
||||||
"commanderFullnameDoc2",
|
"commanderFullnameDoc2",
|
||||||
|
"commanderOrgDoc2",
|
||||||
|
"commanderOrgOldDoc2",
|
||||||
"commanderPositionDoc2",
|
"commanderPositionDoc2",
|
||||||
|
"commanderPositionOldDoc2",
|
||||||
"commanderAboveFullnameDoc2",
|
"commanderAboveFullnameDoc2",
|
||||||
|
"commanderAboveOrgDoc2",
|
||||||
|
"commanderAboveOrgOldDoc2",
|
||||||
"commanderAbovePositionDoc2",
|
"commanderAbovePositionDoc2",
|
||||||
|
"commanderAbovePositionOldDoc2",
|
||||||
"evaluationResult",
|
"evaluationResult",
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
@ -2759,9 +2785,15 @@ export class EvaluationController {
|
||||||
"subjectDoc2",
|
"subjectDoc2",
|
||||||
"assignedPosition",
|
"assignedPosition",
|
||||||
"commanderFullnameDoc2",
|
"commanderFullnameDoc2",
|
||||||
|
"commanderOrgDoc2",
|
||||||
|
"commanderOrgOldDoc2",
|
||||||
"commanderPositionDoc2",
|
"commanderPositionDoc2",
|
||||||
|
"commanderPositionOldDoc2",
|
||||||
"commanderAboveFullnameDoc2",
|
"commanderAboveFullnameDoc2",
|
||||||
|
"commanderAboveOrgDoc2",
|
||||||
|
"commanderAboveOrgOldDoc2",
|
||||||
"commanderAbovePositionDoc2",
|
"commanderAbovePositionDoc2",
|
||||||
|
"commanderAbovePositionOldDoc2",
|
||||||
"evaluationResult",
|
"evaluationResult",
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
@ -2799,11 +2831,17 @@ export class EvaluationController {
|
||||||
@Body()
|
@Body()
|
||||||
body: {
|
body: {
|
||||||
author: string;
|
author: string;
|
||||||
subject: string;
|
subject: string[];
|
||||||
commanderFullname: string;
|
commanderFullname: string;
|
||||||
|
commanderOrg: string;
|
||||||
|
commanderOrgOld?: string;
|
||||||
commanderPosition: string;
|
commanderPosition: string;
|
||||||
|
commanderPositionOld?: string;
|
||||||
commanderAboveFullname: string;
|
commanderAboveFullname: string;
|
||||||
|
commanderAboveOrg: string;
|
||||||
|
commanderAboveOrgOld?: string;
|
||||||
commanderAbovePosition: string;
|
commanderAbovePosition: string;
|
||||||
|
commanderAbovePositionOld?: string;
|
||||||
},
|
},
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
|
|
@ -2813,13 +2851,19 @@ export class EvaluationController {
|
||||||
if (!evaluation) {
|
if (!evaluation) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found.");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found.");
|
||||||
}
|
}
|
||||||
|
const _null:any = null;
|
||||||
evaluation.author = body.author;
|
evaluation.author = body.author;
|
||||||
evaluation.subject = body.subject;
|
evaluation.subject = body.subject;
|
||||||
evaluation.commanderFullname = body.commanderFullname;
|
evaluation.commanderFullname = body.commanderFullname;
|
||||||
|
evaluation.commanderOrg = body.commanderOrg;
|
||||||
|
evaluation.commanderOrgOld = body.commanderOrgOld??_null;
|
||||||
evaluation.commanderPosition = body.commanderPosition;
|
evaluation.commanderPosition = body.commanderPosition;
|
||||||
|
evaluation.commanderPositionOld = body.commanderPositionOld??_null;
|
||||||
evaluation.commanderAboveFullname = body.commanderAboveFullname;
|
evaluation.commanderAboveFullname = body.commanderAboveFullname;
|
||||||
|
evaluation.commanderAboveOrg = body.commanderAboveOrg;
|
||||||
|
evaluation.commanderAboveOrgOld = body.commanderAboveOrgOld??_null;
|
||||||
evaluation.commanderAbovePosition = body.commanderAbovePosition;
|
evaluation.commanderAbovePosition = body.commanderAbovePosition;
|
||||||
|
evaluation.commanderAbovePositionOld = body.commanderAbovePositionOld??_null;
|
||||||
evaluation.lastUpdateUserId = request.user.sub;
|
evaluation.lastUpdateUserId = request.user.sub;
|
||||||
evaluation.lastUpdateFullName = request.user.name;
|
evaluation.lastUpdateFullName = request.user.name;
|
||||||
evaluation.lastUpdatedAt = new Date();
|
evaluation.lastUpdatedAt = new Date();
|
||||||
|
|
@ -2859,7 +2903,7 @@ export class EvaluationController {
|
||||||
@Body()
|
@Body()
|
||||||
body: {
|
body: {
|
||||||
authorDoc2: string;
|
authorDoc2: string;
|
||||||
subjectDoc2: string;
|
subjectDoc2: string[];
|
||||||
assignedPosition: string;
|
assignedPosition: string;
|
||||||
commanderFullnameDoc2: string;
|
commanderFullnameDoc2: string;
|
||||||
commanderPositionDoc2: string;
|
commanderPositionDoc2: string;
|
||||||
|
|
|
||||||
|
|
@ -359,7 +359,7 @@ export class ReoportController {
|
||||||
dateRetireLaw: dateRetireLaw
|
dateRetireLaw: dateRetireLaw
|
||||||
? Extension.ToThaiNumber(Extension.ToThaiShortDate(new Date(dateRetireLaw)))
|
? Extension.ToThaiNumber(Extension.ToThaiShortDate(new Date(dateRetireLaw)))
|
||||||
: "-",
|
: "-",
|
||||||
subject: evaluation.subject != null ? evaluation.subject : "-",
|
subject: evaluation.subject != null ? evaluation.subject[0] : "-",
|
||||||
subjectOld: subjectOld,
|
subjectOld: subjectOld,
|
||||||
educations:
|
educations:
|
||||||
evaluation.education.length > 0
|
evaluation.education.length > 0
|
||||||
|
|
|
||||||
|
|
@ -216,6 +216,20 @@ export class Evaluation extends EntityBase {
|
||||||
@Column({ nullable: true, comment: "ตำแหน่งเดิม ผู้บังคับบัญชาเหนือขึ้นไป 1 ระดับ" })
|
@Column({ nullable: true, comment: "ตำแหน่งเดิม ผู้บังคับบัญชาเหนือขึ้นไป 1 ระดับ" })
|
||||||
commanderAbovePositionOld: string;
|
commanderAbovePositionOld: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true, comment: "สังกัดปัจุบัน ผู้บังคับบัญชาชั้นต้น doc2" })
|
||||||
|
commanderOrgDoc2: string;
|
||||||
|
@Column({ nullable: true, comment: "สังกัดเดิม ผู้บังคับบัญชาชั้นต้น doc2" })
|
||||||
|
commanderOrgOldDoc2: string;
|
||||||
|
@Column({ nullable: true, comment: "ตำแหน่งเดิม ผู้บังคับบัญชาชั้นต้น doc2" })
|
||||||
|
commanderPositionOldDoc2: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true, comment: "สังกัดปัจุบัน ผู้บังคับบัญชาเหนือขึ้นไป 1 ระดับ doc2" })
|
||||||
|
commanderAboveOrgDoc2: string;
|
||||||
|
@Column({ nullable: true, comment: "สังกัดเดิม ผู้บังคับบัญชาเหนือขึ้นไป 1 ระดับ doc2" })
|
||||||
|
commanderAboveOrgOldDoc2: string;
|
||||||
|
@Column({ nullable: true, comment: "ตำแหน่งเดิม ผู้บังคับบัญชาเหนือขึ้นไป 1 ระดับ doc2" })
|
||||||
|
commanderAbovePositionOldDoc2: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "ชื่อ-นามสกุล ผู้บังคับบัญชาเหนือขึ้นไป 1 ระดับ (จัดเตรียมเอกสารเล่ม 2)",
|
comment: "ชื่อ-นามสกุล ผู้บังคับบัญชาเหนือขึ้นไป 1 ระดับ (จัดเตรียมเอกสารเล่ม 2)",
|
||||||
|
|
@ -237,14 +251,14 @@ export class Evaluation extends EntityBase {
|
||||||
@Column({ nullable: true, comment: "ชื่อเจ้าของผลงาน" })
|
@Column({ nullable: true, comment: "ชื่อเจ้าของผลงาน" })
|
||||||
author: string;
|
author: string;
|
||||||
|
|
||||||
@Column({ nullable: true, comment: "ชื่อผลงาน" })
|
@Column({ type: 'json', nullable: true, comment: 'ชื่อผลงาน' })
|
||||||
subject: string;
|
subject: string[];
|
||||||
|
|
||||||
@Column({ nullable: true, comment: "ชื่อเจ้าของผลงาน2" })
|
@Column({ nullable: true, comment: "ชื่อเจ้าของผลงาน2" })
|
||||||
authorDoc2: string;
|
authorDoc2: string;
|
||||||
|
|
||||||
@Column({ nullable: true, comment: "ชื่อผลงาน2" })
|
@Column({ type: 'json', nullable: true, comment: "ชื่อผลงาน2" })
|
||||||
subjectDoc2: string;
|
subjectDoc2: string[];
|
||||||
|
|
||||||
@Column({ nullable: true, comment: "ตำแหน่งที่ได้รับมอบหมาย" })
|
@Column({ nullable: true, comment: "ตำแหน่งที่ได้รับมอบหมาย" })
|
||||||
assignedPosition: string;
|
assignedPosition: string;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue