Merge branch 'develop'
* develop: no message no message แก้บันทึกคำสั่ง
This commit is contained in:
commit
0bce2a3637
1 changed files with 371 additions and 360 deletions
|
|
@ -1147,7 +1147,7 @@ export class ReportController extends Controller {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
// console.log(">>>>3",salaryProfile1);
|
// console.log(">>>>3",salaryProfile1);
|
||||||
|
|
||||||
//รอบปีก่อนหน้า
|
//รอบปีก่อนหน้า
|
||||||
const salaryPeriodIncrease2_APR = await this.salaryPeriodRepository.findOne({
|
const salaryPeriodIncrease2_APR = await this.salaryPeriodRepository.findOne({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -1584,7 +1584,7 @@ export class ReportController extends Controller {
|
||||||
: item.type === "FULLHAFT"
|
: item.type === "FULLHAFT"
|
||||||
? "หนึ่งขั้นครึ่ง"
|
? "หนึ่งขั้นครึ่ง"
|
||||||
: "-",
|
: "-",
|
||||||
score1: item.result??"-", //ผลการประเมินฯ ครั้งที่ 1
|
score1: item.result ?? "-", //ผลการประเมินฯ ครั้งที่ 1
|
||||||
score2: "-", //ผลการประเมินฯ ครั้งที่ 2
|
score2: "-", //ผลการประเมินฯ ครั้งที่ 2
|
||||||
}))
|
}))
|
||||||
: null,
|
: null,
|
||||||
|
|
@ -1664,7 +1664,7 @@ export class ReportController extends Controller {
|
||||||
: item.type === "FULLHAFT"
|
: item.type === "FULLHAFT"
|
||||||
? "หนึ่งขั้นครึ่ง"
|
? "หนึ่งขั้นครึ่ง"
|
||||||
: "-",
|
: "-",
|
||||||
score1: item.result??"-", //ผลการประเมินฯ ครั้งที่ 1
|
score1: item.result ?? "-", //ผลการประเมินฯ ครั้งที่ 1
|
||||||
score2: "-", //ผลการประเมินฯ ครั้งที่ 2
|
score2: "-", //ผลการประเมินฯ ครั้งที่ 2
|
||||||
}))
|
}))
|
||||||
: null,
|
: null,
|
||||||
|
|
@ -2253,7 +2253,7 @@ export class ReportController extends Controller {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
isRetired: true, // เฉพาะคนที่เกษียณ
|
isRetired: true, // เฉพาะคนที่เกษียณ
|
||||||
type: Not(In(["NONE","PENDING"])),
|
type: Not(In(["NONE", "PENDING"])),
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
type: "DESC",
|
type: "DESC",
|
||||||
|
|
@ -2503,14 +2503,10 @@ export class ReportController extends Controller {
|
||||||
@Path() salaryPeriodId: string,
|
@Path() salaryPeriodId: string,
|
||||||
@Path() group: string,
|
@Path() group: string,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
||||||
return new HttpSuccess({
|
return new HttpSuccess({
|
||||||
template: "gov2-10",
|
template: "gov2-10",
|
||||||
reportName: "gov2-10",
|
reportName: "gov2-10",
|
||||||
data: {
|
data: {},
|
||||||
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4481,7 +4477,7 @@ export class ReportController extends Controller {
|
||||||
const matchingProfile = aprPreviousYearProfileCurrent.find(
|
const matchingProfile = aprPreviousYearProfileCurrent.find(
|
||||||
(profileAPR) => profileAPR.citizenId === profile.citizenId,
|
(profileAPR) => profileAPR.citizenId === profile.citizenId,
|
||||||
);
|
);
|
||||||
if (!matchingProfile) return false;
|
if (!matchingProfile) return false;
|
||||||
const typeMatch = checkTypeMatch(matchingProfile.type, profile.type);
|
const typeMatch = checkTypeMatch(matchingProfile.type, profile.type);
|
||||||
return typeMatch;
|
return typeMatch;
|
||||||
})
|
})
|
||||||
|
|
@ -4783,7 +4779,7 @@ export class ReportController extends Controller {
|
||||||
amountSpecial: profile.amountSpecial
|
amountSpecial: profile.amountSpecial
|
||||||
? Extension.ToThaiNumber(profile.amountSpecial.toLocaleString())
|
? Extension.ToThaiNumber(profile.amountSpecial.toLocaleString())
|
||||||
: "-",
|
: "-",
|
||||||
score: profile.result??"-",
|
score: profile.result ?? "-",
|
||||||
reason: null,
|
reason: null,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
@ -6469,326 +6465,327 @@ export class ReportController extends Controller {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* API ออกคำสั่ง 33
|
// * API ออกคำสั่ง 33
|
||||||
*
|
// *
|
||||||
* @summary ออกคำสั่ง 33
|
// * @summary ออกคำสั่ง 33
|
||||||
*
|
// *
|
||||||
* @param {string} id Guid, *Id ผังเงินเดือน
|
// * @param {string} id Guid, *Id ผังเงินเดือน
|
||||||
*/
|
// */
|
||||||
@Post("command/33/resume")
|
// @Post("command/33/resume")
|
||||||
async SalaryReport33Resume(
|
// async SalaryReport33Resume(
|
||||||
@Body()
|
// @Body()
|
||||||
body: {
|
// body: {
|
||||||
result: {
|
// result: {
|
||||||
id: string;
|
// id: string;
|
||||||
refCommandNo: string;
|
// refCommandNo: string;
|
||||||
templateDoc: string;
|
// templateDoc: string;
|
||||||
mpCee?: string | null;
|
// mpCee?: string | null;
|
||||||
refCommandCode?: string | null;
|
// refCommandCode?: string | null;
|
||||||
refCommandName?: string | null;
|
// refCommandName?: string | null;
|
||||||
}[];
|
// }[];
|
||||||
},
|
// },
|
||||||
@Request() request: RequestWithUser,
|
// @Request() request: RequestWithUser,
|
||||||
) {
|
// ) {
|
||||||
await Promise.all(
|
// await Promise.all(
|
||||||
body.result.map(async (v) => {
|
// body.result.map(async (v) => {
|
||||||
const salary = await this.salaryProfileRepository.findOne({
|
// const salary = await this.salaryProfileRepository.findOne({
|
||||||
where: {
|
// where: {
|
||||||
id: v.id,
|
// id: v.id,
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
|
|
||||||
if (salary != null) {
|
// if (salary != null) {
|
||||||
await new CallAPI()
|
// await new CallAPI()
|
||||||
.PostData(request, "/org/profile/salary", {
|
// .PostData(request, "/org/profile/salary", {
|
||||||
profileId: salary.profileId,
|
// profileId: salary.profileId,
|
||||||
date: new Date(),
|
|
||||||
amount: salary.positionSalaryAmount,
|
|
||||||
positionSalaryAmount: salary.amountSpecial,
|
|
||||||
mouthSalaryAmount: null,
|
|
||||||
posNo: salary.orgShortName + salary.posMasterNo,
|
|
||||||
position: salary.position,
|
|
||||||
positionLine: null,
|
|
||||||
positionPathSide: null,
|
|
||||||
positionExecutive: salary.posExecutive,
|
|
||||||
positionType: salary.posType,
|
|
||||||
positionLevel: salary.posLevel,
|
|
||||||
refCommandNo: v.refCommandNo,
|
|
||||||
templateDoc: v.templateDoc,
|
|
||||||
refCommandCode: v.refCommandCode,
|
|
||||||
refCommandName: v.refCommandName,
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
const before = null;
|
|
||||||
salary.status = "DONE";
|
|
||||||
salary.lastUpdateUserId = request.user.sub;
|
|
||||||
salary.lastUpdateFullName = request.user.name;
|
|
||||||
salary.lastUpdatedAt = new Date();
|
|
||||||
await this.salaryProfileRepository.save(salary, { data: request });
|
|
||||||
setLogDataDiff(request, { before, after: salary });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
return new HttpSuccess();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
// date: new Date(),
|
||||||
* API ออกคำสั่ง 34
|
// amount: salary.positionSalaryAmount,
|
||||||
*
|
// positionSalaryAmount: salary.amountSpecial,
|
||||||
* @summary ออกคำสั่ง 34
|
// mouthSalaryAmount: null,
|
||||||
*
|
// posNo: salary.orgShortName + salary.posMasterNo,
|
||||||
* @param {string} id Guid, *Id ผังเงินเดือน
|
// position: salary.position,
|
||||||
*/
|
// positionLine: null,
|
||||||
@Post("command/34/resume")
|
// positionPathSide: null,
|
||||||
async SalaryReport34Resume(
|
// positionExecutive: salary.posExecutive,
|
||||||
@Body()
|
// positionType: salary.posType,
|
||||||
body: {
|
// positionLevel: salary.posLevel,
|
||||||
result: {
|
// refCommandNo: v.refCommandNo,
|
||||||
id: string;
|
// templateDoc: v.templateDoc,
|
||||||
refCommandNo: string;
|
// refCommandCode: v.refCommandCode,
|
||||||
templateDoc: string;
|
// refCommandName: v.refCommandName,
|
||||||
mpCee?: string | null;
|
// })
|
||||||
refCommandCode?: string | null;
|
// .then(async () => {
|
||||||
refCommandName?: string | null;
|
// const before = null;
|
||||||
}[];
|
// salary.status = "DONE";
|
||||||
},
|
// salary.lastUpdateUserId = request.user.sub;
|
||||||
@Request() request: RequestWithUser,
|
// salary.lastUpdateFullName = request.user.name;
|
||||||
) {
|
// salary.lastUpdatedAt = new Date();
|
||||||
await Promise.all(
|
// await this.salaryProfileRepository.save(salary, { data: request });
|
||||||
body.result.map(async (v) => {
|
// setLogDataDiff(request, { before, after: salary });
|
||||||
const salary = await this.salaryProfileRepository.findOne({
|
// });
|
||||||
where: {
|
// }
|
||||||
id: v.id,
|
// }),
|
||||||
},
|
// );
|
||||||
});
|
// return new HttpSuccess();
|
||||||
if (salary != null) {
|
// }
|
||||||
await new CallAPI()
|
|
||||||
.PostData(request, "/org/profile/salary", {
|
|
||||||
profileId: salary.profileId,
|
|
||||||
date: new Date(),
|
|
||||||
amount: salary.positionSalaryAmount,
|
|
||||||
positionSalaryAmount: salary.amountSpecial,
|
|
||||||
mouthSalaryAmount: null,
|
|
||||||
posNo: salary.orgShortName + salary.posMasterNo,
|
|
||||||
position: salary.position,
|
|
||||||
positionLine: null,
|
|
||||||
positionPathSide: null,
|
|
||||||
positionExecutive: salary.posExecutive,
|
|
||||||
positionType: salary.posType,
|
|
||||||
positionLevel: salary.posLevel,
|
|
||||||
refCommandNo: v.refCommandNo,
|
|
||||||
templateDoc: v.templateDoc,
|
|
||||||
refCommandCode: v.refCommandCode,
|
|
||||||
refCommandName: v.refCommandName,
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
const before = null;
|
|
||||||
salary.status = "DONE";
|
|
||||||
salary.lastUpdateUserId = request.user.sub;
|
|
||||||
salary.lastUpdateFullName = request.user.name;
|
|
||||||
salary.lastUpdatedAt = new Date();
|
|
||||||
await this.salaryProfileRepository.save(salary, { data: request });
|
|
||||||
setLogDataDiff(request, { before, after: salary });
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
return new HttpSuccess();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* API ออกคำสั่ง 35
|
// * API ออกคำสั่ง 34
|
||||||
*
|
// *
|
||||||
* @summary ออกคำสั่ง 35
|
// * @summary ออกคำสั่ง 34
|
||||||
*
|
// *
|
||||||
* @param {string} id Guid, *Id ผังเงินเดือน
|
// * @param {string} id Guid, *Id ผังเงินเดือน
|
||||||
*/
|
// */
|
||||||
@Post("command/35/resume")
|
// @Post("command/34/resume")
|
||||||
async SalaryReport35Resume(
|
// async SalaryReport34Resume(
|
||||||
@Body()
|
// @Body()
|
||||||
body: {
|
// body: {
|
||||||
result: {
|
// result: {
|
||||||
id: string;
|
// id: string;
|
||||||
refCommandNo: string;
|
// refCommandNo: string;
|
||||||
templateDoc: string;
|
// templateDoc: string;
|
||||||
mpCee?: string | null;
|
// mpCee?: string | null;
|
||||||
refCommandCode?: string | null;
|
// refCommandCode?: string | null;
|
||||||
refCommandName?: string | null;
|
// refCommandName?: string | null;
|
||||||
}[];
|
// }[];
|
||||||
},
|
// },
|
||||||
@Request() request: RequestWithUser,
|
// @Request() request: RequestWithUser,
|
||||||
) {
|
// ) {
|
||||||
await Promise.all(
|
// await Promise.all(
|
||||||
body.result.map(async (v) => {
|
// body.result.map(async (v) => {
|
||||||
const salary = await this.salaryProfileRepository.findOne({
|
// const salary = await this.salaryProfileRepository.findOne({
|
||||||
where: {
|
// where: {
|
||||||
id: v.id,
|
// id: v.id,
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
if (salary != null) {
|
// if (salary != null) {
|
||||||
await new CallAPI()
|
// await new CallAPI()
|
||||||
.PostData(request, "/org/profile/salary", {
|
// .PostData(request, "/org/profile/salary", {
|
||||||
profileId: salary.profileId,
|
// profileId: salary.profileId,
|
||||||
date: new Date(),
|
// date: new Date(),
|
||||||
amount: salary.positionSalaryAmount,
|
// amount: salary.positionSalaryAmount,
|
||||||
positionSalaryAmount: salary.amountSpecial,
|
// positionSalaryAmount: salary.amountSpecial,
|
||||||
mouthSalaryAmount: null,
|
// mouthSalaryAmount: null,
|
||||||
posNo: salary.orgShortName + salary.posMasterNo,
|
// posNo: salary.orgShortName + salary.posMasterNo,
|
||||||
position: salary.position,
|
// position: salary.position,
|
||||||
positionLine: null,
|
// positionLine: null,
|
||||||
positionPathSide: null,
|
// positionPathSide: null,
|
||||||
positionExecutive: salary.posExecutive,
|
// positionExecutive: salary.posExecutive,
|
||||||
positionType: salary.posType,
|
// positionType: salary.posType,
|
||||||
positionLevel: salary.posLevel,
|
// positionLevel: salary.posLevel,
|
||||||
refCommandNo: v.refCommandNo,
|
// refCommandNo: v.refCommandNo,
|
||||||
templateDoc: v.templateDoc,
|
// templateDoc: v.templateDoc,
|
||||||
refCommandCode: v.refCommandCode,
|
// refCommandCode: v.refCommandCode,
|
||||||
refCommandName: v.refCommandName,
|
// refCommandName: v.refCommandName,
|
||||||
})
|
// })
|
||||||
.then(async () => {
|
// .then(async () => {
|
||||||
const before = null;
|
// const before = null;
|
||||||
salary.status = "DONE";
|
// salary.status = "DONE";
|
||||||
salary.lastUpdateUserId = request.user.sub;
|
// salary.lastUpdateUserId = request.user.sub;
|
||||||
salary.lastUpdateFullName = request.user.name;
|
// salary.lastUpdateFullName = request.user.name;
|
||||||
salary.lastUpdatedAt = new Date();
|
// salary.lastUpdatedAt = new Date();
|
||||||
await this.salaryProfileRepository.save(salary, { data: request });
|
// await this.salaryProfileRepository.save(salary, { data: request });
|
||||||
setLogDataDiff(request, { before, after: salary });
|
// setLogDataDiff(request, { before, after: salary });
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}),
|
// }),
|
||||||
);
|
// );
|
||||||
return new HttpSuccess();
|
// return new HttpSuccess();
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* API ออกคำสั่ง 36
|
// * API ออกคำสั่ง 35
|
||||||
*
|
// *
|
||||||
* @summary ออกคำสั่ง 36
|
// * @summary ออกคำสั่ง 35
|
||||||
*
|
// *
|
||||||
* @param {string} id Guid, *Id ผังเงินเดือน
|
// * @param {string} id Guid, *Id ผังเงินเดือน
|
||||||
*/
|
// */
|
||||||
@Post("command/36/resume")
|
// @Post("command/35/resume")
|
||||||
async SalaryReport36Resume(
|
// async SalaryReport35Resume(
|
||||||
@Body()
|
// @Body()
|
||||||
body: {
|
// body: {
|
||||||
result: {
|
// result: {
|
||||||
id: string;
|
// id: string;
|
||||||
refCommandNo: string;
|
// refCommandNo: string;
|
||||||
templateDoc: string;
|
// templateDoc: string;
|
||||||
mpCee?: string | null;
|
// mpCee?: string | null;
|
||||||
refCommandCode?: string | null;
|
// refCommandCode?: string | null;
|
||||||
refCommandName?: string | null;
|
// refCommandName?: string | null;
|
||||||
}[];
|
// }[];
|
||||||
},
|
// },
|
||||||
@Request() request: RequestWithUser,
|
// @Request() request: RequestWithUser,
|
||||||
) {
|
// ) {
|
||||||
await Promise.all(
|
// await Promise.all(
|
||||||
body.result.map(async (v) => {
|
// body.result.map(async (v) => {
|
||||||
const salary = await this.salaryProfileEmployeeRepository.findOne({
|
// const salary = await this.salaryProfileRepository.findOne({
|
||||||
where: {
|
// where: {
|
||||||
id: v.id,
|
// id: v.id,
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
if (salary != null) {
|
// if (salary != null) {
|
||||||
await new CallAPI()
|
// await new CallAPI()
|
||||||
.PostData(request, "/org/profile-employee/salary", {
|
// .PostData(request, "/org/profile/salary", {
|
||||||
profileEmployeeId: salary.profileId,
|
// profileId: salary.profileId,
|
||||||
date: new Date(),
|
// date: new Date(),
|
||||||
amount: salary.positionSalaryAmount,
|
// amount: salary.positionSalaryAmount,
|
||||||
positionSalaryAmount: salary.amountSpecial,
|
// positionSalaryAmount: salary.amountSpecial,
|
||||||
mouthSalaryAmount: null,
|
// mouthSalaryAmount: null,
|
||||||
posNo: salary.orgShortName + salary.posMasterNo,
|
// posNo: salary.orgShortName + salary.posMasterNo,
|
||||||
position: salary.position,
|
// position: salary.position,
|
||||||
// positionLine: null,
|
// positionLine: null,
|
||||||
// positionPathSide: null,
|
// positionPathSide: null,
|
||||||
// positionExecutive: null,
|
// positionExecutive: salary.posExecutive,
|
||||||
positionType: salary.posType,
|
// positionType: salary.posType,
|
||||||
positionLevel: salary.posLevel ? String(salary.posLevel) : null,
|
// positionLevel: salary.posLevel,
|
||||||
refCommandNo: v.refCommandNo,
|
// refCommandNo: v.refCommandNo,
|
||||||
templateDoc: v.templateDoc,
|
// templateDoc: v.templateDoc,
|
||||||
refCommandCode: v.refCommandCode,
|
// refCommandCode: v.refCommandCode,
|
||||||
refCommandName: v.refCommandName,
|
// refCommandName: v.refCommandName,
|
||||||
})
|
// })
|
||||||
.then(async () => {
|
// .then(async () => {
|
||||||
const before = null;
|
// const before = null;
|
||||||
salary.status = "DONE";
|
// salary.status = "DONE";
|
||||||
salary.lastUpdateUserId = request.user.sub;
|
// salary.lastUpdateUserId = request.user.sub;
|
||||||
salary.lastUpdateFullName = request.user.name;
|
// salary.lastUpdateFullName = request.user.name;
|
||||||
salary.lastUpdatedAt = new Date();
|
// salary.lastUpdatedAt = new Date();
|
||||||
await this.salaryProfileEmployeeRepository.save(salary, { data: request });
|
// await this.salaryProfileRepository.save(salary, { data: request });
|
||||||
setLogDataDiff(request, { before, after: salary });
|
// setLogDataDiff(request, { before, after: salary });
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}),
|
// }),
|
||||||
);
|
// );
|
||||||
return new HttpSuccess();
|
// return new HttpSuccess();
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* API ออกคำสั่ง 37
|
// * API ออกคำสั่ง 36
|
||||||
*
|
// *
|
||||||
* @summary ออกคำสั่ง 37
|
// * @summary ออกคำสั่ง 36
|
||||||
*
|
// *
|
||||||
* @param {string} id Guid, *Id ผังเงินเดือน
|
// * @param {string} id Guid, *Id ผังเงินเดือน
|
||||||
*/
|
// */
|
||||||
@Post("command/37/resume")
|
// @Post("command/36/resume")
|
||||||
async SalaryReport37Resume(
|
// async SalaryReport36Resume(
|
||||||
@Body()
|
// @Body()
|
||||||
body: {
|
// body: {
|
||||||
result: {
|
// result: {
|
||||||
id: string;
|
// id: string;
|
||||||
refCommandNo: string;
|
// refCommandNo: string;
|
||||||
templateDoc: string;
|
// templateDoc: string;
|
||||||
mpCee?: string | null;
|
// mpCee?: string | null;
|
||||||
refCommandCode?: string | null;
|
// refCommandCode?: string | null;
|
||||||
refCommandName?: string | null;
|
// refCommandName?: string | null;
|
||||||
}[];
|
// }[];
|
||||||
},
|
// },
|
||||||
@Request() request: RequestWithUser,
|
// @Request() request: RequestWithUser,
|
||||||
) {
|
// ) {
|
||||||
await Promise.all(
|
// await Promise.all(
|
||||||
body.result.map(async (v) => {
|
// body.result.map(async (v) => {
|
||||||
const salary = await this.salaryProfileEmployeeRepository.findOne({
|
// const salary = await this.salaryProfileEmployeeRepository.findOne({
|
||||||
where: {
|
// where: {
|
||||||
id: v.id,
|
// id: v.id,
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
if (salary != null) {
|
// if (salary != null) {
|
||||||
await new CallAPI()
|
// await new CallAPI()
|
||||||
.PostData(request, "/org/profile-employee/salary", {
|
// .PostData(request, "/org/profile-employee/salary", {
|
||||||
profileEmployeeId: salary.profileId,
|
// profileEmployeeId: salary.profileId,
|
||||||
date: new Date(),
|
// date: new Date(),
|
||||||
amount: salary.positionSalaryAmount,
|
// amount: salary.positionSalaryAmount,
|
||||||
positionSalaryAmount: salary.amountSpecial,
|
// positionSalaryAmount: salary.amountSpecial,
|
||||||
mouthSalaryAmount: null,
|
// mouthSalaryAmount: null,
|
||||||
posNo: salary.orgShortName + salary.posMasterNo,
|
// posNo: salary.orgShortName + salary.posMasterNo,
|
||||||
position: salary.position,
|
// position: salary.position,
|
||||||
positionLine: null,
|
// // positionLine: null,
|
||||||
positionPathSide: null,
|
// // positionPathSide: null,
|
||||||
positionExecutive: null,
|
// // positionExecutive: null,
|
||||||
positionType: salary.posType,
|
// positionType: salary.posType,
|
||||||
positionLevel: salary.posLevel,
|
// positionLevel: salary.posLevel ? String(salary.posLevel) : null,
|
||||||
refCommandNo: v.refCommandNo,
|
// refCommandNo: v.refCommandNo,
|
||||||
templateDoc: v.templateDoc,
|
// templateDoc: v.templateDoc,
|
||||||
refCommandCode: v.refCommandCode,
|
// refCommandCode: v.refCommandCode,
|
||||||
refCommandName: v.refCommandName,
|
// refCommandName: v.refCommandName,
|
||||||
})
|
// })
|
||||||
.then(async () => {
|
// .then(async () => {
|
||||||
const before = null;
|
// const before = null;
|
||||||
salary.status = "DONE";
|
// salary.status = "DONE";
|
||||||
salary.lastUpdateUserId = request.user.sub;
|
// salary.lastUpdateUserId = request.user.sub;
|
||||||
salary.lastUpdateFullName = request.user.name;
|
// salary.lastUpdateFullName = request.user.name;
|
||||||
salary.lastUpdatedAt = new Date();
|
// salary.lastUpdatedAt = new Date();
|
||||||
await this.salaryProfileEmployeeRepository.save(salary, { data: request });
|
// await this.salaryProfileEmployeeRepository.save(salary, { data: request });
|
||||||
setLogDataDiff(request, { before, after: salary });
|
// setLogDataDiff(request, { before, after: salary });
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}),
|
// }),
|
||||||
);
|
// );
|
||||||
return new HttpSuccess();
|
// return new HttpSuccess();
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * API ออกคำสั่ง 37
|
||||||
|
// *
|
||||||
|
// * @summary ออกคำสั่ง 37
|
||||||
|
// *
|
||||||
|
// * @param {string} id Guid, *Id ผังเงินเดือน
|
||||||
|
// */
|
||||||
|
// @Post("command/37/resume")
|
||||||
|
// async SalaryReport37Resume(
|
||||||
|
// @Body()
|
||||||
|
// body: {
|
||||||
|
// result: {
|
||||||
|
// id: string;
|
||||||
|
// refCommandNo: string;
|
||||||
|
// templateDoc: string;
|
||||||
|
// mpCee?: string | null;
|
||||||
|
// refCommandCode?: string | null;
|
||||||
|
// refCommandName?: string | null;
|
||||||
|
// }[];
|
||||||
|
// },
|
||||||
|
// @Request() request: RequestWithUser,
|
||||||
|
// ) {
|
||||||
|
// await Promise.all(
|
||||||
|
// body.result.map(async (v) => {
|
||||||
|
// const salary = await this.salaryProfileEmployeeRepository.findOne({
|
||||||
|
// where: {
|
||||||
|
// id: v.id,
|
||||||
|
// },
|
||||||
|
// });
|
||||||
|
// if (salary != null) {
|
||||||
|
// await new CallAPI()
|
||||||
|
// .PostData(request, "/org/profile-employee/salary", {
|
||||||
|
// profileEmployeeId: salary.profileId,
|
||||||
|
// date: new Date(),
|
||||||
|
// amount: salary.positionSalaryAmount,
|
||||||
|
// positionSalaryAmount: salary.amountSpecial,
|
||||||
|
// mouthSalaryAmount: null,
|
||||||
|
// posNo: salary.orgShortName + salary.posMasterNo,
|
||||||
|
// position: salary.position,
|
||||||
|
// positionLine: null,
|
||||||
|
// positionPathSide: null,
|
||||||
|
// positionExecutive: null,
|
||||||
|
// positionType: salary.posType,
|
||||||
|
// positionLevel: salary.posLevel,
|
||||||
|
// refCommandNo: v.refCommandNo,
|
||||||
|
// templateDoc: v.templateDoc,
|
||||||
|
// refCommandCode: v.refCommandCode,
|
||||||
|
// refCommandName: v.refCommandName,
|
||||||
|
// })
|
||||||
|
// .then(async () => {
|
||||||
|
// const before = null;
|
||||||
|
// salary.status = "DONE";
|
||||||
|
// salary.lastUpdateUserId = request.user.sub;
|
||||||
|
// salary.lastUpdateFullName = request.user.name;
|
||||||
|
// salary.lastUpdatedAt = new Date();
|
||||||
|
// await this.salaryProfileEmployeeRepository.save(salary, { data: request });
|
||||||
|
// setLogDataDiff(request, { before, after: salary });
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }),
|
||||||
|
// );
|
||||||
|
// return new HttpSuccess();
|
||||||
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API ออกคำสั่ง 33
|
* API ออกคำสั่ง 33
|
||||||
|
|
@ -7820,18 +7817,18 @@ export class ReportController extends Controller {
|
||||||
body: {
|
body: {
|
||||||
refIds: {
|
refIds: {
|
||||||
refId: string;
|
refId: string;
|
||||||
commandAffectDate: Date | null;
|
|
||||||
commandNo: string | null;
|
commandNo: string | null;
|
||||||
commandId?: string | null;
|
commandYear: number | null;
|
||||||
commandYear: number;
|
commandId: string | null;
|
||||||
templateDoc: string | null;
|
remark: string | null;
|
||||||
amount: Double | null;
|
amount: Double | null;
|
||||||
amountSpecial: Double | null;
|
amountSpecial?: Double | null;
|
||||||
positionSalaryAmount: Double | null;
|
positionSalaryAmount: Double | null;
|
||||||
mouthSalaryAmount: Double | null;
|
mouthSalaryAmount: Double | null;
|
||||||
mpCee?: string | null;
|
commandCode?: string | null;
|
||||||
refCommandCode?: string | null;
|
commandName?: string | null;
|
||||||
refCommandName?: string | null;
|
commandDateAffect: Date | null;
|
||||||
|
commandDateSign: Date | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
|
|
@ -7848,23 +7845,29 @@ export class ReportController extends Controller {
|
||||||
await new CallAPI()
|
await new CallAPI()
|
||||||
.PostData(request, "/org/profile/salary/update", {
|
.PostData(request, "/org/profile/salary/update", {
|
||||||
profileId: salary.profileId,
|
profileId: salary.profileId,
|
||||||
date: new Date(),
|
commandDateAffect: v.commandDateAffect,
|
||||||
|
commandDateSign: v.commandDateSign,
|
||||||
amount: v.amount,
|
amount: v.amount,
|
||||||
amountSpecial: v.amountSpecial,
|
amountSpecial: v.amountSpecial,
|
||||||
commandId: v.commandId,
|
|
||||||
positionSalaryAmount: v.positionSalaryAmount,
|
positionSalaryAmount: v.positionSalaryAmount,
|
||||||
mouthSalaryAmount: v.mouthSalaryAmount,
|
mouthSalaryAmount: v.mouthSalaryAmount,
|
||||||
posNo: salary.orgShortName + salary.posMasterNo,
|
posNo: salary.posMasterNo.toString(),
|
||||||
position: salary.position,
|
posNoAbb: salary.orgShortName,
|
||||||
positionLine: null,
|
positionName: salary.position,
|
||||||
positionPathSide: null,
|
|
||||||
positionExecutive: salary.posExecutive,
|
positionExecutive: salary.posExecutive,
|
||||||
positionType: salary.posType,
|
positionType: salary.posType,
|
||||||
positionLevel: salary.posLevel,
|
positionLevel: salary.posLevel,
|
||||||
refCommandNo: `${v.commandNo}/${Extension.ToThaiYear(v.commandYear)}`,
|
commandId: v.commandId,
|
||||||
templateDoc: v.templateDoc,
|
remark: v.remark,
|
||||||
refCommandCode: v.refCommandCode,
|
orgRoot: salary.root,
|
||||||
refCommandName: v.refCommandName,
|
orgChild1: salary.child1,
|
||||||
|
orgChild2: salary.child2,
|
||||||
|
orgChild3: salary.child3,
|
||||||
|
orgChild4: salary.child4,
|
||||||
|
commandCode: v.commandCode,
|
||||||
|
commandName: v.commandName,
|
||||||
|
commandNo: v.commandNo,
|
||||||
|
commandYear: v.commandYear,
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
const before = null;
|
const before = null;
|
||||||
|
|
@ -7894,18 +7897,18 @@ export class ReportController extends Controller {
|
||||||
body: {
|
body: {
|
||||||
refIds: {
|
refIds: {
|
||||||
refId: string;
|
refId: string;
|
||||||
commandAffectDate: Date | null;
|
|
||||||
commandNo: string | null;
|
commandNo: string | null;
|
||||||
|
commandYear: number | null;
|
||||||
commandId: string | null;
|
commandId: string | null;
|
||||||
commandYear: number;
|
remark: string | null;
|
||||||
templateDoc: string | null;
|
|
||||||
amount: Double | null;
|
amount: Double | null;
|
||||||
amountSpecial: Double | null;
|
amountSpecial?: Double | null;
|
||||||
positionSalaryAmount: Double | null;
|
positionSalaryAmount: Double | null;
|
||||||
mouthSalaryAmount: Double | null;
|
mouthSalaryAmount: Double | null;
|
||||||
mpCee?: string | null;
|
commandCode?: string | null;
|
||||||
refCommandCode?: string | null;
|
commandName?: string | null;
|
||||||
refCommandName?: string | null;
|
commandDateAffect: Date | null;
|
||||||
|
commandDateSign: Date | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
|
|
@ -7921,20 +7924,28 @@ export class ReportController extends Controller {
|
||||||
await new CallAPI()
|
await new CallAPI()
|
||||||
.PostData(request, "/org/profile-employee/salary/update", {
|
.PostData(request, "/org/profile-employee/salary/update", {
|
||||||
profileEmployeeId: salary.profileId,
|
profileEmployeeId: salary.profileId,
|
||||||
date: new Date(),
|
commandDateAffect: v.commandDateAffect,
|
||||||
|
commandDateSign: v.commandDateSign,
|
||||||
amount: v.amount,
|
amount: v.amount,
|
||||||
amountSpecial: v.amountSpecial,
|
amountSpecial: v.amountSpecial,
|
||||||
commandId: v.commandId,
|
|
||||||
positionSalaryAmount: v.positionSalaryAmount,
|
positionSalaryAmount: v.positionSalaryAmount,
|
||||||
mouthSalaryAmount: v.mouthSalaryAmount,
|
mouthSalaryAmount: v.mouthSalaryAmount,
|
||||||
posNo: salary.orgShortName + salary.posMasterNo,
|
posNo: salary.posMasterNo.toString(),
|
||||||
position: salary.position,
|
posNoAbb: salary.orgShortName,
|
||||||
|
positionName: salary.position,
|
||||||
positionType: salary.posType,
|
positionType: salary.posType,
|
||||||
positionLevel: salary.posLevel ? String(salary.posLevel) : null,
|
positionLevel: salary.posLevel,
|
||||||
refCommandNo: `${v.commandNo}/${Extension.ToThaiYear(v.commandYear)}`,
|
commandId: v.commandId,
|
||||||
templateDoc: v.templateDoc,
|
remark: v.remark,
|
||||||
refCommandCode: v.refCommandCode,
|
orgRoot: salary.root,
|
||||||
refCommandName: v.refCommandName,
|
orgChild1: salary.child1,
|
||||||
|
orgChild2: salary.child2,
|
||||||
|
orgChild3: salary.child3,
|
||||||
|
orgChild4: salary.child4,
|
||||||
|
commandCode: v.commandCode,
|
||||||
|
commandName: v.commandName,
|
||||||
|
commandNo: v.commandNo,
|
||||||
|
commandYear: v.commandYear,
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
const before = null;
|
const before = null;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue