Fix scansione barcode alternativi in VerificaGiacenze
This commit is contained in:
parent
f3f0fd8fd8
commit
71a18e9ffa
@ -97,6 +97,8 @@ public class MtbAart extends EntityBase {
|
|||||||
|
|
||||||
private List<MtbUntMis> mtbUntMis;
|
private List<MtbUntMis> mtbUntMis;
|
||||||
|
|
||||||
|
private List<MtbAartBarCode> mtbAartBarCode;
|
||||||
|
|
||||||
|
|
||||||
public enum UntMisRifPesoEnum {
|
public enum UntMisRifPesoEnum {
|
||||||
C,
|
C,
|
||||||
@ -965,6 +967,13 @@ public class MtbAart extends EntityBase {
|
|||||||
return getMtbUntMis() != null && !getMtbUntMis().isEmpty() ? getMtbUntMis().get(0) : null;
|
return getMtbUntMis() != null && !getMtbUntMis().isEmpty() ? getMtbUntMis().get(0) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<MtbAartBarCode> getMtbAartBarCode() {
|
||||||
|
return mtbAartBarCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMtbAartBarCode(List<MtbAartBarCode> mtbAartBarCode) {
|
||||||
|
this.mtbAartBarCode = mtbAartBarCode;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
|
|||||||
@ -0,0 +1,55 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class MtbAartBarCode extends EntityBase {
|
||||||
|
private String codBarre;
|
||||||
|
private String codMart;
|
||||||
|
private BigDecimal qtaCnf;
|
||||||
|
private String flagPrimario;
|
||||||
|
private String tipoCodBarre;
|
||||||
|
|
||||||
|
public MtbAartBarCode() {
|
||||||
|
this.type = "mtb_aart_bar_code";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodBarre() {
|
||||||
|
return codBarre;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodBarre(String codBarre) {
|
||||||
|
this.codBarre = codBarre;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMart() {
|
||||||
|
return codMart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodMart(String codMart) {
|
||||||
|
this.codMart = codMart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaCnf() {
|
||||||
|
return qtaCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQtaCnf(BigDecimal qtaCnf) {
|
||||||
|
this.qtaCnf = qtaCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagPrimario() {
|
||||||
|
return flagPrimario;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlagPrimario(String flagPrimario) {
|
||||||
|
this.flagPrimario = flagPrimario;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTipoCodBarre() {
|
||||||
|
return tipoCodBarre;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTipoCodBarre(String tipoCodBarre) {
|
||||||
|
this.tipoCodBarre = tipoCodBarre;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -11,6 +11,7 @@ import java.time.LocalDateTime;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -24,6 +25,7 @@ import it.integry.integrywmsnative.core.data_store.db.respository_new.VerificaGi
|
|||||||
import it.integry.integrywmsnative.core.exception.NoArtsFoundException;
|
import it.integry.integrywmsnative.core.exception.NoArtsFoundException;
|
||||||
import it.integry.integrywmsnative.core.mapper.VerificaGiacenzeMapper;
|
import it.integry.integrywmsnative.core.mapper.VerificaGiacenzeMapper;
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAartBarCode;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaPvRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaPvRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
||||||
@ -116,7 +118,7 @@ public class VerificaGiacenzeViewModel {
|
|||||||
|
|
||||||
public void randomizeElements(int elementsCount) {
|
public void randomizeElements(int elementsCount) {
|
||||||
|
|
||||||
for(int i = 0; i < elementsCount; i++) {
|
for (int i = 0; i < elementsCount; i++) {
|
||||||
var randomIndex = (int) (Math.random() * currentLoadedAnagrafiche.size());
|
var randomIndex = (int) (Math.random() * currentLoadedAnagrafiche.size());
|
||||||
var randomAnagrafica = currentLoadedAnagrafiche.get(randomIndex);
|
var randomAnagrafica = currentLoadedAnagrafiche.get(randomIndex);
|
||||||
|
|
||||||
@ -168,7 +170,7 @@ public class VerificaGiacenzeViewModel {
|
|||||||
|
|
||||||
|
|
||||||
public void save() throws Exception {
|
public void save() throws Exception {
|
||||||
if(currentVerificaRows.getValue().isEmpty()) {
|
if (currentVerificaRows.getValue().isEmpty()) {
|
||||||
delete();
|
delete();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -280,10 +282,21 @@ public class VerificaGiacenzeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public MtbAart searchAnagraficaByBarcode(String barcode) {
|
public MtbAart searchAnagraficaByBarcode(String barcode) {
|
||||||
return currentLoadedAnagrafiche.parallelStream()
|
MtbAart mtbAart = currentLoadedAnagrafiche.parallelStream()
|
||||||
.filter(mtbAart -> barcode.equals(mtbAart.getBarCode()))
|
.filter(x -> barcode.equals(x.getBarCode()))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
|
|
||||||
|
if (mtbAart == null) {
|
||||||
|
mtbAart = currentLoadedAnagrafiche.parallelStream()
|
||||||
|
.filter(x -> x.getMtbAartBarCode() != null &&
|
||||||
|
x.getMtbAartBarCode().stream()
|
||||||
|
.anyMatch(y -> barcode.equals(y.getCodBarre())))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
return mtbAart;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void insertRow(VerificaGiacenzeRowEntity rowEntity) {
|
public void insertRow(VerificaGiacenzeRowEntity rowEntity) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user