8355-testToMaster #3336
|
@ -91,13 +91,7 @@ module.exports = Self => {
|
||||||
return posA - posB;
|
return posA - posB;
|
||||||
});
|
});
|
||||||
|
|
||||||
const coordsString = coords
|
return coords;
|
||||||
.map(item => `point=${item.latitude},${item.longitude}`)
|
|
||||||
.join('&');
|
|
||||||
return {
|
|
||||||
coords,
|
|
||||||
view: `https://graphhopper.com/maps/?${coordsString}&profile=small_truck`
|
|
||||||
};
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
switch (err.response?.data?.code) {
|
switch (err.response?.data?.code) {
|
||||||
case 'NoTrips':
|
case 'NoTrips':
|
||||||
|
|
|
@ -4035,3 +4035,6 @@ INSERT IGNORE INTO vn.saySimpleConfig (url, defaultChannel)
|
||||||
|
|
||||||
INSERT INTO vn.workerIrpf (workerFk,spouseNif, geographicMobilityDate)
|
INSERT INTO vn.workerIrpf (workerFk,spouseNif, geographicMobilityDate)
|
||||||
VALUES (1106,'26493101E','2019-09-20');
|
VALUES (1106,'26493101E','2019-09-20');
|
||||||
|
|
||||||
|
INSERT INTO vn.osrmConfig (id,url,tolerance)
|
||||||
|
VALUES (1,'https://router.project-osrm.org', 0.002);
|
||||||
|
|
|
@ -82,7 +82,7 @@ module.exports = Self => {
|
||||||
// Revisamos las coincidencias y actualizamos la prioridad en el array
|
// Revisamos las coincidencias y actualizamos la prioridad en el array
|
||||||
const addressPositions = await models.OsrmConfig.optimize(addressIds, firstAddress, lastAddress, myOptions);
|
const addressPositions = await models.OsrmConfig.optimize(addressIds, firstAddress, lastAddress, myOptions);
|
||||||
await Promise.all(ticketAddress.map(async i => {
|
await Promise.all(ticketAddress.map(async i => {
|
||||||
const foundPosition = addressPositions.coords.find(item => item.addressId === i.addressId);
|
const foundPosition = addressPositions.find(item => item.addressId === i.addressId);
|
||||||
if (foundPosition) i.priority = foundPosition.position + (maxPosition + 1);
|
if (foundPosition) i.priority = foundPosition.position + (maxPosition + 1);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue