Cambiata lettura barcode in Versamento su Ordine
This commit is contained in:
parent
d4c7cdf400
commit
392dd18338
@ -328,13 +328,13 @@ public class Ean128Model {
|
||||
public String InternalPart;
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal1;
|
||||
public String Internal1; //Cod-Mart
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal2;
|
||||
public String Internal2; //IDLotto
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal3;
|
||||
public String Internal3; //Cod-Jfas
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal4;
|
||||
|
||||
@ -14,6 +14,7 @@ public class CreateUDSRequestDTO {
|
||||
private String codAnag;
|
||||
private String codVdes;
|
||||
private String rifOrd;
|
||||
private Integer idLotto;
|
||||
private boolean orderRequired;
|
||||
private List<CreateUDSRequestOrderDTO> orders;
|
||||
|
||||
@ -125,6 +126,14 @@ public class CreateUDSRequestDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getIdLotto() {
|
||||
return idLotto;
|
||||
}
|
||||
|
||||
public CreateUDSRequestDTO setIdLotto(Integer idLotto) {
|
||||
this.idLotto = idLotto;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public static class Causale {
|
||||
|
||||
@ -55,6 +55,7 @@ import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalView;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteView;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.DialogAskLineaProdView;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.dto.DialogAskLineaProdResponse;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_mtbcolr_list.DialogChooseArtsFromMtbColrList;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||
@ -297,7 +298,7 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLULineaProdRequired(RunnableArgs<String> onComplete, Runnable onAbort) {
|
||||
public void onLULineaProdRequired(RunnableArgs<DialogAskLineaProdResponse> onComplete, Runnable onAbort) {
|
||||
DialogAskLineaProdView.newInstance(onComplete, onAbort)
|
||||
.show(getParentFragmentManager(), DialogAskLineaProdView.class.getName());
|
||||
}
|
||||
|
||||
@ -55,6 +55,7 @@ import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.dto.DialogAskLineaProdResponse;
|
||||
|
||||
public class PickingLiberoViewModel {
|
||||
|
||||
@ -324,17 +325,18 @@ public class PickingLiberoViewModel {
|
||||
|
||||
private void createNewLU_PostClienteAsk(Integer customNumCollo, String customSerCollo, VtbDest vtbDest, Runnable onComplete) {
|
||||
if (this.mFlagAskLineaProd) {
|
||||
this.sendLULineaProdRequired(codJfas -> {
|
||||
createNewLU_PostLineaProdAsk(customNumCollo, customSerCollo, vtbDest, codJfas, onComplete);
|
||||
}, () -> {
|
||||
this.sendLULineaProdRequired(response -> {
|
||||
createNewLU_PostLineaProdAsk(customNumCollo, customSerCollo, vtbDest, response.getPosizione(), response.getIdLotto(), onComplete);
|
||||
|
||||
}, () -> {
|
||||
this.sendOnLoadingEnded();
|
||||
});
|
||||
} else {
|
||||
createNewLU_PostLineaProdAsk(customNumCollo, customSerCollo, vtbDest, null, onComplete);
|
||||
createNewLU_PostLineaProdAsk(customNumCollo, customSerCollo, vtbDest, null, null, onComplete);
|
||||
}
|
||||
}
|
||||
|
||||
private void createNewLU_PostLineaProdAsk(Integer customNumCollo, String customSerCollo, VtbDest vtbDest, String codJfas, Runnable onComplete) {
|
||||
private void createNewLU_PostLineaProdAsk(Integer customNumCollo, String customSerCollo, VtbDest vtbDest, String codJfas, Integer idLotto, Runnable onComplete) {
|
||||
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
@ -342,6 +344,7 @@ public class PickingLiberoViewModel {
|
||||
.setRifOrd(mDefaultGestione == GestioneEnum.LAVORAZIONE ? "PICKING LIBERO" : null)
|
||||
.setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep())
|
||||
.setCausaleCollo(CreateUDSRequestDTO.Causale.SCARICO)
|
||||
.setIdLotto(idLotto)
|
||||
.setOrderRequired(mFlagAskLineaProd);
|
||||
|
||||
if (customNumCollo != null) {
|
||||
@ -948,7 +951,7 @@ public class PickingLiberoViewModel {
|
||||
if (this.mListener != null) mListener.onLUClienteRequired(onComplete, onAbort);
|
||||
}
|
||||
|
||||
private void sendLULineaProdRequired(RunnableArgs<String> onComplete, Runnable onAbort) {
|
||||
private void sendLULineaProdRequired(RunnableArgs<DialogAskLineaProdResponse> onComplete, Runnable onAbort) {
|
||||
if (this.mListener != null) mListener.onLULineaProdRequired(onComplete, onAbort);
|
||||
}
|
||||
|
||||
@ -1008,7 +1011,7 @@ public class PickingLiberoViewModel {
|
||||
|
||||
void onLUClienteRequired(RunnableArgss<VtbDest, String> onComplete, Runnable onAbort);
|
||||
|
||||
void onLULineaProdRequired(RunnableArgs<String> onComplete, Runnable onAbort);
|
||||
void onLULineaProdRequired(RunnableArgs<DialogAskLineaProdResponse> onComplete, Runnable onAbort);
|
||||
|
||||
void onArtSelectionRequest(List<MtbColr> mtbColrsToPick, MtbAart mtbAart, RunnableArgs<List<MtbColr>> onComplete, Runnable onAbort);
|
||||
|
||||
|
||||
@ -2,13 +2,14 @@ package it.integry.integrywmsnative.view.dialogs.ask_linea_prod;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
|
||||
@Module(subcomponents = DialogAskLineaProdComponent.class)
|
||||
public class DialogAskLineaProdModule {
|
||||
|
||||
@Provides
|
||||
DialogAskLineaProdViewModel providesDialogAskLineaProdViewModel() {
|
||||
return new DialogAskLineaProdViewModel();
|
||||
DialogAskLineaProdViewModel providesDialogAskLineaProdViewModel(BarcodeRESTConsumer barcodeRESTConsumer) {
|
||||
return new DialogAskLineaProdViewModel(barcodeRESTConsumer);
|
||||
}
|
||||
|
||||
}
|
||||
@ -21,13 +21,14 @@ import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.databinding.DialogAskLineaProdBinding;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.dto.DialogAskLineaProdResponse;
|
||||
|
||||
public class DialogAskLineaProdView extends BaseDialogFragment implements DialogAskLineaProdViewModel.Listener {
|
||||
|
||||
@Inject
|
||||
DialogAskLineaProdViewModel mViewModel;
|
||||
|
||||
private final RunnableArgs<String> onComplete;
|
||||
private final RunnableArgs<DialogAskLineaProdResponse> onComplete;
|
||||
private final Runnable onAbort;
|
||||
|
||||
private DialogAskLineaProdBinding mBindings;
|
||||
@ -37,11 +38,11 @@ public class DialogAskLineaProdView extends BaseDialogFragment implements Dialog
|
||||
private int mBarcodeScannerIstanceID;
|
||||
|
||||
//Pass here all external parameters
|
||||
public static DialogAskLineaProdView newInstance(RunnableArgs<String> onComplete, Runnable onAbort) {
|
||||
public static DialogAskLineaProdView newInstance(RunnableArgs<DialogAskLineaProdResponse> onComplete, Runnable onAbort) {
|
||||
return new DialogAskLineaProdView(onComplete, onAbort);
|
||||
}
|
||||
|
||||
private DialogAskLineaProdView(RunnableArgs<String> onComplete, Runnable onAbort) {
|
||||
private DialogAskLineaProdView(RunnableArgs<DialogAskLineaProdResponse> onComplete, Runnable onAbort) {
|
||||
super();
|
||||
this.onComplete = onComplete;
|
||||
this.onAbort = onAbort;
|
||||
@ -101,8 +102,8 @@ public class DialogAskLineaProdView extends BaseDialogFragment implements Dialog
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onProductionLineSelected(String codJfas) {
|
||||
this.onComplete.run(codJfas);
|
||||
public void onProductionLineSelected(DialogAskLineaProdResponse response) {
|
||||
this.onComplete.run(response);
|
||||
|
||||
requireActivity().runOnUiThread(this::dismiss);
|
||||
}
|
||||
|
||||
@ -1,20 +1,73 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.ask_linea_prod;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.exception.InvalidLineaProdBarcodeException;
|
||||
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityPosizione;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.dto.DialogAskLineaProdResponse;
|
||||
|
||||
public class DialogAskLineaProdViewModel {
|
||||
|
||||
private Listener mListener;
|
||||
|
||||
public void processBarcodeDTO(BarcodeScanDTO data, Runnable onComplete) {
|
||||
if (UtilityBarcode.isEtichettaPosizione(data)) {
|
||||
private final BarcodeRESTConsumer barcodeRESTConsumer;
|
||||
|
||||
@Inject
|
||||
public DialogAskLineaProdViewModel(BarcodeRESTConsumer barcodeRESTConsumer) {
|
||||
this.barcodeRESTConsumer = barcodeRESTConsumer;
|
||||
}
|
||||
|
||||
|
||||
public void processBarcodeDTO(BarcodeScanDTO data, Runnable onComplete) {
|
||||
if (UtilityBarcode.isEtichetta128(data)) {
|
||||
this.executeEtichettaEan128(data, onComplete);
|
||||
} else if (UtilityBarcode.isEtichettaPosizione(data)) {
|
||||
executeEtichettaPosizione(data, onComplete);
|
||||
} else {
|
||||
this.sendError(new NoResultFromBarcodeException());
|
||||
onComplete.run();
|
||||
}
|
||||
}
|
||||
|
||||
private void executeEtichettaEan128(BarcodeScanDTO data, Runnable onComplete) {
|
||||
this.barcodeRESTConsumer.decodeEan128(data, ean128Model -> {
|
||||
|
||||
if (UtilityString.isNullOrEmpty(ean128Model.Internal2)) {
|
||||
this.sendError(new InvalidLineaProdBarcodeException("Id lotto non presente"));
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
if (UtilityString.isNullOrEmpty(ean128Model.Internal3)) {
|
||||
this.sendError(new InvalidLineaProdBarcodeException("Fase non presente"));
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
MtbDepoPosizione foundPosizione = UtilityPosizione.getFromCache(ean128Model.Internal3);
|
||||
|
||||
if (foundPosizione == null || !foundPosizione.isFlagLineaProduzione()) {
|
||||
this.sendError(new InvalidLineaProdBarcodeException(ean128Model.Internal3));
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
onComplete.run();
|
||||
this.sendOnProductionLineSelected(
|
||||
new DialogAskLineaProdResponse(foundPosizione.getPosizione(), Integer.parseInt(ean128Model.Internal2)));
|
||||
|
||||
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
private void executeEtichettaPosizione(BarcodeScanDTO data, Runnable onComplete) {
|
||||
MtbDepoPosizione foundPosizione = UtilityPosizione.getFromCache(data.getStringValue());
|
||||
|
||||
if (foundPosizione == null || !foundPosizione.isFlagLineaProduzione()) {
|
||||
@ -24,13 +77,9 @@ public class DialogAskLineaProdViewModel {
|
||||
}
|
||||
|
||||
onComplete.run();
|
||||
this.sendOnProductionLineSelected(foundPosizione.getPosizione());
|
||||
this.sendOnProductionLineSelected(new DialogAskLineaProdResponse(foundPosizione.getPosizione(), null));
|
||||
}
|
||||
|
||||
} else {
|
||||
this.sendError(new NoResultFromBarcodeException());
|
||||
onComplete.run();
|
||||
}
|
||||
}
|
||||
|
||||
public DialogAskLineaProdViewModel setListener(Listener listener) {
|
||||
this.mListener = listener;
|
||||
@ -45,8 +94,8 @@ public class DialogAskLineaProdViewModel {
|
||||
if (this.mListener != null) mListener.onLoadingEnded();
|
||||
}
|
||||
|
||||
private void sendOnProductionLineSelected(String codJfas) {
|
||||
if (this.mListener != null) mListener.onProductionLineSelected(codJfas);
|
||||
private void sendOnProductionLineSelected(DialogAskLineaProdResponse response) {
|
||||
if (this.mListener != null) mListener.onProductionLineSelected(response);
|
||||
}
|
||||
|
||||
private void sendError(Exception ex) {
|
||||
@ -55,6 +104,7 @@ public class DialogAskLineaProdViewModel {
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
void onError(Exception ex);
|
||||
void onProductionLineSelected(String codJfas);
|
||||
|
||||
void onProductionLineSelected(DialogAskLineaProdResponse response);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.ask_linea_prod.dto;
|
||||
|
||||
public class DialogAskLineaProdResponse {
|
||||
|
||||
|
||||
private String posizione;
|
||||
private final Integer idLotto;
|
||||
|
||||
|
||||
public DialogAskLineaProdResponse(String posizione, Integer idLotto) {
|
||||
this.posizione = posizione;
|
||||
this.idLotto = idLotto;
|
||||
}
|
||||
|
||||
public String getPosizione() {
|
||||
return posizione;
|
||||
}
|
||||
|
||||
public Integer getIdLotto() {
|
||||
return idLotto;
|
||||
}
|
||||
|
||||
}
|
||||
@ -42,11 +42,12 @@
|
||||
|
||||
|
||||
|
||||
<ProgressBar
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/progressBar"
|
||||
style="?android:attr/progressBarStyle"
|
||||
style="?attr/circularProgressIndicatorStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user