fix organization
This commit is contained in:
parent
9d45d6b0e7
commit
eb5e259874
3 changed files with 51 additions and 30 deletions
|
|
@ -641,14 +641,18 @@ export class AssignController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลบุคคล");
|
||||
}
|
||||
|
||||
const splitOc = await profileData.organization.split(" ");
|
||||
const splitOcAmount = await splitOc.length;
|
||||
// const splitOc = await profileData.organization.split(" ");
|
||||
// const splitOcAmount = await splitOc.length;
|
||||
const profile = {
|
||||
...profileData,
|
||||
name: `${profileData.prefixName}${profileData.firstName} ${profileData.lastName}`,
|
||||
Position: profileData.positionName,
|
||||
Department: splitOcAmount > 2 ? splitOc[splitOcAmount - 3] : "-",
|
||||
OrganizationOrganization: splitOcAmount > 1 ? splitOc[splitOcAmount - 2] : "-",
|
||||
OrganizationOrganization: profileData.orgChild2Name
|
||||
? (profileData.orgChild4Name ? profileData.orgChild4Name + " " : "") +
|
||||
(profileData.orgChild3Name ? profileData.orgChild3Name + " " : "") +
|
||||
(profileData.orgChild2Name ? profileData.orgChild2Name + " " : "")
|
||||
: "-",
|
||||
Department: profileData.orgChild1Name ?? "-",
|
||||
Oc: profileData.orgRootName,
|
||||
PositionAndLevel: profileData.positionName + profileData.positionLevelName,
|
||||
};
|
||||
|
|
@ -890,14 +894,18 @@ export class AssignController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลบุคคล");
|
||||
}
|
||||
|
||||
const splitOc = await profileData.organization.split(" ");
|
||||
const splitOcAmount = await splitOc.length;
|
||||
// const splitOc = await profileData.organization.split(" ");
|
||||
// const splitOcAmount = await splitOc.length;
|
||||
const profile = {
|
||||
...profileData,
|
||||
name: `${profileData.prefixName}${profileData.firstName} ${profileData.lastName}`,
|
||||
Position: profileData.positionName,
|
||||
Department: splitOcAmount > 2 ? splitOc[splitOcAmount - 3] : "-",
|
||||
OrganizationOrganization: splitOcAmount > 1 ? splitOc[splitOcAmount - 2] : "-",
|
||||
OrganizationOrganization: profileData.orgChild2Name
|
||||
? (profileData.orgChild4Name ? profileData.orgChild4Name + " " : "") +
|
||||
(profileData.orgChild3Name ? profileData.orgChild3Name + " " : "") +
|
||||
(profileData.orgChild2Name ? profileData.orgChild2Name + " " : "")
|
||||
: "-",
|
||||
Department: profileData.orgChild1Name ?? "-",
|
||||
Oc: profileData.orgRootName,
|
||||
PositionAndLevel: profileData.positionName + profileData.positionLevelName,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -285,8 +285,8 @@ export class EvaluateResultController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลบุคคล");
|
||||
}
|
||||
|
||||
const splitOc = await experimenteeData.organization.split(" ");
|
||||
const splitOcAmount = await splitOc.length;
|
||||
// const splitOc = await experimenteeData.organization.split(" ");
|
||||
// const splitOcAmount = await splitOc.length;
|
||||
const experimentee = await {
|
||||
...experimenteeData,
|
||||
name:
|
||||
|
|
@ -295,8 +295,12 @@ export class EvaluateResultController extends Controller {
|
|||
" " +
|
||||
experimenteeData.lastName,
|
||||
PositionLevel: experimenteeData.positionName + experimenteeData.positionLevelName,
|
||||
Department: splitOcAmount > 2 ? splitOc[splitOcAmount - 3] : "-",
|
||||
OrganizationOrganization: splitOcAmount > 1 ? splitOc[splitOcAmount - 2] : "-",
|
||||
OrganizationOrganization: experimenteeData.orgChild2Name
|
||||
? (experimenteeData.orgChild4Name ? experimenteeData.orgChild4Name + " " : "") +
|
||||
(experimenteeData.orgChild3Name ? experimenteeData.orgChild3Name + " " : "") +
|
||||
(experimenteeData.orgChild2Name ? experimenteeData.orgChild2Name + " " : "")
|
||||
: "-",
|
||||
Department: experimenteeData.orgChild1Name ?? "-",
|
||||
Oc: experimenteeData.orgRootName,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -593,19 +593,22 @@ export class ReportController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
const splitOc = await experimenteeData.organization.split(" ");
|
||||
const splitOcAmount = await splitOc.length;
|
||||
const organization = await experimenteeData.organization.replace(/\//g, " ");
|
||||
// const splitOc = await experimenteeData.organization.split(" ");
|
||||
// const splitOcAmount = await splitOc.length;
|
||||
// const organization = await experimenteeData.organization.replace(/\//g, " ");
|
||||
|
||||
const experimentee = await {
|
||||
...experimenteeData,
|
||||
organization: organization,
|
||||
name: `${experimenteeData.prefixName}${experimenteeData.firstName} ${experimenteeData.lastName}`,
|
||||
PositionLevelName: experimenteeData.positionLevelName,
|
||||
PositionLineName: experimenteeData.positionLineName,
|
||||
Position: experimenteeData.positionName,
|
||||
Department: splitOcAmount > 2 ? splitOc[splitOcAmount - 3] : "-",
|
||||
OrganizationOrganization: splitOcAmount > 1 ? splitOc[splitOcAmount - 2] : "-",
|
||||
OrganizationOrganization: experimenteeData.orgChild2Name
|
||||
? (experimenteeData.orgChild4Name ? experimenteeData.orgChild4Name + " " : "") +
|
||||
(experimenteeData.orgChild3Name ? experimenteeData.orgChild3Name + " " : "") +
|
||||
(experimenteeData.orgChild2Name ? experimenteeData.orgChild2Name + " " : "")
|
||||
: "-",
|
||||
Department: experimenteeData.orgChild1Name ?? "-",
|
||||
Oc: experimenteeData.orgRootName,
|
||||
PositionLevel: experimenteeData.positionName + experimenteeData.positionLevelName,
|
||||
};
|
||||
|
|
@ -836,19 +839,22 @@ export class ReportController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
const splitOc = await experimenteeData.organization.split(" ");
|
||||
const splitOcAmount = await splitOc.length;
|
||||
const organization = await experimenteeData.organization.replace(/\//g, " ");
|
||||
// const splitOc = await experimenteeData.organization.split(" ");
|
||||
// const splitOcAmount = await splitOc.length;
|
||||
// const organization = await experimenteeData.organization.replace(/\//g, " ");
|
||||
|
||||
const experimentee = await {
|
||||
...experimenteeData,
|
||||
organization: organization,
|
||||
name: `${experimenteeData.prefixName}${experimenteeData.firstName} ${experimenteeData.lastName}`,
|
||||
PositionLevelName: experimenteeData.positionLevelName,
|
||||
PositionLineName: experimenteeData.positionLineName,
|
||||
Position: experimenteeData.positionName,
|
||||
Department: splitOcAmount > 2 ? splitOc[splitOcAmount - 3] : "-",
|
||||
OrganizationOrganization: splitOcAmount > 1 ? splitOc[splitOcAmount - 2] : "-",
|
||||
OrganizationOrganization: experimenteeData.orgChild2Name
|
||||
? (experimenteeData.orgChild4Name ? experimenteeData.orgChild4Name + " " : "") +
|
||||
(experimenteeData.orgChild3Name ? experimenteeData.orgChild3Name + " " : "") +
|
||||
(experimenteeData.orgChild2Name ? experimenteeData.orgChild2Name + " " : "")
|
||||
: "-",
|
||||
Department: experimenteeData.orgChild1Name ?? "-",
|
||||
Oc: experimenteeData.orgRootName,
|
||||
PositionLevel: experimenteeData.positionName + experimenteeData.positionLevelName,
|
||||
};
|
||||
|
|
@ -1112,19 +1118,22 @@ export class ReportController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
|
||||
const splitOc = await experimenteeData.organization.split(" ");
|
||||
const splitOcAmount = await splitOc.length;
|
||||
const organization = await experimenteeData.organization.replace(/\//g, " ");
|
||||
// const splitOc = await experimenteeData.organization.split(" ");
|
||||
// const splitOcAmount = await splitOc.length;
|
||||
// const organization = await experimenteeData.organization.replace(/\//g, " ");
|
||||
|
||||
const experimentee = await {
|
||||
...experimenteeData,
|
||||
organization: organization,
|
||||
name: `${experimenteeData.prefixName}${experimenteeData.firstName} ${experimenteeData.lastName}`,
|
||||
PositionLevelName: experimenteeData.positionLevelName,
|
||||
PositionLineName: experimenteeData.positionLineName,
|
||||
Position: experimenteeData.positionName,
|
||||
Department: splitOcAmount > 2 ? splitOc[splitOcAmount - 3] : "-",
|
||||
OrganizationOrganization: splitOcAmount > 1 ? splitOc[splitOcAmount - 2] : "-",
|
||||
OrganizationOrganization: experimenteeData.orgChild2Name
|
||||
? (experimenteeData.orgChild4Name ? experimenteeData.orgChild4Name + " " : "") +
|
||||
(experimenteeData.orgChild3Name ? experimenteeData.orgChild3Name + " " : "") +
|
||||
(experimenteeData.orgChild2Name ? experimenteeData.orgChild2Name + " " : "")
|
||||
: "-",
|
||||
Department: experimenteeData.orgChild1Name ?? "-",
|
||||
Oc: experimenteeData.orgRootName,
|
||||
PositionLevel: experimenteeData.positionName + experimenteeData.positionLevelName,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue