diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index 8698b96..4b44251 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -32,6 +32,7 @@ import { SalaryOrgEmployee } from "../entities/SalaryOrgEmployee"; import { SalaryProfileEmployee } from "../entities/SalaryProfileEmployee"; import { setLogDataDiff } from "../interfaces/utils"; import { RequestWithUser } from "../middlewares/user"; +import permission from "../interfaces/permission"; import CallAPI from "../interfaces/call-api"; import { isNotEmittedStatement } from "typescript"; @@ -7581,6 +7582,7 @@ export class ReportController extends Controller { // }), // ) .andWhere("salaryProfileEmployee.status36 = :status", { status: "PENDING" }) + .andWhere("salaryProfileEmployee.rootId = :rootId", { rootId: body.rootId }) .select([ "salaryProfileEmployee.id", "salaryProfileEmployee.orgShortName", @@ -8829,6 +8831,7 @@ export class ReportController extends Controller { commandYear: v.commandYear, commandId: v.commandId, salaryLevel: salary.salaryLevel && salary.salaryLevelNew ? salary.salaryLevelNew : salary.salaryLevel, + group: salary.group && salary.groupNew ? salary.groupNew : salary.group, }) .then(async () => { const before = null; diff --git a/src/controllers/SalaryPeriodController.ts b/src/controllers/SalaryPeriodController.ts index 3cde762..67bbd00 100644 --- a/src/controllers/SalaryPeriodController.ts +++ b/src/controllers/SalaryPeriodController.ts @@ -1554,6 +1554,7 @@ export class SalaryPeriodController extends Controller { }, ) { await new permission().PermissionList(request, "SYS_SALARY_OFFICER"); + const _data = await new permission().PermissionOrgList(request, "SYS_SALARY_OFFICER"); const salaryOrg = await this.salaryOrgRepository.findOne({ where: { id: id, @@ -1626,6 +1627,56 @@ export class SalaryPeriodController extends Controller { ); }), ) + .andWhere( + _data.root != undefined && _data.root != null + ? _data.root[0] != null + ? `rootId IN (:...root)` + : `rootId is null` + : "1=1", + { + root: ["4b574414-5faa-438c-829a-3c6444582cfd"], + }, + ) + .andWhere( + _data.child1 != undefined && _data.child1 != null + ? _data.child1[0] != null + ? `child1Id IN (:...child1)` + : `child1Id is null` + : "1=1", + { + child1: _data.child1, + }, + ) + .andWhere( + _data.child2 != undefined && _data.child2 != null + ? _data.child2[0] != null + ? `child2Id IN (:...child2)` + : `child2Id is null` + : "1=1", + { + child2: _data.child2, + }, + ) + .andWhere( + _data.child3 != undefined && _data.child3 != null + ? _data.child3[0] != null + ? `child3Id IN (:...child3)` + : `child3Id is null` + : "1=1", + { + child3: _data.child3, + }, + ) + .andWhere( + _data.child4 != undefined && _data.child4 != null + ? _data.child4[0] != null + ? `child4Id IN (:...child4)` + : `child4Id is null` + : "1=1", + { + child4: _data.child4, + }, + ) .orderBy("profile.rootOrder", "ASC") .addOrderBy("profile.child1Order", "ASC") .addOrderBy("profile.child2Order", "ASC") @@ -2738,6 +2789,7 @@ export class SalaryPeriodController extends Controller { }); salaryProfileNew.type = salaryOld == null ? 0 : salaryOld.type; salaryProfileNew.salaryLevel = salaryOld && salaryOld.salaryLevelNew ? salaryOld.salaryLevelNew : salaryOld?.salaryLevel; + salaryProfileNew.group = salaryOld && salaryOld.groupNew ? salaryOld.groupNew : salaryOld?.group; salaryProfileNew.amount = salaryOld == null ? 0 : salaryOld.amount; salaryProfileNew.amountSpecial = salaryOld == null ? 0 : salaryOld.amountSpecial; salaryProfileNew.amountUse = salaryOld == null ? 0 : salaryOld.amountUse; diff --git a/src/controllers/SalaryPeriodEmployeeController.ts b/src/controllers/SalaryPeriodEmployeeController.ts index 68f7a70..625b4d3 100644 --- a/src/controllers/SalaryPeriodEmployeeController.ts +++ b/src/controllers/SalaryPeriodEmployeeController.ts @@ -1121,6 +1121,9 @@ export class SalaryPeriodEmployeeController extends Controller { .orWhere("CONCAT(profile.orgShortName,profile.posMasterNo) 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}%` })