add commanderPositionName

This commit is contained in:
mamoss 2025-04-09 16:21:06 +07:00
parent 384d637610
commit 8d6da2f55e

View file

@ -303,6 +303,7 @@ export class OrganizationDotnetController extends Controller {
},
});
let fullname = "";
let commanderPositionName = "";
let commanderId = "";
let commanderKeycloak = "";
@ -393,8 +394,9 @@ export class OrganizationDotnetController extends Controller {
pos.current_holder.firstName +
" " +
pos.current_holder.lastName;
commanderId = pos.current_holder.id;
commanderKeycloak = pos.current_holder.keycloak;
commanderPositionName = pos.current_holder?.position;
commanderId = pos.current_holder?.id;
commanderKeycloak = pos.current_holder?.keycloak;
} else {
let pos = await this.posMasterRepository.findOne({
relations: ["current_holder"],
@ -417,8 +419,9 @@ export class OrganizationDotnetController extends Controller {
pos.current_holder.firstName +
" " +
pos.current_holder.lastName;
commanderId = pos.current_holder.id;
commanderKeycloak = pos.current_holder.keycloak;
commanderPositionName = pos.current_holder?.position;
commanderId = pos.current_holder?.id;
commanderKeycloak = pos.current_holder?.keycloak;
} else {
let pos = await this.posMasterRepository.findOne({
relations: ["current_holder"],
@ -441,8 +444,9 @@ export class OrganizationDotnetController extends Controller {
pos.current_holder.firstName +
" " +
pos.current_holder.lastName;
commanderId = pos.current_holder.id;
commanderKeycloak = pos.current_holder.keycloak;
commanderPositionName = pos.current_holder?.position;
commanderId = pos.current_holder?.id;
commanderKeycloak = pos.current_holder?.keycloak;
} else {
let pos = await this.posMasterRepository.findOne({
relations: ["current_holder"],
@ -465,8 +469,9 @@ export class OrganizationDotnetController extends Controller {
pos.current_holder.firstName +
" " +
pos.current_holder.lastName;
commanderId = pos.current_holder.id;
commanderKeycloak = pos.current_holder.keycloak;
commanderPositionName = pos.current_holder?.position;
commanderId = pos.current_holder?.id;
commanderKeycloak = pos.current_holder?.keycloak;
} else {
let pos = await this.posMasterRepository.findOne({
relations: ["current_holder"],
@ -489,10 +494,12 @@ export class OrganizationDotnetController extends Controller {
pos.current_holder.firstName +
" " +
pos.current_holder.lastName;
commanderId = pos.current_holder.id;
commanderKeycloak = pos.current_holder.keycloak;
commanderPositionName = pos.current_holder?.position;
commanderId = pos.current_holder?.id;
commanderKeycloak = pos.current_holder?.keycloak;
} else {
fullname = "";
commanderPositionName = "";
commanderId = "";
commanderKeycloak = "";
}
@ -633,6 +640,7 @@ export class OrganizationDotnetController extends Controller {
x.orgRevision?.orgRevisionIsCurrent == true,
)?.orgChild4Id ?? null,
commander: fullname,
commanderPositionName,
commanderId,
commanderKeycloak,
posLevel: profile.posLevel?.posLevelName ?? null,
@ -703,8 +711,9 @@ export class OrganizationDotnetController extends Controller {
pos.current_holder.firstName +
" " +
pos.current_holder.lastName;
commanderId = pos.current_holder.id;
commanderKeycloak = pos.current_holder.keycloak;
commanderPositionName = pos.current_holder?.position;
commanderId = pos.current_holder?.id;
commanderKeycloak = pos.current_holder?.keycloak;
} else {
let pos = await this.posMasterRepository.findOne({
relations: ["current_holder"],
@ -728,8 +737,9 @@ export class OrganizationDotnetController extends Controller {
pos.current_holder.firstName +
" " +
pos.current_holder.lastName;
commanderId = pos.current_holder.id;
commanderKeycloak = pos.current_holder.keycloak;
commanderPositionName = pos.current_holder?.position;
commanderId = pos.current_holder?.id;
commanderKeycloak = pos.current_holder?.keycloak;
} else {
let pos = await this.posMasterRepository.findOne({
relations: ["current_holder"],
@ -753,8 +763,9 @@ export class OrganizationDotnetController extends Controller {
pos.current_holder.firstName +
" " +
pos.current_holder.lastName;
commanderId = pos.current_holder.id;
commanderKeycloak = pos.current_holder.keycloak;
commanderPositionName = pos.current_holder?.position;
commanderId = pos.current_holder?.id;
commanderKeycloak = pos.current_holder?.keycloak;
} else {
let pos = await this.posMasterRepository.findOne({
relations: ["current_holder"],
@ -778,8 +789,9 @@ export class OrganizationDotnetController extends Controller {
pos.current_holder.firstName +
" " +
pos.current_holder.lastName;
commanderId = pos.current_holder.id;
commanderKeycloak = pos.current_holder.keycloak;
commanderPositionName = pos.current_holder?.position;
commanderId = pos.current_holder?.id;
commanderKeycloak = pos.current_holder?.keycloak;
} else {
let pos = await this.posMasterRepository.findOne({
relations: ["current_holder"],
@ -803,10 +815,12 @@ export class OrganizationDotnetController extends Controller {
pos.current_holder.firstName +
" " +
pos.current_holder.lastName;
commanderId = pos.current_holder.id;
commanderKeycloak = pos.current_holder.keycloak;
commanderPositionName = pos.current_holder?.position;
commanderId = pos.current_holder?.id;
commanderKeycloak = pos.current_holder?.keycloak;
} else {
fullname = "";
commanderPositionName = "";
commanderId = "";
commanderKeycloak = "";
}
@ -952,6 +966,7 @@ export class OrganizationDotnetController extends Controller {
x.orgRevision?.orgRevisionIsCurrent == true,
)?.orgChild4Id ?? null,
commander: fullname,
commanderPositionName,
commanderId,
commanderKeycloak,
posLevel: profile.posLevel?.posLevelName ?? null,