บันทึกลงทะเบียนประวัติ
This commit is contained in:
parent
166c919bbe
commit
b8e1c93cb4
3 changed files with 77 additions and 7 deletions
|
|
@ -24,6 +24,7 @@ import {
|
|||
} from "../entities/DevelopmentScholarship";
|
||||
import { PosType } from "../entities/PosType";
|
||||
import { PosLevel } from "../entities/PosLevel";
|
||||
import CallAPI from "../interfaces/call-api";
|
||||
|
||||
@Route("api/v1/development/scholarship")
|
||||
@Tags("DevelopmentScholarship")
|
||||
|
|
@ -75,7 +76,7 @@ export class DevelopmentScholarshipController extends Controller {
|
|||
*
|
||||
* @summary DEV_012 - แก้ไขทุนการศึกษา/ฝึกอบรม #12
|
||||
*
|
||||
* @param {string} id Id โครงการ
|
||||
* @param {string} id Id ข้าราชการฯที่ได้รับทุนการศึกษา
|
||||
*/
|
||||
@Put("{id}")
|
||||
async UpdateDevelopmentScholarship(
|
||||
|
|
@ -117,7 +118,7 @@ export class DevelopmentScholarshipController extends Controller {
|
|||
*
|
||||
* @summary DEV_013 - ลบทุนการศึกษา/ฝึกอบรม #13
|
||||
*
|
||||
* @param {string} id Id โครงการ
|
||||
* @param {string} id Id ข้าราชการฯที่ได้รับทุนการศึกษา
|
||||
*/
|
||||
@Delete("{id}")
|
||||
async DeleteDevelopmentScholarship(@Path() id: string) {
|
||||
|
|
@ -224,7 +225,7 @@ export class DevelopmentScholarshipController extends Controller {
|
|||
*
|
||||
* @summary DEV_015 - รายละเอียดทุนการศึกษา/ฝึกอบรม #15
|
||||
*
|
||||
* @param {string} id Id โครงการ
|
||||
* @param {string} id Id ข้าราชการฯที่ได้รับทุนการศึกษา
|
||||
*/
|
||||
@Get("{id}")
|
||||
async GetDevelopemtScholarshipById(@Path() id: string) {
|
||||
|
|
@ -321,11 +322,15 @@ export class DevelopmentScholarshipController extends Controller {
|
|||
*
|
||||
* @summary DEV_0 - เปลี่ยนสถานะ #
|
||||
*
|
||||
* @param {string} id Id โครงการ
|
||||
* @param {string} id Id ข้าราชการฯที่ได้รับทุนการศึกษา
|
||||
* @param {string} status status สถานะ
|
||||
*/
|
||||
@Get("status/{id}/{status}")
|
||||
async ChangeStatusDevelopemtScholarshipById(@Path() id: string, @Path() status: string) {
|
||||
async ChangeStatusDevelopemtScholarshipById(
|
||||
@Path() id: string,
|
||||
@Path() status: string,
|
||||
@Request() request: { user: Record<string, any> },
|
||||
) {
|
||||
const getDevelopment = await this.developmentScholarshipRepository.findOne({
|
||||
where: { id: id },
|
||||
});
|
||||
|
|
@ -335,12 +340,53 @@ export class DevelopmentScholarshipController extends Controller {
|
|||
const _status = status.trim().toUpperCase();
|
||||
getDevelopment.status = _status;
|
||||
if (_status == "GRADUATE") {
|
||||
//xxxxxxxxxxxxxxxxxxxบันทึกลงทะเบียน
|
||||
if (getDevelopment.scholarshipType != null) {
|
||||
switch (getDevelopment.scholarshipType.trim().toUpperCase()) {
|
||||
case "DOMESTICE":
|
||||
getDevelopment.scholarshipType = "การศึกษาในประเทศ";
|
||||
break;
|
||||
case "NOABROAD":
|
||||
getDevelopment.scholarshipType =
|
||||
"ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่ไม่มีการไปต่างประเทศ)";
|
||||
break;
|
||||
case "ABROAD":
|
||||
getDevelopment.scholarshipType =
|
||||
"ฝึกอบรมในประเทศที่ส่งไปพัฒนากับหน่วยวงานภายนอก (หลักสูตรที่มีการไปต่างประเทศ)";
|
||||
break;
|
||||
case "EXECUTIVE":
|
||||
getDevelopment.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,
|
||||
});
|
||||
} else if (_status == "NOTGRADUATE") {
|
||||
} else {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบสถานะนี้ในระบบ");
|
||||
}
|
||||
await this.developmentScholarshipRepository.remove(getDevelopment);
|
||||
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue