hotFix collection_assign #2384
|
@ -16,6 +16,7 @@ BEGIN
|
||||||
DECLARE vItemPackingTypeFk VARCHAR(1);
|
DECLARE vItemPackingTypeFk VARCHAR(1);
|
||||||
DECLARE vWarehouseFk INT;
|
DECLARE vWarehouseFk INT;
|
||||||
DECLARE vLockName VARCHAR(215);
|
DECLARE vLockName VARCHAR(215);
|
||||||
|
DECLARE vLockTime INT DEFAULT 30;
|
||||||
|
|
||||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -33,8 +34,8 @@ BEGIN
|
||||||
pc.collectionAssignLockname
|
pc.collectionAssignLockname
|
||||||
INTO vHasTooMuchCollections,
|
INTO vHasTooMuchCollections,
|
||||||
vLockName
|
vLockName
|
||||||
FROM tCollection
|
FROM productionConfig pc
|
||||||
JOIN productionConfig pc;
|
LEFT JOIN tCollection;
|
||||||
|
|
||||||
DROP TEMPORARY TABLE tCollection;
|
DROP TEMPORARY TABLE tCollection;
|
||||||
|
|
||||||
|
@ -53,6 +54,10 @@ BEGIN
|
||||||
vItemPackingTypeFk
|
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
|
-- Se eliminan las colecciones sin asignar que estan obsoletas
|
||||||
INSERT INTO ticketTracking(stateFk, ticketFk)
|
INSERT INTO ticketTracking(stateFk, ticketFk)
|
||||||
SELECT s.id, tc.ticketFk
|
SELECT s.id, tc.ticketFk
|
||||||
|
|
Loading…
Reference in New Issue