add posexcutive date
This commit is contained in:
parent
180cdd225e
commit
f781af3151
7 changed files with 984 additions and 155 deletions
|
|
@ -89,32 +89,31 @@ export class ProfileSalaryEmployeeController extends Controller {
|
|||
|
||||
@Get("tenure/{profileId}")
|
||||
public async getPositionTenure(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||
const position = await AppDataSource.query(
|
||||
"CALL GetProfileEmployeeSalaryPosition(?)",
|
||||
[profileId]
|
||||
);
|
||||
const _position = position.length > 0 ? position[0] : []
|
||||
const mapPosition = _position.length > 1
|
||||
? _position
|
||||
.slice(1)
|
||||
.map((curr: any, index: number) => ({
|
||||
year: curr.Years ? Math.floor(Number(curr.Years)) : 0,
|
||||
month: curr.Months ? Math.floor(Number(curr.Months)) : 0,
|
||||
day: curr.Days ? Math.floor(Number(curr.Days)) : 0,
|
||||
name: _position[index]?.positionName
|
||||
}))
|
||||
: [];
|
||||
const position = await AppDataSource.query("CALL GetProfileEmployeeSalaryPosition(?)", [
|
||||
profileId,
|
||||
]);
|
||||
const _position = position.length > 0 ? position[0] : [];
|
||||
const mapPosition =
|
||||
_position.length > 1
|
||||
? _position.slice(1).map((curr: any, index: number) => ({
|
||||
year: curr.Years ? Math.floor(Number(curr.Years)) : 0,
|
||||
month: curr.Months ? Math.floor(Number(curr.Months)) : 0,
|
||||
day: curr.Days ? Math.floor(Number(curr.Days)) : 0,
|
||||
name: _position[index]?.positionName,
|
||||
}))
|
||||
: [];
|
||||
|
||||
const posLevel = [{
|
||||
year: 3,
|
||||
month: 0,
|
||||
day: 0,
|
||||
name: "ส 1",
|
||||
}];
|
||||
|
||||
const posLevel: any = [
|
||||
// {
|
||||
// year: 3,
|
||||
// month: 0,
|
||||
// day: 0,
|
||||
// name: "ส 1",
|
||||
// }
|
||||
];
|
||||
return new HttpSuccess({
|
||||
position: mapPosition,
|
||||
posLevel: posLevel
|
||||
posLevel: posLevel,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue