Merge branch 'feature/FastPickingSpedizione' into master-beta

This commit is contained in:
2025-03-27 10:35:52 +01:00
11 changed files with 65 additions and 65 deletions

View File

@@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
android {
def appVersionCode = 484
def appVersionName = '1.45.02'
def appVersionCode = 487
def appVersionName = '1.45.05'
signingConfigs {
release {

View File

@@ -3,6 +3,6 @@ package it.integry.integrywmsnative.core.exception;
public class InvalidCodMdepBarcodeException extends RuntimeException {
public InvalidCodMdepBarcodeException(String message) {
super(message);
super("Il deposito scansionato non è valido: " + message);
}
}

View File

@@ -13,7 +13,7 @@ import retrofit2.http.Query;
public interface GiacenzaPvRESTConsumerService {
@GET("giacenza/retrieve")
@GET("wms/pv/verifica_giacenze/retrieve")
Call<ServiceRESTResponse<List<GiacenzaPvDTO>>> retrieve(@Query("codMdep") String codMdep);

View File

@@ -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");
}
}

View File

@@ -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);
}
}

View File

@@ -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();
}

View File

@@ -141,13 +141,6 @@ public class VerificaGiacenzeFragment extends BaseFragment implements ITitledFra
this.initRecyclerView();
this.initBarcodeReader();
this.onLoadingStarted();
executorService.execute(() -> {
mViewModel.randomizeElements(2000);
this.onLoadingEnded();
});
});
}

View File

@@ -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 {
}
}

View File

@@ -9,6 +9,8 @@ import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
import it.integry.integrywmsnative.core.exception.InvalidCodMdepBarcodeException;
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
import it.integry.integrywmsnative.core.utility.UtilityString;
@@ -17,7 +19,7 @@ public class DialogAskDepositoViewModel {
Handler handler;
BarcodeRESTConsumer barcodeRESTConsumer;
private MutableLiveData<String> codMdep = new MutableLiveData<>();
private final MutableLiveData<String> codMdep = new MutableLiveData<>();
private Listener listener;
public DialogAskDepositoViewModel(Handler handler, BarcodeRESTConsumer barcodeRESTConsumer) {
@@ -45,14 +47,14 @@ public class DialogAskDepositoViewModel {
throw new InvalidCodMdepBarcodeException(barcodeScanDTO.getStringValue());
}
// AvailableCodMdepsDTO availableCodMdepsDTO = SettingsManager.iDB().getAvailableCodMdep().stream()
// .filter(x -> x.getCodMdep().equalsIgnoreCase(ean128Model.Internal4))
// .findFirst()
// .orElse(null);
//
// if (availableCodMdepsDTO == null) {
// throw new InvalidCodMdepBarcodeException(barcodeScanDTO.getStringValue());
// }
AvailableCodMdepsDTO availableCodMdepsDTO = SettingsManager.iDB().getAvailableCodMdep().stream()
.filter(x -> x.getCodMdep().equalsIgnoreCase(ean128Model.Internal4))
.findFirst()
.orElse(null);
if (availableCodMdepsDTO == null) {
throw new InvalidCodMdepBarcodeException(ean128Model.Internal4);
}
handler.post(() -> {
this.codMdep.setValue(ean128Model.Internal4);

View File

@@ -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>

View File

@@ -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>