add relation child command
This commit is contained in:
parent
8b5f8746b2
commit
8ddef76726
1 changed files with 41 additions and 3 deletions
|
|
@ -2593,7 +2593,18 @@ export class CommandController extends Controller {
|
||||||
body.data.map(async (item) => {
|
body.data.map(async (item) => {
|
||||||
if (item.profileType && item.profileType.trim().toUpperCase() == "OFFICER") {
|
if (item.profileType && item.profileType.trim().toUpperCase() == "OFFICER") {
|
||||||
const profile = await this.profileRepository.findOne({
|
const profile = await this.profileRepository.findOne({
|
||||||
relations: ["profileSalary", "posLevel", "posType", "current_holders", "roleKeycloaks"],
|
relations: [
|
||||||
|
"profileSalary",
|
||||||
|
"posLevel",
|
||||||
|
"posType",
|
||||||
|
"current_holders",
|
||||||
|
"current_holders.orgRoot",
|
||||||
|
"current_holders.orgChild1",
|
||||||
|
"current_holders.orgChild2",
|
||||||
|
"current_holders.orgChild3",
|
||||||
|
"current_holders.orgChild4",
|
||||||
|
"roleKeycloaks",
|
||||||
|
],
|
||||||
where: { id: item.profileId },
|
where: { id: item.profileId },
|
||||||
order: {
|
order: {
|
||||||
profileSalary: {
|
profileSalary: {
|
||||||
|
|
@ -2751,7 +2762,18 @@ export class CommandController extends Controller {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const profile = await this.profileEmployeeRepository.findOne({
|
const profile = await this.profileEmployeeRepository.findOne({
|
||||||
relations: ["profileSalary", "posLevel", "posType", "current_holders", "roleKeycloaks"],
|
relations: [
|
||||||
|
"profileSalary",
|
||||||
|
"posLevel",
|
||||||
|
"posType",
|
||||||
|
"current_holders",
|
||||||
|
"current_holders.orgRoot",
|
||||||
|
"current_holders.orgChild1",
|
||||||
|
"current_holders.orgChild2",
|
||||||
|
"current_holders.orgChild3",
|
||||||
|
"current_holders.orgChild4",
|
||||||
|
"roleKeycloaks",
|
||||||
|
],
|
||||||
where: { id: item.profileId },
|
where: { id: item.profileId },
|
||||||
order: {
|
order: {
|
||||||
profileSalary: {
|
profileSalary: {
|
||||||
|
|
@ -2947,7 +2969,18 @@ export class CommandController extends Controller {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
body.data.map(async (item) => {
|
body.data.map(async (item) => {
|
||||||
const profile = await this.profileEmployeeRepository.findOne({
|
const profile = await this.profileEmployeeRepository.findOne({
|
||||||
relations: ["profileSalary", "posLevel", "posType", "current_holders", "roleKeycloaks"],
|
relations: [
|
||||||
|
"profileSalary",
|
||||||
|
"posLevel",
|
||||||
|
"posType",
|
||||||
|
"current_holders",
|
||||||
|
"current_holders.orgRoot",
|
||||||
|
"current_holders.orgChild1",
|
||||||
|
"current_holders.orgChild2",
|
||||||
|
"current_holders.orgChild3",
|
||||||
|
"current_holders.orgChild4",
|
||||||
|
"roleKeycloaks",
|
||||||
|
],
|
||||||
where: { id: item.profileId },
|
where: { id: item.profileId },
|
||||||
order: {
|
order: {
|
||||||
profileSalary: {
|
profileSalary: {
|
||||||
|
|
@ -3275,6 +3308,11 @@ export class CommandController extends Controller {
|
||||||
"posType",
|
"posType",
|
||||||
"posLevel",
|
"posLevel",
|
||||||
"current_holders",
|
"current_holders",
|
||||||
|
"current_holders.orgRoot",
|
||||||
|
"current_holders.orgChild1",
|
||||||
|
"current_holders.orgChild2",
|
||||||
|
"current_holders.orgChild3",
|
||||||
|
"current_holders.orgChild4",
|
||||||
"current_holders.positions",
|
"current_holders.positions",
|
||||||
"current_holders.positions.posExecutive",
|
"current_holders.positions.posExecutive",
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue