Merge branch 'master' into develop
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:
@@ -999,15 +999,14 @@ public class CommonRules extends QueryRules {
|
|||||||
|
|
||||||
public static void setIdArtEqui(Connection conn, MtbAart entity) throws Exception {
|
public static void setIdArtEqui(Connection conn, MtbAart entity) throws Exception {
|
||||||
if (!UtilityString.isNullOrEmpty(entity.getIdArtEqui())) return;
|
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 = setupGest.getSetupBoolean("MTB_AART","ID_ART_EQUI","INSERT_AUTO");
|
||||||
Boolean setSetIdArtEqui = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
|
||||||
if ( !setSetIdArtEqui ) return;
|
if ( !setSetIdArtEqui ) return;
|
||||||
|
|
||||||
// Convertire in JSON
|
// Convertire in JSON
|
||||||
entity.setOnlyPkMaster(false);
|
entity.setOnlyPkMaster(false);
|
||||||
ResponseJSONObjectMapper objectMapper = ContextLoader.getCurrentWebApplicationContext().getBean(ResponseJSONObjectMapper.class);
|
ResponseJSONObjectMapper objectMapper = ContextLoader.getCurrentWebApplicationContext().getBean(ResponseJSONObjectMapper.class);
|
||||||
String jsonParm = objectMapper.writeValueAsString(entity);
|
String jsonParm = objectMapper.writeValueAsString(entity);
|
||||||
sql =
|
String sql =
|
||||||
String.format(
|
String.format(
|
||||||
"SELECT * FROM dbo.suggestMtbArtEqui('%s') " ,
|
"SELECT * FROM dbo.suggestMtbArtEqui('%s') " ,
|
||||||
jsonParm);
|
jsonParm);
|
||||||
|
|||||||
@@ -2,14 +2,17 @@ package it.integry.ems.production.dto;
|
|||||||
|
|
||||||
import it.integry.ems.Import.dto.AnomalieDTO;
|
import it.integry.ems.Import.dto.AnomalieDTO;
|
||||||
import it.integry.ems_model.entity.DtbOrdt;
|
import it.integry.ems_model.entity.DtbOrdt;
|
||||||
|
import it.integry.ems_model.entity.MtbColr;
|
||||||
import it.integry.ems_model.entity.MtbColt;
|
import it.integry.ems_model.entity.MtbColt;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class CheckMaterialeBarcodeInOrdineResponseDTO {
|
public class CheckMaterialeBarcodeInOrdineResponseDTO {
|
||||||
|
|
||||||
private List<AnomalieDTO> anomalie;
|
private List<AnomalieDTO> anomalie;
|
||||||
private boolean isNewOrderRequired = false;
|
private boolean isNewOrderRequired = false;
|
||||||
|
private MtbColr versamento;
|
||||||
private MtbColt collo;
|
private MtbColt collo;
|
||||||
|
|
||||||
public List<AnomalieDTO> getAnomalie() {
|
public List<AnomalieDTO> getAnomalie() {
|
||||||
@@ -38,4 +41,13 @@ public class CheckMaterialeBarcodeInOrdineResponseDTO {
|
|||||||
this.collo = collo;
|
this.collo = collo;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MtbColr getVersamento() {
|
||||||
|
return versamento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CheckMaterialeBarcodeInOrdineResponseDTO setVersamento(MtbColr versamento) {
|
||||||
|
this.versamento = versamento;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import it.integry.ems_model.exception.GestSetupNotFoundException;
|
|||||||
import it.integry.ems_model.service.SetupGest;
|
import it.integry.ems_model.service.SetupGest;
|
||||||
import it.integry.ems_model.types.OperationType;
|
import it.integry.ems_model.types.OperationType;
|
||||||
import it.integry.ems_model.utility.*;
|
import it.integry.ems_model.utility.*;
|
||||||
|
import org.apache.bcel.classfile.Utility;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.http.entity.ContentType;
|
import org.apache.http.entity.ContentType;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
@@ -1285,8 +1286,14 @@ public class MesProductionServiceV2 {
|
|||||||
throw new Exception("Il barcode richiesto non ha fornito alcun risultato!");
|
throw new Exception("Il barcode richiesto non ha fornito alcun risultato!");
|
||||||
|
|
||||||
List<MtbColr> rows = collo.getMtbColr();
|
List<MtbColr> rows = collo.getMtbColr();
|
||||||
if (UtilityList.isNullOrEmpty(rows))
|
if (UtilityList.isNullOrEmpty(rows)){
|
||||||
throw new Exception("La UL richiesta è vuota!");
|
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());
|
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 {
|
private DtbOrdt completeDatiOrdine(DtbOrdt ordine) throws Exception {
|
||||||
ordine.setOperation(OperationType.SELECT_OBJECT);
|
ordine.setOperation(OperationType.SELECT_OBJECT);
|
||||||
entityProcessor.processEntity(ordine, multiDBTransactionManager);
|
entityProcessor.processEntity(ordine, multiDBTransactionManager);
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ public class WMSArticoloService {
|
|||||||
" mtb_aart.cod_msfa AS [mtb_aart.cod_msfa], " +
|
" mtb_aart.cod_msfa AS [mtb_aart.cod_msfa], " +
|
||||||
" mtb_aart.qta_cnf AS [mtb_aart.qta_cnf], " +
|
" mtb_aart.qta_cnf AS [mtb_aart.qta_cnf], " +
|
||||||
" mtb_aart.cod_aliq AS [mtb_aart.cod_aliq], " +
|
" mtb_aart.cod_aliq AS [mtb_aart.cod_aliq], " +
|
||||||
|
" mtb_aart.posizione AS [posizione], " +
|
||||||
" bar_code AS [barcode], " +
|
" bar_code AS [barcode], " +
|
||||||
" cod_barre_imb AS [cod_barre_imb], " +
|
" cod_barre_imb AS [cod_barre_imb], " +
|
||||||
" mtb_grup.descrizione AS [mtb_grup.descrizione], " +
|
" mtb_grup.descrizione AS [mtb_grup.descrizione], " +
|
||||||
|
|||||||
Reference in New Issue
Block a user