Fix descrizione riga UL in ContenutoBancaleActivity

This commit is contained in:
2024-01-23 18:19:03 +01:00
parent 0ae1ac87d5
commit 4f4dea9097
6 changed files with 20 additions and 42 deletions

View File

@@ -25,6 +25,7 @@ import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsume
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.databinding.ActivityContenutoBancaleBinding;
import it.integry.integrywmsnative.gest.contenuto_bancale.ui.ContenutoBancaleListAdapter;
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
@@ -124,9 +125,10 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
}
private void initColloInfo() {
mDepositoRESTConsumer.getDepoByCodMdep(mtbColt.get().getCodMdep(), depo -> {
descrizioneDepo.set("(" + depo.getDescrizione() + ")");
}, this::onError);
SettingsManager.iDB().getAvailableCodMdep().stream()
.filter(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.get().getCodMdep()))
.findFirst()
.ifPresent(x -> descrizioneDepo.set("(" + x.getDescrizione() + ")"));
}
private void initFab() {
@@ -138,7 +140,7 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
fabPopupMenu.setForceShowIcon(true);
fabPopupMenu.getMenuInflater().inflate(R.menu.contenuto_bancale_fab_menu, fabPopupMenu.getMenu());
if(mtbColt.get().isDocumentPresent()){
if (mtbColt.get().isDocumentPresent()) {
fabPopupMenu.getMenu().removeItem(R.id.delete_ul);
}

View File

@@ -26,18 +26,16 @@ public class ListaBancaliViewModel {
public void dispatchMtbColt(MtbColt mtbColtToDispatch, boolean onlyResiduo, RunnableArgs<MtbColt> onComplete) {
this.sendOnLoadingStarted();
new Thread(() -> {
mColliMagazzinoRESTConsumer.getByTestata(mtbColtToDispatch, onlyResiduo, false, mtbColt -> {
this.sendOnLoadingEnded();
mColliMagazzinoRESTConsumer.getByTestata(mtbColtToDispatch, onlyResiduo, false, mtbColt -> {
this.sendOnLoadingEnded();
ObservableArrayList<MtbColr> mtbColrObservableArrayList = new ObservableArrayList<>();
if(mtbColt != null && mtbColt.getMtbColr() != null) mtbColrObservableArrayList.addAll(mtbColt.getMtbColr());
mtbColtToDispatch.setMtbColr(mtbColrObservableArrayList);
ObservableArrayList<MtbColr> mtbColrObservableArrayList = new ObservableArrayList<>();
if (mtbColt != null && mtbColt.getMtbColr() != null)
mtbColrObservableArrayList.addAll(mtbColt.getMtbColr());
mtbColtToDispatch.setMtbColr(mtbColrObservableArrayList);
onComplete.run(mtbColtToDispatch);
}, this::sendError);
}).start();
onComplete.run(mtbColtToDispatch);
}, this::sendError);
}