diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index f134b7dd..b2b2985c 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -1453,7 +1453,7 @@ export class PositionController extends Controller { where: { id: In(requestBody.positionMaster) }, }); - posMasters.forEach(async (posMaster: any) => { + posMasters.forEach(async (posMaster: any, index: number) => { posMaster.orgRootId = null; posMaster.orgChild1Id = null; posMaster.orgChild2Id = null; @@ -1576,8 +1576,8 @@ export class PositionController extends Controller { const maxPosMasterOrder = Math.max(...allLastPosMasterNo.map((pos) => pos.posMasterOrder), 0); - posMaster.posMasterNo = maxPosMasterNo + 1; - posMaster.posMasterOrder = maxPosMasterOrder + 1; + posMaster.posMasterNo = maxPosMasterNo + index + 1; + posMaster.posMasterOrder = maxPosMasterOrder + index + 1; posMaster.createdUserId = request.user.sub; posMaster.createdFullName = request.user.name; posMaster.lastUpdateUserId = request.user.sub;