7152-devToTest_2414 #2228

Merged
alexm merged 636 commits from 7152-devToTest_2414 into test 2024-03-28 08:26: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 vLockName VARCHAR(215);
DECLARE vLockTime INT DEFAULT 15; DECLARE vLockTime INT DEFAULT 15;
DECLARE vFreeWagonFk INT; DECLARE vFreeWagonFk INT;
DECLARE c1 CURSOR FOR DECLARE c1 CURSOR FOR
SELECT ticketFk, `lines`, m3 SELECT ticketFk, `lines`, m3
FROM tmp.productionBuffer FROM tmp.productionBuffer
@ -44,13 +45,21 @@ proc:BEGIN
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; 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, SELECT pc.ticketTrolleyMax * o.numberOfWagons,
pc.hasUniqueCollectionTime, pc.hasUniqueCollectionTime,
w.code, w.code,
o.warehouseFk, o.warehouseFk,
o.itemPackingTypeFk, o.itemPackingTypeFk,
st.code, st.code,
CONCAT('collection_new', o.warehouseFk, ':',o.itemPackingTypeFk),
o.numberOfWagons, o.numberOfWagons,
o.trainFk, o.trainFk,
o.linesLimit, o.linesLimit,
@ -61,7 +70,6 @@ proc:BEGIN
vWarehouseFk, vWarehouseFk,
vItemPackingTypeFk, vItemPackingTypeFk,
vStateFk, vStateFk,
vLockName,
vWagons, vWagons,
vTrainFk, vTrainFk,
vLinesLimit, vLinesLimit,
@ -71,6 +79,12 @@ proc:BEGIN
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('/',
'collection_new',
vWarehouseFk,
vItemPackingTypeFk
);
IF NOT GET_LOCK(vLockName, vLockTime) THEN IF NOT GET_LOCK(vLockName, vLockTime) THEN
LEAVE proc; LEAVE proc;
END IF; END IF;