Merge branch 'develop' of github.com:Frappet/bma-ehr-organization into develop
This commit is contained in:
commit
ab3391b179
1 changed files with 27 additions and 11 deletions
|
|
@ -339,10 +339,12 @@ export class PositionController extends Controller {
|
||||||
where: {
|
where: {
|
||||||
orgChild4Id: orgChild4.id,
|
orgChild4Id: orgChild4.id,
|
||||||
},
|
},
|
||||||
order: { posMasterNo: "DESC" },
|
order: { posMasterOrder: "DESC" },
|
||||||
});
|
});
|
||||||
posMaster.posMasterOrder =
|
posMaster.posMasterOrder =
|
||||||
order.posMasterOrder == null ? 1 : order.posMasterOrder + 1;
|
order !== null && order !== undefined && order.posMasterOrder
|
||||||
|
? order.posMasterOrder + 1
|
||||||
|
: 1;
|
||||||
posMaster.orgRootId = orgChild4.orgRootId;
|
posMaster.orgRootId = orgChild4.orgRootId;
|
||||||
posMaster.orgChild1Id = orgChild4.orgChild1Id;
|
posMaster.orgChild1Id = orgChild4.orgChild1Id;
|
||||||
posMaster.orgChild2Id = orgChild4.orgChild2Id;
|
posMaster.orgChild2Id = orgChild4.orgChild2Id;
|
||||||
|
|
@ -356,9 +358,12 @@ export class PositionController extends Controller {
|
||||||
orgChild3Id: orgChild3.id,
|
orgChild3Id: orgChild3.id,
|
||||||
orgChild4Id: IsNull() || "",
|
orgChild4Id: IsNull() || "",
|
||||||
},
|
},
|
||||||
order: { posMasterNo: "DESC" },
|
order: { posMasterOrder: "DESC" },
|
||||||
});
|
});
|
||||||
posMaster.posMasterOrder = order.posMasterOrder == null ? 1 : order.posMasterOrder + 1;
|
posMaster.posMasterOrder =
|
||||||
|
order !== null && order !== undefined && order.posMasterOrder
|
||||||
|
? order.posMasterOrder + 1
|
||||||
|
: 1;
|
||||||
posMaster.orgRootId = orgChild3.orgRootId;
|
posMaster.orgRootId = orgChild3.orgRootId;
|
||||||
posMaster.orgChild1Id = orgChild3.orgChild1Id;
|
posMaster.orgChild1Id = orgChild3.orgChild1Id;
|
||||||
posMaster.orgChild2Id = orgChild3.orgChild2Id;
|
posMaster.orgChild2Id = orgChild3.orgChild2Id;
|
||||||
|
|
@ -372,9 +377,12 @@ export class PositionController extends Controller {
|
||||||
orgChild3Id: IsNull() || "",
|
orgChild3Id: IsNull() || "",
|
||||||
orgChild4Id: IsNull() || "",
|
orgChild4Id: IsNull() || "",
|
||||||
},
|
},
|
||||||
order: { posMasterNo: "DESC" },
|
order: { posMasterOrder: "DESC" },
|
||||||
});
|
});
|
||||||
posMaster.posMasterOrder = order.posMasterOrder == null ? 1 : order.posMasterOrder + 1;
|
posMaster.posMasterOrder =
|
||||||
|
order !== null && order !== undefined && order.posMasterOrder
|
||||||
|
? order.posMasterOrder + 1
|
||||||
|
: 1;
|
||||||
posMaster.orgRootId = orgChild2.orgRootId;
|
posMaster.orgRootId = orgChild2.orgRootId;
|
||||||
posMaster.orgChild1Id = orgChild2.orgChild1Id;
|
posMaster.orgChild1Id = orgChild2.orgChild1Id;
|
||||||
posMaster.orgChild2Id = orgChild2.id;
|
posMaster.orgChild2Id = orgChild2.id;
|
||||||
|
|
@ -388,9 +396,12 @@ export class PositionController extends Controller {
|
||||||
orgChild3Id: IsNull() || "",
|
orgChild3Id: IsNull() || "",
|
||||||
orgChild4Id: IsNull() || "",
|
orgChild4Id: IsNull() || "",
|
||||||
},
|
},
|
||||||
order: { posMasterNo: "DESC" },
|
order: { posMasterOrder: "DESC" },
|
||||||
});
|
});
|
||||||
posMaster.posMasterOrder = order.posMasterOrder == null ? 1 : order.posMasterOrder + 1;
|
posMaster.posMasterOrder =
|
||||||
|
order !== null && order !== undefined && order.posMasterOrder
|
||||||
|
? order.posMasterOrder + 1
|
||||||
|
: 1;
|
||||||
posMaster.orgRootId = orgChild1.orgRootId;
|
posMaster.orgRootId = orgChild1.orgRootId;
|
||||||
posMaster.orgChild1Id = orgChild1.id;
|
posMaster.orgChild1Id = orgChild1.id;
|
||||||
posMaster.orgRevisionId = orgChild1.orgRevisionId;
|
posMaster.orgRevisionId = orgChild1.orgRevisionId;
|
||||||
|
|
@ -404,9 +415,12 @@ export class PositionController extends Controller {
|
||||||
orgChild3Id: IsNull() || "",
|
orgChild3Id: IsNull() || "",
|
||||||
orgChild4Id: IsNull() || "",
|
orgChild4Id: IsNull() || "",
|
||||||
},
|
},
|
||||||
order: { posMasterNo: "DESC" },
|
order: { posMasterOrder: "DESC" },
|
||||||
});
|
});
|
||||||
posMaster.posMasterOrder = order.posMasterOrder == null ? 1 : order.posMasterOrder + 1;
|
posMaster.posMasterOrder =
|
||||||
|
order !== null && order !== undefined && order.posMasterOrder
|
||||||
|
? order.posMasterOrder + 1
|
||||||
|
: 1;
|
||||||
posMaster.orgRootId = orgRoot.id;
|
posMaster.orgRootId = orgRoot.id;
|
||||||
posMaster.orgRevisionId = orgRoot.orgRevisionId;
|
posMaster.orgRevisionId = orgRoot.orgRevisionId;
|
||||||
}
|
}
|
||||||
|
|
@ -1834,9 +1848,11 @@ export class PositionController extends Controller {
|
||||||
{ orgRevisionId: findDraft.id, ancestorDNA: dataPublish.ancestorDNA },
|
{ orgRevisionId: findDraft.id, ancestorDNA: dataPublish.ancestorDNA },
|
||||||
{ ancestorDNA: "" },
|
{ ancestorDNA: "" },
|
||||||
);
|
);
|
||||||
|
if (dataPublish.ancestorDNA == null || dataPublish.ancestorDNA == "")
|
||||||
|
dataPublish.ancestorDNA = dataPublish.id;
|
||||||
dataDraft.ancestorDNA = dataPublish.ancestorDNA;
|
dataDraft.ancestorDNA = dataPublish.ancestorDNA;
|
||||||
await this.posMasterRepository.save(dataDraft);
|
await this.posMasterRepository.save(dataDraft);
|
||||||
|
await this.posMasterRepository.save(dataPublish);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue