ปรับระดับชั้นงานตาม 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}")
|
||||
async GetEmpLevelById(@Path() id: string) {
|
||||
const getEmpPosLevel = await this.employeePosLevelRepository.findOne({
|
||||
relations: ["employeePosType"],
|
||||
select: ["id", "posLevelName", "posLevelRank",],
|
||||
where: { id: id },
|
||||
});
|
||||
if (!getEmpPosLevel) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลระดับชั้นงานลูกจ้างประจำนี้");
|
||||
}
|
||||
|
||||
return new HttpSuccess(getEmpPosLevel);
|
||||
const mapEmpPosLevel = {
|
||||
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()
|
||||
async GetEmpPosLevel() {
|
||||
const empPosLevel = await this.employeePosLevelRepository.find({
|
||||
relations: ["employeePosType"],
|
||||
select: ["id","posLevelName", "posLevelRank",],
|
||||
});
|
||||
|
||||
return new HttpSuccess(empPosLevel);
|
||||
const mapEmpPosLevel = empPosLevel.map((item) => ({
|
||||
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