Fix su scannedMtbColr nullo in spedizione.
This commit is contained in:
@@ -3,21 +3,22 @@ package it.integry.integrywmsnative.gest.contenuto_bancale.viewmodel;
|
|||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import androidx.databinding.ObservableField;
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.databinding.ObservableField;
|
||||||
|
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||||
import it.integry.integrywmsnative.core.di.BindableString;
|
import it.integry.integrywmsnative.core.di.BindableString;
|
||||||
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
@@ -85,7 +86,6 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void recoverUL() {
|
public void recoverUL() {
|
||||||
Intent data = new Intent();
|
Intent data = new Intent();
|
||||||
String key = DataCache.addItem(mtbColt.get());
|
String key = DataCache.addItem(mtbColt.get());
|
||||||
@@ -105,7 +105,7 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
if (value.size() > 0) {
|
if (value.size() > 0) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ReportManager.getReportNameLUFromGestione(mtbColt.get().getGestioneEnum(), reportName -> {
|
String reportName = ReportManager.getReportNameLUFromGestione(mtbColt.get().getGestioneEnum());
|
||||||
|
|
||||||
reportName = mReportName != null ? mReportName : reportName;
|
reportName = mReportName != null ? mReportName : reportName;
|
||||||
|
|
||||||
@@ -121,8 +121,6 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
DialogSimpleMessageHelper.makeSuccessDialog(mContext, res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null).show();
|
DialogSimpleMessageHelper.makeSuccessDialog(mContext, res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null).show();
|
||||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
||||||
|
|
||||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress)
|
|
||||||
);
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ public class PickingResiViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum(), reportName -> {
|
String reportName = ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum());
|
||||||
|
|
||||||
this.mPrinterRESTConsumer.printCollo(
|
this.mPrinterRESTConsumer.printCollo(
|
||||||
printerName,
|
printerName,
|
||||||
@@ -224,7 +224,6 @@ public class PickingResiViewModel {
|
|||||||
1,
|
1,
|
||||||
reportName, onComplete, onFailed);
|
reportName, onComplete, onFailed);
|
||||||
|
|
||||||
}, onFailed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void postCloseOperations(MtbColt mtbColt, Runnable onComplete) {
|
private void postCloseOperations(MtbColt mtbColt, Runnable onComplete) {
|
||||||
@@ -282,7 +281,6 @@ public class PickingResiViewModel {
|
|||||||
BigDecimal qtaCnfDoc = withdrawableDtbDocr.getQtaCnf();
|
BigDecimal qtaCnfDoc = withdrawableDtbDocr.getQtaCnf();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.sendOnItemDispatched(
|
this.sendOnItemDispatched(
|
||||||
withdrawableDtbDocr.getMtbAart(),
|
withdrawableDtbDocr.getMtbAart(),
|
||||||
totalNumCnfDoc,
|
totalNumCnfDoc,
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void initBarcode() {
|
private void initBarcode() {
|
||||||
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||||
.setOnScanSuccessfull(onScanSuccessful)
|
.setOnScanSuccessfull(onScanSuccessful)
|
||||||
@@ -97,7 +96,6 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
|
|
||||||
@@ -180,9 +178,6 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void onItemDispatched(HistoryVersamentoProdULDTO item, BigDecimal quantity, MtbColt sourceMtbColt, Dialog progress) {
|
private void onItemDispatched(HistoryVersamentoProdULDTO item, BigDecimal quantity, MtbColt sourceMtbColt, Dialog progress) {
|
||||||
|
|
||||||
if (progress == null) {
|
if (progress == null) {
|
||||||
@@ -220,7 +215,6 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mtbColtScarico.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
mtbColtScarico.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
|
|
||||||
@@ -329,9 +323,8 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||||
ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum(), reportName -> {
|
String reportName = ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum());
|
||||||
|
|
||||||
PrinterRESTConsumer.printColloStatic(
|
PrinterRESTConsumer.printColloStatic(
|
||||||
printerName,
|
printerName,
|
||||||
@@ -339,11 +332,9 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
1,
|
1,
|
||||||
reportName, onComplete, onAbort);
|
reportName, onComplete, onAbort);
|
||||||
|
|
||||||
}, onAbort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void refreshAdapter() {
|
private void refreshAdapter() {
|
||||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
@@ -360,5 +351,4 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -714,7 +714,7 @@ public class SpedizioneViewModel {
|
|||||||
|
|
||||||
MtbColr refMtbColr = null;
|
MtbColr refMtbColr = null;
|
||||||
|
|
||||||
if(refMtbColt != null && refMtbColt.getMtbColr().size() > 0) {
|
if (scannedMtbColr != null && refMtbColt != null && refMtbColt.getMtbColr().size() > 0) {
|
||||||
Optional<MtbColr> optionalMtbColr = Stream.of(refMtbColt.getMtbColr())
|
Optional<MtbColr> optionalMtbColr = Stream.of(refMtbColt.getMtbColr())
|
||||||
.filter(y -> UtilityString.equalsIgnoreCase(y.getCodMart(), scannedMtbColr.getCodMart()) &&
|
.filter(y -> UtilityString.equalsIgnoreCase(y.getCodMart(), scannedMtbColr.getCodMart()) &&
|
||||||
UtilityString.equalsIgnoreCase(y.getCodTagl(), scannedMtbColr.getCodTagl()) &&
|
UtilityString.equalsIgnoreCase(y.getCodTagl(), scannedMtbColr.getCodTagl()) &&
|
||||||
@@ -1412,7 +1412,7 @@ public class SpedizioneViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
private void singlePrint(MtbColt mtbColtToPrint, String printerName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum(), reportName -> {
|
String reportName = ReportManager.getReportNameLUFromGestione(mtbColtToPrint.getGestioneEnum());
|
||||||
|
|
||||||
this.mPrinterRESTConsumer.printCollo(
|
this.mPrinterRESTConsumer.printCollo(
|
||||||
printerName,
|
printerName,
|
||||||
@@ -1420,7 +1420,6 @@ public class SpedizioneViewModel {
|
|||||||
1,
|
1,
|
||||||
reportName, onComplete, onFailed);
|
reportName, onComplete, onFailed);
|
||||||
|
|
||||||
}, onFailed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user