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