#1409 แก้เป็นส่ง refId ของคำสั่งขอลาออกไปค้นที่ command ก่อนอัพ status = CANCEL
This commit is contained in:
parent
c5b54d55de
commit
3961488b91
1 changed files with 29 additions and 0 deletions
|
|
@ -3466,6 +3466,7 @@ export class CommandController extends Controller {
|
||||||
orgChild2New?: string | null;
|
orgChild2New?: string | null;
|
||||||
orgChild3New?: string | null;
|
orgChild3New?: string | null;
|
||||||
orgChild4New?: string | null;
|
orgChild4New?: string | null;
|
||||||
|
resignId?: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -3530,6 +3531,19 @@ export class CommandController extends Controller {
|
||||||
if (code && ["C-PM-08", "C-PM-17", "C-PM-18"].includes(code)) {
|
if (code && ["C-PM-08", "C-PM-17", "C-PM-18"].includes(code)) {
|
||||||
removePostMasterAct(profile.id);
|
removePostMasterAct(profile.id);
|
||||||
}
|
}
|
||||||
|
//ออกคำสั่งยกเลิกลาออกต้องอัพเดทสถานะคำสั่งลาออกเป็น CANCEL
|
||||||
|
else if (item.resignId && code && ["C-PM-41"].includes(code)) {
|
||||||
|
const commandRecive = await this.commandReciveRepository.findOne({
|
||||||
|
select: ["commandId"],
|
||||||
|
where: { refId: item.resignId },
|
||||||
|
});
|
||||||
|
if (commandRecive && commandRecive.commandId) {
|
||||||
|
await this.commandRepository.update(
|
||||||
|
{ id: commandRecive?.commandId },
|
||||||
|
{ status: "CANCEL" }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
let _commandYear = item.commandYear;
|
let _commandYear = item.commandYear;
|
||||||
if (item.commandYear) {
|
if (item.commandYear) {
|
||||||
_commandYear = item.commandYear > 2500 ? item.commandYear : item.commandYear + 543;
|
_commandYear = item.commandYear > 2500 ? item.commandYear : item.commandYear + 543;
|
||||||
|
|
@ -3796,6 +3810,7 @@ export class CommandController extends Controller {
|
||||||
commandCode?: string | null;
|
commandCode?: string | null;
|
||||||
commandName?: string | null;
|
commandName?: string | null;
|
||||||
remark: string | null;
|
remark: string | null;
|
||||||
|
resignId: string | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -3851,6 +3866,20 @@ export class CommandController extends Controller {
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
||||||
}
|
}
|
||||||
|
const code = _command?.commandType?.code;
|
||||||
|
//ออกคำสั่งยกเลิกลาออกต้องอัพเดทสถานะคำสั่งลาออกเป็น CANCEL
|
||||||
|
if (item.resignId && code && ["C-PM-42"].includes(code)) {
|
||||||
|
const commandRecive = await this.commandReciveRepository.findOne({
|
||||||
|
select: ["commandId"],
|
||||||
|
where: { refId: item.resignId },
|
||||||
|
});
|
||||||
|
if (commandRecive && commandRecive.commandId) {
|
||||||
|
await this.commandRepository.update(
|
||||||
|
{ id: commandRecive?.commandId },
|
||||||
|
{ status: "CANCEL" }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
let _commandYear = item.commandYear;
|
let _commandYear = item.commandYear;
|
||||||
if (item.commandYear) {
|
if (item.commandYear) {
|
||||||
_commandYear = item.commandYear > 2500 ? item.commandYear : item.commandYear + 543;
|
_commandYear = item.commandYear > 2500 ? item.commandYear : item.commandYear + 543;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue