add Officer view

This commit is contained in:
kittapath 2025-01-22 15:15:29 +07:00
parent 99c1ead9a1
commit debf24e5bc
3 changed files with 25 additions and 2 deletions

View file

@ -815,6 +815,13 @@ export class WorkflowController extends Controller {
let condition: any = {
isDirector: true,
orgRootId: posMasterUser.orgRootId,
orgRevisionId: posMasterUser.orgRevisionId,
};
let conditionOfficer: any = {
isDirector: true,
isOfficer: true,
orgRevisionId: posMasterUser.orgRevisionId,
};
if (type.trim().toUpperCase() == "OPERATE") {
@ -832,6 +839,7 @@ export class WorkflowController extends Controller {
condition = {
isDirector: true,
orgRootId: posMasterUser.orgRootId,
orgRevisionId: posMasterUser.orgRevisionId,
orgChild1Id: IsNull(),
orgChild2Id: IsNull(),
orgChild3Id: IsNull(),
@ -848,6 +856,7 @@ export class WorkflowController extends Controller {
condition = {
isDirector: true,
isDeputy: true,
orgRevisionId: posMasterUser.orgRevisionId,
orgChild1Id: IsNull(),
orgChild2Id: IsNull(),
orgChild3Id: IsNull(),
@ -860,7 +869,11 @@ export class WorkflowController extends Controller {
if (body.isAct == true) {
const [lists, total] = await AppDataSource.getRepository(viewDirectorActing)
.createQueryBuilder("viewDirectorActing")
.andWhere(condition)
.andWhere(
new Brackets((qb) => {
qb.orWhere(condition).orWhere(conditionOfficer);
}),
)
.andWhere(
new Brackets((qb) => {
qb.orWhere(
@ -936,7 +949,11 @@ export class WorkflowController extends Controller {
} else {
const [lists, total] = await AppDataSource.getRepository(viewDirector)
.createQueryBuilder("viewDirector")
.andWhere(condition)
.andWhere(
new Brackets((qb) => {
qb.orWhere(condition).orWhere(conditionOfficer);
}),
)
.andWhere(
new Brackets((qb) => {
qb.orWhere(