add dpis controller
This commit is contained in:
parent
497decefe4
commit
4852131651
74 changed files with 606 additions and 336 deletions
|
|
@ -142,8 +142,9 @@ export class OrganizationDotnetController extends Controller {
|
|||
profileEmp.map((item: ProfileEmployee) => {
|
||||
const rootName =
|
||||
item.current_holders.length == 0
|
||||
? null
|
||||
: item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.orgRoot?.orgRootName;
|
||||
? null
|
||||
: item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.orgRoot
|
||||
?.orgRootName;
|
||||
const shortName =
|
||||
item.current_holders.length == 0
|
||||
? null
|
||||
|
|
@ -152,8 +153,8 @@ export class OrganizationDotnetController extends Controller {
|
|||
null
|
||||
? `${item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.orgChild4.orgChild4ShortName}${item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.posMasterNo}`
|
||||
: item.current_holders.find((x) => x.orgRevisionId == findRevision?.id) != null &&
|
||||
item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.orgChild3 !=
|
||||
null
|
||||
item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)
|
||||
?.orgChild3 != null
|
||||
? `${item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.orgChild3.orgChild3ShortName}${item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.posMasterNo}`
|
||||
: item.current_holders.find((x) => x.orgRevisionId == findRevision?.id) != null &&
|
||||
item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)
|
||||
|
|
@ -169,7 +170,7 @@ export class OrganizationDotnetController extends Controller {
|
|||
?.orgRoot != null
|
||||
? `${item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.orgRoot.orgRootShortName}${item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.posMasterNo}`
|
||||
: null;
|
||||
return {
|
||||
return {
|
||||
oc: rootName,
|
||||
id: item.id,
|
||||
createdAt: item.createdAt,
|
||||
|
|
@ -222,9 +223,9 @@ export class OrganizationDotnetController extends Controller {
|
|||
currentZipCode: item.currentZipCode,
|
||||
posLevel: item.posLevel,
|
||||
posType: item.posType,
|
||||
posNo: shortName
|
||||
}
|
||||
})
|
||||
posNo: shortName,
|
||||
};
|
||||
}),
|
||||
);
|
||||
return new HttpSuccess(profileEmp_);
|
||||
}
|
||||
|
|
@ -902,15 +903,15 @@ export class OrganizationDotnetController extends Controller {
|
|||
const profile = await this.profileRepo.find({
|
||||
where: { keycloak: Not(IsNull()) || Not("") },
|
||||
relations: [
|
||||
"posType",
|
||||
"posLevel",
|
||||
"current_holders",
|
||||
"current_holders.orgRoot",
|
||||
"posType",
|
||||
"posLevel",
|
||||
"current_holders",
|
||||
"current_holders.orgRoot",
|
||||
"current_holders.orgChild1",
|
||||
"current_holders.orgChild2",
|
||||
"current_holders.orgChild3",
|
||||
"current_holders.orgChild4",
|
||||
"profileSalary"
|
||||
"profileSalary",
|
||||
],
|
||||
order: {
|
||||
profileSalary: {
|
||||
|
|
@ -922,13 +923,14 @@ export class OrganizationDotnetController extends Controller {
|
|||
const findRevision = await this.orgRevisionRepo.findOne({
|
||||
where: { orgRevisionIsCurrent: true },
|
||||
});
|
||||
|
||||
|
||||
const profile_ = await Promise.all(
|
||||
profile.map((item: Profile) => {
|
||||
const rootName =
|
||||
item.current_holders.length == 0
|
||||
? null
|
||||
: item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.orgRoot?.orgRootName;
|
||||
? null
|
||||
: item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.orgRoot
|
||||
?.orgRootName;
|
||||
const shortName =
|
||||
item.current_holders.length == 0
|
||||
? null
|
||||
|
|
@ -937,8 +939,8 @@ export class OrganizationDotnetController extends Controller {
|
|||
null
|
||||
? `${item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.orgChild4.orgChild4ShortName}${item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.posMasterNo}`
|
||||
: item.current_holders.find((x) => x.orgRevisionId == findRevision?.id) != null &&
|
||||
item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.orgChild3 !=
|
||||
null
|
||||
item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)
|
||||
?.orgChild3 != null
|
||||
? `${item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.orgChild3.orgChild3ShortName}${item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.posMasterNo}`
|
||||
: item.current_holders.find((x) => x.orgRevisionId == findRevision?.id) != null &&
|
||||
item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)
|
||||
|
|
@ -955,7 +957,7 @@ export class OrganizationDotnetController extends Controller {
|
|||
? `${item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.orgRoot.orgRootShortName}${item.current_holders.find((x) => x.orgRevisionId == findRevision?.id)?.posMasterNo}`
|
||||
: null;
|
||||
|
||||
return {
|
||||
return {
|
||||
oc: rootName,
|
||||
id: item.id,
|
||||
createdAt: item.createdAt,
|
||||
|
|
@ -1008,14 +1010,12 @@ export class OrganizationDotnetController extends Controller {
|
|||
currentZipCode: item.currentZipCode,
|
||||
dutyTimeId: item.dutyTimeId,
|
||||
dutyTimeEffectiveDate: item.dutyTimeEffectiveDate,
|
||||
positionLevel: item.profileSalary.length > 0
|
||||
? item.profileSalary[0].positionLevel
|
||||
: null,
|
||||
posNo: shortName
|
||||
}
|
||||
})
|
||||
positionLevel: item.profileSalary.length > 0 ? item.profileSalary[0].positionLevel : null,
|
||||
posNo: shortName,
|
||||
};
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
return new HttpSuccess(profile_);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue