Merge branch 'develop' into adiDev

This commit is contained in:
AdisakKanthawilang 2025-04-10 18:01:21 +07:00
commit f19d3ce70e

View file

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