เพิ่มวันที่แก้ไข

This commit is contained in:
kittapath 2024-08-30 21:02:14 +07:00
parent 218886b3f4
commit ad4efc2b47
28 changed files with 205 additions and 40 deletions

View file

@ -609,6 +609,8 @@ export class ProfileEmployeeTempController extends Controller {
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.createdAt = new Date();
profile.lastUpdatedAt = new Date();
profile.dateRetire = calculateRetireDate(profile.birthDate);
profile.dateRetireLaw = calculateRetireLaw(profile.birthDate);
profile.citizenId = Extension.CheckCitizen(profile.citizenId);
@ -678,6 +680,7 @@ export class ProfileEmployeeTempController extends Controller {
Object.assign(record, body);
record.lastUpdateUserId = request.user.sub;
record.lastUpdateFullName = request.user.name;
record.lastUpdatedAt = new Date();
record.dateRetire = calculateRetireDate(record.birthDate);
record.dateRetireLaw = calculateRetireLaw(record.birthDate);
record.citizenId = Extension.CheckCitizen(record.citizenId);
@ -2192,6 +2195,7 @@ export class ProfileEmployeeTempController extends Controller {
profileEmp.lastUpdateUserId = request.user.sub;
profileEmp.lastUpdateFullName = request.user.name;
profileEmp.lastUpdatedAt = new Date();
profileEmp.nodeTemp = String(body.node);
profileEmp.nodeIdTemp = body.nodeId;
profileEmp.orgRevisionIdTemp = body.orgRevisionId;
@ -2916,8 +2920,10 @@ export class ProfileEmployeeTempController extends Controller {
history.profileEmployeeId = profileEmployeeId;
history.lastUpdateFullName = request.user.name;
history.lastUpdateUserId = request.user.sub;
history.lastUpdatedAt = new Date();
profileEmp.lastUpdateUserId = request.user.sub;
profileEmp.lastUpdateFullName = request.user.name;
profileEmp.lastUpdatedAt = new Date();
await Promise.all([
this.profileRepo.save(profileEmp),
@ -3084,6 +3090,8 @@ export class ProfileEmployeeTempController extends Controller {
employment.createdFullName = request.user.name;
employment.lastUpdateUserId = request.user.sub;
employment.lastUpdateFullName = request.user.name;
employment.createdAt = new Date();
employment.lastUpdatedAt = new Date();
await this.employmentRepository.save(employment);
// if (employment) {
// Object.assign(history, { ...employment, id: undefined });
@ -3141,9 +3149,11 @@ export class ProfileEmployeeTempController extends Controller {
employment.lastUpdateUserId = request.user.sub;
employment.lastUpdateFullName = request.user.name;
employment.lastUpdatedAt = new Date();
history.profileEmployeeEmploymentId = id;
history.lastUpdateFullName = request.user.name;
history.lastUpdateUserId = request.user.sub;
history.lastUpdatedAt = new Date();
await Promise.all([
this.employmentRepository.save(employment),