This commit is contained in:
AdisakKanthawilang 2025-04-04 09:52:59 +07:00
parent 79ada6fcee
commit bb69bb5096
6 changed files with 133 additions and 74 deletions

View file

@ -16,6 +16,7 @@ import { ProfileAssessment } from "../entities/ProfileAssessment";
import { log } from "console";
import { format } from "path";
import { viewProfileEvaluation } from "../entities/view/viewProfileEvaluation";
import { viewPosMaster } from "../entities/view/viewPosMaster";
import { viewProfileEmployeeEvaluation } from "../entities/view/viewProfileEmployeeEvaluation";
import Extension from "../interfaces/extension";
import { resetPassword } from "../keycloak";
@ -766,11 +767,11 @@ export class OrganizationUnauthorizeController extends Controller {
? null
: findProfile.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild4;
let _child1 = child1 == null ? "" : `${child1.orgChild1Name}/`;
let _child2 = child2 == null ? "" : `${child2.orgChild2Name}/`;
let _child3 = child3 == null ? "" : `${child3.orgChild3Name}/`;
let _child4 = child4 == null ? "" : `${child4.orgChild4Name}/`;
let _root = root == null ? "" : `${root.orgRootName}`;
let _root = root?.orgRootName;
let _child1 =child1?.orgChild1Name;
let _child2 =child2?.orgChild2Name;
let _child3 =child3?.orgChild3Name;
let _child4 =child4?.orgChild4Name;
return new HttpSuccess({
rootId: root == null ? null : root.id,
@ -778,7 +779,11 @@ export class OrganizationUnauthorizeController extends Controller {
orgRootShortName: root == null ? null : root.orgRootShortName,
orgRevisionId: findRevision.id,
profileId: findProfile.id,
org: `${_child4}${_child3}${_child2}${_child1}${_root}`,
org: (_child4 == null ? "" : _child4 + "\n") +
(_child3 == null ? "" : _child3 + "\n") +
(_child2 == null ? "" : _child2 + "\n") +
(_child1 == null ? "" : _child1 + "\n") +
(_root == null ? "" : _root),
type: "OFFICER",
rank: findProfile.rank,
prefix: findProfile.prefix,
@ -858,11 +863,11 @@ export class OrganizationUnauthorizeController extends Controller {
? null
: findProfile.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild4;
let _child1 = child1 == null ? "" : `${child1.orgChild1Name}/`;
let _child2 = child2 == null ? "" : `${child2.orgChild2Name}/`;
let _child3 = child3 == null ? "" : `${child3.orgChild3Name}/`;
let _child4 = child4 == null ? "" : `${child4.orgChild4Name}/`;
let _root = root == null ? "" : `${root.orgRootName}`;
let _root = root?.orgRootName;
let _child1 =child1?.orgChild1Name;
let _child2 =child2?.orgChild2Name;
let _child3 =child3?.orgChild3Name;
let _child4 =child4?.orgChild4Name;
return new HttpSuccess({
rootId: root == null ? null : root.id,
@ -870,7 +875,11 @@ export class OrganizationUnauthorizeController extends Controller {
orgRootShortName: root == null ? null : root.orgRootShortName,
orgRevisionId: findRevision.id,
profileId: findProfile.id,
org: `${_child4}${_child3}${_child2}${_child1}${_root}`,
org: (_child4 == null ? "" : _child4 + "\n") +
(_child3 == null ? "" : _child3 + "\n") +
(_child2 == null ? "" : _child2 + "\n") +
(_child1 == null ? "" : _child1 + "\n") +
(_root == null ? "" : _root),
type: "EMPLOYEE",
rank: findProfile.rank,
prefix: findProfile.prefix,
@ -950,11 +959,11 @@ export class OrganizationUnauthorizeController extends Controller {
? null
: findProfile.current_holders.find((x) => x.orgRevisionId == findRevision.id)?.orgChild4;
let _child1 = child1 == null ? "" : `${child1.orgChild1Name}/`;
let _child2 = child2 == null ? "" : `${child2.orgChild2Name}/`;
let _child3 = child3 == null ? "" : `${child3.orgChild3Name}/`;
let _child4 = child4 == null ? "" : `${child4.orgChild4Name}/`;
let _root = root == null ? "" : `${root.orgRootName}`;
let _root = root?.orgRootName;
let _child1 =child1?.orgChild1Name;
let _child2 =child2?.orgChild2Name;
let _child3 =child3?.orgChild3Name;
let _child4 =child4?.orgChild4Name;
return new HttpSuccess({
rootId: root == null ? null : root.id,
@ -962,7 +971,11 @@ export class OrganizationUnauthorizeController extends Controller {
orgRootShortName: root == null ? null : root.orgRootShortName,
orgRevisionId: findRevision.id,
profileId: findProfile.id,
org: `${_child4}${_child3}${_child2}${_child1}${_root}`,
org: (_child4 == null ? "" : _child4 + "\n") +
(_child3 == null ? "" : _child3 + "\n") +
(_child2 == null ? "" : _child2 + "\n") +
(_child1 == null ? "" : _child1 + "\n") +
(_root == null ? "" : _root),
type: "EMPLOYEE",
rank: findProfile.rank,
prefix: findProfile.prefix,