Merge branch 'develop' of github.com:Frappet/bma-ehr-organization into develop

This commit is contained in:
Kittapath 2024-02-06 12:01:23 +07:00
commit 53621bbef1
4 changed files with 84 additions and 14 deletions

View file

@ -712,7 +712,15 @@ export class PositionController extends Controller {
const [posMaster, total] = await this.posMasterRepository.findAndCount({
where: keywordConditions,
order: { posMasterOrder: "ASC" },
relations: ["orgRoot", "orgChild1", "orgChild2", "orgChild3", "orgChild4"],
relations: [
"orgRoot",
"orgChild1",
"orgChild2",
"orgChild3",
"orgChild4",
"current_holder",
"next_holder",
],
skip: (body.page - 1) * body.pageSize,
take: body.pageSize,
});
@ -736,6 +744,16 @@ export class PositionController extends Controller {
posMasterNoPrefix: posMaster.posMasterNoPrefix,
posMasterNo: posMaster.posMasterNo,
posMasterNoSuffix: posMaster.posMasterNoSuffix,
fullNameNextHolder:
posMaster.current_holder.prefix +
posMaster.current_holder.firstName +
" " +
posMaster.current_holder.lastName,
fullNameCurrentHolder:
posMaster.next_holder.prefix +
posMaster.next_holder.firstName +
" " +
posMaster.next_holder.lastName,
orgShortname:
body.type === 0
? posMaster.orgRoot.orgRootShortName