no message

This commit is contained in:
kittapath 2024-12-26 19:35:39 +07:00
parent 21e238502a
commit 3fb223f992

View file

@ -1780,8 +1780,7 @@ export class CommandController extends Controller {
},
select: ["orgRootId"],
});
}
else {
} else {
posMaster = await this.posMasterRepository.find({
where: {
current_holderId: In(requestBody.persons.map((x) => x.profileId)),
@ -1790,12 +1789,12 @@ export class CommandController extends Controller {
select: ["orgRootId"],
});
}
let _posMaster: any;
if (["C-PM-38", "C-PM-40"].includes(commandCode)) {
_posMaster = await this.posMasterRepository.find({
where: {
orgRootId: In(posMaster.map((x:any) => x.orgRootId)),
orgRootId: In(posMaster.map((x: any) => x.orgRootId)),
orgChild1: IsNull(),
orgChild2: IsNull(),
orgChild3: IsNull(),
@ -1809,7 +1808,7 @@ export class CommandController extends Controller {
} else {
_posMaster = await this.posMasterRepository.find({
where: {
orgRootId: In(posMaster.map((x:any) => x.orgRootId)),
orgRootId: In(posMaster.map((x: any) => x.orgRootId)),
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
isDirector: true,
current_holderId: Not(IsNull()),
@ -4166,28 +4165,28 @@ export class CommandController extends Controller {
history.profileSalaryId = data.id;
await this.salaryHistoryRepo.save(history, { data: req });
if (profile != null) {
profile.position = position?.positionName ?? "";
profile.posTypeId = position?.posTypeId ?? "";
profile.posLevelId = position?.posLevelId ?? "";
profile.lastUpdateUserId = req.user.sub;
profile.lastUpdateFullName = req.user.name;
profile.lastUpdatedAt = new Date();
await this.profileRepository.save(profile);
}
// if (profile != null) {
// profile.position = position?.positionName ?? "";
// profile.posTypeId = position?.posTypeId ?? "";
// profile.posLevelId = position?.posLevelId ?? "";
// profile.lastUpdateUserId = req.user.sub;
// profile.lastUpdateFullName = req.user.name;
// profile.lastUpdatedAt = new Date();
// await this.profileRepository.save(profile);
// }
}
}),
);
const posMasters = await this.posMasterRepository.find({
where: { id: In(body.refIds.map((x) => x.refId)) },
});
const data = posMasters.map((_data) => ({
..._data,
current_holderId: _data.next_holderId,
next_holderId: null,
statusReport: "PENDING",
}));
await this.posMasterRepository.save(data);
// const posMasters = await this.posMasterRepository.find({
// where: { id: In(body.refIds.map((x) => x.refId)) },
// });
// const data = posMasters.map((_data) => ({
// ..._data,
// current_holderId: _data.next_holderId,
// next_holderId: null,
// statusReport: "PENDING",
// }));
// await this.posMasterRepository.save(data);
return new HttpSuccess();
}