no message
This commit is contained in:
parent
c937b96119
commit
f59734d47b
1 changed files with 36 additions and 8 deletions
|
|
@ -5471,37 +5471,65 @@ export class OrganizationController extends Controller {
|
||||||
async findNodeAllOrg(@Body() requestBody: { node: number; nodeId: string }) {
|
async findNodeAllOrg(@Body() requestBody: { node: number; nodeId: string }) {
|
||||||
switch (requestBody.node) {
|
switch (requestBody.node) {
|
||||||
case 0: {
|
case 0: {
|
||||||
const data = await this.orgRootRepository.findOne({
|
const data = await this.orgRootRepository.find({
|
||||||
where: { id: requestBody.nodeId },
|
where: { id: requestBody.nodeId },
|
||||||
});
|
});
|
||||||
return new HttpSuccess(data);
|
return new HttpSuccess(
|
||||||
|
data.map((y) => ({
|
||||||
|
name: y.orgRootName,
|
||||||
|
rootId: y.id,
|
||||||
|
child1Id: null,
|
||||||
|
child2Id: null,
|
||||||
|
child3Id: null,
|
||||||
|
child4Id: null,
|
||||||
|
})),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
case 1: {
|
case 1: {
|
||||||
const data = await this.child1Repository.findOne({
|
const data = await this.child1Repository.find({
|
||||||
where: { id: requestBody.nodeId },
|
where: { id: requestBody.nodeId },
|
||||||
});
|
});
|
||||||
return new HttpSuccess(data);
|
return new HttpSuccess(data);
|
||||||
}
|
}
|
||||||
case 2: {
|
case 2: {
|
||||||
const data = await this.child2Repository.findOne({
|
const data = await this.child2Repository.find({
|
||||||
where: { id: requestBody.nodeId },
|
where: { id: requestBody.nodeId },
|
||||||
});
|
});
|
||||||
return new HttpSuccess(data);
|
return new HttpSuccess(data);
|
||||||
}
|
}
|
||||||
case 3: {
|
case 3: {
|
||||||
const data = await this.child3Repository.findOne({
|
const data = await this.child3Repository.find({
|
||||||
where: { id: requestBody.nodeId },
|
where: { id: requestBody.nodeId },
|
||||||
});
|
});
|
||||||
return new HttpSuccess(data);
|
return new HttpSuccess(data);
|
||||||
}
|
}
|
||||||
case 4: {
|
case 4: {
|
||||||
const data = await this.child4Repository.findOne({
|
const data = await this.child4Repository.find({
|
||||||
where: { id: requestBody.nodeId },
|
where: { id: requestBody.nodeId },
|
||||||
});
|
});
|
||||||
return new HttpSuccess(data);
|
return new HttpSuccess(data);
|
||||||
}
|
}
|
||||||
default:
|
default: {
|
||||||
return new HttpSuccess([]);
|
const data = await this.orgRootRepository.find({
|
||||||
|
where: {
|
||||||
|
orgRevision: {
|
||||||
|
orgRevisionIsCurrent: true,
|
||||||
|
orgRevisionIsDraft: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return new HttpSuccess(
|
||||||
|
data.map((y) => ({
|
||||||
|
name: y.orgRootName,
|
||||||
|
rootId: y.id,
|
||||||
|
child1Id: null,
|
||||||
|
child2Id: null,
|
||||||
|
child3Id: null,
|
||||||
|
child4Id: null,
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
return new HttpSuccess(data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue