This commit is contained in:
kittapath 2025-01-08 18:57:01 +07:00
parent 7f037eb975
commit 3475224f36

View file

@ -1310,36 +1310,36 @@ export class ProfileController extends Controller {
orgRootId: posMaster.orgRootId,
id: Not(posMaster.current_holderId || ""),
};
let conditionNow: any = {
orgRootId: posMaster.orgRootId,
orgChild1Id: posMaster.orgChild1Id,
orgChild2Id: posMaster.orgChild2Id,
orgChild3Id: posMaster.orgChild3Id,
orgChild4Id: posMaster.orgChild4Id,
id: Not(posMaster.current_holderId),
};
if (posMaster.orgChild1Id == null) {
} else if (posMaster.orgChild2Id == null) {
condition.orgChild1Id = null;
} else if (posMaster.orgChild3Id == null) {
condition.orgChild2Id = null;
} else if (posMaster.orgChild4Id == null) {
condition.orgChild3Id = null;
} else {
condition.orgChild4Id = null;
}
// let conditionNow: any = {
// orgRootId: posMaster.orgRootId,
// orgChild1Id: posMaster.orgChild1Id,
// orgChild2Id: posMaster.orgChild2Id,
// orgChild3Id: posMaster.orgChild3Id,
// orgChild4Id: posMaster.orgChild4Id,
// id: Not(posMaster.current_holderId),
// };
// if (posMaster.orgChild1Id == null) {
// } else if (posMaster.orgChild2Id == null) {
// condition.orgChild1Id = null;
// } else if (posMaster.orgChild3Id == null) {
// condition.orgChild2Id = null;
// } else if (posMaster.orgChild4Id == null) {
// condition.orgChild3Id = null;
// } else {
// condition.orgChild4Id = null;
// }
if (body.isDirector == true) {
condition.isDirector = true;
conditionNow.isDirector = true;
// conditionNow.isDirector = true;
}
const [lists, total] = await AppDataSource.getRepository(viewDirectorActing)
.createQueryBuilder("viewDirectorActing")
// .andWhere(condition)
.andWhere(
new Brackets((qb) => {
qb.orWhere(condition).orWhere(conditionNow);
}),
)
.andWhere(condition)
// .andWhere(
// new Brackets((qb) => {
// qb.orWhere(condition).orWhere(conditionNow);
// }),
// )
.andWhere(
new Brackets((qb) => {
qb.orWhere(
@ -1426,37 +1426,37 @@ export class ProfileController extends Controller {
orgRootId: posMaster.orgRootId,
id: Not(posMaster.current_holderId || ""),
};
let conditionNow: any = {
orgRootId: posMaster.orgRootId,
orgChild1Id: posMaster.orgChild1Id,
orgChild2Id: posMaster.orgChild2Id,
orgChild3Id: posMaster.orgChild3Id,
orgChild4Id: posMaster.orgChild4Id,
id: Not(posMaster.current_holderId),
};
if (posMaster.orgChild1Id == null) {
condition.orgRootId = null;
} else if (posMaster.orgChild2Id == null) {
condition.orgChild1Id = null;
} else if (posMaster.orgChild3Id == null) {
condition.orgChild2Id = null;
} else if (posMaster.orgChild4Id == null) {
condition.orgChild3Id = null;
} else {
condition.orgChild4Id = null;
}
// let conditionNow: any = {
// orgRootId: posMaster.orgRootId,
// orgChild1Id: posMaster.orgChild1Id,
// orgChild2Id: posMaster.orgChild2Id,
// orgChild3Id: posMaster.orgChild3Id,
// orgChild4Id: posMaster.orgChild4Id,
// id: Not(posMaster.current_holderId),
// };
// if (posMaster.orgChild1Id == null) {
// condition.orgRootId = null;
// } else if (posMaster.orgChild2Id == null) {
// condition.orgChild1Id = null;
// } else if (posMaster.orgChild3Id == null) {
// condition.orgChild2Id = null;
// } else if (posMaster.orgChild4Id == null) {
// condition.orgChild3Id = null;
// } else {
// condition.orgChild4Id = null;
// }
if (body.isDirector == true) {
condition.isDirector = true;
conditionNow.isDirector = true;
// conditionNow.isDirector = true;
}
const [lists, total] = await AppDataSource.getRepository(viewDirectorActing)
.createQueryBuilder("viewDirectorActing")
// .andWhere(condition)
.andWhere(
new Brackets((qb) => {
qb.orWhere(condition).orWhere(conditionNow);
}),
)
.andWhere(condition)
// .andWhere(
// new Brackets((qb) => {
// qb.orWhere(condition).orWhere(conditionNow);
// }),
// )
.andWhere(
new Brackets((qb) => {
qb.orWhere(
@ -1518,37 +1518,37 @@ export class ProfileController extends Controller {
orgRootId: posMaster.orgRootId,
id: Not(posMaster.current_holderId || ""),
};
let conditionNow: any = {
orgRootId: posMaster.orgRootId,
orgChild1Id: posMaster.orgChild1Id,
orgChild2Id: posMaster.orgChild2Id,
orgChild3Id: posMaster.orgChild3Id,
orgChild4Id: posMaster.orgChild4Id,
id: Not(posMaster.current_holderId),
};
if (posMaster.orgChild1Id == null) {
condition.orgRootId = null;
} else if (posMaster.orgChild2Id == null) {
condition.orgChild1Id = null;
} else if (posMaster.orgChild3Id == null) {
condition.orgChild2Id = null;
} else if (posMaster.orgChild4Id == null) {
condition.orgChild3Id = null;
} else {
condition.orgChild4Id = null;
}
// let conditionNow: any = {
// orgRootId: posMaster.orgRootId,
// orgChild1Id: posMaster.orgChild1Id,
// orgChild2Id: posMaster.orgChild2Id,
// orgChild3Id: posMaster.orgChild3Id,
// orgChild4Id: posMaster.orgChild4Id,
// id: Not(posMaster.current_holderId),
// };
// if (posMaster.orgChild1Id == null) {
// condition.orgRootId = null;
// } else if (posMaster.orgChild2Id == null) {
// condition.orgChild1Id = null;
// } else if (posMaster.orgChild3Id == null) {
// condition.orgChild2Id = null;
// } else if (posMaster.orgChild4Id == null) {
// condition.orgChild3Id = null;
// } else {
// condition.orgChild4Id = null;
// }
if (body.isDirector == true) {
condition.isDirector = true;
conditionNow.isDirector = true;
// conditionNow.isDirector = true;
}
const [lists, total] = await AppDataSource.getRepository(viewDirector)
.createQueryBuilder("viewDirector")
// .andWhere(condition)
.andWhere(
new Brackets((qb) => {
qb.orWhere(condition).orWhere(conditionNow);
}),
)
.andWhere(condition)
// .andWhere(
// new Brackets((qb) => {
// qb.orWhere(condition).orWhere(conditionNow);
// }),
// )
.andWhere(
new Brackets((qb) => {
qb.orWhere(