Fix check tipo documento trasferimenti interni in spostaUl
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250909162127 extends BaseMigration implements MigrationModelInterface {
|
||||
@@ -10,7 +10,8 @@ public class Migration_20250909162127 extends BaseMigration implements Migration
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
if (!isCustomer(IntegryCustomer.Biolevante))
|
||||
|
||||
if (!isCustomerDb(IntegryCustomerDB.Biolevante_Biolevante))
|
||||
return;
|
||||
|
||||
executeStatement(
|
||||
|
||||
@@ -1222,7 +1222,7 @@ public class WMSGenericService {
|
||||
if (UtilityString.isNullOrEmpty(sourceMtbColr.getBarcodeUlIn()))
|
||||
throw new MissingDataException("Il barcode UL in input non può essere nullo");
|
||||
|
||||
MtbColt anagUl = WMSUtility.retrieveBarcodeUlAnag(multiDBTransactionManager.getPrimaryConnection(),sourceMtbColr.getBarcodeUlIn());
|
||||
MtbColt anagUl = WMSUtility.retrieveBarcodeUlAnag(multiDBTransactionManager.getPrimaryConnection(), sourceMtbColr.getBarcodeUlIn());
|
||||
if (anagUl == null)
|
||||
throw new Exception("Il barcode UL in input non esiste nel sistema");
|
||||
/*
|
||||
@@ -1254,7 +1254,7 @@ public class WMSGenericService {
|
||||
|
||||
|
||||
//<editor-fold desc="se il collo che voglio rettificare ha già altri movimenti agganciati forzo la creazione di un nuovo collo">
|
||||
Integer movimentiBarcode = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), "SELECT COUNT(*) FROM mtb_colr WHERE barcode_ul_out = "+UtilityDB.valueToString(sourceMtbColr.getBarcodeUlIn()));
|
||||
Integer movimentiBarcode = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), "SELECT COUNT(*) FROM mtb_colr WHERE barcode_ul_out = " + UtilityDB.valueToString(sourceMtbColr.getBarcodeUlIn()));
|
||||
createNewCollo = movimentiBarcode > 0 || createNewCollo;
|
||||
//</editor-fold>
|
||||
|
||||
@@ -2108,37 +2108,48 @@ public class WMSGenericService {
|
||||
//<editor-fold desc="Creazione movimento di magazzino">
|
||||
|
||||
//<editor-fold desc="DA CONTROLLARE!!">
|
||||
String codDtipToUse = setupGest.getSetupDepo(multiDBTransactionManager.getPrimaryConnection(), "PICKING", "LOGISTICA", "COD_DTIP_DOC_TRASF_INTERNI", codMdepArrivo);
|
||||
boolean shouldGenerateDoc = requestDTO.isCreateDocAutomatically() && !UtilityString.equalsIgnoreCase(codMdepPartenza, codMdepArrivo);
|
||||
|
||||
if (UtilityString.isNullOrEmpty(codDtipToUse))
|
||||
throw new Exception("La configurazione della setup gest non è completa per gestire gli spostamenti tra depositi");
|
||||
|
||||
String sql = Query.format(
|
||||
"SELECT segno_qta_car - segno_qta_scar FROM dtb_tipi WHERE cod_dtip = %s",
|
||||
codDtipToUse
|
||||
);
|
||||
|
||||
short segno = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||
String codMdepDoc;
|
||||
String codAnag;
|
||||
String codVdes;
|
||||
|
||||
if (segno > 0) {
|
||||
codMdepDoc = codMdepArrivo;
|
||||
|
||||
MtbDepo mtbDepoPartenza = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(),
|
||||
Query.format("SELECT * FROM mtb_depo WHERE cod_mdep = {}", codMdepPartenza), MtbDepo.class);
|
||||
|
||||
codAnag = mtbDepoPartenza.getCodAnag();
|
||||
codVdes = mtbDepoPartenza.getCodVdes();
|
||||
} else {
|
||||
if (!shouldGenerateDoc) {
|
||||
codMdepDoc = codMdepPartenza;
|
||||
codAnag = aziendaService.retrieveInternalCodAnagFornitore();
|
||||
codVdes = null;
|
||||
} else {
|
||||
String codDtipToUse = setupGest.getSetupDepo(multiDBTransactionManager.getPrimaryConnection(), "PICKING", "LOGISTICA", "COD_DTIP_DOC_TRASF_INTERNI", codMdepArrivo);
|
||||
|
||||
MtbDepo mtbDepoArrivo = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(),
|
||||
Query.format("SELECT * FROM mtb_depo WHERE cod_mdep = {}", codMdepArrivo), MtbDepo.class);
|
||||
if (UtilityString.isNullOrEmpty(codDtipToUse))
|
||||
throw new IllegalArgumentException("Nessun tipo documento configurato per gestire gli spostamenti tra depositi (PICKING > LOGISTICA > COD_DTIP_DOC_TRASF_INTERNI)");
|
||||
|
||||
String sql = Query.format(
|
||||
"SELECT segno_qta_car - segno_qta_scar FROM dtb_tipi WHERE cod_dtip = %s",
|
||||
codDtipToUse
|
||||
);
|
||||
|
||||
|
||||
short segno = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||
|
||||
if (segno > 0) {
|
||||
codMdepDoc = codMdepArrivo;
|
||||
|
||||
MtbDepo mtbDepoPartenza = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(),
|
||||
Query.format("SELECT * FROM mtb_depo WHERE cod_mdep = {}", codMdepPartenza), MtbDepo.class);
|
||||
|
||||
codAnag = mtbDepoPartenza.getCodAnag();
|
||||
codVdes = mtbDepoPartenza.getCodVdes();
|
||||
} else {
|
||||
codMdepDoc = codMdepPartenza;
|
||||
|
||||
MtbDepo mtbDepoArrivo = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(),
|
||||
Query.format("SELECT * FROM mtb_depo WHERE cod_mdep = {}", codMdepArrivo), MtbDepo.class);
|
||||
|
||||
codAnag = mtbDepoArrivo.getCodAnag();
|
||||
codVdes = mtbDepoArrivo.getCodVdes();
|
||||
}
|
||||
|
||||
codAnag = mtbDepoArrivo.getCodAnag();
|
||||
codVdes = mtbDepoArrivo.getCodVdes();
|
||||
}
|
||||
//</editor-fold>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user