แก้สิทธิ์
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,
|
(x: PosMaster) => x.orgRootId == dataId && x.orgChild1Id == null,
|
||||||
) as any) {
|
) as any) {
|
||||||
delete item.id;
|
delete item.id;
|
||||||
const posMaster: any = Object.assign(new PosMaster(), item);
|
const posMaster = Object.assign(new PosMaster(), item);
|
||||||
posMaster.positions = [];
|
posMaster.positions = [];
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
@ -1274,13 +1274,12 @@ async function handler_org_draft(msg: amqp.ConsumeMessage): Promise<boolean> {
|
||||||
await posMasterRepository.save(posMaster);
|
await posMasterRepository.save(posMaster);
|
||||||
|
|
||||||
// Copy assignments
|
// Copy assignments
|
||||||
posMaster.posMasterAssigns = item.posMasterAssigns.map(
|
await posMasterAssignRepository.save(
|
||||||
({ id, ...rest }: PosMasterAssign) => ({
|
item.posMasterAssigns.map(({ id, ...rest }: PosMasterAssign) => ({
|
||||||
...rest,
|
...rest,
|
||||||
posMasterId: posMaster.id,
|
posMasterId: posMaster.id,
|
||||||
}),
|
})),
|
||||||
);
|
);
|
||||||
await posMasterRepository.save(posMaster);
|
|
||||||
|
|
||||||
// Create positions
|
// Create positions
|
||||||
for await (const pos of item.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);
|
await posMasterRepository.save(posMaster);
|
||||||
|
|
||||||
// Copy assignments
|
// Copy assignments
|
||||||
posMaster.posMasterAssigns = item.posMasterAssigns.map(
|
await posMasterAssignRepository.save(
|
||||||
({ id, ...rest }: PosMasterAssign) => ({
|
item.posMasterAssigns.map(({ id, ...rest }: PosMasterAssign) => ({
|
||||||
...rest,
|
...rest,
|
||||||
posMasterId: posMaster.id,
|
posMasterId: posMaster.id,
|
||||||
}),
|
})),
|
||||||
);
|
);
|
||||||
await posMasterRepository.save(posMaster);
|
|
||||||
|
|
||||||
// Create positions
|
// Create positions
|
||||||
for await (const pos of item.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);
|
await posMasterRepository.save(posMaster);
|
||||||
|
|
||||||
// Copy assignments
|
// Copy assignments
|
||||||
posMaster.posMasterAssigns = item.posMasterAssigns.map(
|
await posMasterAssignRepository.save(
|
||||||
({ id, ...rest }: PosMasterAssign) => ({
|
item.posMasterAssigns.map(({ id, ...rest }: PosMasterAssign) => ({
|
||||||
...rest,
|
...rest,
|
||||||
posMasterId: posMaster.id,
|
posMasterId: posMaster.id,
|
||||||
}),
|
})),
|
||||||
);
|
);
|
||||||
await posMasterRepository.save(posMaster);
|
|
||||||
|
|
||||||
// Create positions
|
// Create positions
|
||||||
for await (const pos of item.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);
|
await posMasterRepository.save(posMaster);
|
||||||
|
|
||||||
// Copy assignments
|
// Copy assignments
|
||||||
posMaster.posMasterAssigns = item.posMasterAssigns.map(
|
await posMasterAssignRepository.save(
|
||||||
({ id, ...rest }: PosMasterAssign) => ({
|
item.posMasterAssigns.map(({ id, ...rest }: PosMasterAssign) => ({
|
||||||
...rest,
|
...rest,
|
||||||
posMasterId: posMaster.id,
|
posMasterId: posMaster.id,
|
||||||
}),
|
})),
|
||||||
);
|
);
|
||||||
await posMasterRepository.save(posMaster);
|
|
||||||
|
|
||||||
// Create positions
|
// Create positions
|
||||||
for await (const pos of item.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);
|
await posMasterRepository.save(posMaster);
|
||||||
|
|
||||||
// Copy assignments
|
// Copy assignments
|
||||||
posMaster.posMasterAssigns = item.posMasterAssigns.map(
|
await posMasterAssignRepository.save(
|
||||||
({ id, ...rest }: PosMasterAssign) => ({
|
item.posMasterAssigns.map(({ id, ...rest }: PosMasterAssign) => ({
|
||||||
...rest,
|
...rest,
|
||||||
posMasterId: posMaster.id,
|
posMasterId: posMaster.id,
|
||||||
}),
|
})),
|
||||||
);
|
);
|
||||||
await posMasterRepository.save(posMaster);
|
|
||||||
|
|
||||||
// Create positions
|
// Create positions
|
||||||
for await (const pos of item.positions) {
|
for await (const pos of item.positions) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue