Finish v1.45.02(484)

This commit is contained in:
Giuseppe Scorrano 2025-03-18 12:17:23 +01:00
commit c99e32998b
4 changed files with 145 additions and 92 deletions

View File

@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
android { android {
def appVersionCode = 483 def appVersionCode = 484
def appVersionName = '1.45.01' def appVersionName = '1.45.02'
signingConfigs { signingConfigs {
release { release {

View File

@ -5,6 +5,7 @@ import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Resources; import android.content.res.Resources;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.text.Html; import android.text.Html;
import android.text.SpannableString; import android.text.SpannableString;
import android.view.Gravity; import android.view.Gravity;
@ -96,6 +97,9 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
@Inject @Inject
DialogInputQuantityV2View mDialogInputQuantityV2View; DialogInputQuantityV2View mDialogInputQuantityV2View;
@Inject
Handler handler;
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel; private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
private final ObservableArrayList<SpedizioneListModel> mSpedizioneMutableData = new ObservableArrayList<>(); private final ObservableArrayList<SpedizioneListModel> mSpedizioneMutableData = new ObservableArrayList<>();
@ -715,6 +719,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
}; };
public void addExtraItem() { public void addExtraItem() {
handler.post(() -> {
DialogScanArtView DialogScanArtView
.newInstance(!mEnableFakeGiacenza, (status, mtbAart, ean128Model, mtbColr) -> { .newInstance(!mEnableFakeGiacenza, (status, mtbAart, ean128Model, mtbColr) -> {
if (status == DialogConsts.Results.YES) { if (status == DialogConsts.Results.YES) {
@ -725,9 +730,11 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
this.mViewmodel.executeEmptyMagazzinoAutomaticoRequest(pickMagazzinoAutomaticoPosizione, this::onLoadingEnded); this.mViewmodel.executeEmptyMagazzinoAutomaticoRequest(pickMagazzinoAutomaticoPosizione, this::onLoadingEnded);
}) })
.show(getSupportFragmentManager(), "tag"); .show(getSupportFragmentManager(), "tag");
});
} }
public void startManualSearch() { public void startManualSearch() {
handler.post(() -> {
BarcodeManager.disable(); BarcodeManager.disable();
DialogSimpleInputHelper.makeInputDialog(this, "Inserisci il codice a barre", codice -> { DialogSimpleInputHelper.makeInputDialog(this, "Inserisci il codice a barre", codice -> {
@ -735,10 +742,13 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
BarcodeManager.enable(); BarcodeManager.enable();
}, BarcodeManager::enable).show(); }, BarcodeManager::enable).show();
});
} }
public void removeListFilter() { public void removeListFilter() {
handler.post(() -> {
this.mViewmodel.resetMatchedRows(); this.mViewmodel.resetMatchedRows();
});
} }
@ -754,6 +764,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
public void trackPackaging() { public void trackPackaging() {
handler.post(() -> {
this.fabPopupMenu.dismiss(); this.fabPopupMenu.dismiss();
DialogTracciamentoImballiView.newInstance(imballiData -> { DialogTracciamentoImballiView.newInstance(imballiData -> {
@ -765,15 +776,18 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
.show(getSupportFragmentManager(), DialogAskVettoreView.class.getName()); .show(getSupportFragmentManager(), DialogAskVettoreView.class.getName());
} }
}).show(getSupportFragmentManager(), DialogTracciamentoImballiView.class.getName()); }).show(getSupportFragmentManager(), DialogTracciamentoImballiView.class.getName());
});
} }
public void showCreatedUL() { public void showCreatedUL() {
handler.post(() -> {
this.fabPopupMenu.dismiss(); this.fabPopupMenu.dismiss();
ArrayList<MtbColt> createdMtbColts = this.mViewmodel.getCreatedMtbColts(); ArrayList<MtbColt> createdMtbColts = this.mViewmodel.getCreatedMtbColts();
Intent myIntent = ListaBancaliActivity.createIntent(this, createdMtbColts, true, false); Intent myIntent = ListaBancaliActivity.createIntent(this, createdMtbColts, true, false);
this.startActivityForResult(myIntent, PICK_UL_REQUEST); this.startActivityForResult(myIntent, PICK_UL_REQUEST);
});
} }
@ -785,6 +799,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
@Override @Override
public void onLUOpened(MtbColt mtbColt) { public void onLUOpened(MtbColt mtbColt) {
handler.post(() -> {
this.addExtraItemsEnabled.set(SettingsManager.iDB().isFlagCanAddExtraItemSpedizione()); this.addExtraItemsEnabled.set(SettingsManager.iDB().isFlagCanAddExtraItemSpedizione());
noLUPresent.set(false); noLUPresent.set(false);
@ -793,42 +808,51 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
.show(); .show();
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(mtbColt); this.mBottomSheetFragmentLUContentViewModel.setMtbColt(mtbColt);
});
} }
@Override @Override
public void onLUClosed() { public void onLUClosed() {
handler.post(() -> {
this.addExtraItemsEnabled.set(false); this.addExtraItemsEnabled.set(false);
noLUPresent.set(true); noLUPresent.set(true);
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null); this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
if (this.mShouldCloseActivity) super.onBackPressed(); if (this.mShouldCloseActivity) super.onBackPressed();
});
} }
@Override @Override
public void onLUPesoRequired(String codTcol, BigDecimal netWeightKG, BigDecimal grossWeightKG, RunnableArgsss<String, BigDecimal, BigDecimal> onComplete) { public void onLUPesoRequired(String codTcol, BigDecimal netWeightKG, BigDecimal grossWeightKG, RunnableArgsss<String, BigDecimal, BigDecimal> onComplete) {
handler.post(() -> {
DialogInputPesoLUView.newInstance(null, new BigDecimal(50), new BigDecimal(55), (newCodTcol, newNetWeight, newGrossWeight) -> { DialogInputPesoLUView.newInstance(null, new BigDecimal(50), new BigDecimal(55), (newCodTcol, newNetWeight, newGrossWeight) -> {
onComplete.run(newCodTcol, netWeightKG, grossWeightKG); onComplete.run(newCodTcol, netWeightKG, grossWeightKG);
}) })
.show(getSupportFragmentManager(), "tag"); .show(getSupportFragmentManager(), "tag");
});
} }
@Override @Override
public void onLUSuccessullyPrinted() { public void onLUSuccessullyPrinted() {
handler.post(() -> {
Resources res = getResources(); Resources res = getResources();
String errorMessage = res.getText(R.string.alert_print_completed_message).toString(); String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
DialogSimpleMessageView DialogSimpleMessageView
.makeSuccessDialog(res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null) .makeSuccessDialog(res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null)
.show(getSupportFragmentManager(), "tag"); .show(getSupportFragmentManager(), "tag");
});
} }
@Override @Override
public void onLUPrintRequest(RunnableArgs<Boolean> onComplete) { public void onLUPrintRequest(RunnableArgs<Boolean> onComplete) {
handler.post(() -> {
DialogYesNoView.newInstance(getString(R.string.action_print), DialogYesNoView.newInstance(getString(R.string.action_print),
String.format(getString(R.string.message_print_packing_list), "Packing List"), String.format(getString(R.string.message_print_packing_list), "Packing List"),
result -> { result -> {
onComplete.run(result == DialogConsts.Results.YES); onComplete.run(result == DialogConsts.Results.YES);
}) })
.show(getSupportFragmentManager(), "dialog-print"); .show(getSupportFragmentManager(), "dialog-print");
});
} }
@Override @Override
@ -845,18 +869,23 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
@Override @Override
public void onFilterApplied(String newValue) { public void onFilterApplied(String newValue) {
handler.post(() -> {
this.mBindings.filteredArtsInListExpandableLayout.expand(true); this.mBindings.filteredArtsInListExpandableLayout.expand(true);
this.mBindings.descriptionFilterText.setText(!UtilityString.isNullOrEmpty(newValue) ? newValue : ""); this.mBindings.descriptionFilterText.setText(!UtilityString.isNullOrEmpty(newValue) ? newValue : "");
});
} }
@Override @Override
public void onFilterRemoved() { public void onFilterRemoved() {
handler.post(() -> {
this.mBindings.filteredArtsInListExpandableLayout.collapse(true); this.mBindings.filteredArtsInListExpandableLayout.collapse(true);
this.mBindings.descriptionFilterText.setText(""); this.mBindings.descriptionFilterText.setText("");
});
} }
@Override @Override
public void onMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete) { public void onMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete) {
handler.post(() -> {
String text = getResources().getString(R.string.alert_delete_mtb_colr); String text = getResources().getString(R.string.alert_delete_mtb_colr);
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text), DialogSimpleMessageView.makeWarningDialog(new SpannableString(text),
null, null,
@ -864,10 +893,12 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
() -> onComplete.run(false) () -> onComplete.run(false)
) )
.show(getSupportFragmentManager(), "tag"); .show(getSupportFragmentManager(), "tag");
});
} }
@Override @Override
public void onError(Exception ex, boolean useSnackbar) { public void onError(Exception ex, boolean useSnackbar) {
handler.post(() -> {
this.onLoadingEnded(); this.onLoadingEnded();
if (ex instanceof InvalidPesoKGException) { if (ex instanceof InvalidPesoKGException) {
@ -880,6 +911,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
} }
BarcodeManager.enable(); BarcodeManager.enable();
});
} }
@Override @Override

View File

@ -1,5 +1,9 @@
package it.integry.integrywmsnative.gest.spedizione; package it.integry.integrywmsnative.gest.spedizione;
import android.os.Handler;
import java.util.concurrent.ExecutorService;
import dagger.Module; import dagger.Module;
import dagger.Provides; import dagger.Provides;
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService; import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
@ -38,7 +42,9 @@ public class SpedizioneModule {
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer, ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
MagazzinoAutomaticoRESTConsumer magazzinoAutomaticoRESTConsumer, MagazzinoAutomaticoRESTConsumer magazzinoAutomaticoRESTConsumer,
ImballiRESTConsumer imballiRESTConsumer, ImballiRESTConsumer imballiRESTConsumer,
MagazzinoRESTConsumer magazzinoRESTConsumer) { MagazzinoRESTConsumer magazzinoRESTConsumer,
ExecutorService executorService,
Handler handler) {
return new SpedizioneViewModel(articoloRESTConsumer, return new SpedizioneViewModel(articoloRESTConsumer,
barcodeRESTConsumer, barcodeRESTConsumer,
colliDataRecoverService, colliDataRecoverService,
@ -51,7 +57,9 @@ public class SpedizioneModule {
colliLavorazioneRESTConsumer, colliLavorazioneRESTConsumer,
magazzinoAutomaticoRESTConsumer, magazzinoAutomaticoRESTConsumer,
imballiRESTConsumer, imballiRESTConsumer,
magazzinoRESTConsumer); magazzinoRESTConsumer,
executorService,
handler);
} }
} }

View File

@ -1,5 +1,7 @@
package it.integry.integrywmsnative.gest.spedizione; package it.integry.integrywmsnative.gest.spedizione;
import android.os.Handler;
import androidx.databinding.ObservableArrayList; import androidx.databinding.ObservableArrayList;
import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.MutableLiveData;
@ -14,6 +16,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.Optional; import java.util.Optional;
import java.util.concurrent.ExecutorService;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.inject.Inject; import javax.inject.Inject;
@ -140,9 +143,13 @@ public class SpedizioneViewModel {
private final MagazzinoAutomaticoRESTConsumer mMagazzinoAutomaticoRESTConsumer; private final MagazzinoAutomaticoRESTConsumer mMagazzinoAutomaticoRESTConsumer;
private final ImballiRESTConsumer mImballiRESTConsumer; private final ImballiRESTConsumer mImballiRESTConsumer;
private final ExecutorService executorService;
private final Handler handler;
private ColliScaricoRESTConsumerInterface mColliScaricoRESTConsumer; private ColliScaricoRESTConsumerInterface mColliScaricoRESTConsumer;
private MagazzinoRESTConsumer magazzinoRESTConsumer; private MagazzinoRESTConsumer magazzinoRESTConsumer;
@Inject @Inject
public SpedizioneViewModel(ArticoloRESTConsumer articoloRESTConsumer, public SpedizioneViewModel(ArticoloRESTConsumer articoloRESTConsumer,
BarcodeRESTConsumer barcodeRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer,
@ -156,7 +163,9 @@ public class SpedizioneViewModel {
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer, ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
MagazzinoAutomaticoRESTConsumer mMagazzinoAutomaticoRESTConsumer, MagazzinoAutomaticoRESTConsumer mMagazzinoAutomaticoRESTConsumer,
ImballiRESTConsumer imballiRESTConsumer, ImballiRESTConsumer imballiRESTConsumer,
MagazzinoRESTConsumer magazzinoRESTConsumer) { MagazzinoRESTConsumer magazzinoRESTConsumer,
ExecutorService executorService,
Handler handler) {
this.mArticoloRESTConsumer = articoloRESTConsumer; this.mArticoloRESTConsumer = articoloRESTConsumer;
this.mBarcodeRESTConsumer = barcodeRESTConsumer; this.mBarcodeRESTConsumer = barcodeRESTConsumer;
this.mColliDataRecoverService = colliDataRecoverService; this.mColliDataRecoverService = colliDataRecoverService;
@ -170,6 +179,8 @@ public class SpedizioneViewModel {
this.mMagazzinoAutomaticoRESTConsumer = mMagazzinoAutomaticoRESTConsumer; this.mMagazzinoAutomaticoRESTConsumer = mMagazzinoAutomaticoRESTConsumer;
this.mImballiRESTConsumer = imballiRESTConsumer; this.mImballiRESTConsumer = imballiRESTConsumer;
this.magazzinoRESTConsumer = magazzinoRESTConsumer; this.magazzinoRESTConsumer = magazzinoRESTConsumer;
this.executorService = executorService;
this.handler = handler;
} }
@ -2015,12 +2026,14 @@ public class SpedizioneViewModel {
} }
public void resetMatchedRows() { public void resetMatchedRows() {
handler.post(() -> {
for (PickingObjectDTO pickingObjectDTO : this.mPickingList.getValue()) { for (PickingObjectDTO pickingObjectDTO : this.mPickingList.getValue()) {
pickingObjectDTO.setTempPickData(null).setHidden(false); pickingObjectDTO.setTempPickData(null).setHidden(false);
} }
this.mPickingList.postValue(this.mPickingList.getValue()); this.mPickingList.postValue(this.mPickingList.getValue());
this.sendFilterRemoved(); this.sendFilterRemoved();
});
} }
public void closeOrder() { public void closeOrder() {