label name

This commit is contained in:
AdisakKanthawilang 2024-03-01 12:16:54 +07:00
parent ba76e787b0
commit 4d3769e4b4
2 changed files with 12 additions and 0 deletions

View file

@ -718,6 +718,7 @@ export class OrganizationController extends Controller {
orgTreeFax: orgRoot.orgRootFax,
orgRevisionId: orgRoot.orgRevisionId,
orgRootName: orgRoot.orgRootName,
labelName: orgRoot.orgRootName + " " + orgRoot.orgRootCode + "00" +" "+ orgRoot.orgRootShortName,
totalPosition: await this.posMasterRepository.count({
where: { orgRevisionId: orgRoot.orgRevisionId, orgRootId: orgRoot.id },
}),
@ -824,6 +825,7 @@ export class OrganizationController extends Controller {
orgTreeFax: orgChild1.orgChild1Fax,
orgRevisionId: orgRoot.orgRevisionId,
orgRootName: orgRoot.orgRootName,
labelName: orgChild1.orgChild1Name + " " + orgChild1.orgChild1Code + "00" +" "+ orgChild1.orgChild1ShortName,
totalPosition: await this.posMasterRepository.count({
where: { orgRevisionId: orgRoot.orgRevisionId, orgChild1Id: orgChild1.id },
}),
@ -930,6 +932,7 @@ export class OrganizationController extends Controller {
orgTreeFax: orgChild2.orgChild2Fax,
orgRevisionId: orgRoot.orgRevisionId,
orgRootName: orgRoot.orgRootName,
labelName: orgChild2.orgChild2Name + " " + orgChild2.orgChild2Code + "00" +" "+ orgChild2.orgChild2ShortName,
totalPosition: await this.posMasterRepository.count({
where: {
orgRevisionId: orgRoot.orgRevisionId,
@ -1039,6 +1042,7 @@ export class OrganizationController extends Controller {
orgTreeFax: orgChild3.orgChild3Fax,
orgRevisionId: orgRoot.orgRevisionId,
orgRootName: orgRoot.orgRootName,
labelName: orgChild3.orgChild3Name + " " + orgChild3.orgChild3Code + "00" +" "+ orgChild3.orgChild3ShortName,
totalPosition: await this.posMasterRepository.count({
where: {
orgRevisionId: orgRoot.orgRevisionId,
@ -1148,6 +1152,7 @@ export class OrganizationController extends Controller {
orgTreeFax: orgChild4.orgChild4Fax,
orgRevisionId: orgRoot.orgRevisionId,
orgRootName: orgRoot.orgRootName,
labelName: orgChild4.orgChild4Name + " " + orgChild4.orgChild4Code + "00" +" "+ orgChild4.orgChild4ShortName,
totalPosition: await this.posMasterRepository.count({
where: {
orgRevisionId: orgRoot.orgRevisionId,

View file

@ -944,6 +944,7 @@ export class PositionController extends Controller {
let checkChildConditions: any = {};
let keywordAsInt: any;
let searchShortName = "";
let labelName = "";
let searchShortName0 = `CONCAT(orgRoot.orgRootShortName,posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix)`;
let searchShortName1 = `CONCAT(orgChild1.orgChild1ShortName,posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix)`;
let searchShortName2 = `CONCAT(orgChild2.orgChild2ShortName,posMaster.posMasterNoPrefix,posMaster.posMasterNo,posMaster.posMasterNoSuffix)`;
@ -1155,6 +1156,7 @@ export class PositionController extends Controller {
) {
body.type = 0;
shortName = posMaster.orgRoot.orgRootShortName;
// labelName = posMaster.orgRoot.orgRootName+" "+posMaster.orgRoot.orgRootCode + "00"+" "+posMaster.orgRoot.orgRootShortName;
} else if (
posMaster.orgRootId !== null &&
posMaster.orgChild1Id !== null &&
@ -1163,6 +1165,7 @@ export class PositionController extends Controller {
) {
body.type = 1;
shortName = posMaster.orgChild1.orgChild1ShortName;
// labelName = posMaster.orgChild1.orgChild1Name+" "+posMaster.orgChild1.orgChild1Code + "00"+" "+posMaster.orgChild1.orgChild1ShortName;
} else if (
posMaster.orgRootId !== null &&
posMaster.orgChild1Id !== null &&
@ -1171,6 +1174,7 @@ export class PositionController extends Controller {
) {
body.type = 2;
shortName = posMaster.orgChild2.orgChild2ShortName;
// labelName = posMaster.orgChild2.orgChild2Name+" "+posMaster.orgChild2.orgChild2Code + "00"+" "+posMaster.orgChild2.orgChild2ShortName;
} else if (
posMaster.orgRootId !== null &&
posMaster.orgChild1Id !== null &&
@ -1179,6 +1183,7 @@ export class PositionController extends Controller {
) {
body.type = 3;
shortName = posMaster.orgChild3.orgChild3ShortName;
// labelName = posMaster.orgChild3.orgChild3Name+" "+posMaster.orgChild3.orgChild3Code + "00"+" "+posMaster.orgChild3.orgChild3ShortName;
} else if (
posMaster.orgRootId !== null &&
posMaster.orgChild1Id !== null &&
@ -1187,6 +1192,7 @@ export class PositionController extends Controller {
) {
body.type = 4;
shortName = posMaster.orgChild4.orgChild4ShortName;
// labelName = posMaster.orgChild4.orgChild4Name+" "+posMaster.orgChild4.orgChild4Code + "00"+" "+posMaster.orgChild4.orgChild4ShortName;
}
return {
@ -1208,6 +1214,7 @@ export class PositionController extends Controller {
? null
: `${posMaster.next_holder.prefix}${posMaster.next_holder.firstName} ${posMaster.next_holder.lastName}`,
orgShortname: shortName,
// labelName: labelName,
isSit: posMaster.isSit,
profilePosition: profile == null || profile.position == null ? null : profile.position,
profilePostype: type == null || type.posTypeName == null ? null : type.posTypeName,