Merge branch '7683-productionControlDeadlock' of https://gitea.verdnatura.es/verdnatura/salix into 7683-productionControlDeadlock
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
57efba8601
|
@ -13,7 +13,7 @@ module.exports = Self => {
|
||||||
required: true
|
required: true
|
||||||
}],
|
}],
|
||||||
returns: {
|
returns: {
|
||||||
type: ['object'],
|
type: 'boolean',
|
||||||
root: true
|
root: true
|
||||||
},
|
},
|
||||||
http: {
|
http: {
|
||||||
|
@ -39,6 +39,7 @@ module.exports = Self => {
|
||||||
const xmlString = response.data;
|
const xmlString = response.data;
|
||||||
const parser = new DOMParser();
|
const parser = new DOMParser();
|
||||||
const xmlDoc = parser.parseFromString(xmlString, 'text/xml');
|
const xmlDoc = parser.parseFromString(xmlString, 'text/xml');
|
||||||
return xmlDoc.getElementsByTagName('Mensaje')[0].textContent;
|
const result = xmlDoc.getElementsByTagName('Mensaje')[0].textContent;
|
||||||
|
return result.toLowerCase().includes('se ha cancelado correctamente');
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,19 +10,20 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`item_comparative`(
|
||||||
)
|
)
|
||||||
proc: BEGIN
|
proc: BEGIN
|
||||||
/**
|
/**
|
||||||
* Genera una tabla de comparativa de artículos por itemType/comprador/fecha.
|
* Generates a comparison table of items by itemType/buyer/date.
|
||||||
* Los datos se calculan en función de los parámetros proporcionados.
|
* The data is calculated based on the provided parameters.
|
||||||
*
|
*
|
||||||
* @param vDate La fecha para la cual se generará la comparativa.
|
* @param vDate The date for which the comparison will be generated.
|
||||||
* @param vDayRange El rango de días a considerar para la comparativa.
|
* @param vDayRange The range of days to consider for the comparison.
|
||||||
* @param vWarehouseFk El identificador del almacén para filtrar los artículos.
|
* @param vWarehouseFk The warehouse identifier to filter the items.
|
||||||
* @param vAvailableSince La fecha de disponibilidad desde la cual se consideran los artículos disponibles.
|
* @param vAvailableSince The availability date from which the items are considered available.
|
||||||
* @param vBuyerFk El identificador del comprador para filtrar los artículos.
|
* @param vBuyerFk The buyer identifier to filter the items.
|
||||||
* @param vIsFloramondo Indica si se deben incluir solo los artículos de Floramondo (opcional).
|
* @param vIsFloramondo Indicates whether only Floramondo items should be included (optional).
|
||||||
* @param vCountryFk El identificador del país.
|
* @param vCountryFk The country identifier.
|
||||||
* @param tmp.comparativeFilterType(filterFk INT ,itemTypeFk INT)
|
* @param tmp.comparativeFilterType(filterFk INT, itemTypeFk INT)
|
||||||
* @return tmp.comparative
|
* @return tmp.comparative
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DECLARE vDayRangeStart DATE;
|
DECLARE vDayRangeStart DATE;
|
||||||
DECLARE vDayRangeEnd DATE;
|
DECLARE vDayRangeEnd DATE;
|
||||||
DECLARE w1, w2, w3, w4, w5, w6, w7 INT;
|
DECLARE w1, w2, w3, w4, w5, w6, w7 INT;
|
||||||
|
|
|
@ -46,12 +46,18 @@ BEGIN
|
||||||
i.tag8 = JSON_VALUE(vTags, '$.8'),
|
i.tag8 = JSON_VALUE(vTags, '$.8'),
|
||||||
i.tag9 = JSON_VALUE(vTags, '$.9'),
|
i.tag9 = JSON_VALUE(vTags, '$.9'),
|
||||||
i.tag10 = JSON_VALUE(vTags, '$.10'),
|
i.tag10 = JSON_VALUE(vTags, '$.10'),
|
||||||
|
i.tag11 = JSON_VALUE(vTags, '$.11'),
|
||||||
|
i.tag12 = JSON_VALUE(vTags, '$.12'),
|
||||||
|
i.tag13 = JSON_VALUE(vTags, '$.13'),
|
||||||
i.value5 = JSON_VALUE(vValues, '$.5'),
|
i.value5 = JSON_VALUE(vValues, '$.5'),
|
||||||
i.value6 = JSON_VALUE(vValues, '$.6'),
|
i.value6 = JSON_VALUE(vValues, '$.6'),
|
||||||
i.value7 = JSON_VALUE(vValues, '$.7'),
|
i.value7 = JSON_VALUE(vValues, '$.7'),
|
||||||
i.value8 = JSON_VALUE(vValues, '$.8'),
|
i.value8 = JSON_VALUE(vValues, '$.8'),
|
||||||
i.value9 = JSON_VALUE(vValues, '$.9'),
|
i.value9 = JSON_VALUE(vValues, '$.9'),
|
||||||
i.value10 = JSON_VALUE(vValues, '$.10'),
|
i.value10 = JSON_VALUE(vValues, '$.10'),
|
||||||
|
i.value11 = JSON_VALUE(vValues, '$.11'),
|
||||||
|
i.value12 = JSON_VALUE(vValues, '$.12'),
|
||||||
|
i.value13 = JSON_VALUE(vValues, '$.13'),
|
||||||
i.producerFk = p.id,
|
i.producerFk = p.id,
|
||||||
i.inkFk = k.id,
|
i.inkFk = k.id,
|
||||||
i.originFk = IFNULL(o.id, i.originFk)
|
i.originFk = IFNULL(o.id, i.originFk)
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
ALTER TABLE vn.item ADD IF NOT EXISTS tag11 varchar(20) DEFAULT NULL NULL;
|
||||||
|
ALTER TABLE vn.item ADD IF NOT EXISTS value11 varchar(50) DEFAULT NULL NULL;
|
||||||
|
|
||||||
|
ALTER TABLE vn.item ADD IF NOT EXISTS tag12 varchar(20) DEFAULT NULL NULL;
|
||||||
|
ALTER TABLE vn.item ADD IF NOT EXISTS value12 varchar(50) DEFAULT NULL NULL;
|
||||||
|
|
||||||
|
ALTER TABLE vn.item ADD IF NOT EXISTS tag13 varchar(20) DEFAULT NULL NULL;
|
||||||
|
ALTER TABLE vn.item ADD IF NOT EXISTS value13 varchar(50) DEFAULT NULL NULL;
|
|
@ -44,15 +44,21 @@ module.exports = Self => {
|
||||||
|
|
||||||
const expedition = await models.Expedition.findOne(filter);
|
const expedition = await models.Expedition.findOne(filter);
|
||||||
const {code} = expedition.agencyMode();
|
const {code} = expedition.agencyMode();
|
||||||
|
let isDeleted = true;
|
||||||
|
|
||||||
if (code && code.toLowerCase().substring(0, 10) == 'viaexpress') {
|
if (code?.toLowerCase()?.includes('mrw')) {
|
||||||
const isDeleted = await models.ViaexpressConfig.deleteExpedition(expeditionId);
|
const result = await models.MrwConfig.cancelShipment(expeditionId);
|
||||||
|
isDeleted = result;
|
||||||
|
}
|
||||||
|
|
||||||
if (isDeleted === 'true') {
|
if (code?.toLowerCase()?.substring(0, 10) == 'viaexpress') {
|
||||||
const deletedExpedition = await models.Expedition.destroyById(expeditionId);
|
const result = await models.ViaexpressConfig.deleteExpedition(expeditionId);
|
||||||
deletedExpeditions.push(deletedExpedition);
|
if (result !== 'true') isDeleted = false;
|
||||||
} else notDeletedExpeditions.push(expeditionId);
|
}
|
||||||
} else {
|
|
||||||
|
if (!isDeleted)
|
||||||
|
notDeletedExpeditions.push(expeditionId);
|
||||||
|
else {
|
||||||
const deletedExpedition = await models.Expedition.destroyById(expeditionId);
|
const deletedExpedition = await models.Expedition.destroyById(expeditionId);
|
||||||
deletedExpeditions.push(deletedExpedition);
|
deletedExpeditions.push(deletedExpedition);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue