no message
This commit is contained in:
parent
9b2cd6d3e3
commit
8662afa75d
1 changed files with 49 additions and 28 deletions
|
|
@ -2922,18 +2922,18 @@ export class OrganizationDotnetController extends Controller {
|
||||||
: null;
|
: null;
|
||||||
const Oc =
|
const Oc =
|
||||||
item.current_holders.length == 0
|
item.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
: body.node == 4 && item.current_holders[0].orgChild4 != null
|
: body.node == 4 && item.current_holders[0].orgChild4 != null
|
||||||
? `${item.current_holders[0].orgChild4.orgChild4Name}/${item.current_holders[0].orgChild3.orgChild3Name}/${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}`
|
? `${item.current_holders[0].orgChild4.orgChild4Name}/${item.current_holders[0].orgChild3.orgChild3Name}/${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}`
|
||||||
: body.node == 3 && item.current_holders[0].orgChild3 != null
|
: body.node == 3 && item.current_holders[0].orgChild3 != null
|
||||||
? `${item.current_holders[0].orgChild3.orgChild3Name}/${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}`
|
? `${item.current_holders[0].orgChild3.orgChild3Name}/${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}`
|
||||||
: body.node == 2 && item.current_holders[0].orgChild2 != null
|
: body.node == 2 && item.current_holders[0].orgChild2 != null
|
||||||
? `${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}`
|
? `${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}`
|
||||||
: body.node == 1 && item.current_holders[0].orgChild1 != null
|
: body.node == 1 && item.current_holders[0].orgChild1 != null
|
||||||
? `${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}`
|
? `${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}`
|
||||||
: body.node == 0 && item.current_holders[0].orgRoot != null
|
: body.node == 0 && item.current_holders[0].orgRoot != null
|
||||||
? `${item.current_holders[0].orgRoot.orgRootName}`
|
? `${item.current_holders[0].orgRoot.orgRootName}`
|
||||||
: null;
|
: null;
|
||||||
return {
|
return {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
prefix: item.prefix,
|
prefix: item.prefix,
|
||||||
|
|
@ -2944,7 +2944,7 @@ export class OrganizationDotnetController extends Controller {
|
||||||
position: item.position,
|
position: item.position,
|
||||||
positionLevel: item.posLevel?.posLevelName ?? null,
|
positionLevel: item.posLevel?.posLevelName ?? null,
|
||||||
positionType: item.posType?.posTypeName ?? null,
|
positionType: item.posType?.posTypeName ?? null,
|
||||||
oc: Oc
|
oc: Oc,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
@ -3065,18 +3065,18 @@ export class OrganizationDotnetController extends Controller {
|
||||||
: null;
|
: null;
|
||||||
const Oc =
|
const Oc =
|
||||||
item.current_holders.length == 0
|
item.current_holders.length == 0
|
||||||
? null
|
? null
|
||||||
: body.node == 4 && item.current_holders[0].orgChild4 != null
|
: body.node == 4 && item.current_holders[0].orgChild4 != null
|
||||||
? `${item.current_holders[0].orgChild4.orgChild4Name}/${item.current_holders[0].orgChild3.orgChild3Name}/${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}`
|
? `${item.current_holders[0].orgChild4.orgChild4Name}/${item.current_holders[0].orgChild3.orgChild3Name}/${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}`
|
||||||
: body.node == 3 && item.current_holders[0].orgChild3 != null
|
: body.node == 3 && item.current_holders[0].orgChild3 != null
|
||||||
? `${item.current_holders[0].orgChild3.orgChild3Name}/${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}`
|
? `${item.current_holders[0].orgChild3.orgChild3Name}/${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}`
|
||||||
: body.node == 2 && item.current_holders[0].orgChild2 != null
|
: body.node == 2 && item.current_holders[0].orgChild2 != null
|
||||||
? `${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}`
|
? `${item.current_holders[0].orgChild2.orgChild2Name}/${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}`
|
||||||
: body.node == 1 && item.current_holders[0].orgChild1 != null
|
: body.node == 1 && item.current_holders[0].orgChild1 != null
|
||||||
? `${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}`
|
? `${item.current_holders[0].orgChild1.orgChild1Name}/${item.current_holders[0].orgRoot.orgRootName}`
|
||||||
: body.node == 0 && item.current_holders[0].orgRoot != null
|
: body.node == 0 && item.current_holders[0].orgRoot != null
|
||||||
? `${item.current_holders[0].orgRoot.orgRootName}`
|
? `${item.current_holders[0].orgRoot.orgRootName}`
|
||||||
: null;
|
: null;
|
||||||
return {
|
return {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
prefix: item.prefix,
|
prefix: item.prefix,
|
||||||
|
|
@ -3088,7 +3088,7 @@ export class OrganizationDotnetController extends Controller {
|
||||||
position: item.position,
|
position: item.position,
|
||||||
positionLevel: item.posLevel?.posLevelName ?? null,
|
positionLevel: item.posLevel?.posLevelName ?? null,
|
||||||
positionType: item.posType?.posTypeName ?? null,
|
positionType: item.posType?.posTypeName ?? null,
|
||||||
oc: Oc
|
oc: Oc,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
@ -3191,4 +3191,25 @@ export class OrganizationDotnetController extends Controller {
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2. API ข้อมูลหน่วยงานตามโครงสร้าง
|
||||||
|
*
|
||||||
|
* @summary 2. API ข้อมูลหน่วยงานตามโครงสร้าง
|
||||||
|
*
|
||||||
|
* @param {string} id Id หน่วยงาน
|
||||||
|
*/
|
||||||
|
@Get("email/{id}")
|
||||||
|
async GetEmailById(@Path() id: string) {
|
||||||
|
const profile = await this.profileRepo.findOne({
|
||||||
|
where: { id: id },
|
||||||
|
});
|
||||||
|
if (profile != null) return new HttpSuccess(profile.email);
|
||||||
|
const profileEmp = await this.profileEmpRepo.findOne({
|
||||||
|
where: { id: id },
|
||||||
|
});
|
||||||
|
if (profileEmp != null) return new HttpSuccess(profileEmp.email);
|
||||||
|
|
||||||
|
return new HttpSuccess(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue