refs #5858 fix rename file #2214

Merged
jsegarra merged 4 commits from #5858_fix_extension into dev 2024-03-27 06:01:34 +00:00
1 changed files with 20 additions and 6 deletions
Showing only changes of commit e22122e577 - Show all commits

View File

@ -28,6 +28,7 @@ proc:BEGIN
DECLARE vLockName VARCHAR(215);
DECLARE vLockTime INT DEFAULT 15;
DECLARE vFreeWagonFk INT;
DECLARE c1 CURSOR FOR
SELECT ticketFk, `lines`, m3
FROM tmp.productionBuffer
@ -44,13 +45,21 @@ proc:BEGIN
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
IF vLockName IS NOT NULL THEN
DO RELEASE_LOCK(vLockName);
END IF;
RESIGNAL;
END;
SELECT pc.ticketTrolleyMax * o.numberOfWagons,
pc.hasUniqueCollectionTime,
w.code,
o.warehouseFk,
o.itemPackingTypeFk,
st.code,
CONCAT('collection_new', o.warehouseFk, ':',o.itemPackingTypeFk),
o.numberOfWagons,
o.trainFk,
o.linesLimit,
@ -61,7 +70,6 @@ proc:BEGIN
vWarehouseFk,
vItemPackingTypeFk,
vStateFk,
vLockName,
vWagons,
vTrainFk,
vLinesLimit,
@ -71,6 +79,12 @@ proc:BEGIN
JOIN state st ON st.`code` = 'ON_PREPARATION'
JOIN operator o ON o.workerFk = vUserFk;
SET vLockName = CONCAT_WS('/',
'collection_new',
vWarehouseFk,
vItemPackingTypeFk
);
IF NOT GET_LOCK(vLockName, vLockTime) THEN
LEAVE proc;
END IF;