7336_devToTest #2414
|
@ -0,0 +1,13 @@
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`connection_kill`(
|
||||||
|
vConnectionId BIGINT
|
||||||
|
)
|
||||||
|
BEGIN
|
||||||
|
/**
|
||||||
|
* Kill a connection
|
||||||
|
*
|
||||||
|
* @param vConnectionId
|
||||||
|
*/
|
||||||
|
KILL vConnectionId;
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
|
@ -30,10 +30,9 @@ 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
|
||||||
INTO vHasTooMuchCollections
|
FROM productionConfig pc
|
||||||
FROM tCollection
|
LEFT JOIN tCollection ON TRUE;
|
||||||
JOIN productionConfig pc;
|
|
||||||
|
|
||||||
DROP TEMPORARY TABLE tCollection;
|
DROP TEMPORARY TABLE tCollection;
|
||||||
|
|
||||||
|
@ -47,7 +46,7 @@ BEGIN
|
||||||
WHERE workerFk = vUserFk;
|
WHERE workerFk = vUserFk;
|
||||||
|
|
||||||
SET vLockName = CONCAT_WS('/',
|
SET vLockName = CONCAT_WS('/',
|
||||||
'collection_assign',
|
vLockName,
|
||||||
vWarehouseFk,
|
vWarehouseFk,
|
||||||
vItemPackingTypeFk
|
vItemPackingTypeFk
|
||||||
);
|
);
|
||||||
|
|
|
@ -63,7 +63,8 @@ BEGIN
|
||||||
o.numberOfWagons,
|
o.numberOfWagons,
|
||||||
o.trainFk,
|
o.trainFk,
|
||||||
o.linesLimit,
|
o.linesLimit,
|
||||||
o.volumeLimit
|
o.volumeLimit,
|
||||||
|
pc.collection_new_lockname
|
||||||
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
|
||||||
);
|
);
|
||||||
|
|
|
@ -79,6 +79,10 @@ BEGIN
|
||||||
ORDER BY (vQuantity % `grouping`) ASC
|
ORDER BY (vQuantity % `grouping`) ASC
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
|
|
||||||
|
IF vNewPrice IS NULL THEN
|
||||||
|
CALL util.throw('price retrieval failed');
|
||||||
|
END IF;
|
||||||
|
|
||||||
IF vNewPrice > vOldPrice THEN
|
IF vNewPrice > vOldPrice THEN
|
||||||
SET vFinalPrice = vOldPrice;
|
SET vFinalPrice = vOldPrice;
|
||||||
SET vOption = 'substitution';
|
SET vOption = 'substitution';
|
||||||
|
@ -90,7 +94,8 @@ BEGIN
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
|
|
||||||
UPDATE sale
|
UPDATE sale
|
||||||
SET quantity = quantity - vQuantity
|
SET originalQuantity = quantity - vQuantity,
|
||||||
|
quantity = quantity - vQuantity
|
||||||
WHERE id = vSaleFk;
|
WHERE id = vSaleFk;
|
||||||
|
|
||||||
INSERT INTO vn.sale(ticketFk,
|
INSERT INTO vn.sale(ticketFk,
|
||||||
|
@ -100,7 +105,8 @@ BEGIN
|
||||||
price)
|
price)
|
||||||
SELECT vTicketFk,
|
SELECT vTicketFk,
|
||||||
vNewItemFk,
|
vNewItemFk,
|
||||||
CEIL(vQuantity / vRoundQuantity) * vRoundQuantity, CONCAT('+ ', i.name),
|
CEIL(vQuantity / vRoundQuantity) * vRoundQuantity,
|
||||||
|
CONCAT('+ ', i.name),
|
||||||
vFinalPrice
|
vFinalPrice
|
||||||
FROM vn.item i
|
FROM vn.item i
|
||||||
WHERE id = vNewItemFk;
|
WHERE id = vNewItemFk;
|
||||||
|
|
|
@ -63,7 +63,7 @@ BEGIN
|
||||||
INSERT INTO ticketPackaging (ticketFk, packagingFk, quantity)
|
INSERT INTO ticketPackaging (ticketFk, packagingFk, quantity)
|
||||||
(SELECT vCurTicketFk, p.id, COUNT(*)
|
(SELECT vCurTicketFk, p.id, COUNT(*)
|
||||||
FROM expedition e
|
FROM expedition e
|
||||||
JOIN packaging p ON p.itemFk = e.freightItemFk
|
JOIN packaging p ON p.id = e.packagingFk
|
||||||
WHERE e.ticketFk = vCurTicketFk AND p.isPackageReturnable
|
WHERE e.ticketFk = vCurTicketFk AND p.isPackageReturnable
|
||||||
AND vWithPackage
|
AND vWithPackage
|
||||||
GROUP BY p.itemFk);
|
GROUP BY p.itemFk);
|
||||||
|
|
|
@ -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';
|
|
@ -0,0 +1,3 @@
|
||||||
|
-- Place your SQL code here
|
||||||
|
ALTER TABLE vn.productionConfig ADD collection_new_lockname varchar(100) DEFAULT 'collection_new' NOT NULL COMMENT 'Lockname value for proc vn.collection_new';
|
||||||
|
ALTER TABLE vn.productionConfig ADD collection_assign_lockname varchar(100) DEFAULT 'collection_assign' NULL COMMENT 'Lockname value for proc vn.collection_new';
|
|
@ -0,0 +1,13 @@
|
||||||
|
|
||||||
|
ALTER TABLE vn.productionConfig
|
||||||
|
DROP COLUMN IF EXISTS collectionNewLockname,
|
||||||
|
DROP COLUMN IF EXISTS collectionAssignLockname;
|
||||||
|
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`connection_kill`()
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
||||||
|
|
||||||
|
GRANT EXECUTE ON PROCEDURE util.connection_kill TO 'developer';
|
|
@ -49,8 +49,7 @@ module.exports = Self => {
|
||||||
JOIN vn.agencyMode am ON am.id = r.agencyModeFk
|
JOIN vn.agencyMode am ON am.id = r.agencyModeFk
|
||||||
JOIN vn.agency ag ON ag.id = am.agencyFk
|
JOIN vn.agency ag ON ag.id = am.agencyFk
|
||||||
LEFT JOIN vn.userConfig uc ON uc.userFk = account.myUser_getId()
|
LEFT JOIN vn.userConfig uc ON uc.userFk = account.myUser_getId()
|
||||||
WHERE (r.created = util.VN_CURDATE() OR r.created = util.yesterday())
|
WHERE t.routeFk = ?
|
||||||
AND t.routeFk = ?
|
|
||||||
GROUP BY t.addressFk, e.itemPackingTypeFk
|
GROUP BY t.addressFk, e.itemPackingTypeFk
|
||||||
) sub
|
) sub
|
||||||
GROUP BY addressFk
|
GROUP BY addressFk
|
||||||
|
|
Loading…
Reference in New Issue