#208 and update migration

This commit is contained in:
Adisak 2025-11-07 13:57:03 +07:00
parent 7d5d6bb43e
commit 13ed3450dd
3 changed files with 11 additions and 5 deletions

View file

@ -2886,8 +2886,8 @@ export class ProfileController extends Controller {
} else if ((posMaster?.current_holder?.posLevel?.posLevelAuthority ?? null) == "GOVERNOR") { } else if ((posMaster?.current_holder?.posLevel?.posLevelAuthority ?? null) == "GOVERNOR") {
return new HttpSuccess({ data: [], total: 0 }); return new HttpSuccess({ data: [], total: 0 });
} }
console.log(posMaster); // console.log(posMaster);
console.log(posMaster.id); // console.log(posMaster.id);
let condition: any = { let condition: any = {
orgRootId: posMaster.orgRootId, orgRootId: posMaster.orgRootId,
id: Not(posMaster.current_holderId || ""), id: Not(posMaster.current_holderId || ""),
@ -2917,9 +2917,9 @@ export class ProfileController extends Controller {
condition.isDirector = true; condition.isDirector = true;
conditionNow.isDirector = true; conditionNow.isDirector = true;
} }
console.log(condition); // console.log(condition);
console.log("------------------"); // console.log("------------------");
console.log(conditionNow); // console.log(conditionNow);
if (body.isAct == true) { if (body.isAct == true) {
const [lists, total] = await AppDataSource.getRepository(viewDirectorActing) const [lists, total] = await AppDataSource.getRepository(viewDirectorActing)
.createQueryBuilder("viewDirectorActing") .createQueryBuilder("viewDirectorActing")
@ -2928,6 +2928,7 @@ export class ProfileController extends Controller {
qb.orWhere(condition).orWhere(conditionNow); qb.orWhere(condition).orWhere(conditionNow);
}), }),
) )
.andWhere("viewDirectorActing.isProbation = :isProbation", { isProbation: false })
.andWhere( .andWhere(
new Brackets((qb) => { new Brackets((qb) => {
qb.orWhere( qb.orWhere(
@ -2992,6 +2993,7 @@ export class ProfileController extends Controller {
qb.orWhere(condition).orWhere(conditionNow); qb.orWhere(condition).orWhere(conditionNow);
}), }),
) )
.andWhere("viewDirectorActing.isProbation = :isProbation", { isProbation: false })
.andWhere( .andWhere(
new Brackets((qb) => { new Brackets((qb) => {
qb.orWhere( qb.orWhere(

View file

@ -8,6 +8,8 @@ import { ViewColumn, ViewEntity } from "typeorm";
profile.lastName AS lastName, profile.lastName AS lastName,
profile.citizenId AS citizenId, profile.citizenId AS citizenId,
profile.position AS position, profile.position AS position,
profile.keycloak AS keycloakId,
profile.isProbation AS isProbation,
CONCAT( CONCAT(
CASE CASE
WHEN posMaster.orgChild1Id IS NULL THEN orgRoot.orgRootShortName WHEN posMaster.orgChild1Id IS NULL THEN orgRoot.orgRootShortName

View file

@ -73,6 +73,8 @@ export class UpdateViewDirectiorAndViewDirectiorActing1762489522691 implements M
profile.lastName AS lastName, profile.lastName AS lastName,
profile.citizenId AS citizenId, profile.citizenId AS citizenId,
profile.position AS position, profile.position AS position,
profile.keycloak AS keycloakId,
profile.isProbation AS isProbation,
CONCAT( CONCAT(
CASE CASE
WHEN posMaster.orgChild1Id IS NULL THEN orgRoot.orgRootShortName WHEN posMaster.orgChild1Id IS NULL THEN orgRoot.orgRootShortName