feat: refs #7685 delivery coordinates #2706
|
@ -0,0 +1,25 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`address_updateCoordinates`(
|
||||
vTicketFk INT,
|
||||
vLongitude INT,
|
||||
vLatitude INT)
|
||||
BEGIN
|
||||
/**
|
||||
* Actualiza las coordenadas de una dirección.
|
||||
robert marked this conversation as resolved
Outdated
|
||||
*
|
||||
* @param vTicketFk Id del ticket
|
||||
robert marked this conversation as resolved
Outdated
guillermo
commented
Al empezar la descripción siempre mayuscula sin punto al final Al empezar la descripción siempre mayuscula sin punto al final
|
||||
* @param vLongitude Longitud de la dirección
|
||||
robert marked this conversation as resolved
Outdated
guillermo
commented
Acentos Acentos
|
||||
* @param vLatitude Latitud de la dirección
|
||||
*/
|
||||
DECLARE vAddressFK INT;
|
||||
|
||||
SELECT addressFK INTO vAddressFK
|
||||
FROM ticket
|
||||
WHERE id = vTicketFk;
|
||||
|
||||
UPDATE address
|
||||
SET longitude = vLongitude,
|
||||
latitude = vLatitude
|
||||
WHERE id = vAddressFK;
|
||||
END$$
|
||||
robert marked this conversation as resolved
guillermo
commented
Quitar salto de linea Quitar salto de linea
|
||||
DELIMITER ;
|
|
@ -3,18 +3,11 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`delivery_beforeInsert
|
|||
BEFORE INSERT ON `delivery`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
|
||||
IF (NEW.longitude IS NOT NULL AND NEW.latitude IS NOT NULL AND NEW.ticketFK IS NOT NULL)
|
||||
IF (NEW.longitude IS NOT NULL
|
||||
AND NEW.latitude IS NOT NULL
|
||||
robert marked this conversation as resolved
Outdated
guillermo
commented
Sobrepasa los caracteres máximos por linea, aplica esto al otro tmb Sobrepasa los caracteres máximos por linea, aplica esto al otro tmb
|
||||
AND NEW.ticketFK IS NOT NULL)
|
||||
robert marked this conversation as resolved
Outdated
guillermo
commented
address_updateCoordinates(NEW.ticketFk, NEW.longitude, NEW.latitude); Espacio despues de coma, aplica esto al otro tmb address_updateCoordinates(NEW.ticketFk, NEW.longitude, NEW.latitude);
Espacio despues de coma, aplica esto al otro tmb
|
||||
THEN
|
||||
UPDATE address
|
||||
SET longitude = NEW.longitude,
|
||||
latitude = NEW.latitude
|
||||
WHERE id IN (
|
||||
SELECT addressFK
|
||||
FROM ticket
|
||||
WHERE id = NEW.ticketFk
|
||||
);
|
||||
CALL address_updateCoordinates(NEW.ticketFk, NEW.longitude, NEW.latitude);
|
||||
END IF;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -3,18 +3,11 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`delivery_beforeUpdate
|
|||
BEFORE UPDATE ON `delivery`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
|
||||
IF (NEW.longitude IS NOT NULL AND NEW.latitude IS NOT NULL AND NEW.ticketFK IS NOT NULL)
|
||||
IF (NEW.longitude IS NOT NULL
|
||||
AND NEW.latitude IS NOT NULL
|
||||
AND NEW.ticketFK IS NOT NULL)
|
||||
THEN
|
||||
UPDATE address
|
||||
SET longitude = NEW.longitude,
|
||||
latitude = NEW.latitude
|
||||
WHERE id IN (
|
||||
SELECT addressFK
|
||||
FROM ticket
|
||||
WHERE id = NEW.ticketFk
|
||||
);
|
||||
CALL address_updateCoordinates(NEW.ticketFk, NEW.longitude, NEW.latitude);
|
||||
END IF;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
Loading…
Reference in New Issue
Actualiza las coordenadas de una dirección. (Acento y punto al final)
El punto del final, te lo he puesto en el anterior comentario...