Fix decodifica barcode in recupero materiale
This commit is contained in:
parent
7878748548
commit
ba1118fdd8
@ -18,6 +18,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MaterialiRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
@ -30,6 +31,7 @@ import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||
|
||||
public class ProdRecuperoMaterialeViewModel {
|
||||
|
||||
private final BarcodeRESTConsumer mBarcodeRESTConsumer;
|
||||
private final ProdRecuperoMaterialeRESTConsumer mProdRecuperoMaterialeRESTConsumer;
|
||||
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||
private final PrinterRESTConsumer mPrinterRESTConsumer;
|
||||
@ -44,11 +46,13 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
|
||||
|
||||
@Inject
|
||||
public ProdRecuperoMaterialeViewModel(ProdRecuperoMaterialeRESTConsumer prodRecuperoMaterialeRESTConsumer,
|
||||
public ProdRecuperoMaterialeViewModel(BarcodeRESTConsumer barcodeRESTConsumer,
|
||||
ProdRecuperoMaterialeRESTConsumer prodRecuperoMaterialeRESTConsumer,
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||
PrinterRESTConsumer printerRESTConsumer,
|
||||
MaterialiRESTConsumer materialiRESTConsumer,
|
||||
ExecutorService executorService) {
|
||||
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||
this.mProdRecuperoMaterialeRESTConsumer = prodRecuperoMaterialeRESTConsumer;
|
||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||
this.mPrinterRESTConsumer = printerRESTConsumer;
|
||||
@ -78,29 +82,37 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
|
||||
public void processBarcodeDTO(BarcodeScanDTO data) {
|
||||
if (UtilityBarcode.isEtichettaAnonima(data) || UtilityBarcode.isEtichetta128(data)) {
|
||||
this.executeEtichettaLU(data.getStringValue());
|
||||
this.executeEtichettaLU(data);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void executeEtichettaLU(String sscc) {
|
||||
private void executeEtichettaLU(BarcodeScanDTO barcodeScanDTO) {
|
||||
this.sendOnLoadingStarted();
|
||||
this.mBarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
||||
|
||||
this.mColliMagazzinoRESTConsumer.getBySSCC(sscc, true, false, mtbColt -> {
|
||||
this.sendOnLoadingEnded();
|
||||
if(ean128Model == null || ean128Model.Sscc == null) {
|
||||
this.sendError(new NoLUFoundException());
|
||||
this.sendOnLoadingEnded();
|
||||
return;
|
||||
}
|
||||
|
||||
this.mColliMagazzinoRESTConsumer.getBySSCC(ean128Model.Sscc, true, false, mtbColt -> {
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
if (mtbColt != null) {
|
||||
HistoryVersamentoProdULDTO historyVersamentoProdULRestDTO = this.getHistoryElementFromMtbColt(mtbColt);
|
||||
if (historyVersamentoProdULRestDTO != null) {
|
||||
this.dispatchItem(historyVersamentoProdULRestDTO, mtbColt);
|
||||
} else {
|
||||
this.sendError(new NoLUFoundException());
|
||||
}
|
||||
|
||||
if (mtbColt != null) {
|
||||
HistoryVersamentoProdULDTO historyVersamentoProdULRestDTO = this.getHistoryElementFromMtbColt(mtbColt);
|
||||
if (historyVersamentoProdULRestDTO != null) {
|
||||
this.dispatchItem(historyVersamentoProdULRestDTO, mtbColt);
|
||||
} else {
|
||||
this.sendError(new NoLUFoundException());
|
||||
}
|
||||
|
||||
} else {
|
||||
this.sendError(new NoLUFoundException());
|
||||
}
|
||||
|
||||
}, this::sendError);
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
@ -181,7 +193,7 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
.setNumColloRif(item.getNumColloRif())
|
||||
.setOrdini(ordiniRequest);
|
||||
|
||||
if(mtbColt != null) {
|
||||
if (mtbColt != null) {
|
||||
request.setMtbColtCarico(mtbColt);
|
||||
} else {
|
||||
request.setMtbColtCarico(sourceMtbColt);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user