Iniziata implementazione di Recupero materiale e Versamento materiale in produzione.
This commit is contained in:
parent
bded2fc04e
commit
511c9814d9
2
.idea/runConfigurations/app.xml
generated
2
.idea/runConfigurations/app.xml
generated
@ -6,7 +6,7 @@
|
||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||
<option name="ARTIFACT_NAME" value="" />
|
||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="dynamic__base,dynamic_vgalimenti" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="dynamic_ime,dynamic_vgalimenti" />
|
||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||
<option name="MODE" value="default_activity" />
|
||||
<option name="CLEAR_LOGCAT" value="true" />
|
||||
|
||||
@ -26,4 +26,18 @@ public class UtilityString {
|
||||
|
||||
return capMatcher.appendTail(capBuffer).toString();
|
||||
}
|
||||
|
||||
public static String toCamelCase(String input) {
|
||||
if(UtilityString.isNullOrEmpty(input)) return input;
|
||||
|
||||
String tmp = "";
|
||||
|
||||
tmp += String.valueOf(input.charAt(0)).toUpperCase();
|
||||
|
||||
if(input.length() > 1) {
|
||||
tmp += input.substring(1).toLowerCase();
|
||||
}
|
||||
|
||||
return tmp;
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.interfaces.ISearcableFragment;
|
||||
import it.integry.integrywmsnative.databinding.FragmentMainAccettazioneBinding;
|
||||
import it.integry.integrywmsnative.gest.accettazione.core.AccettazioneHelper;
|
||||
import it.integry.integrywmsnative.gest.accettazione.core.MainListAccettazioneAdapterNew;
|
||||
import it.integry.integrywmsnative.gest.accettazione.core.MainListAccettazioneAdapter;
|
||||
import it.integry.integrywmsnative.gest.accettazione.core.interfaces.ILoadOrdiniCallback;
|
||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
@ -49,7 +49,7 @@ public class MainAccettazioneFragment extends Fragment implements ISearcableFrag
|
||||
private FragmentMainAccettazioneBinding mBinding;
|
||||
|
||||
private AccettazioneHelper mHelper;
|
||||
private MainListAccettazioneAdapterNew mAdapter;
|
||||
private MainListAccettazioneAdapter mAdapter;
|
||||
|
||||
private List<OrdineAccettazioneInevasoDTO> mOriginalOrderList;
|
||||
private List<OrdineAccettazioneInevasoDTO> mRenderedOrderList = new ArrayList<>();
|
||||
@ -152,14 +152,14 @@ public class MainAccettazioneFragment extends Fragment implements ISearcableFrag
|
||||
}
|
||||
|
||||
private void initRecyclerView() {
|
||||
mAdapter = new MainListAccettazioneAdapterNew(getActivity(), mRenderedOrderList, onSingleSelectionChanged);
|
||||
mAdapter = new MainListAccettazioneAdapter(getActivity(), mRenderedOrderList, onSingleSelectionChanged);
|
||||
mBinding.accettazioneMainList.setAdapter(mAdapter);
|
||||
}
|
||||
|
||||
private void refreshRenderedOrdini(List<OrdineAccettazioneInevasoDTO> ordini) {
|
||||
|
||||
mRenderedOrderList.clear();
|
||||
mRenderedOrderList.addAll(ordini);
|
||||
if(ordini != null) mRenderedOrderList.addAll(ordini);
|
||||
}
|
||||
|
||||
private void refreshRecyclerView() {
|
||||
@ -271,7 +271,7 @@ public class MainAccettazioneFragment extends Fragment implements ISearcableFrag
|
||||
// groupedOrdiniInevasi.add(groupedOrdine);
|
||||
// });
|
||||
//
|
||||
// mAdapter = new MainListAccettazioneAdapterNew(getActivity(), groupedOrdiniInevasi, onGroupSelectionChanged);
|
||||
// mAdapter = new MainListAccettazioneAdapter(getActivity(), groupedOrdiniInevasi, onGroupSelectionChanged);
|
||||
// mBinding.accettazioneMainList.setAdapter(mAdapter);
|
||||
// }
|
||||
|
||||
|
||||
@ -12,7 +12,6 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.zhukic.sectionedrecyclerview.SectionedRecyclerViewAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
@ -24,10 +23,9 @@ import it.integry.integrywmsnative.databinding.AccettazioneMainListGroupClientiB
|
||||
import it.integry.integrywmsnative.databinding.AccettazioneMainListGroupModelBinding;
|
||||
import it.integry.integrywmsnative.databinding.AccettazioneMainListModelBinding;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||
import it.integry.integrywmsnative.gest.prod_ord_produzione.core.OrdineProduzioneListAdapter;
|
||||
import it.integry.integrywmsnative.ui.fastscroll.SectionTitleProvider;
|
||||
|
||||
public class MainListAccettazioneAdapterNew extends SectionedRecyclerViewAdapter<MainListAccettazioneAdapterNew.SubheaderHolder, MainListAccettazioneAdapterNew.SingleItemViewHolder> implements SectionTitleProvider {
|
||||
public class MainListAccettazioneAdapter extends SectionedRecyclerViewAdapter<MainListAccettazioneAdapter.SubheaderHolder, MainListAccettazioneAdapter.SingleItemViewHolder> implements SectionTitleProvider {
|
||||
|
||||
|
||||
private Context mContext;
|
||||
@ -57,7 +55,7 @@ public class MainListAccettazioneAdapterNew extends SectionedRecyclerViewAdapter
|
||||
}
|
||||
}
|
||||
|
||||
public MainListAccettazioneAdapterNew(Context context, List<OrdineAccettazioneInevasoDTO> myDataset, RunnableArgs<OrdineAccettazioneInevasoDTO> onSingleSelectionChanged) {
|
||||
public MainListAccettazioneAdapter(Context context, List<OrdineAccettazioneInevasoDTO> myDataset, RunnableArgs<OrdineAccettazioneInevasoDTO> onSingleSelectionChanged) {
|
||||
mContext = context;
|
||||
mOriginalDataset = myDataset;
|
||||
mDataset = orderItems(myDataset);
|
||||
@ -152,7 +152,7 @@ public class ProdOrdineProduzioneElencoFragment extends Fragment implements ITit
|
||||
private void refreshRenderedOrdini(List<OrdineAccettazioneInevasoDTO> ordini) {
|
||||
|
||||
mRenderedOrderList.clear();
|
||||
mRenderedOrderList.addAll(ordini);
|
||||
if(ordini != null) mRenderedOrderList.addAll(ordini);
|
||||
}
|
||||
|
||||
private void refreshRecyclerView() {
|
||||
|
||||
@ -66,7 +66,7 @@ public class ProdRecuperoMaterialeFragment extends Fragment implements ITitledFr
|
||||
((IPoppableActivity) getActivity()).pop();
|
||||
});
|
||||
|
||||
mViewmodel.openLU();
|
||||
// mViewmodel.openLU();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,140 @@
|
||||
package it.integry.integrywmsnative.gest.prod_recupero_materiale.core;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.zhukic.sectionedrecyclerview.SectionedRecyclerViewAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
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.HistoryVersamentoProdUL;
|
||||
import it.integry.integrywmsnative.ui.fastscroll.SectionTitleProvider;
|
||||
|
||||
public class HistoryULsListAdapter extends SectionedRecyclerViewAdapter<HistoryULsListAdapter.SubheaderHolder, HistoryULsListAdapter.SingleItemViewHolder> implements SectionTitleProvider {
|
||||
|
||||
|
||||
private Context mContext;
|
||||
|
||||
private List<HistoryVersamentoProdUL> mOriginalDataset;
|
||||
private List<HistoryVersamentoProdUL> mDataset;
|
||||
|
||||
|
||||
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, List<HistoryVersamentoProdUL> myDataset) {
|
||||
mContext = context;
|
||||
mOriginalDataset = myDataset;
|
||||
mDataset = orderItems(myDataset);
|
||||
}
|
||||
|
||||
public void updateItems(List<HistoryVersamentoProdUL> updatedDataset) {
|
||||
mDataset.clear();
|
||||
mDataset.addAll(orderItems(updatedDataset));
|
||||
notifyDataSetChanged();
|
||||
notifyDataChanged();
|
||||
}
|
||||
|
||||
|
||||
private List<HistoryVersamentoProdUL> orderItems(List<HistoryVersamentoProdUL> dataset) {
|
||||
return Stream.of(dataset)
|
||||
.sortBy(HistoryVersamentoProdUL::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) {
|
||||
String fase = UtilityString.isNullOrEmpty(mDataset.get(nextItemPosition).getDescrizioneFase()) ? mDataset.get(nextItemPosition).getCodJfas() : mDataset.get(nextItemPosition).getDescrizioneFase();
|
||||
|
||||
subheaderHolder.binding.codJfas.setText(UtilityString.toCamelCase(fase));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBindItemViewHolder(SingleItemViewHolder h, int itemPosition) {
|
||||
final HistoryVersamentoProdUL ul = mDataset.get(itemPosition);
|
||||
final SingleItemViewHolder holder = h;
|
||||
|
||||
|
||||
holder.binding.codMart.setText(ul.getCodMart());
|
||||
holder.binding.descrizione.setText(ul.getDescrizioneArt());
|
||||
holder.binding.numCollo.setText(String.valueOf(ul.getNumCollo()));
|
||||
holder.binding.partitaMag.setText(ul.getPartitaMag());
|
||||
|
||||
holder.binding.qtaVersata.setText(String.valueOf(ul.getQtaCol()));
|
||||
holder.binding.untMisQtaVersata.setText(ul.getUntMis());
|
||||
|
||||
|
||||
holder.binding.getRoot().setOnClickListener(v -> {
|
||||
// ordine.setSelected(!ordine.isSelected());
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onPlaceSubheaderBetweenItems(int position) {
|
||||
return !this.mDataset.get(position).getCodJfas().equalsIgnoreCase(this.mDataset.get(position + 1).getCodJfas());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemSize() {
|
||||
return mDataset.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSectionTitle(int position) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -2,6 +2,18 @@ package it.integry.integrywmsnative.gest.prod_recupero_materiale.core;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdUL;
|
||||
|
||||
public class ProdRecuperoMaterialeHelper {
|
||||
|
||||
|
||||
@ -10,4 +22,67 @@ public class ProdRecuperoMaterialeHelper {
|
||||
public ProdRecuperoMaterialeHelper(Context context) {
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
|
||||
public void loadLastULVersate(RunnableArgs<List<HistoryVersamentoProdUL>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
String sql = "SELECT jtb_fasi.cod_jfas, " +
|
||||
"jtb_fasi.descrizione AS descrizione_fase, " +
|
||||
"mtb_colr.gestione, " +
|
||||
"mtb_colr.data_collo, " +
|
||||
"mtb_colr.num_collo, " +
|
||||
"mtb_colr.cod_mart, " +
|
||||
"mtb_colr.cod_col, " +
|
||||
"mtb_colr.cod_tagl, " +
|
||||
"SUM(mtb_colr.qta_col) AS qta_col, " +
|
||||
"SUM(mtb_colr.num_cnf) AS num_cnf, " +
|
||||
"mtb_colr.ser_collo, " +
|
||||
"mtb_colr.partita_mag, " +
|
||||
"mtb_colr.cod_jcom, " +
|
||||
"mtb_colt.segno, " +
|
||||
"ISNULL(mtb_aart.descrizione_estesa, mtb_aart.descrizione) AS descrizione_art, " +
|
||||
"mtb_aart.unt_mis, " +
|
||||
"MAX(datetime_row) AS datetime_row " +
|
||||
"FROM mtb_colr " +
|
||||
"INNER JOIN mtb_colt " +
|
||||
"ON mtb_colr.num_collo = mtb_colt.num_collo " +
|
||||
"AND mtb_colr.data_collo = mtb_colt.data_collo " +
|
||||
"AND mtb_colr.ser_collo = mtb_colt.ser_collo " +
|
||||
"AND mtb_colr.gestione = mtb_colt.gestione " +
|
||||
"INNER JOIN mtb_aart " +
|
||||
"ON mtb_colr.cod_mart = mtb_aart.cod_mart " +
|
||||
"LEFT OUTER JOIN jtb_fasi ON mtb_colt.cod_jfas = jtb_fasi.cod_jfas " +
|
||||
"WHERE jtb_fasi.cod_jfas IS NOT NULL " +
|
||||
"AND segno = -1 " +
|
||||
"GROUP BY jtb_fasi.cod_jfas, " +
|
||||
"jtb_fasi.descrizione, " +
|
||||
"mtb_colr.gestione, " +
|
||||
"mtb_colr.data_collo, " +
|
||||
"mtb_colr.num_collo, " +
|
||||
"mtb_colr.cod_mart, " +
|
||||
"mtb_colr.cod_col, " +
|
||||
"mtb_colr.cod_tagl, " +
|
||||
"mtb_colr.ser_collo, " +
|
||||
"mtb_colr.partita_mag, " +
|
||||
"mtb_colr.cod_jcom, " +
|
||||
"mtb_aart.descrizione_estesa, " +
|
||||
"mtb_aart.descrizione, " +
|
||||
"mtb_aart.unt_mis, " +
|
||||
"mtb_colt.segno " +
|
||||
"ORDER BY data_collo DESC";
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<HistoryVersamentoProdUL>>() {}.getType();
|
||||
SystemRESTConsumer.processSql(sql, typeOfObjectsList, new ISimpleOperationCallback<List<HistoryVersamentoProdUL>>() {
|
||||
@Override
|
||||
public void onSuccess(List<HistoryVersamentoProdUL> value) {
|
||||
onComplete.run(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
onFailed.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,168 @@
|
||||
package it.integry.integrywmsnative.gest.prod_recupero_materiale.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class HistoryVersamentoProdUL {
|
||||
|
||||
|
||||
private String gestione;
|
||||
private String dataCollo;
|
||||
private Integer numCollo;
|
||||
private String segno;
|
||||
private String codMart;
|
||||
private String codCol;
|
||||
private String codTagl;
|
||||
private String codJfas;
|
||||
private String descrizioneFase;
|
||||
private BigDecimal qtaCol;
|
||||
private BigDecimal numCnf;
|
||||
private String partitaMag;
|
||||
private String codJcom;
|
||||
private String datetimeRow;
|
||||
private String descrizioneArt;
|
||||
private String untMis;
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdUL setGestione(String gestione) {
|
||||
this.gestione = gestione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDataCollo() {
|
||||
return dataCollo;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdUL setDataCollo(String dataCollo) {
|
||||
this.dataCollo = dataCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumCollo() {
|
||||
return numCollo;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdUL setNumCollo(Integer numCollo) {
|
||||
this.numCollo = numCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSegno() {
|
||||
return segno;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdUL setSegno(String segno) {
|
||||
this.segno = segno;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdUL setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodCol() {
|
||||
return codCol;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdUL setCodCol(String codCol) {
|
||||
this.codCol = codCol;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodTagl() {
|
||||
return codTagl;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdUL setCodTagl(String codTagl) {
|
||||
this.codTagl = codTagl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJfas() {
|
||||
return codJfas;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdUL setCodJfas(String codJfas) {
|
||||
this.codJfas = codJfas;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizioneFase() {
|
||||
return descrizioneFase;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdUL setDescrizioneFase(String descrizioneFase) {
|
||||
this.descrizioneFase = descrizioneFase;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCol() {
|
||||
return qtaCol;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdUL setQtaCol(BigDecimal qtaCol) {
|
||||
this.qtaCol = qtaCol;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getNumCnf() {
|
||||
return numCnf;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdUL setNumCnf(BigDecimal numCnf) {
|
||||
this.numCnf = numCnf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdUL setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJcom() {
|
||||
return codJcom;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdUL setCodJcom(String codJcom) {
|
||||
this.codJcom = codJcom;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDatetimeRow() {
|
||||
return datetimeRow;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdUL setDatetimeRow(String datetimeRow) {
|
||||
this.datetimeRow = datetimeRow;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizioneArt() {
|
||||
return descrizioneArt;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdUL setDescrizioneArt(String descrizioneArt) {
|
||||
this.descrizioneArt = descrizioneArt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
public HistoryVersamentoProdUL setUntMis(String untMis) {
|
||||
this.untMis = untMis;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -1,23 +1,30 @@
|
||||
package it.integry.integrywmsnative.gest.prod_recupero_materiale.viewmodel;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.interfaces.IPoppableActivity;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityPosizione;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.FragmentProdRecuperoMaterialeBinding;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.core.HistoryULsListAdapter;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.core.ProdRecuperoMaterialeHelper;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdUL;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.views.InputQuantityToReturnDialog;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLU;
|
||||
@ -30,6 +37,9 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
private ProdRecuperoMaterialeHelper mHelper;
|
||||
private Runnable mOnRecuperoCompleted;
|
||||
|
||||
|
||||
private HistoryULsListAdapter mAdapter;
|
||||
|
||||
public ObservableField<MtbColt> mtbColt = new ObservableField<>();
|
||||
|
||||
|
||||
@ -39,7 +49,15 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
mHelper = helper;
|
||||
mOnRecuperoCompleted = onRecuperoCompleted;
|
||||
|
||||
BarcodeManager.enable();
|
||||
ProgressDialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
mHelper.loadLastULVersate(historyULs -> {
|
||||
progressDialog.dismiss();
|
||||
initRecyclerView(historyULs);
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
}
|
||||
|
||||
public void openLU() {
|
||||
@ -103,4 +121,13 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initRecyclerView(List<HistoryVersamentoProdUL> historyULs) {
|
||||
mAdapter = new HistoryULsListAdapter(mContext, historyULs);
|
||||
|
||||
mBinding.prodRecuperoMaterialeMainList.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
mBinding.prodRecuperoMaterialeMainList.setAdapter(mAdapter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ public class ProdVersamentoMaterialViewModel {
|
||||
((IPoppableActivity)mContext).pop();
|
||||
} else {
|
||||
|
||||
if (mtbDepoPosizione != null && mtbColt.get() != null) {
|
||||
if (mtbDepoPosizione != null && mtbDepoPosizione.isFlagLineaProduzione() && mtbColt.get() != null) {
|
||||
createColloScarico(mtbDepoPosizione);
|
||||
} else {
|
||||
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
||||
@ -98,6 +98,7 @@ public class ProdVersamentoMaterialViewModel {
|
||||
|
||||
MtbColt cloneUL = ((MtbColt) mtbColt.get().clone());
|
||||
cloneUL.setCodJfas(mtbDepoPosizione.getPosizione());
|
||||
cloneUL.setSerCollo(null);
|
||||
|
||||
ColliMagazzinoRESTConsumer.createColloScaricoDaCarico(cloneUL, mtbDepoPosizione, generatedMtbColt -> {
|
||||
showDataSavedDialog(() -> {
|
||||
|
||||
@ -40,6 +40,8 @@ public class PickingObjectDTO implements Parcelable {
|
||||
private BigDecimal numCnf;
|
||||
private String codAlis;
|
||||
private BigDecimal colliPedana;
|
||||
private BigDecimal qtaColloDisponibile;
|
||||
private BigDecimal numCnfColloDisponibile;
|
||||
|
||||
private MtbAart mtbAart;
|
||||
|
||||
@ -97,6 +99,16 @@ public class PickingObjectDTO implements Parcelable {
|
||||
} else {
|
||||
numCnfCollo = new BigDecimal(in.readFloat());
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
qtaColloDisponibile = null;
|
||||
} else {
|
||||
qtaColloDisponibile = new BigDecimal(in.readFloat());
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
numCnfColloDisponibile = null;
|
||||
} else {
|
||||
numCnfColloDisponibile = new BigDecimal(in.readFloat());
|
||||
}
|
||||
|
||||
|
||||
mtbAart = (MtbAart) in.readValue(MtbAart.class.getClassLoader());
|
||||
@ -166,6 +178,18 @@ public class PickingObjectDTO implements Parcelable {
|
||||
dest.writeByte((byte) (0x01));
|
||||
dest.writeFloat(numCnfCollo.floatValue());
|
||||
}
|
||||
if (qtaColloDisponibile == null) {
|
||||
dest.writeByte((byte) (0x00));
|
||||
} else {
|
||||
dest.writeByte((byte) (0x01));
|
||||
dest.writeFloat(qtaColloDisponibile.floatValue());
|
||||
}
|
||||
if (numCnfColloDisponibile == null) {
|
||||
dest.writeByte((byte) (0x00));
|
||||
} else {
|
||||
dest.writeByte((byte) (0x01));
|
||||
dest.writeFloat(numCnfColloDisponibile.floatValue());
|
||||
}
|
||||
|
||||
dest.writeValue(mtbAart);
|
||||
}
|
||||
@ -251,7 +275,7 @@ public class PickingObjectDTO implements Parcelable {
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCollo() {
|
||||
return qtaCollo;
|
||||
return qtaCollo != null ? qtaCollo : BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
public PickingObjectDTO setQtaCollo(BigDecimal qtaCollo) {
|
||||
@ -351,7 +375,7 @@ public class PickingObjectDTO implements Parcelable {
|
||||
}
|
||||
|
||||
public BigDecimal getQtaOrd() {
|
||||
return qtaOrd;
|
||||
return qtaOrd != null ? qtaOrd : BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
public PickingObjectDTO setQtaOrd(BigDecimal qtaOrd) {
|
||||
@ -395,6 +419,24 @@ public class PickingObjectDTO implements Parcelable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaColloDisponibile() {
|
||||
return qtaColloDisponibile;
|
||||
}
|
||||
|
||||
public PickingObjectDTO setQtaColloDisponibile(BigDecimal qtaColloDisponibile) {
|
||||
this.qtaColloDisponibile = qtaColloDisponibile;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getNumCnfColloDisponibile() {
|
||||
return numCnfColloDisponibile;
|
||||
}
|
||||
|
||||
public PickingObjectDTO setNumCnfColloDisponibile(BigDecimal numCnfColloDisponibile) {
|
||||
this.numCnfColloDisponibile = numCnfColloDisponibile;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbAart getMtbAart() {
|
||||
return mtbAart;
|
||||
}
|
||||
|
||||
@ -68,7 +68,8 @@
|
||||
android:iconifiedByDefault="true"
|
||||
app:defaultQueryHint="@string/search"
|
||||
app:iconifiedByDefault="true"
|
||||
android:layout_gravity="end"/>
|
||||
android:layout_gravity="end"
|
||||
android:tint="@android:color/black"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/main_filter"
|
||||
@ -79,7 +80,7 @@
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
android:src="@drawable/ic_search_black_24dp"
|
||||
android:tint="@color/colorPrimaryGray"/>
|
||||
android:tint="@android:color/black"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/main_select_all"
|
||||
@ -90,7 +91,7 @@
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
android:src="@drawable/ic_check_black_24dp"
|
||||
android:tint="@color/colorPrimaryGray"/>
|
||||
android:tint="@android:color/black"/>
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
|
||||
@ -6,12 +6,22 @@
|
||||
<data>
|
||||
|
||||
</data>
|
||||
<FrameLayout
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment">
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:background="@color/gray_200"
|
||||
android:id="@+id/prod_recupero_materiale_main_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
||||
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/white"
|
||||
android:layout_marginTop="16dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/cod_jfas"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="L1"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/gray_600"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"/>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</layout>
|
||||
108
app/src/main/res/layout/prod_recupero_materiale_list_item.xml
Normal file
108
app/src/main/res/layout/prod_recupero_materiale_list_item.xml
Normal file
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/white"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingBottom="4dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/left_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_toStartOf="@id/right_content"
|
||||
android:paddingEnd="8dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/num_collo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="22"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="22sp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/cod_mart"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
tools:text="150101-040"
|
||||
android:textColor="@android:color/black"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/partita_mag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/gray_700"
|
||||
tools:text="Lotto articolo"
|
||||
android:layout_marginStart="4dp"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/descrizione"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/gray_700"
|
||||
tools:text="Descrizione estesa articolo"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/right_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignTop="@id/left_content"
|
||||
android:layout_alignBottom="@id/left_content"
|
||||
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"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
tools:text="27"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/unt_mis_qta_versata"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:textSize="18sp"
|
||||
tools:text="PZ"/>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
||||
@ -43,6 +43,9 @@
|
||||
<color name="green_700">#388E3C</color>
|
||||
|
||||
|
||||
<color name="gray_100">#F5F5F5</color>
|
||||
<color name="gray_200">#eeeeee</color>
|
||||
<color name="gray_300">#e0e0e0</color>
|
||||
<color name="gray_400">#BDBDBD</color>
|
||||
<color name="gray_500">#9E9E9E</color>
|
||||
<color name="gray_600">#757575</color>
|
||||
|
||||
@ -40,7 +40,8 @@
|
||||
|
||||
<style name="AppTheme.NewMaterial.Text.ToolbarTitle" parent="AppTheme.NewMaterial.Text">
|
||||
<item name="android:textSize">20sp</item>
|
||||
<item name="android:textColor">#5F6368</item>
|
||||
<!--<item name="android:textColor">#5F6368</item>-->
|
||||
<item name="android:textColor">@android:color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.NewMaterial.Text.ListDivider" parent="AppTheme.NewMaterial.Text">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user