Completato refactoring del dialog ask cliente
This commit is contained in:
parent
90985b899b
commit
9765fe1807
@ -65,6 +65,8 @@ import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviForn
|
|||||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreModule;
|
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreModule;
|
||||||
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceComponent;
|
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceComponent;
|
||||||
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceModule;
|
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceModule;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteComponent;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteModule;
|
||||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsComponent;
|
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsComponent;
|
||||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsModule;
|
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsModule;
|
||||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotComponent;
|
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotComponent;
|
||||||
@ -119,7 +121,8 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
|||||||
DocInterniModule.class,
|
DocInterniModule.class,
|
||||||
DialogSelectDocInfoModule.class,
|
DialogSelectDocInfoModule.class,
|
||||||
DocInterniEditFormModule.class,
|
DocInterniEditFormModule.class,
|
||||||
DialogSelectDocRowsModule.class
|
DialogSelectDocRowsModule.class,
|
||||||
|
DialogAskClienteModule.class
|
||||||
})
|
})
|
||||||
public interface MainApplicationComponent {
|
public interface MainApplicationComponent {
|
||||||
|
|
||||||
@ -161,6 +164,8 @@ public interface MainApplicationComponent {
|
|||||||
|
|
||||||
OrdiniUscitaElencoComponent.Factory prodOrdineLavorazioneElencoComponent();
|
OrdiniUscitaElencoComponent.Factory prodOrdineLavorazioneElencoComponent();
|
||||||
|
|
||||||
|
DialogAskClienteComponent.Factory dialogAskClienteComponent();
|
||||||
|
|
||||||
DialogInputQuantityV2Component.Factory dialogInputQuantityV2Component();
|
DialogInputQuantityV2Component.Factory dialogInputQuantityV2Component();
|
||||||
|
|
||||||
DialogInputLUProdComponent.Factory dialogInputLUProdComponent();
|
DialogInputLUProdComponent.Factory dialogInputLUProdComponent();
|
||||||
|
|||||||
@ -31,6 +31,7 @@ import it.integry.integrywmsnative.core.update.UpdatesManager;
|
|||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
public class MainApplicationModule {
|
public class MainApplicationModule {
|
||||||
@ -85,6 +86,12 @@ public class MainApplicationModule {
|
|||||||
return DialogProgressView.newInstance();
|
return DialogProgressView.newInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
DialogInputQuantityV2View providesDialogInputQuantityV2View() {
|
||||||
|
return new DialogInputQuantityV2View();
|
||||||
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
OrdiniRESTConsumer provideOrdiniRESTConsumer(SystemRESTConsumer systemRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
OrdiniRESTConsumer provideOrdiniRESTConsumer(SystemRESTConsumer systemRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
||||||
|
|||||||
@ -85,6 +85,9 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
@Inject
|
@Inject
|
||||||
AccettazionePickingViewModel mViewModel;
|
AccettazionePickingViewModel mViewModel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||||
|
|
||||||
private final AccettazionePickingFiltroOrdineViewModel mAppliedFilterViewModel = new AccettazionePickingFiltroOrdineViewModel();
|
private final AccettazionePickingFiltroOrdineViewModel mAppliedFilterViewModel = new AccettazionePickingFiltroOrdineViewModel();
|
||||||
|
|
||||||
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
||||||
@ -833,8 +836,9 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
.setCanLUBeClosed(true)
|
.setCanLUBeClosed(true)
|
||||||
.setCanOverflowOrderQuantity(canOverflowQuantity);
|
.setCanOverflowOrderQuantity(canOverflowQuantity);
|
||||||
|
|
||||||
DialogInputQuantityV2View
|
mDialogInputQuantityV2View
|
||||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
.setQtaCnf(resultDTO.getQtaCnf())
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
@ -842,9 +846,8 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
.setPartitaMag(resultDTO.getPartitaMag())
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
.setDataScad(resultDTO.getDataScad());
|
.setDataScad(resultDTO.getDataScad());
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
}, () -> {
|
|
||||||
this.mViewModel.resetMatchedRows();
|
|
||||||
})
|
})
|
||||||
|
.setOnAbort(() -> this.mViewModel.resetMatchedRows())
|
||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -55,9 +55,13 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
MtbColrRepository documentRowsRepository;
|
MtbColrRepository documentRowsRepository;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
DocInterniEditFormViewModel viewModel;
|
DocInterniEditFormViewModel viewModel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View dialogInputQuantityV2View;
|
||||||
|
|
||||||
|
|
||||||
private int mBarcodeScannerIstanceID;
|
private int mBarcodeScannerIstanceID;
|
||||||
private ActivityContabDocInterniEditBinding binding;
|
private ActivityContabDocInterniEditBinding binding;
|
||||||
@ -245,11 +249,12 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
}
|
}
|
||||||
return partitaMag;
|
return partitaMag;
|
||||||
});
|
});
|
||||||
DialogInputQuantityV2View
|
dialogInputQuantityV2View.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
this.onLoadingStarted();
|
this.onLoadingStarted();
|
||||||
this.viewModel.saveRow(row, resultDTO);
|
this.viewModel.saveRow(row, resultDTO);
|
||||||
}, this::onLoadingEnded)
|
})
|
||||||
|
.setOnAbort(this::onLoadingEnded)
|
||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -69,6 +69,9 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
@Inject
|
@Inject
|
||||||
PickingLiberoViewModel mViewModel;
|
PickingLiberoViewModel mViewModel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||||
|
|
||||||
public BindableBoolean thereIsAnOpenedUL = new BindableBoolean(false);
|
public BindableBoolean thereIsAnOpenedUL = new BindableBoolean(false);
|
||||||
public BindableBoolean thereIsntAnOpenedUL = new BindableBoolean(true);
|
public BindableBoolean thereIsntAnOpenedUL = new BindableBoolean(true);
|
||||||
public BindableBoolean thereIsAnyRowInUL = new BindableBoolean(false);
|
public BindableBoolean thereIsAnyRowInUL = new BindableBoolean(false);
|
||||||
@ -334,8 +337,8 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||||
.setCanLUBeClosed(canLUBeClosed);
|
.setCanLUBeClosed(canLUBeClosed);
|
||||||
|
|
||||||
DialogInputQuantityV2View
|
mDialogInputQuantityV2View.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
.setQtaCnf(resultDTO.getQtaCnf())
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
@ -345,15 +348,14 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
|
|
||||||
this.openProgress();
|
this.openProgress();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
}, () -> {
|
|
||||||
this.closeProgress();
|
|
||||||
})
|
})
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.setOnAbort(this::closeProgress)
|
||||||
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRowSaved() {
|
public void onRowSaved() {
|
||||||
getActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
FBToast.successToast(getActivity(), getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
FBToast.successToast(getActivity(), getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,6 +64,9 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
@Inject
|
@Inject
|
||||||
PickingResiViewModel mViewmodel;
|
PickingResiViewModel mViewmodel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||||
|
|
||||||
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
||||||
|
|
||||||
private ObservableArrayList<PickingResiListModel> mPickingResiMutableData = new ObservableArrayList<>();
|
private ObservableArrayList<PickingResiListModel> mPickingResiMutableData = new ObservableArrayList<>();
|
||||||
@ -319,8 +322,9 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
.setCanLUBeClosed(false)
|
.setCanLUBeClosed(false)
|
||||||
.setCanPartitaMagBeChanged(false);
|
.setCanPartitaMagBeChanged(false);
|
||||||
|
|
||||||
DialogInputQuantityV2View
|
mDialogInputQuantityV2View
|
||||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
.setQtaCnf(resultDTO.getQtaCnf())
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
@ -330,7 +334,8 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
|
|
||||||
this.openProgress();
|
this.openProgress();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
}, () -> {
|
})
|
||||||
|
.setOnAbort(() -> {
|
||||||
this.mViewmodel.resetMatchedRows();
|
this.mViewmodel.resetMatchedRows();
|
||||||
})
|
})
|
||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
|
|||||||
@ -53,6 +53,9 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
@Inject
|
@Inject
|
||||||
ProdRecuperoMaterialeViewModel mViewModel;
|
ProdRecuperoMaterialeViewModel mViewModel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||||
|
|
||||||
private FragmentProdRecuperoMaterialeBinding mBinding;
|
private FragmentProdRecuperoMaterialeBinding mBinding;
|
||||||
|
|
||||||
private int barcodeScannerIstanceID = -1;
|
private int barcodeScannerIstanceID = -1;
|
||||||
@ -200,8 +203,9 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
.setCanOverflowOrderQuantity(canOverflowOrderQuantity)
|
.setCanOverflowOrderQuantity(canOverflowOrderQuantity)
|
||||||
.setCanLUBeClosed(canLUBeClosed);
|
.setCanLUBeClosed(canLUBeClosed);
|
||||||
|
|
||||||
DialogInputQuantityV2View
|
mDialogInputQuantityV2View
|
||||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
.setQtaCnf(resultDTO.getQtaCnf())
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
@ -210,7 +214,8 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
.setDataScad(resultDTO.getDataScad());
|
.setDataScad(resultDTO.getDataScad());
|
||||||
|
|
||||||
this.mViewModel.onItemDispatched(item, pickedQuantityDTO, sourceMtbColt);
|
this.mViewModel.onItemDispatched(item, pickedQuantityDTO, sourceMtbColt);
|
||||||
}, this::onLoadingEnded)
|
})
|
||||||
|
.setOnAbort(this::onLoadingEnded)
|
||||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -73,6 +73,9 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
@Inject
|
@Inject
|
||||||
RettificaGiacenzeViewModel mViewModel;
|
RettificaGiacenzeViewModel mViewModel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||||
|
|
||||||
public BindableBoolean thereIsAnOpenedUL = new BindableBoolean(false);
|
public BindableBoolean thereIsAnOpenedUL = new BindableBoolean(false);
|
||||||
public BindableBoolean thereIsntAnOpenedUL = new BindableBoolean(false);
|
public BindableBoolean thereIsntAnOpenedUL = new BindableBoolean(false);
|
||||||
|
|
||||||
@ -320,7 +323,7 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
thereIsAnOpenedUL.set(false);
|
thereIsAnOpenedUL.set(false);
|
||||||
|
|
||||||
|
|
||||||
if(getActivity() != null) ((IPoppableActivity) getActivity()).pop();
|
if (getActivity() != null) ((IPoppableActivity) getActivity()).pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -331,7 +334,7 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
() -> onComplete.run(true),
|
() -> onComplete.run(true),
|
||||||
() -> onComplete.run(false)
|
() -> onComplete.run(false)
|
||||||
)
|
)
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.show(getActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -378,8 +381,9 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||||
.setCanLUBeClosed(canLUBeClosed);
|
.setCanLUBeClosed(canLUBeClosed);
|
||||||
|
|
||||||
DialogInputQuantityV2View
|
mDialogInputQuantityV2View
|
||||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
.setQtaCnf(resultDTO.getQtaCnf())
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
@ -389,15 +393,16 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
|
|
||||||
this.openProgress();
|
this.openProgress();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
}, () -> {
|
})
|
||||||
|
.setOnAbort(() -> {
|
||||||
this.closeProgress();
|
this.closeProgress();
|
||||||
})
|
})
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRowSaved() {
|
public void onRowSaved() {
|
||||||
FBToast.successToast(getActivity(), getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
FBToast.successToast(requireActivity(), getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -450,7 +455,8 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
null,
|
null,
|
||||||
() -> onComplete.run(true),
|
() -> onComplete.run(true),
|
||||||
() -> onComplete.run(false))
|
() -> onComplete.run(false))
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");;
|
.show(getActivity().getSupportFragmentManager(), "tag");
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -461,7 +467,7 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
null,
|
null,
|
||||||
R.string.button_ignore_print,
|
R.string.button_ignore_print,
|
||||||
onComplete)
|
onComplete)
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.show(getActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -469,7 +475,7 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
DialogYesNo.make(getActivity(), "Posiziona UL", "Vuoi cambiare la posizione della UL corrente?", result -> {
|
DialogYesNo.make(getActivity(), "Posiziona UL", "Vuoi cambiare la posizione della UL corrente?", result -> {
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case YES:
|
case YES:
|
||||||
DialogAskPositionOfLU.makeBase(getActivity(), false, (status, mtbDepoPosizione) -> {
|
DialogAskPositionOfLU.makeBase(getActivity(), false, (status, mtbDepoPosizione) -> {
|
||||||
if (status == DialogConsts.Results.ABORT) {
|
if (status == DialogConsts.Results.ABORT) {
|
||||||
onComplete.run(false, null);
|
onComplete.run(false, null);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -83,6 +83,9 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
@Inject
|
@Inject
|
||||||
SpedizioneViewModel mViewmodel;
|
SpedizioneViewModel mViewmodel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||||
|
|
||||||
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
||||||
|
|
||||||
private final ObservableArrayList<SpedizioneListModel> mSpedizioneMutableData = new ObservableArrayList<>();
|
private final ObservableArrayList<SpedizioneListModel> mSpedizioneMutableData = new ObservableArrayList<>();
|
||||||
@ -405,7 +408,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
|
|
||||||
BigDecimal qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
BigDecimal qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||||
.filter(y -> y.getRefMtbColr() != null &&
|
.filter(y -> y.getRefMtbColr() != null &&
|
||||||
y.getRefMtbColr().getId() == mtbColrToDispatch.getId()
|
y.getRefMtbColr().getId() == mtbColrToDispatch.getId()
|
||||||
/*
|
/*
|
||||||
y.getRefMtbColr().getNumCollo().equals(mtbColrToDispatch.getNumCollo()) &&
|
y.getRefMtbColr().getNumCollo().equals(mtbColrToDispatch.getNumCollo()) &&
|
||||||
y.getRefMtbColr().getDataColloD().equals(mtbColrToDispatch.getDataColloD()) &&
|
y.getRefMtbColr().getDataColloD().equals(mtbColrToDispatch.getDataColloD()) &&
|
||||||
@ -549,7 +552,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
|
|
||||||
BigDecimal qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
BigDecimal qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||||
.filter(y -> y.getRefMtbColr() != null &&
|
.filter(y -> y.getRefMtbColr() != null &&
|
||||||
y.getRefMtbColr().getId() == mtbColrToDispatch.getId() /*
|
y.getRefMtbColr().getId() == mtbColrToDispatch.getId() /*
|
||||||
y.getRefMtbColr().getNumCollo().equals(mtbColrToDispatch.getNumCollo()) &&
|
y.getRefMtbColr().getNumCollo().equals(mtbColrToDispatch.getNumCollo()) &&
|
||||||
y.getRefMtbColr().getDataColloD().equals(mtbColrToDispatch.getDataColloD()) &&
|
y.getRefMtbColr().getDataColloD().equals(mtbColrToDispatch.getDataColloD()) &&
|
||||||
y.getRefMtbColr().getSerCollo().equals(mtbColrToDispatch.getSerCollo()) &&
|
y.getRefMtbColr().getSerCollo().equals(mtbColrToDispatch.getSerCollo()) &&
|
||||||
@ -821,8 +824,9 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
.setCanLUBeClosed(true)
|
.setCanLUBeClosed(true)
|
||||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged);
|
.setCanPartitaMagBeChanged(canPartitaMagBeChanged);
|
||||||
|
|
||||||
DialogInputQuantityV2View
|
mDialogInputQuantityV2View
|
||||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
.setQtaCnf(resultDTO.getQtaCnf())
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
@ -832,7 +836,8 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
|
|
||||||
this.openProgress();
|
this.openProgress();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
}, () -> {
|
})
|
||||||
|
.setOnAbort(() -> {
|
||||||
this.mViewmodel.resetMatchedRows();
|
this.mViewmodel.resetMatchedRows();
|
||||||
})
|
})
|
||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
|
|||||||
@ -48,6 +48,9 @@ public class VersamentoMerceFragment extends BaseFragment implements ITitledFrag
|
|||||||
@Inject
|
@Inject
|
||||||
VersamentoMerceViewModel mViewModel;
|
VersamentoMerceViewModel mViewModel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||||
|
|
||||||
private FragmentMainVersamentoMerceBinding mBindings = null;
|
private FragmentMainVersamentoMerceBinding mBindings = null;
|
||||||
|
|
||||||
private final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
private final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||||
@ -202,9 +205,10 @@ public class VersamentoMerceFragment extends BaseFragment implements ITitledFrag
|
|||||||
.setCanPartitaMagBeChanged(canBatchLotBeChanged)
|
.setCanPartitaMagBeChanged(canBatchLotBeChanged)
|
||||||
.setCanLUBeClosed(false);
|
.setCanLUBeClosed(false);
|
||||||
|
|
||||||
this.getActivity().runOnUiThread(() -> {
|
this.requireActivity().runOnUiThread(() -> {
|
||||||
DialogInputQuantityV2View
|
mDialogInputQuantityV2View
|
||||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
|
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
@ -215,8 +219,9 @@ public class VersamentoMerceFragment extends BaseFragment implements ITitledFrag
|
|||||||
|
|
||||||
onComplete.run(pickedQuantityDTO);
|
onComplete.run(pickedQuantityDTO);
|
||||||
|
|
||||||
}, this::onLoadingEnded)
|
})
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.setOnAbort(this::onLoadingEnded)
|
||||||
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,7 @@ public class DialogProgressView extends DialogFragment {
|
|||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.dialog_progress, container, false);
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.dialog_progress, container, false);
|
||||||
|
|
||||||
getDialog().setCanceledOnTouchOutside(false);
|
setCancelable(false);
|
||||||
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
|
||||||
mBindings.setTitle(UtilityString.isNullOrEmpty(title) ? requireActivity().getString(R.string.loading) : title);
|
mBindings.setTitle(UtilityString.isNullOrEmpty(title) ? requireActivity().getString(R.string.loading) : title);
|
||||||
|
|||||||
@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs.ask_cliente;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface DialogAskClienteComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
DialogAskClienteComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(DialogAskClienteView dialogAskClienteView);
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs.ask_cliente;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
|
||||||
|
@Module(subcomponents = DialogAskClienteComponent.class)
|
||||||
|
public class DialogAskClienteModule {
|
||||||
|
}
|
||||||
@ -14,20 +14,32 @@ import androidx.annotation.Nullable;
|
|||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
import java.util.AbstractMap;
|
import java.util.AbstractMap;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||||
import it.integry.integrywmsnative.core.model.VtbDest;
|
import it.integry.integrywmsnative.core.model.VtbDest;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityHashMap;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.databinding.DialogAskClienteBinding;
|
import it.integry.integrywmsnative.databinding.DialogAskClienteBinding;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteClienteDTO;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteDestinatarioDTO;
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteDestinatarioDTO;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page1ViewModel;
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page1ViewModel;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page2ViewModel;
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel.DialogAskCliente_Page2ViewModel;
|
||||||
@ -45,6 +57,12 @@ public class DialogAskClienteView extends BaseDialogFragment {
|
|||||||
|
|
||||||
private boolean mIsClienteSelected = false;
|
private boolean mIsClienteSelected = false;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
SystemRESTConsumer systemRESTConsumer;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogProgressView dialogProgressView;
|
||||||
|
|
||||||
public static DialogAskClienteView newInstance(@NotNull RunnableArgss<VtbDest, String> onComplete, @NotNull Runnable onAbort) {
|
public static DialogAskClienteView newInstance(@NotNull RunnableArgss<VtbDest, String> onComplete, @NotNull Runnable onAbort) {
|
||||||
return new DialogAskClienteView(onComplete, onAbort);
|
return new DialogAskClienteView(onComplete, onAbort);
|
||||||
}
|
}
|
||||||
@ -69,6 +87,11 @@ public class DialogAskClienteView extends BaseDialogFragment {
|
|||||||
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||||
|
|
||||||
|
MainApplication.appComponent
|
||||||
|
.dialogAskClienteComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
|
|
||||||
List<Map.Entry<Integer, Class<? extends IDialogAskClienteViewModel>>> views = new ArrayList<>();
|
List<Map.Entry<Integer, Class<? extends IDialogAskClienteViewModel>>> views = new ArrayList<>();
|
||||||
views.add(new AbstractMap.SimpleEntry<>(R.layout.dialog_ask_cliente__page1, DialogAskCliente_Page1ViewModel.class));
|
views.add(new AbstractMap.SimpleEntry<>(R.layout.dialog_ask_cliente__page1, DialogAskCliente_Page1ViewModel.class));
|
||||||
@ -96,21 +119,19 @@ public class DialogAskClienteView extends BaseDialogFragment {
|
|||||||
DialogAskCliente_Page1ViewModel viewModel1 = (DialogAskCliente_Page1ViewModel) mAdapter.getViewModel(R.layout.dialog_ask_cliente__page1);
|
DialogAskCliente_Page1ViewModel viewModel1 = (DialogAskCliente_Page1ViewModel) mAdapter.getViewModel(R.layout.dialog_ask_cliente__page1);
|
||||||
DialogAskCliente_Page2ViewModel viewModel2 = (DialogAskCliente_Page2ViewModel) mAdapter.getViewModel(R.layout.dialog_ask_cliente__page2);
|
DialogAskCliente_Page2ViewModel viewModel2 = (DialogAskCliente_Page2ViewModel) mAdapter.getViewModel(R.layout.dialog_ask_cliente__page2);
|
||||||
|
|
||||||
viewModel1
|
viewModel1.setOnConfirmClickListener(() -> {
|
||||||
.setOnConfirmClickListener(() -> {
|
String codAnag = viewModel1.getCurrentCliente();
|
||||||
String codAnag = viewModel1.getCurrentCliente();
|
|
||||||
|
|
||||||
if (UtilityString.isNullOrEmpty(codAnag)) {
|
if (UtilityString.isNullOrEmpty(codAnag)) {
|
||||||
this.mIsClienteSelected = true;
|
this.mIsClienteSelected = true;
|
||||||
dismiss();
|
dismiss();
|
||||||
mOnComplete.run(null, null);
|
mOnComplete.run(null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel2.setCodAnag(codAnag);
|
viewModel2.setCodAnag(codAnag);
|
||||||
|
|
||||||
mBindings.viewpager.setCurrentItem(mBindings.viewpager.getCurrentItem() + 1, true);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
mBindings.viewpager.setCurrentItem(mBindings.viewpager.getCurrentItem() + 1, true);
|
||||||
|
});
|
||||||
viewModel2.setOnConfirmClickListener(() -> {
|
viewModel2.setOnConfirmClickListener(() -> {
|
||||||
DialogAskClienteDestinatarioDTO cliente = viewModel2.getCurrentDestinatario();
|
DialogAskClienteDestinatarioDTO cliente = viewModel2.getCurrentDestinatario();
|
||||||
|
|
||||||
@ -122,9 +143,84 @@ public class DialogAskClienteView extends BaseDialogFragment {
|
|||||||
|
|
||||||
viewModel1.setOnAbortClickListener(this::dismiss);
|
viewModel1.setOnAbortClickListener(this::dismiss);
|
||||||
viewModel2.setOnAbortClickListener(this::dismiss);
|
viewModel2.setOnAbortClickListener(this::dismiss);
|
||||||
|
|
||||||
|
|
||||||
|
this.dialogProgressView.show(this.getParentFragmentManager(), "tag");
|
||||||
|
|
||||||
|
this.initClienti(viewModel1, () -> {
|
||||||
|
this.initDestinatari(viewModel2, () -> {
|
||||||
|
this.dialogProgressView.dismiss();
|
||||||
|
}, () -> {
|
||||||
|
this.dialogProgressView.dismiss();
|
||||||
|
});
|
||||||
|
}, () -> {
|
||||||
|
this.dialogProgressView.dismiss();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initClienti(DialogAskCliente_Page1ViewModel viewModel, Runnable onComplete, Runnable onAbort) {
|
||||||
|
Type typeOfObjectsList = new TypeToken<ArrayList<HashMap<String, Object>>>() {
|
||||||
|
}.getType();
|
||||||
|
|
||||||
|
String sqlClienti = "SELECT gtb_anag.cod_anag, rag_soc, jtb_comt.cod_jcom " +
|
||||||
|
"FROM gtb_anag " +
|
||||||
|
"LEFT OUTER JOIN jtb_comt ON gtb_anag.cod_anag = jtb_comt.cod_anag " +
|
||||||
|
"INNER JOIN vtb_clie ON gtb_anag.cod_anag = vtb_clie.cod_anag " +
|
||||||
|
"WHERE vtb_clie.flag_stato = 'A' " +
|
||||||
|
"ORDER BY rag_soc";
|
||||||
|
|
||||||
|
this.systemRESTConsumer.<ArrayList<HashMap<String, Object>>>processSql(sqlClienti, typeOfObjectsList, value -> {
|
||||||
|
var availableClienti = new ArrayList<DialogAskClienteClienteDTO>();
|
||||||
|
|
||||||
|
Stream.of(value)
|
||||||
|
.groupBy(x -> x.get("codAnag").toString() + " " + x.get("ragSoc").toString())
|
||||||
|
.forEach(x -> {
|
||||||
|
DialogAskClienteClienteDTO dialogAskClienteClienteDTO = new DialogAskClienteClienteDTO();
|
||||||
|
dialogAskClienteClienteDTO.setCodAnag(UtilityHashMap.getValueIfExists(x.getValue().get(0), "codAnag"));
|
||||||
|
dialogAskClienteClienteDTO.setRagSoc(UtilityHashMap.getValueIfExists(x.getValue().get(0), "ragSoc"));
|
||||||
|
|
||||||
|
for (HashMap<String, Object> group : x.getValue()) {
|
||||||
|
if (group.containsKey("codJcom")) {
|
||||||
|
dialogAskClienteClienteDTO.getCodJcoms().add(UtilityHashMap.getValueIfExists(group, "codJcom"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
availableClienti.add(dialogAskClienteClienteDTO);
|
||||||
|
});
|
||||||
|
|
||||||
|
viewModel.setAvailableClienti(availableClienti);
|
||||||
|
onComplete.run();
|
||||||
|
}, ex -> {
|
||||||
|
onAbort.run();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initDestinatari(DialogAskCliente_Page2ViewModel viewModel, Runnable onComplete, Runnable onAbort) {
|
||||||
|
String sql = "SELECT vtb_dest.cod_anag,\n" +
|
||||||
|
" cod_vdes,\n" +
|
||||||
|
" destinatario,\n" +
|
||||||
|
" indirizzo,\n" +
|
||||||
|
" cap,\n" +
|
||||||
|
" citta,\n" +
|
||||||
|
" prov,\n" +
|
||||||
|
" nazione\n" +
|
||||||
|
"FROM vtb_dest\n" +
|
||||||
|
"INNER JOIN vtb_clie ON vtb_clie.cod_anag = vtb_dest.cod_anag\n" +
|
||||||
|
"WHERE vtb_clie.flag_stato = 'A'";
|
||||||
|
|
||||||
|
Type typeOfObjectsList = new TypeToken<ArrayList<DialogAskClienteDestinatarioDTO>>() {
|
||||||
|
}.getType();
|
||||||
|
this.systemRESTConsumer.<ArrayList<DialogAskClienteDestinatarioDTO>>processSql(sql, typeOfObjectsList, value -> {
|
||||||
|
viewModel.setAvailableDestinatari(value);
|
||||||
|
|
||||||
|
onComplete.run();
|
||||||
|
}, ex -> {
|
||||||
|
onAbort.run();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||||
mAdapter.onDismiss();
|
mAdapter.onDismiss();
|
||||||
|
|||||||
@ -10,12 +10,9 @@ import androidx.databinding.ViewDataBinding;
|
|||||||
|
|
||||||
import com.annimon.stream.Optional;
|
import com.annimon.stream.Optional;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.google.gson.reflect.TypeToken;
|
|
||||||
import com.tfb.fbtoast.FBToast;
|
import com.tfb.fbtoast.FBToast;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
@ -24,11 +21,8 @@ import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
|||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ISimpleOperationCallback;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityHashMap;
|
|
||||||
import it.integry.integrywmsnative.databinding.DialogAskClientePage1Binding;
|
import it.integry.integrywmsnative.databinding.DialogAskClientePage1Binding;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteClienteDTO;
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteClienteDTO;
|
||||||
|
|
||||||
@ -46,7 +40,6 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
private Runnable onAbortClickListener;
|
private Runnable onAbortClickListener;
|
||||||
|
|
||||||
public DialogAskCliente_Page1ViewModel() {
|
public DialogAskCliente_Page1ViewModel() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -59,53 +52,18 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
this.mBinding = (DialogAskClientePage1Binding) binding;
|
this.mBinding = (DialogAskClientePage1Binding) binding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setAvailableClienti(ArrayList<DialogAskClienteClienteDTO> availableClienti) {
|
||||||
|
this.availableClienti = availableClienti;
|
||||||
|
initializeAdapter(availableClienti);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onShow() {
|
public void onShow() {
|
||||||
|
|
||||||
String sql = "SELECT gtb_anag.cod_anag, rag_soc, jtb_comt.cod_jcom " +
|
mBarcodeScannerInstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||||
"FROM gtb_anag " +
|
.setOnScanSuccessfull(onScanSuccessful)
|
||||||
"LEFT OUTER JOIN jtb_comt ON gtb_anag.cod_anag = jtb_comt.cod_anag " +
|
.setOnScanFailed(ex -> UtilityExceptions.defaultException(mContext, ex, false)));
|
||||||
"INNER JOIN vtb_clie ON gtb_anag.cod_anag = vtb_clie.cod_anag " +
|
BarcodeManager.enable();
|
||||||
"WHERE vtb_clie.flag_stato = 'A' " +
|
|
||||||
"ORDER BY rag_soc";
|
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<HashMap<String, Object>>>() { }.getType();
|
|
||||||
|
|
||||||
SystemRESTConsumer.processSqlStatic(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<HashMap<String, Object>>>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(ArrayList<HashMap<String, Object>> value) {
|
|
||||||
|
|
||||||
availableClienti = new ArrayList<>();
|
|
||||||
|
|
||||||
Stream.of(value)
|
|
||||||
.groupBy(x -> x.get("codAnag").toString() + " " + x.get("ragSoc").toString())
|
|
||||||
.forEach(x -> {
|
|
||||||
DialogAskClienteClienteDTO dialogAskClienteClienteDTO = new DialogAskClienteClienteDTO();
|
|
||||||
dialogAskClienteClienteDTO.setCodAnag(UtilityHashMap.getValueIfExists(x.getValue().get(0), "codAnag"));
|
|
||||||
dialogAskClienteClienteDTO.setRagSoc(UtilityHashMap.getValueIfExists(x.getValue().get(0), "ragSoc"));
|
|
||||||
|
|
||||||
for (HashMap<String, Object> group : x.getValue()) {
|
|
||||||
if (group.containsKey("codJcom")) {
|
|
||||||
dialogAskClienteClienteDTO.getCodJcoms().add(UtilityHashMap.getValueIfExists(group, "codJcom"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
availableClienti.add(dialogAskClienteClienteDTO);
|
|
||||||
});
|
|
||||||
|
|
||||||
initializeAdapter(availableClienti);
|
|
||||||
|
|
||||||
mBarcodeScannerInstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
|
||||||
.setOnScanSuccessfull(onScanSuccessful)
|
|
||||||
.setOnScanFailed(ex -> UtilityExceptions.defaultException(mContext, ex, false)));
|
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.mBinding.buttonYes.setOnClickListener(v -> {
|
this.mBinding.buttonYes.setOnClickListener(v -> {
|
||||||
if (validateCliente()) {
|
if (validateCliente()) {
|
||||||
@ -147,7 +105,7 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
} else {
|
} else {
|
||||||
DialogAskClienteClienteDTO resultCodJcom = searchBarcodeInCodJcom(barcode);
|
DialogAskClienteClienteDTO resultCodJcom = searchBarcodeInCodJcom(barcode);
|
||||||
|
|
||||||
if(resultCodJcom != null) {
|
if (resultCodJcom != null) {
|
||||||
mBinding.dropdownCliente.setText(resultCodJcom.toString());
|
mBinding.dropdownCliente.setText(resultCodJcom.toString());
|
||||||
refreshCodJcoms(resultCodJcom);
|
refreshCodJcoms(resultCodJcom);
|
||||||
mBinding.dropdownCommessa.setText(barcode);
|
mBinding.dropdownCommessa.setText(barcode);
|
||||||
@ -219,7 +177,7 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
|
|
||||||
|
|
||||||
private boolean validateCliente() {
|
private boolean validateCliente() {
|
||||||
if(SettingsManager.iDB().isFlagAllowEmptyClienteInPickingLibero() && mBinding.inputCliente.getEditText().getText().toString().trim().length() == 0) {
|
if (SettingsManager.iDB().isFlagAllowEmptyClienteInPickingLibero() && mBinding.inputCliente.getEditText().getText().toString().trim().length() == 0) {
|
||||||
return true;
|
return true;
|
||||||
} else return getCurrentCliente() != null;
|
} else return getCurrentCliente() != null;
|
||||||
}
|
}
|
||||||
@ -229,7 +187,7 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
.filter(x -> x.getRagSoc().equalsIgnoreCase(mBinding.inputCliente.getEditText().getText().toString()))
|
.filter(x -> x.getRagSoc().equalsIgnoreCase(mBinding.inputCliente.getEditText().getText().toString()))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
if(result.isPresent()) return result.get().getCodAnag();
|
if (result.isPresent()) return result.get().getCodAnag();
|
||||||
else return null;
|
else return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,7 +198,7 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
|||||||
.map(DialogAskClienteClienteDTO::getCodJcoms)
|
.map(DialogAskClienteClienteDTO::getCodJcoms)
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
if(result.isPresent() && Stream.of(result.get()).anyMatch(x -> x.equalsIgnoreCase(mBinding.inputCommessa.getEditText().getText().toString()))) {
|
if (result.isPresent() && Stream.of(result.get()).anyMatch(x -> x.equalsIgnoreCase(mBinding.inputCommessa.getEditText().getText().toString()))) {
|
||||||
return mBinding.inputCommessa.getEditText().getText().toString();
|
return mBinding.inputCommessa.getEditText().getText().toString();
|
||||||
} else return null;
|
} else return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,29 +5,24 @@ import android.widget.AutoCompleteTextView;
|
|||||||
|
|
||||||
import androidx.databinding.ViewDataBinding;
|
import androidx.databinding.ViewDataBinding;
|
||||||
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ISimpleOperationCallback;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
|
||||||
import it.integry.integrywmsnative.databinding.DialogAskClientePage2Binding;
|
import it.integry.integrywmsnative.databinding.DialogAskClientePage2Binding;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteDestinatarioDTO;
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.dto.DialogAskClienteDestinatarioDTO;
|
||||||
|
|
||||||
public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewModel {
|
public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewModel {
|
||||||
|
|
||||||
|
|
||||||
private DialogAskClientePage2Binding mBinding;
|
private DialogAskClientePage2Binding mBinding;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
|
||||||
private Runnable mOnConfirm;
|
private Runnable mOnConfirm;
|
||||||
private Runnable mOnAbort;
|
private Runnable mOnAbort;
|
||||||
|
|
||||||
private List<DialogAskClienteDestinatarioDTO> availableDestinatari;
|
private ArrayList<DialogAskClienteDestinatarioDTO> availableDestinatari;
|
||||||
|
|
||||||
private String mCodAnag;
|
private String mCodAnag;
|
||||||
|
|
||||||
@ -40,6 +35,10 @@ public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewMod
|
|||||||
this.mBinding = (DialogAskClientePage2Binding) binding;
|
this.mBinding = (DialogAskClientePage2Binding) binding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setAvailableDestinatari(ArrayList<DialogAskClienteDestinatarioDTO> availableDestinatari) {
|
||||||
|
this.availableDestinatari = availableDestinatari;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setContext(Context context) {
|
public void setContext(Context context) {
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
@ -47,29 +46,18 @@ public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewMod
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onShow() {
|
public void onShow() {
|
||||||
String sql = "SELECT cod_anag, cod_vdes, destinatario, indirizzo, cap, citta, prov, nazione " +
|
var filteredDestinatari = availableDestinatari != null ? Stream.of(availableDestinatari)
|
||||||
"FROM vtb_dest " +
|
.filter(x -> x.getCodAnag().equalsIgnoreCase(mCodAnag))
|
||||||
"WHERE cod_anag = " + UtilityDB.valueToString(mCodAnag);
|
.toList()
|
||||||
|
: null;
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<DialogAskClienteDestinatarioDTO>>() {
|
|
||||||
}.getType();
|
|
||||||
SystemRESTConsumer.processSqlStatic(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<DialogAskClienteDestinatarioDTO>>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(ArrayList<DialogAskClienteDestinatarioDTO> value) {
|
|
||||||
availableDestinatari = value;
|
|
||||||
initializeAdapter(value);
|
|
||||||
|
|
||||||
if(value == null || value.size() == 0) {
|
if (filteredDestinatari == null || filteredDestinatari.size() == 0) {
|
||||||
mOnConfirm.run();
|
mOnConfirm.run();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
initializeAdapter(filteredDestinatari);
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
this.mBinding.buttonYes.setOnClickListener(v -> {
|
this.mBinding.buttonYes.setOnClickListener(v -> {
|
||||||
@ -106,7 +94,7 @@ public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewMod
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void initializeAdapter(ArrayList<DialogAskClienteDestinatarioDTO> items) {
|
private void initializeAdapter(List<DialogAskClienteDestinatarioDTO> items) {
|
||||||
DialogAskCliente_Page2_ArrayAdapter adapter = new DialogAskCliente_Page2_ArrayAdapter(mContext, items);
|
DialogAskCliente_Page2_ArrayAdapter adapter = new DialogAskCliente_Page2_ArrayAdapter(mContext, items);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ public class DialogAskCliente_Page2_ArrayAdapter extends ArrayAdapter<DialogAskC
|
|||||||
|
|
||||||
private ListFilter listFilter = new ListFilter();
|
private ListFilter listFilter = new ListFilter();
|
||||||
|
|
||||||
public DialogAskCliente_Page2_ArrayAdapter(@NonNull Context context, @NonNull ArrayList<DialogAskClienteDestinatarioDTO> list) {
|
public DialogAskCliente_Page2_ArrayAdapter(@NonNull Context context, @NonNull List<DialogAskClienteDestinatarioDTO> list) {
|
||||||
super(context, 0 , list);
|
super(context, 0 , list);
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mDataset = list;
|
mDataset = list;
|
||||||
|
|||||||
@ -23,13 +23,12 @@ import com.google.android.material.textfield.TextInputLayout;
|
|||||||
import com.pedromassango.doubleclick.DoubleClick;
|
import com.pedromassango.doubleclick.DoubleClick;
|
||||||
import com.pedromassango.doubleclick.DoubleClickListener;
|
import com.pedromassango.doubleclick.DoubleClickListener;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
import it.integry.integrywmsnative.MainApplication;
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
@ -47,14 +46,15 @@ import it.integry.integrywmsnative.core.utility.UtilityObservable;
|
|||||||
import it.integry.integrywmsnative.databinding.DialogInputQuantityV2Binding;
|
import it.integry.integrywmsnative.databinding.DialogInputQuantityV2Binding;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class DialogInputQuantityV2View extends BaseDialogFragment implements DialogInputQuantityV2ViewModel.Listener {
|
public class DialogInputQuantityV2View extends BaseDialogFragment implements DialogInputQuantityV2ViewModel.Listener {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
DialogInputQuantityV2ViewModel mViewModel;
|
DialogInputQuantityV2ViewModel mViewModel;
|
||||||
|
|
||||||
private final DialogInputQuantityV2DTO mDialogInputQuantityV2DTO;
|
private DialogInputQuantityV2DTO mDialogInputQuantityV2DTO;
|
||||||
private final RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> mOnComplete;
|
private RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> mOnComplete;
|
||||||
private final Runnable mOnAbort;
|
private Runnable mOnAbort;
|
||||||
|
|
||||||
public ObservableField<Integer> currentTextNumCnfToTake = new ObservableField<>(0);
|
public ObservableField<Integer> currentTextNumCnfToTake = new ObservableField<>(0);
|
||||||
public ObservableField<Integer> currentTextNumPezziToTake = new ObservableField<>(0);
|
public ObservableField<Integer> currentTextNumPezziToTake = new ObservableField<>(0);
|
||||||
@ -86,17 +86,22 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
private boolean mEnableDataCallback = true;
|
private boolean mEnableDataCallback = true;
|
||||||
|
|
||||||
private int mBarcodeScannerIstanceID;
|
private int mBarcodeScannerIstanceID;
|
||||||
|
private boolean mFirstStart = true;
|
||||||
|
|
||||||
public static DialogInputQuantityV2View newInstance(@NotNull DialogInputQuantityV2DTO dialogInputQuantityV2DTO, @NotNull RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> onComplete, @NotNull Runnable onAbort) {
|
|
||||||
return new DialogInputQuantityV2View(dialogInputQuantityV2DTO, onComplete, onAbort);
|
public DialogInputQuantityV2View setDialogInputQuantityV2DTO(DialogInputQuantityV2DTO mDialogInputQuantityV2DTO) {
|
||||||
|
this.mDialogInputQuantityV2DTO = mDialogInputQuantityV2DTO;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private DialogInputQuantityV2View(@NotNull DialogInputQuantityV2DTO dialogInputQuantityV2DTO, @NotNull RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> onComplete, @NotNull Runnable onAbort) {
|
public DialogInputQuantityV2View setOnComplete(RunnableArgss<DialogInputQuantityV2ResultDTO, Boolean> mOnComplete) {
|
||||||
super();
|
this.mOnComplete = mOnComplete;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
this.mDialogInputQuantityV2DTO = dialogInputQuantityV2DTO;
|
public DialogInputQuantityV2View setOnAbort(Runnable mOnAbort) {
|
||||||
this.mOnComplete = onComplete;
|
this.mOnAbort = mOnAbort;
|
||||||
this.mOnAbort = onAbort;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -203,7 +208,11 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
this.init();
|
|
||||||
|
if(!mFirstStart) {
|
||||||
|
this.init();
|
||||||
|
mFirstStart = false;
|
||||||
|
}
|
||||||
|
|
||||||
int onNumCnfInputChanged = SettingsManager.iDB().getOnNumCnfInputChanged();
|
int onNumCnfInputChanged = SettingsManager.iDB().getOnNumCnfInputChanged();
|
||||||
|
|
||||||
|
|||||||
@ -46,6 +46,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/recipient"
|
android:hint="@string/recipient"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/description_text">
|
app:layout_constraintTop_toBottomOf="@id/description_text">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user