ปรับระดับชั้นงานตาม ui
This commit is contained in:
parent
2455f4a7d2
commit
3e278b173c
1 changed files with 16 additions and 4 deletions
|
|
@ -163,14 +163,20 @@ export class EmployeePosLevelController extends Controller {
|
||||||
@Get("{id}")
|
@Get("{id}")
|
||||||
async GetEmpLevelById(@Path() id: string) {
|
async GetEmpLevelById(@Path() id: string) {
|
||||||
const getEmpPosLevel = await this.employeePosLevelRepository.findOne({
|
const getEmpPosLevel = await this.employeePosLevelRepository.findOne({
|
||||||
|
relations: ["employeePosType"],
|
||||||
select: ["id", "posLevelName", "posLevelRank",],
|
select: ["id", "posLevelName", "posLevelRank",],
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
});
|
});
|
||||||
if (!getEmpPosLevel) {
|
if (!getEmpPosLevel) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลระดับชั้นงานลูกจ้างประจำนี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลระดับชั้นงานลูกจ้างประจำนี้");
|
||||||
}
|
}
|
||||||
|
const mapEmpPosLevel = {
|
||||||
return new HttpSuccess(getEmpPosLevel);
|
id: getEmpPosLevel.id,
|
||||||
|
posLevelName: getEmpPosLevel.posLevelName,
|
||||||
|
posTypeName: getEmpPosLevel.employeePosType == null ? null : getEmpPosLevel.employeePosType.posTypeName, //กลุ่มงาน
|
||||||
|
commander: null //ผู้มีอำนาจสั่งบรรจุ
|
||||||
|
}
|
||||||
|
return new HttpSuccess(mapEmpPosLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -182,9 +188,15 @@ export class EmployeePosLevelController extends Controller {
|
||||||
@Get()
|
@Get()
|
||||||
async GetEmpPosLevel() {
|
async GetEmpPosLevel() {
|
||||||
const empPosLevel = await this.employeePosLevelRepository.find({
|
const empPosLevel = await this.employeePosLevelRepository.find({
|
||||||
|
relations: ["employeePosType"],
|
||||||
select: ["id","posLevelName", "posLevelRank",],
|
select: ["id","posLevelName", "posLevelRank",],
|
||||||
});
|
});
|
||||||
|
const mapEmpPosLevel = empPosLevel.map((item) => ({
|
||||||
return new HttpSuccess(empPosLevel);
|
id: item.id,
|
||||||
|
posLevelName: item.posLevelName,
|
||||||
|
posTypeName: item.employeePosType == null ? null : item.employeePosType.posTypeName, //กลุ่มงาน
|
||||||
|
commander: null //ผู้มีอำนาจสั่งบรรจุ
|
||||||
|
}));
|
||||||
|
return new HttpSuccess(mapEmpPosLevel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue