Merge branch 'develop' into feature/FastPickingSpedizione
This commit is contained in:
commit
26512f5dc1
@ -5,6 +5,7 @@ import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
import android.view.Gravity;
|
||||
|
||||
@ -695,4 +696,15 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmAnomalie(int anomalie, RunnableArgs<Boolean> onConfirm) {
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(Html.fromHtml(String.format(getString(R.string.confirm_anomalie), anomalie))),
|
||||
null, () -> {
|
||||
onConfirm.run(true);
|
||||
}, () -> {
|
||||
onConfirm.run(false);
|
||||
})
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
}
|
||||
@ -643,7 +643,6 @@ public class AccettazioneBollaPickingViewModel {
|
||||
.setQtaCnf(qtaCnf)
|
||||
.setNumCnf(numCnf)
|
||||
.setPartitaMag(partitaMag)
|
||||
// .setCodJcom(pickingObjectDTO.getSitBollaAccettazione().getCodJcom())
|
||||
.setDataDoc(sitBolla != null ? sitBolla.getDataDoc() : firstAvailableBolla.getDataDoc())
|
||||
.setNumDoc(sitBolla != null ? sitBolla.getNumDoc() : firstAvailableBolla.getNumDoc())
|
||||
.setCodDtip(sitBolla != null ? sitBolla.getCodDtip() : firstAvailableBolla.getCodDtip())
|
||||
@ -662,7 +661,7 @@ public class AccettazioneBollaPickingViewModel {
|
||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||
|
||||
pickingObjectDTO.getWithdrawMtbColrs().add(insertedMtbColr);
|
||||
mCurrentMtbColt.getMtbColr().add(insertedMtbColr);
|
||||
mCurrentMtbColt.getMtbColr().add(0, insertedMtbColr);
|
||||
|
||||
//Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei
|
||||
resetMatchedRows();
|
||||
@ -803,21 +802,42 @@ public class AccettazioneBollaPickingViewModel {
|
||||
} else {
|
||||
CloseUDCRequestDTO closeUDCRequestDTO = new CloseUDCRequestDTO()
|
||||
.setMtbColt(mCurrentMtbColt);
|
||||
mColliCaricoRESTConsumer.closeUDC(closeUDCRequestDTO, closeUDCResponse -> {
|
||||
|
||||
Runnable onVersamentoCompleted = () -> {
|
||||
managePrintCollo(this::postCloseOperations);
|
||||
ObservableArrayList<MtbColr> mtbColr = mCurrentMtbColt.getMtbColr();
|
||||
List<PickingObjectDTO> pickingList = getPickingList().getValue();
|
||||
|
||||
this.sendLUClosed();
|
||||
this.sendOnLoadingEnded();
|
||||
};
|
||||
int listCount = pickingList != null ? pickingList.size() : 0;
|
||||
int anomalie = listCount > 0 ? listCount - mtbColr.size() : 0;
|
||||
|
||||
manageVersamentoAutomatico(onVersamentoCompleted);
|
||||
}, this::sendError);
|
||||
if (anomalie == 0){
|
||||
closeUdc(closeUDCRequestDTO);
|
||||
} else {
|
||||
onConfirmAnomalie(anomalie, canBeClose -> {
|
||||
if (canBeClose) {
|
||||
closeUdc(closeUDCRequestDTO);
|
||||
} else {
|
||||
this.sendOnLoadingEnded();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
private void closeUdc(CloseUDCRequestDTO closeUDCRequestDTO){
|
||||
mColliCaricoRESTConsumer.closeUDC(closeUDCRequestDTO, closeUDCResponse -> {
|
||||
|
||||
Runnable onVersamentoCompleted = () -> {
|
||||
managePrintCollo(this::postCloseOperations);
|
||||
|
||||
this.sendLUClosed();
|
||||
this.sendOnLoadingEnded();
|
||||
};
|
||||
|
||||
manageVersamentoAutomatico(onVersamentoCompleted);
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
private void manageVersamentoAutomatico(Runnable onComplete) {
|
||||
|
||||
if (!SettingsManager.iDB().isFlagAccettazioneBollaAskVersamentoAutomatico()) {
|
||||
@ -1040,6 +1060,9 @@ public class AccettazioneBollaPickingViewModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
private void onConfirmAnomalie(int anomalie, RunnableArgs<Boolean> onConfirm){
|
||||
if (this.mListener != null) mListener.onConfirmAnomalie(anomalie, onConfirm);
|
||||
}
|
||||
|
||||
public interface Listener extends ILoadingListener, ILUPrintListener, ILUBaseOperationsListener {
|
||||
|
||||
@ -1077,6 +1100,8 @@ public class AccettazioneBollaPickingViewModel {
|
||||
|
||||
void onUnknownBarcodeScanned(String barcode, RunnableArgs<String> done, Runnable abort);
|
||||
|
||||
void onConfirmAnomalie(int anomalie, RunnableArgs<Boolean> onConfirm);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,12 +2,10 @@ package it.integry.integrywmsnative.gest.accettazione_bolla_picking.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
@ -17,7 +15,6 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.zhukic.sectionedrecyclerview.SectionedRecyclerViewAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
@ -65,29 +62,10 @@ public class AccettazioneBollaPickingListAdapter extends SectionedRecyclerViewAd
|
||||
this.mShowSecondaryUntMis = showSecondaryUntMis;
|
||||
|
||||
mutableDataSet.addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
||||
@RequiresApi(api = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
|
||||
@Override
|
||||
public void onChanged(ObservableList sender) {
|
||||
List<AccettazioneBollaPickingListModel> listaOrdinata = new ArrayList<>();
|
||||
if (!sender.isEmpty()) {
|
||||
listaOrdinata = new ArrayList<>(sender);
|
||||
|
||||
Collections.sort(listaOrdinata, (a, b) -> {
|
||||
|
||||
boolean condA = a.getQtaEvasa().floatValue() > 0;
|
||||
boolean condB = b.getQtaEvasa().floatValue() > 0;
|
||||
|
||||
if (condA && !condB) {
|
||||
return -1;
|
||||
} else if (!condA && condB) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
mDataset.clear();
|
||||
mDataset.addAll(listaOrdinata);
|
||||
mDataset.addAll(sender);
|
||||
notifyDataSetChanged();
|
||||
notifyDataChanged();
|
||||
}
|
||||
|
||||
@ -12,13 +12,10 @@ import it.integry.integrywmsnative.core.model.observable.ObservableMtbTcol;
|
||||
|
||||
public class BottomSheetFragmentLUContentViewModel {
|
||||
|
||||
|
||||
|
||||
public ObservableField<MtbColt> mtbColt = new ObservableField<>();
|
||||
public ObservableField<String> pesoKg = new ObservableField<>();
|
||||
public ObservableField<String> pesoNettoKg = new ObservableField<>();
|
||||
private Listener mListener;
|
||||
private MtbColrListener mMtbColrListener;
|
||||
|
||||
public void closeCurrentLU() {
|
||||
if (this.mListener != null) this.mListener.onBottomSheetLUClose();
|
||||
@ -42,11 +39,6 @@ public class BottomSheetFragmentLUContentViewModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public BottomSheetFragmentLUContentViewModel setMtbColrListener(MtbColrListener mtbColrListener) {
|
||||
this.mMtbColrListener = mtbColrListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void refreshPesi() {
|
||||
MtbColt collo = this.mtbColt.get();
|
||||
if (collo == null) return;
|
||||
@ -77,8 +69,4 @@ public class BottomSheetFragmentLUContentViewModel {
|
||||
|
||||
void onBottomSheetLUClose();
|
||||
}
|
||||
|
||||
public interface MtbColrListener {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -217,6 +217,7 @@
|
||||
<string name="settings_category">Impostazioni</string>
|
||||
<string name="check_box_preference_title">Check box</string>
|
||||
<string name="check_box_preference_summary">This is a regular preference</string>
|
||||
<string name="confirm_anomalie"><![CDATA[Sono state riscontrate <b>%d</b> anomalie. Continuare?]]></string>
|
||||
|
||||
<string name="alert_delete_UL">Stai per eliminare una UL. Confermi?</string>
|
||||
<string name="alert_delete_mtb_colr">Stai per eliminare una riga. Confermi?</string>
|
||||
|
||||
@ -216,6 +216,7 @@
|
||||
<string name="settings_category">Settings</string>
|
||||
<string name="check_box_preference_title">Check box</string>
|
||||
<string name="check_box_preference_summary">This is a regular preference</string>
|
||||
<string name="confirm_anomalie"><![CDATA[<b>%d</b> anomalies were found. To continue?]]></string>
|
||||
|
||||
<string name="alert_delete_UL">Are you sure you want to delete this UL? Please confirm</string>
|
||||
<string name="alert_delete_mtb_colr">Are you sure to delete? Please confirm</string>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user