Implementato controllo su barcode UL/Articolo in fase di add extra item.
This commit is contained in:
parent
a6664102db
commit
0cc31a4a8e
@ -10,6 +10,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
|
||||
public class BaseDialogFragment extends DialogFragment {
|
||||
@ -65,7 +66,7 @@ public class BaseDialogFragment extends DialogFragment {
|
||||
protected void openProgress() {
|
||||
|
||||
// new Thread(() -> {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
if (this.mCurrentProgress == null) {
|
||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
||||
}
|
||||
@ -75,7 +76,7 @@ public class BaseDialogFragment extends DialogFragment {
|
||||
|
||||
protected void closeProgress() {
|
||||
// new Thread(() -> {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
if (mCurrentProgress != null) {
|
||||
mCurrentProgress.dismiss();
|
||||
mCurrentProgress = null;
|
||||
@ -83,4 +84,12 @@ public class BaseDialogFragment extends DialogFragment {
|
||||
});
|
||||
// }).start();
|
||||
}
|
||||
|
||||
|
||||
public void onError(Exception ex) {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.closeProgress();
|
||||
UtilityExceptions.defaultException(requireActivity(), ex);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
public BindableBoolean bottomSheetEnabled = new BindableBoolean(false);
|
||||
public BindableBoolean closeOrderButtonEnabled = new BindableBoolean(false);
|
||||
|
||||
private boolean mEnableGiacenza;
|
||||
private boolean mEnableFakeGiacenza;
|
||||
private boolean mFlagShowCodForn;
|
||||
private boolean mDivideByGrpMerc;
|
||||
private boolean mEnableQuantityReset;
|
||||
@ -195,16 +195,16 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
mEnableGiacenza = !SettingsManager.iDB().isFlagSpedizioneEnableFakeGiacenza();
|
||||
mEnableFakeGiacenza = !SettingsManager.iDB().isFlagSpedizioneEnableFakeGiacenza();
|
||||
boolean enableCheckPartitaMag = SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV();
|
||||
boolean canOverflowOrderQuantity = SettingsManager.iDB().isFlagCanAddExtraQuantitySpedizione();
|
||||
boolean shouldAskPesoLU = SettingsManager.iDB().isFlagAskPesoColloSpedizione();
|
||||
boolean useQtaOrd = SettingsManager.iDB().isFlagSpedizioneUseQtaOrd();
|
||||
|
||||
if (mEnableGiacenza) this.openProgress();
|
||||
if (mEnableFakeGiacenza) this.openProgress();
|
||||
mViewmodel.init(
|
||||
codMdep,
|
||||
mEnableGiacenza,
|
||||
mEnableFakeGiacenza,
|
||||
enableCheckPartitaMag,
|
||||
shouldAskPesoLU,
|
||||
canOverflowOrderQuantity,
|
||||
@ -311,7 +311,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
boolean anyLUPresent = x.getMtbColts() != null && x.getMtbColts().size() > 0;
|
||||
|
||||
spedizioneListModel.setActive(!mEnableGiacenza || anyLUPresent);
|
||||
spedizioneListModel.setActive(!mEnableFakeGiacenza || anyLUPresent);
|
||||
|
||||
|
||||
AtomicBigDecimal numCnfWithdrawRows = new AtomicBigDecimal();
|
||||
@ -323,10 +323,10 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
qtaColWithdrawRows.addAndGet(row.getQtaCol());
|
||||
});
|
||||
|
||||
spedizioneListModel.setBadge2(x.getSitArtOrdDTO().getCodJcom());
|
||||
|
||||
if (!anyLUPresent) {
|
||||
spedizioneListModel.setGroupTitle(mEnableGiacenza ? getString(R.string.picking_not_available) : "");
|
||||
spedizioneListModel.setBadge2(x.getSitArtOrdDTO().getCodJcom());
|
||||
spedizioneListModel.setGroupTitle(mEnableFakeGiacenza ? getString(R.string.picking_not_available) : "");
|
||||
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
spedizioneListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
@ -469,7 +469,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
boolean anyLUPresent = x.getMtbColts() != null && x.getMtbColts().size() > 0;
|
||||
|
||||
spedizioneListModel.setActive(!mEnableGiacenza || anyLUPresent);
|
||||
spedizioneListModel.setActive(!mEnableFakeGiacenza || anyLUPresent);
|
||||
|
||||
|
||||
AtomicBigDecimal numCnfWithdrawRows = new AtomicBigDecimal();
|
||||
@ -625,7 +625,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
public void addExtraItem() {
|
||||
DialogScanArtView
|
||||
.newInstance((status, mtbAart, ean128Model, mtbColr) -> {
|
||||
.newInstance(!mEnableFakeGiacenza, (status, mtbAart, ean128Model, mtbColr) -> {
|
||||
if (status == DialogConsts.Results.YES) {
|
||||
this.mViewmodel.dispatchExtraItem(mtbAart, ean128Model, mtbColr);
|
||||
}
|
||||
|
||||
@ -27,7 +27,6 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgssss;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.databinding.DialogScanArtBinding;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_art_from_lista_mtb_colr.DialogChooseArtFromListaMtbColrView;
|
||||
@ -37,6 +36,8 @@ public class DialogScanArtView extends BaseDialogFragment implements DialogScanA
|
||||
@Inject
|
||||
DialogScanArtViewModel mViewModel;
|
||||
|
||||
private final boolean mForceOnlyUL;
|
||||
|
||||
private DialogScanArtBinding mBindings;
|
||||
|
||||
private int mBarcodeScannerIstanceID;
|
||||
@ -44,12 +45,13 @@ public class DialogScanArtView extends BaseDialogFragment implements DialogScanA
|
||||
private RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, MtbColr> mOnItemChoosed = null;
|
||||
|
||||
|
||||
public static DialogScanArtView newInstance(@NotNull RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, MtbColr> onComplete) {
|
||||
return new DialogScanArtView(onComplete);
|
||||
public static DialogScanArtView newInstance(boolean forceOnlyUL, @NotNull RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, MtbColr> onComplete) {
|
||||
return new DialogScanArtView(forceOnlyUL, onComplete);
|
||||
}
|
||||
|
||||
private DialogScanArtView(RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, MtbColr> onItemChoosed) {
|
||||
private DialogScanArtView(boolean forceOnlyUL, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, MtbColr> onItemChoosed) {
|
||||
super();
|
||||
mForceOnlyUL = forceOnlyUL;
|
||||
mOnItemChoosed = onItemChoosed;
|
||||
}
|
||||
|
||||
@ -67,6 +69,7 @@ public class DialogScanArtView extends BaseDialogFragment implements DialogScanA
|
||||
.inject(this);
|
||||
|
||||
this.mViewModel
|
||||
.setForceOnlyUL(mForceOnlyUL)
|
||||
.setListener(this);
|
||||
|
||||
getDialog().setCanceledOnTouchOutside(false);
|
||||
@ -122,8 +125,7 @@ public class DialogScanArtView extends BaseDialogFragment implements DialogScanA
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
this.closeProgress();
|
||||
UtilityExceptions.defaultException(getActivity(), ex);
|
||||
super.onError(ex);
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,6 +26,8 @@ public class DialogScanArtViewModel {
|
||||
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||
|
||||
private boolean mForceOnlyUL;
|
||||
|
||||
private Listener mListener;
|
||||
|
||||
public DialogScanArtViewModel(BarcodeRESTConsumer barcodeRESTConsumer, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
@ -34,6 +36,10 @@ public class DialogScanArtViewModel {
|
||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||
}
|
||||
|
||||
public DialogScanArtViewModel setForceOnlyUL(boolean forceOnlyUL) {
|
||||
this.mForceOnlyUL = forceOnlyUL;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete) {
|
||||
if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
||||
@ -44,12 +50,14 @@ public class DialogScanArtViewModel {
|
||||
//Cerco l'UL presente all'interno della posizione
|
||||
// this.executeEtichettaPosizione(barcodeScanDTO.getStringValue(), onComplete);
|
||||
|
||||
} else if(UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||
} else if(UtilityBarcode.isEtichetta128(barcodeScanDTO) && !mForceOnlyUL) {
|
||||
this.executeEtichettaEan128(barcodeScanDTO, onComplete);
|
||||
} else if(UtilityBarcode.isEanPeso(barcodeScanDTO)){
|
||||
} else if(UtilityBarcode.isEanPeso(barcodeScanDTO) && !mForceOnlyUL){
|
||||
this.executeEtichettaEanPeso(barcodeScanDTO, onComplete);
|
||||
} else {
|
||||
} else if (!mForceOnlyUL){
|
||||
this.loadArticolo(barcodeScanDTO.getStringValue(), null, onComplete);
|
||||
} else {
|
||||
this.sendError(new Exception("Barcode non valido"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.0.1'
|
||||
classpath 'com.android.tools.build:gradle:7.0.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.google.gms:google-services:4.3.5'
|
||||
classpath 'com.google.firebase:perf-plugin:1.3.5'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user