Aggiunta commessa ordine nel recupero materiali
This commit is contained in:
@@ -151,6 +151,7 @@ public class RecuperaMaterialiRequestDTO {
|
||||
private BigDecimal qtaCol;
|
||||
private BigDecimal numCnf;
|
||||
private Integer percentageHr;
|
||||
private String codJcom;
|
||||
|
||||
public Integer getNumero() {
|
||||
return numero;
|
||||
@@ -214,5 +215,14 @@ public class RecuperaMaterialiRequestDTO {
|
||||
this.percentageHr = percentageHr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJcom() {
|
||||
return codJcom;
|
||||
}
|
||||
|
||||
public Ordine setCodJcom(String codJcom) {
|
||||
this.codJcom = codJcom;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +163,8 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
.setRigaOrd(x.getRigaOrd())
|
||||
.setPercentageHr(x.getPercentageHr())
|
||||
.setQtaCol(x.getQtaCol())
|
||||
.setNumCnf(x.getNumCnf()))
|
||||
.setNumCnf(x.getNumCnf())
|
||||
.setCodJcom(x.getCodJcom()))
|
||||
.collect(Collectors.toUnmodifiableList());
|
||||
|
||||
MtbColtKey movementScaricoKey = new MtbColtKey(item.getGestione(), item.getSerCollo(), item.getDataCollo(), item.getNumCollo());
|
||||
|
||||
@@ -26,7 +26,6 @@ public class HistoryVersamentoProdULDTO {
|
||||
private BigDecimal numCnf;
|
||||
private String partitaMag;
|
||||
private String codJcom;
|
||||
private String codJcomOrd;
|
||||
private LocalDateTime datetimeRow;
|
||||
private String descrizioneArt;
|
||||
private String untMis;
|
||||
@@ -177,15 +176,6 @@ public class HistoryVersamentoProdULDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJcomOrd() {
|
||||
return codJcomOrd;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdULDTO setCodJcomOrd(String codJcomOrd) {
|
||||
this.codJcomOrd = codJcomOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDateTime getDatetimeRow() {
|
||||
return datetimeRow;
|
||||
}
|
||||
@@ -290,7 +280,7 @@ public class HistoryVersamentoProdULDTO {
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
HistoryVersamentoProdULDTO that = (HistoryVersamentoProdULDTO) o;
|
||||
return getGestione().equals(that.getGestione()) && getDataCollo().equals(that.getDataCollo()) && getSerCollo().equals(that.getSerCollo()) && getNumCollo().equals(that.getNumCollo()) && getSegno().equals(that.getSegno()) && getCodMart().equals(that.getCodMart()) && Objects.equals(getCodCol(), that.getCodCol()) && Objects.equals(getCodTagl(), that.getCodTagl()) && getCodJfas().equals(that.getCodJfas()) && Objects.equals(getDescrizioneFase(), that.getDescrizioneFase()) && getQtaCol().equals(that.getQtaCol()) && getQtaCnf().equals(that.getQtaCnf()) && getNumCnf().equals(that.getNumCnf()) && Objects.equals(getPartitaMag(), that.getPartitaMag()) && Objects.equals(getCodJcom(), that.getCodJcom()) && Objects.equals(getCodJcomOrd(), that.getCodJcomOrd()) && getDatetimeRow().equals(that.getDatetimeRow()) && Objects.equals(getDescrizioneArt(), that.getDescrizioneArt()) && Objects.equals(getUntMis(), that.getUntMis()) && getBarcodeUlOut().equals(that.getBarcodeUlOut()) && Objects.equals(getCodMdepOut(), that.getCodMdepOut()) && Objects.equals(getPosizioneOut(), that.getPosizioneOut()) && Objects.equals(getBarcodeUlIn(), that.getBarcodeUlIn()) && Objects.equals(getCodMdepIn(), that.getCodMdepIn()) && Objects.equals(getPosizioneIn(), that.getPosizioneIn());
|
||||
return getGestione().equals(that.getGestione()) && getDataCollo().equals(that.getDataCollo()) && getSerCollo().equals(that.getSerCollo()) && getNumCollo().equals(that.getNumCollo()) && getSegno().equals(that.getSegno()) && getCodMart().equals(that.getCodMart()) && Objects.equals(getCodCol(), that.getCodCol()) && Objects.equals(getCodTagl(), that.getCodTagl()) && getCodJfas().equals(that.getCodJfas()) && Objects.equals(getDescrizioneFase(), that.getDescrizioneFase()) && getQtaCol().equals(that.getQtaCol()) && getQtaCnf().equals(that.getQtaCnf()) && getNumCnf().equals(that.getNumCnf()) && Objects.equals(getPartitaMag(), that.getPartitaMag()) && Objects.equals(getCodJcom(), that.getCodJcom()) && getDatetimeRow().equals(that.getDatetimeRow()) && Objects.equals(getDescrizioneArt(), that.getDescrizioneArt()) && Objects.equals(getUntMis(), that.getUntMis()) && getBarcodeUlOut().equals(that.getBarcodeUlOut()) && Objects.equals(getCodMdepOut(), that.getCodMdepOut()) && Objects.equals(getPosizioneOut(), that.getPosizioneOut()) && Objects.equals(getBarcodeUlIn(), that.getBarcodeUlIn()) && Objects.equals(getCodMdepIn(), that.getCodMdepIn()) && Objects.equals(getPosizioneIn(), that.getPosizioneIn());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -310,7 +300,6 @@ public class HistoryVersamentoProdULDTO {
|
||||
result = 31 * result + getNumCnf().hashCode();
|
||||
result = 31 * result + Objects.hashCode(getPartitaMag());
|
||||
result = 31 * result + Objects.hashCode(getCodJcom());
|
||||
result = 31 * result + Objects.hashCode(getCodJcomOrd());
|
||||
result = 31 * result + getDatetimeRow().hashCode();
|
||||
result = 31 * result + Objects.hashCode(getDescrizioneArt());
|
||||
result = 31 * result + Objects.hashCode(getUntMis());
|
||||
@@ -331,6 +320,7 @@ public class HistoryVersamentoProdULDTO {
|
||||
private BigDecimal qtaCol;
|
||||
private BigDecimal numCnf;
|
||||
private Integer percentageHr;
|
||||
private String codJcom;
|
||||
|
||||
public BigDecimal getQtaCnf() {
|
||||
return qtaCol.divide(numCnf, 3, RoundingMode.HALF_EVEN);
|
||||
@@ -398,5 +388,42 @@ public class HistoryVersamentoProdULDTO {
|
||||
this.percentageHr = percentageHr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJcom() {
|
||||
return codJcom;
|
||||
}
|
||||
|
||||
public OrdineDto setCodJcom(String codJcom) {
|
||||
this.codJcom = codJcom;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
OrdineDto ordineDto = (OrdineDto) o;
|
||||
return getNumero().equals(ordineDto.getNumero()) &&
|
||||
getData().equals(ordineDto.getData()) &&
|
||||
getGestione().equals(ordineDto.getGestione()) &&
|
||||
Objects.equals(getRigaOrd(), ordineDto.getRigaOrd()) &&
|
||||
getQtaCol().equals(ordineDto.getQtaCol()) &&
|
||||
getNumCnf().equals(ordineDto.getNumCnf()) &&
|
||||
Objects.equals(getPercentageHr(), ordineDto.getPercentageHr()) &&
|
||||
Objects.equals(getCodJcom(), ordineDto.getCodJcom());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = getNumero().hashCode();
|
||||
result = 31 * result + getData().hashCode();
|
||||
result = 31 * result + getGestione().hashCode();
|
||||
result = 31 * result + Objects.hashCode(getRigaOrd());
|
||||
result = 31 * result + getQtaCol().hashCode();
|
||||
result = 31 * result + getNumCnf().hashCode();
|
||||
result = 31 * result + Objects.hashCode(getPercentageHr());
|
||||
result = 31 * result + Objects.hashCode(getCodJcom());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,10 @@ package it.integry.integrywmsnative.gest.prod_recupero_materiale.rest;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -17,6 +16,7 @@ import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MaterialiRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULRestDTO;
|
||||
|
||||
@Singleton
|
||||
public class ProdRecuperoMaterialeRESTConsumer extends _BaseRESTConsumer {
|
||||
@@ -43,66 +43,65 @@ public class ProdRecuperoMaterialeRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
List<HistoryVersamentoProdULDTO> newUlList = new ArrayList<>();
|
||||
|
||||
Stream.of(ulList)
|
||||
.distinctBy(x -> {
|
||||
HashMap<String, Object> hashMap = new HashMap<>();
|
||||
hashMap.put("gestione", x.getGestione());
|
||||
hashMap.put("data_collo", x.getDataCollo());
|
||||
hashMap.put("ser_collo", x.getSerCollo());
|
||||
hashMap.put("num_collo", x.getNumCollo());
|
||||
hashMap.put("cod_mart", x.getCodMart());
|
||||
hashMap.put("barcode_ul_out", x.getBarcodeUlOut());
|
||||
|
||||
return hashMap;
|
||||
})
|
||||
.forEach(restDTO -> {
|
||||
|
||||
List<HistoryVersamentoProdULDTO.OrdineDto> ordineList = ulList.stream()
|
||||
.filter(x -> x.getNumCollo().equals(restDTO.getNumCollo()) &&
|
||||
x.getDataCollo().equals(restDTO.getDataCollo()) &&
|
||||
x.getSerCollo().equals(restDTO.getSerCollo()) &&
|
||||
x.getGestione().equals(restDTO.getGestione()) &&
|
||||
(x.getRigaOrd() == null || Objects.equals(x.getRigaOrd(), restDTO.getRigaOrd())))
|
||||
.map(x -> new HistoryVersamentoProdULDTO.OrdineDto()
|
||||
.setData(x.getDataOrd())
|
||||
.setNumero(x.getNumOrd())
|
||||
.setGestione(x.getGestione())
|
||||
.setRigaOrd(x.getRigaOrd())
|
||||
.setQtaCol(x.getQtaCol())
|
||||
.setNumCnf(x.getNumCnf())
|
||||
.setPercentageHr(x.getPercentageHr()))
|
||||
.collect(Collectors.toList());
|
||||
Map<HashMap<String, Object>, List<HistoryVersamentoProdULRestDTO>> ulListGrouped = ulList.stream()
|
||||
.collect(Collectors.groupingBy(x -> new HashMap<>() {{
|
||||
put("gestione", x.getGestione());
|
||||
put("data_collo", x.getDataCollo());
|
||||
put("ser_collo", x.getSerCollo());
|
||||
put("num_collo", x.getNumCollo());
|
||||
put("cod_mart", x.getCodMart());
|
||||
put("barcode_ul_out", x.getBarcodeUlOut());
|
||||
}}, Collectors.toList()));
|
||||
|
||||
|
||||
newUlList.add(new HistoryVersamentoProdULDTO()
|
||||
.setGestione(restDTO.getGestione())
|
||||
.setDataCollo(restDTO.getDataCollo())
|
||||
.setSerCollo(restDTO.getSerCollo())
|
||||
.setNumCollo(restDTO.getNumCollo())
|
||||
.setSegno(restDTO.getSegno())
|
||||
.setCodMart(restDTO.getCodMart())
|
||||
.setCodCol(restDTO.getCodCol())
|
||||
.setCodTagl(restDTO.getCodTagl())
|
||||
.setCodJfas(restDTO.getCodJfas())
|
||||
.setDescrizioneArt(restDTO.getDescrizioneArt())
|
||||
.setDescrizioneFase(restDTO.getDescrizioneFase())
|
||||
.setQtaCol(restDTO.getQtaCol())
|
||||
.setQtaCnf(restDTO.getQtaCnf())
|
||||
.setNumCnf(restDTO.getNumCnf())
|
||||
.setPartitaMag(restDTO.getPartitaMag())
|
||||
.setCodJcom(restDTO.getCodJcom())
|
||||
.setCodJcomOrd(restDTO.getCodJcomOrd())
|
||||
.setDatetimeRow(restDTO.getDatetimeRow())
|
||||
.setUntMis(restDTO.getUntMis())
|
||||
.setBarcodeUlOut(restDTO.getBarcodeUlOut())
|
||||
.setCodMdepOut(restDTO.getCodMdepOut())
|
||||
.setPosizioneOut(restDTO.getPosizioneOut())
|
||||
.setBarcodeUlIn(restDTO.getBarcodeUlIn())
|
||||
.setCodMdepIn(restDTO.getCodMdepIn())
|
||||
.setPosizioneIn(restDTO.getPosizioneIn())
|
||||
.setOrdini(ordineList));
|
||||
ulListGrouped.forEach((key, value) -> {
|
||||
|
||||
});
|
||||
var listaOrdini = value.stream()
|
||||
.filter(x -> x.getDataOrd() != null &&
|
||||
x.getGestioneOrd() != null &&
|
||||
x.getNumOrd() != null)
|
||||
.map(x -> new HistoryVersamentoProdULDTO.OrdineDto()
|
||||
.setData(x.getDataOrd())
|
||||
.setNumero(x.getNumOrd())
|
||||
.setGestione(x.getGestione())
|
||||
.setRigaOrd(x.getRigaOrd())
|
||||
.setQtaCol(x.getQtaCol())
|
||||
.setNumCnf(x.getNumCnf())
|
||||
.setPercentageHr(x.getPercentageHr())
|
||||
.setCodJcom(x.getCodJcomOrd()))
|
||||
.distinct()
|
||||
.collect(Collectors.toUnmodifiableList());
|
||||
|
||||
var restData = value.get(0);
|
||||
|
||||
newUlList.add(new HistoryVersamentoProdULDTO()
|
||||
.setGestione(restData.getGestione())
|
||||
.setDataCollo(restData.getDataCollo())
|
||||
.setSerCollo(restData.getSerCollo())
|
||||
.setNumCollo(restData.getNumCollo())
|
||||
.setSegno(restData.getSegno())
|
||||
.setCodMart(restData.getCodMart())
|
||||
.setCodCol(restData.getCodCol())
|
||||
.setCodTagl(restData.getCodTagl())
|
||||
.setCodJfas(restData.getCodJfas())
|
||||
.setDescrizioneArt(restData.getDescrizioneArt())
|
||||
.setDescrizioneFase(restData.getDescrizioneFase())
|
||||
.setQtaCol(restData.getQtaCol())
|
||||
.setQtaCnf(restData.getQtaCnf())
|
||||
.setNumCnf(restData.getNumCnf())
|
||||
.setPartitaMag(restData.getPartitaMag())
|
||||
.setCodJcom(restData.getCodJcom())
|
||||
.setDatetimeRow(restData.getDatetimeRow())
|
||||
.setUntMis(restData.getUntMis())
|
||||
.setBarcodeUlOut(restData.getBarcodeUlOut())
|
||||
.setCodMdepOut(restData.getCodMdepOut())
|
||||
.setPosizioneOut(restData.getPosizioneOut())
|
||||
.setBarcodeUlIn(restData.getBarcodeUlIn())
|
||||
.setCodMdepIn(restData.getCodMdepIn())
|
||||
.setPosizioneIn(restData.getPosizioneIn())
|
||||
.setOrdini(listaOrdini));
|
||||
|
||||
});
|
||||
|
||||
|
||||
if (!newUlList.isEmpty()) {
|
||||
|
||||
@@ -152,10 +152,12 @@
|
||||
style="@style/Widget.Material3.Chip.Assist"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{`Comm. Ord.: ` + item.codJcomOrd}"
|
||||
android:text="@{`Comm. Ord.: ` + item.ordini.get(0).codJcom}"
|
||||
android:textAppearance="?attr/textAppearanceLabelSmall"
|
||||
android:textColor="?attr/colorOnSecondaryContainer"
|
||||
android:focusable="false"
|
||||
android:clickable="false"
|
||||
android:checkable="false"
|
||||
app:ensureMinTouchTargetSize="false"
|
||||
app:chipBackgroundColor="?attr/colorSecondaryContainer"
|
||||
app:chipIcon="@drawable/ic_receipt_long_24"
|
||||
@@ -164,7 +166,7 @@
|
||||
app:chipMinHeight="28dp"
|
||||
app:iconStartPadding="4dp"
|
||||
app:textStartPadding="6dp"
|
||||
app:visibility="@{!UtilityString.isNullOrEmpty(item.codJcomOrd) ? View.VISIBLE : View.GONE}"
|
||||
app:visibility="@{item.ordini.size == 1 && !UtilityString.isNullOrEmpty(item.ordini.get(0).codJcom) ? View.VISIBLE : View.GONE}"
|
||||
tools:visibility="visible"
|
||||
tools:text="Comm. Ord.: ORD12345"/>
|
||||
|
||||
@@ -177,6 +179,8 @@
|
||||
android:textAppearance="?attr/textAppearanceLabelSmall"
|
||||
android:textColor="?attr/colorOnTertiaryContainer"
|
||||
android:focusable="false"
|
||||
android:clickable="false"
|
||||
android:checkable="false"
|
||||
app:ensureMinTouchTargetSize="false"
|
||||
app:chipBackgroundColor="?attr/colorTertiaryContainer"
|
||||
app:chipIcon="@drawable/ic_warehouse_24"
|
||||
@@ -198,6 +202,8 @@
|
||||
android:textAppearance="?attr/textAppearanceLabelSmall"
|
||||
android:textColor="?attr/colorOnErrorContainer"
|
||||
android:focusable="false"
|
||||
android:clickable="false"
|
||||
android:checkable="false"
|
||||
app:ensureMinTouchTargetSize="false"
|
||||
app:chipBackgroundColor="?attr/colorErrorContainer"
|
||||
app:chipIcon="@drawable/ic_label_24"
|
||||
|
||||
Reference in New Issue
Block a user