Finish Hotfix-1
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:
@@ -14,6 +14,7 @@ public class CheckMaterialeBarcodeInOrdineResponseDTO {
|
||||
private boolean canCreateNewUl = false;
|
||||
private MaterialeVersatoSuOrdineDTO versamento;
|
||||
private GiacenzaArtInBarcodeDTO collo;
|
||||
private MtbColt sourceMtbColt;
|
||||
|
||||
|
||||
public List<AnomalieDTO> getAnomalie() {
|
||||
@@ -60,4 +61,13 @@ public class CheckMaterialeBarcodeInOrdineResponseDTO {
|
||||
this.canCreateNewUl = canCreateNewUl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbColt getSourceMtbColt() {
|
||||
return sourceMtbColt;
|
||||
}
|
||||
|
||||
public CheckMaterialeBarcodeInOrdineResponseDTO setSourceMtbColt(MtbColt sourceMtbColt) {
|
||||
this.sourceMtbColt = sourceMtbColt;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,18 @@ public class MaterialeVersatoSuOrdineDTO {
|
||||
private String untMis;
|
||||
@SqlField("cod_mart")
|
||||
private String codMart;
|
||||
@SqlField("qta_cnf")
|
||||
private BigDecimal qtaCnf;
|
||||
@SqlField("qta_cnf_art")
|
||||
private BigDecimal qtaCnfArt;
|
||||
@SqlField("num_Cnf")
|
||||
private BigDecimal numCnf;
|
||||
@SqlField("rap_conv2")
|
||||
private BigDecimal rapConv2;
|
||||
@SqlField("unt_mis2")
|
||||
private String untMis2;
|
||||
@SqlField("descrizione")
|
||||
private String descrizione;
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
@@ -116,4 +128,58 @@ public class MaterialeVersatoSuOrdineDTO {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnf() {
|
||||
return qtaCnf;
|
||||
}
|
||||
|
||||
public MaterialeVersatoSuOrdineDTO setQtaCnf(BigDecimal qtaCnf) {
|
||||
this.qtaCnf = qtaCnf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getNumCnf() {
|
||||
return numCnf;
|
||||
}
|
||||
|
||||
public MaterialeVersatoSuOrdineDTO setNumCnf(BigDecimal numCnf) {
|
||||
this.numCnf = numCnf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getRapConv2() {
|
||||
return rapConv2;
|
||||
}
|
||||
|
||||
public MaterialeVersatoSuOrdineDTO setRapConv2(BigDecimal rapConv2) {
|
||||
this.rapConv2 = rapConv2;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUntMis2() {
|
||||
return untMis2;
|
||||
}
|
||||
|
||||
public MaterialeVersatoSuOrdineDTO setUntMis2(String untMis2) {
|
||||
this.untMis2 = untMis2;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public MaterialeVersatoSuOrdineDTO setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnfArt() {
|
||||
return qtaCnfArt;
|
||||
}
|
||||
|
||||
public MaterialeVersatoSuOrdineDTO setQtaCnfArt(BigDecimal qtaCnfArt) {
|
||||
this.qtaCnfArt = qtaCnfArt;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1289,7 +1289,7 @@ public class MesProductionServiceV2 {
|
||||
public CheckMaterialeBarcodeInOrdineResponseDTO checkMaterialeBarcodeInOrdine(CheckMaterialeBarcodeInOrdineDTO dto) throws Exception {
|
||||
|
||||
CheckMaterialeBarcodeInOrdineResponseDTO response = new CheckMaterialeBarcodeInOrdineResponseDTO();
|
||||
List<AnomalieDTO> anomalie = new ArrayList<>();
|
||||
|
||||
MtbColt collo;
|
||||
collo = pvmService.getColloByBarcode(dto.getBarcode(), true);
|
||||
|
||||
@@ -1305,12 +1305,14 @@ public class MesProductionServiceV2 {
|
||||
throw new Exception("Il barcode richiesto non ha fornito alcun risultato!");
|
||||
}
|
||||
}
|
||||
response.setSourceMtbColt(collo);
|
||||
|
||||
List<MtbColr> rows = collo.getMtbColr();
|
||||
if (UtilityList.isNullOrEmpty(rows)) {
|
||||
MaterialeVersatoSuOrdineDTO versamentoSuOrdine = getVersamentoBarcodeSuOrdine(dto.getOrdine(), dto.getBarcode());
|
||||
if (versamentoSuOrdine != null && UtilityBigDecimal.greaterThan(versamentoSuOrdine.getQtaVersata(), BigDecimal.ZERO)) {
|
||||
response.setVersamento(versamentoSuOrdine);
|
||||
return response;
|
||||
} else {
|
||||
throw new Exception("La UL richiesta è vuota!");
|
||||
}
|
||||
@@ -1324,7 +1326,7 @@ public class MesProductionServiceV2 {
|
||||
if (arts.size() > 1)
|
||||
throw new Exception("Impossibile versare a produzione una pedana mista!");
|
||||
|
||||
final MtbAart rowArt = entityProcessor.processEntity(arts.get(0), true,multiDBTransactionManager);
|
||||
final MtbAart rowArt = entityProcessor.processEntity(arts.get(0), true, multiDBTransactionManager);
|
||||
GiacenzaArtInBarcodeDTO invDto = new GiacenzaArtInBarcodeDTO();
|
||||
invDto
|
||||
.setBarcodeUl(dto.getBarcode())
|
||||
@@ -1350,7 +1352,7 @@ public class MesProductionServiceV2 {
|
||||
matchLottoSlToOrdine &&
|
||||
!UtilityString.isNullOrEmpty(ordineLav.getPartitaMag()) &&
|
||||
!ordineLav.getPartitaMag().startsWith(row.getPartitaMag())) {
|
||||
anomalie.add(AnomalieDTO.warning(String.format("La partita di semilavorato che si vuole versare (%s) non corrisponde a quella dell'ordine (%s), per concludere la procedura di versamento verrà creato un nuovo ordine di lavorazione con la partita selezionata!", row.getPartitaMag(), ordineLav.getPartitaMag())));
|
||||
response.getAnomalie().add(AnomalieDTO.warning(String.format("La partita di semilavorato che si vuole versare (%s) non corrisponde a quella dell'ordine (%s), per concludere la procedura di versamento verrà creato un nuovo ordine di lavorazione con la partita selezionata!", row.getPartitaMag(), ordineLav.getPartitaMag())));
|
||||
response.setNewOrderRequired(true);
|
||||
}
|
||||
invDto.setPartitaMag(row.getPartitaMag())
|
||||
@@ -1362,7 +1364,6 @@ public class MesProductionServiceV2 {
|
||||
}
|
||||
|
||||
response.setCollo(invDto);
|
||||
response.setAnomalie(anomalie);
|
||||
return response;
|
||||
|
||||
}
|
||||
@@ -1377,8 +1378,24 @@ public class MesProductionServiceV2 {
|
||||
}
|
||||
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" +
|
||||
String sql = Query.format("SELECT mtb_colt.data_collo,\n" +
|
||||
" mtb_colt.num_collo,\n" +
|
||||
" mtb_colt.ser_collo,\n" +
|
||||
" mtb_colt.gestione,\n" +
|
||||
" mtb_colr.cod_mart,\n" +
|
||||
" mtb_aart.unt_mis,\n" +
|
||||
" mtb_aart.unt_mis2,\n" +
|
||||
" mtb_aart.rap_conv2,\n" +
|
||||
" mtb_aart.qta_cnf as qta_cnf_art,\n" +
|
||||
" mtb_colr.qta_cnf,\n" +
|
||||
" SUM(num_cnf) AS num_cnf,\n" +
|
||||
" mtb_aart.descrizione,\n" +
|
||||
" mtb_aart.descrizione,\n" +
|
||||
" mtb_colr.partita_mag,\n" +
|
||||
" SUM(qta_col) AS qta_versata,\n" +
|
||||
" mtb_colr.data_ord,\n" +
|
||||
" mtb_colr.num_ord\n" +
|
||||
" FROM mtb_colr\n" +
|
||||
" INNER JOIN mtb_aart ON mtb_aart.cod_mart = mtb_colr.cod_mart\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" +
|
||||
@@ -1390,7 +1407,9 @@ public class MesProductionServiceV2 {
|
||||
" AND mtb_colr.data_ord = {}\n" +
|
||||
" AND mtb_colr.num_ord = {}\n" +
|
||||
" 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);
|
||||
"GROUP BY mtb_colt.data_collo, mtb_colt.num_collo, mtb_colt.ser_collo, mtb_colt.gestione, mtb_colr.cod_mart,\n" +
|
||||
" mtb_aart.unt_mis, mtb_colr.partita_mag, mtb_colr.data_ord, mtb_colr.num_ord,mtb_colr.qta_cnf, mtb_aart.unt_mis2,\n" +
|
||||
" mtb_aart.rap_conv2, mtb_aart.descrizione, mtb_aart.qta_cnf", ordine.getDataOrd(), ordine.getNumOrd(), barcode, sscc);
|
||||
|
||||
MaterialeVersatoSuOrdineDTO rowVersamento = UtilityDB.executeSimpleQueryOnlyFirstRowDTO(multiDBTransactionManager.getPrimaryConnection(), sql, MaterialeVersatoSuOrdineDTO.class);
|
||||
|
||||
@@ -1409,7 +1428,7 @@ public class MesProductionServiceV2 {
|
||||
public Object versaMaterialeSuOrdine(VersamentoMaterialeSuOrdineDTO dto) throws Exception {
|
||||
|
||||
|
||||
MtbColt colloDaVersare = pvmService.getColloByBarcode(dto.getMtbColt().getBarcodeUl(),true);
|
||||
MtbColt colloDaVersare = pvmService.getColloByBarcode(dto.getMtbColt().getBarcodeUl(), true);
|
||||
colloDaVersare.setOperation(OperationType.SELECT_OBJECT);
|
||||
entityProcessor.processEntity(colloDaVersare, multiDBTransactionManager);
|
||||
List<MvwSitArtUdcDetInventarioDTO> contenuto = wmsGenericService.getGiacenzaCollo(colloDaVersare);
|
||||
@@ -1489,7 +1508,7 @@ public class MesProductionServiceV2 {
|
||||
|
||||
InsertUDSRowRequestDTO insertRequestDto = new InsertUDSRowRequestDTO()
|
||||
.setCodMart(scarico.getCodMart())
|
||||
.setQtaTot(UtilityBigDecimal.isNull(dto.getQtaVersamento(),scarico.getQtaCol()))
|
||||
.setQtaTot(UtilityBigDecimal.isNull(dto.getQtaVersamento(), scarico.getQtaCol()))
|
||||
.setPartitaMag(scarico.getPartitaMag())
|
||||
.setSourceMtbColr(sourceMtbColr)
|
||||
.setTargetMtbColt(uds)
|
||||
|
||||
Reference in New Issue
Block a user