no message
This commit is contained in:
parent
a87b03262d
commit
3724b2c0a6
3 changed files with 91 additions and 23 deletions
|
|
@ -61,14 +61,8 @@ export class OrganizationController extends Controller {
|
||||||
@Get("history")
|
@Get("history")
|
||||||
async GetHistory() {
|
async GetHistory() {
|
||||||
const orgRevision = await this.orgRevisionRepository.find({
|
const orgRevision = await this.orgRevisionRepository.find({
|
||||||
select: [
|
select: ["id", "orgRevisionName", "orgRevisionIsCurrent", "createdAt", "orgRevisionIsDraft"],
|
||||||
"id",
|
order: { createdAt: "ASC" },
|
||||||
"orgRevisionName",
|
|
||||||
"orgRevisionIsCurrent",
|
|
||||||
"orgRevisionCreatedAt",
|
|
||||||
"orgRevisionIsDraft",
|
|
||||||
],
|
|
||||||
order: { orgRevisionCreatedAt: "DESC" },
|
|
||||||
});
|
});
|
||||||
// if (!orgRevision) {
|
// if (!orgRevision) {
|
||||||
// return new HttpSuccess([]);
|
// return new HttpSuccess([]);
|
||||||
|
|
@ -77,7 +71,7 @@ export class OrganizationController extends Controller {
|
||||||
orgRevisionId: revision.id,
|
orgRevisionId: revision.id,
|
||||||
orgRevisionName: revision.orgRevisionName,
|
orgRevisionName: revision.orgRevisionName,
|
||||||
orgRevisionIsCurrent: revision.orgRevisionIsCurrent,
|
orgRevisionIsCurrent: revision.orgRevisionIsCurrent,
|
||||||
orgRevisionCreatedAt: revision.orgRevisionCreatedAt,
|
orgRevisionCreatedAt: revision.createdAt,
|
||||||
orgRevisionIsDraft: revision.orgRevisionIsDraft,
|
orgRevisionIsDraft: revision.orgRevisionIsDraft,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -269,12 +269,19 @@ export class OrganizationDotnetController extends Controller {
|
||||||
@Get("keycloak/{keycloakId}")
|
@Get("keycloak/{keycloakId}")
|
||||||
async GetProfileByKeycloakIdAsync(@Path() keycloakId: string) {
|
async GetProfileByKeycloakIdAsync(@Path() keycloakId: string) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
relations: {
|
relations: [
|
||||||
posLevel: true,
|
"posLevel",
|
||||||
posType: true,
|
"posType",
|
||||||
profileSalary: true,
|
"profileSalary",
|
||||||
profileInsignias: true,
|
"profileInsignias",
|
||||||
},
|
"current_holders",
|
||||||
|
"current_holders.orgRevision",
|
||||||
|
"current_holders.orgRoot",
|
||||||
|
"current_holders.orgChild1",
|
||||||
|
"current_holders.orgChild2",
|
||||||
|
"current_holders.orgChild3",
|
||||||
|
"current_holders.orgChild4",
|
||||||
|
],
|
||||||
where: { keycloak: keycloakId },
|
where: { keycloak: keycloakId },
|
||||||
order: {
|
order: {
|
||||||
profileSalary: {
|
profileSalary: {
|
||||||
|
|
@ -287,12 +294,19 @@ export class OrganizationDotnetController extends Controller {
|
||||||
});
|
});
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
const profile = await this.profileEmpRepo.findOne({
|
const profile = await this.profileEmpRepo.findOne({
|
||||||
relations: {
|
relations: [
|
||||||
posLevel: true,
|
"posLevel",
|
||||||
posType: true,
|
"posType",
|
||||||
profileSalary: true,
|
"profileSalary",
|
||||||
profileInsignias: true,
|
"profileInsignias",
|
||||||
},
|
"current_holders",
|
||||||
|
"current_holders.orgRevision",
|
||||||
|
"current_holders.orgRoot",
|
||||||
|
"current_holders.orgChild1",
|
||||||
|
"current_holders.orgChild2",
|
||||||
|
"current_holders.orgChild3",
|
||||||
|
"current_holders.orgChild4",
|
||||||
|
],
|
||||||
where: { keycloak: keycloakId },
|
where: { keycloak: keycloakId },
|
||||||
order: {
|
order: {
|
||||||
profileSalary: {
|
profileSalary: {
|
||||||
|
|
@ -347,6 +361,36 @@ export class OrganizationDotnetController extends Controller {
|
||||||
currentZipCode: profile.currentZipCode,
|
currentZipCode: profile.currentZipCode,
|
||||||
dutyTimeId: profile.dutyTimeId,
|
dutyTimeId: profile.dutyTimeId,
|
||||||
dutyTimeEffectiveDate: profile.dutyTimeEffectiveDate,
|
dutyTimeEffectiveDate: profile.dutyTimeEffectiveDate,
|
||||||
|
root:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgRoot?.orgRootName ?? null,
|
||||||
|
child1:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgChild1?.orgChild1Name ?? null,
|
||||||
|
child2:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgChild2?.orgChild2Name ?? null,
|
||||||
|
child3:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgChild3?.orgChild3Name ?? null,
|
||||||
|
child4:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgChild4?.orgChild4Name ?? null,
|
||||||
posLevel: profile.posLevel ? profile.posLevel : null,
|
posLevel: profile.posLevel ? profile.posLevel : null,
|
||||||
posType: profile.posType ? profile.posType : null,
|
posType: profile.posType ? profile.posType : null,
|
||||||
profileSalary: profile.profileSalary.length > 0 ? profile.profileSalary[0] : null,
|
profileSalary: profile.profileSalary.length > 0 ? profile.profileSalary[0] : null,
|
||||||
|
|
@ -398,6 +442,36 @@ export class OrganizationDotnetController extends Controller {
|
||||||
currentZipCode: profile.currentZipCode,
|
currentZipCode: profile.currentZipCode,
|
||||||
dutyTimeId: profile.dutyTimeId,
|
dutyTimeId: profile.dutyTimeId,
|
||||||
dutyTimeEffectiveDate: profile.dutyTimeEffectiveDate,
|
dutyTimeEffectiveDate: profile.dutyTimeEffectiveDate,
|
||||||
|
root:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgRoot?.orgRootName ?? null,
|
||||||
|
child1:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgChild1?.orgChild1Name ?? null,
|
||||||
|
child2:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgChild2?.orgChild2Name ?? null,
|
||||||
|
child3:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgChild3?.orgChild3Name ?? null,
|
||||||
|
child4:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgChild4?.orgChild4Name ?? null,
|
||||||
posLevel: profile.posLevel ? profile.posLevel : null,
|
posLevel: profile.posLevel ? profile.posLevel : null,
|
||||||
posType: profile.posType ? profile.posType : null,
|
posType: profile.posType ? profile.posType : null,
|
||||||
profileSalary: profile.profileSalary.length > 0 ? profile.profileSalary[0] : null,
|
profileSalary: profile.profileSalary.length > 0 ? profile.profileSalary[0] : null,
|
||||||
|
|
|
||||||
|
|
@ -866,7 +866,7 @@ export class ReportController extends Controller {
|
||||||
});
|
});
|
||||||
if (orgRevisionActive == null) {
|
if (orgRevisionActive == null) {
|
||||||
const _orgRevisionActive = await this.orgRevisionRepository.find({
|
const _orgRevisionActive = await this.orgRevisionRepository.find({
|
||||||
order: { orgRevisionCreatedAt: "DESC" },
|
order: { createdAt: "DESC" },
|
||||||
skip: 1,
|
skip: 1,
|
||||||
relations: [
|
relations: [
|
||||||
"posMasters",
|
"posMasters",
|
||||||
|
|
@ -3033,7 +3033,7 @@ export class ReportController extends Controller {
|
||||||
});
|
});
|
||||||
if (orgRevisionActive == null) {
|
if (orgRevisionActive == null) {
|
||||||
const _orgRevisionActive = await this.orgRevisionRepository.find({
|
const _orgRevisionActive = await this.orgRevisionRepository.find({
|
||||||
order: { orgRevisionCreatedAt: "DESC" },
|
order: { createdAt: "DESC" },
|
||||||
skip: 1,
|
skip: 1,
|
||||||
relations: [
|
relations: [
|
||||||
"posMasters",
|
"posMasters",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue