Merge branch 'develop' into adiDev
# Conflicts: # src/controllers/ProfileEmployeeController.ts
This commit is contained in:
commit
b7ce71d017
6 changed files with 199 additions and 2 deletions
|
|
@ -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")
|
||||
|
|
@ -2853,4 +2854,60 @@ export class ProfileEmployeeController extends Controller {
|
|||
});
|
||||
return new HttpSuccess(profiles);
|
||||
}
|
||||
|
||||
/**
|
||||
* API ออกคำสั่งลูกจ้าง
|
||||
*
|
||||
* @summary ORG_038 - ออกคำสั่งลูกจ้าง (ADMIN) #
|
||||
*
|
||||
*/
|
||||
@Post("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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue