แก้สิทธิ์
This commit is contained in:
parent
870ce7dfdd
commit
a0244f2b61
1 changed files with 16 additions and 21 deletions
|
|
@ -1238,7 +1238,7 @@ async function handler_org_draft(msg: amqp.ConsumeMessage): Promise<boolean> {
|
|||
(x: PosMaster) => x.orgRootId == dataId && x.orgChild1Id == null,
|
||||
) as any) {
|
||||
delete item.id;
|
||||
const posMaster: any = Object.assign(new PosMaster(), item);
|
||||
const posMaster = Object.assign(new PosMaster(), item);
|
||||
posMaster.positions = [];
|
||||
|
||||
if (
|
||||
|
|
@ -1274,13 +1274,12 @@ async function handler_org_draft(msg: amqp.ConsumeMessage): Promise<boolean> {
|
|||
await posMasterRepository.save(posMaster);
|
||||
|
||||
// Copy assignments
|
||||
posMaster.posMasterAssigns = item.posMasterAssigns.map(
|
||||
({ id, ...rest }: PosMasterAssign) => ({
|
||||
await posMasterAssignRepository.save(
|
||||
item.posMasterAssigns.map(({ id, ...rest }: PosMasterAssign) => ({
|
||||
...rest,
|
||||
posMasterId: posMaster.id,
|
||||
}),
|
||||
})),
|
||||
);
|
||||
await posMasterRepository.save(posMaster);
|
||||
|
||||
// Create positions
|
||||
for await (const pos of item.positions) {
|
||||
|
|
@ -1365,13 +1364,12 @@ async function handler_org_draft(msg: amqp.ConsumeMessage): Promise<boolean> {
|
|||
await posMasterRepository.save(posMaster);
|
||||
|
||||
// Copy assignments
|
||||
posMaster.posMasterAssigns = item.posMasterAssigns.map(
|
||||
({ id, ...rest }: PosMasterAssign) => ({
|
||||
await posMasterAssignRepository.save(
|
||||
item.posMasterAssigns.map(({ id, ...rest }: PosMasterAssign) => ({
|
||||
...rest,
|
||||
posMasterId: posMaster.id,
|
||||
}),
|
||||
})),
|
||||
);
|
||||
await posMasterRepository.save(posMaster);
|
||||
|
||||
// Create positions
|
||||
for await (const pos of item.positions) {
|
||||
|
|
@ -1458,13 +1456,12 @@ async function handler_org_draft(msg: amqp.ConsumeMessage): Promise<boolean> {
|
|||
await posMasterRepository.save(posMaster);
|
||||
|
||||
// Copy assignments
|
||||
posMaster.posMasterAssigns = item.posMasterAssigns.map(
|
||||
({ id, ...rest }: PosMasterAssign) => ({
|
||||
await posMasterAssignRepository.save(
|
||||
item.posMasterAssigns.map(({ id, ...rest }: PosMasterAssign) => ({
|
||||
...rest,
|
||||
posMasterId: posMaster.id,
|
||||
}),
|
||||
})),
|
||||
);
|
||||
await posMasterRepository.save(posMaster);
|
||||
|
||||
// Create positions
|
||||
for await (const pos of item.positions) {
|
||||
|
|
@ -1553,13 +1550,12 @@ async function handler_org_draft(msg: amqp.ConsumeMessage): Promise<boolean> {
|
|||
await posMasterRepository.save(posMaster);
|
||||
|
||||
// Copy assignments
|
||||
posMaster.posMasterAssigns = item.posMasterAssigns.map(
|
||||
({ id, ...rest }: PosMasterAssign) => ({
|
||||
await posMasterAssignRepository.save(
|
||||
item.posMasterAssigns.map(({ id, ...rest }: PosMasterAssign) => ({
|
||||
...rest,
|
||||
posMasterId: posMaster.id,
|
||||
}),
|
||||
})),
|
||||
);
|
||||
await posMasterRepository.save(posMaster);
|
||||
|
||||
// Create positions
|
||||
for await (const pos of item.positions) {
|
||||
|
|
@ -1651,13 +1647,12 @@ async function handler_org_draft(msg: amqp.ConsumeMessage): Promise<boolean> {
|
|||
await posMasterRepository.save(posMaster);
|
||||
|
||||
// Copy assignments
|
||||
posMaster.posMasterAssigns = item.posMasterAssigns.map(
|
||||
({ id, ...rest }: PosMasterAssign) => ({
|
||||
await posMasterAssignRepository.save(
|
||||
item.posMasterAssigns.map(({ id, ...rest }: PosMasterAssign) => ({
|
||||
...rest,
|
||||
posMasterId: posMaster.id,
|
||||
}),
|
||||
})),
|
||||
);
|
||||
await posMasterRepository.save(posMaster);
|
||||
|
||||
// Create positions
|
||||
for await (const pos of item.positions) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue