This commit is contained in:
moss 2025-03-29 16:59:26 +07:00
parent ab03d3aa3d
commit 0c6d9ac9c1
2 changed files with 34 additions and 15 deletions

View file

@ -1224,8 +1224,8 @@ export class SalaryPeriodController extends Controller {
})
// .orWhere("profile.citizenId LIKE :keyword", { keyword: `%${body.keyword}%` })
.orWhere("profile.position LIKE :keyword", { keyword: `%${body.keyword}%` })
// .orWhere("profile.posType LIKE :keyword", { keyword: `%${body.keyword}%` })
// .orWhere("profile.posLevel LIKE :keyword", { keyword: `%${body.keyword}%` })
.orWhere("profile.posType LIKE :keyword", { keyword: `%${body.keyword}%` })
.orWhere("profile.posLevel LIKE :keyword", { keyword: `%${body.keyword}%` })
// .orWhere("profile.posExecutive LIKE :keyword", { keyword: `%${body.keyword}%` })
.orWhere("profile.amount LIKE :keyword", { keyword: `%${body.keyword}%` })
.orWhere("profile.amountSpecial LIKE :keyword", { keyword: `%${body.keyword}%` })
@ -1712,13 +1712,14 @@ export class SalaryPeriodController extends Controller {
salaryPeriod.lastUpdatedAt = new Date();
await this.salaryPeriodRepository.save(salaryPeriod, { data: request });
setLogDataDiff(request, { before, after: salaryPeriod });
let _null: any = null;
await Promise.all(
orgs.map(async (root: any) => {
let salaryOrgNew = Object.assign(new SalaryOrg());
salaryOrgNew.salaryPeriodId = salaryPeriod.id;
salaryOrgNew.status = "PENDING";
salaryOrgNew.rootId = root.rootId;
salaryOrgNew.rootDnaId = root.rootDnaId ?? _null;
salaryOrgNew.root = root.root;
salaryOrgNew.revisionId = salaryPeriod.revisionId;
salaryOrgNew.snapshot = snapshot;
@ -1739,6 +1740,7 @@ export class SalaryPeriodController extends Controller {
salaryOrgNew.salaryPeriodId = salaryPeriod.id;
salaryOrgNew.status = "PENDING";
salaryOrgNew.rootId = root.rootId;
salaryOrgNew.rootDnaId = root.rootDnaId ?? _null;
salaryOrgNew.root = root.root;
salaryOrgNew.revisionId = salaryPeriod.revisionId;
salaryOrgNew.snapshot = snapshot;
@ -1835,7 +1837,7 @@ export class SalaryPeriodController extends Controller {
await this.salaryPeriodRepository.save(chk_SalaryPeriod, { data: request });
setLogDataDiff(request, { before: beforeChk_SalaryPeriod, after: chk_SalaryPeriod });
let _null: any = null;
await Promise.all(
orgs.map(async (root: any) => {
let salaryOrgNew = Object.assign(new SalaryOrg());
@ -1844,6 +1846,7 @@ export class SalaryPeriodController extends Controller {
salaryOrgNew.salaryPeriodId = chk_SalaryPeriod.id;
salaryOrgNew.status = "PENDING";
salaryOrgNew.rootId = root.rootId;
salaryOrgNew.rootDnaId = root.rootDnaId ?? _null;
salaryOrgNew.root = root.root;
salaryOrgNew.revisionId = chk_SalaryPeriod.revisionId;
salaryOrgNew.snapshot = snapshot;
@ -1867,6 +1870,7 @@ export class SalaryPeriodController extends Controller {
salaryOrgNew.salaryPeriodId = chk_SalaryPeriod.id;
salaryOrgNew.status = "PENDING";
salaryOrgNew.rootId = root.rootId;
salaryOrgNew.rootDnaId = root.rootDnaId ?? _null;
salaryOrgNew.root = root.root;
salaryOrgNew.revisionId = chk_SalaryPeriod.revisionId;
salaryOrgNew.snapshot = snapshot;
@ -2203,7 +2207,7 @@ export class SalaryPeriodController extends Controller {
salaryOrgNew.salaryPeriodId = salaryPeriod.id;
salaryOrgNew.status = "PENDING";
salaryOrgNew.rootId = root.rootId;
salaryOrgNew.rootDnaId = root.rootDnaId;
salaryOrgNew.rootDnaId = root.rootDnaId ?? _null;
salaryOrgNew.root = root.root;
salaryOrgNew.revisionId = salaryPeriod.revisionId;
salaryOrgNew.snapshot = snapshot;
@ -2721,13 +2725,14 @@ export class SalaryPeriodController extends Controller {
salaryPeriod.lastUpdatedAt = new Date();
await this.salaryPeriodRepository.save(salaryPeriod, { data: request });
setLogDataDiff(request, { before, after: salaryPeriod });
let _null: any = null;
await Promise.all(
orgs.map(async (root: any) => {
let salaryOrgNew = Object.assign(new SalaryOrg());
salaryOrgNew.salaryPeriodId = salaryPeriod.id;
salaryOrgNew.status = "PENDING";
salaryOrgNew.rootId = root.rootId;
salaryOrgNew.rootDnaId = root.rootDnaId ?? _null;
salaryOrgNew.root = root.root;
salaryOrgNew.revisionId = salaryPeriod.revisionId;
salaryOrgNew.snapshot = snapshot;
@ -2756,6 +2761,7 @@ export class SalaryPeriodController extends Controller {
salaryOrgNew.salaryPeriodId = salaryPeriod.id;
salaryOrgNew.status = "PENDING";
salaryOrgNew.rootId = root.rootId;
salaryOrgNew.rootDnaId = root.rootDnaId ?? _null;
salaryOrgNew.root = root.root;
salaryOrgNew.revisionId = salaryPeriod.revisionId;
salaryOrgNew.snapshot = snapshot;