Finish v1.40.23(440)
This commit is contained in:
commit
f458a52b18
@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 439
|
def appVersionCode = 440
|
||||||
def appVersionName = '1.40.22'
|
def appVersionName = '1.40.23'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
@ -18,7 +19,7 @@ import retrofit2.Response;
|
|||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class DocumentRESTConsumer extends _BaseRESTConsumer {
|
public class DocumentRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
|
||||||
public void createDocsFromColli(List<LoadColliDTO> listColli, RunnableArgs<List<DtbDoct>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createDocsFromColli(List<LoadColliDTO> listColli, RunnableArgs<List<DtbDoct>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
DocumentiRESTConsumerService documentiRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
DocumentiRESTConsumerService documentiRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
||||||
@ -50,8 +51,21 @@ public class DocumentRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void checkFrumaDocument(String fornitore, String numDoc, String dataDoc, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
var inventarioRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
||||||
|
inventarioRESTConsumerService.checkFrumaDoc(fornitore, numDoc, dataDoc)
|
||||||
|
.enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(@NonNull Call<ServiceRESTResponse<Boolean>> call, @NonNull Response<ServiceRESTResponse<Boolean>> response) {
|
||||||
|
analyzeAnswer(response, "checkDocument", onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(@NonNull Call<ServiceRESTResponse<Boolean>> call, @NonNull Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void loadDocumentAvailableArts(String codDtip, String codMgrp, String codAnagForn, RunnableArgs<RetrieveDocumentoArtsResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
public void loadDocumentAvailableArts(String codDtip, String codMgrp, String codAnagForn, RunnableArgs<RetrieveDocumentoArtsResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
var inventarioRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
var inventarioRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.DtbDoct;
|
import it.integry.integrywmsnative.core.model.DtbDoct;
|
||||||
@ -20,8 +21,11 @@ public interface DocumentiRESTConsumerService {
|
|||||||
@POST("createDocFromColli")
|
@POST("createDocFromColli")
|
||||||
Call<ServiceRESTResponse<DtbDoct>> createDocFromColli(@Body LoadColliDTO listColli);
|
Call<ServiceRESTResponse<DtbDoct>> createDocFromColli(@Body LoadColliDTO listColli);
|
||||||
|
|
||||||
|
@GET("wms/documento/checkFruma")
|
||||||
|
Call<ServiceRESTResponse<Boolean>> checkFrumaDoc(
|
||||||
|
@Query("fornitore") String fornitore,
|
||||||
|
@Query("numDoc") String numDoc,
|
||||||
|
@Query("dataDoc") String dataDoc);
|
||||||
|
|
||||||
@GET("wms/documento/arts")
|
@GET("wms/documento/arts")
|
||||||
Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> retrieveArts(
|
Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> retrieveArts(
|
||||||
|
|||||||
@ -3,6 +3,8 @@ package it.integry.integrywmsnative.gest.contab_doc_interni;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.text.SpannableString;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@ -37,6 +39,7 @@ import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniE
|
|||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.ui.DocInterniListAdapter;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.ui.DocInterniListAdapter;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.ui.DocInterniListModel;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.ui.DocInterniListModel;
|
||||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
public class DocInterniFragment extends BaseFragment implements ITitledFragment, IScrollableFragment, DocInterniViewModel.Listener {
|
public class DocInterniFragment extends BaseFragment implements ITitledFragment, IScrollableFragment, DocInterniViewModel.Listener {
|
||||||
|
|
||||||
@ -120,10 +123,21 @@ public class DocInterniFragment extends BaseFragment implements ITitledFragment,
|
|||||||
this.openDocumentSelectionDialog();
|
this.openDocumentSelectionDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onWarning(String warningText, Runnable action) {
|
||||||
|
this.requireActivity().runOnUiThread(() -> {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
DialogSimpleMessageView
|
||||||
|
.makeWarningDialog(new SpannableString(Html.fromHtml(warningText)), null, action)
|
||||||
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDocDetailsChanged(DialogSelectDocInfoResponseDTO selection) {
|
public void onDocDetailsChanged(DialogSelectDocInfoResponseDTO selection) {
|
||||||
mViewModel.setSelectedDocDetails(selection);
|
mViewModel.setSelectedDocDetails(selection, () -> {
|
||||||
mBinding.invalidateAll();
|
mBinding.invalidateAll();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -8,16 +8,22 @@ import java.util.List;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColtRepository;
|
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColtRepository;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
|
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
|
||||||
import it.integry.integrywmsnative.core.di.BindableInteger;
|
import it.integry.integrywmsnative.core.di.BindableInteger;
|
||||||
|
import it.integry.integrywmsnative.core.exception.NoDocFoundException;
|
||||||
import it.integry.integrywmsnative.core.exception.NoDocTypeSelectedException;
|
import it.integry.integrywmsnative.core.exception.NoDocTypeSelectedException;
|
||||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.DocumentRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.DocumentRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.model.documento.DocumentoArtDTO;
|
import it.integry.integrywmsnative.core.rest.model.documento.DocumentoArtDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoResponseDTO;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoResponseDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.exception.DocumentRequiredException;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.FornitoreDTO;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.FornitoreDTO;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GruppoArticoloDTO;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GruppoArticoloDTO;
|
||||||
@ -76,6 +82,14 @@ public class DocInterniViewModel {
|
|||||||
if (this.mListener != null) mListener.onError(ex);
|
if (this.mListener != null) mListener.onError(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendWarning(String warningText, Runnable action) {
|
||||||
|
if (this.mListener != null) mListener.onWarning(warningText, action);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendDocDetailsChanged(DialogSelectDocInfoResponseDTO selection){
|
||||||
|
if (this.mListener != null) mListener.onDocDetailsChanged(selection);
|
||||||
|
}
|
||||||
|
|
||||||
public DocInterniViewModel setListeners(Listener listener) {
|
public DocInterniViewModel setListeners(Listener listener) {
|
||||||
this.mListener = listener;
|
this.mListener = listener;
|
||||||
return this;
|
return this;
|
||||||
@ -85,7 +99,7 @@ public class DocInterniViewModel {
|
|||||||
return mDocsList;
|
return mDocsList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSelectedDocDetails(DialogSelectDocInfoResponseDTO selection) {
|
public void setSelectedDocDetails(DialogSelectDocInfoResponseDTO selection, Runnable action) {
|
||||||
this.fornitore = selection.getFornitore();
|
this.fornitore = selection.getFornitore();
|
||||||
this.dtbTipi = selection.getTipoDoc();
|
this.dtbTipi = selection.getTipoDoc();
|
||||||
|
|
||||||
@ -94,10 +108,31 @@ public class DocInterniViewModel {
|
|||||||
this.numDoc = selection.getNumDoc() != null ? selection.getNumDoc().toString() : null;
|
this.numDoc = selection.getNumDoc() != null ? selection.getNumDoc().toString() : null;
|
||||||
this.note = selection.getNote();
|
this.note = selection.getNote();
|
||||||
|
|
||||||
this.sendOnLoadingStarted();
|
if (dtbTipi.getCodDtip().equalsIgnoreCase("FRUMA")) {
|
||||||
fetchProducts(() -> {
|
documentRESTConsumer.checkFrumaDocument(
|
||||||
fetchDocuments(this::sendOnLoadingEnded);
|
fornitore.getCodAnag(),
|
||||||
});
|
numDoc,
|
||||||
|
UtilityDate.formatDate(dataDoc, "yyyy/MM/dd"),
|
||||||
|
data -> {
|
||||||
|
if (!data) {
|
||||||
|
this.sendWarning(UtilityResources.getString(R.string.no_doc_found_message), this::init);
|
||||||
|
} else {
|
||||||
|
action.run();
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
fetchProducts(() -> {
|
||||||
|
fetchDocuments(this::sendOnLoadingEnded);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
this::sendError
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
action.run();
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
fetchProducts(() -> {
|
||||||
|
fetchDocuments(this::sendOnLoadingEnded);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fetchProducts(Runnable onComplete) {
|
public void fetchProducts(Runnable onComplete) {
|
||||||
@ -210,6 +245,8 @@ public class DocInterniViewModel {
|
|||||||
|
|
||||||
void onError(Exception ex);
|
void onError(Exception ex);
|
||||||
|
|
||||||
|
void onWarning(String warningText, Runnable action);
|
||||||
|
|
||||||
void onDocInterniSetupFetched(DocInterniSetupDTO docInterniSetupDTO);
|
void onDocInterniSetupFetched(DocInterniSetupDTO docInterniSetupDTO);
|
||||||
|
|
||||||
void onDocDetailsChanged(DialogSelectDocInfoResponseDTO selection);
|
void onDocDetailsChanged(DialogSelectDocInfoResponseDTO selection);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user