diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index d1afbb40..aa8448da 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -4480,7 +4480,7 @@ export class CommandController extends Controller { ]; const _organization = organization .filter((part) => part !== undefined && part !== null) - .join("/"); + .join(" "); const organizationNew = [ posMasterAct.posMaster?.current_holder?.position ?? null, @@ -4492,7 +4492,7 @@ export class CommandController extends Controller { ]; const _organizationNew = organizationNew .filter((part) => part !== undefined && part !== null) - .join("/"); + .join(" "); var _data = { no: Extension.ToThaiNumber((i + 1).toString()), fullName: `${item.Prefix ?? ""}${item.FirstName ?? ""} ${item.LastName ?? ""}`, diff --git a/src/controllers/PosMasterActController.ts b/src/controllers/PosMasterActController.ts index 6f2b7cc5..e658d122 100644 --- a/src/controllers/PosMasterActController.ts +++ b/src/controllers/PosMasterActController.ts @@ -300,7 +300,7 @@ export class PosMasterActController extends Controller { ]; const _organization = organization .filter((part) => part !== undefined && part !== null) - .join("/"); + .join(" "); const organizationNew = [ posMasterAct.posMaster?.current_holder?.position ?? null, @@ -312,7 +312,7 @@ export class PosMasterActController extends Controller { ]; const _organizationNew = organizationNew .filter((part) => part !== undefined && part !== null) - .join("/"); + .join(" "); return new HttpSuccess({ prefix: posMasterAct.posMasterChild?.current_holder?.prefix ?? null, firstName: posMasterAct.posMasterChild?.current_holder?.firstName ?? null, diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 6581f3ec..8084cd20 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -5502,7 +5502,7 @@ export class ProfileController extends Controller { : posMaster_.orgChild1.orgChild1Name, posMaster_ == null || posMaster_.orgRoot == null ? null : posMaster_.orgRoot.orgRootName, ]; - const org = fullNameParts.filter((part) => part !== undefined && part !== null).join("/"); + const org = fullNameParts.filter((part) => part !== undefined && part !== null).join(" "); //find commander(ผู้บังคับบัญชา) let node = 4; @@ -5707,7 +5707,7 @@ export class ProfileController extends Controller { ]; commanderOrg_ = commanderFullNameParts .filter((part) => part !== undefined && part !== null) - .join("/"); + .join(" "); const commandAboveProfile = await this.profileRepo.findOne({ where: { id: String(commandAboveProfileId) }, @@ -5755,7 +5755,7 @@ export class ProfileController extends Controller { ]; commanderAboveOrg_ = commanderAboveFullNameParts .filter((part) => part !== undefined && part !== null) - .join("/"); + .join(" "); const _profile: any = { profileId: profile.id, diff --git a/src/controllers/ProfileEmployeeController.ts b/src/controllers/ProfileEmployeeController.ts index 3798b6af..714c34bf 100644 --- a/src/controllers/ProfileEmployeeController.ts +++ b/src/controllers/ProfileEmployeeController.ts @@ -3191,6 +3191,7 @@ export class ProfileEmployeeController extends Controller { .orWhere(conditionFullName, { keyword: `%${body.keyword}%`, }) + .where("profileEmployee.isLeave = false") .orderBy("profileEmployee.citizenId", "ASC") .skip((body.page - 1) * body.pageSize) .take(body.pageSize) diff --git a/src/controllers/ProfileGovernmentController.ts b/src/controllers/ProfileGovernmentController.ts index 10958196..b1abb860 100644 --- a/src/controllers/ProfileGovernmentController.ts +++ b/src/controllers/ProfileGovernmentController.ts @@ -8,7 +8,12 @@ import { Profile } from "../entities/Profile"; import { ProfileGovernment, UpdateProfileGovernment } from "../entities/ProfileGovernment"; import { Position } from "../entities/Position"; import { PosMaster } from "../entities/PosMaster"; -import { calculateAge, calculateGovAge, calculateRetireDate, setLogDataDiff } from "../interfaces/utils"; +import { + calculateAge, + calculateGovAge, + calculateRetireDate, + setLogDataDiff, +} from "../interfaces/utils"; import permission from "../interfaces/permission"; import { OrgRevision } from "../entities/OrgRevision"; @Route("api/v1/org/profile/government") @@ -89,7 +94,7 @@ export class ProfileGovernmentHistoryController extends Controller { posMaster == null || posMaster.orgChild1 == null ? null : posMaster.orgChild1.orgChild1Name, posMaster == null || posMaster.orgRoot == null ? null : posMaster.orgRoot.orgRootName, ]; - const org = fullNameParts.filter((part) => part !== undefined && part !== null).join("/"); + const org = fullNameParts.filter((part) => part !== undefined && part !== null).join(" "); let orgShortName = ""; if (posMaster != null) { if (posMaster.orgChild1Id === null) { @@ -120,7 +125,7 @@ export class ProfileGovernmentHistoryController extends Controller { dateLeave: record.birthDate == null ? null : calculateRetireDate(record.birthDate), dateRetireLaw: record.dateRetireLaw ?? null, // govAge: record.dateStart == null ? null : calculateAge(record.dateStart), - govAge: await calculateGovAge(profile.id,"OFFICER"), + govAge: await calculateGovAge(profile.id, "OFFICER"), dateAppoint: record.dateAppoint, dateStart: record.dateStart, govAgeAbsent: record.govAgeAbsent, @@ -200,7 +205,7 @@ export class ProfileGovernmentHistoryController extends Controller { posMaster == null || posMaster.orgChild1 == null ? null : posMaster.orgChild1.orgChild1Name, posMaster == null || posMaster.orgRoot == null ? null : posMaster.orgRoot.orgRootName, ]; - const org = fullNameParts.filter((part) => part !== undefined && part !== null).join("/"); + const org = fullNameParts.filter((part) => part !== undefined && part !== null).join(" "); let orgShortName = ""; if (posMaster != null) { if (posMaster.orgChild1Id === null) { @@ -231,7 +236,7 @@ export class ProfileGovernmentHistoryController extends Controller { dateLeave: record.birthDate == null ? null : calculateRetireDate(record.birthDate), dateRetireLaw: record.dateRetireLaw ?? null, // govAge: record.dateStart == null ? null : calculateAge(record.dateStart), - govAge: await calculateGovAge(profileId,"OFFICER"), + govAge: await calculateGovAge(profileId, "OFFICER"), dateAppoint: record.dateAppoint, dateStart: record.dateStart, govAgeAbsent: record.govAgeAbsent, @@ -294,7 +299,7 @@ export class ProfileGovernmentHistoryController extends Controller { posMaster == null || posMaster.orgChild1 == null ? null : posMaster.orgChild1.orgChild1Name, posMaster == null || posMaster.orgRoot == null ? null : posMaster.orgRoot.orgRootName, ]; - const org = fullNameParts.filter((part) => part !== undefined && part !== null).join("/"); + const org = fullNameParts.filter((part) => part !== undefined && part !== null).join(" "); let orgShortName = ""; if (posMaster != null) { if (posMaster.orgChild1Id === null) { @@ -325,7 +330,7 @@ export class ProfileGovernmentHistoryController extends Controller { dateLeave: record.birthDate == null ? null : calculateRetireDate(record.birthDate), dateRetireLaw: record.dateRetireLaw ?? null, // govAge: record.dateStart == null ? null : calculateAge(record.dateStart), - govAge: await calculateGovAge(profileId,"OFFICER"), + govAge: await calculateGovAge(profileId, "OFFICER"), dateAppoint: record.dateAppoint, dateStart: record.dateStart, govAgeAbsent: record.govAgeAbsent, diff --git a/src/controllers/ProfileGovernmentEmployeeController.ts b/src/controllers/ProfileGovernmentEmployeeController.ts index 626149f0..d8db83ed 100644 --- a/src/controllers/ProfileGovernmentEmployeeController.ts +++ b/src/controllers/ProfileGovernmentEmployeeController.ts @@ -90,7 +90,7 @@ export class ProfileGovernmentEmployeeController extends Controller { posMaster == null || posMaster.orgChild1 == null ? null : posMaster.orgChild1.orgChild1Name, posMaster == null || posMaster.orgRoot == null ? null : posMaster.orgRoot.orgRootName, ]; - const org = fullNameParts.filter((part) => part !== undefined && part !== null).join("/"); + const org = fullNameParts.filter((part) => part !== undefined && part !== null).join(" "); let orgShortName = ""; if (posMaster != null) { if (posMaster.orgChild1Id === null) { @@ -194,7 +194,7 @@ export class ProfileGovernmentEmployeeController extends Controller { posMaster == null || posMaster.orgChild1 == null ? null : posMaster.orgChild1.orgChild1Name, posMaster == null || posMaster.orgRoot == null ? null : posMaster.orgRoot.orgRootName, ]; - const org = fullNameParts.filter((part) => part !== undefined && part !== null).join("/"); + const org = fullNameParts.filter((part) => part !== undefined && part !== null).join(" "); let orgShortName = ""; if (posMaster != null) { if (posMaster.orgChild1Id === null) { @@ -281,7 +281,7 @@ export class ProfileGovernmentEmployeeController extends Controller { posMaster == null || posMaster.orgChild1 == null ? null : posMaster.orgChild1.orgChild1Name, posMaster == null || posMaster.orgRoot == null ? null : posMaster.orgRoot.orgRootName, ]; - const org = fullNameParts.filter((part) => part !== undefined && part !== null).join("/"); + const org = fullNameParts.filter((part) => part !== undefined && part !== null).join(" "); let orgShortName = ""; if (posMaster != null) { if (posMaster.orgChild1Id === null) { diff --git a/src/controllers/ProfileGovernmentEmployeeTempController.ts b/src/controllers/ProfileGovernmentEmployeeTempController.ts index 6facd5b0..7f72241a 100644 --- a/src/controllers/ProfileGovernmentEmployeeTempController.ts +++ b/src/controllers/ProfileGovernmentEmployeeTempController.ts @@ -85,7 +85,7 @@ export class ProfileGovernmentEmployeeTempController extends Controller { posMaster == null || posMaster.orgChild1 == null ? null : posMaster.orgChild1.orgChild1Name, posMaster == null || posMaster.orgRoot == null ? null : posMaster.orgRoot.orgRootName, ]; - const org = fullNameParts.filter((part) => part !== undefined && part !== null).join("/"); + const org = fullNameParts.filter((part) => part !== undefined && part !== null).join(" "); let orgShortName = ""; if (posMaster != null) { if (posMaster.orgChild1Id === null) { @@ -184,7 +184,7 @@ export class ProfileGovernmentEmployeeTempController extends Controller { posMaster == null || posMaster.orgChild1 == null ? null : posMaster.orgChild1.orgChild1Name, posMaster == null || posMaster.orgRoot == null ? null : posMaster.orgRoot.orgRootName, ]; - const org = fullNameParts.filter((part) => part !== undefined && part !== null).join("/"); + const org = fullNameParts.filter((part) => part !== undefined && part !== null).join(" "); let orgShortName = ""; if (posMaster != null) { if (posMaster.orgChild1Id === null) { @@ -271,7 +271,7 @@ export class ProfileGovernmentEmployeeTempController extends Controller { posMaster == null || posMaster.orgChild1 == null ? null : posMaster.orgChild1.orgChild1Name, posMaster == null || posMaster.orgRoot == null ? null : posMaster.orgRoot.orgRootName, ]; - const org = fullNameParts.filter((part) => part !== undefined && part !== null).join("/"); + const org = fullNameParts.filter((part) => part !== undefined && part !== null).join(" "); let orgShortName = ""; if (posMaster != null) { if (posMaster.orgChild1Id === null) {