ออกคำสั่งลูกจ้าง

This commit is contained in:
Kittapath 2024-06-13 10:17:57 +07:00
parent ae1a382dd0
commit b2178c6341
4 changed files with 203 additions and 22 deletions

View file

@ -58,6 +58,7 @@ import {
UpdateEmploymentProfileEmployee,
} from "../entities/ProfileEmployeeEmployment";
import { ProfileEmployeeEmploymentHistory } from "../entities/ProfileEmployeeEmploymentHistory";
import CallAPI from "../interfaces/call-api";
@Route("api/v1/org/profile-employee")
@Tags("ProfileEmployee")
@ -1549,28 +1550,28 @@ export class ProfileEmployeeController extends Controller {
posLevelId: item.posLevelId,
posLevelName: item.posLevel?.posLevelName,
profileEducation: latestProfileEducation?.degree ?? null,
// ? {
// id: latestProfileEducation.id,
// degree: latestProfileEducation.degree,
// country: latestProfileEducation.country,
// duration: latestProfileEducation.duration,
// durationYear: latestProfileEducation.durationYear,
// field: latestProfileEducation.field,
// finishDate: latestProfileEducation.finishDate,
// fundName: latestProfileEducation.fundName,
// gpa: latestProfileEducation.gpa,
// institute: latestProfileEducation.institute,
// other: latestProfileEducation.other,
// startDate: latestProfileEducation.startDate,
// endDate: latestProfileEducation.endDate,
// educationLevel: latestProfileEducation.educationLevel,
// positionPath: latestProfileEducation.positionPath,
// positionPathId: latestProfileEducation.positionPathId,
// isDate: latestProfileEducation.isDate,
// isEducation: latestProfileEducation.isEducation,
// note: latestProfileEducation.note,
// }
// : null,
// ? {
// id: latestProfileEducation.id,
// degree: latestProfileEducation.degree,
// country: latestProfileEducation.country,
// duration: latestProfileEducation.duration,
// durationYear: latestProfileEducation.durationYear,
// field: latestProfileEducation.field,
// finishDate: latestProfileEducation.finishDate,
// fundName: latestProfileEducation.fundName,
// gpa: latestProfileEducation.gpa,
// institute: latestProfileEducation.institute,
// other: latestProfileEducation.other,
// startDate: latestProfileEducation.startDate,
// endDate: latestProfileEducation.endDate,
// educationLevel: latestProfileEducation.educationLevel,
// positionPath: latestProfileEducation.positionPath,
// positionPathId: latestProfileEducation.positionPathId,
// isDate: latestProfileEducation.isDate,
// isEducation: latestProfileEducation.isEducation,
// note: latestProfileEducation.note,
// }
// : null,
};
}),
);
@ -2849,4 +2850,60 @@ export class ProfileEmployeeController extends Controller {
});
return new HttpSuccess(profiles);
}
/**
* API
*
* @summary ORG_038 - (ADMIN) #
*
*/
@Get("report/resume")
async doneReport(
@Body()
body: {
result: {
id: string;
personId: string;
templateDoc: string;
amount: string;
positionSalaryAmount: string;
mouthSalaryAmount: string;
refCommandNo: string;
}[];
},
@Request() request: { user: Record<string, any> },
) {
await Promise.all(
body.result.map(async (v) => {
const profile = await this.profileRepo.findOne({
where: {
id: v.id,
},
relations: ["posType", "posLevel"],
});
if (profile != null) {
await new CallAPI()
.PostData(request, "org/profile/salary", {
profileId: profile.id,
date: new Date(),
amount: v.amount,
positionSalaryAmount: v.positionSalaryAmount,
mouthSalaryAmount: v.mouthSalaryAmount,
posNo: profile.posMasterNoTemp,
position: profile.positionTemp,
positionType: profile.posTypeNameTemp,
positionLevel: profile.posLevelNameTemp,
refCommandNo: v.refCommandNo,
templateDoc: v.templateDoc,
})
.then(async (x) => {
profile.statusTemp = "DONE";
profile.employeeClass = "TEMP";
await this.profileRepo.save(profile);
});
}
}),
);
return new HttpSuccess();
}
}