Merge pull request 'feat refactor setParking REGEXP refs #7575' (!2654) from 7575_setParking_regExp into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #2654 Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
commit
68b7f5baf6
|
@ -22,40 +22,42 @@ proc: BEGIN
|
||||||
CALL util.throw('parkingNotExist');
|
CALL util.throw('parkingNotExist');
|
||||||
LEAVE proc;
|
LEAVE proc;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
|
IF vParam REGEXP '^[0-9]+$' THEN
|
||||||
|
-- Se comprueba si es una preparación previa
|
||||||
|
SELECT COUNT(*) INTO vIsSaleGroup
|
||||||
|
FROM vn.saleGroup sg
|
||||||
|
WHERE sg.id = vParam;
|
||||||
|
|
||||||
-- Se comprueba si es una preparación previa
|
IF vIsSaleGroup THEN
|
||||||
SELECT COUNT(*) INTO vIsSaleGroup
|
CALL vn.saleGroup_setParking(vParam, vParkingFk);
|
||||||
FROM vn.saleGroup sg
|
LEAVE proc;
|
||||||
WHERE sg.id = vParam;
|
END IF;
|
||||||
|
|
||||||
IF vIsSaleGroup THEN
|
-- Se comprueba si es un ticket
|
||||||
CALL vn.saleGroup_setParking(vParam, vParkingFk);
|
SELECT COUNT(*) INTO vIsTicket
|
||||||
LEAVE proc;
|
FROM vn.ticket t
|
||||||
|
WHERE t.id = vParam
|
||||||
|
AND t.shipped >= TIMESTAMPADD(WEEK,-1,util.VN_CURDATE());
|
||||||
|
|
||||||
|
IF vIsTicket THEN
|
||||||
|
CALL vn.ticket_setParking(vParam, vParkingFk);
|
||||||
|
LEAVE proc;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
-- Se comprueba si es una coleccion de tickets
|
||||||
|
SELECT COUNT(*) INTO vIsCollection
|
||||||
|
FROM vn.collection c
|
||||||
|
WHERE c.id = vParam
|
||||||
|
AND c.created >= TIMESTAMPADD(WEEK,-1,util.VN_CURDATE());
|
||||||
|
|
||||||
|
IF vIsCollection THEN
|
||||||
|
CALL vn.collection_setParking(vParam, vParkingFk);
|
||||||
|
LEAVE proc;
|
||||||
|
END IF;
|
||||||
|
ELSE
|
||||||
|
-- Por descarte, se considera una matrícula
|
||||||
|
CALL vn.shelving_setParking(vParam, vParkingFk);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
-- Se comprueba si es un ticket
|
|
||||||
SELECT COUNT(*) INTO vIsTicket
|
|
||||||
FROM vn.ticket t
|
|
||||||
WHERE t.id = vParam
|
|
||||||
AND t.shipped >= TIMESTAMPADD(WEEK,-1,util.VN_CURDATE());
|
|
||||||
|
|
||||||
IF vIsTicket THEN
|
|
||||||
CALL vn.ticket_setParking(vParam, vParkingFk);
|
|
||||||
LEAVE proc;
|
|
||||||
END IF;
|
|
||||||
|
|
||||||
-- Se comprueba si es una coleccion de tickets
|
|
||||||
SELECT COUNT(*) INTO vIsCollection
|
|
||||||
FROM vn.collection c
|
|
||||||
WHERE c.id = vParam
|
|
||||||
AND c.created >= TIMESTAMPADD(WEEK,-1,util.VN_CURDATE());
|
|
||||||
|
|
||||||
IF vIsCollection THEN
|
|
||||||
CALL vn.collection_setParking(vParam, vParkingFk);
|
|
||||||
LEAVE proc;
|
|
||||||
END IF;
|
|
||||||
|
|
||||||
-- Por descarte, se considera una matrícula
|
|
||||||
CALL vn.shelving_setParking(vParam, vParkingFk);
|
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
Loading…
Reference in New Issue