save profile salary
This commit is contained in:
parent
3a0fc39397
commit
479e9a3938
14 changed files with 817 additions and 129 deletions
|
|
@ -2200,6 +2200,14 @@ export class CommandController extends Controller {
|
||||||
posmasterId: string;
|
posmasterId: string;
|
||||||
positionId: string;
|
positionId: string;
|
||||||
commandId?: string | null;
|
commandId?: string | null;
|
||||||
|
orgRoot?: string | null;
|
||||||
|
orgChild1?: string | null;
|
||||||
|
orgChild2?: string | null;
|
||||||
|
orgChild3?: string | null;
|
||||||
|
orgChild4?: string | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -2225,6 +2233,7 @@ export class CommandController extends Controller {
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.assign(data, { ...item, ...meta });
|
Object.assign(data, { ...item, ...meta });
|
||||||
|
|
@ -2322,6 +2331,14 @@ export class CommandController extends Controller {
|
||||||
posmasterId: string;
|
posmasterId: string;
|
||||||
positionId: string;
|
positionId: string;
|
||||||
commandId?: string | null;
|
commandId?: string | null;
|
||||||
|
orgRoot?: string | null;
|
||||||
|
orgChild1?: string | null;
|
||||||
|
orgChild2?: string | null;
|
||||||
|
orgChild3?: string | null;
|
||||||
|
orgChild4?: string | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -2347,6 +2364,7 @@ export class CommandController extends Controller {
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.assign(data, {
|
Object.assign(data, {
|
||||||
|
|
@ -2459,6 +2477,14 @@ export class CommandController extends Controller {
|
||||||
dateLeave?: Date | null;
|
dateLeave?: Date | null;
|
||||||
commandId?: string | null;
|
commandId?: string | null;
|
||||||
isGovernment?: boolean | null;
|
isGovernment?: boolean | null;
|
||||||
|
orgRoot?: string | null;
|
||||||
|
orgChild1?: string | null;
|
||||||
|
orgChild2?: string | null;
|
||||||
|
orgChild3?: string | null;
|
||||||
|
orgChild4?: string | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -2490,6 +2516,7 @@ export class CommandController extends Controller {
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.assign(data, { ...item, ...meta });
|
Object.assign(data, { ...item, ...meta });
|
||||||
|
|
@ -2600,6 +2627,14 @@ export class CommandController extends Controller {
|
||||||
dateLeave?: Date | null;
|
dateLeave?: Date | null;
|
||||||
isGovernment?: boolean | null;
|
isGovernment?: boolean | null;
|
||||||
commandId?: string | null;
|
commandId?: string | null;
|
||||||
|
orgRoot?: string | null;
|
||||||
|
orgChild1?: string | null;
|
||||||
|
orgChild2?: string | null;
|
||||||
|
orgChild3?: string | null;
|
||||||
|
orgChild4?: string | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -2628,6 +2663,7 @@ export class CommandController extends Controller {
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.assign(data, {
|
Object.assign(data, {
|
||||||
|
|
@ -2700,6 +2736,14 @@ export class CommandController extends Controller {
|
||||||
leaveReason?: string | null;
|
leaveReason?: string | null;
|
||||||
dateLeave?: Date | null;
|
dateLeave?: Date | null;
|
||||||
isLeave?: boolean;
|
isLeave?: boolean;
|
||||||
|
orgRoot?: string | null;
|
||||||
|
orgChild1?: string | null;
|
||||||
|
orgChild2?: string | null;
|
||||||
|
orgChild3?: string | null;
|
||||||
|
orgChild4?: string | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -2728,6 +2772,7 @@ export class CommandController extends Controller {
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
};
|
};
|
||||||
if (item.isLeave != undefined && item.isLeave == true) {
|
if (item.isLeave != undefined && item.isLeave == true) {
|
||||||
await removeProfileInOrganize(profile.id, "OFFICER");
|
await removeProfileInOrganize(profile.id, "OFFICER");
|
||||||
|
|
@ -2783,6 +2828,14 @@ export class CommandController extends Controller {
|
||||||
positionLevel: string | null;
|
positionLevel: string | null;
|
||||||
refCommandNo: string | null;
|
refCommandNo: string | null;
|
||||||
templateDoc: string | null;
|
templateDoc: string | null;
|
||||||
|
orgRoot?: string | null;
|
||||||
|
orgChild1?: string | null;
|
||||||
|
orgChild2?: string | null;
|
||||||
|
orgChild3?: string | null;
|
||||||
|
orgChild4?: string | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -2808,6 +2861,7 @@ export class CommandController extends Controller {
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.assign(data, {
|
Object.assign(data, {
|
||||||
|
|
@ -2843,7 +2897,6 @@ export class CommandController extends Controller {
|
||||||
isLeave: boolean | null;
|
isLeave: boolean | null;
|
||||||
leaveReason?: string | null;
|
leaveReason?: string | null;
|
||||||
dateLeave?: Date | null;
|
dateLeave?: Date | null;
|
||||||
refCommandDate?: Date | null;
|
|
||||||
detail?: string | null;
|
detail?: string | null;
|
||||||
level?: string | null;
|
level?: string | null;
|
||||||
unStigma?: string | null;
|
unStigma?: string | null;
|
||||||
|
|
@ -2852,6 +2905,9 @@ export class CommandController extends Controller {
|
||||||
positionSalaryAmount?: Double | null;
|
positionSalaryAmount?: Double | null;
|
||||||
mouthSalaryAmount?: Double | null;
|
mouthSalaryAmount?: Double | null;
|
||||||
isGovernment?: boolean | null;
|
isGovernment?: boolean | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -2887,6 +2943,13 @@ export class CommandController extends Controller {
|
||||||
orgRevisionIsDraft: false,
|
orgRevisionIsDraft: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const orgRevisionRef =
|
||||||
|
profile?.current_holders?.find((x) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||||
|
const orgRootRef = orgRevisionRef?.orgRoot ?? null;
|
||||||
|
const orgChild1Ref = orgRevisionRef?.orgChild1 ?? null;
|
||||||
|
const orgChild2Ref = orgRevisionRef?.orgChild2 ?? null;
|
||||||
|
const orgChild3Ref = orgRevisionRef?.orgChild3 ?? null;
|
||||||
|
const orgChild4Ref = orgRevisionRef?.orgChild4 ?? null;
|
||||||
const shortName =
|
const shortName =
|
||||||
!profile.current_holders || profile.current_holders.length == 0
|
!profile.current_holders || profile.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
|
|
@ -2929,10 +2992,10 @@ export class CommandController extends Controller {
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
positionType: profile.posType.posTypeName,
|
positionType: profile.posType.posTypeName,
|
||||||
positionLevel: profile.posLevel.posLevelName,
|
positionLevel: profile.posLevel.posLevelName,
|
||||||
posNo: shortName ? shortName : "-",
|
posNo: shortName ? shortName : null,
|
||||||
positionLine: position?.positionField ?? "-",
|
positionLine: position?.positionField ?? null,
|
||||||
positionPathSide: position?.positionArea ?? "-",
|
positionPathSide: position?.positionArea ?? null,
|
||||||
positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
positionExecutive: position?.posExecutive?.posExecutiveName ?? null,
|
||||||
amount: item.amount ? item.amount : null,
|
amount: item.amount ? item.amount : null,
|
||||||
positionSalaryAmount: item.positionSalaryAmount ? item.positionSalaryAmount : null,
|
positionSalaryAmount: item.positionSalaryAmount ? item.positionSalaryAmount : null,
|
||||||
mouthSalaryAmount: item.mouthSalaryAmount ? item.mouthSalaryAmount : null,
|
mouthSalaryAmount: item.mouthSalaryAmount ? item.mouthSalaryAmount : null,
|
||||||
|
|
@ -2942,6 +3005,11 @@ export class CommandController extends Controller {
|
||||||
? profile.profileSalary[0].order + 1
|
? profile.profileSalary[0].order + 1
|
||||||
: 1
|
: 1
|
||||||
: null,
|
: null,
|
||||||
|
orgRoot: orgRootRef?.orgRootName ?? null,
|
||||||
|
orgChild1: orgChild1Ref?.orgChild1Name ?? null,
|
||||||
|
orgChild2: orgChild2Ref?.orgChild2Name ?? null,
|
||||||
|
orgChild3: orgChild3Ref?.orgChild3Name ?? null,
|
||||||
|
orgChild4: orgChild4Ref?.orgChild4Name ?? null,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
|
|
@ -2949,7 +3017,10 @@ export class CommandController extends Controller {
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
dateGovernment: new Date(),
|
dateGovernment: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
isGovernment: item.isGovernment,
|
isGovernment: item.isGovernment,
|
||||||
|
refCommandCode: item.refCommandCode,
|
||||||
|
refCommandName: item.refCommandName,
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.assign(data, meta);
|
Object.assign(data, meta);
|
||||||
|
|
@ -3056,6 +3127,13 @@ export class CommandController extends Controller {
|
||||||
orgRevisionIsDraft: false,
|
orgRevisionIsDraft: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const orgRevisionRef =
|
||||||
|
profile?.current_holders?.find((x) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||||
|
const orgRootRef = orgRevisionRef?.orgRoot ?? null;
|
||||||
|
const orgChild1Ref = orgRevisionRef?.orgChild1 ?? null;
|
||||||
|
const orgChild2Ref = orgRevisionRef?.orgChild2 ?? null;
|
||||||
|
const orgChild3Ref = orgRevisionRef?.orgChild3 ?? null;
|
||||||
|
const orgChild4Ref = orgRevisionRef?.orgChild4 ?? null;
|
||||||
const shortName =
|
const shortName =
|
||||||
!profile.current_holders || profile.current_holders.length == 0
|
!profile.current_holders || profile.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
|
|
@ -3098,7 +3176,7 @@ export class CommandController extends Controller {
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
positionType: profile.posType.posTypeName,
|
positionType: profile.posType.posTypeName,
|
||||||
positionLevel: profile.posLevel.posLevelName,
|
positionLevel: profile.posLevel.posLevelName,
|
||||||
posNo: shortName ? shortName : "-",
|
posNo: shortName ? shortName : null,
|
||||||
// positionLine: position?.positionField ?? "-",
|
// positionLine: position?.positionField ?? "-",
|
||||||
// positionPathSide: position?.positionArea ?? "-",
|
// positionPathSide: position?.positionArea ?? "-",
|
||||||
// positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
// positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
||||||
|
|
@ -3111,6 +3189,11 @@ export class CommandController extends Controller {
|
||||||
? profile.profileSalary[0].order + 1
|
? profile.profileSalary[0].order + 1
|
||||||
: 1
|
: 1
|
||||||
: null,
|
: null,
|
||||||
|
orgRoot: orgRootRef?.orgRootName ?? null,
|
||||||
|
orgChild1: orgChild1Ref?.orgChild1Name ?? null,
|
||||||
|
orgChild2: orgChild2Ref?.orgChild2Name ?? null,
|
||||||
|
orgChild3: orgChild3Ref?.orgChild3Name ?? null,
|
||||||
|
orgChild4: orgChild4Ref?.orgChild4Name ?? null,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
|
|
@ -3118,7 +3201,10 @@ export class CommandController extends Controller {
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
dateGovernment: new Date(),
|
dateGovernment: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
isGovernment: item.isGovernment,
|
isGovernment: item.isGovernment,
|
||||||
|
refCommandCode: item.refCommandCode,
|
||||||
|
refCommandName: item.refCommandName,
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.assign(data, meta);
|
Object.assign(data, meta);
|
||||||
|
|
@ -3220,7 +3306,6 @@ export class CommandController extends Controller {
|
||||||
isLeave: boolean | null;
|
isLeave: boolean | null;
|
||||||
leaveReason?: string | null;
|
leaveReason?: string | null;
|
||||||
dateLeave?: Date | null;
|
dateLeave?: Date | null;
|
||||||
refCommandDate?: Date | null;
|
|
||||||
detail?: string | null;
|
detail?: string | null;
|
||||||
level?: string | null;
|
level?: string | null;
|
||||||
unStigma?: string | null;
|
unStigma?: string | null;
|
||||||
|
|
@ -3229,6 +3314,9 @@ export class CommandController extends Controller {
|
||||||
positionSalaryAmount?: Double | null;
|
positionSalaryAmount?: Double | null;
|
||||||
mouthSalaryAmount?: Double | null;
|
mouthSalaryAmount?: Double | null;
|
||||||
isGovernment?: boolean | null;
|
isGovernment?: boolean | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -3263,6 +3351,13 @@ export class CommandController extends Controller {
|
||||||
orgRevisionIsDraft: false,
|
orgRevisionIsDraft: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const orgRevisionRef =
|
||||||
|
profile?.current_holders?.find((x) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||||
|
const orgRootRef = orgRevisionRef?.orgRoot ?? null;
|
||||||
|
const orgChild1Ref = orgRevisionRef?.orgChild1 ?? null;
|
||||||
|
const orgChild2Ref = orgRevisionRef?.orgChild2 ?? null;
|
||||||
|
const orgChild3Ref = orgRevisionRef?.orgChild3 ?? null;
|
||||||
|
const orgChild4Ref = orgRevisionRef?.orgChild4 ?? null;
|
||||||
const shortName =
|
const shortName =
|
||||||
!profile.current_holders || profile.current_holders.length == 0
|
!profile.current_holders || profile.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
|
|
@ -3304,7 +3399,7 @@ export class CommandController extends Controller {
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
positionType: profile.posType.posTypeName,
|
positionType: profile.posType.posTypeName,
|
||||||
positionLevel: profile.posLevel.posLevelName,
|
positionLevel: profile.posLevel.posLevelName,
|
||||||
posNo: shortName ? shortName : "-",
|
posNo: shortName ? shortName : null,
|
||||||
// positionLine: position?.positionField ?? "-",
|
// positionLine: position?.positionField ?? "-",
|
||||||
// positionPathSide: position?.positionArea ?? "-",
|
// positionPathSide: position?.positionArea ?? "-",
|
||||||
// positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
// positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
||||||
|
|
@ -3317,6 +3412,11 @@ export class CommandController extends Controller {
|
||||||
? profile.profileSalary[0].order + 1
|
? profile.profileSalary[0].order + 1
|
||||||
: 1
|
: 1
|
||||||
: null,
|
: null,
|
||||||
|
orgRoot: orgRootRef?.orgRootName ?? null,
|
||||||
|
orgChild1: orgChild1Ref?.orgChild1Name ?? null,
|
||||||
|
orgChild2: orgChild2Ref?.orgChild2Name ?? null,
|
||||||
|
orgChild3: orgChild3Ref?.orgChild3Name ?? null,
|
||||||
|
orgChild4: orgChild4Ref?.orgChild4Name ?? null,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
|
|
@ -3324,7 +3424,10 @@ export class CommandController extends Controller {
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
dateGovernment: new Date(),
|
dateGovernment: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
isGovernment: item.isGovernment,
|
isGovernment: item.isGovernment,
|
||||||
|
refCommandCode: item.refCommandCode,
|
||||||
|
refCommandName: item.refCommandName,
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.assign(data, meta);
|
Object.assign(data, meta);
|
||||||
|
|
@ -3426,6 +3529,9 @@ export class CommandController extends Controller {
|
||||||
amount?: Double | null;
|
amount?: Double | null;
|
||||||
positionSalaryAmount?: Double | null;
|
positionSalaryAmount?: Double | null;
|
||||||
mouthSalaryAmount?: Double | null;
|
mouthSalaryAmount?: Double | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -3461,6 +3567,13 @@ export class CommandController extends Controller {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const orgRevisionRef =
|
||||||
|
profile?.current_holders?.find((x) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||||
|
const orgRootRef = orgRevisionRef?.orgRoot ?? null;
|
||||||
|
const orgChild1Ref = orgRevisionRef?.orgChild1 ?? null;
|
||||||
|
const orgChild2Ref = orgRevisionRef?.orgChild2 ?? null;
|
||||||
|
const orgChild3Ref = orgRevisionRef?.orgChild3 ?? null;
|
||||||
|
const orgChild4Ref = orgRevisionRef?.orgChild4 ?? null;
|
||||||
const shortName =
|
const shortName =
|
||||||
!profile.current_holders || profile.current_holders.length == 0
|
!profile.current_holders || profile.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
|
|
@ -3502,10 +3615,10 @@ export class CommandController extends Controller {
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
positionType: profile.posType.posTypeName,
|
positionType: profile.posType.posTypeName,
|
||||||
positionLevel: profile.posLevel.posLevelName,
|
positionLevel: profile.posLevel.posLevelName,
|
||||||
posNo: shortName ? shortName : "-",
|
posNo: shortName ? shortName : null,
|
||||||
positionLine: position?.positionField ?? "-",
|
positionLine: position?.positionField ?? null,
|
||||||
positionPathSide: position?.positionArea ?? "-",
|
positionPathSide: position?.positionArea ?? null,
|
||||||
positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
positionExecutive: position?.posExecutive?.posExecutiveName ?? null,
|
||||||
amount: item.amount ? item.amount : null,
|
amount: item.amount ? item.amount : null,
|
||||||
positionSalaryAmount: item.positionSalaryAmount ? item.positionSalaryAmount : null,
|
positionSalaryAmount: item.positionSalaryAmount ? item.positionSalaryAmount : null,
|
||||||
mouthSalaryAmount: item.mouthSalaryAmount ? item.mouthSalaryAmount : null,
|
mouthSalaryAmount: item.mouthSalaryAmount ? item.mouthSalaryAmount : null,
|
||||||
|
|
@ -3515,12 +3628,20 @@ export class CommandController extends Controller {
|
||||||
? profile.profileSalary[0].order + 1
|
? profile.profileSalary[0].order + 1
|
||||||
: 1
|
: 1
|
||||||
: null,
|
: null,
|
||||||
|
orgRoot: orgRootRef?.orgRootName ?? null,
|
||||||
|
orgChild1: orgChild1Ref?.orgChild1Name ?? null,
|
||||||
|
orgChild2: orgChild2Ref?.orgChild2Name ?? null,
|
||||||
|
orgChild3: orgChild3Ref?.orgChild3Name ?? null,
|
||||||
|
orgChild4: orgChild4Ref?.orgChild4Name ?? null,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
|
refCommandCode: item.refCommandCode,
|
||||||
|
refCommandName: item.refCommandName,
|
||||||
};
|
};
|
||||||
Object.assign(data, meta);
|
Object.assign(data, meta);
|
||||||
const history = new ProfileSalaryHistory();
|
const history = new ProfileSalaryHistory();
|
||||||
|
|
@ -3563,6 +3684,9 @@ export class CommandController extends Controller {
|
||||||
positionSalaryAmount?: Double | null;
|
positionSalaryAmount?: Double | null;
|
||||||
mouthSalaryAmount?: Double | null;
|
mouthSalaryAmount?: Double | null;
|
||||||
isGovernment?: boolean | null;
|
isGovernment?: boolean | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -3614,6 +3738,13 @@ export class CommandController extends Controller {
|
||||||
orgRevisionIsDraft: false,
|
orgRevisionIsDraft: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const orgRevisionRef =
|
||||||
|
profile?.current_holders?.find((x) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||||
|
const orgRootRef = orgRevisionRef?.orgRoot ?? null;
|
||||||
|
const orgChild1Ref = orgRevisionRef?.orgChild1 ?? null;
|
||||||
|
const orgChild2Ref = orgRevisionRef?.orgChild2 ?? null;
|
||||||
|
const orgChild3Ref = orgRevisionRef?.orgChild3 ?? null;
|
||||||
|
const orgChild4Ref = orgRevisionRef?.orgChild4 ?? null;
|
||||||
const shortName =
|
const shortName =
|
||||||
!profile.current_holders || profile.current_holders.length == 0
|
!profile.current_holders || profile.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
|
|
@ -3654,9 +3785,9 @@ export class CommandController extends Controller {
|
||||||
positionType: profile.posType.posTypeName,
|
positionType: profile.posType.posTypeName,
|
||||||
positionLevel: profile.posLevel.posLevelName,
|
positionLevel: profile.posLevel.posLevelName,
|
||||||
posNo: shortName,
|
posNo: shortName,
|
||||||
positionLine: position?.positionField ?? "-",
|
positionLine: position?.positionField ?? null,
|
||||||
positionPathSide: position?.positionArea ?? "-",
|
positionPathSide: position?.positionArea ?? null,
|
||||||
positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
positionExecutive: position?.posExecutive?.posExecutiveName ?? null,
|
||||||
amount: item.amount ? item.amount : null,
|
amount: item.amount ? item.amount : null,
|
||||||
positionSalaryAmount: item.positionSalaryAmount ? item.positionSalaryAmount : null,
|
positionSalaryAmount: item.positionSalaryAmount ? item.positionSalaryAmount : null,
|
||||||
mouthSalaryAmount: item.mouthSalaryAmount ? item.mouthSalaryAmount : null,
|
mouthSalaryAmount: item.mouthSalaryAmount ? item.mouthSalaryAmount : null,
|
||||||
|
|
@ -3666,6 +3797,11 @@ export class CommandController extends Controller {
|
||||||
? profile.profileSalary[0].order + 1
|
? profile.profileSalary[0].order + 1
|
||||||
: 1
|
: 1
|
||||||
: null,
|
: null,
|
||||||
|
orgRoot: orgRootRef?.orgRootName ?? null,
|
||||||
|
orgChild1: orgChild1Ref?.orgChild1Name ?? null,
|
||||||
|
orgChild2: orgChild2Ref?.orgChild2Name ?? null,
|
||||||
|
orgChild3: orgChild3Ref?.orgChild3Name ?? null,
|
||||||
|
orgChild4: orgChild4Ref?.orgChild4Name ?? null,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
|
|
@ -3673,7 +3809,10 @@ export class CommandController extends Controller {
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
dateGovernment: new Date(),
|
dateGovernment: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
isGovernment: item.isGovernment,
|
isGovernment: item.isGovernment,
|
||||||
|
refCommandCode: item.refCommandCode,
|
||||||
|
refCommandName: item.refCommandName,
|
||||||
});
|
});
|
||||||
await removeProfileInOrganize(profile.id, "OFFICER");
|
await removeProfileInOrganize(profile.id, "OFFICER");
|
||||||
const clearProfile = await checkCommandType(String(item.commandId));
|
const clearProfile = await checkCommandType(String(item.commandId));
|
||||||
|
|
@ -3736,6 +3875,7 @@ export class CommandController extends Controller {
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
};
|
};
|
||||||
const _null: any = null;
|
const _null: any = null;
|
||||||
if (item.bodyProfile.posLevelId === "") item.bodyProfile.posLevelId = null;
|
if (item.bodyProfile.posLevelId === "") item.bodyProfile.posLevelId = null;
|
||||||
|
|
@ -4031,9 +4171,12 @@ export class CommandController extends Controller {
|
||||||
commandYear: number;
|
commandYear: number;
|
||||||
templateDoc: 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;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -4072,12 +4215,20 @@ export class CommandController extends Controller {
|
||||||
refCommandNo: `${item.commandNo}/${Extension.ToThaiYear(item.commandYear)}`,
|
refCommandNo: `${item.commandNo}/${Extension.ToThaiYear(item.commandYear)}`,
|
||||||
templateDoc: item.templateDoc,
|
templateDoc: item.templateDoc,
|
||||||
order: dest_item == null ? 1 : dest_item.order + 1,
|
order: dest_item == null ? 1 : dest_item.order + 1,
|
||||||
|
// orgRoot: orgRootRef?.orgRootName??null,
|
||||||
|
// orgChild1: orgChild1Ref?.orgChild1Name??null,
|
||||||
|
// orgChild2: orgChild2Ref?.orgChild2Name??null,
|
||||||
|
// orgChild3: orgChild3Ref?.orgChild3Name??null,
|
||||||
|
// orgChild4: orgChild4Ref?.orgChild4Name??null,
|
||||||
|
refCommandCode: item.refCommandCode,
|
||||||
|
refCommandName: item.refCommandName,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.assign(data, meta);
|
Object.assign(data, meta);
|
||||||
|
|
@ -4226,6 +4377,9 @@ export class CommandController extends Controller {
|
||||||
amountSpecial?: Double | null;
|
amountSpecial?: Double | null;
|
||||||
positionSalaryAmount: Double | null;
|
positionSalaryAmount: Double | null;
|
||||||
mouthSalaryAmount: Double | null;
|
mouthSalaryAmount: Double | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -4376,6 +4530,9 @@ export class CommandController extends Controller {
|
||||||
amountSpecial?: Double | null;
|
amountSpecial?: Double | null;
|
||||||
positionSalaryAmount: Double | null;
|
positionSalaryAmount: Double | null;
|
||||||
mouthSalaryAmount: Double | null;
|
mouthSalaryAmount: Double | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -4398,6 +4555,11 @@ export class CommandController extends Controller {
|
||||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบตำแหน่งดังกล่าว");
|
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบตำแหน่งดังกล่าว");
|
||||||
}
|
}
|
||||||
if (posMaster.next_holderId != null) {
|
if (posMaster.next_holderId != null) {
|
||||||
|
const orgRootRef = posMaster?.orgRoot ?? null;
|
||||||
|
const orgChild1Ref = posMaster?.orgChild1 ?? null;
|
||||||
|
const orgChild2Ref = posMaster?.orgChild2 ?? null;
|
||||||
|
const orgChild3Ref = posMaster?.orgChild3 ?? null;
|
||||||
|
const orgChild4Ref = posMaster?.orgChild4 ?? null;
|
||||||
const shortName =
|
const shortName =
|
||||||
posMaster != null && posMaster.orgChild4 != null
|
posMaster != null && posMaster.orgChild4 != null
|
||||||
? `${posMaster.orgChild4.orgChild4ShortName}${posMaster.posMasterNo}`
|
? `${posMaster.orgChild4.orgChild4ShortName}${posMaster.posMasterNo}`
|
||||||
|
|
@ -4441,12 +4603,20 @@ export class CommandController extends Controller {
|
||||||
refCommandNo: `${item.commandNo}/${Extension.ToThaiYear(item.commandYear)}`,
|
refCommandNo: `${item.commandNo}/${Extension.ToThaiYear(item.commandYear)}`,
|
||||||
templateDoc: item.templateDoc,
|
templateDoc: item.templateDoc,
|
||||||
order: dest_item == null ? 1 : dest_item.order + 1,
|
order: dest_item == null ? 1 : dest_item.order + 1,
|
||||||
|
orgRoot: orgRootRef?.orgRootName ?? null,
|
||||||
|
orgChild1: orgChild1Ref?.orgChild1Name ?? null,
|
||||||
|
orgChild2: orgChild2Ref?.orgChild2Name ?? null,
|
||||||
|
orgChild3: orgChild3Ref?.orgChild3Name ?? null,
|
||||||
|
orgChild4: orgChild4Ref?.orgChild4Name ?? null,
|
||||||
|
refCommandCode: item.refCommandCode,
|
||||||
|
refCommandName: item.refCommandName,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
};
|
};
|
||||||
Object.assign(data, meta);
|
Object.assign(data, meta);
|
||||||
const history = new ProfileSalaryHistory();
|
const history = new ProfileSalaryHistory();
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ export class ImportDataController extends Controller {
|
||||||
private profileFamilyCoupleRepository = AppDataSource.getRepository(ProfileFamilyCouple);
|
private profileFamilyCoupleRepository = AppDataSource.getRepository(ProfileFamilyCouple);
|
||||||
private profileFamilyMotherRepository = AppDataSource.getRepository(ProfileFamilyMother);
|
private profileFamilyMotherRepository = AppDataSource.getRepository(ProfileFamilyMother);
|
||||||
private profileFamilyFatherRepository = AppDataSource.getRepository(ProfileFamilyFather);
|
private profileFamilyFatherRepository = AppDataSource.getRepository(ProfileFamilyFather);
|
||||||
private salaryRepository = AppDataSource.getRepository(ProfileSalary);
|
private salaryRepo = AppDataSource.getRepository(ProfileSalary);
|
||||||
private profileRepo = AppDataSource.getRepository(Profile);
|
private profileRepo = AppDataSource.getRepository(Profile);
|
||||||
private profileEmpRepo = AppDataSource.getRepository(ProfileEmployee);
|
private profileEmpRepo = AppDataSource.getRepository(ProfileEmployee);
|
||||||
private posLevelRepo = AppDataSource.getRepository(PosLevel);
|
private posLevelRepo = AppDataSource.getRepository(PosLevel);
|
||||||
|
|
@ -323,14 +323,36 @@ export class ImportDataController extends Controller {
|
||||||
const SALARY: any =
|
const SALARY: any =
|
||||||
item.SALARY == null || item.SALARY == "" ? null_ : Number(item.SALARY);
|
item.SALARY == null || item.SALARY == "" ? null_ : Number(item.SALARY);
|
||||||
profileSalary.amount = SALARY;
|
profileSalary.amount = SALARY;
|
||||||
|
const SAL_POS_AMOUNT_1: any =
|
||||||
|
item.SAL_POS_AMOUNT_1 == null || item.SAL_POS_AMOUNT_1 == ""
|
||||||
|
? null_
|
||||||
|
: Number(item.SAL_POS_AMOUNT_1);
|
||||||
|
const SAL_POS_AMOUNT_2: any =
|
||||||
|
item.SAL_POS_AMOUNT_2 == null || item.SAL_POS_AMOUNT_2 == ""
|
||||||
|
? null_
|
||||||
|
: Number(item.SAL_POS_AMOUNT_2);
|
||||||
|
profileSalary.positionSalaryAmount = SAL_POS_AMOUNT_1 ?? SAL_POS_AMOUNT_2;
|
||||||
|
const SPECIAL_AMT: any =
|
||||||
|
item.SPECIAL_AMT == null || item.SPECIAL_AMT == "" ? null_ : Number(item.SPECIAL_AMT);
|
||||||
|
profileSalary.amountSpecial = SPECIAL_AMT;
|
||||||
profileSalary.profileId = _item.id;
|
profileSalary.profileId = _item.id;
|
||||||
profileSalary.refCommandNo = item.MP_COMMAND_NUM;
|
profileSalary.refCommandNo = item.MP_COMMAND_NUM;
|
||||||
profileSalary.posNo = item.POS_NUM_NAME + item.POS_NUM_CODE;
|
profileSalary.posNo = item.POS_NUM_NAME + item.POS_NUM_CODE;
|
||||||
profileSalary.position = item.FLAG_TO_NAME;
|
profileSalary.position = item.WORK_LINE_NAME;
|
||||||
profileSalary.positionLine = item.WORK_LINE_NAME;
|
|
||||||
profileSalary.positionPathSide = item.SPECIALIST_NAME;
|
profileSalary.positionPathSide = item.SPECIALIST_NAME;
|
||||||
profileSalary.positionExecutive = item.ADMIN_NAME;
|
profileSalary.positionExecutive = item.ADMIN_NAME;
|
||||||
profileSalary.templateDoc = item.REMARK;
|
profileSalary.templateDoc = item.REMARK;
|
||||||
|
profileSalary.refCommandDate =
|
||||||
|
item.MP_COMMAND_DATE == ""
|
||||||
|
? null_
|
||||||
|
: new Date(item.MP_COMMAND_DATE.replace(" +0700 +07:00", ""));
|
||||||
|
profileSalary.refCommandCode = item.FLAG_TO_NAME_CODE;
|
||||||
|
profileSalary.refCommandName = item.FLAG_TO_NAME;
|
||||||
|
profileSalary.orgRoot = item.DEPARTMENT_NAME;
|
||||||
|
profileSalary.orgChild1 = item.DIVISION_NAME;
|
||||||
|
profileSalary.orgChild2 = item.SECTION_NAME;
|
||||||
|
profileSalary.orgChild3 = item.JOB_NAME;
|
||||||
|
profileSalary.mpCee = item.MP_CEE;
|
||||||
const ORDER_MOVE_POSITION: any =
|
const ORDER_MOVE_POSITION: any =
|
||||||
item.ORDER_MOVE_POSITION == null || item.ORDER_MOVE_POSITION == ""
|
item.ORDER_MOVE_POSITION == null || item.ORDER_MOVE_POSITION == ""
|
||||||
? null_
|
? null_
|
||||||
|
|
@ -340,10 +362,16 @@ export class ImportDataController extends Controller {
|
||||||
profileSalary.createdFullName = request.user.name;
|
profileSalary.createdFullName = request.user.name;
|
||||||
profileSalary.lastUpdateUserId = request.user.sub;
|
profileSalary.lastUpdateUserId = request.user.sub;
|
||||||
profileSalary.lastUpdateFullName = request.user.name;
|
profileSalary.lastUpdateFullName = request.user.name;
|
||||||
profileSalary.createdAt = new Date();
|
profileSalary.createdAt =
|
||||||
profileSalary.lastUpdatedAt = new Date();
|
item.USER_CREATE == ""
|
||||||
|
? null_
|
||||||
|
: new Date(item.USER_CREATE.replace(" +0700 +07:00", ""));
|
||||||
|
profileSalary.lastUpdatedAt =
|
||||||
|
item.USER_UPDATE == ""
|
||||||
|
? null_
|
||||||
|
: new Date(item.USER_UPDATE.replace(" +0700 +07:00", ""));
|
||||||
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
|
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
|
||||||
await this.salaryRepository.save(profileSalary);
|
await this.salaryRepo.save(profileSalary);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
|
@ -407,14 +435,36 @@ export class ImportDataController extends Controller {
|
||||||
const SALARY: any =
|
const SALARY: any =
|
||||||
item.SALARY == null || item.SALARY == "" ? null_ : Number(item.SALARY);
|
item.SALARY == null || item.SALARY == "" ? null_ : Number(item.SALARY);
|
||||||
profileSalary.amount = SALARY;
|
profileSalary.amount = SALARY;
|
||||||
|
const SAL_POS_AMOUNT_1: any =
|
||||||
|
item.SAL_POS_AMOUNT_1 == null || item.SAL_POS_AMOUNT_1 == ""
|
||||||
|
? null_
|
||||||
|
: Number(item.SAL_POS_AMOUNT_1);
|
||||||
|
const SAL_POS_AMOUNT_2: any =
|
||||||
|
item.SAL_POS_AMOUNT_2 == null || item.SAL_POS_AMOUNT_2 == ""
|
||||||
|
? null_
|
||||||
|
: Number(item.SAL_POS_AMOUNT_2);
|
||||||
|
profileSalary.positionSalaryAmount = SAL_POS_AMOUNT_1 ?? SAL_POS_AMOUNT_2;
|
||||||
|
const SPECIAL_AMT: any =
|
||||||
|
item.SPECIAL_AMT == null || item.SPECIAL_AMT == "" ? null_ : Number(item.SPECIAL_AMT);
|
||||||
|
profileSalary.amountSpecial = SPECIAL_AMT;
|
||||||
profileSalary.profileEmployeeId = _item.id;
|
profileSalary.profileEmployeeId = _item.id;
|
||||||
profileSalary.refCommandNo = item.MP_COMMAND_NUM;
|
profileSalary.refCommandNo = item.MP_COMMAND_NUM;
|
||||||
profileSalary.posNo = item.POS_NUM_NAME + item.POS_NUM_CODE;
|
profileSalary.posNo = item.POS_NUM_NAME + item.POS_NUM_CODE;
|
||||||
// profileSalary.position = item.FLAG_TO_NAME;
|
|
||||||
profileSalary.position = item.WORK_LINE_NAME;
|
profileSalary.position = item.WORK_LINE_NAME;
|
||||||
profileSalary.positionPathSide = item.SPECIALIST_NAME;
|
profileSalary.positionPathSide = item.SPECIALIST_NAME;
|
||||||
profileSalary.positionExecutive = item.ADMIN_NAME;
|
profileSalary.positionExecutive = item.ADMIN_NAME;
|
||||||
profileSalary.templateDoc = item.REMARK;
|
profileSalary.templateDoc = item.REMARK;
|
||||||
|
profileSalary.refCommandDate =
|
||||||
|
item.MP_COMMAND_DATE == ""
|
||||||
|
? null_
|
||||||
|
: new Date(item.MP_COMMAND_DATE.replace(" +0700 +07:00", ""));
|
||||||
|
profileSalary.refCommandCode = item.FLAG_TO_NAME_CODE;
|
||||||
|
profileSalary.refCommandName = item.FLAG_TO_NAME;
|
||||||
|
profileSalary.orgRoot = item.DEPARTMENT_NAME;
|
||||||
|
profileSalary.orgChild1 = item.DIVISION_NAME;
|
||||||
|
profileSalary.orgChild2 = item.SECTION_NAME;
|
||||||
|
profileSalary.orgChild3 = item.JOB_NAME;
|
||||||
|
profileSalary.mpCee = item.MP_CEE;
|
||||||
const ORDER_MOVE_POSITION: any =
|
const ORDER_MOVE_POSITION: any =
|
||||||
item.ORDER_MOVE_POSITION == null || item.ORDER_MOVE_POSITION == ""
|
item.ORDER_MOVE_POSITION == null || item.ORDER_MOVE_POSITION == ""
|
||||||
? null_
|
? null_
|
||||||
|
|
@ -424,10 +474,16 @@ export class ImportDataController extends Controller {
|
||||||
profileSalary.createdFullName = request.user.name;
|
profileSalary.createdFullName = request.user.name;
|
||||||
profileSalary.lastUpdateUserId = request.user.sub;
|
profileSalary.lastUpdateUserId = request.user.sub;
|
||||||
profileSalary.lastUpdateFullName = request.user.name;
|
profileSalary.lastUpdateFullName = request.user.name;
|
||||||
profileSalary.createdAt = new Date();
|
profileSalary.createdAt =
|
||||||
profileSalary.lastUpdatedAt = new Date();
|
item.USER_CREATE == ""
|
||||||
|
? null_
|
||||||
|
: new Date(item.USER_CREATE.replace(" +0700 +07:00", ""));
|
||||||
|
profileSalary.lastUpdatedAt =
|
||||||
|
item.USER_UPDATE == ""
|
||||||
|
? null_
|
||||||
|
: new Date(item.USER_UPDATE.replace(" +0700 +07:00", ""));
|
||||||
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
|
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
|
||||||
await this.salaryRepository.save(profileSalary);
|
await this.salaryRepo.save(profileSalary);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ export class ProfileController extends Controller {
|
||||||
private profileFamilyFatherHistoryRepo = AppDataSource.getRepository(ProfileFamilyFatherHistory);
|
private profileFamilyFatherHistoryRepo = AppDataSource.getRepository(ProfileFamilyFatherHistory);
|
||||||
private trainingRepository = AppDataSource.getRepository(ProfileTraining);
|
private trainingRepository = AppDataSource.getRepository(ProfileTraining);
|
||||||
private disciplineRepository = AppDataSource.getRepository(ProfileDiscipline);
|
private disciplineRepository = AppDataSource.getRepository(ProfileDiscipline);
|
||||||
private salaryRepository = AppDataSource.getRepository(ProfileSalary);
|
private salaryRepo = AppDataSource.getRepository(ProfileSalary);
|
||||||
private profileEducationRepo = AppDataSource.getRepository(ProfileEducation);
|
private profileEducationRepo = AppDataSource.getRepository(ProfileEducation);
|
||||||
private provinceRepo = AppDataSource.getRepository(Province);
|
private provinceRepo = AppDataSource.getRepository(Province);
|
||||||
private districtRepo = AppDataSource.getRepository(District);
|
private districtRepo = AppDataSource.getRepository(District);
|
||||||
|
|
@ -221,7 +221,7 @@ export class ProfileController extends Controller {
|
||||||
let _child3 = child3 == null || child3 == undefined ? "" : `${child3.orgChild3Name}/`;
|
let _child3 = child3 == null || child3 == undefined ? "" : `${child3.orgChild3Name}/`;
|
||||||
let _child4 = child4 == null || child4 == undefined ? "" : `${child4.orgChild4Name}/`;
|
let _child4 = child4 == null || child4 == undefined ? "" : `${child4.orgChild4Name}/`;
|
||||||
|
|
||||||
const salary_raw = await this.salaryRepository.find({
|
const salary_raw = await this.salaryRepo.find({
|
||||||
select: [
|
select: [
|
||||||
"date",
|
"date",
|
||||||
"position",
|
"position",
|
||||||
|
|
@ -580,7 +580,7 @@ export class ProfileController extends Controller {
|
||||||
field: "-",
|
field: "-",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const salary_raw = await this.salaryRepository.find({
|
const salary_raw = await this.salaryRepo.find({
|
||||||
select: [
|
select: [
|
||||||
"date",
|
"date",
|
||||||
"position",
|
"position",
|
||||||
|
|
@ -1403,12 +1403,12 @@ export class ProfileController extends Controller {
|
||||||
let condition: any = {
|
let condition: any = {
|
||||||
orgRootId: posMaster.orgRootId || "",
|
orgRootId: posMaster.orgRootId || "",
|
||||||
};
|
};
|
||||||
// if (body.isDirector == true) {
|
if (body.isDirector == true) {
|
||||||
condition = {
|
condition = {
|
||||||
orgRootId: posMaster.orgRootId || "",
|
orgRootId: posMaster.orgRootId || "",
|
||||||
isDirector: true,
|
isDirector: true,
|
||||||
};
|
};
|
||||||
// }
|
}
|
||||||
const [lists, total] = await AppDataSource.getRepository(viewDirectorActing)
|
const [lists, total] = await AppDataSource.getRepository(viewDirectorActing)
|
||||||
.createQueryBuilder("viewDirectorActing")
|
.createQueryBuilder("viewDirectorActing")
|
||||||
.andWhere(condition)
|
.andWhere(condition)
|
||||||
|
|
@ -2034,6 +2034,8 @@ export class ProfileController extends Controller {
|
||||||
date: Date | null;
|
date: Date | null;
|
||||||
refCommandNo: string | null;
|
refCommandNo: string | null;
|
||||||
salaryRef: string | null;
|
salaryRef: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
|
|
@ -2056,6 +2058,13 @@ export class ProfileController extends Controller {
|
||||||
orgRevisionIsDraft: false,
|
orgRevisionIsDraft: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const orgRevisionRef =
|
||||||
|
profile?.current_holders?.find((x) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||||
|
const orgRootRef = orgRevisionRef?.orgRoot ?? null;
|
||||||
|
const orgChild1Ref = orgRevisionRef?.orgChild1 ?? null;
|
||||||
|
const orgChild2Ref = orgRevisionRef?.orgChild2 ?? null;
|
||||||
|
const orgChild3Ref = orgRevisionRef?.orgChild3 ?? null;
|
||||||
|
const orgChild4Ref = orgRevisionRef?.orgChild4 ?? null;
|
||||||
const shortName =
|
const shortName =
|
||||||
!profile.current_holders || profile.current_holders.length == 0
|
!profile.current_holders || profile.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
|
|
@ -2098,10 +2107,10 @@ export class ProfileController extends Controller {
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
positionType: profile.posType.posTypeName,
|
positionType: profile.posType.posTypeName,
|
||||||
positionLevel: profile.posLevel.posLevelName,
|
positionLevel: profile.posLevel.posLevelName,
|
||||||
posNo: shortName ? shortName : "-",
|
posNo: shortName ? shortName : null,
|
||||||
positionLine: position?.positionField ?? "-",
|
positionLine: position?.positionField ?? null,
|
||||||
positionPathSide: position?.positionArea ?? "-",
|
positionPathSide: position?.positionArea ?? null,
|
||||||
positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
positionExecutive: position?.posExecutive?.posExecutiveName ?? null,
|
||||||
amount: profile.amount,
|
amount: profile.amount,
|
||||||
positionSalaryAmount: profile.positionSalaryAmount,
|
positionSalaryAmount: profile.positionSalaryAmount,
|
||||||
mouthSalaryAmount: profile.mouthSalaryAmount,
|
mouthSalaryAmount: profile.mouthSalaryAmount,
|
||||||
|
|
@ -2111,14 +2120,22 @@ export class ProfileController extends Controller {
|
||||||
? profile.profileSalary[0].order + 1
|
? profile.profileSalary[0].order + 1
|
||||||
: 1
|
: 1
|
||||||
: null,
|
: null,
|
||||||
|
orgRoot: orgRootRef?.orgRootName ?? null,
|
||||||
|
orgChild1: orgChild1Ref?.orgChild1Name ?? null,
|
||||||
|
orgChild2: orgChild2Ref?.orgChild2Name ?? null,
|
||||||
|
orgChild3: orgChild3Ref?.orgChild3Name ?? null,
|
||||||
|
orgChild4: orgChild4Ref?.orgChild4Name ?? null,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
|
refCommandCode: body.refCommandCode,
|
||||||
|
refCommandName: body.refCommandName,
|
||||||
});
|
});
|
||||||
await Promise.all([this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.salaryRepo.save(profileSalary)]);
|
||||||
}
|
}
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -2138,6 +2155,8 @@ export class ProfileController extends Controller {
|
||||||
date: Date | null;
|
date: Date | null;
|
||||||
refCommandNo: string | null;
|
refCommandNo: string | null;
|
||||||
salaryRef: string | null;
|
salaryRef: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
|
|
@ -2173,6 +2192,13 @@ export class ProfileController extends Controller {
|
||||||
orgRevisionIsDraft: false,
|
orgRevisionIsDraft: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const orgRevisionRef =
|
||||||
|
profile?.current_holders?.find((x) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||||
|
const orgRootRef = orgRevisionRef?.orgRoot ?? null;
|
||||||
|
const orgChild1Ref = orgRevisionRef?.orgChild1 ?? null;
|
||||||
|
const orgChild2Ref = orgRevisionRef?.orgChild2 ?? null;
|
||||||
|
const orgChild3Ref = orgRevisionRef?.orgChild3 ?? null;
|
||||||
|
const orgChild4Ref = orgRevisionRef?.orgChild4 ?? null;
|
||||||
const shortName =
|
const shortName =
|
||||||
!profile.current_holders || profile.current_holders.length == 0
|
!profile.current_holders || profile.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
|
|
@ -2209,10 +2235,10 @@ export class ProfileController extends Controller {
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
positionType: profile.posType.posTypeName,
|
positionType: profile.posType.posTypeName,
|
||||||
positionLevel: profile.posLevel.posLevelName,
|
positionLevel: profile.posLevel.posLevelName,
|
||||||
posNo: shortName ? shortName : "-",
|
posNo: shortName ? shortName : null,
|
||||||
positionLine: position?.positionField ?? "-",
|
positionLine: position?.positionField ?? null,
|
||||||
positionPathSide: position?.positionArea ?? "-",
|
positionPathSide: position?.positionArea ?? null,
|
||||||
positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
positionExecutive: position?.posExecutive?.posExecutiveName ?? null,
|
||||||
amount: profile.amount,
|
amount: profile.amount,
|
||||||
positionSalaryAmount: profile.positionSalaryAmount,
|
positionSalaryAmount: profile.positionSalaryAmount,
|
||||||
mouthSalaryAmount: profile.mouthSalaryAmount,
|
mouthSalaryAmount: profile.mouthSalaryAmount,
|
||||||
|
|
@ -2222,15 +2248,23 @@ export class ProfileController extends Controller {
|
||||||
? profile.profileSalary[0].order + 1
|
? profile.profileSalary[0].order + 1
|
||||||
: 1
|
: 1
|
||||||
: null,
|
: null,
|
||||||
|
orgRoot: orgRootRef?.orgRootName ?? null,
|
||||||
|
orgChild1: orgChild1Ref?.orgChild1Name ?? null,
|
||||||
|
orgChild2: orgChild2Ref?.orgChild2Name ?? null,
|
||||||
|
orgChild3: orgChild3Ref?.orgChild3Name ?? null,
|
||||||
|
orgChild4: orgChild4Ref?.orgChild4Name ?? null,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
|
refCommandCode: body.refCommandCode,
|
||||||
|
refCommandName: body.refCommandName,
|
||||||
});
|
});
|
||||||
await removeProfileInOrganize(profile.id, "OFFICER");
|
await removeProfileInOrganize(profile.id, "OFFICER");
|
||||||
await Promise.all([this.profileRepo.save(_profile), this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.profileRepo.save(_profile), this.salaryRepo.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -2250,6 +2284,8 @@ export class ProfileController extends Controller {
|
||||||
date: Date | null;
|
date: Date | null;
|
||||||
refCommandNo: string | null;
|
refCommandNo: string | null;
|
||||||
salaryRef: string | null;
|
salaryRef: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
|
|
@ -2284,6 +2320,13 @@ export class ProfileController extends Controller {
|
||||||
orgRevisionIsDraft: false,
|
orgRevisionIsDraft: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const orgRevisionRef =
|
||||||
|
profile?.current_holders?.find((x) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||||
|
const orgRootRef = orgRevisionRef?.orgRoot ?? null;
|
||||||
|
const orgChild1Ref = orgRevisionRef?.orgChild1 ?? null;
|
||||||
|
const orgChild2Ref = orgRevisionRef?.orgChild2 ?? null;
|
||||||
|
const orgChild3Ref = orgRevisionRef?.orgChild3 ?? null;
|
||||||
|
const orgChild4Ref = orgRevisionRef?.orgChild4 ?? null;
|
||||||
const shortName =
|
const shortName =
|
||||||
!profile.current_holders || profile.current_holders.length == 0
|
!profile.current_holders || profile.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
|
|
@ -2320,10 +2363,10 @@ export class ProfileController extends Controller {
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
positionType: profile.posType.posTypeName,
|
positionType: profile.posType.posTypeName,
|
||||||
positionLevel: profile.posLevel.posLevelName,
|
positionLevel: profile.posLevel.posLevelName,
|
||||||
posNo: shortName ? shortName : "-",
|
posNo: shortName ? shortName : null,
|
||||||
positionLine: position?.positionField ?? "-",
|
positionLine: position?.positionField ?? null,
|
||||||
positionPathSide: position?.positionArea ?? "-",
|
positionPathSide: position?.positionArea ?? null,
|
||||||
positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
positionExecutive: position?.posExecutive?.posExecutiveName ?? null,
|
||||||
amount: profile.amount,
|
amount: profile.amount,
|
||||||
positionSalaryAmount: profile.positionSalaryAmount,
|
positionSalaryAmount: profile.positionSalaryAmount,
|
||||||
mouthSalaryAmount: profile.mouthSalaryAmount,
|
mouthSalaryAmount: profile.mouthSalaryAmount,
|
||||||
|
|
@ -2333,15 +2376,23 @@ export class ProfileController extends Controller {
|
||||||
? profile.profileSalary[0].order + 1
|
? profile.profileSalary[0].order + 1
|
||||||
: 1
|
: 1
|
||||||
: null,
|
: null,
|
||||||
|
orgRoot: orgRootRef?.orgRootName ?? null,
|
||||||
|
orgChild1: orgChild1Ref?.orgChild1Name ?? null,
|
||||||
|
orgChild2: orgChild2Ref?.orgChild2Name ?? null,
|
||||||
|
orgChild3: orgChild3Ref?.orgChild3Name ?? null,
|
||||||
|
orgChild4: orgChild4Ref?.orgChild4Name ?? null,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
|
refCommandCode: body.refCommandCode,
|
||||||
|
refCommandName: body.refCommandName,
|
||||||
});
|
});
|
||||||
await removeProfileInOrganize(profile.id, "OFFICER");
|
await removeProfileInOrganize(profile.id, "OFFICER");
|
||||||
await Promise.all([this.profileRepo.save(_profile), this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.profileRepo.save(_profile), this.salaryRepo.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -2361,6 +2412,8 @@ export class ProfileController extends Controller {
|
||||||
date: Date | null;
|
date: Date | null;
|
||||||
refCommandNo: string | null;
|
refCommandNo: string | null;
|
||||||
salaryRef: string | null;
|
salaryRef: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
|
|
@ -2395,6 +2448,13 @@ export class ProfileController extends Controller {
|
||||||
orgRevisionIsDraft: false,
|
orgRevisionIsDraft: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const orgRevisionRef =
|
||||||
|
profile?.current_holders?.find((x) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||||
|
const orgRootRef = orgRevisionRef?.orgRoot ?? null;
|
||||||
|
const orgChild1Ref = orgRevisionRef?.orgChild1 ?? null;
|
||||||
|
const orgChild2Ref = orgRevisionRef?.orgChild2 ?? null;
|
||||||
|
const orgChild3Ref = orgRevisionRef?.orgChild3 ?? null;
|
||||||
|
const orgChild4Ref = orgRevisionRef?.orgChild4 ?? null;
|
||||||
const shortName =
|
const shortName =
|
||||||
!profile.current_holders || profile.current_holders.length == 0
|
!profile.current_holders || profile.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
|
|
@ -2431,10 +2491,10 @@ export class ProfileController extends Controller {
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
positionType: profile.posType.posTypeName,
|
positionType: profile.posType.posTypeName,
|
||||||
positionLevel: profile.posLevel.posLevelName,
|
positionLevel: profile.posLevel.posLevelName,
|
||||||
posNo: shortName ? shortName : "-",
|
posNo: shortName ? shortName : null,
|
||||||
positionLine: position?.positionField ?? "-",
|
positionLine: position?.positionField ?? null,
|
||||||
positionPathSide: position?.positionArea ?? "-",
|
positionPathSide: position?.positionArea ?? null,
|
||||||
positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
positionExecutive: position?.posExecutive?.posExecutiveName ?? null,
|
||||||
amount: profile.amount,
|
amount: profile.amount,
|
||||||
positionSalaryAmount: profile.positionSalaryAmount,
|
positionSalaryAmount: profile.positionSalaryAmount,
|
||||||
mouthSalaryAmount: profile.mouthSalaryAmount,
|
mouthSalaryAmount: profile.mouthSalaryAmount,
|
||||||
|
|
@ -2444,31 +2504,23 @@ export class ProfileController extends Controller {
|
||||||
? profile.profileSalary[0].order + 1
|
? profile.profileSalary[0].order + 1
|
||||||
: 1
|
: 1
|
||||||
: null,
|
: null,
|
||||||
|
orgRoot: orgRootRef?.orgRootName ?? null,
|
||||||
|
orgChild1: orgChild1Ref?.orgChild1Name ?? null,
|
||||||
|
orgChild2: orgChild2Ref?.orgChild2Name ?? null,
|
||||||
|
orgChild3: orgChild3Ref?.orgChild3Name ?? null,
|
||||||
|
orgChild4: orgChild4Ref?.orgChild4Name ?? null,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
|
refCommandCode: body.refCommandCode,
|
||||||
|
refCommandName: body.refCommandName,
|
||||||
});
|
});
|
||||||
// //เพิ่มวินัย
|
|
||||||
// const profileDiscipline: ProfileDiscipline = Object.assign(new ProfileDiscipline(), {
|
|
||||||
// date: body.date,
|
|
||||||
// profileId: body.profileId,
|
|
||||||
// refCommandNo: body.refCommandNo,
|
|
||||||
// createdUserId: req.user.sub,
|
|
||||||
// createdFullName: req.user.name,
|
|
||||||
// lastUpdateUserId: req.user.sub,
|
|
||||||
// lastUpdateFullName: req.user.name,
|
|
||||||
// createdAt: new Date(),
|
|
||||||
// lastUpdatedAt: new Date(),
|
|
||||||
// });
|
|
||||||
await removeProfileInOrganize(profile.id, "OFFICER");
|
await removeProfileInOrganize(profile.id, "OFFICER");
|
||||||
await Promise.all([
|
await Promise.all([this.profileRepo.save(_profile), this.salaryRepo.save(profileSalary)]);
|
||||||
this.profileRepo.save(_profile),
|
|
||||||
this.salaryRepository.save(profileSalary),
|
|
||||||
// this.profileDisciplineRepo.save(profileDiscipline)
|
|
||||||
]);
|
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -2488,6 +2540,8 @@ export class ProfileController extends Controller {
|
||||||
date: Date | null;
|
date: Date | null;
|
||||||
refCommandNo: string | null;
|
refCommandNo: string | null;
|
||||||
salaryRef: string | null;
|
salaryRef: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
|
|
@ -2522,6 +2576,13 @@ export class ProfileController extends Controller {
|
||||||
orgRevisionIsDraft: false,
|
orgRevisionIsDraft: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const orgRevisionRef =
|
||||||
|
profile?.current_holders?.find((x) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||||
|
const orgRootRef = orgRevisionRef?.orgRoot ?? null;
|
||||||
|
const orgChild1Ref = orgRevisionRef?.orgChild1 ?? null;
|
||||||
|
const orgChild2Ref = orgRevisionRef?.orgChild2 ?? null;
|
||||||
|
const orgChild3Ref = orgRevisionRef?.orgChild3 ?? null;
|
||||||
|
const orgChild4Ref = orgRevisionRef?.orgChild4 ?? null;
|
||||||
const shortName =
|
const shortName =
|
||||||
!profile.current_holders || profile.current_holders.length == 0
|
!profile.current_holders || profile.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
|
|
@ -2558,10 +2619,10 @@ export class ProfileController extends Controller {
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
positionType: profile.posType.posTypeName,
|
positionType: profile.posType.posTypeName,
|
||||||
positionLevel: profile.posLevel.posLevelName,
|
positionLevel: profile.posLevel.posLevelName,
|
||||||
posNo: shortName ? shortName : "-",
|
posNo: shortName ? shortName : null,
|
||||||
positionLine: position?.positionField ?? "-",
|
positionLine: position?.positionField ?? null,
|
||||||
positionPathSide: position?.positionArea ?? "-",
|
positionPathSide: position?.positionArea ?? null,
|
||||||
positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
positionExecutive: position?.posExecutive?.posExecutiveName ?? null,
|
||||||
amount: profile.amount,
|
amount: profile.amount,
|
||||||
positionSalaryAmount: profile.positionSalaryAmount,
|
positionSalaryAmount: profile.positionSalaryAmount,
|
||||||
mouthSalaryAmount: profile.mouthSalaryAmount,
|
mouthSalaryAmount: profile.mouthSalaryAmount,
|
||||||
|
|
@ -2571,15 +2632,23 @@ export class ProfileController extends Controller {
|
||||||
? profile.profileSalary[0].order + 1
|
? profile.profileSalary[0].order + 1
|
||||||
: 1
|
: 1
|
||||||
: null,
|
: null,
|
||||||
|
orgRoot: orgRootRef?.orgRootName ?? null,
|
||||||
|
orgChild1: orgChild1Ref?.orgChild1Name ?? null,
|
||||||
|
orgChild2: orgChild2Ref?.orgChild2Name ?? null,
|
||||||
|
orgChild3: orgChild3Ref?.orgChild3Name ?? null,
|
||||||
|
orgChild4: orgChild4Ref?.orgChild4Name ?? null,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
|
refCommandCode: body.refCommandCode,
|
||||||
|
refCommandName: body.refCommandName,
|
||||||
});
|
});
|
||||||
await removeProfileInOrganize(profile.id, "OFFICER");
|
await removeProfileInOrganize(profile.id, "OFFICER");
|
||||||
await Promise.all([this.profileRepo.save(_profile), this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.profileRepo.save(_profile), this.salaryRepo.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -2599,6 +2668,8 @@ export class ProfileController extends Controller {
|
||||||
date: Date | null;
|
date: Date | null;
|
||||||
refCommandNo: string | null;
|
refCommandNo: string | null;
|
||||||
salaryRef: string | null;
|
salaryRef: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
|
|
@ -2632,6 +2703,13 @@ export class ProfileController extends Controller {
|
||||||
orgRevisionIsDraft: false,
|
orgRevisionIsDraft: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const orgRevisionRef =
|
||||||
|
profile?.current_holders?.find((x) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||||
|
const orgRootRef = orgRevisionRef?.orgRoot ?? null;
|
||||||
|
const orgChild1Ref = orgRevisionRef?.orgChild1 ?? null;
|
||||||
|
const orgChild2Ref = orgRevisionRef?.orgChild2 ?? null;
|
||||||
|
const orgChild3Ref = orgRevisionRef?.orgChild3 ?? null;
|
||||||
|
const orgChild4Ref = orgRevisionRef?.orgChild4 ?? null;
|
||||||
const shortName =
|
const shortName =
|
||||||
!profile.current_holders || profile.current_holders.length == 0
|
!profile.current_holders || profile.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
|
|
@ -2668,10 +2746,10 @@ export class ProfileController extends Controller {
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
positionType: profile.posType.posTypeName,
|
positionType: profile.posType.posTypeName,
|
||||||
positionLevel: profile.posLevel.posLevelName,
|
positionLevel: profile.posLevel.posLevelName,
|
||||||
posNo: shortName ? shortName : "-",
|
posNo: shortName ? shortName : null,
|
||||||
positionLine: position?.positionField ?? "-",
|
positionLine: position?.positionField ?? null,
|
||||||
positionPathSide: position?.positionArea ?? "-",
|
positionPathSide: position?.positionArea ?? null,
|
||||||
positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
positionExecutive: position?.posExecutive?.posExecutiveName ?? null,
|
||||||
amount: profile.amount,
|
amount: profile.amount,
|
||||||
positionSalaryAmount: profile.positionSalaryAmount,
|
positionSalaryAmount: profile.positionSalaryAmount,
|
||||||
mouthSalaryAmount: profile.mouthSalaryAmount,
|
mouthSalaryAmount: profile.mouthSalaryAmount,
|
||||||
|
|
@ -2681,15 +2759,23 @@ export class ProfileController extends Controller {
|
||||||
? profile.profileSalary[0].order + 1
|
? profile.profileSalary[0].order + 1
|
||||||
: 1
|
: 1
|
||||||
: null,
|
: null,
|
||||||
|
orgRoot: orgRootRef?.orgRootName ?? null,
|
||||||
|
orgChild1: orgChild1Ref?.orgChild1Name ?? null,
|
||||||
|
orgChild2: orgChild2Ref?.orgChild2Name ?? null,
|
||||||
|
orgChild3: orgChild3Ref?.orgChild3Name ?? null,
|
||||||
|
orgChild4: orgChild4Ref?.orgChild4Name ?? null,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
|
refCommandCode: body.refCommandCode,
|
||||||
|
refCommandName: body.refCommandName,
|
||||||
});
|
});
|
||||||
await removeProfileInOrganize(profile.id, "OFFICER");
|
await removeProfileInOrganize(profile.id, "OFFICER");
|
||||||
await Promise.all([this.profileRepo.save(_profile), this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.profileRepo.save(_profile), this.salaryRepo.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -2709,6 +2795,8 @@ export class ProfileController extends Controller {
|
||||||
date: Date | null;
|
date: Date | null;
|
||||||
refCommandNo: string | null;
|
refCommandNo: string | null;
|
||||||
salaryRef: string | null;
|
salaryRef: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
|
|
@ -2736,6 +2824,13 @@ export class ProfileController extends Controller {
|
||||||
orgRevisionIsDraft: false,
|
orgRevisionIsDraft: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const orgRevisionRef =
|
||||||
|
profile?.current_holders?.find((x) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||||
|
const orgRootRef = orgRevisionRef?.orgRoot ?? null;
|
||||||
|
const orgChild1Ref = orgRevisionRef?.orgChild1 ?? null;
|
||||||
|
const orgChild2Ref = orgRevisionRef?.orgChild2 ?? null;
|
||||||
|
const orgChild3Ref = orgRevisionRef?.orgChild3 ?? null;
|
||||||
|
const orgChild4Ref = orgRevisionRef?.orgChild4 ?? null;
|
||||||
const shortName =
|
const shortName =
|
||||||
!profile.current_holders || profile.current_holders.length == 0
|
!profile.current_holders || profile.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
|
|
@ -2772,10 +2867,10 @@ export class ProfileController extends Controller {
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
positionType: profile.posType.posTypeName,
|
positionType: profile.posType.posTypeName,
|
||||||
positionLevel: profile.posLevel.posLevelName,
|
positionLevel: profile.posLevel.posLevelName,
|
||||||
posNo: shortName ? shortName : "-",
|
posNo: shortName ? shortName : null,
|
||||||
positionLine: position?.positionField ?? "-",
|
positionLine: position?.positionField ?? null,
|
||||||
positionPathSide: position?.positionArea ?? "-",
|
positionPathSide: position?.positionArea ?? null,
|
||||||
positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
positionExecutive: position?.posExecutive?.posExecutiveName ?? null,
|
||||||
amount: profile.amount,
|
amount: profile.amount,
|
||||||
positionSalaryAmount: profile.positionSalaryAmount,
|
positionSalaryAmount: profile.positionSalaryAmount,
|
||||||
mouthSalaryAmount: profile.mouthSalaryAmount,
|
mouthSalaryAmount: profile.mouthSalaryAmount,
|
||||||
|
|
@ -2785,14 +2880,22 @@ export class ProfileController extends Controller {
|
||||||
? profile.profileSalary[0].order + 1
|
? profile.profileSalary[0].order + 1
|
||||||
: 1
|
: 1
|
||||||
: null,
|
: null,
|
||||||
|
orgRoot: orgRootRef?.orgRootName ?? null,
|
||||||
|
orgChild1: orgChild1Ref?.orgChild1Name ?? null,
|
||||||
|
orgChild2: orgChild2Ref?.orgChild2Name ?? null,
|
||||||
|
orgChild3: orgChild3Ref?.orgChild3Name ?? null,
|
||||||
|
orgChild4: orgChild4Ref?.orgChild4Name ?? null,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
|
refCommandCode: body.refCommandCode,
|
||||||
|
refCommandName: body.refCommandName,
|
||||||
});
|
});
|
||||||
await Promise.all([this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.salaryRepo.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -2812,6 +2915,8 @@ export class ProfileController extends Controller {
|
||||||
date: Date | null;
|
date: Date | null;
|
||||||
refCommandNo: string | null;
|
refCommandNo: string | null;
|
||||||
salaryRef: string | null;
|
salaryRef: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
|
|
@ -2839,6 +2944,13 @@ export class ProfileController extends Controller {
|
||||||
orgRevisionIsDraft: false,
|
orgRevisionIsDraft: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const orgRevisionRef =
|
||||||
|
profile?.current_holders?.find((x) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||||
|
const orgRootRef = orgRevisionRef?.orgRoot ?? null;
|
||||||
|
const orgChild1Ref = orgRevisionRef?.orgChild1 ?? null;
|
||||||
|
const orgChild2Ref = orgRevisionRef?.orgChild2 ?? null;
|
||||||
|
const orgChild3Ref = orgRevisionRef?.orgChild3 ?? null;
|
||||||
|
const orgChild4Ref = orgRevisionRef?.orgChild4 ?? null;
|
||||||
const shortName =
|
const shortName =
|
||||||
!profile.current_holders || profile.current_holders.length == 0
|
!profile.current_holders || profile.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
|
|
@ -2875,10 +2987,10 @@ export class ProfileController extends Controller {
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
positionType: profile.posType.posTypeName,
|
positionType: profile.posType.posTypeName,
|
||||||
positionLevel: profile.posLevel.posLevelName,
|
positionLevel: profile.posLevel.posLevelName,
|
||||||
posNo: shortName ? shortName : "-",
|
posNo: shortName ? shortName : null,
|
||||||
positionLine: position?.positionField ?? "-",
|
positionLine: position?.positionField ?? null,
|
||||||
positionPathSide: position?.positionArea ?? "-",
|
positionPathSide: position?.positionArea ?? null,
|
||||||
positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
positionExecutive: position?.posExecutive?.posExecutiveName ?? null,
|
||||||
amount: profile.amount,
|
amount: profile.amount,
|
||||||
positionSalaryAmount: profile.positionSalaryAmount,
|
positionSalaryAmount: profile.positionSalaryAmount,
|
||||||
mouthSalaryAmount: profile.mouthSalaryAmount,
|
mouthSalaryAmount: profile.mouthSalaryAmount,
|
||||||
|
|
@ -2888,14 +3000,22 @@ export class ProfileController extends Controller {
|
||||||
? profile.profileSalary[0].order + 1
|
? profile.profileSalary[0].order + 1
|
||||||
: 1
|
: 1
|
||||||
: null,
|
: null,
|
||||||
|
orgRoot: orgRootRef?.orgRootName ?? null,
|
||||||
|
orgChild1: orgChild1Ref?.orgChild1Name ?? null,
|
||||||
|
orgChild2: orgChild2Ref?.orgChild2Name ?? null,
|
||||||
|
orgChild3: orgChild3Ref?.orgChild3Name ?? null,
|
||||||
|
orgChild4: orgChild4Ref?.orgChild4Name ?? null,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
|
refCommandCode: body.refCommandCode,
|
||||||
|
refCommandName: body.refCommandName,
|
||||||
});
|
});
|
||||||
await Promise.all([this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.salaryRepo.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -2915,6 +3035,8 @@ export class ProfileController extends Controller {
|
||||||
date: Date | null;
|
date: Date | null;
|
||||||
refCommandNo: string | null;
|
refCommandNo: string | null;
|
||||||
salaryRef: string | null;
|
salaryRef: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
|
|
@ -2942,6 +3064,13 @@ export class ProfileController extends Controller {
|
||||||
orgRevisionIsDraft: false,
|
orgRevisionIsDraft: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const orgRevisionRef =
|
||||||
|
profile?.current_holders?.find((x) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||||
|
const orgRootRef = orgRevisionRef?.orgRoot ?? null;
|
||||||
|
const orgChild1Ref = orgRevisionRef?.orgChild1 ?? null;
|
||||||
|
const orgChild2Ref = orgRevisionRef?.orgChild2 ?? null;
|
||||||
|
const orgChild3Ref = orgRevisionRef?.orgChild3 ?? null;
|
||||||
|
const orgChild4Ref = orgRevisionRef?.orgChild4 ?? null;
|
||||||
const shortName =
|
const shortName =
|
||||||
!profile.current_holders || profile.current_holders.length == 0
|
!profile.current_holders || profile.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
|
|
@ -2979,10 +3108,10 @@ export class ProfileController extends Controller {
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
positionType: profile.posType.posTypeName,
|
positionType: profile.posType.posTypeName,
|
||||||
positionLevel: profile.posLevel.posLevelName,
|
positionLevel: profile.posLevel.posLevelName,
|
||||||
posNo: shortName ? shortName : "-",
|
posNo: shortName ? shortName : null,
|
||||||
positionLine: position?.positionField ?? "-",
|
positionLine: position?.positionField ?? null,
|
||||||
positionPathSide: position?.positionArea ?? "-",
|
positionPathSide: position?.positionArea ?? null,
|
||||||
positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
positionExecutive: position?.posExecutive?.posExecutiveName ?? null,
|
||||||
amount: profile.amount,
|
amount: profile.amount,
|
||||||
positionSalaryAmount: profile.positionSalaryAmount,
|
positionSalaryAmount: profile.positionSalaryAmount,
|
||||||
mouthSalaryAmount: profile.mouthSalaryAmount,
|
mouthSalaryAmount: profile.mouthSalaryAmount,
|
||||||
|
|
@ -2992,14 +3121,22 @@ export class ProfileController extends Controller {
|
||||||
? profile.profileSalary[0].order + 1
|
? profile.profileSalary[0].order + 1
|
||||||
: 1
|
: 1
|
||||||
: null,
|
: null,
|
||||||
|
orgRoot: orgRootRef?.orgRootName ?? null,
|
||||||
|
orgChild1: orgChild1Ref?.orgChild1Name ?? null,
|
||||||
|
orgChild2: orgChild2Ref?.orgChild2Name ?? null,
|
||||||
|
orgChild3: orgChild3Ref?.orgChild3Name ?? null,
|
||||||
|
orgChild4: orgChild4Ref?.orgChild4Name ?? null,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
|
refCommandCode: body.refCommandCode,
|
||||||
|
refCommandName: body.refCommandName,
|
||||||
});
|
});
|
||||||
await Promise.all([this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.salaryRepo.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -3019,6 +3156,8 @@ export class ProfileController extends Controller {
|
||||||
date: Date | null;
|
date: Date | null;
|
||||||
refCommandNo: string | null;
|
refCommandNo: string | null;
|
||||||
salaryRef: string | null;
|
salaryRef: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
|
|
@ -3046,6 +3185,13 @@ export class ProfileController extends Controller {
|
||||||
orgRevisionIsDraft: false,
|
orgRevisionIsDraft: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const orgRevisionRef =
|
||||||
|
profile?.current_holders?.find((x) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||||
|
const orgRootRef = orgRevisionRef?.orgRoot ?? null;
|
||||||
|
const orgChild1Ref = orgRevisionRef?.orgChild1 ?? null;
|
||||||
|
const orgChild2Ref = orgRevisionRef?.orgChild2 ?? null;
|
||||||
|
const orgChild3Ref = orgRevisionRef?.orgChild3 ?? null;
|
||||||
|
const orgChild4Ref = orgRevisionRef?.orgChild4 ?? null;
|
||||||
const shortName =
|
const shortName =
|
||||||
!profile.current_holders || profile.current_holders.length == 0
|
!profile.current_holders || profile.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
|
|
@ -3082,10 +3228,10 @@ export class ProfileController extends Controller {
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
positionType: profile.posType.posTypeName,
|
positionType: profile.posType.posTypeName,
|
||||||
positionLevel: profile.posLevel.posLevelName,
|
positionLevel: profile.posLevel.posLevelName,
|
||||||
posNo: shortName ? shortName : "-",
|
posNo: shortName ? shortName : null,
|
||||||
positionLine: position?.positionField ?? "-",
|
positionLine: position?.positionField ?? null,
|
||||||
positionPathSide: position?.positionArea ?? "-",
|
positionPathSide: position?.positionArea ?? null,
|
||||||
positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
positionExecutive: position?.posExecutive?.posExecutiveName ?? null,
|
||||||
amount: profile.amount,
|
amount: profile.amount,
|
||||||
positionSalaryAmount: profile.positionSalaryAmount,
|
positionSalaryAmount: profile.positionSalaryAmount,
|
||||||
mouthSalaryAmount: profile.mouthSalaryAmount,
|
mouthSalaryAmount: profile.mouthSalaryAmount,
|
||||||
|
|
@ -3095,14 +3241,22 @@ export class ProfileController extends Controller {
|
||||||
? profile.profileSalary[0].order + 1
|
? profile.profileSalary[0].order + 1
|
||||||
: 1
|
: 1
|
||||||
: null,
|
: null,
|
||||||
|
orgRoot: orgRootRef?.orgRootName ?? null,
|
||||||
|
orgChild1: orgChild1Ref?.orgChild1Name ?? null,
|
||||||
|
orgChild2: orgChild2Ref?.orgChild2Name ?? null,
|
||||||
|
orgChild3: orgChild3Ref?.orgChild3Name ?? null,
|
||||||
|
orgChild4: orgChild4Ref?.orgChild4Name ?? null,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
|
refCommandCode: body.refCommandCode,
|
||||||
|
refCommandName: body.refCommandName,
|
||||||
});
|
});
|
||||||
await Promise.all([this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.salaryRepo.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -3122,6 +3276,8 @@ export class ProfileController extends Controller {
|
||||||
date: Date | null;
|
date: Date | null;
|
||||||
refCommandNo: string | null;
|
refCommandNo: string | null;
|
||||||
salaryRef: string | null;
|
salaryRef: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
|
|
@ -3149,6 +3305,13 @@ export class ProfileController extends Controller {
|
||||||
orgRevisionIsDraft: false,
|
orgRevisionIsDraft: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const orgRevisionRef =
|
||||||
|
profile?.current_holders?.find((x) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||||
|
const orgRootRef = orgRevisionRef?.orgRoot ?? null;
|
||||||
|
const orgChild1Ref = orgRevisionRef?.orgChild1 ?? null;
|
||||||
|
const orgChild2Ref = orgRevisionRef?.orgChild2 ?? null;
|
||||||
|
const orgChild3Ref = orgRevisionRef?.orgChild3 ?? null;
|
||||||
|
const orgChild4Ref = orgRevisionRef?.orgChild4 ?? null;
|
||||||
const shortName =
|
const shortName =
|
||||||
!profile.current_holders || profile.current_holders.length == 0
|
!profile.current_holders || profile.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
|
|
@ -3186,10 +3349,10 @@ export class ProfileController extends Controller {
|
||||||
position: profile.position,
|
position: profile.position,
|
||||||
positionType: profile.posType.posTypeName,
|
positionType: profile.posType.posTypeName,
|
||||||
positionLevel: profile.posLevel.posLevelName,
|
positionLevel: profile.posLevel.posLevelName,
|
||||||
posNo: shortName ? shortName : "-",
|
posNo: shortName ? shortName : null,
|
||||||
positionLine: position?.positionField ?? "-",
|
positionLine: position?.positionField ?? null,
|
||||||
positionPathSide: position?.positionArea ?? "-",
|
positionPathSide: position?.positionArea ?? null,
|
||||||
positionExecutive: position?.posExecutive?.posExecutiveName ?? "-",
|
positionExecutive: position?.posExecutive?.posExecutiveName ?? null,
|
||||||
amount: profile.amount,
|
amount: profile.amount,
|
||||||
positionSalaryAmount: profile.positionSalaryAmount,
|
positionSalaryAmount: profile.positionSalaryAmount,
|
||||||
mouthSalaryAmount: profile.mouthSalaryAmount,
|
mouthSalaryAmount: profile.mouthSalaryAmount,
|
||||||
|
|
@ -3199,14 +3362,22 @@ export class ProfileController extends Controller {
|
||||||
? profile.profileSalary[0].order + 1
|
? profile.profileSalary[0].order + 1
|
||||||
: 1
|
: 1
|
||||||
: null,
|
: null,
|
||||||
|
orgRoot: orgRootRef?.orgRootName ?? null,
|
||||||
|
orgChild1: orgChild1Ref?.orgChild1Name ?? null,
|
||||||
|
orgChild2: orgChild2Ref?.orgChild2Name ?? null,
|
||||||
|
orgChild3: orgChild3Ref?.orgChild3Name ?? null,
|
||||||
|
orgChild4: orgChild4Ref?.orgChild4Name ?? null,
|
||||||
createdUserId: req.user.sub,
|
createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
|
refCommandDate: new Date(),
|
||||||
|
refCommandCode: body.refCommandCode,
|
||||||
|
refCommandName: body.refCommandName,
|
||||||
});
|
});
|
||||||
await Promise.all([this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.salaryRepo.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -8183,7 +8354,7 @@ export class ProfileController extends Controller {
|
||||||
const _null: any = null;
|
const _null: any = null;
|
||||||
const profiles = await Promise.all(
|
const profiles = await Promise.all(
|
||||||
profile.map(async (_data) => {
|
profile.map(async (_data) => {
|
||||||
const salary = await this.salaryRepository.findOne({
|
const salary = await this.salaryRepo.findOne({
|
||||||
where: {
|
where: {
|
||||||
profileId: _data.id,
|
profileId: _data.id,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ export class ProfileEmployeeController extends Controller {
|
||||||
private profileFamilyFatherRepository = AppDataSource.getRepository(ProfileFamilyFather);
|
private profileFamilyFatherRepository = AppDataSource.getRepository(ProfileFamilyFather);
|
||||||
private trainingRepository = AppDataSource.getRepository(ProfileTraining);
|
private trainingRepository = AppDataSource.getRepository(ProfileTraining);
|
||||||
private disciplineRepository = AppDataSource.getRepository(ProfileDiscipline);
|
private disciplineRepository = AppDataSource.getRepository(ProfileDiscipline);
|
||||||
private salaryRepository = AppDataSource.getRepository(ProfileSalary);
|
private salaryRepo = AppDataSource.getRepository(ProfileSalary);
|
||||||
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
||||||
private child1Repository = AppDataSource.getRepository(OrgChild1);
|
private child1Repository = AppDataSource.getRepository(OrgChild1);
|
||||||
private child2Repository = AppDataSource.getRepository(OrgChild2);
|
private child2Repository = AppDataSource.getRepository(OrgChild2);
|
||||||
|
|
@ -548,7 +548,7 @@ export class ProfileEmployeeController extends Controller {
|
||||||
Field: "-",
|
Field: "-",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const salary_raw = await this.salaryRepository.find({
|
const salary_raw = await this.salaryRepo.find({
|
||||||
select: [
|
select: [
|
||||||
"date",
|
"date",
|
||||||
"position",
|
"position",
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ export class ProfileEmployeeTempController extends Controller {
|
||||||
private profileFamilyFatherRepository = AppDataSource.getRepository(ProfileFamilyFather);
|
private profileFamilyFatherRepository = AppDataSource.getRepository(ProfileFamilyFather);
|
||||||
private trainingRepository = AppDataSource.getRepository(ProfileTraining);
|
private trainingRepository = AppDataSource.getRepository(ProfileTraining);
|
||||||
private disciplineRepository = AppDataSource.getRepository(ProfileDiscipline);
|
private disciplineRepository = AppDataSource.getRepository(ProfileDiscipline);
|
||||||
private salaryRepository = AppDataSource.getRepository(ProfileSalary);
|
private salaryRepo = AppDataSource.getRepository(ProfileSalary);
|
||||||
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
private orgRootRepository = AppDataSource.getRepository(OrgRoot);
|
||||||
private child1Repository = AppDataSource.getRepository(OrgChild1);
|
private child1Repository = AppDataSource.getRepository(OrgChild1);
|
||||||
private child2Repository = AppDataSource.getRepository(OrgChild2);
|
private child2Repository = AppDataSource.getRepository(OrgChild2);
|
||||||
|
|
@ -545,7 +545,7 @@ export class ProfileEmployeeTempController extends Controller {
|
||||||
Field: "-",
|
Field: "-",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const salary_raw = await this.salaryRepository.find({
|
const salary_raw = await this.salaryRepo.find({
|
||||||
select: [
|
select: [
|
||||||
"date",
|
"date",
|
||||||
"position",
|
"position",
|
||||||
|
|
|
||||||
|
|
@ -119,10 +119,11 @@ export class ProfileSalaryController extends Controller {
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
|
refCommandDate: new Date(),
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
};
|
};
|
||||||
const _null:any = null;
|
const _null: any = null;
|
||||||
Object.assign(data, { ...body, ...meta });
|
Object.assign(data, { ...body, ...meta });
|
||||||
const history = new ProfileSalaryHistory();
|
const history = new ProfileSalaryHistory();
|
||||||
Object.assign(history, { ...data, id: undefined });
|
Object.assign(history, { ...data, id: undefined });
|
||||||
|
|
@ -131,9 +132,9 @@ export class ProfileSalaryController extends Controller {
|
||||||
history.profileSalaryId = data.id;
|
history.profileSalaryId = data.id;
|
||||||
await this.salaryHistoryRepo.save(history, { data: req });
|
await this.salaryHistoryRepo.save(history, { data: req });
|
||||||
|
|
||||||
profile.amount = body?.amount??_null;
|
profile.amount = body?.amount ?? _null;
|
||||||
profile.positionSalaryAmount = body?.positionSalaryAmount??_null;
|
profile.positionSalaryAmount = body?.positionSalaryAmount ?? _null;
|
||||||
profile.mouthSalaryAmount = body.mouthSalaryAmount??_null;
|
profile.mouthSalaryAmount = body.mouthSalaryAmount ?? _null;
|
||||||
await this.profileRepo.save(profile, { data: req });
|
await this.profileRepo.save(profile, { data: req });
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
|
|
@ -164,6 +165,7 @@ export class ProfileSalaryController extends Controller {
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
|
refCommandDate: new Date(),
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
};
|
};
|
||||||
|
|
@ -176,7 +178,7 @@ export class ProfileSalaryController extends Controller {
|
||||||
history.profileSalaryId = data.id;
|
history.profileSalaryId = data.id;
|
||||||
await this.salaryHistoryRepo.save(history, { data: req });
|
await this.salaryHistoryRepo.save(history, { data: req });
|
||||||
|
|
||||||
let null_:any = null;
|
let null_: any = null;
|
||||||
profile.amount = body.amount ?? null_;
|
profile.amount = body.amount ?? null_;
|
||||||
profile.amountSpecial = body.amountSpecial ?? null_;
|
profile.amountSpecial = body.amountSpecial ?? null_;
|
||||||
profile.positionSalaryAmount = body.positionSalaryAmount ?? null_;
|
profile.positionSalaryAmount = body.positionSalaryAmount ?? null_;
|
||||||
|
|
@ -208,6 +210,7 @@ export class ProfileSalaryController extends Controller {
|
||||||
history.lastUpdateFullName = req.user.name;
|
history.lastUpdateFullName = req.user.name;
|
||||||
history.createdUserId = req.user.sub;
|
history.createdUserId = req.user.sub;
|
||||||
history.createdFullName = req.user.name;
|
history.createdFullName = req.user.name;
|
||||||
|
record.refCommandDate = new Date();
|
||||||
history.createdAt = new Date();
|
history.createdAt = new Date();
|
||||||
history.lastUpdatedAt = new Date();
|
history.lastUpdatedAt = new Date();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,7 @@ export class ProfileSalaryEmployeeController extends Controller {
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
|
refCommandDate: new Date(),
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
};
|
};
|
||||||
|
|
@ -137,15 +138,15 @@ export class ProfileSalaryEmployeeController extends Controller {
|
||||||
Object.assign(data, { ...body, ...meta });
|
Object.assign(data, { ...body, ...meta });
|
||||||
const history = new ProfileSalaryHistory();
|
const history = new ProfileSalaryHistory();
|
||||||
Object.assign(history, { ...data, id: undefined });
|
Object.assign(history, { ...data, id: undefined });
|
||||||
const _null:any = null;
|
const _null: any = null;
|
||||||
await this.salaryRepo.save(data, { data: req });
|
await this.salaryRepo.save(data, { data: req });
|
||||||
setLogDataDiff(req, { before, after: data });
|
setLogDataDiff(req, { before, after: data });
|
||||||
history.profileSalaryId = data.id;
|
history.profileSalaryId = data.id;
|
||||||
await this.salaryHistoryRepo.save(history, { data: req });
|
await this.salaryHistoryRepo.save(history, { data: req });
|
||||||
|
|
||||||
profile.amount = body?.amount??_null;
|
profile.amount = body?.amount ?? _null;
|
||||||
profile.positionSalaryAmount = body?.positionSalaryAmount??_null;
|
profile.positionSalaryAmount = body?.positionSalaryAmount ?? _null;
|
||||||
profile.mouthSalaryAmount = body.mouthSalaryAmount??_null;
|
profile.mouthSalaryAmount = body.mouthSalaryAmount ?? _null;
|
||||||
await this.profileRepo.save(profile, { data: req });
|
await this.profileRepo.save(profile, { data: req });
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
|
|
@ -179,6 +180,7 @@ export class ProfileSalaryEmployeeController extends Controller {
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
|
refCommandDate: new Date(),
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
};
|
};
|
||||||
|
|
@ -192,7 +194,7 @@ export class ProfileSalaryEmployeeController extends Controller {
|
||||||
history.profileSalaryId = data.id;
|
history.profileSalaryId = data.id;
|
||||||
await this.salaryHistoryRepo.save(history, { data: req });
|
await this.salaryHistoryRepo.save(history, { data: req });
|
||||||
|
|
||||||
let null_:any = null;
|
let null_: any = null;
|
||||||
profile.amount = body.amount ?? null_;
|
profile.amount = body.amount ?? null_;
|
||||||
profile.amountSpecial = body.amountSpecial ?? null_;
|
profile.amountSpecial = body.amountSpecial ?? null_;
|
||||||
profile.positionSalaryAmount = body.positionSalaryAmount ?? null_;
|
profile.positionSalaryAmount = body.positionSalaryAmount ?? null_;
|
||||||
|
|
@ -228,6 +230,7 @@ export class ProfileSalaryEmployeeController extends Controller {
|
||||||
history.lastUpdateFullName = req.user.name;
|
history.lastUpdateFullName = req.user.name;
|
||||||
history.createdUserId = req.user.sub;
|
history.createdUserId = req.user.sub;
|
||||||
history.createdFullName = req.user.name;
|
history.createdFullName = req.user.name;
|
||||||
|
record.refCommandDate = new Date();
|
||||||
history.createdAt = new Date();
|
history.createdAt = new Date();
|
||||||
history.lastUpdatedAt = new Date();
|
history.lastUpdatedAt = new Date();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,7 @@ export class ProfileSalaryEmployeeTempController extends Controller {
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
|
refCommandDate: new Date(),
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
};
|
};
|
||||||
|
|
@ -158,6 +159,7 @@ export class ProfileSalaryEmployeeTempController extends Controller {
|
||||||
record.lastUpdateUserId = req.user.sub;
|
record.lastUpdateUserId = req.user.sub;
|
||||||
record.lastUpdateFullName = req.user.name;
|
record.lastUpdateFullName = req.user.name;
|
||||||
record.lastUpdatedAt = new Date();
|
record.lastUpdatedAt = new Date();
|
||||||
|
record.refCommandDate = new Date();
|
||||||
history.lastUpdateUserId = req.user.sub;
|
history.lastUpdateUserId = req.user.sub;
|
||||||
history.lastUpdateFullName = req.user.name;
|
history.lastUpdateFullName = req.user.name;
|
||||||
history.createdUserId = req.user.sub;
|
history.createdUserId = req.user.sub;
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,14 @@ export class CommandType extends EntityBase {
|
||||||
})
|
})
|
||||||
code: string;
|
code: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "รหัสประเภทของคำสั่งแต่งตั้ง",
|
||||||
|
length: 255,
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
refCommandCode: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "คำสั่งเรื่อง",
|
comment: "คำสั่งเรื่อง",
|
||||||
|
|
|
||||||
|
|
@ -94,4 +94,88 @@ export class HR_POSITION_OFFICER {
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
ORDER_MOVE_POSITION: string;
|
ORDER_MOVE_POSITION: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "text",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
MP_COMMAND_DATE: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "text",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
FLAG_TO_NAME_CODE: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "text",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
JOB_NAME: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "text",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
SECTION_NAME: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "text",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
DIVISION_NAME: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "text",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
DEPARTMENT_NAME: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "text",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
MP_CEE: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "text",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
SAL_POS_AMOUNT_1: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "text",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
SAL_POS_AMOUNT_2: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "text",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
SPECIAL_AMT: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "text",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
USER_CREATE: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "text",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
USER_UPDATE: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,62 @@ export class ProfileSalary extends EntityBase {
|
||||||
// })
|
// })
|
||||||
// commandType: string;
|
// commandType: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "root name",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
orgRoot: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "child1 name",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
orgChild1: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "child2 name",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
orgChild2: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "child3 name",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
orgChild3: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "child4 name",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
orgChild4: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "ระดับ",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
mpCee: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "รหัสประเภทของคำสั่งแต่งตั้ง",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
refCommandCode: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "ชื่อประเภทคำสั่ง",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
refCommandName: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "เลขที่คำสั่ง",
|
comment: "เลขที่คำสั่ง",
|
||||||
|
|
@ -135,6 +191,13 @@ export class ProfileSalary extends EntityBase {
|
||||||
})
|
})
|
||||||
refCommandNo: string;
|
refCommandNo: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
comment: "วันที่ออกคำสั่ง",
|
||||||
|
type: "datetime",
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
refCommandDate: Date;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "เอกสารอ้างอิง",
|
comment: "เอกสารอ้างอิง",
|
||||||
|
|
@ -207,6 +270,15 @@ export class CreateProfileSalary {
|
||||||
// commandType?: string | null;
|
// commandType?: string | null;
|
||||||
templateDoc: string | null;
|
templateDoc: string | null;
|
||||||
isGovernment?: boolean | null;
|
isGovernment?: boolean | null;
|
||||||
|
|
||||||
|
orgRoot?: string | null;
|
||||||
|
orgChild1?: string | null;
|
||||||
|
orgChild2?: string | null;
|
||||||
|
orgChild3?: string | null;
|
||||||
|
orgChild4?: string | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CreateProfileSalaryEmployee {
|
export class CreateProfileSalaryEmployee {
|
||||||
|
|
@ -226,6 +298,15 @@ export class CreateProfileSalaryEmployee {
|
||||||
positionLevel: string | null;
|
positionLevel: string | null;
|
||||||
refCommandNo: string | null;
|
refCommandNo: string | null;
|
||||||
templateDoc: string | null;
|
templateDoc: string | null;
|
||||||
|
|
||||||
|
orgRoot?: string | null;
|
||||||
|
orgChild1?: string | null;
|
||||||
|
orgChild2?: string | null;
|
||||||
|
orgChild3?: string | null;
|
||||||
|
orgChild4?: string | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class UpdateProfileSalaryEmployee {
|
export class UpdateProfileSalaryEmployee {
|
||||||
|
|
@ -243,6 +324,15 @@ export class UpdateProfileSalaryEmployee {
|
||||||
positionLevel: string | null;
|
positionLevel: string | null;
|
||||||
refCommandNo: string | null;
|
refCommandNo: string | null;
|
||||||
templateDoc: string | null;
|
templateDoc: string | null;
|
||||||
|
|
||||||
|
orgRoot?: string | null;
|
||||||
|
orgChild1?: string | null;
|
||||||
|
orgChild2?: string | null;
|
||||||
|
orgChild3?: string | null;
|
||||||
|
orgChild4?: string | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type UpdateProfileSalary = {
|
export type UpdateProfileSalary = {
|
||||||
|
|
@ -260,4 +350,13 @@ export type UpdateProfileSalary = {
|
||||||
positionLevel?: string | null;
|
positionLevel?: string | null;
|
||||||
refCommandNo?: string | null;
|
refCommandNo?: string | null;
|
||||||
templateDoc?: string | null;
|
templateDoc?: string | null;
|
||||||
|
|
||||||
|
orgRoot?: string | null;
|
||||||
|
orgChild1?: string | null;
|
||||||
|
orgChild2?: string | null;
|
||||||
|
orgChild3?: string | null;
|
||||||
|
orgChild4?: string | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,70 @@ export class ProfileSalaryHistory extends EntityBase {
|
||||||
})
|
})
|
||||||
mouthSalaryAmount: Double;
|
mouthSalaryAmount: Double;
|
||||||
|
|
||||||
|
// @Column({
|
||||||
|
// nullable: true,
|
||||||
|
// comment: "ประเภทคำสั่ง",
|
||||||
|
// type: "text",
|
||||||
|
// default: null,
|
||||||
|
// })
|
||||||
|
// commandType: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "root name",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
orgRoot: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "child1 name",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
orgChild1: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "child2 name",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
orgChild2: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "child3 name",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
orgChild3: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "child4 name",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
orgChild4: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "ระดับ",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
mpCee: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "รหัสประเภทของคำสั่งแต่งตั้ง",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
refCommandCode: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "ชื่อประเภทคำสั่ง",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
refCommandName: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "เลขที่คำสั่ง",
|
comment: "เลขที่คำสั่ง",
|
||||||
|
|
@ -115,6 +179,13 @@ export class ProfileSalaryHistory extends EntityBase {
|
||||||
})
|
})
|
||||||
refCommandNo: string;
|
refCommandNo: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
comment: "วันที่ออกคำสั่ง",
|
||||||
|
type: "datetime",
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
refCommandDate: Date;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "เอกสารอ้างอิง",
|
comment: "เอกสารอ้างอิง",
|
||||||
|
|
@ -169,6 +240,15 @@ export class CreateProfileSalaryHistory {
|
||||||
positionLevel: string | null;
|
positionLevel: string | null;
|
||||||
refCommandNo: string | null;
|
refCommandNo: string | null;
|
||||||
templateDoc: string | null;
|
templateDoc: string | null;
|
||||||
|
|
||||||
|
orgRoot?: string | null;
|
||||||
|
orgChild1?: string | null;
|
||||||
|
orgChild2?: string | null;
|
||||||
|
orgChild3?: string | null;
|
||||||
|
orgChild4?: string | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class UpdateProfileSalaryHistory {
|
export class UpdateProfileSalaryHistory {
|
||||||
|
|
@ -186,4 +266,13 @@ export class UpdateProfileSalaryHistory {
|
||||||
positionLevel?: string | null;
|
positionLevel?: string | null;
|
||||||
refCommandNo?: string | null;
|
refCommandNo?: string | null;
|
||||||
templateDoc?: string | null;
|
templateDoc?: string | null;
|
||||||
|
|
||||||
|
orgRoot?: string | null;
|
||||||
|
orgChild1?: string | null;
|
||||||
|
orgChild2?: string | null;
|
||||||
|
orgChild3?: string | null;
|
||||||
|
orgChild4?: string | null;
|
||||||
|
mpCee?: string | null;
|
||||||
|
refCommandCode?: string | null;
|
||||||
|
refCommandName?: string | null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ class FunctionMain {
|
||||||
createdFullName: req.user.name,
|
createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
|
refCommandDate: new Date(),
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
lastUpdatedAt: new Date(),
|
lastUpdatedAt: new Date(),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ export async function init() {
|
||||||
console.log(channel ? "[AMQ] Create channel success" : "[AMQ] Create channel failed");
|
console.log(channel ? "[AMQ] Create channel success" : "[AMQ] Create channel failed");
|
||||||
|
|
||||||
channel.assertQueue(queue, { durable: true }), //----> (1.5) assert queue and set durable (if "true" save to disk on RabbitMQ)
|
channel.assertQueue(queue, { durable: true }), //----> (1.5) assert queue and set durable (if "true" save to disk on RabbitMQ)
|
||||||
channel.assertQueue(queue_org, { durable: true }),
|
channel.assertQueue(queue_org, { durable: true }),
|
||||||
channel.prefetch(1)
|
channel.prefetch(1);
|
||||||
|
|
||||||
sendToQueue = (payload: any, persistent = true) => {
|
sendToQueue = (payload: any, persistent = true) => {
|
||||||
//----> (2) sendQueue To RabbitMQ and set persistent (if "true" redo the failed queue when server run again)
|
//----> (2) sendQueue To RabbitMQ and set persistent (if "true" redo the failed queue when server run again)
|
||||||
|
|
@ -42,7 +42,7 @@ export async function init() {
|
||||||
|
|
||||||
console.log("[AMQ] Listening for message...");
|
console.log("[AMQ] Listening for message...");
|
||||||
createConsumer(queue, channel, handler), //----> (3) Process Consumer
|
createConsumer(queue, channel, handler), //----> (3) Process Consumer
|
||||||
createConsumer(queue_org, channel, handler_org)
|
createConsumer(queue_org, channel, handler_org);
|
||||||
// createConsumer(queue2, channel, handler2);
|
// createConsumer(queue2, channel, handler2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -102,6 +102,8 @@ async function handler(msg: amqp.ConsumeMessage): Promise<boolean> {
|
||||||
amountSpecial: x.amountSpecial,
|
amountSpecial: x.amountSpecial,
|
||||||
positionSalaryAmount: x.positionSalaryAmount,
|
positionSalaryAmount: x.positionSalaryAmount,
|
||||||
mouthSalaryAmount: x.mouthSalaryAmount,
|
mouthSalaryAmount: x.mouthSalaryAmount,
|
||||||
|
refCommandCode: command.commandType.refCommandCode,
|
||||||
|
refCommandName: command.commandType.name,
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue