diff --git a/db/routines/vn/procedures/collection_assign.sql b/db/routines/vn/procedures/collection_assign.sql index f6000e87d..47efa7cd3 100644 --- a/db/routines/vn/procedures/collection_assign.sql +++ b/db/routines/vn/procedures/collection_assign.sql @@ -30,8 +30,10 @@ BEGIN -- Si hay colecciones sin terminar, sale del proceso CALL collection_get(vUserFk); - SELECT (pc.maxNotReadyCollections - COUNT(*)) <= 0 - INTO vHasTooMuchCollections + SELECT (pc.maxNotReadyCollections - COUNT(*)) <= 0, + pc.collectionAssignLockname + INTO vHasTooMuchCollections, + vLockName FROM tCollection JOIN productionConfig pc; @@ -47,7 +49,7 @@ BEGIN WHERE workerFk = vUserFk; SET vLockName = CONCAT_WS('/', - 'collection_assign', + vLockName, vWarehouseFk, vItemPackingTypeFk ); diff --git a/db/routines/vn/procedures/collection_new.sql b/db/routines/vn/procedures/collection_new.sql index f3767ddf3..f207eb2b0 100644 --- a/db/routines/vn/procedures/collection_new.sql +++ b/db/routines/vn/procedures/collection_new.sql @@ -63,7 +63,8 @@ BEGIN o.numberOfWagons, o.trainFk, o.linesLimit, - o.volumeLimit + o.volumeLimit, + pc.collectionNewLockname INTO vMaxTickets, vHasUniqueCollectionTime, vWorkerCode, @@ -73,14 +74,15 @@ BEGIN vWagons, vTrainFk, vLinesLimit, - vVolumeLimit + vVolumeLimit, + vLockName FROM productionConfig pc JOIN worker w ON w.id = vUserFk JOIN state st ON st.`code` = 'ON_PREPARATION' JOIN operator o ON o.workerFk = vUserFk; SET vLockName = CONCAT_WS('/', - 'collection_new', + vLockName, vWarehouseFk, vItemPackingTypeFk ); diff --git a/db/versions/11016-pinkAralia/00-firstScript.sql b/db/versions/11016-pinkAralia/00-firstScript.sql new file mode 100644 index 000000000..de090013d --- /dev/null +++ b/db/versions/11016-pinkAralia/00-firstScript.sql @@ -0,0 +1,5 @@ +-- Place your SQL code here +ALTER TABLE vn.productionConfig ADD collectionNewLockname varchar(100) + DEFAULT 'collection_new' NOT NULL COMMENT 'Lockname value for proc vn.collection_new'; +ALTER TABLE vn.productionConfig ADD collectionAssignLockname varchar(100) + DEFAULT 'collection_assign' NULL COMMENT 'Lockname value for proc vn.collection_new';