Merge remote-tracking branch 'origin/develop' into develop
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good

This commit is contained in:
2025-01-14 17:41:45 +01:00

View File

@@ -378,10 +378,9 @@ public class ColliImportService {
}
public List<EntityBase> importColliVebad(String format, String type, ImportRequestDTO requestDTO, List<AnomalieDTO> anomalie) throws Exception {
List<EntityBase> entityList = new ArrayList<>();
Connection conn = multiDBTransactionManager.getPrimaryConnection();
VebadDTO vebadDesadv = new VebadDTO().setDettagliLotti(new ArrayList<>());
Map<String, String> setup = setupGest.getImportSetupSection(multiDBTransactionManager.getPrimaryConnection(), type, format);
if (requestDTO == null || requestDTO.getRawContent() == null) {
throw new Exception("Nessun file da importare");
}
@@ -475,18 +474,31 @@ public class ColliImportService {
List<MtbColt> mtbColts = new ArrayList<>();
String pIvaForn = vebadDesadv.getEstremiFile().getpIvaFornitore().substring(2);
String sql = Query.format(
"SELECT af.cod_anag\n" +
"FROM gtb_anag\n" +
" INNER JOIN dbo.atb_forn af ON gtb_anag.cod_anag = af.cod_anag\n" +
"WHERE part_iva = %s",
pIvaForn
);
String codAnag = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
for (VebadDesadvDettagliLottiDTO dettagliLotti : vebadDesadv.getDettagliLotti()) {
MtbColt mtbColt = new MtbColt()
.setGestione("A")
.setSegno(1)
.setCodAnag(codAnag)
.setCodMdep("01")
.setDataCollo(UtilityString.parseLocalDate(vebadDesadv.testataDoc.getDataDDT()))
.setBarcodeUl(dettagliLotti.getCodSscc());
mtbColt.setOperation(OperationType.INSERT);
String sql = Query.format("SELECT cod_mart from mtb_lisa WHERE cod_barre_imb = %s", dettagliLotti.getGtin());
String codMart = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
sql = Query.format("SELECT cod_mart from mtb_lisa WHERE cod_barre_imb = %s", dettagliLotti.getGtin());
String codMart = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
MtbColr mtbColr = new MtbColr()
.setDataScadPartita(dettagliLotti.getDataScad())