update current

This commit is contained in:
mamoss 2025-08-18 22:56:04 +07:00
parent b0f5ff78d8
commit 8b7de2a0ba
6 changed files with 86 additions and 54 deletions

View file

@ -2001,6 +2001,7 @@ export class EmployeeTempPositionController extends Controller {
dataMaster.isSit = requestBody.isSit;
dataMaster.current_holderId = requestBody.profileId;
dataMaster.lastUpdatedAt = new Date();
// dataMaster.next_holderId = requestBody.profileId;
await this.employeeTempPosMasterRepository.save(dataMaster);
@ -2137,7 +2138,10 @@ export class EmployeeTempPositionController extends Controller {
orgRevisionId: posMaster.orgRevisionId,
},
});
if (posMasterOld != null) posMasterOld.current_holderId = null;
if (posMasterOld != null) {
posMasterOld.current_holderId = null;
posMasterOld.lastUpdatedAt = new Date();
}
// if (posMasterOld != null) posMasterOld.next_holderId = null;
const positionOld = await this.employeePositionRepository.findOne({
@ -2172,6 +2176,7 @@ export class EmployeeTempPositionController extends Controller {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
posMaster.current_holderId = body.profileId;
posMaster.lastUpdatedAt = new Date();
// posMaster.next_holderId = body.profileId;
if (posMasterOld != null) await this.employeeTempPosMasterRepository.save(posMasterOld);
await this.employeeTempPosMasterRepository.save(posMaster);