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

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

@ -175,6 +175,8 @@ export class ImportDataController 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();
profiles.push(profile);
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
@ -248,6 +250,8 @@ export class ImportDataController extends Controller {
profileEmp.createdFullName = request.user.name;
profileEmp.lastUpdateUserId = request.user.sub;
profileEmp.lastUpdateFullName = request.user.name;
profileEmp.createdAt = new Date();
profileEmp.lastUpdatedAt = new Date();
profiles.push(profileEmp);
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
@ -336,6 +340,8 @@ export class ImportDataController extends Controller {
profileSalary.createdFullName = request.user.name;
profileSalary.lastUpdateUserId = request.user.sub;
profileSalary.lastUpdateFullName = request.user.name;
profileSalary.createdAt = new Date();
profileSalary.lastUpdatedAt = new Date();
// profileSalarys.push(profileSalary);
// await this.salaryRepository.save(profileSalary);
// if (profileSalarys.length === BATCH_SIZE) {
@ -428,6 +434,8 @@ export class ImportDataController extends Controller {
profileSalary.createdFullName = request.user.name;
profileSalary.lastUpdateUserId = request.user.sub;
profileSalary.lastUpdateFullName = request.user.name;
profileSalary.createdAt = new Date();
profileSalary.lastUpdatedAt = new Date();
// profileSalarys.push(profileSalary);
// await this.salaryRepository.save(profileSalary);
// if (profileSalarys.length === BATCH_SIZE) {
@ -509,6 +517,8 @@ export class ImportDataController extends Controller {
profileFather.createdFullName = request.user.name;
profileFather.lastUpdateUserId = request.user.sub;
profileFather.lastUpdateFullName = request.user.name;
profileFather.createdAt = new Date();
profileFather.lastUpdatedAt = new Date();
profileMother.profileId = _item.id;
profileMother.motherPrefix = existingProfile.MOTHER_RANK_NAME;
@ -518,6 +528,8 @@ export class ImportDataController extends Controller {
profileMother.createdFullName = request.user.name;
profileMother.lastUpdateUserId = request.user.sub;
profileMother.lastUpdateFullName = request.user.name;
profileMother.createdAt = new Date();
profileMother.lastUpdatedAt = new Date();
profileCouple.profileId = _item.id;
profileCouple.couplePrefix = existingProfile.SPOUSE_RANK_NAME;
@ -539,6 +551,8 @@ export class ImportDataController extends Controller {
profileCouple.createdFullName = request.user.name;
profileCouple.lastUpdateUserId = request.user.sub;
profileCouple.lastUpdateFullName = request.user.name;
profileCouple.createdAt = new Date();
profileCouple.lastUpdatedAt = new Date();
// fathers.push(profileFather);
// mothers.push(profileMother);
@ -633,6 +647,8 @@ export class ImportDataController extends Controller {
profileFather.createdFullName = request.user.name;
profileFather.lastUpdateUserId = request.user.sub;
profileFather.lastUpdateFullName = request.user.name;
profileFather.createdAt = new Date();
profileFather.lastUpdatedAt = new Date();
profileMother.profileEmployeeId = _item.id;
profileMother.motherPrefix = existingProfile.MOTHER_RANK_NAME;
@ -642,6 +658,8 @@ export class ImportDataController extends Controller {
profileMother.createdFullName = request.user.name;
profileMother.lastUpdateUserId = request.user.sub;
profileMother.lastUpdateFullName = request.user.name;
profileMother.createdAt = new Date();
profileMother.lastUpdatedAt = new Date();
profileCouple.profileEmployeeId = _item.id;
profileCouple.couplePrefix = existingProfile.SPOUSE_RANK_NAME;
@ -663,6 +681,8 @@ export class ImportDataController extends Controller {
profileCouple.createdFullName = request.user.name;
profileCouple.lastUpdateUserId = request.user.sub;
profileCouple.lastUpdateFullName = request.user.name;
profileCouple.createdAt = new Date();
profileCouple.lastUpdatedAt = new Date();
// fathers.push(profileFather);
// mothers.push(profileMother);
@ -720,6 +740,8 @@ export class ImportDataController extends Controller {
educationMis.createdFullName = request.user.name;
educationMis.lastUpdateUserId = request.user.sub;
educationMis.lastUpdateFullName = request.user.name;
educationMis.createdAt = new Date();
educationMis.lastUpdatedAt = new Date();
educationMis_.push(educationMis);
}),
);
@ -786,6 +808,8 @@ export class ImportDataController extends Controller {
education.createdFullName = request.user.name;
education.lastUpdateUserId = request.user.sub;
education.lastUpdateFullName = request.user.name;
education.createdAt = new Date();
education.lastUpdatedAt = new Date();
// await educations.push(await education);
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
await this.educationRepository.save(await education);
@ -860,6 +884,8 @@ export class ImportDataController extends Controller {
education.createdFullName = request.user.name;
education.lastUpdateUserId = request.user.sub;
education.lastUpdateFullName = request.user.name;
education.createdAt = new Date();
education.lastUpdatedAt = new Date();
// educations.push(education);
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
await this.educationRepository.save(education);
@ -898,6 +924,8 @@ export class ImportDataController extends Controller {
prov.createdFullName = request.user.name;
prov.lastUpdateUserId = request.user.sub;
prov.lastUpdateFullName = request.user.name;
prov.createdAt = new Date();
prov.lastUpdatedAt = new Date();
provinces_.push(prov);
}),
);
@ -930,6 +958,8 @@ export class ImportDataController extends Controller {
amh.createdFullName = request.user.name;
amh.lastUpdateUserId = request.user.sub;
amh.lastUpdateFullName = request.user.name;
amh.createdAt = new Date();
amh.lastUpdatedAt = new Date();
amphur_.push(amh);
}),
);
@ -963,6 +993,8 @@ export class ImportDataController extends Controller {
subD.createdFullName = request.user.name;
subD.lastUpdateUserId = request.user.sub;
subD.lastUpdateFullName = request.user.name;
subD.createdAt = new Date();
subD.lastUpdatedAt = new Date();
subDistrict_.push(subD);
}),
);
@ -1112,6 +1144,8 @@ export class ImportDataController extends Controller {
_item.createdFullName = request.user.name;
_item.lastUpdateUserId = request.user.sub;
_item.lastUpdateFullName = request.user.name;
_item.createdAt = new Date();
_item.lastUpdatedAt = new Date();
// profileDatas.push(_item);
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
await this.profileRepo.save(_item);
@ -1265,6 +1299,8 @@ export class ImportDataController extends Controller {
_item.createdFullName = request.user.name;
_item.lastUpdateUserId = request.user.sub;
_item.lastUpdateFullName = request.user.name;
_item.createdAt = new Date();
_item.lastUpdatedAt = new Date();
// profileDatas.push(_item);
console.log(">>>>>>>>>>>>>>>>>>>" + rowCount);
await this.profileEmpRepo.save(_item);