เพิ่มฟิลด์ employeePosLevel.posLevelAuthority
This commit is contained in:
parent
ac1599485a
commit
a069c81d41
3 changed files with 37 additions and 5 deletions
|
|
@ -167,7 +167,7 @@ export class EmployeePosLevelController extends Controller {
|
|||
async GetEmpLevelById(@Path() id: string) {
|
||||
const getEmpPosLevel = await this.employeePosLevelRepository.findOne({
|
||||
relations: ["posType"],
|
||||
select: ["id", "posLevelName", "posLevelRank"],
|
||||
select: ["id", "posLevelName", "posLevelRank", "posLevelAuthority"],
|
||||
where: { id: id },
|
||||
});
|
||||
if (!getEmpPosLevel) {
|
||||
|
|
@ -178,7 +178,7 @@ export class EmployeePosLevelController extends Controller {
|
|||
posLevelName: getEmpPosLevel.posLevelName,
|
||||
posTypeId: getEmpPosLevel.posType == null ? null : getEmpPosLevel.posType.id,
|
||||
posTypeName: getEmpPosLevel.posType == null ? null : getEmpPosLevel.posType.posTypeName, //กลุ่มงาน
|
||||
commander: null, //ผู้มีอำนาจสั่งบรรจุ
|
||||
posLevelAuthority: getEmpPosLevel.posLevelAuthority, //ผู้มีอำนาจสั่งบรรจุ
|
||||
};
|
||||
return new HttpSuccess(mapEmpPosLevel);
|
||||
}
|
||||
|
|
@ -193,14 +193,14 @@ export class EmployeePosLevelController extends Controller {
|
|||
async GetEmpPosLevel() {
|
||||
const empPosLevel = await this.employeePosLevelRepository.find({
|
||||
relations: ["posType"],
|
||||
select: ["id", "posLevelName", "posLevelRank"],
|
||||
select: ["id", "posLevelName", "posLevelRank", "posLevelAuthority"],
|
||||
});
|
||||
const mapEmpPosLevel = empPosLevel.map((item) => ({
|
||||
id: item.id,
|
||||
posLevelName: item.posLevelName,
|
||||
posTypeId: item.posType == null ? null : item.posType.id,
|
||||
posTypeName: item.posType == null ? null : item.posType.posTypeName, //กลุ่มงาน
|
||||
commander: null, //ผู้มีอำนาจสั่งบรรจุ
|
||||
posLevelAuthority: item.posLevelAuthority, //ผู้มีอำนาจสั่งบรรจุ
|
||||
}));
|
||||
return new HttpSuccess(mapEmpPosLevel);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue