Merge branch 'develop' into feature/RefactoringGestioneColli

This commit is contained in:
2025-09-24 11:18:42 +02:00
parent 5dc20c4e3f
commit e12f00984d
2 changed files with 46 additions and 56 deletions

View File

@@ -6,8 +6,8 @@ import java.time.LocalDateTime;
public class CreateUDCProduzioneRequestDTO {
private LocalDate customDataCollo;
private LocalDateTime customDataVersamento;
private LocalDate dataCollo;
private LocalDateTime dataVersamento;
private String codMdep;
private String codJfas;
@@ -29,26 +29,28 @@ public class CreateUDCProduzioneRequestDTO {
private String partitaMag;
private String annotazioni;
private String barcodeUl;
private String codDtipProvv;
private Integer progressivoUl;
private int numEtich = 0;
public LocalDate getCustomDataCollo() {
return customDataCollo;
public LocalDate getDataCollo() {
return dataCollo;
}
public CreateUDCProduzioneRequestDTO setCustomDataCollo(LocalDate customDataCollo) {
this.customDataCollo = customDataCollo;
public CreateUDCProduzioneRequestDTO setDataCollo(LocalDate dataCollo) {
this.dataCollo = dataCollo;
return this;
}
public LocalDateTime getCustomDataVersamento() {
return customDataVersamento;
public LocalDateTime getDataVersamento() {
return dataVersamento;
}
public CreateUDCProduzioneRequestDTO setCustomDataVersamento(LocalDateTime customDataVersamento) {
this.customDataVersamento = customDataVersamento;
public CreateUDCProduzioneRequestDTO setDataVersamento(LocalDateTime dataVersamento) {
this.dataVersamento = dataVersamento;
return this;
}
@@ -222,4 +224,22 @@ public class CreateUDCProduzioneRequestDTO {
this.codDtipProvv = codDtipProvv;
return this;
}
public Integer getProgressivoUl() {
return progressivoUl;
}
public CreateUDCProduzioneRequestDTO setProgressivoUl(Integer progressivoUl) {
this.progressivoUl = progressivoUl;
return this;
}
public String getBarcodeUl() {
return barcodeUl;
}
public CreateUDCProduzioneRequestDTO setBarcodeUl(String barcodeUl) {
this.barcodeUl = barcodeUl;
return this;
}
}

View File

@@ -23,7 +23,6 @@ import it.integry.ems.report.dto.JasperDTO;
import it.integry.ems.report.dto.PairsDTO;
import it.integry.ems.retail.pvmRetail.service.PvmService;
import it.integry.ems.retail.wms.Utility.WMSUtility;
import it.integry.ems.retail.wms.Utility.WMSUtility;
import it.integry.ems.retail.wms.accettazione.service.WMSAccettazioneService;
import it.integry.ems.retail.wms.dto.*;
import it.integry.ems.retail.wms.generic.dto.MvwSitArtUdcDetInventarioDTO;
@@ -32,7 +31,6 @@ import it.integry.ems.retail.wms.generic.service.WMSGenericService;
import it.integry.ems.retail.wms.generic.service.WMSGiacenzaULService;
import it.integry.ems.retail.wms.lavorazione.service.WMSLavorazioneService;
import it.integry.ems.rules.completing.CommonRules;
import it.integry.ems.rules.completing.CommonRules;
import it.integry.ems.rules.completing.DocumentRules;
import it.integry.ems.rules.completing.PartitaMagRules;
import it.integry.ems.rules.completing.dto.DatiPartitaMagDTO;
@@ -74,6 +72,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
@@ -781,7 +780,7 @@ public class MesProductionServiceV2 {
}};
MtbColt createdUdc = wmsLavorazioneService.createUDC(new CreateUDCRequestDTO()
.setDataCollo(request.getCustomDataCollo())
.setDataCollo(request.getDataCollo())
.setCodMdep(request.getCodMdep())
.setCodJfas(request.getCodJfas())
.setCodAnag(request.getCodAnag())
@@ -789,7 +788,9 @@ public class MesProductionServiceV2 {
.setPosizione(request.getPosizione())
.setCodTcol(request.getCodTcol())
.setRifOrd(request.getRifOrd())
.setDataVersamento(request.getCustomDataVersamento())
.setDataVersamento(request.getDataVersamento())
.setProgressivoUl(request.getProgressivoUl())
.setBarcodeUl(request.getBarcodeUl())
.setCodDtipProvv(request.getCodDtipProvv())
.setOrders(orders));
@@ -804,7 +805,7 @@ public class MesProductionServiceV2 {
.setQtaTot(request.getQta())
.setQtaCnf(request.getQtaCnf())
.setNumCnf(request.getNumCnf())
.setDatetimeRow(request.getCustomDataVersamento())
.setDatetimeRow(request.getDataVersamento())
.setAnnotazioni(request.getAnnotazioni())
.setNumEtich(Math.max(request.getNumEtich(), 0)));
@@ -1145,6 +1146,7 @@ public class MesProductionServiceV2 {
}
LocalDate dataCollo = UtilityLocalDate.isNull(dto.getDataCollo(), UtilityLocalDate.getNow());
LocalDateTime dataVersamento = UtilityLocalDate.isNull(dto.getDataVers(), UtilityLocalDate.getNowTime());
if (dto.isAccodaAdEsistenti()) {
String queryMtbColt = "SELECT mtb_colr.* " +
@@ -1172,7 +1174,8 @@ public class MesProductionServiceV2 {
if (udc == null) {
final CreateUDCProduzioneRequestDTO createUdcRequest = new CreateUDCProduzioneRequestDTO()
.setCustomDataCollo(dataCollo)
.setDataCollo(dataCollo)
.setDataVersamento(dataVersamento)
.setDataOrd(dto.getDataOrd())
.setNumOrd(dto.getNumOrd())
.setCodMdep(UtilityString.isNull(dto.getCodMdep(), ordineLav.getCodMdep()))
@@ -1197,12 +1200,6 @@ public class MesProductionServiceV2 {
createUdcRequest.setProgressivoUl(progressivoUl);
}
if (dto.getDataCollo() != null) {
createUdcRequest.setCustomDataCollo(dto.getDataCollo());
}
if (dto.getDataVers() != null) {
createUdcRequest.setCustomDataVersamento(dto.getDataVers());
}
if (dto.isSegnaQuarantena()) {
String codDtipProvv = setupGest.getSetup("MES", "SETUP", "COD_DTIP_PROVV");
@@ -1237,37 +1234,10 @@ public class MesProductionServiceV2 {
// .setNumOrd(dto.getNumOrd())
// .setDataOrd(dto.getDataOrd())));
if (!UtilityString.isNullOrEmpty(dto.getPartitaMag()) && !dto.getPartitaMag().equalsIgnoreCase(ordineLav.getPartitaMag())) {
int progressivoUl = CommonRules.retrieveNextProgressivoUlRG(
multiDBTransactionManager.getPrimaryConnection(),
dto.getGestione(),
dto.getDataOrd(),
dto.getNumOrd(),
1,
dto.getCodJfas(),
dto.getPartitaMag()
);
if (dto.getDataCollo() != null) {
createUdcRequest.setDataCollo(dto.getDataCollo());
}
if (dto.getDataVers() != null) {
createUdcRequest.setCustomDataVersamento(dto.getDataVers());
}
if (dto.isSegnaQuarantena()) {
String codDtipProvv = setupGest.getSetup("MES", "SETUP", "COD_DTIP_PROVV");
if (UtilityString.isNullOrEmpty(codDtipProvv))
throw new GestSetupNotFoundException("MES", "SETUP", "COD_DTIP_PROVV");
createUdcRequest.setCodDtipProvv(codDtipProvv);
}
}
udc = createULLavorazione(createUdcRequest);
udcRow = udc.getMtbColr().get(0);
}
} else {
InsertUDCRowRequestDTO insertUDCRow = new InsertUDCRowRequestDTO()
.setTargetMtbColt(udc)
.setCodMart(ordineLav.getCodProd())
@@ -1289,13 +1259,13 @@ public class MesProductionServiceV2 {
if (dto.getDataVers() != null) {
udcRow.setDatetimeRow(dto.getDataVers());
}
entityProcessor.processEntity(udc, true, multiDBTransactionManager);
} catch (Exception e) {
multiDBTransactionManager.rollbackAll();
throw e;
}
} catch (Exception e) {
multiDBTransactionManager.rollbackAll();
throw e;
}
if (dto.isSegnaQuarantena()) {
String indirizziQuarantena = setupGest.getSetup("MES", "MAIL", "INDIRIZZI_QUARANTENA");
@@ -1781,7 +1751,7 @@ public class MesProductionServiceV2 {
.setCodMart(ordine.getCodProd())
.setPartitaMag(partitaSL.getPartitaMag())
.setPartitaMagProd(partitaSL.getPartitaMagProd())
.setDataScad(UtilityLocalDate.localDateFromDate(partitaSL.getDataScad()))
.setDataScad(partitaSL.getDataScad())
.setDataProd(partitaSL.getDataProd())
.setNote(partitaSL.getNote()), false);