aggiunta raggruppamento per deposito
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:
@@ -2,6 +2,7 @@ package it.integry.ems.document.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
public class ULRowDTO {
|
||||
|
||||
@@ -13,6 +14,7 @@ public class ULRowDTO {
|
||||
private LocalDate dataOrd;
|
||||
private Integer numOrd;
|
||||
private Integer rigaOrd;
|
||||
private String codMdep;
|
||||
|
||||
public String getBarcodeUl() {
|
||||
return barcodeUl;
|
||||
@@ -85,4 +87,25 @@ public class ULRowDTO {
|
||||
this.rigaOrd = rigaOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMdep() {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public ULRowDTO setCodMdep(String codMdep) {
|
||||
this.codMdep = codMdep;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (!(o instanceof ULRowDTO)) return false;
|
||||
ULRowDTO ulRowDTO = (ULRowDTO) o;
|
||||
return Objects.equals(getBarcodeUl(), ulRowDTO.getBarcodeUl()) && Objects.equals(getCodMart(), ulRowDTO.getCodMart()) && Objects.equals(getPartitaMag(), ulRowDTO.getPartitaMag()) && Objects.equals(getDataScad(), ulRowDTO.getDataScad()) && Objects.equals(getQtaCol(), ulRowDTO.getQtaCol()) && Objects.equals(getDataOrd(), ulRowDTO.getDataOrd()) && Objects.equals(getNumOrd(), ulRowDTO.getNumOrd()) && Objects.equals(getRigaOrd(), ulRowDTO.getRigaOrd()) && Objects.equals(getCodMdep(), ulRowDTO.getCodMdep());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getBarcodeUl(), getCodMart(), getPartitaMag(), getDataScad(), getQtaCol(), getDataOrd(), getNumOrd(), getRigaOrd(), getCodMdep());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import it.integry.ems.document.dto.CreateULFromDocumentsDTO;
|
||||
import it.integry.ems.document.dto.ULRowDTO;
|
||||
import it.integry.ems.document.dto.UlVenditaDTO;
|
||||
import it.integry.ems.javabeans.RequestDataDTO;
|
||||
import it.integry.ems.menu.dto.StbMenuDTO;
|
||||
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;
|
||||
@@ -754,62 +755,68 @@ public class DocumentiDirettiService {
|
||||
|
||||
}
|
||||
|
||||
for (ULRowDTO ulRowDTO : createUDSFromDocuments.getUlRows()) {
|
||||
if ((createUDSFromDocuments.isMonoUl() && uds == null) || !createUDSFromDocuments.isMonoUl()) {
|
||||
Map<String, List<ULRowDTO>> ulGroup = createUDSFromDocuments.getUlRows().stream().collect(groupingBy(ULRowDTO::getCodMdep));
|
||||
|
||||
for(Map.Entry<String, List<ULRowDTO>> entry : ulGroup.entrySet()) {
|
||||
String codMdep = entry.getKey();
|
||||
for (ULRowDTO ulRowDTO : entry.getValue()) {
|
||||
if ((createUDSFromDocuments.isMonoUl() && uds == null) || !createUDSFromDocuments.isMonoUl()) {
|
||||
if (!createUDSFromDocuments.isMonoUl()) {
|
||||
CreateUDSRequestOrderDTO ord = new CreateUDSRequestOrderDTO()
|
||||
.setDataOrd(ulRowDTO.getDataOrd())
|
||||
.setNumOrd(ulRowDTO.getNumOrd())
|
||||
.setGestione(createUDSFromDocuments.getGestione());
|
||||
createUDSRequestOrderDTO = new ArrayList<>();
|
||||
createUDSRequestOrderDTO.add(ord);
|
||||
}
|
||||
uds = wmsSpedizioneService.createUDS(
|
||||
new CreateUDSRequestDTO()
|
||||
.setCodAnag(createUDSFromDocuments.getCodAnag())
|
||||
.setCodMdep(codMdep)
|
||||
.setCodVdes(createUDSFromDocuments.getCodVdes())
|
||||
.setOrders(createUDSRequestOrderDTO));
|
||||
}
|
||||
uds.getMtbCols().forEach(x -> x.setOperation(OperationType.NO_OP));
|
||||
|
||||
List<MvwSitArtUdcDetInventarioDTO> mvwSitArtUdcDetInventarioDTOS = wmsGiacenzaULService.retrieveArtsInGiacenzaByBarcodeUl(multiDBTransactionManager.getPrimaryConnection(), ulRowDTO.getBarcodeUl());
|
||||
|
||||
MtbColr sourceMtbColr = null;
|
||||
if ( mvwSitArtUdcDetInventarioDTOS != null ) {
|
||||
MvwSitArtUdcDetInventarioDTO mvwSitArtUdcDetInventarioDTO = mvwSitArtUdcDetInventarioDTOS.stream()
|
||||
.filter(x ->
|
||||
x.getCodMart().equalsIgnoreCase(ulRowDTO.getCodMart()) &&
|
||||
UtilityString.equalsIgnoreCase(x.getPartitaMag(), ulRowDTO.getPartitaMag()))
|
||||
.findFirst().orElse(null);
|
||||
if (mvwSitArtUdcDetInventarioDTO != null) {
|
||||
sourceMtbColr =
|
||||
new MtbColr()
|
||||
.setGestione(mvwSitArtUdcDetInventarioDTO.getGestione())
|
||||
.setDataCollo(mvwSitArtUdcDetInventarioDTO.getDataCollo())
|
||||
.setSerCollo(mvwSitArtUdcDetInventarioDTO.getSerCollo())
|
||||
.setNumCollo(mvwSitArtUdcDetInventarioDTO.getNumCollo());
|
||||
}
|
||||
}
|
||||
|
||||
wmsSpedizioneService.insertUDSRow(
|
||||
new InsertUDSRowRequestDTO()
|
||||
.setCodMart(ulRowDTO.getCodMart())
|
||||
.setPartitaMag(ulRowDTO.getPartitaMag())
|
||||
.setQtaTot(ulRowDTO.getQtaCol())
|
||||
.setDataOrd(ulRowDTO.getDataOrd()!=null?UtilityLocalDate.localDateToDate(ulRowDTO.getDataOrd()):null)
|
||||
.setNumOrd(ulRowDTO.getNumOrd())
|
||||
.setRigaOrd(ulRowDTO.getRigaOrd())
|
||||
.setTargetMtbColt(uds)
|
||||
.setSourceMtbColr(sourceMtbColr)
|
||||
);
|
||||
|
||||
if (!createUDSFromDocuments.isMonoUl()) {
|
||||
CreateUDSRequestOrderDTO ord = new CreateUDSRequestOrderDTO()
|
||||
.setDataOrd(ulRowDTO.getDataOrd())
|
||||
.setNumOrd(ulRowDTO.getNumOrd())
|
||||
.setGestione(createUDSFromDocuments.getGestione());
|
||||
createUDSRequestOrderDTO = new ArrayList<>();
|
||||
createUDSRequestOrderDTO.add(ord);
|
||||
wmsSpedizioneService.closeUDS(new CloseUDSRequestDTO().setMtbColt(uds));
|
||||
|
||||
generatedMtbColt.add(uds);
|
||||
}
|
||||
uds = wmsSpedizioneService.createUDS(
|
||||
new CreateUDSRequestDTO()
|
||||
.setCodAnag(createUDSFromDocuments.getCodAnag())
|
||||
.setCodMdep(createUDSFromDocuments.getCodMdep())
|
||||
.setCodVdes(createUDSFromDocuments.getCodVdes())
|
||||
.setOrders(createUDSRequestOrderDTO));
|
||||
}
|
||||
uds.getMtbCols().forEach(x -> x.setOperation(OperationType.NO_OP));
|
||||
|
||||
List<MvwSitArtUdcDetInventarioDTO> mvwSitArtUdcDetInventarioDTOS = wmsGiacenzaULService.retrieveArtsInGiacenzaByBarcodeUl(multiDBTransactionManager.getPrimaryConnection(), ulRowDTO.getBarcodeUl());
|
||||
|
||||
MtbColr sourceMtbColr = null;
|
||||
if ( mvwSitArtUdcDetInventarioDTOS != null ) {
|
||||
MvwSitArtUdcDetInventarioDTO mvwSitArtUdcDetInventarioDTO = mvwSitArtUdcDetInventarioDTOS.stream()
|
||||
.filter(x ->
|
||||
x.getCodMart().equalsIgnoreCase(ulRowDTO.getCodMart()) &&
|
||||
UtilityString.equalsIgnoreCase(x.getPartitaMag(), ulRowDTO.getPartitaMag()))
|
||||
.findFirst().orElse(null);
|
||||
if (mvwSitArtUdcDetInventarioDTO != null) {
|
||||
sourceMtbColr =
|
||||
new MtbColr()
|
||||
.setGestione(mvwSitArtUdcDetInventarioDTO.getGestione())
|
||||
.setDataCollo(mvwSitArtUdcDetInventarioDTO.getDataCollo())
|
||||
.setSerCollo(mvwSitArtUdcDetInventarioDTO.getSerCollo())
|
||||
.setNumCollo(mvwSitArtUdcDetInventarioDTO.getNumCollo());
|
||||
}
|
||||
}
|
||||
|
||||
wmsSpedizioneService.insertUDSRow(
|
||||
new InsertUDSRowRequestDTO()
|
||||
.setCodMart(ulRowDTO.getCodMart())
|
||||
.setPartitaMag(ulRowDTO.getPartitaMag())
|
||||
.setQtaTot(ulRowDTO.getQtaCol())
|
||||
.setDataOrd(ulRowDTO.getDataOrd()!=null?UtilityLocalDate.localDateToDate(ulRowDTO.getDataOrd()):null)
|
||||
.setNumOrd(ulRowDTO.getNumOrd())
|
||||
.setRigaOrd(ulRowDTO.getRigaOrd())
|
||||
.setTargetMtbColt(uds)
|
||||
.setSourceMtbColr(sourceMtbColr)
|
||||
);
|
||||
|
||||
if (!createUDSFromDocuments.isMonoUl()) {
|
||||
wmsSpedizioneService.closeUDS(new CloseUDSRequestDTO().setMtbColt(uds));
|
||||
|
||||
generatedMtbColt.add(uds);
|
||||
}
|
||||
}
|
||||
|
||||
if (createUDSFromDocuments.isMonoUl()) {
|
||||
wmsSpedizioneService.closeUDS(new CloseUDSRequestDTO().setMtbColt(uds));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user