แก้ค้นหาคนครอง

This commit is contained in:
Kittapath 2024-03-19 12:24:29 +07:00
parent 6ba3236994
commit 9c7072c128
3 changed files with 9 additions and 4 deletions

View file

@ -1996,6 +1996,7 @@ export class EmployeePositionController extends Controller {
dataMaster.isSit = requestBody.isSit;
dataMaster.current_holderId = requestBody.profileId;
dataMaster.next_holderId = requestBody.profileId;
await this.employeePosMasterRepository.save(dataMaster);
return new HttpSuccess();

View file

@ -384,8 +384,10 @@ export class ProfileController extends Controller {
)
.andWhere(
new Brackets((qb) => {
qb.where("next_holders.id IS NULL").orWhere("next_holders.id NOT IN (:...ids)", {
ids: orgRevision.posMasters.map((x) => x.next_holderId),
qb.where("profile.id NOT IN (:...ids)", {
ids: orgRevision.posMasters
.filter((x) => x.next_holderId != null)
.map((x) => x.next_holderId),
});
}),
)

View file

@ -379,8 +379,10 @@ export class ProfileEmployeeController extends Controller {
)
.andWhere(
new Brackets((qb) => {
qb.where("next_holders.id IS NULL").orWhere("next_holders.id NOT IN (:...ids)", {
ids: orgRevision.posMasters.map((x) => x.next_holderId),
qb.where("profile.id NOT IN (:...ids)", {
ids: orgRevision.posMasters
.filter((x) => x.next_holderId != null)
.map((x) => x.next_holderId),
});
}),
)