บันทึกการศึกษา
This commit is contained in:
parent
d101cbca4a
commit
00df943de5
1 changed files with 37 additions and 26 deletions
|
|
@ -218,6 +218,7 @@ export class DevelopmentScholarshipController extends Controller {
|
|||
.getManyAndCount();
|
||||
const formattedData = development.map((item) => ({
|
||||
id: item.id,
|
||||
year: item.scholarshipYear,
|
||||
citizenId: item.citizenId,
|
||||
fullName: item.prefix + item.firstName + " " + item.lastName,
|
||||
position: item.position,
|
||||
|
|
@ -461,51 +462,61 @@ export class DevelopmentScholarshipController extends Controller {
|
|||
getDevelopment.status = _status;
|
||||
getDevelopment.lastUpdateUserId = request.user.sub;
|
||||
getDevelopment.lastUpdateFullName = request.user.name;
|
||||
let scholarshipType = "";
|
||||
if (_status == "GRADUATE") {
|
||||
if (getDevelopment.scholarshipType != null) {
|
||||
switch (getDevelopment.scholarshipType.trim().toUpperCase()) {
|
||||
case "DOMESTICE":
|
||||
getDevelopment.scholarshipType = "การศึกษาในประเทศ";
|
||||
scholarshipType = "การศึกษาในประเทศ";
|
||||
break;
|
||||
case "NOABROAD":
|
||||
getDevelopment.scholarshipType =
|
||||
scholarshipType =
|
||||
"ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ)";
|
||||
break;
|
||||
case "ABROAD":
|
||||
getDevelopment.scholarshipType =
|
||||
scholarshipType =
|
||||
"ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ)";
|
||||
break;
|
||||
case "EXECUTIVE":
|
||||
getDevelopment.scholarshipType =
|
||||
scholarshipType =
|
||||
"ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรประเภทนักบริหาร)";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
let profileEdu = await new CallAPI().PostData(request, "org/profile/educations", {
|
||||
profileId: getDevelopment.profileId,
|
||||
institute: getDevelopment.educationalInstitution,
|
||||
startDate: getDevelopment.startDate,
|
||||
endDate: getDevelopment.endDate,
|
||||
finishDate: null,
|
||||
isEducation: false,
|
||||
degree: null,
|
||||
field: getDevelopment.field,
|
||||
fundName: getDevelopment.scholarshipType,
|
||||
gpa: null,
|
||||
country: getDevelopment.studyCountry,
|
||||
other: null,
|
||||
duration: getDevelopment.totalPeriod,
|
||||
durationYear: 0,
|
||||
note: null,
|
||||
educationLevel: getDevelopment.degreeLevel,
|
||||
educationLevelId: null,
|
||||
isDate: false,
|
||||
positionPath: null,
|
||||
positionPathId: null,
|
||||
});
|
||||
let profileEdu = await new CallAPI()
|
||||
.PostData(request, "org/profile/educations", {
|
||||
profileId: getDevelopment.profileId,
|
||||
institute: getDevelopment.educationalInstitution,
|
||||
startDate: getDevelopment.startDate,
|
||||
endDate: getDevelopment.endDate,
|
||||
finishDate: null,
|
||||
isEducation: false,
|
||||
degree: null,
|
||||
field: getDevelopment.field,
|
||||
fundName: scholarshipType,
|
||||
gpa: null,
|
||||
country: getDevelopment.studyCountry,
|
||||
other: null,
|
||||
duration: getDevelopment.totalPeriod,
|
||||
durationYear: 0,
|
||||
note: null,
|
||||
educationLevel: getDevelopment.degreeLevel,
|
||||
educationLevelId: null,
|
||||
isDate: false,
|
||||
positionPath: null,
|
||||
positionPathId: null,
|
||||
})
|
||||
.then(async (x) => {
|
||||
await this.developmentScholarshipRepository.save(getDevelopment);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("ไม่สามารถบันทึกลงทะเบียนประวัติได้");
|
||||
});
|
||||
} else if (_status == "NOTGRADUATE") {
|
||||
getDevelopment.status = _status;
|
||||
await this.developmentScholarshipRepository.save(getDevelopment);
|
||||
} else {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบสถานะนี้ในระบบ");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue