create cornjob retire
This commit is contained in:
parent
f4256117ef
commit
8fa3b89b14
1 changed files with 14 additions and 8 deletions
|
|
@ -1559,6 +1559,12 @@ export class CommandController extends Controller {
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("cornjob/cronjobUpdateRetirementStatus")
|
||||||
|
async runCronjobUpdateRetirementStatus() {
|
||||||
|
await this.cronjobUpdateRetirementStatus();
|
||||||
|
return new HttpSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API รายละเอียดรายการคำสั่ง tab4 คำสั่ง
|
* API รายละเอียดรายการคำสั่ง tab4 คำสั่ง
|
||||||
*
|
*
|
||||||
|
|
@ -3541,19 +3547,19 @@ export class CommandController extends Controller {
|
||||||
profile.lastUpdateFullName = req.user.name;
|
profile.lastUpdateFullName = req.user.name;
|
||||||
profile.lastUpdatedAt = new Date();
|
profile.lastUpdatedAt = new Date();
|
||||||
const clearProfile = await checkCommandType(String(item.commandId));
|
const clearProfile = await checkCommandType(String(item.commandId));
|
||||||
|
|
||||||
//ปั๊มประวัติก่อนลบตำแหน่ง
|
//ปั๊มประวัติก่อนลบตำแหน่ง
|
||||||
const curRevision = await this.orgRevisionRepo.findOne({
|
const curRevision = await this.orgRevisionRepo.findOne({
|
||||||
where: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false }
|
where: { orgRevisionIsCurrent: true, orgRevisionIsDraft: false },
|
||||||
})
|
});
|
||||||
|
|
||||||
if(curRevision){
|
if (curRevision) {
|
||||||
const curPosMaster = await this.posMasterRepository.findOne({
|
const curPosMaster = await this.posMasterRepository.findOne({
|
||||||
where:{
|
where: {
|
||||||
current_holderId: profile.id,
|
current_holderId: profile.id,
|
||||||
orgRevisionId: curRevision.id
|
orgRevisionId: curRevision.id,
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
if (curPosMaster && clearProfile.LeaveType != "RETIRE_OUT_EMP") {
|
if (curPosMaster && clearProfile.LeaveType != "RETIRE_OUT_EMP") {
|
||||||
await CreatePosMasterHistoryOfficer(curPosMaster.id, req, "DELETE");
|
await CreatePosMasterHistoryOfficer(curPosMaster.id, req, "DELETE");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue