list รายชื่อ workflow
This commit is contained in:
parent
0b5fae46cf
commit
e570339e1a
1 changed files with 28 additions and 22 deletions
|
|
@ -800,27 +800,28 @@ export class WorkflowController extends Controller {
|
|||
keyword: string;
|
||||
page: number;
|
||||
pageSize: number;
|
||||
profileId?: string | null;
|
||||
},
|
||||
) {
|
||||
let userId = "";
|
||||
// if (xxx) {
|
||||
// } else {
|
||||
// const posMasterUser = await this.posMasterRepo.findOne({
|
||||
// where: {
|
||||
// orgRevision: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
||||
// current_holder: { keycloak: request.user.sub },
|
||||
// },
|
||||
// relations: ["current_holder", "current_holder.posType", "current_holder.posLevel"],
|
||||
// });
|
||||
// }
|
||||
let posMasterUser: PosMaster = new PosMaster();
|
||||
if (body.profileId) {
|
||||
posMasterUser = (await this.posMasterRepo.findOne({
|
||||
where: {
|
||||
orgRevision: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
||||
current_holderId: body.profileId,
|
||||
},
|
||||
relations: ["current_holder", "current_holder.posType", "current_holder.posLevel"],
|
||||
})) as PosMaster;
|
||||
} else {
|
||||
posMasterUser = (await this.posMasterRepo.findOne({
|
||||
where: {
|
||||
orgRevision: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
||||
current_holder: { keycloak: request.user.sub },
|
||||
},
|
||||
relations: ["current_holder", "current_holder.posType", "current_holder.posLevel"],
|
||||
})) as PosMaster;
|
||||
}
|
||||
|
||||
const posMasterUser = await this.posMasterRepo.findOne({
|
||||
where: {
|
||||
orgRevision: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
||||
current_holder: { keycloak: request.user.sub },
|
||||
},
|
||||
relations: ["current_holder", "current_holder.posType", "current_holder.posLevel"],
|
||||
});
|
||||
if (!posMasterUser || !posMasterUser.orgRootId)
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบตำแหน่งผู้ใช้งาน");
|
||||
|
||||
|
|
@ -846,10 +847,15 @@ export class WorkflowController extends Controller {
|
|||
// orgChild3Id: IsNull(),
|
||||
// orgChild4Id: IsNull(),
|
||||
};
|
||||
condition.orgChild1Id = IsNull();
|
||||
condition.orgChild2Id = IsNull();
|
||||
condition.orgChild3Id = IsNull();
|
||||
condition.orgChild4Id = IsNull();
|
||||
if (posMasterUser.orgChild4Id == null) {
|
||||
condition.orgChild4Id = IsNull();
|
||||
} else if (posMasterUser.orgChild3Id == null) {
|
||||
condition.orgChild3Id = IsNull();
|
||||
} else if (posMasterUser.orgChild2Id == null) {
|
||||
condition.orgChild2Id = IsNull();
|
||||
} else if (posMasterUser.orgChild1Id == null) {
|
||||
condition.orgChild1Id = IsNull();
|
||||
}
|
||||
} else {
|
||||
if (
|
||||
(posMasterUser.current_holder.posType.posTypeName == "ทั่วไป" &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue