This commit is contained in:
DESKTOP-2S5P7D1\Windows 10 2025-02-04 10:13:40 +07:00
parent 43c873ce46
commit fdf27655e1
3 changed files with 27 additions and 8 deletions

View file

@ -1215,8 +1215,13 @@ export class SalaryPeriodController extends Controller {
.orWhere("profile.prefix LIKE :keyword", { keyword: `%${body.keyword}%` })
.orWhere("profile.firstName LIKE :keyword", { keyword: `%${body.keyword}%` })
.orWhere("profile.lastName LIKE :keyword", { keyword: `%${body.keyword}%` })
.orWhere("CONCAT(profile.prefix,profile.firstName,' ',profile.lastName) LIKE :keyword", { keyword: `%${body.keyword}%` })
.orWhere("CONCAT(profile.orgShortName,profile.posMasterNo) LIKE :keyword", { keyword: `%${body.keyword}%` })
.orWhere(
"CONCAT(profile.prefix,profile.firstName,' ',profile.lastName) LIKE :keyword",
{ keyword: `%${body.keyword}%` },
)
.orWhere("CONCAT(profile.orgShortName,profile.posMasterNo) LIKE :keyword", {
keyword: `%${body.keyword}%`,
})
// .orWhere("profile.citizenId LIKE :keyword", { keyword: `%${body.keyword}%` })
.orWhere("profile.position LIKE :keyword", { keyword: `%${body.keyword}%` })
// .orWhere("profile.posType LIKE :keyword", { keyword: `%${body.keyword}%` })
@ -2167,6 +2172,7 @@ export class SalaryPeriodController extends Controller {
salaryOrgNew.salaryPeriodId = salaryPeriod.id;
salaryOrgNew.status = "PENDING";
salaryOrgNew.rootId = root.rootId;
salaryOrgNew.rootDnaId = root.rootDnaId;
salaryOrgNew.root = root.root;
salaryOrgNew.revisionId = salaryPeriod.revisionId;
salaryOrgNew.snapshot = snapshot;
@ -2197,6 +2203,7 @@ export class SalaryPeriodController extends Controller {
salaryOrgNew.salaryPeriodId = salaryPeriod.id;
salaryOrgNew.status = "PENDING";
salaryOrgNew.rootId = root.rootId;
salaryOrgNew.rootDnaId = root.rootDnaId;
salaryOrgNew.root = root.root;
salaryOrgNew.revisionId = salaryPeriod.revisionId;
salaryOrgNew.snapshot = snapshot;
@ -2357,7 +2364,7 @@ export class SalaryPeriodController extends Controller {
const salaryOrgSnap2Old: any = await this.salaryOrgRepository.findOne({
where: {
salaryPeriodId: salaryPeriodAPROld.id,
rootId: _salaryOrg.rootId,
rootDnaId: _salaryOrg.rootDnaId,
group: _salaryOrg.group,
snapshot: "SNAP2",
},
@ -2374,7 +2381,7 @@ export class SalaryPeriodController extends Controller {
const salaryOrgSnap1 = await this.salaryOrgRepository.findOne({
where: {
salaryPeriodId: salaryPeriod.id,
rootId: _salaryOrg.rootId,
rootDnaId: _salaryOrg.rootDnaId,
group: _salaryOrg.group,
snapshot: "SNAP1",
},
@ -2423,7 +2430,7 @@ export class SalaryPeriodController extends Controller {
const salaryOrgSnap2Old: any = await this.salaryOrgEmployeeRepository.findOne({
where: {
salaryPeriodId: salaryPeriodAPROld.id,
rootId: _salaryOrg.rootId,
rootDnaId: _salaryOrg.rootDnaId,
group: _salaryOrg.group,
snapshot: "SNAP2",
},
@ -2439,7 +2446,7 @@ export class SalaryPeriodController extends Controller {
const salaryOrgSnap1 = await this.salaryOrgEmployeeRepository.findOne({
where: {
salaryPeriodId: salaryPeriod.id,
rootId: _salaryOrg.rootId,
rootDnaId: _salaryOrg.rootDnaId,
group: _salaryOrg.group,
snapshot: "SNAP1",
},
@ -2487,7 +2494,7 @@ export class SalaryPeriodController extends Controller {
const salaryOrgSnap1 = await this.salaryOrgRepository.findOne({
where: {
salaryPeriodId: salaryPeriod.id,
rootId: _salaryOrg.rootId,
rootDnaId: _salaryOrg.rootDnaId,
group: _salaryOrg.group,
snapshot: "SNAP1",
},
@ -2529,7 +2536,7 @@ export class SalaryPeriodController extends Controller {
const salaryOrgSnap1 = await this.salaryOrgEmployeeRepository.findOne({
where: {
salaryPeriodId: salaryPeriod.id,
rootId: _salaryOrg.rootId,
rootDnaId: _salaryOrg.rootDnaId,
group: _salaryOrg.group,
snapshot: "SNAP1",
},

View file

@ -22,6 +22,12 @@ export class SalaryOrg extends EntityBase {
})
rootId: string;
@Column({
comment: "คีย์นอก(FK)ของตาราง orgRoot Dna",
length: 40,
})
rootDnaId: string;
@Column({
nullable: true,
comment: "orgRoot",

View file

@ -22,6 +22,12 @@ export class SalaryOrgEmployee extends EntityBase {
})
rootId: string;
@Column({
comment: "คีย์นอก(FK)ของตาราง orgRoot Dna",
length: 40,
})
rootDnaId: string;
@Column({
nullable: true,
comment: "orgRoot",