feat: previas con sitema de reservas refs #6861 #2176

Merged
carlosap merged 64 commits from 6861-Pasar-modo-trabajo-de-previa-a-reservas into dev 2024-06-25 11:21:03 +00:00
1 changed files with 31 additions and 6 deletions
Showing only changes of commit d770cd8d48 - Show all commits

View File

@ -10,13 +10,27 @@ proc:BEGIN
* @param vCollectionFk Id de colección
*/
DECLARE vHasTooMuchCollections BOOL;
DECLARE vLockTime INT DEFAULT 15;
DECLARE vItemPackingTypeFk VARCHAR(1);
DECLARE vWarehouseFk INT;
DECLARE vLockName VARCHAR(215);
DECLARE vLockTime INT DEFAULT 30;
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
IF vLockName IS NOT NULL THEN
DO RELEASE_LOCK(vLockName);
END IF;
RESIGNAL;
END;
-- Si hay colecciones sin terminar, sale del proceso
CALL collection_get(vUserFk);
SELECT (pc.maxNotReadyCollections - COUNT(*)) <= 0
INTO vHasTooMuchCollections
SELECT (pc.maxNotReadyCollections - COUNT(*)) <= 0,
collection_assign_lockname
INTO vHasTooMuchCollections,
vLockName
FROM tCollection
jgallego marked this conversation as resolved Outdated

alias

alias
JOIN productionConfig pc ;
@ -27,8 +41,19 @@ proc:BEGIN
LEAVE proc;
jgallego marked this conversation as resolved
Review

si hi ha un throw el leave es innecesari

si hi ha un throw el leave es innecesari
END IF;
jgallego marked this conversation as resolved Outdated

castella no

castella no
IF NOT GET_LOCK('collection_getAssigned', vLockTime) THEN
LEAVE proc;
SELECT warehouseFk, itemPackingTypeFk
INTO vWarehouseFk, vItemPackingTypeFk
FROM operator
WHERE workerFk = vUserFk;
SET vLockName = CONCAT_WS('/',
vLockName,
vWarehouseFk,
vItemPackingTypeFk
);
IF NOT GET_LOCK(vLockName, vLockTime) THEN
CALL util.throw(CONCAT('Cannot get lock: ', vLockName));
END IF;
-- Se eliminan las colecciones sin asignar que estan obsoletas
@ -72,6 +97,6 @@ proc:BEGIN
CALL itemShelvingSale_addByCollection(vCollectionFk);
DO RELEASE_LOCK('collection_getAssigned');
DO RELEASE_LOCK(vLockName);
END$$
DELIMITER ;