Finish Hotfix-1
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good

This commit is contained in:
2024-12-10 12:54:56 +01:00
4 changed files with 42 additions and 5 deletions

View File

@@ -999,15 +999,14 @@ public class CommonRules extends QueryRules {
public static void setIdArtEqui(Connection conn, MtbAart entity) throws Exception {
if (!UtilityString.isNullOrEmpty(entity.getIdArtEqui())) return;
String sql = "select CAst( case when dbo.getGestSetup( 'MTB_AART', 'ID_ART_EQUI', 'INSERT_AUTO') = 'N' THEN 0 ELSE 1 END as BIT)";
Boolean setSetIdArtEqui = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
boolean setSetIdArtEqui = setupGest.getSetupBoolean("MTB_AART","ID_ART_EQUI","INSERT_AUTO");
if ( !setSetIdArtEqui ) return;
// Convertire in JSON
entity.setOnlyPkMaster(false);
ResponseJSONObjectMapper objectMapper = ContextLoader.getCurrentWebApplicationContext().getBean(ResponseJSONObjectMapper.class);
String jsonParm = objectMapper.writeValueAsString(entity);
sql =
String sql =
String.format(
"SELECT * FROM dbo.suggestMtbArtEqui('%s') " ,
jsonParm);

View File

@@ -2,14 +2,17 @@ package it.integry.ems.production.dto;
import it.integry.ems.Import.dto.AnomalieDTO;
import it.integry.ems_model.entity.DtbOrdt;
import it.integry.ems_model.entity.MtbColr;
import it.integry.ems_model.entity.MtbColt;
import java.math.BigDecimal;
import java.util.List;
public class CheckMaterialeBarcodeInOrdineResponseDTO {
private List<AnomalieDTO> anomalie;
private boolean isNewOrderRequired = false;
private MtbColr versamento;
private MtbColt collo;
public List<AnomalieDTO> getAnomalie() {
@@ -38,4 +41,13 @@ public class CheckMaterialeBarcodeInOrdineResponseDTO {
this.collo = collo;
return this;
}
public MtbColr getVersamento() {
return versamento;
}
public CheckMaterialeBarcodeInOrdineResponseDTO setVersamento(MtbColr versamento) {
this.versamento = versamento;
return this;
}
}

View File

@@ -38,6 +38,7 @@ 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 org.apache.bcel.classfile.Utility;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.http.entity.ContentType;
import org.apache.logging.log4j.LogManager;
@@ -1285,8 +1286,14 @@ public class MesProductionServiceV2 {
throw new Exception("Il barcode richiesto non ha fornito alcun risultato!");
List<MtbColr> rows = collo.getMtbColr();
if (UtilityList.isNullOrEmpty(rows))
throw new Exception("La UL richiesta è vuota!");
if (UtilityList.isNullOrEmpty(rows)){
MtbColr versamentoSuOrdine = getVersamentoBarcodeSuOrdine(dto.getOrdine(),dto.getBarcode());
if (versamentoSuOrdine != null && UtilityBigDecimal.greaterThan(versamentoSuOrdine.getQtaCol(),BigDecimal.ZERO)){
response.setVersamento(versamentoSuOrdine);
}else{
throw new Exception("La UL richiesta è vuota!");
}
}
DtbOrdt ordineLav = completeDatiOrdine(dto.getOrdine());
@@ -1320,6 +1327,24 @@ public class MesProductionServiceV2 {
}
private MtbColr getVersamentoBarcodeSuOrdine(DtbOrdt ordine,String barcode) throws Exception {
String sql = Query.format("SELECT mtb_colt.data_collo, mtb_colt.num_collo, mtb_colt.ser_collo, mtb_colt.gestione, mtb_colr.cod_mart, SUM(qta_col) AS qta_col\n" +
"FROM mtb_colr\n" +
" INNER JOIN mtb_colt ON mtb_colr.gestione = mtb_colt.gestione AND mtb_colr.data_collo = mtb_colt.data_collo AND\n" +
" mtb_colr.ser_collo = mtb_colt.ser_collo AND mtb_colr.num_collo = mtb_colt.num_collo\n" +
" INNER JOIN mtb_colt rif\n" +
" ON mtb_colr.gestione_rif = rif.gestione AND mtb_colr.data_collo_rif = rif.data_collo AND\n" +
" mtb_colr.ser_collo_rif = rif.ser_collo AND mtb_colr.num_collo_rif = rif.num_collo\n" +
"WHERE mtb_colt.gestione = 'L'\n" +
" 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",ordine.getDataOrd(),ordine.getNumOrd(),barcode);
return UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(),sql,MtbColr.class);
}
private DtbOrdt completeDatiOrdine(DtbOrdt ordine) throws Exception {
ordine.setOperation(OperationType.SELECT_OBJECT);
entityProcessor.processEntity(ordine, multiDBTransactionManager);

View File

@@ -107,6 +107,7 @@ public class WMSArticoloService {
" mtb_aart.cod_msfa AS [mtb_aart.cod_msfa], " +
" mtb_aart.qta_cnf AS [mtb_aart.qta_cnf], " +
" mtb_aart.cod_aliq AS [mtb_aart.cod_aliq], " +
" mtb_aart.posizione AS [posizione], " +
" bar_code AS [barcode], " +
" cod_barre_imb AS [cod_barre_imb], " +
" mtb_grup.descrizione AS [mtb_grup.descrizione], " +