Merge branch 'main' into develop

This commit is contained in:
mamoss 2025-05-14 15:03:35 +07:00
commit e1ff9e6103
2 changed files with 17 additions and 22 deletions

View file

@ -7170,6 +7170,7 @@ export class OrganizationController extends Controller {
return { return {
orgTreeId: orgRoot.id, orgTreeId: orgRoot.id,
orgLevel: 0, orgLevel: 0,
isDeputy: orgRoot.isDeputy,
orgName: orgRoot.orgRootName, orgName: orgRoot.orgRootName,
orgTreeName: orgRoot.orgRootName, orgTreeName: orgRoot.orgRootName,
orgTreeShortName: orgRoot.orgRootShortName, orgTreeShortName: orgRoot.orgRootShortName,

View file

@ -50,7 +50,7 @@ export class WorkflowController extends Controller {
sysName: string; sysName: string;
posLevelName: string; posLevelName: string;
posTypeName: string; posTypeName: string;
fullName?: string|null fullName?: string | null;
}, },
) { ) {
let profileType = "OFFICER"; let profileType = "OFFICER";
@ -1103,7 +1103,7 @@ export class WorkflowController extends Controller {
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
current_holderId: profile.id, current_holderId: profile.id,
}, },
relations: ["orgChild1"], relations: ["orgChild1", "orgRoot"],
}); });
const profileDirector = await this.posMasterRepo.findOne({ const profileDirector = await this.posMasterRepo.findOne({
where: { where: {
@ -1116,12 +1116,14 @@ export class WorkflowController extends Controller {
isOfficer: false, isOfficer: false,
isStaff: false, isStaff: false,
isDirector: profileDirector?.isDirector ?? false, isDirector: profileDirector?.isDirector ?? false,
isDeputy: false,
}); });
let isOfficer = profileOfficer.orgChild1 == null ? false : profileOfficer.orgChild1.isOfficer; let isOfficer = profileOfficer.orgChild1 == null ? false : profileOfficer.orgChild1.isOfficer;
return new HttpSuccess({ return new HttpSuccess({
isOfficer: isOfficer, isOfficer: isOfficer,
isStaff: !isOfficer, isStaff: !isOfficer,
isDirector: profileDirector?.isDirector ?? false, isDirector: profileDirector?.isDirector ?? false,
isDeputy: profileOfficer?.orgRoot?.isDeputy ?? false,
}); });
} }
@ -1265,7 +1267,6 @@ export class WorkflowController extends Controller {
refId: string[]; refId: string[];
}, },
) { ) {
const _posMaster = await this.posMasterRepo.find({ const _posMaster = await this.posMasterRepo.find({
where: { where: {
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true }, orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
@ -1315,12 +1316,11 @@ export class WorkflowController extends Controller {
refId: string[]; refId: string[];
}, },
) { ) {
const profileWithKc = await this.profileRepo.find({ const profileWithKc = await this.profileRepo.find({
where:{ where: {
keycloak: In(body.refId) keycloak: In(body.refId),
} },
}) });
const profileIds = profileWithKc.map((p) => p.id); const profileIds = profileWithKc.map((p) => p.id);
@ -1332,14 +1332,8 @@ export class WorkflowController extends Controller {
}, },
current_holderId: In(profileIds), current_holderId: In(profileIds),
}, },
select: [ select: ["orgRootId", "orgChild1Id", "orgChild2Id", "orgChild3Id", "orgChild4Id"],
"orgRootId", });
"orgChild1Id",
"orgChild2Id",
"orgChild3Id",
"orgChild4Id",
],
})
const _data: any = _posMaster.map((x) => ({ const _data: any = _posMaster.map((x) => ({
orgRootId: x.orgRootId, orgRootId: x.orgRootId,