filter command-type
This commit is contained in:
parent
f8672b081f
commit
f825914ec2
1 changed files with 28 additions and 11 deletions
|
|
@ -1656,18 +1656,35 @@ export class CommandController extends Controller {
|
|||
},
|
||||
select: ["orgRootId"],
|
||||
});
|
||||
|
||||
const _posMaster = await this.posMasterRepository.find({
|
||||
where: {
|
||||
orgRootId: In(posMaster.map((x) => x.orgRootId)),
|
||||
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
|
||||
isDirector: true,
|
||||
current_holderId: Not(IsNull()),
|
||||
},
|
||||
relations: ["current_holder", "orgRoot"],
|
||||
});
|
||||
let _posMaster : any
|
||||
if(["C-PM-38", "C-PM-40"].includes(commandCode)) {
|
||||
_posMaster = await this.posMasterRepository.find({
|
||||
where: {
|
||||
orgRootId: In(posMaster.map((x) => x.orgRootId)),
|
||||
orgChild1: IsNull(),
|
||||
orgChild2: IsNull(),
|
||||
orgChild3: IsNull(),
|
||||
orgChild4: IsNull(),
|
||||
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
|
||||
isDirector: true,
|
||||
current_holderId: Not(IsNull()),
|
||||
},
|
||||
relations: ["current_holder", "orgRoot"],
|
||||
});
|
||||
}
|
||||
else {
|
||||
_posMaster = await this.posMasterRepository.find({
|
||||
where: {
|
||||
orgRootId: In(posMaster.map((x) => x.orgRootId)),
|
||||
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
|
||||
isDirector: true,
|
||||
current_holderId: Not(IsNull()),
|
||||
},
|
||||
relations: ["current_holder", "orgRoot"],
|
||||
});
|
||||
}
|
||||
await Promise.all(
|
||||
_posMaster.map(async (item) => {
|
||||
_posMaster.map(async (item:any) => {
|
||||
const _commandSend = await this.commandSendRepository.findOne({
|
||||
where: {
|
||||
commandId: command.id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue