แต่งตั้ง ย้ายแก้ไขเงื่อนไขการ search ตำแหน่ง #2554
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m5s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m5s
This commit is contained in:
parent
bba6754eeb
commit
0a874798bd
1 changed files with 11 additions and 2 deletions
|
|
@ -4434,6 +4434,7 @@ export class PositionController extends Controller {
|
||||||
typeCommand: string | null;
|
typeCommand: string | null;
|
||||||
posType?: string | null;
|
posType?: string | null;
|
||||||
posLevel?: string | null;
|
posLevel?: string | null;
|
||||||
|
profileId?: string | null;
|
||||||
isAll: boolean;
|
isAll: boolean;
|
||||||
isBlank: boolean;
|
isBlank: boolean;
|
||||||
},
|
},
|
||||||
|
|
@ -4475,9 +4476,13 @@ export class PositionController extends Controller {
|
||||||
posLevel: posLevel?.id,
|
posLevel: posLevel?.id,
|
||||||
};
|
};
|
||||||
} else if (body.typeCommand == "APPOINT") {
|
} else if (body.typeCommand == "APPOINT") {
|
||||||
conditionA = "posType.posTypeRank > :posTypeRank";
|
// เดิม : กรองเฉพาะ posTypeRank ที่สูงกว่า
|
||||||
|
// conditionA = "posType.posTypeRank > :posTypeRank";
|
||||||
|
// ใหม่ : กรองเฉพาะ posType ที่สูงหรือต่ำกว่าก็ได้
|
||||||
|
conditionA = "positions.posTypeId != :currentPosType";
|
||||||
params = {
|
params = {
|
||||||
posTypeRank: posType?.posTypeRank ?? 0,
|
// posTypeRank: posType?.posTypeRank ?? 0,
|
||||||
|
currentPosType: posType?.id,
|
||||||
};
|
};
|
||||||
} else if (body.typeCommand == "SLIP") {
|
} else if (body.typeCommand == "SLIP") {
|
||||||
conditionA = "positions.posTypeId LIKE :posType AND posLevel.posLevelRank > :posLevelRank";
|
conditionA = "positions.posTypeId LIKE :posType AND posLevel.posLevelRank > :posLevelRank";
|
||||||
|
|
@ -4541,6 +4546,10 @@ export class PositionController extends Controller {
|
||||||
typeCondition.current_holderId = IsNull();
|
typeCondition.current_holderId = IsNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (body.typeCommand === "MOVE" && body.profileId && !body.isBlank) {
|
||||||
|
typeCondition.current_holderId = Not(body.profileId);
|
||||||
|
}
|
||||||
|
|
||||||
const [posMaster, total] = await AppDataSource.getRepository(PosMaster)
|
const [posMaster, total] = await AppDataSource.getRepository(PosMaster)
|
||||||
.createQueryBuilder("posMaster")
|
.createQueryBuilder("posMaster")
|
||||||
.leftJoinAndSelect("posMaster.orgRevision", "orgRevision")
|
.leftJoinAndSelect("posMaster.orgRevision", "orgRevision")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue