add command code 20
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m3s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m3s
This commit is contained in:
parent
b1210d51e8
commit
757da877f6
8 changed files with 268 additions and 218 deletions
|
|
@ -276,34 +276,35 @@ export class ProfileInsigniaController extends Controller {
|
|||
}
|
||||
const profileSalarys = await this.profileSalaryRepo.find({
|
||||
where: [
|
||||
{
|
||||
profileId: body.profileId,
|
||||
commandCode: In([
|
||||
"0",
|
||||
"9",
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"8",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"16",
|
||||
]),
|
||||
},
|
||||
{ profileId: body.profileId, commandCode: IsNull() },
|
||||
],
|
||||
{
|
||||
profileId: body.profileId,
|
||||
commandCode: In([
|
||||
"0",
|
||||
"9",
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"8",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"16",
|
||||
"20",
|
||||
]),
|
||||
},
|
||||
{ profileId: body.profileId, commandCode: IsNull() },
|
||||
],
|
||||
order: { order: "ASC" },
|
||||
});
|
||||
if (!profileSalarys) {
|
||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบข้อมูลตำแหน่งและเงินเดือน");
|
||||
}
|
||||
const birth = new Date(profile.birthDate);
|
||||
const mapData = profileSalarys.map(x => {
|
||||
const mapData = profileSalarys.map((x) => {
|
||||
// คำนวณอายุ
|
||||
let age = null;
|
||||
if (x.commandDateAffect && profile.birthDate) {
|
||||
|
|
@ -317,16 +318,16 @@ export class ProfileInsigniaController extends Controller {
|
|||
}
|
||||
}
|
||||
return {
|
||||
dateAffect: x.commandDateAffect,
|
||||
position: x.positionName,
|
||||
root: x.orgRoot,
|
||||
child1: x.orgChild1,
|
||||
child2: x.orgChild2,
|
||||
child3: x.orgChild3,
|
||||
child4: x.orgChild4,
|
||||
age: age,
|
||||
amount: x.amount,
|
||||
remark: x.remark
|
||||
dateAffect: x.commandDateAffect,
|
||||
position: x.positionName,
|
||||
root: x.orgRoot,
|
||||
child1: x.orgChild1,
|
||||
child2: x.orgChild2,
|
||||
child3: x.orgChild3,
|
||||
child4: x.orgChild4,
|
||||
age: age,
|
||||
amount: x.amount,
|
||||
remark: x.remark,
|
||||
};
|
||||
});
|
||||
return new HttpSuccess(mapData);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue