In accettazione bolla sitemato ordinamento righe e aggiunto controllo anomalie
This commit is contained in:
parent
2e37e874c3
commit
4d29e2ab41
@ -5,6 +5,7 @@ import android.content.Intent;
|
|||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.Html;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
|
|
||||||
@ -690,4 +691,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)
|
.setQtaCnf(qtaCnf)
|
||||||
.setNumCnf(numCnf)
|
.setNumCnf(numCnf)
|
||||||
.setPartitaMag(partitaMag)
|
.setPartitaMag(partitaMag)
|
||||||
// .setCodJcom(pickingObjectDTO.getSitBollaAccettazione().getCodJcom())
|
|
||||||
.setDataDoc(sitBolla != null ? sitBolla.getDataDoc() : firstAvailableBolla.getDataDoc())
|
.setDataDoc(sitBolla != null ? sitBolla.getDataDoc() : firstAvailableBolla.getDataDoc())
|
||||||
.setNumDoc(sitBolla != null ? sitBolla.getNumDoc() : firstAvailableBolla.getNumDoc())
|
.setNumDoc(sitBolla != null ? sitBolla.getNumDoc() : firstAvailableBolla.getNumDoc())
|
||||||
.setCodDtip(sitBolla != null ? sitBolla.getCodDtip() : firstAvailableBolla.getCodDtip())
|
.setCodDtip(sitBolla != null ? sitBolla.getCodDtip() : firstAvailableBolla.getCodDtip())
|
||||||
@ -662,7 +661,7 @@ public class AccettazioneBollaPickingViewModel {
|
|||||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||||
|
|
||||||
pickingObjectDTO.getWithdrawMtbColrs().add(insertedMtbColr);
|
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
|
//Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei
|
||||||
resetMatchedRows();
|
resetMatchedRows();
|
||||||
@ -801,21 +800,42 @@ public class AccettazioneBollaPickingViewModel {
|
|||||||
} else {
|
} else {
|
||||||
CloseUDCRequestDTO closeUDCRequestDTO = new CloseUDCRequestDTO()
|
CloseUDCRequestDTO closeUDCRequestDTO = new CloseUDCRequestDTO()
|
||||||
.setMtbColt(mCurrentMtbColt);
|
.setMtbColt(mCurrentMtbColt);
|
||||||
mColliCaricoRESTConsumer.closeUDC(closeUDCRequestDTO, closeUDCResponse -> {
|
|
||||||
|
|
||||||
Runnable onVersamentoCompleted = () -> {
|
ObservableArrayList<MtbColr> mtbColr = mCurrentMtbColt.getMtbColr();
|
||||||
managePrintCollo(this::postCloseOperations);
|
List<PickingObjectDTO> pickingList = getPickingList().getValue();
|
||||||
|
|
||||||
this.sendLUClosed();
|
int listCount = pickingList != null ? pickingList.size() : 0;
|
||||||
this.sendOnLoadingEnded();
|
int anomalie = listCount > 0 ? listCount - mtbColr.size() : 0;
|
||||||
};
|
|
||||||
|
|
||||||
manageVersamentoAutomatico(onVersamentoCompleted);
|
if (anomalie == 0){
|
||||||
}, this::sendError);
|
closeUdc(closeUDCRequestDTO);
|
||||||
|
} else {
|
||||||
|
onConfirmAnomalie(anomalie, canBeClose -> {
|
||||||
|
if (canBeClose) {
|
||||||
|
closeUdc(closeUDCRequestDTO);
|
||||||
|
} else {
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, this::sendError);
|
}, 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) {
|
private void manageVersamentoAutomatico(Runnable onComplete) {
|
||||||
|
|
||||||
if (!SettingsManager.iDB().isFlagAccettazioneBollaAskVersamentoAutomatico()) {
|
if (!SettingsManager.iDB().isFlagAccettazioneBollaAskVersamentoAutomatico()) {
|
||||||
@ -1038,6 +1058,9 @@ public class AccettazioneBollaPickingViewModel {
|
|||||||
return this;
|
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 {
|
public interface Listener extends ILoadingListener, ILUPrintListener, ILUBaseOperationsListener {
|
||||||
|
|
||||||
@ -1075,6 +1098,8 @@ public class AccettazioneBollaPickingViewModel {
|
|||||||
|
|
||||||
void onUnknownBarcodeScanned(String barcode, RunnableArgs<String> done, Runnable abort);
|
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.content.Context;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.os.Build;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import androidx.annotation.RequiresApi;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.core.content.res.ResourcesCompat;
|
import androidx.core.content.res.ResourcesCompat;
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
@ -17,7 +15,6 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
import com.zhukic.sectionedrecyclerview.SectionedRecyclerViewAdapter;
|
import com.zhukic.sectionedrecyclerview.SectionedRecyclerViewAdapter;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
@ -65,29 +62,10 @@ public class AccettazioneBollaPickingListAdapter extends SectionedRecyclerViewAd
|
|||||||
this.mShowSecondaryUntMis = showSecondaryUntMis;
|
this.mShowSecondaryUntMis = showSecondaryUntMis;
|
||||||
|
|
||||||
mutableDataSet.addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
mutableDataSet.addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
||||||
@RequiresApi(api = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
|
|
||||||
@Override
|
@Override
|
||||||
public void onChanged(ObservableList sender) {
|
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.clear();
|
||||||
mDataset.addAll(listaOrdinata);
|
mDataset.addAll(sender);
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
notifyDataChanged();
|
notifyDataChanged();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,13 +12,10 @@ import it.integry.integrywmsnative.core.model.observable.ObservableMtbTcol;
|
|||||||
|
|
||||||
public class BottomSheetFragmentLUContentViewModel {
|
public class BottomSheetFragmentLUContentViewModel {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public ObservableField<MtbColt> mtbColt = new ObservableField<>();
|
public ObservableField<MtbColt> mtbColt = new ObservableField<>();
|
||||||
public ObservableField<String> pesoKg = new ObservableField<>();
|
public ObservableField<String> pesoKg = new ObservableField<>();
|
||||||
public ObservableField<String> pesoNettoKg = new ObservableField<>();
|
public ObservableField<String> pesoNettoKg = new ObservableField<>();
|
||||||
private Listener mListener;
|
private Listener mListener;
|
||||||
private MtbColrListener mMtbColrListener;
|
|
||||||
|
|
||||||
public void closeCurrentLU() {
|
public void closeCurrentLU() {
|
||||||
if (this.mListener != null) this.mListener.onBottomSheetLUClose();
|
if (this.mListener != null) this.mListener.onBottomSheetLUClose();
|
||||||
@ -42,11 +39,6 @@ public class BottomSheetFragmentLUContentViewModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BottomSheetFragmentLUContentViewModel setMtbColrListener(MtbColrListener mtbColrListener) {
|
|
||||||
this.mMtbColrListener = mtbColrListener;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void refreshPesi() {
|
public void refreshPesi() {
|
||||||
MtbColt collo = this.mtbColt.get();
|
MtbColt collo = this.mtbColt.get();
|
||||||
if (collo == null) return;
|
if (collo == null) return;
|
||||||
@ -77,8 +69,4 @@ public class BottomSheetFragmentLUContentViewModel {
|
|||||||
|
|
||||||
void onBottomSheetLUClose();
|
void onBottomSheetLUClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface MtbColrListener {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -217,6 +217,7 @@
|
|||||||
<string name="settings_category">Impostazioni</string>
|
<string name="settings_category">Impostazioni</string>
|
||||||
<string name="check_box_preference_title">Check box</string>
|
<string name="check_box_preference_title">Check box</string>
|
||||||
<string name="check_box_preference_summary">This is a regular preference</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_UL">Stai per eliminare una UL. Confermi?</string>
|
||||||
<string name="alert_delete_mtb_colr">Stai per eliminare una riga. 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="settings_category">Settings</string>
|
||||||
<string name="check_box_preference_title">Check box</string>
|
<string name="check_box_preference_title">Check box</string>
|
||||||
<string name="check_box_preference_summary">This is a regular preference</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_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>
|
<string name="alert_delete_mtb_colr">Are you sure to delete? Please confirm</string>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user