[ROSSOGARGANO]
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good

- gestione versamento materiale tramite barcode ean128
This commit is contained in:
2025-01-30 14:43:53 +01:00
parent f9f5456bc0
commit f8a44ea086

View File

@@ -38,6 +38,8 @@ import it.integry.ems_model.exception.GestSetupNotFoundException;
import it.integry.ems_model.service.SetupGest;
import it.integry.ems_model.types.OperationType;
import it.integry.ems_model.utility.*;
import it.integry.ems_model.utility.BarcodeEan128.Ean128Model;
import it.integry.ems_model.utility.BarcodeEan128.UtilityBarcodeEan128;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.http.entity.ContentType;
import org.apache.logging.log4j.LogManager;
@@ -1331,6 +1333,15 @@ public class MesProductionServiceV2 {
}
private MaterialeVersatoSuOrdineDTO getVersamentoBarcodeSuOrdine(DtbOrdt ordine, String barcode) throws Exception {
Ean128Model model;
try{
model = UtilityBarcodeEan128.decode(barcode.getBytes());
}catch (Exception e){
model = new Ean128Model();
}
String sscc = UtilityString.isNull(model.Sscc,barcode);
String sql = Query.format("SELECT mtb_colt.data_collo, mtb_colt.num_collo, mtb_colt.ser_collo, mtb_colt.gestione, mtb_colr.cod_mart, mtb_aart.unt_mis,mtb_colr.partita_mag, SUM(qta_col) AS qta_versata,mtb_colr.data_ord, mtb_colr.num_ord\n" +
"FROM mtb_colr\n" +
" INNER JOIN mtb_aart ON mtb_aart.cod_mart = mtb_colr.cod_mart\n" +
@@ -1343,8 +1354,8 @@ public class MesProductionServiceV2 {
" AND mtb_colt.segno = -1\n" +
" AND mtb_colr.data_ord = {}\n" +
" AND mtb_colr.num_ord = {}\n" +
" AND rif.barcode_ul = {}\n" +
"GROUP BY mtb_colt.data_collo, mtb_colt.num_collo, mtb_colt.ser_collo, mtb_colt.gestione, mtb_colr.cod_mart, mtb_aart.unt_mis,mtb_colr.partita_mag,mtb_colr.data_ord, mtb_colr.num_ord", ordine.getDataOrd(), ordine.getNumOrd(), barcode);
" AND (rif.barcode_ul = {} or rif.barcode_ul ={})\n" +
"GROUP BY mtb_colt.data_collo, mtb_colt.num_collo, mtb_colt.ser_collo, mtb_colt.gestione, mtb_colr.cod_mart, mtb_aart.unt_mis,mtb_colr.partita_mag,mtb_colr.data_ord, mtb_colr.num_ord", ordine.getDataOrd(), ordine.getNumOrd(), barcode, sscc);
MaterialeVersatoSuOrdineDTO rowVersamento = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, MaterialeVersatoSuOrdineDTO.class);