Merge branch 'feature/RefactoringGestioneColli' into master-beta
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -2,37 +2,108 @@ package it.integry.integrywmsnative.core.expansion.view;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.databinding.ObservableList;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.zhukic.sectionedrecyclerview.SectionedRecyclerViewAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class ExtendedSectionedRecyclerView<T, SH extends RecyclerView.ViewHolder, VH extends RecyclerView.ViewHolder>
|
||||
extends SectionedRecyclerViewAdapter<SH, VH> {
|
||||
|
||||
protected ArrayList<T> mDataset = new ArrayList<>();
|
||||
private View mEmptyView;
|
||||
|
||||
public ExtendedSectionedRecyclerView(ObservableArrayList<T> myDataset) {
|
||||
mDataset.addAll(myDataset);
|
||||
protected final List<T> originalItems = new ArrayList<>();
|
||||
private final Object originalItemsLock = new Object();
|
||||
|
||||
myDataset.addOnListChangedCallback(new OnListGeneralChangedCallback<T>() {
|
||||
@Override
|
||||
public void onChanged(ObservableList<T> sender) {
|
||||
mDataset.clear();
|
||||
mDataset.addAll(sender);
|
||||
public ExtendedSectionedRecyclerView(ObservableArrayList<T> observableList) {
|
||||
// originalItems.addAll(observableList);
|
||||
//
|
||||
// observableList.addOnListChangedCallback(new OnListGeneralChangedCallback<T>() {
|
||||
// @Override
|
||||
// public void onChanged(ObservableList<T> sender) {
|
||||
// originalItems.clear();
|
||||
// originalItems.addAll(sender);
|
||||
// notifyDataChanged();
|
||||
// notifyDataSetChanged();
|
||||
// checkIfEmpty();
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// checkIfEmpty();
|
||||
|
||||
synchronized (originalItemsLock) {
|
||||
this.originalItems.addAll(observableList); // Salva lo stato corrente per il filtraggio
|
||||
}
|
||||
|
||||
observableList.addOnListChangedCallback(new ObservableList.OnListChangedCallback<ObservableList<T>>() {
|
||||
private void updateLists() {
|
||||
// Si assume che observableList sia modificata sul thread UI o che la sincronizzazione sia gestita esternamente.
|
||||
List<T> currentData = new ArrayList<>(observableList); // Crea uno snapshot
|
||||
synchronized (originalItemsLock) {
|
||||
originalItems.clear();
|
||||
originalItems.addAll(currentData); // Aggiorna la lista originale per il filtraggio
|
||||
}
|
||||
// Aggiorna la lista visualizzata dall'adapter
|
||||
// clear();
|
||||
// addAll(currentData); // Usa lo snapshot
|
||||
// notifyDataSetChanged(); // ArrayAdapter.addAll non chiama notifyDataSetChanged, quindi è necessario se non chiamato da clear()
|
||||
// Tuttavia, clear() e addAll() di ArrayAdapter gestiscono la notifica se mNotifyOnChange è true (default).
|
||||
// Per sicurezza e coerenza con il codice originale, lo manteniamo.
|
||||
notifyDataChanged();
|
||||
notifyDataSetChanged();
|
||||
checkIfEmpty();
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void onChanged(ObservableList<T> sender) {
|
||||
updateLists();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeChanged(ObservableList<T> sender, int positionStart, int itemCount) {
|
||||
updateLists();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeInserted(ObservableList<T> sender, int positionStart, int itemCount) {
|
||||
updateLists();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeMoved(ObservableList<T> sender, int fromPosition, int toPosition, int itemCount) {
|
||||
updateLists();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeRemoved(ObservableList<T> sender, int positionStart, int itemCount) {
|
||||
updateLists();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public ExtendedSectionedRecyclerView(@NonNull LiveData<List<T>> liveData,
|
||||
@NonNull LifecycleOwner lifecycleOwner) {
|
||||
liveData.observe(lifecycleOwner, newList -> {
|
||||
// L'observer di LiveData viene eseguito sul thread UI
|
||||
List<T> dataToUse = (newList == null) ? new ArrayList<>() : new ArrayList<>(newList);
|
||||
synchronized (originalItemsLock) {
|
||||
originalItems.clear();
|
||||
originalItems.addAll(dataToUse); // Aggiorna la lista originale per il filtraggio
|
||||
}
|
||||
// Aggiorna la lista visualizzata dall'adapter
|
||||
// clear();
|
||||
// addAll(dataToUse); // addAll gestisce correttamente una collezione vuota se newList è null
|
||||
notifyDataChanged();
|
||||
notifyDataSetChanged();
|
||||
checkIfEmpty();
|
||||
});
|
||||
}
|
||||
|
||||
public ExtendedSectionedRecyclerView<T, SH, VH> setEmptyView(View emptyView) {
|
||||
@@ -43,7 +114,7 @@ public abstract class ExtendedSectionedRecyclerView<T, SH extends RecyclerView.V
|
||||
|
||||
@Override
|
||||
public int getItemSize() {
|
||||
return this.mDataset.size();
|
||||
return this.originalItems.size();
|
||||
}
|
||||
|
||||
private void checkIfEmpty() {
|
||||
|
||||
@@ -151,6 +151,7 @@ public class RecuperaMaterialiRequestDTO {
|
||||
private BigDecimal qtaCol;
|
||||
private BigDecimal numCnf;
|
||||
private Integer percentageHr;
|
||||
private String codJcom;
|
||||
|
||||
public Integer getNumero() {
|
||||
return numero;
|
||||
@@ -214,5 +215,14 @@ public class RecuperaMaterialiRequestDTO {
|
||||
this.percentageHr = percentageHr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJcom() {
|
||||
return codJcom;
|
||||
}
|
||||
|
||||
public Ordine setCodJcom(String codJcom) {
|
||||
this.codJcom = codJcom;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class MainAccettazioneBolleElencoAdapter extends ExtendedSectionedRecycle
|
||||
|
||||
@Override
|
||||
public void onBindSubheaderViewHolder(MainAccettazioneBolleElencoAdapter.SubheaderHolder subheaderHolder, int nextItemPosition) {
|
||||
MainAccettazioneBolleElencoListModel pickingObjectDTO = this.mDataset.get(nextItemPosition);
|
||||
MainAccettazioneBolleElencoListModel pickingObjectDTO = this.originalItems.get(nextItemPosition);
|
||||
|
||||
subheaderHolder.mBinding.groupTitle.setVisibility(UtilityString.isNullOrEmpty(pickingObjectDTO.getGroupTitle()) ? View.GONE : View.VISIBLE);
|
||||
subheaderHolder.mBinding.groupTitle.setText(Html.fromHtml(pickingObjectDTO.getGroupTitle()));
|
||||
@@ -87,7 +87,7 @@ public class MainAccettazioneBolleElencoAdapter extends ExtendedSectionedRecycle
|
||||
|
||||
@Override
|
||||
public void onBindItemViewHolder(final MainAccettazioneBolleElencoAdapter.SingleItemViewHolder holder, final int position) {
|
||||
MainAccettazioneBolleElencoListModel listModel = this.mDataset.get(position);
|
||||
MainAccettazioneBolleElencoListModel listModel = this.originalItems.get(position);
|
||||
|
||||
listModel.getSelectedObservable().resetOnPropertyChangedCallback();
|
||||
|
||||
@@ -132,8 +132,8 @@ public class MainAccettazioneBolleElencoAdapter extends ExtendedSectionedRecycle
|
||||
|
||||
if (getItemSize() == 1) return true;
|
||||
else if (getItemSize() > 1) {
|
||||
MainAccettazioneBolleElencoListModel compare1 = this.mDataset.get(position);
|
||||
MainAccettazioneBolleElencoListModel compare2 = this.mDataset.get(position + 1);
|
||||
MainAccettazioneBolleElencoListModel compare1 = this.originalItems.get(position);
|
||||
MainAccettazioneBolleElencoListModel compare2 = this.originalItems.get(position + 1);
|
||||
|
||||
return !UtilityString.equalsIgnoreCase(compare1.getGroupTitle(), compare2.getGroupTitle());
|
||||
}
|
||||
|
||||
@@ -78,19 +78,19 @@ public class MainListAccettazioneOrdiniElencoAdapter extends ExtendedSectionedRe
|
||||
|
||||
@Override
|
||||
public void onBindSubheaderViewHolder(SubheaderHolder subheaderHolder, int nextItemPosition) {
|
||||
subheaderHolder.binding.accettazioneMainListGroupHeader.setText(mDataset.get(nextItemPosition).getGroupTitle());
|
||||
subheaderHolder.binding.accettazioneMainListGroupHeader.setText(originalItems.get(nextItemPosition).getGroupTitle());
|
||||
|
||||
subheaderHolder.binding.getRoot().setOnClickListener(new OnSingleClickListener() {
|
||||
@Override
|
||||
public void onSingleClick(View v) {
|
||||
if(mOnGroupItemClicked != null) mOnGroupItemClicked.run(mDataset.get(nextItemPosition).getGroupTitle());
|
||||
if(mOnGroupItemClicked != null) mOnGroupItemClicked.run(originalItems.get(nextItemPosition).getGroupTitle());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindItemViewHolder(SingleItemViewHolder holder, int itemPosition) {
|
||||
final MainListAccettazioneOrdiniElencoListModel ordine = mDataset.get(itemPosition);
|
||||
final MainListAccettazioneOrdiniElencoListModel ordine = originalItems.get(itemPosition);
|
||||
|
||||
ordine.getSelectedObservable().resetOnPropertyChangedCallback();
|
||||
|
||||
@@ -130,8 +130,8 @@ public class MainListAccettazioneOrdiniElencoAdapter extends ExtendedSectionedRe
|
||||
public boolean onPlaceSubheaderBetweenItems(int position) {
|
||||
if (getItemSize() == 1) return true;
|
||||
else if (getItemSize() > 1) {
|
||||
MainListAccettazioneOrdiniElencoListModel compare1 = this.mDataset.get(position);
|
||||
MainListAccettazioneOrdiniElencoListModel compare2 = this.mDataset.get(position + 1);
|
||||
MainListAccettazioneOrdiniElencoListModel compare1 = this.originalItems.get(position);
|
||||
MainListAccettazioneOrdiniElencoListModel compare2 = this.originalItems.get(position + 1);
|
||||
|
||||
if (UtilityString.equalsIgnoreCase(compare1.getGroupTitle(), compare2.getGroupTitle())) {
|
||||
return false;
|
||||
@@ -143,7 +143,7 @@ public class MainListAccettazioneOrdiniElencoAdapter extends ExtendedSectionedRe
|
||||
|
||||
@Override
|
||||
public int getItemSize() {
|
||||
return mDataset.size();
|
||||
return originalItems.size();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -82,19 +82,19 @@ public class OrdineProduzioneListAdapter extends ExtendedSectionedRecyclerView<M
|
||||
|
||||
@Override
|
||||
public void onBindSubheaderViewHolder(OrdineProduzioneListAdapter.SubheaderHolder subheaderHolder, int nextItemPosition) {
|
||||
subheaderHolder.binding.ordineProduzioneMainListGroupHeader.setText(mDataset.get(nextItemPosition).getGroupTitle());
|
||||
subheaderHolder.binding.ordineProduzioneMainListGroupHeader.setText(originalItems.get(nextItemPosition).getGroupTitle());
|
||||
|
||||
subheaderHolder.binding.getRoot().setOnClickListener(new OnSingleClickListener() {
|
||||
@Override
|
||||
public void onSingleClick(View v) {
|
||||
if(mOnGroupItemClicked != null) mOnGroupItemClicked.run(mDataset.get(nextItemPosition).getGroupTitle());
|
||||
if(mOnGroupItemClicked != null) mOnGroupItemClicked.run(originalItems.get(nextItemPosition).getGroupTitle());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindItemViewHolder(OrdineProduzioneListAdapter.SingleItemViewHolder holder, int itemPosition) {
|
||||
final MainListProdOrdineProduzioneElencoListModel ordine = mDataset.get(itemPosition);
|
||||
final MainListProdOrdineProduzioneElencoListModel ordine = originalItems.get(itemPosition);
|
||||
|
||||
ordine.getSelectedObservable().resetOnPropertyChangedCallback();
|
||||
|
||||
@@ -134,8 +134,8 @@ public class OrdineProduzioneListAdapter extends ExtendedSectionedRecyclerView<M
|
||||
public boolean onPlaceSubheaderBetweenItems(int position) {
|
||||
if (getItemSize() == 1) return true;
|
||||
else if (getItemSize() > 1) {
|
||||
MainListProdOrdineProduzioneElencoListModel compare1 = this.mDataset.get(position);
|
||||
MainListProdOrdineProduzioneElencoListModel compare2 = this.mDataset.get(position + 1);
|
||||
MainListProdOrdineProduzioneElencoListModel compare1 = this.originalItems.get(position);
|
||||
MainListProdOrdineProduzioneElencoListModel compare2 = this.originalItems.get(position + 1);
|
||||
|
||||
if (UtilityString.equalsIgnoreCase(compare1.getGroupTitle(), compare2.getGroupTitle())) {
|
||||
return false;
|
||||
@@ -147,7 +147,7 @@ public class OrdineProduzioneListAdapter extends ExtendedSectionedRecyclerView<M
|
||||
|
||||
@Override
|
||||
public int getItemSize() {
|
||||
return mDataset.size();
|
||||
return originalItems.size();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,13 +9,13 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
import com.ravikoradiya.liveadapter.Type;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
@@ -34,15 +34,15 @@ import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.FragmentProdRecuperoMaterialeBinding;
|
||||
import it.integry.integrywmsnative.databinding.ProdRecuperoMaterialeListItemBinding;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ui.HistoryULsListAdapter;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ui.HistoryULsListModel;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUView;
|
||||
import kotlin.Unit;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
@@ -61,8 +61,6 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
private String codJfas;
|
||||
private String fragmentResultKeyString;
|
||||
|
||||
private final ObservableArrayList<HistoryULsListModel> mHistoryULMutableData = new ObservableArrayList<>();
|
||||
|
||||
public ProdRecuperoMaterialeFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
@@ -166,64 +164,48 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
}
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
this.onLoadingStarted();
|
||||
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
this.mViewModel.processBarcodeDTO(data);
|
||||
} catch (Exception ex) {
|
||||
this.onError(ex);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
private void initRecyclerView() {
|
||||
this.mViewModel.getOrderList().observe(getViewLifecycleOwner(), this::refreshList);
|
||||
var itemType = new Type<HistoryVersamentoProdULDTO, ProdRecuperoMaterialeListItemBinding>(R.layout.prod_recupero_materiale_list_item, it.integry.integrywmsnative.BR.item);
|
||||
itemType.onClick(holder -> {
|
||||
this.mViewModel.dispatchItem(holder.getBinding().getItem(), null);
|
||||
return null;
|
||||
});
|
||||
itemType.areItemSame((item1, item2) ->
|
||||
Objects.equals(item1.getNumCollo(), item2.getNumCollo()) &&
|
||||
Objects.equals(item1.getDataCollo(), item2.getDataCollo()) &&
|
||||
Objects.equals(item1.getSerCollo(), item2.getSerCollo()) &&
|
||||
Objects.equals(item1.getGestione(), item2.getGestione()) &&
|
||||
Objects.equals(item1.getCodMart(), item2.getCodMart()) &&
|
||||
Objects.equals(item1.getPartitaMag(), item2.getPartitaMag()) &&
|
||||
Objects.equals(item1.getCodCol(), item2.getCodCol()) &&
|
||||
Objects.equals(item1.getCodTagl(), item2.getCodTagl()) &&
|
||||
Objects.equals(item1.getCodJcom(), item2.getCodJcom()) &&
|
||||
Objects.equals(item1.getCodJfas(), item2.getCodJfas())
|
||||
);
|
||||
itemType.areContentsTheSame(HistoryVersamentoProdULDTO::equals);
|
||||
|
||||
HistoryULsListAdapter adapter = new HistoryULsListAdapter(getActivity(), mHistoryULMutableData)
|
||||
.setOnItemClicked(data -> this.mViewModel.dispatchItem(data.getOriginalModel(), null));
|
||||
|
||||
adapter.setEmptyView(mBinding.emptyView);
|
||||
|
||||
mBinding.prodRecuperoMaterialeMainList.setAdapter(adapter);
|
||||
new LiveAdapter(this.mViewModel.getOrderList(), this)
|
||||
.map(HistoryVersamentoProdULDTO.class, itemType)
|
||||
.onNoData(x -> {
|
||||
mBinding.emptyView.setVisibility(x ? View.VISIBLE : View.GONE);
|
||||
return Unit.INSTANCE;
|
||||
})
|
||||
.into(mBinding.prodRecuperoMaterialeMainList);
|
||||
|
||||
if (mToolbar != null)
|
||||
mToolbar.setRecyclerView(mBinding.prodRecuperoMaterialeMainList);
|
||||
|
||||
}
|
||||
|
||||
private void refreshList(List<HistoryVersamentoProdULDTO> filteredList) {
|
||||
|
||||
List<HistoryVersamentoProdULDTO> tmpList = null;
|
||||
|
||||
if (filteredList != null) {
|
||||
tmpList = filteredList;
|
||||
} else {
|
||||
tmpList = mViewModel.getOrderList().getValue();
|
||||
}
|
||||
|
||||
this.mHistoryULMutableData.clear();
|
||||
this.mHistoryULMutableData.addAll(convertDataModelToListModel(tmpList));
|
||||
}
|
||||
|
||||
private List<HistoryULsListModel> convertDataModelToListModel(List<HistoryVersamentoProdULDTO> dataList) {
|
||||
|
||||
return Stream.of(dataList)
|
||||
.sortBy(HistoryVersamentoProdULDTO::getCodJfas)
|
||||
.map(x -> {
|
||||
HistoryULsListModel listModel = new HistoryULsListModel();
|
||||
|
||||
listModel
|
||||
.setOriginalModel(x)
|
||||
.setGroupTitle(UtilityString.isNullOrEmpty(x.getDescrizioneFase()) ? x.getCodJfas() : x.getDescrizioneFase())
|
||||
|
||||
.setCodMart(x.getCodMart())
|
||||
.setDescrizione(x.getDescrizioneArt())
|
||||
.setPartitaMag(x.getPartitaMag())
|
||||
.setCodJcom(x.getCodJcom())
|
||||
.setQtaVersata(x.getQtaCol())
|
||||
.setUntMisVersata(x.getUntMis());
|
||||
|
||||
|
||||
return listModel;
|
||||
})
|
||||
.toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemDispatched(HistoryVersamentoProdULDTO item,
|
||||
MtbColt sourceMtbColt,
|
||||
@@ -255,7 +237,7 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
mDialogInputQuantityV2View
|
||||
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||
.setOnComplete(resultDTO -> {
|
||||
if(resultDTO == null || resultDTO.isAborted()) {
|
||||
if (resultDTO == null || resultDTO.isAborted()) {
|
||||
this.onLoadingEnded();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MaterialiRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.rest.ProdRecuperoMaterialeRESTConsumer;
|
||||
|
||||
@Module(subcomponents = ProdRecuperoMaterialeComponent.class)
|
||||
@@ -21,10 +20,9 @@ public class ProdRecuperoMaterialeModule {
|
||||
@Provides
|
||||
ProdRecuperoMaterialeViewModel providesProdRecuperoMaterialeViewModel(ProdRecuperoMaterialeRESTConsumer prodRecuperoMaterialeRESTConsumer,
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||
PrinterRESTConsumer printerRESTConsumer,
|
||||
MaterialiRESTConsumer materialiRESTConsumer,
|
||||
ExecutorService executorService) {
|
||||
return new ProdRecuperoMaterialeViewModel(prodRecuperoMaterialeRESTConsumer, colliMagazzinoRESTConsumer, printerRESTConsumer, materialiRESTConsumer, executorService);
|
||||
return new ProdRecuperoMaterialeViewModel(prodRecuperoMaterialeRESTConsumer, colliMagazzinoRESTConsumer, materialiRESTConsumer, executorService);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package it.integry.integrywmsnative.gest.prod_recupero_materiale;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
@@ -13,14 +13,12 @@ import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.key.MtbColtKey;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MaterialiRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.materiali.RecuperaMaterialiRequestDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||
@@ -33,7 +31,6 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
|
||||
private final ProdRecuperoMaterialeRESTConsumer mProdRecuperoMaterialeRESTConsumer;
|
||||
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||
private final PrinterRESTConsumer mPrinterRESTConsumer;
|
||||
private final MaterialiRESTConsumer mMaterialiRESTConsumer;
|
||||
private final ExecutorService mExecutorService;
|
||||
|
||||
@@ -47,12 +44,10 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
@Inject
|
||||
public ProdRecuperoMaterialeViewModel(ProdRecuperoMaterialeRESTConsumer prodRecuperoMaterialeRESTConsumer,
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||
PrinterRESTConsumer printerRESTConsumer,
|
||||
MaterialiRESTConsumer materialiRESTConsumer,
|
||||
ExecutorService executorService) {
|
||||
this.mProdRecuperoMaterialeRESTConsumer = prodRecuperoMaterialeRESTConsumer;
|
||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||
this.mPrinterRESTConsumer = printerRESTConsumer;
|
||||
this.mMaterialiRESTConsumer = materialiRESTConsumer;
|
||||
this.mExecutorService = executorService;
|
||||
}
|
||||
@@ -67,7 +62,9 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
this.mExecutorService.execute(() -> {
|
||||
try {
|
||||
List<HistoryVersamentoProdULDTO> lastUlVersate = mProdRecuperoMaterialeRESTConsumer.loadLastULVersateSynchronized(mCodJfas);
|
||||
this.mUlList.postValue(lastUlVersate != null ? lastUlVersate : new ArrayList<>());
|
||||
lastUlVersate.sort(Comparator.comparing(HistoryVersamentoProdULDTO::getCodJfas));
|
||||
|
||||
this.mUlList.postValue(lastUlVersate);
|
||||
this.sendOnDataRefreshEnded();
|
||||
} catch (Exception e) {
|
||||
this.sendError(e);
|
||||
@@ -75,32 +72,29 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
});
|
||||
}
|
||||
|
||||
public void processBarcodeDTO(BarcodeScanDTO data) {
|
||||
public void processBarcodeDTO(BarcodeScanDTO data) throws Exception {
|
||||
if (UtilityBarcode.isEtichettaAnonima(data) || UtilityBarcode.isEtichetta128(data)) {
|
||||
this.executeEtichettaLU(data.getStringValue());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void executeEtichettaLU(String sscc) {
|
||||
private void executeEtichettaLU(String sscc) throws Exception {
|
||||
|
||||
this.sendOnLoadingStarted();
|
||||
var mtbColt = this.mColliMagazzinoRESTConsumer.getBySsccSynchronized(sscc, true, false);
|
||||
|
||||
this.mColliMagazzinoRESTConsumer.getBySSCC(sscc, true, false, mtbColt -> {
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
if (mtbColt != null) {
|
||||
if (mtbColt == null)
|
||||
throw new NoLUFoundException();
|
||||
|
||||
|
||||
HistoryVersamentoProdULDTO historyVersamentoProdULRestDTO = this.getHistoryElementFromMtbColt(mtbColt);
|
||||
if (historyVersamentoProdULRestDTO != null) {
|
||||
|
||||
if (historyVersamentoProdULRestDTO == null)
|
||||
throw new NoLUFoundException();
|
||||
|
||||
this.dispatchItem(historyVersamentoProdULRestDTO, mtbColt);
|
||||
} else {
|
||||
this.sendError(new NoLUFoundException());
|
||||
}
|
||||
|
||||
} else {
|
||||
this.sendError(new NoLUFoundException());
|
||||
}
|
||||
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +163,8 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
.setRigaOrd(x.getRigaOrd())
|
||||
.setPercentageHr(x.getPercentageHr())
|
||||
.setQtaCol(x.getQtaCol())
|
||||
.setNumCnf(x.getNumCnf()))
|
||||
.setNumCnf(x.getNumCnf())
|
||||
.setCodJcom(x.getCodJcom()))
|
||||
.collect(Collectors.toUnmodifiableList());
|
||||
|
||||
MtbColtKey movementScaricoKey = new MtbColtKey(item.getGestione(), item.getSerCollo(), item.getDataCollo(), item.getNumCollo());
|
||||
@@ -204,19 +199,6 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
}
|
||||
|
||||
|
||||
private void printCollo(MtbColt mtbColtToPrint, Runnable onComplete) {
|
||||
singlePrint(mtbColtToPrint, onComplete, ex -> this.sendOnLUPrintError(ex, onComplete));
|
||||
}
|
||||
|
||||
|
||||
private void singlePrint(MtbColt mtbColtToPrint, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
mtbColtToPrint,
|
||||
onComplete, onAbort);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public MutableLiveData<List<HistoryVersamentoProdULDTO>> getOrderList() {
|
||||
return mUlList;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.math.RoundingMode;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
|
||||
@@ -274,6 +275,43 @@ public class HistoryVersamentoProdULDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
HistoryVersamentoProdULDTO that = (HistoryVersamentoProdULDTO) o;
|
||||
return getGestione().equals(that.getGestione()) && getDataCollo().equals(that.getDataCollo()) && getSerCollo().equals(that.getSerCollo()) && getNumCollo().equals(that.getNumCollo()) && getSegno().equals(that.getSegno()) && getCodMart().equals(that.getCodMart()) && Objects.equals(getCodCol(), that.getCodCol()) && Objects.equals(getCodTagl(), that.getCodTagl()) && getCodJfas().equals(that.getCodJfas()) && Objects.equals(getDescrizioneFase(), that.getDescrizioneFase()) && getQtaCol().equals(that.getQtaCol()) && getQtaCnf().equals(that.getQtaCnf()) && getNumCnf().equals(that.getNumCnf()) && Objects.equals(getPartitaMag(), that.getPartitaMag()) && Objects.equals(getCodJcom(), that.getCodJcom()) && getDatetimeRow().equals(that.getDatetimeRow()) && Objects.equals(getDescrizioneArt(), that.getDescrizioneArt()) && Objects.equals(getUntMis(), that.getUntMis()) && getBarcodeUlOut().equals(that.getBarcodeUlOut()) && Objects.equals(getCodMdepOut(), that.getCodMdepOut()) && Objects.equals(getPosizioneOut(), that.getPosizioneOut()) && Objects.equals(getBarcodeUlIn(), that.getBarcodeUlIn()) && Objects.equals(getCodMdepIn(), that.getCodMdepIn()) && Objects.equals(getPosizioneIn(), that.getPosizioneIn());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = getGestione().hashCode();
|
||||
result = 31 * result + getDataCollo().hashCode();
|
||||
result = 31 * result + getSerCollo().hashCode();
|
||||
result = 31 * result + getNumCollo().hashCode();
|
||||
result = 31 * result + getSegno().hashCode();
|
||||
result = 31 * result + getCodMart().hashCode();
|
||||
result = 31 * result + Objects.hashCode(getCodCol());
|
||||
result = 31 * result + Objects.hashCode(getCodTagl());
|
||||
result = 31 * result + getCodJfas().hashCode();
|
||||
result = 31 * result + Objects.hashCode(getDescrizioneFase());
|
||||
result = 31 * result + getQtaCol().hashCode();
|
||||
result = 31 * result + getQtaCnf().hashCode();
|
||||
result = 31 * result + getNumCnf().hashCode();
|
||||
result = 31 * result + Objects.hashCode(getPartitaMag());
|
||||
result = 31 * result + Objects.hashCode(getCodJcom());
|
||||
result = 31 * result + getDatetimeRow().hashCode();
|
||||
result = 31 * result + Objects.hashCode(getDescrizioneArt());
|
||||
result = 31 * result + Objects.hashCode(getUntMis());
|
||||
result = 31 * result + getBarcodeUlOut().hashCode();
|
||||
result = 31 * result + Objects.hashCode(getCodMdepOut());
|
||||
result = 31 * result + Objects.hashCode(getPosizioneOut());
|
||||
result = 31 * result + Objects.hashCode(getBarcodeUlIn());
|
||||
result = 31 * result + Objects.hashCode(getCodMdepIn());
|
||||
result = 31 * result + Objects.hashCode(getPosizioneIn());
|
||||
return result;
|
||||
}
|
||||
|
||||
public static class OrdineDto {
|
||||
private Integer numero;
|
||||
private LocalDate data;
|
||||
@@ -282,6 +320,7 @@ public class HistoryVersamentoProdULDTO {
|
||||
private BigDecimal qtaCol;
|
||||
private BigDecimal numCnf;
|
||||
private Integer percentageHr;
|
||||
private String codJcom;
|
||||
|
||||
public BigDecimal getQtaCnf() {
|
||||
return qtaCol.divide(numCnf, 3, RoundingMode.HALF_EVEN);
|
||||
@@ -349,5 +388,42 @@ public class HistoryVersamentoProdULDTO {
|
||||
this.percentageHr = percentageHr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJcom() {
|
||||
return codJcom;
|
||||
}
|
||||
|
||||
public OrdineDto setCodJcom(String codJcom) {
|
||||
this.codJcom = codJcom;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
OrdineDto ordineDto = (OrdineDto) o;
|
||||
return getNumero().equals(ordineDto.getNumero()) &&
|
||||
getData().equals(ordineDto.getData()) &&
|
||||
getGestione().equals(ordineDto.getGestione()) &&
|
||||
Objects.equals(getRigaOrd(), ordineDto.getRigaOrd()) &&
|
||||
getQtaCol().equals(ordineDto.getQtaCol()) &&
|
||||
getNumCnf().equals(ordineDto.getNumCnf()) &&
|
||||
Objects.equals(getPercentageHr(), ordineDto.getPercentageHr()) &&
|
||||
Objects.equals(getCodJcom(), ordineDto.getCodJcom());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = getNumero().hashCode();
|
||||
result = 31 * result + getData().hashCode();
|
||||
result = 31 * result + getGestione().hashCode();
|
||||
result = 31 * result + Objects.hashCode(getRigaOrd());
|
||||
result = 31 * result + getQtaCol().hashCode();
|
||||
result = 31 * result + getNumCnf().hashCode();
|
||||
result = 31 * result + Objects.hashCode(getPercentageHr());
|
||||
result = 31 * result + Objects.hashCode(getCodJcom());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ public class HistoryVersamentoProdULRestDTO {
|
||||
private BigDecimal numCnf;
|
||||
private String partitaMag;
|
||||
private String codJcom;
|
||||
private String codJcomOrd;
|
||||
private LocalDateTime datetimeRow;
|
||||
private String descrizioneArt;
|
||||
private String untMis;
|
||||
@@ -183,6 +184,15 @@ public class HistoryVersamentoProdULRestDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJcomOrd() {
|
||||
return codJcomOrd;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdULRestDTO setCodJcomOrd(String codJcomOrd) {
|
||||
this.codJcomOrd = codJcomOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDateTime getDatetimeRow() {
|
||||
return datetimeRow;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package it.integry.integrywmsnative.gest.prod_recupero_materiale.rest;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -15,6 +16,7 @@ import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MaterialiRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULRestDTO;
|
||||
|
||||
@Singleton
|
||||
public class ProdRecuperoMaterialeRESTConsumer extends _BaseRESTConsumer {
|
||||
@@ -32,35 +34,32 @@ public class ProdRecuperoMaterialeRESTConsumer extends _BaseRESTConsumer {
|
||||
return loadLastULVersateSynchronized(null);
|
||||
}
|
||||
|
||||
public List<HistoryVersamentoProdULDTO> loadLastULVersateSynchronized(String codJfas) throws Exception {
|
||||
public @NonNull List<HistoryVersamentoProdULDTO> loadLastULVersateSynchronized(String codJfas) throws Exception {
|
||||
var ulList = mMaterialiRESTConsumer.makeSynchronousRetrieveLastVersamentiRequest(codJfas);
|
||||
|
||||
if (ulList == null) {
|
||||
return null;
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
List<HistoryVersamentoProdULDTO> newUlList = new ArrayList<>();
|
||||
|
||||
Stream.of(ulList)
|
||||
.distinctBy(x -> {
|
||||
HashMap<String, Object> hashMap = new HashMap<>();
|
||||
hashMap.put("gestione", x.getGestione());
|
||||
hashMap.put("data_collo", x.getDataCollo());
|
||||
hashMap.put("ser_collo", x.getSerCollo());
|
||||
hashMap.put("num_collo", x.getNumCollo());
|
||||
hashMap.put("cod_mart", x.getCodMart());
|
||||
hashMap.put("barcode_ul_out", x.getBarcodeUlOut());
|
||||
Map<HashMap<String, Object>, List<HistoryVersamentoProdULRestDTO>> ulListGrouped = ulList.stream()
|
||||
.collect(Collectors.groupingBy(x -> new HashMap<>() {{
|
||||
put("gestione", x.getGestione());
|
||||
put("data_collo", x.getDataCollo());
|
||||
put("ser_collo", x.getSerCollo());
|
||||
put("num_collo", x.getNumCollo());
|
||||
put("cod_mart", x.getCodMart());
|
||||
put("barcode_ul_out", x.getBarcodeUlOut());
|
||||
}}, Collectors.toList()));
|
||||
|
||||
return hashMap;
|
||||
})
|
||||
.forEach(restDTO -> {
|
||||
|
||||
List<HistoryVersamentoProdULDTO.OrdineDto> ordineList = ulList.stream()
|
||||
.filter(x -> x.getNumCollo().equals(restDTO.getNumCollo()) &&
|
||||
x.getDataCollo().equals(restDTO.getDataCollo()) &&
|
||||
x.getSerCollo().equals(restDTO.getSerCollo()) &&
|
||||
x.getGestione().equals(restDTO.getGestione()) &&
|
||||
(x.getRigaOrd() == null || Objects.equals(x.getRigaOrd(), restDTO.getRigaOrd())))
|
||||
ulListGrouped.forEach((key, value) -> {
|
||||
|
||||
var listaOrdini = value.stream()
|
||||
.filter(x -> x.getDataOrd() != null &&
|
||||
x.getGestioneOrd() != null &&
|
||||
x.getNumOrd() != null)
|
||||
.map(x -> new HistoryVersamentoProdULDTO.OrdineDto()
|
||||
.setData(x.getDataOrd())
|
||||
.setNumero(x.getNumOrd())
|
||||
@@ -68,36 +67,39 @@ public class ProdRecuperoMaterialeRESTConsumer extends _BaseRESTConsumer {
|
||||
.setRigaOrd(x.getRigaOrd())
|
||||
.setQtaCol(x.getQtaCol())
|
||||
.setNumCnf(x.getNumCnf())
|
||||
.setPercentageHr(x.getPercentageHr()))
|
||||
.collect(Collectors.toList());
|
||||
.setPercentageHr(x.getPercentageHr())
|
||||
.setCodJcom(x.getCodJcomOrd()))
|
||||
.distinct()
|
||||
.collect(Collectors.toUnmodifiableList());
|
||||
|
||||
var restData = value.get(0);
|
||||
|
||||
newUlList.add(new HistoryVersamentoProdULDTO()
|
||||
.setGestione(restDTO.getGestione())
|
||||
.setDataCollo(restDTO.getDataCollo())
|
||||
.setSerCollo(restDTO.getSerCollo())
|
||||
.setNumCollo(restDTO.getNumCollo())
|
||||
.setSegno(restDTO.getSegno())
|
||||
.setCodMart(restDTO.getCodMart())
|
||||
.setCodCol(restDTO.getCodCol())
|
||||
.setCodTagl(restDTO.getCodTagl())
|
||||
.setCodJfas(restDTO.getCodJfas())
|
||||
.setDescrizioneArt(restDTO.getDescrizioneArt())
|
||||
.setDescrizioneFase(restDTO.getDescrizioneFase())
|
||||
.setQtaCol(restDTO.getQtaCol())
|
||||
.setQtaCnf(restDTO.getQtaCnf())
|
||||
.setNumCnf(restDTO.getNumCnf())
|
||||
.setPartitaMag(restDTO.getPartitaMag())
|
||||
.setCodJcom(restDTO.getCodJcom())
|
||||
.setDatetimeRow(restDTO.getDatetimeRow())
|
||||
.setUntMis(restDTO.getUntMis())
|
||||
.setBarcodeUlOut(restDTO.getBarcodeUlOut())
|
||||
.setCodMdepOut(restDTO.getCodMdepOut())
|
||||
.setPosizioneOut(restDTO.getPosizioneOut())
|
||||
.setBarcodeUlIn(restDTO.getBarcodeUlIn())
|
||||
.setCodMdepIn(restDTO.getCodMdepIn())
|
||||
.setPosizioneIn(restDTO.getPosizioneIn())
|
||||
.setOrdini(ordineList));
|
||||
.setGestione(restData.getGestione())
|
||||
.setDataCollo(restData.getDataCollo())
|
||||
.setSerCollo(restData.getSerCollo())
|
||||
.setNumCollo(restData.getNumCollo())
|
||||
.setSegno(restData.getSegno())
|
||||
.setCodMart(restData.getCodMart())
|
||||
.setCodCol(restData.getCodCol())
|
||||
.setCodTagl(restData.getCodTagl())
|
||||
.setCodJfas(restData.getCodJfas())
|
||||
.setDescrizioneArt(restData.getDescrizioneArt())
|
||||
.setDescrizioneFase(restData.getDescrizioneFase())
|
||||
.setQtaCol(restData.getQtaCol())
|
||||
.setQtaCnf(restData.getQtaCnf())
|
||||
.setNumCnf(restData.getNumCnf())
|
||||
.setPartitaMag(restData.getPartitaMag())
|
||||
.setCodJcom(restData.getCodJcom())
|
||||
.setDatetimeRow(restData.getDatetimeRow())
|
||||
.setUntMis(restData.getUntMis())
|
||||
.setBarcodeUlOut(restData.getBarcodeUlOut())
|
||||
.setCodMdepOut(restData.getCodMdepOut())
|
||||
.setPosizioneOut(restData.getPosizioneOut())
|
||||
.setBarcodeUlIn(restData.getBarcodeUlIn())
|
||||
.setCodMdepIn(restData.getCodMdepIn())
|
||||
.setPosizioneIn(restData.getPosizioneIn())
|
||||
.setOrdini(listaOrdini));
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -1,134 +0,0 @@
|
||||
package it.integry.integrywmsnative.gest.prod_recupero_materiale.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.view.ExtendedSectionedRecyclerView;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.ProdRecuperoMaterialeListHeaderBinding;
|
||||
import it.integry.integrywmsnative.databinding.ProdRecuperoMaterialeListItemBinding;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO;
|
||||
|
||||
public class HistoryULsListAdapter extends ExtendedSectionedRecyclerView<HistoryULsListModel, HistoryULsListAdapter.SubheaderHolder,HistoryULsListAdapter.SingleItemViewHolder> {
|
||||
|
||||
|
||||
private Context mContext;
|
||||
|
||||
private RunnableArgs<HistoryULsListModel> mOnItemClicked;
|
||||
|
||||
static class SubheaderHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
ProdRecuperoMaterialeListHeaderBinding binding;
|
||||
|
||||
SubheaderHolder(ProdRecuperoMaterialeListHeaderBinding binding) {
|
||||
super(binding.getRoot());
|
||||
this.binding = binding;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static class SingleItemViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
ProdRecuperoMaterialeListItemBinding binding;
|
||||
|
||||
SingleItemViewHolder(ProdRecuperoMaterialeListItemBinding binding) {
|
||||
super(binding.getRoot());
|
||||
this.binding = binding;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public HistoryULsListAdapter(Context context, ObservableArrayList<HistoryULsListModel> myDataset) {
|
||||
super(myDataset);
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
public HistoryULsListAdapter setOnItemClicked(RunnableArgs<HistoryULsListModel> onItemClicked) {
|
||||
this.mOnItemClicked = onItemClicked;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
private List<HistoryVersamentoProdULDTO> orderItems(List<HistoryVersamentoProdULDTO> dataset) {
|
||||
return Stream.of(dataset)
|
||||
.sortBy(HistoryVersamentoProdULDTO::getCodJfas)
|
||||
.toList();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public SubheaderHolder onCreateSubheaderViewHolder(ViewGroup parent, int viewType) {
|
||||
ProdRecuperoMaterialeListHeaderBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.prod_recupero_materiale_list_header, parent, false);
|
||||
return new SubheaderHolder(binding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleItemViewHolder onCreateItemViewHolder(ViewGroup parent, int viewType) {
|
||||
ProdRecuperoMaterialeListItemBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.prod_recupero_materiale_list_item, parent, false);
|
||||
return new SingleItemViewHolder(binding);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onBindSubheaderViewHolder(SubheaderHolder subheaderHolder, int nextItemPosition) {
|
||||
subheaderHolder.binding.recuperMaterialeMainListGroupHeader.setText(UtilityString.toCamelCase(mDataset.get(nextItemPosition).getGroupTitle()));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBindItemViewHolder(SingleItemViewHolder holder, int itemPosition) {
|
||||
final HistoryULsListModel ul = mDataset.get(itemPosition);
|
||||
|
||||
holder.binding.codMart.setText(ul.getCodMart());
|
||||
holder.binding.descrizione.setText(ul.getDescrizione());
|
||||
|
||||
holder.binding.partitaMagContainer.setVisibility(UtilityString.isNullOrEmpty(ul.getPartitaMag()) ? View.GONE : View.VISIBLE);
|
||||
holder.binding.partitaMag.setText(ul.getPartitaMag());
|
||||
|
||||
holder.binding.commessaContainer.setVisibility(UtilityString.isNullOrEmpty(ul.getCodJcom()) ? View.GONE : View.VISIBLE);
|
||||
holder.binding.commessa.setText(ul.getCodJcom());
|
||||
|
||||
holder.binding.qtaVersata.setText(UtilityNumber.decimalToString(ul.getQtaVersata(), 2));
|
||||
holder.binding.untMisQtaVersata.setText(String.valueOf(ul.getUntMisVersata()));
|
||||
|
||||
holder.binding.getRoot().setOnClickListener(v -> {
|
||||
if(this.mOnItemClicked != null) this.mOnItemClicked.run(ul);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onPlaceSubheaderBetweenItems(int position) {
|
||||
if (getItemSize() == 1) return true;
|
||||
else if (getItemSize() > 1) {
|
||||
HistoryULsListModel compare1 = this.mDataset.get(position);
|
||||
HistoryULsListModel compare2 = this.mDataset.get(position + 1);
|
||||
|
||||
if (UtilityString.equalsIgnoreCase(compare1.getGroupTitle(), compare2.getGroupTitle())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
package it.integry.integrywmsnative.gest.prod_recupero_materiale.ui;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO;
|
||||
|
||||
public class HistoryULsListModel {
|
||||
|
||||
private String groupTitle;
|
||||
|
||||
private String codMart;
|
||||
private String descrizione;
|
||||
private String partitaMag;
|
||||
private String codJcom;
|
||||
|
||||
private BigDecimal qtaVersata;
|
||||
private String untMisVersata;
|
||||
|
||||
private HistoryVersamentoProdULDTO originalModel;
|
||||
|
||||
public String getGroupTitle() {
|
||||
return groupTitle;
|
||||
}
|
||||
|
||||
public HistoryULsListModel setGroupTitle(String groupTitle) {
|
||||
this.groupTitle = groupTitle;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public HistoryULsListModel setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public HistoryULsListModel setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public HistoryULsListModel setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJcom() {
|
||||
return codJcom;
|
||||
}
|
||||
|
||||
public HistoryULsListModel setCodJcom(String codJcom) {
|
||||
this.codJcom = codJcom;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaVersata() {
|
||||
return qtaVersata;
|
||||
}
|
||||
|
||||
public HistoryULsListModel setQtaVersata(BigDecimal qtaVersata) {
|
||||
this.qtaVersata = qtaVersata;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUntMisVersata() {
|
||||
return untMisVersata;
|
||||
}
|
||||
|
||||
public HistoryULsListModel setUntMisVersata(String untMisVersata) {
|
||||
this.untMisVersata = untMisVersata;
|
||||
return this;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdULDTO getOriginalModel() {
|
||||
return originalModel;
|
||||
}
|
||||
|
||||
public HistoryULsListModel setOriginalModel(HistoryVersamentoProdULDTO originalModel) {
|
||||
this.originalModel = originalModel;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -163,7 +163,7 @@ public class UltimeConsegneClienteFragment extends BaseFragment implements Ultim
|
||||
private void refreshConsegne(GtbAnag gtbAnag) {
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.loadConsegneClienti(gtbAnag.getCodAnag(),
|
||||
this.mViewModel.loadConsegneClienti(gtbAnag != null ? gtbAnag.getCodAnag() : null,
|
||||
null,
|
||||
-1,
|
||||
548
|
||||
|
||||
@@ -72,7 +72,7 @@ public class UltimeConsegneMainListAdapter extends ExtendedSectionedRecyclerView
|
||||
|
||||
@Override
|
||||
public void onBindItemViewHolder(final SingleItemViewHolder holder, final int position) {
|
||||
final DocumentoResoDTO consegna = this.mDataset.get(position);
|
||||
final DocumentoResoDTO consegna = this.originalItems.get(position);
|
||||
|
||||
holder.mBinding.setConsegna(consegna);
|
||||
|
||||
@@ -117,13 +117,13 @@ public class UltimeConsegneMainListAdapter extends ExtendedSectionedRecyclerView
|
||||
|
||||
@Override
|
||||
public void onBindSubheaderViewHolder(SubheaderHolder subheaderHolder, int nextItemPosition) {
|
||||
subheaderHolder.mBinding.title.setText(this.mDataset.get(nextItemPosition).getRagSoc());
|
||||
subheaderHolder.mBinding.title.setText(this.originalItems.get(nextItemPosition).getRagSoc());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPlaceSubheaderBetweenItems(int position) {
|
||||
|
||||
if(!this.mDataset.get(position).getCodAnag().equalsIgnoreCase(this.mDataset.get(position+1).getCodAnag())) {
|
||||
if(!this.originalItems.get(position).getCodAnag().equalsIgnoreCase(this.originalItems.get(position+1).getCodAnag())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,13 @@ package it.integry.integrywmsnative.gest.ultime_consegne_cliente.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
@@ -70,6 +72,7 @@ public class DialogUltimeConsegneFiltroAvanzatoView extends BaseDialogFragment {
|
||||
.setNegativeButton(R.string.abort, (dialog, which) -> {
|
||||
if (onConfirm != null) onConfirm.run(Result.aborted());
|
||||
})
|
||||
.setNeutralButton(R.string.reset, (dialog, which) -> {})
|
||||
.create();
|
||||
|
||||
alertDialog.setCanceledOnTouchOutside(isCancelable());
|
||||
@@ -80,6 +83,18 @@ public class DialogUltimeConsegneFiltroAvanzatoView extends BaseDialogFragment {
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShow(DialogInterface dialogInterface) {
|
||||
super.onShow(dialogInterface);
|
||||
|
||||
var alertDialog = ((AlertDialog) dialogInterface);
|
||||
|
||||
var neutralButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL);
|
||||
neutralButton.setOnClickListener(view -> {
|
||||
reset();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
if (getDialog() != null) getDialog().dismiss();
|
||||
|
||||
@@ -75,7 +75,7 @@ public class UltimiArriviFornitoreListAdapter extends ExtendedSectionedRecyclerV
|
||||
|
||||
@Override
|
||||
public void onBindItemViewHolder(final SingleItemViewHolder holder, final int position) {
|
||||
final DocumentoResoDTO consegna = this.mDataset.get(position);
|
||||
final DocumentoResoDTO consegna = this.originalItems.get(position);
|
||||
|
||||
holder.mBinding.setConsegna(consegna);
|
||||
|
||||
@@ -117,13 +117,13 @@ public class UltimiArriviFornitoreListAdapter extends ExtendedSectionedRecyclerV
|
||||
|
||||
@Override
|
||||
public void onBindSubheaderViewHolder(SubheaderHolder subheaderHolder, int nextItemPosition) {
|
||||
subheaderHolder.mBinding.title.setText(this.mDataset.get(nextItemPosition).getRagSoc());
|
||||
subheaderHolder.mBinding.title.setText(this.originalItems.get(nextItemPosition).getRagSoc());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPlaceSubheaderBetweenItems(int position) {
|
||||
|
||||
if(!this.mDataset.get(position).getCodAnag().equalsIgnoreCase(this.mDataset.get(position+1).getCodAnag())) {
|
||||
if(!this.originalItems.get(position).getCodAnag().equalsIgnoreCase(this.originalItems.get(position+1).getCodAnag())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -132,14 +132,14 @@ public class UltimiArriviFornitoreListAdapter extends ExtendedSectionedRecyclerV
|
||||
|
||||
@Override
|
||||
public int getItemSize() {
|
||||
return this.mDataset.size();
|
||||
return this.originalItems.size();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void updateItems(List<DocumentoResoDTO> updatedDataset) {
|
||||
mDataset.clear();
|
||||
mDataset.addAll(updatedDataset);
|
||||
originalItems.clear();
|
||||
originalItems.addAll(updatedDataset);
|
||||
notifyDataSetChanged();
|
||||
notifyDataChanged();
|
||||
}
|
||||
|
||||
4
app/src/main/res/drawable/badge_background_primary.xml
Normal file
4
app/src/main/res/drawable/badge_background_primary.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="?attr/colorPrimaryContainer"/>
|
||||
<corners android:radius="4dp"/>
|
||||
</shape>
|
||||
4
app/src/main/res/drawable/badge_background_secondary.xml
Normal file
4
app/src/main/res/drawable/badge_background_secondary.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="?attr/colorSecondaryContainer"/>
|
||||
<corners android:radius="4dp"/>
|
||||
</shape>
|
||||
10
app/src/main/res/drawable/ic_engineering_24.xml
Normal file
10
app/src/main/res/drawable/ic_engineering_24.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M13.78,15.34L12.72,12.22L13.78,9.1H17.22L18.28,12.22L17.22,15.34H13.78ZM5,19V8.3L9.38,5H17V7H10.7L7,10V19H5ZM10,19V17H12V19H10ZM15,19V17H17V19H15Z"/>
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/ic_label_24.xml
Normal file
10
app/src/main/res/drawable/ic_label_24.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M17.63,5.84C17.27,5.33 16.67,5 16,5L5,5.01C3.9,5.01 3,5.91 3,7v10c0,1.1 0.9,1.99 2,1.99L16,19c0.67,0 1.27,-0.33 1.63,-0.84L22,12l-4.37,-6.16zM16,17H5V7h11l3.55,5L16,17z"/>
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/ic_receipt_long_24.xml
Normal file
10
app/src/main/res/drawable/ic_receipt_long_24.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M19.5,3.5L18,2L16.5,3.5L15,2L13.5,3.5L12,2L10.5,3.5L9,2L7.5,3.5L6,2V22L7.5,20.5L9,22L10.5,20.5L12,22L13.5,20.5L15,22L16.5,20.5L18,22L19.5,20.5L21,22V2L19.5,3.5zM9,12V10H15V12H9zM15,16H9V14H15V16zM15,8H9V6H15V8z" />
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/ic_tag_outline_24.xml
Normal file
10
app/src/main/res/drawable/ic_tag_outline_24.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M21.41,11.58L12.41,2.58C12.04,2.21 11.53,2 11,2H4C2.9,2 2,2.9 2,4v7c0,0.53 0.21,1.04 0.59,1.41l9,9C11.95,21.78 12.45,22 13,22s1.05,-0.22 1.41,-0.59l7,-7C21.78,14.05 22,13.55 22,13S21.78,11.95 21.41,11.58zM13,20.01L4,11V4h7v0l9,9L13,20.01zM6.5,5C7.33,5 8,5.67 8,6.5S7.33,8 6.5,8S5,7.33 5,6.5S5.67,5 6.5,5z" />
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/ic_warehouse_24.xml
Normal file
10
app/src/main/res/drawable/ic_warehouse_24.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M22,21V7L12,3L2,7V21H9V12H15V21H22ZM11,19H9V17H11V19ZM15,19H13V17H15V19Z" />
|
||||
</vector>
|
||||
@@ -296,7 +296,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{view.enabledTaraCol}"
|
||||
android:hint="@string/tare_pckg"
|
||||
android:hint="@string/tare_pkg"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="numberDecimal"
|
||||
android:textColor="@{ContextCompat.getColor(context, view.enabledTaraCol ? android.R.color.black : R.color.gray_400)}"
|
||||
|
||||
@@ -886,7 +886,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:hint="@string/tare_pckg"
|
||||
android:hint="@string/tare_pkg"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="numberDecimal"
|
||||
android:textColor="@color/gray_400"
|
||||
|
||||
@@ -282,7 +282,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="@{view.enabledTaraCol}"
|
||||
android:hint="@string/tare_pckg"
|
||||
android:hint="@string/tare_pkg"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="numberDecimal"
|
||||
app:binding="@{view.currentTaraCol}" />
|
||||
|
||||
@@ -902,7 +902,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:hint="@string/tare_pckg"
|
||||
android:hint="@string/tare_pkg"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="numberDecimal"
|
||||
android:textColor="@color/gray_400"
|
||||
|
||||
@@ -86,14 +86,14 @@
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<Button
|
||||
style="@style/Button.PrimaryOutline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/reset"
|
||||
android:onClick="@{() -> view.reset()}"/>
|
||||
<!-- <Button-->
|
||||
<!-- style="@style/Button.PrimaryOutline"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_gravity="center_horizontal"-->
|
||||
<!-- android:layout_marginTop="12dp"-->
|
||||
<!-- android:text="@string/reset"-->
|
||||
<!-- android:onClick="@{() -> view.reset()}"/>-->
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/recuper_materiale_main_list_group_header"
|
||||
style="@style/TextAppearance.Material3.HeadlineSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginVertical="8dp"
|
||||
android:paddingTop="8dp"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="?colorPrimary"
|
||||
tools:text="Linea 1" />
|
||||
|
||||
</layout>
|
||||
@@ -1,139 +1,235 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/left_content"
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.UntMisUtils" />
|
||||
<variable
|
||||
name="item"
|
||||
type="it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO" />
|
||||
</data>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingVertical="8dp"
|
||||
android:paddingHorizontal="8dp">
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginVertical="4dp"
|
||||
android:checkable="true"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:cardBackgroundColor="?attr/colorSurfaceContainerLow"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp"
|
||||
app:strokeColor="?attr/colorOutlineVariant"
|
||||
app:strokeWidth="0.5dp">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_gravity="center_vertical">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/cod_mart"
|
||||
style="@style/TextAppearance.Material3.TitleSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_alignTop="@id/partita_mag_container"
|
||||
android:layout_alignBaseline="@id/partita_mag_container"
|
||||
tools:text="150101-040" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/partita_mag_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="@color/green_200"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_toEndOf="@id/cod_mart">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/partita_mag"
|
||||
style="@style/TextAppearance.Material3.TitleSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
tools:text="Lotto articolo" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/right_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/cod_mart"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:paddingEnd="8dp">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/qta_versata"
|
||||
style="@style/TextAppearance.Material3.BodyLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
tools:text="27" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/unt_mis_qta_versata"
|
||||
style="@style/TextAppearance.Material3.BodyMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:textStyle="bold"
|
||||
tools:text="PZ" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="12dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/descrizione"
|
||||
style="@style/TextAppearance.Material3.BodyMedium"
|
||||
<!-- Codice Articolo Badge -->
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chip_codice_articolo"
|
||||
style="@style/Widget.Material3.Chip.Assist"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checkable="false"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:textAppearance="?attr/textAppearanceLabelLarge"
|
||||
android:textColor="?attr/colorOnSecondaryContainer"
|
||||
app:ensureMinTouchTargetSize="false"
|
||||
app:chipBackgroundColor="?attr/colorSecondaryContainer"
|
||||
app:chipCornerRadius="8dp"
|
||||
app:chipIcon="@drawable/ic_tag_outline_24"
|
||||
app:chipIconTint="?attr/colorOnSecondaryContainer"
|
||||
app:chipMinHeight="32dp"
|
||||
app:chipStrokeWidth="0dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:text="@{item.codMart}"
|
||||
tools:text="ART001" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/qta_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:gravity="end"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/chip_codice_articolo"
|
||||
app:layout_constraintBottom_toBottomOf="@id/chip_codice_articolo">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/num_cnf_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/badge_background_secondary"
|
||||
android:paddingHorizontal="6dp"
|
||||
android:paddingVertical="2dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:text="@{UtilityNumber.decimalToString(item.numCnf, 0) + ' ' + @string/pkg}"
|
||||
android:textAppearance="?attr/textAppearanceLabelSmall"
|
||||
android:textColor="?attr/colorOnSecondaryContainer"
|
||||
app:visibility="@{UntMisUtils.shouldBeShowInColli(item.mtbAart) ? View.VISIBLE : View.GONE}"
|
||||
tools:visibility="visible"
|
||||
tools:text="10 CNF" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qta_textview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/badge_background_primary"
|
||||
android:paddingHorizontal="6dp"
|
||||
android:paddingVertical="2dp"
|
||||
android:text="@{UtilityNumber.decimalToString(item.qtaCol, item.mtbAart.firstUntMis.cifreDec.intValue()) + ' ' + item.mtbAart.firstUntMis.untMis}"
|
||||
android:textAppearance="?attr/textAppearanceBodyMedium"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?attr/colorOnPrimaryContainer"
|
||||
tools:text="280.45 KG" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/barrier_articolo_qta"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="chip_codice_articolo,qta_layout"
|
||||
app:barrierMargin="6dp"/>
|
||||
|
||||
<!-- Fase Chip (Prominent) -->
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chip_fase"
|
||||
style="@style/Widget.Material3.Chip.Assist"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checkable="false"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:textAppearance="?attr/textAppearanceLabelLarge"
|
||||
android:textColor="?attr/colorOnTertiaryContainer"
|
||||
app:ensureMinTouchTargetSize="false"
|
||||
app:chipBackgroundColor="?attr/colorTertiaryContainer"
|
||||
app:chipCornerRadius="8dp"
|
||||
app:chipIcon="@drawable/ic_engineering_24"
|
||||
app:chipIconTint="?attr/colorOnTertiaryContainer"
|
||||
app:chipMinHeight="32dp"
|
||||
app:chipStrokeWidth="0dp"
|
||||
app:layout_constraintStart_toEndOf="@id/chip_codice_articolo"
|
||||
app:layout_constraintEnd_toStartOf="@id/qta_layout"
|
||||
app:layout_constraintTop_toTopOf="@id/chip_codice_articolo"
|
||||
android:text="@{item.codJfas}"
|
||||
tools:text="C-PRO"
|
||||
android:contentDescription="Fase di lavorazione" />
|
||||
|
||||
<!-- Descrizione Articolo -->
|
||||
<TextView
|
||||
android:id="@+id/tv_descrizione"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:lineSpacingMultiplier="1.1"
|
||||
android:textAppearance="?attr/textAppearanceBodyMedium"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:text="@{item.descrizioneArt}"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="false"
|
||||
android:maxLines="3"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_toStartOf="@id/commessa_container"
|
||||
tools:text="Descrizione estesa articolo" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/chip_fase"
|
||||
tools:text="Descrizione articolo breve che potrebbe essere lunga" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/commessa_container"
|
||||
<!-- Optional Fields managed by Flow -->
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chip_commessa_ordine"
|
||||
style="@style/Widget.Material3.Chip.Assist"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="@color/orange_300"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_alignParentEnd="true">
|
||||
android:text="@{`Comm. Ord.: ` + item.ordini.get(0).codJcom}"
|
||||
android:textAppearance="?attr/textAppearanceLabelSmall"
|
||||
android:textColor="?attr/colorOnSecondaryContainer"
|
||||
android:focusable="false"
|
||||
android:clickable="false"
|
||||
android:checkable="false"
|
||||
app:ensureMinTouchTargetSize="false"
|
||||
app:chipBackgroundColor="?attr/colorSecondaryContainer"
|
||||
app:chipIcon="@drawable/ic_receipt_long_24"
|
||||
app:chipIconTint="?attr/colorOnSecondaryContainer"
|
||||
app:chipIconSize="16dp"
|
||||
app:chipMinHeight="28dp"
|
||||
app:iconStartPadding="4dp"
|
||||
app:textStartPadding="6dp"
|
||||
app:visibility="@{item.ordini.size == 1 && !UtilityString.isNullOrEmpty(item.ordini.get(0).codJcom) ? View.VISIBLE : View.GONE}"
|
||||
tools:visibility="visible"
|
||||
tools:text="Comm. Ord.: ORD12345"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/commessa"
|
||||
style="@style/TextAppearance.Material3.TitleSmall"
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chip_commessa_giacenza"
|
||||
style="@style/Widget.Material3.Chip.Assist"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
tools:text="Commessa" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
android:text="@{`Comm. Giac.: ` + item.codJcom}"
|
||||
android:textAppearance="?attr/textAppearanceLabelSmall"
|
||||
android:textColor="?attr/colorOnTertiaryContainer"
|
||||
android:focusable="false"
|
||||
android:clickable="false"
|
||||
android:checkable="false"
|
||||
app:ensureMinTouchTargetSize="false"
|
||||
app:chipBackgroundColor="?attr/colorTertiaryContainer"
|
||||
app:chipIcon="@drawable/ic_warehouse_24"
|
||||
app:chipIconTint="?attr/colorOnTertiaryContainer"
|
||||
app:chipIconSize="16dp"
|
||||
app:chipMinHeight="28dp"
|
||||
app:iconStartPadding="4dp"
|
||||
app:textStartPadding="6dp"
|
||||
app:visibility="@{!UtilityString.isNullOrEmpty(item.codJcom) ? View.VISIBLE : View.GONE}"
|
||||
tools:visibility="visible"
|
||||
tools:text="Comm. Giac.: GIA67890"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/chip_lotto"
|
||||
style="@style/Widget.Material3.Chip.Assist"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{@string/batch_lot + `: ` + item.partitaMag}"
|
||||
android:textAppearance="?attr/textAppearanceLabelSmall"
|
||||
android:textColor="?attr/colorOnErrorContainer"
|
||||
android:focusable="false"
|
||||
android:clickable="false"
|
||||
android:checkable="false"
|
||||
app:ensureMinTouchTargetSize="false"
|
||||
app:chipBackgroundColor="?attr/colorErrorContainer"
|
||||
app:chipIcon="@drawable/ic_label_24"
|
||||
app:chipIconTint="?attr/colorOnErrorContainer"
|
||||
app:chipIconSize="16dp"
|
||||
app:chipMinHeight="28dp"
|
||||
app:iconStartPadding="4dp"
|
||||
app:textStartPadding="6dp"
|
||||
app:visibility="@{!UtilityString.isNullOrEmpty(item.partitaMag) ? View.VISIBLE : View.GONE}"
|
||||
tools:visibility="visible"
|
||||
tools:text="Lotto: LOTTOXYZ"/>
|
||||
|
||||
<androidx.constraintlayout.helper.widget.Flow
|
||||
android:id="@+id/flow_optional_items"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_descrizione"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:flow_wrapMode="chain"
|
||||
app:flow_horizontalStyle="packed"
|
||||
app:flow_horizontalGap="8dp"
|
||||
app:flow_verticalGap="4dp"
|
||||
app:constraint_referenced_ids="chip_commessa_ordine,chip_commessa_giacenza,chip_lotto" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</layout>
|
||||
@@ -190,8 +190,9 @@
|
||||
<string name="kg_x_pck">KG per collo</string>
|
||||
<string name="tot_kg">Peso totale</string>
|
||||
<string name="tare_lu">Tara pedana</string>
|
||||
<string name="tare_pckg">Tara collo</string>
|
||||
<string name="tare_pkg">Tara collo</string>
|
||||
<string name="tare_art">Tara articolo</string>
|
||||
<string name="pkg">cnf</string>
|
||||
|
||||
<string name="checking_updates">Controllo gli aggiornamenti</string>
|
||||
|
||||
@@ -261,6 +262,7 @@
|
||||
<string name="cod_art_or_description">Cod art / Descrizione</string>
|
||||
<string name="no_supplier_selected">Seleziona un fornitore prima</string>
|
||||
|
||||
<string name="order">Ordine</string>
|
||||
<string name="num_ords">Numero ordine</string>
|
||||
<string name="order_cod_jcoms">Commessa</string>
|
||||
<string name="customer">Cliente</string>
|
||||
|
||||
@@ -24,4 +24,8 @@
|
||||
<dimen name="fastscroll__handle_clickable_width">24dp</dimen>
|
||||
|
||||
<dimen name="fastscroll__handle_padding">2dp</dimen>
|
||||
|
||||
|
||||
<dimen name="spacing_extra_small">4dp</dimen>
|
||||
<dimen name="spacing_none">0dp</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -190,7 +190,8 @@
|
||||
<string name="tot_kg">Tot qty</string>
|
||||
<string name="tare_lu">Tare LU</string>
|
||||
<string name="tare_art">Tare product</string>
|
||||
<string name="tare_pckg">Tare pckg</string>
|
||||
<string name="tare_pkg">Tare pkg</string>
|
||||
<string name="pkg">pkg</string>
|
||||
|
||||
<string name="checking_updates">Checking for updates</string>
|
||||
|
||||
@@ -265,8 +266,9 @@
|
||||
<string name="no_supplier_selected">Please select a supplier first</string>
|
||||
|
||||
|
||||
<string name="num_ords">Orders number</string>
|
||||
<string name="order_cod_jcoms">Orders job</string>
|
||||
<string name="order">Order</string>
|
||||
<string name="num_ords">Order number</string>
|
||||
<string name="order_cod_jcoms">Order job</string>
|
||||
<string name="customer">Customer</string>
|
||||
<string name="inventory_id">Inventory ID</string>
|
||||
<string name="zone">Zone</string>
|
||||
|
||||
Reference in New Issue
Block a user