Merge pull request 'hotFix' (!2380) from hotFix-GET_LOCK into master
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #2380
Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
This commit is contained in:
Pako Natek 2024-04-27 11:14:59 +00:00
commit bb4f97102e
3 changed files with 15 additions and 6 deletions

View File

@ -30,8 +30,10 @@ BEGIN
-- Si hay colecciones sin terminar, sale del proceso -- Si hay colecciones sin terminar, sale del proceso
CALL collection_get(vUserFk); CALL collection_get(vUserFk);
SELECT (pc.maxNotReadyCollections - COUNT(*)) <= 0 SELECT (pc.maxNotReadyCollections - COUNT(*)) <= 0,
INTO vHasTooMuchCollections pc.collectionAssignLockname
INTO vHasTooMuchCollections,
vLockName
FROM tCollection FROM tCollection
JOIN productionConfig pc; JOIN productionConfig pc;
@ -47,7 +49,7 @@ BEGIN
WHERE workerFk = vUserFk; WHERE workerFk = vUserFk;
SET vLockName = CONCAT_WS('/', SET vLockName = CONCAT_WS('/',
'collection_assign', vLockName,
vWarehouseFk, vWarehouseFk,
vItemPackingTypeFk vItemPackingTypeFk
); );

View File

@ -63,7 +63,8 @@ BEGIN
o.numberOfWagons, o.numberOfWagons,
o.trainFk, o.trainFk,
o.linesLimit, o.linesLimit,
o.volumeLimit o.volumeLimit,
pc.collectionNewLockname
INTO vMaxTickets, INTO vMaxTickets,
vHasUniqueCollectionTime, vHasUniqueCollectionTime,
vWorkerCode, vWorkerCode,
@ -73,14 +74,15 @@ BEGIN
vWagons, vWagons,
vTrainFk, vTrainFk,
vLinesLimit, vLinesLimit,
vVolumeLimit vVolumeLimit,
vLockName
FROM productionConfig pc FROM productionConfig pc
JOIN worker w ON w.id = vUserFk JOIN worker w ON w.id = vUserFk
JOIN state st ON st.`code` = 'ON_PREPARATION' JOIN state st ON st.`code` = 'ON_PREPARATION'
JOIN operator o ON o.workerFk = vUserFk; JOIN operator o ON o.workerFk = vUserFk;
SET vLockName = CONCAT_WS('/', SET vLockName = CONCAT_WS('/',
'collection_new', vLockName,
vWarehouseFk, vWarehouseFk,
vItemPackingTypeFk vItemPackingTypeFk
); );

View File

@ -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';