Merge branch 'develop' into master-beta
# Conflicts: # app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneActivity.java # app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneModule.java # app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java
This commit is contained in:
@@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 483
|
||||
def appVersionName = '1.45.01'
|
||||
def appVersionCode = 484
|
||||
def appVersionName = '1.45.02'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
@@ -14,7 +14,6 @@ import android.widget.Toast;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
@@ -26,8 +25,6 @@ import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -107,16 +104,17 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
private final ObservableArrayList<SpedizioneListModel> mSpedizioneMutableData = new ObservableArrayList<>();
|
||||
|
||||
|
||||
public BindableBoolean addExtraItemsEnabled = new BindableBoolean(false);
|
||||
public BindableBoolean noItemsToPick = new BindableBoolean(false);
|
||||
public MutableLiveData<Boolean> noLUPresent = new MutableLiveData<>(true);
|
||||
public BindableBoolean noLUPresent = new BindableBoolean(true);
|
||||
public BindableBoolean bottomSheetEnabled = new BindableBoolean(false);
|
||||
|
||||
private boolean mEnableFakeGiacenza;
|
||||
private boolean mFlagShowCodForn;
|
||||
private boolean mDivideByGrpMerc;
|
||||
private boolean mEnableQuantityReset;
|
||||
private int mBarcodeScannerInstanceID = -1;
|
||||
private int barcodeScannerIstanceID = -1;
|
||||
|
||||
private ArrayList<SitArtOrdDTO> mSitArtOrd;
|
||||
private ArrayList<OrdineUscitaInevasoDTO> mTestateOrdini;
|
||||
@@ -245,38 +243,31 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
|
||||
if (this.mBindings.bottomSheetLuContent.isExpanded()) {
|
||||
this.mBindings.bottomSheetLuContent.collapse();
|
||||
} else if (!noLUPresent.getValue()) {
|
||||
} else if (!noLUPresent.get()) {
|
||||
this.mShouldCloseActivity = true;
|
||||
BarcodeManager.removeCallback(mBarcodeScannerInstanceID);
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
this.mViewmodel.requestCloseLU(true);
|
||||
} catch (Exception e) {
|
||||
onError(e);
|
||||
}
|
||||
});
|
||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||
this.mViewmodel.requestCloseLU(true);
|
||||
} else {
|
||||
BarcodeManager.removeCallback(mBarcodeScannerInstanceID);
|
||||
handler.post(() -> {
|
||||
super.onBackPressed();
|
||||
});
|
||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
private void initVars() {
|
||||
this.noLUPresent.observeForever(newValue -> {
|
||||
this.bottomSheetEnabled.set(!newValue);
|
||||
this.noLUPresent.addOnPropertyChangedCallback(() -> {
|
||||
this.bottomSheetEnabled.set(!this.noLUPresent.get());
|
||||
});
|
||||
}
|
||||
|
||||
private void initBarcodeReader() {
|
||||
mBarcodeScannerInstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
.setOnScanSuccessful(onScanSuccessful)
|
||||
.setOnScanFailed(this::onError));
|
||||
|
||||
BarcodeManager.enable(mBarcodeScannerInstanceID);
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
|
||||
@@ -333,19 +324,13 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
this.mBindings.spedizionePickingList.setLayoutManager(new LinearLayoutManager(this));
|
||||
|
||||
RunnableArgssss<PickingObjectDTO, MtbColt, MtbColr, Boolean> onItemClicked = (clickedItem, refMtbColt, refMtbColr, executeImmediately) -> {
|
||||
executorService.execute(() -> {
|
||||
if (!noLUPresent.getValue() &&
|
||||
((SettingsManager.iDB().isFlagSpedizioneEnableManualPick() &&
|
||||
clickedItem.getSitArtOrdDTO().isFlagEnablePickManuale()) ||
|
||||
clickedItem.getTempPickData() != null)) {
|
||||
try {
|
||||
this.mViewmodel.dispatchOrdineRow(clickedItem, refMtbColt, refMtbColr,
|
||||
SettingsManager.iDB().isFlagSpedizioneEnableManualPick() && clickedItem.getSitArtOrdDTO().isFlagEnablePickManuale(), executeImmediately);
|
||||
} catch (Exception e) {
|
||||
onError(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
if (!noLUPresent.get() &&
|
||||
((SettingsManager.iDB().isFlagSpedizioneEnableManualPick() &&
|
||||
clickedItem.getSitArtOrdDTO().isFlagEnablePickManuale()) ||
|
||||
clickedItem.getTempPickData() != null)) {
|
||||
this.mViewmodel.dispatchOrdineRow(clickedItem, refMtbColt, refMtbColr,
|
||||
SettingsManager.iDB().isFlagSpedizioneEnableManualPick() && clickedItem.getSitArtOrdDTO().isFlagEnablePickManuale(), executeImmediately);
|
||||
}
|
||||
};
|
||||
|
||||
spedizioneListAdapter.setOnItemClicked(onItemClicked);
|
||||
@@ -728,15 +713,9 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
this.onLoadingStarted();
|
||||
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
this.mViewmodel.processBarcodeDTO(data);
|
||||
} catch (Exception e) {
|
||||
onError(e);
|
||||
}
|
||||
this.mViewmodel.processBarcodeDTO(data, () -> {
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
|
||||
this.onLoadingEnded();
|
||||
};
|
||||
|
||||
public void addExtraItem() {
|
||||
@@ -744,27 +723,11 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
DialogScanArtView
|
||||
.newInstance(!mEnableFakeGiacenza, (status, mtbAart, ean128Model, mtbColr) -> {
|
||||
if (status == DialogConsts.Results.YES) {
|
||||
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
this.mViewmodel.dispatchExtraItem(mtbAart, ean128Model, mtbColr);
|
||||
} catch (Exception e) {
|
||||
onError(e);
|
||||
}
|
||||
});
|
||||
|
||||
this.mViewmodel.dispatchExtraItem(mtbAart, ean128Model, mtbColr);
|
||||
}
|
||||
}, pickMagazzinoAutomaticoPosizione -> {
|
||||
this.onLoadingStarted();
|
||||
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
this.mViewmodel.executeEmptyMagazzinoAutomaticoRequest(pickMagazzinoAutomaticoPosizione);
|
||||
} catch (Exception e) {
|
||||
onError(e);
|
||||
}
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
this.mViewmodel.executeEmptyMagazzinoAutomaticoRequest(pickMagazzinoAutomaticoPosizione, this::onLoadingEnded);
|
||||
})
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
@@ -772,13 +735,13 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
public void startManualSearch() {
|
||||
handler.post(() -> {
|
||||
BarcodeManager.disable(mBarcodeScannerInstanceID);
|
||||
BarcodeManager.disable();
|
||||
DialogSimpleInputHelper.makeInputDialog(this, "Inserisci il codice a barre", codice -> {
|
||||
|
||||
this.onScanSuccessful.run(new BarcodeScanDTO().setStringValue(codice).setType(BarcodeType.CODE128));
|
||||
BarcodeManager.enable(mBarcodeScannerInstanceID);
|
||||
BarcodeManager.enable();
|
||||
|
||||
}, () -> BarcodeManager.enable(mBarcodeScannerInstanceID)).show();
|
||||
}, BarcodeManager::enable).show();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -794,13 +757,8 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
this.onLoadingStarted();
|
||||
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
this.mViewmodel.createNewLU(null, null);
|
||||
this.onLoadingEnded();
|
||||
} catch (Exception e) {
|
||||
onError(e);
|
||||
}
|
||||
this.mViewmodel.createNewLU(null, null, () -> {
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -835,23 +793,15 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
public void closeOrder() {
|
||||
this.fabPopupMenu.dismiss();
|
||||
this.onLoadingStarted();
|
||||
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
this.mViewmodel.closeOrder();
|
||||
this.onLoadingEnded();
|
||||
} catch (Exception e) {
|
||||
onError(e);
|
||||
}
|
||||
});
|
||||
this.mViewmodel.closeOrder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLUOpened(MtbColt mtbColt) {
|
||||
handler.post(() -> {
|
||||
this.addExtraItemsEnabled.set(SettingsManager.iDB().isFlagCanAddExtraItemSpedizione());
|
||||
noLUPresent.postValue(false);
|
||||
noLUPresent.set(false);
|
||||
|
||||
Snackbar.make(mBindings.getRoot(), R.string.data_saved, Snackbar.LENGTH_SHORT)
|
||||
.setBackgroundTint(getResources().getColor(R.color.green_500))
|
||||
@@ -865,7 +815,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
public void onLUClosed() {
|
||||
handler.post(() -> {
|
||||
this.addExtraItemsEnabled.set(false);
|
||||
noLUPresent.postValue(true);
|
||||
noLUPresent.set(true);
|
||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
|
||||
|
||||
if (this.mShouldCloseActivity) super.onBackPressed();
|
||||
@@ -875,7 +825,9 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
@Override
|
||||
public void onLUPesoRequired(String codTcol, BigDecimal netWeightKG, BigDecimal grossWeightKG, RunnableArgsss<String, BigDecimal, BigDecimal> onComplete) {
|
||||
handler.post(() -> {
|
||||
DialogInputPesoLUView.newInstance(codTcol, netWeightKG, grossWeightKG, onComplete)
|
||||
DialogInputPesoLUView.newInstance(null, new BigDecimal(50), new BigDecimal(55), (newCodTcol, newNetWeight, newGrossWeight) -> {
|
||||
onComplete.run(newCodTcol, netWeightKG, grossWeightKG);
|
||||
})
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
@@ -946,9 +898,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex, boolean useSnackbar) {
|
||||
|
||||
handler.post(() -> {
|
||||
|
||||
this.onLoadingEnded();
|
||||
|
||||
if (ex instanceof InvalidPesoKGException) {
|
||||
@@ -960,8 +910,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
UtilityExceptions.defaultException(this, ex);
|
||||
}
|
||||
|
||||
BarcodeManager.enable(mBarcodeScannerInstanceID);
|
||||
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -984,8 +933,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
LocalDate dataScad,
|
||||
boolean canOverflowOrderQuantity,
|
||||
boolean canPartitaMagBeChanged,
|
||||
RunnableArgs<PickedQuantityDTO> onComplete,
|
||||
Runnable onAbort) {
|
||||
RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
|
||||
|
||||
if (dataScad == null && pickingObjectDTO.getMtbAart().getGgScadPartita() != null && pickingObjectDTO.getMtbAart().getGgScadPartita() > 0) {
|
||||
dataScad = UtilityDate.getNow();
|
||||
@@ -1014,29 +962,25 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||
.setStatoPartitaMag(pickingObjectDTO != null ? pickingObjectDTO.getStatoArticoloDTO() : null)
|
||||
.setNotifyProductLotStatus(SettingsManager.iDB().isNotifyLotStatus())
|
||||
.setMtbPartitaMagList(mViewmodel.getmPartitaMagList())
|
||||
.setEnableSSCCRead(SettingsManager.iDB().isFlagSpedizioneEnableFastPicking());
|
||||
.setMtbPartitaMagList(mViewmodel.getmPartitaMagList());
|
||||
|
||||
if (!mDialogInputQuantityV2View.isVisible())
|
||||
mDialogInputQuantityV2View
|
||||
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||
.setOnComplete(resultDTO -> {
|
||||
if (resultDTO == null || resultDTO.isAborted()) {
|
||||
onAbort.run();
|
||||
return;
|
||||
}
|
||||
|
||||
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||
.setNumCnf(resultDTO.getNumCnf())
|
||||
.setQtaCnf(resultDTO.getQtaCnf())
|
||||
.setQtaTot(resultDTO.getQtaTot())
|
||||
.setPartitaMag(resultDTO.getPartitaMag())
|
||||
.setDataScad(resultDTO.getDataScad())
|
||||
.setShouldCloseLu(resultDTO.isShouldCloseLu())
|
||||
.setNextUlBarcode(resultDTO.getNextUlBarcode());
|
||||
onComplete.run(pickedQuantityDTO);
|
||||
.setDataScad(resultDTO.getDataScad());
|
||||
|
||||
this.onLoadingStarted();
|
||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||
})
|
||||
.setOnAbort(() -> {
|
||||
this.mViewmodel.resetMatchedRows();
|
||||
})
|
||||
.setOnAbort(onAbort)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
else Toast.makeText(this, "Dialog già a video", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
@@ -1062,113 +1006,66 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
}).show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
public boolean askShouldPrintPackingList() {
|
||||
AtomicReference<Boolean> resultPrintPackingList = new AtomicReference<>();
|
||||
CountDownLatch countDownLatch = new CountDownLatch(1);
|
||||
|
||||
handler.post(() -> {
|
||||
DialogSimpleMessageView.makeInfoDialog(
|
||||
getResources().getString(R.string.action_close_order),
|
||||
new SpannableString(getResources().getString(R.string.message_print_packing_list_on_close_order)),
|
||||
null,
|
||||
() -> {
|
||||
resultPrintPackingList.set(true);
|
||||
countDownLatch.countDown();
|
||||
},
|
||||
() -> {
|
||||
resultPrintPackingList.set(false);
|
||||
countDownLatch.countDown();
|
||||
public void askShouldPrintPackingList(PrintOrderCloseDTO printOrderCloseDTO, RunnableArgs<PrintOrderCloseDTO> onComplete) {
|
||||
DialogSimpleMessageView.makeInfoDialog(
|
||||
getResources().getString(R.string.action_close_order),
|
||||
new SpannableString(getResources().getString(R.string.message_print_packing_list_on_close_order)),
|
||||
null,
|
||||
() -> {
|
||||
printOrderCloseDTO.setFlagPrintPackingList(true);
|
||||
if (SettingsManager.iDB().isFlagPrintEtichetteOnOrderClose()) {
|
||||
this.askShouldPrintSSCC(printOrderCloseDTO, onComplete);
|
||||
} else {
|
||||
onComplete.run(printOrderCloseDTO);
|
||||
}
|
||||
)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
|
||||
|
||||
try {
|
||||
countDownLatch.await();
|
||||
} catch (InterruptedException e) {
|
||||
this.onError(e);
|
||||
}
|
||||
|
||||
return resultPrintPackingList.get();
|
||||
//
|
||||
// boolean printPackingList = resultPrintPackingList.get();
|
||||
// printOrderCloseDTO.setFlagPrintPackingList(printPackingList);
|
||||
//
|
||||
// if (SettingsManager.iDB().isFlagPrintEtichetteOnOrderClose()) {
|
||||
// var shouldPrintSSCCResult = this.askShouldPrintSSCC(printOrderCloseDTO);
|
||||
//
|
||||
// printOrderCloseDTO.setFlagPrintSSCC(shouldPrintSSCCResult.isFlagPrintSSCC());
|
||||
// printOrderCloseDTO.setFlagSkipPrintedSSCC(shouldPrintSSCCResult.isFlagSkipPrintedSSCC());
|
||||
// }
|
||||
//
|
||||
// return printOrderCloseDTO;
|
||||
},
|
||||
() -> {
|
||||
printOrderCloseDTO.setFlagPrintPackingList(false);
|
||||
if (SettingsManager.iDB().isFlagPrintEtichetteOnOrderClose()) {
|
||||
this.askShouldPrintSSCC(printOrderCloseDTO, onComplete);
|
||||
} else {
|
||||
onComplete.run(printOrderCloseDTO);
|
||||
}
|
||||
}
|
||||
)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
public DialogPrintOrderSSCCListView.Result askShouldPrintSSCC(PrintOrderCloseDTO printOrderCloseDTO) {
|
||||
AtomicReference<DialogPrintOrderSSCCListView.Result> result = new AtomicReference<>();
|
||||
CountDownLatch countDownLatch = new CountDownLatch(1);
|
||||
|
||||
handler.post(() -> {
|
||||
DialogPrintOrderSSCCListView.newInstance(printOrderCloseDTO, data -> {
|
||||
result.set(data);
|
||||
countDownLatch.countDown();
|
||||
})
|
||||
.show(this.getSupportFragmentManager(), "dialogPrintOrderSSCCListView");
|
||||
});
|
||||
|
||||
try {
|
||||
countDownLatch.await();
|
||||
} catch (InterruptedException e) {
|
||||
this.onError(e);
|
||||
}
|
||||
|
||||
return result.get();
|
||||
public void askShouldPrintSSCC(PrintOrderCloseDTO printOrderCloseDTO, RunnableArgs<PrintOrderCloseDTO> onComplete) {
|
||||
DialogPrintOrderSSCCListView.newInstance(printOrderCloseDTO, onComplete).show(this.getSupportFragmentManager(), "dialogPrintOrderSSCCListView");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBatchLotSelectionRequest(List<MtbPartitaMag> availableBatchLots, RunnableArgs<MtbPartitaMag> onComplete) {
|
||||
handler.post(() -> {
|
||||
DialogChooseBatchLotView.newInstance(availableBatchLots, onComplete)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
DialogChooseBatchLotView.newInstance(availableBatchLots, onComplete)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrintOrderCloseDTO onCloseOrderPrintRequest() {
|
||||
public void onCloseOrderPrintRequest(RunnableArgs<PrintOrderCloseDTO> onComplete) {
|
||||
PrintOrderCloseDTO printOrderCloseDTO = new PrintOrderCloseDTO();
|
||||
|
||||
if (SettingsManager.iDB().isFlagPrintPackingListOnOrderClose()) {
|
||||
var result = this.askShouldPrintPackingList();
|
||||
printOrderCloseDTO.setFlagPrintPackingList(result);
|
||||
this.askShouldPrintPackingList(printOrderCloseDTO, onComplete);
|
||||
} else if (SettingsManager.iDB().isFlagPrintEtichetteOnOrderClose()) {
|
||||
this.askShouldPrintSSCC(printOrderCloseDTO, onComplete);
|
||||
}
|
||||
|
||||
if (SettingsManager.iDB().isFlagPrintEtichetteOnOrderClose()) {
|
||||
var shouldPrintSSCC = this.askShouldPrintSSCC(printOrderCloseDTO);
|
||||
|
||||
printOrderCloseDTO.setFlagPrintSSCC(shouldPrintSSCC.isFlagPrintSSCC());
|
||||
printOrderCloseDTO.setFlagSkipPrintedSSCC(shouldPrintSSCC.isFlagSkipPrintedSSCC());
|
||||
}
|
||||
|
||||
return printOrderCloseDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateDocsRequest() {
|
||||
handler.post(() -> {
|
||||
DialogYesNoView.newInstance("Chiusura ordine", "Vuoi creare i documenti per gli ordini selezionati?", result -> {
|
||||
DialogYesNoView.newInstance("Chiusura ordine", "Vuoi creare i documenti per gli ordini selezionati?", result -> {
|
||||
|
||||
switch (result) {
|
||||
case YES:
|
||||
this.mViewmodel.createDocs();
|
||||
break;
|
||||
case NO:
|
||||
this.onOrderClosed();
|
||||
break;
|
||||
}
|
||||
switch (result) {
|
||||
case YES:
|
||||
this.mViewmodel.createDocs();
|
||||
break;
|
||||
case NO:
|
||||
this.onOrderClosed();
|
||||
break;
|
||||
}
|
||||
|
||||
}).show(this.getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}).show(this.getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1178,8 +1075,8 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChooseArtsRequest(List<MtbAart> artsList, RunnableArgs<List<MtbAart>> onComplete, Runnable onAbort) {
|
||||
DialogChooseArtsFromMtbAartListView.newInstance(artsList, onComplete, onAbort)
|
||||
public void onChooseArtsRequest(List<MtbAart> artsList, RunnableArgs<List<MtbAart>> onComplete) {
|
||||
DialogChooseArtsFromMtbAartListView.newInstance(artsList, onComplete, this::onLoadingEnded)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@@ -1208,37 +1105,17 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
@Override
|
||||
public void onBottomSheetLUClose() {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
this.mViewmodel.requestCloseLU(true);
|
||||
} catch (Exception e) {
|
||||
onError(e);
|
||||
}
|
||||
});
|
||||
this.mViewmodel.requestCloseLU(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMtbColrEdit(MtbColr mtbColr) {
|
||||
executorService.execute(() -> {
|
||||
this.onLoadingStarted();
|
||||
try {
|
||||
this.mViewmodel.dispatchRowEdit(mtbColr);
|
||||
} catch (Exception e) {
|
||||
onError(e);
|
||||
}
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
this.mViewmodel.dispatchRowEdit(mtbColr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMtbColrDelete(MtbColr mtbColr) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
this.mViewmodel.requestDeleteRow(mtbColr);
|
||||
} catch (Exception e) {
|
||||
onError(e);
|
||||
}
|
||||
});
|
||||
this.mViewmodel.requestDeleteRow(mtbColr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package it.integry.integrywmsnative.gest.spedizione;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import dagger.Module;
|
||||
@@ -41,7 +43,8 @@ public class SpedizioneModule {
|
||||
MagazzinoAutomaticoRESTConsumer magazzinoAutomaticoRESTConsumer,
|
||||
ImballiRESTConsumer imballiRESTConsumer,
|
||||
MagazzinoRESTConsumer magazzinoRESTConsumer,
|
||||
ExecutorService executorService) {
|
||||
ExecutorService executorService,
|
||||
Handler handler) {
|
||||
return new SpedizioneViewModel(articoloRESTConsumer,
|
||||
barcodeRESTConsumer,
|
||||
colliDataRecoverService,
|
||||
@@ -55,7 +58,8 @@ public class SpedizioneModule {
|
||||
magazzinoAutomaticoRESTConsumer,
|
||||
imballiRESTConsumer,
|
||||
magazzinoRESTConsumer,
|
||||
executorService);
|
||||
executorService,
|
||||
handler);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user