Finish v1.43.03(468)

This commit is contained in:
Giuseppe Scorrano 2025-02-11 10:33:13 +01:00
commit a95ff0b0e5
228 changed files with 3809 additions and 2301 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AppInsightsSettings">
<option name="selectedTabId" value="Android Vitals" />
<option name="selectedTabId" value="Firebase Crashlytics" />
<option name="tabSettings">
<map>
<entry key="Android Vitals">

View File

@ -4,7 +4,7 @@
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2025-01-17T09:18:08.345092200Z">
<DropdownSelection timestamp="2025-01-27T15:42:06.256113400Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="PhysicalDevice" identifier="serial=21088B8EFD" />

View File

@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
android {
def appVersionCode = 467
def appVersionName = '1.43.02'
def appVersionCode = 468
def appVersionName = '1.43.03'
signingConfigs {
release {
@ -150,10 +150,7 @@ dependencies {
//FAB
implementation 'com.github.clans:fab:1.6.4'
//CUSTOM VIEWS
implementation 'com.github.NaimishTrivedi:FBToast:1.0'
implementation 'com.github.cachapa:ExpandableLayout:2.9.2'
implementation 'com.github.frankiesardo:linearlistview:1.0.1@aar'
implementation 'com.github.fede87:StatusBarAlert:1.0.1'
implementation 'com.github.zhukic:sectioned-recyclerview:1.2.3'
implementation 'com.github.pedromassango:doubleClick:3.0'
@ -164,9 +161,6 @@ dependencies {
annotationProcessor "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-rxjava3:$room_version"
//AppUpdate
implementation 'com.github.javiersantos:AppUpdater:2.7'
//Barcode
implementation project(':pointmobilescannerlibrary')
implementation project(':zebrascannerlibrary')
@ -184,7 +178,7 @@ dependencies {
//Bluetooth device manager
implementation 'com.github.harry1453:android-bluetooth-serial:v1.1'
implementation 'com.github.harry1453:android-bluetooth-serial:v1.1.2'
// RxJava is also required.
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'

View File

@ -71,6 +71,7 @@ import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMate
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeModule;
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceComponent;
import it.integry.integrywmsnative.gest.prod_rientro_merce.order_detail.ProdRientroMerceOrderDetailComponent;
import it.integry.integrywmsnative.gest.prod_rientro_merce.order_list.ProdRientroMerceOrderListComponent;
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.ProdRiposizionamentoDaProdComponent;
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.ProdRiposizionamentoDaProdModule;
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dialogs.info_giacenza.DialogInfoGiacenzaComponent;
@ -112,6 +113,7 @@ import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetM
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalModule;
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteComponent;
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteModule;
import it.integry.integrywmsnative.view.dialogs.ask_commessa.DialogAskCommessaComponent;
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.DialogAskLineaProdComponent;
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.DialogAskLineaProdModule;
import it.integry.integrywmsnative.view.dialogs.ask_unknown_barcode_notes.DialogAskUnknownBarcodeNotesComponent;
@ -148,6 +150,8 @@ import it.integry.integrywmsnative.view.dialogs.switch_user_depo.DialogSwitchUse
import it.integry.integrywmsnative.view.dialogs.switch_user_depo.DialogSwitchUserDepoModule;
import it.integry.integrywmsnative.view.dialogs.tracciamento_imballi.DialogTracciamentoImballiComponent;
import it.integry.integrywmsnative.view.dialogs.tracciamento_imballi.DialogTracciamentoImballiModule;
import it.integry.integrywmsnative.view.dialogs.update_available.DialogUpdateAvailableComponent;
import it.integry.integrywmsnative.view.dialogs.update_available.DialogUpdateAvailableModule;
// Definition of the Application graph
@Singleton
@ -223,8 +227,10 @@ import it.integry.integrywmsnative.view.dialogs.tracciamento_imballi.DialogTracc
ArticoliInGiacenzaModule.class,
DialogTracciamentoImballiModule.class,
DialogAskVettoreModule.class,
DialogAskVettoreModule.class,
DialogCreateNewArtModule.class,
DialogSwitchUserDepoModule.class
DialogSwitchUserDepoModule.class,
DialogUpdateAvailableModule.class
})
public interface MainApplicationComponent {
@ -371,10 +377,16 @@ public interface MainApplicationComponent {
DialogAskVettoreComponent.Factory dialogAskVettoreComponent();
DialogAskCommessaComponent.Factory dialogAskCommessaComponent();
DialogCreateNewArtComponent.Factory dialogCreateNewArtComponent();
DialogSwitchUserDepoComponent.Factory dialogSwitchUserDepoComponent();
ProdRientroMerceOrderListComponent.Factory prodRientroMerceOrderListComponent();
DialogUpdateAvailableComponent.Factory dialogUpdateAvailableComponent();
void inject(MainApplication mainApplication);
void inject(AppContext mainApplication);

View File

@ -36,12 +36,14 @@ import it.integry.integrywmsnative.core.rest.consumers.ImballiRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoAutomaticoRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoBufferRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MaterialiRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.PVOrdiniAcquistoRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.ProduzioneRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.VettoriRESTConsumer;
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
@ -205,6 +207,12 @@ public class MainApplicationModule {
return new AziendaRESTConsumer();
}
@Provides
@Singleton
ProduzioneRESTConsumer provideProduzioneRESTConsumer() {
return new ProduzioneRESTConsumer();
}
@Provides
@Singleton
BarcodeRESTConsumer provideBarcodeRESTConsumer(Ean128Service ean128Service) {
@ -313,6 +321,12 @@ public class MainApplicationModule {
return new MagazzinoBufferRESTConsumer();
}
@Provides
@Singleton
MaterialiRESTConsumer provideMaterialiRESTConsumer(ExecutorService executorService) {
return new MaterialiRESTConsumer(executorService);
}
@Provides
@Singleton
SoundAlertService provideSoundAlertService() {

View File

@ -85,7 +85,7 @@ public class BarcodeManager {
private static BarcodeCallbackDTO getValidCallback() {
if (mBarcodeCallbacksStacktrace.size() > 0) {
if (!mBarcodeCallbacksStacktrace.isEmpty()) {
return mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() - 1);
} else {
return null;
@ -106,7 +106,7 @@ public class BarcodeManager {
int newID = -1;
if (mBarcodeCallbacksStacktrace.size() > 0) {
if (!mBarcodeCallbacksStacktrace.isEmpty()) {
newID = mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() - 1).getID() + 1;
} else {
newID = 1;

View File

@ -88,7 +88,8 @@ public class MenuConfiguration extends BaseMenuConfiguration {
.setTitleText(R.string.free_picking)
.setTitleIcon(R.drawable.ic_dashboard_picking_libero)
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.free_picking, GestioneEnum.VENDITA, SettingsManager.iDB().isFlagAskClienteInPickingLibero(), false)))
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.free_picking, GestioneEnum.VENDITA,
SettingsManager.iDB().isFlagAskClienteInPickingLibero(), false, false)))
.addItem(new MenuItem()
.setID(R.id.nav_resi_cliente)
@ -124,7 +125,8 @@ public class MenuConfiguration extends BaseMenuConfiguration {
.setTitleText(R.string.free_lav_picking)
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_libero)
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.free_lav_picking, GestioneEnum.LAVORAZIONE, SettingsManager.iDB().isFlagAskClienteInPickingLibero(), false)))
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.free_lav_picking, GestioneEnum.LAVORAZIONE,
SettingsManager.iDB().isFlagAskClienteInPickingLibero(), false, SettingsManager.iDB().isFlagAskCommessaInPickingLiberoLav())))
.addItem(new MenuItem()
.setID(R.id.nav_prod_posizionamento_da_ord)
@ -180,7 +182,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
.setTitleText(R.string.prod_versamento_su_ordine_title_fragment)
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_su_ord)
.setDrawerIcon(R.drawable.ic_black_external)
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.prod_versamento_su_ordine_title_fragment, GestioneEnum.LAVORAZIONE, false, true)))
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.prod_versamento_su_ordine_title_fragment, GestioneEnum.LAVORAZIONE, false, true, false)))
.addItem(new MenuItem()
.setID(R.id.nav_prod_riposizionamento_da_ord)

View File

@ -30,7 +30,7 @@ public class DataCache {
Object foundDataCache = null;
if(dataCacheTemp != null && dataCacheTemp.size() > 0) {
if(dataCacheTemp != null && !dataCacheTemp.isEmpty()) {
foundDataCache = dataCacheTemp.get(0).getItem();
dataCacheList.remove(dataCacheTemp.get(0));
}

View File

@ -46,7 +46,7 @@ public class ColliDataRecoverService {
}
public boolean thereIsAnExistantSession() {
return mtbColtsSessions != null && mtbColtsSessions.size() > 0;
return mtbColtsSessions != null && !mtbColtsSessions.isEmpty();
}
public List<Integer> getAllSessionIDs() {

View File

@ -354,7 +354,7 @@ public class Converters {
view.addTextChangedListener(watcher);
}
BigDecimal newValue = bindableBigDecimal.get();
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
view.setText(UtilityNumber.decimalToString(newValue));
@ -381,7 +381,7 @@ public class Converters {
view.addTextChangedListener(watcher);
}
Integer newValue = bindableInteger.get();
Integer viewValue = view.getText().toString().trim().length() > 0 ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
Integer viewValue = !view.getText().toString().trim().isEmpty() ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
if (!(viewValue.compareTo(newValue) == 0)) {
view.setText(newValue.toString());
@ -432,7 +432,7 @@ public class Converters {
view.addTextChangedListener(watcher);
}
Integer newValue = observableInteger.get();
Integer viewValue = view.getText().toString().trim().length() > 0 ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
Integer viewValue = !view.getText().toString().trim().isEmpty() ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
if (!viewValue.equals(newValue) && newValue != null) {
view.setText(newValue.toString());
@ -459,7 +459,7 @@ public class Converters {
view.addTextChangedListener(watcher);
}
Long newValue = observableLong.get();
Long viewValue = view.getText().toString().trim().length() > 0 ? Long.valueOf(view.getText().toString()) : Long.valueOf(0);
Long viewValue = !view.getText().toString().trim().isEmpty() ? Long.valueOf(view.getText().toString()) : Long.valueOf(0);
if (!viewValue.equals(newValue) && newValue != null) {
view.setText(newValue.toString());
@ -838,6 +838,12 @@ public class Converters {
}
@BindingAdapter("visibilityWhenNotNull")
public static void bindViewVisibilityWhenNotNull(View view, Object genericObject) {
view.setVisibility(genericObject == null ? View.GONE : View.VISIBLE);
}
@BindingAdapter("visibilityWhenNull")
public static void bindViewVisibilityWhenNull(View view, ObservableField<?> bindableObject) {

View File

@ -1,14 +1,15 @@
package it.integry.integrywmsnative.core.di.binders.recyclerview;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ObservableArrayList;
import androidx.databinding.ObservableList;
import androidx.databinding.ViewDataBinding;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.lang.ref.WeakReference;
import java.util.Collection;

View File

@ -228,13 +228,13 @@ public class Ean128Service {
case SHIP_TO_POST -> model.ShipToPost = aiValue.toString();
case SHIP_TO_POST_ISO ->
model.ShipToPostISO = convertToIsoValueModel(aiValue.toString(), 0,
new Callable<String, String>() {
new Callable<>() {
@Override
public String call(String input) {
return input;
}
},
new CallableII<String, Integer, String>() {
new CallableII<>() {
@Override
public String call(String input, Integer input2) {
return input;
@ -300,7 +300,7 @@ public class Ean128Service {
T value = castFunc.call(splitFunc.call(sourceString.substring(3), numberOfDecimalDigits));
Ean128ISOValueModel<T> isoModel = new Ean128ISOValueModel<T>();
Ean128ISOValueModel<T> isoModel = new Ean128ISOValueModel<>();
isoModel.ISOCode = isoCode;
isoModel.Value = value;

View File

@ -2,15 +2,11 @@ package it.integry.integrywmsnative.core.expansion;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.KeyEvent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
import it.integry.pointmobilescannerlibrary.PointMobileBarcodeReader;
public class BaseDialog extends Dialog {

View File

@ -1,14 +1,16 @@
package it.integry.integrywmsnative.core.menu;
import androidx.annotation.NonNull;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.StbMenu;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -16,15 +18,15 @@ public class MenuRESTConsumer extends _BaseRESTConsumer {
public void retrieveMenu(String rootCodOpz, RunnableArgs<StbMenu> onComplete, RunnableArgs<Exception> onFailed) {
MenuRESTConsumerService menuRESTConsumerService = RESTBuilder.getService(MenuRESTConsumerService.class);
menuRESTConsumerService.retrieveMenuConfig(rootCodOpz).enqueue(new Callback<>() {
menuRESTConsumerService.retrieveMenuConfig(rootCodOpz).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<StbMenu>> call, Response<ServiceRESTResponse<StbMenu>> response) {
analyzeAnswer(response, "retrieveMenu", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<StbMenu>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<StbMenu>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -1,7 +1,5 @@
package it.integry.integrywmsnative.core.model;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import it.integry.integrywmsnative.core.utility.UtilityDate;

View File

@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.model;
public class JtbComt extends EntityBase {
private String codJcom;
private String codAnag;
private String codJfas;
private String codJflav;
private String descrizione;
@ -20,6 +21,15 @@ public class JtbComt extends EntityBase {
return this;
}
public String getCodAnag() {
return codAnag;
}
public JtbComt setCodAnag(String codAnag) {
this.codAnag = codAnag;
return this;
}
public String getCodJfas() {
return codJfas;
}

View File

@ -26,7 +26,7 @@ public class MtbColr extends EntityBase {
private String gestioneRif;
private String serColloRif;
private String note;
private String dataOrd;
private LocalDate dataOrd;
private String dataColloRif;
private BigDecimal qtaCnf;
private BigDecimal qtaCol;
@ -225,24 +225,15 @@ public class MtbColr extends EntityBase {
return this;
}
public String getDataOrdS() {
public LocalDate getDataOrd() {
return dataOrd;
}
public Date getDataOrdD() {
return UtilityDate.recognizeDateWithExceptionHandler(getDataOrdS());
}
public MtbColr setDataOrd(String dataOrd) {
public MtbColr setDataOrd(LocalDate dataOrd) {
this.dataOrd = dataOrd;
return this;
}
public MtbColr setDataOrd(Date dataOrd) {
this.dataOrd = UtilityDate.formatDate(dataOrd, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH);
return this;
}
public String getDataColloRifS() {
return dataColloRif;
}

View File

@ -103,7 +103,7 @@ public class MtbDepo extends EntityBase implements Parcelable {
return 0;
}
public static final Creator<MtbDepo> CREATOR = new Creator<MtbDepo>() {
public static final Creator<MtbDepo> CREATOR = new Creator<>() {
@Override
public MtbDepo createFromParcel(Parcel in) {
return new MtbDepo(in);

View File

@ -1,7 +1,5 @@
package it.integry.integrywmsnative.core.model;
import java.util.Date;
public class StbGestSetup extends EntityBase{
private String gestName;

View File

@ -55,7 +55,7 @@ public class VtbDest extends EntityBase implements Parcelable {
return 0;
}
public static final Creator<VtbDest> CREATOR = new Creator<VtbDest>() {
public static final Creator<VtbDest> CREATOR = new Creator<>() {
@Override
public VtbDest createFromParcel(Parcel in) {
return new VtbDest(in);

View File

@ -1,7 +1,5 @@
package it.integry.integrywmsnative.core.model;
import android.os.Parcelable;
import java.math.BigDecimal;
public class VtbVetr extends EntityBase {

View File

@ -19,6 +19,7 @@ import it.integry.integrywmsnative.core.model.MtbGrup;
import it.integry.integrywmsnative.core.model.MtbUntMis;
import it.integry.integrywmsnative.core.model.dto.StatoArticoloDTO;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.articolo.ArticoloDTO;
import it.integry.integrywmsnative.core.rest.model.articolo.RetrieveArticoloByCodMartRequestDTO;
@ -29,7 +30,6 @@ import it.integry.integrywmsnative.core.rest.model.articolo.SearchArticoloByBarc
import it.integry.integrywmsnative.core.rest.model.articolo.UpdateBarcodeImballoRequestDTO;
import it.integry.integrywmsnative.core.utility.UtilityQuery;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -46,15 +46,15 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
articoloRESTConsumerService
.retrieveAvailableUntMis()
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<MtbUntMis>> call, Response<ServiceRESTResponse<MtbUntMis>> response) {
analyzeAnswerList(response, "retrieveAvailableUntMis", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<MtbUntMis>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<MtbUntMis>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -63,15 +63,15 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
articoloRESTConsumerService
.retrieveAvailableGruppiMerceologici()
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<MtbGrup>> call, Response<ServiceRESTResponse<MtbGrup>> response) {
analyzeAnswerList(response, "retrieveAvailableGruppiMerceologici", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<MtbGrup>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<MtbGrup>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -85,7 +85,7 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
articoloRESTConsumerService
.searchByBarcode(request)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> call, Response<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> response) {
analyzeAnswer(response, "searchByBarcode", (m) -> {
@ -94,8 +94,8 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -105,7 +105,7 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
articoloRESTConsumerService
.findIfIsKit(mtbAart)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(@NonNull Call<ServiceRESTResponse<MtbAart>> call, @NonNull Response<ServiceRESTResponse<MtbAart>> response) {
analyzeAnswer(response, "findIfIsKit", (m) -> {
@ -114,8 +114,8 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(@NonNull Call<ServiceRESTResponse<MtbAart>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<MtbAart>> call, @NonNull Exception e) {
onFailed.run(e);
}
});
}
@ -135,15 +135,15 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
articoloRESTConsumer
.getByCodMart(new RetrieveArticoloByCodMartRequestDTO()
.setCodMarts(codMarts))
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<MtbAart>>> call, Response<ServiceRESTResponse<List<MtbAart>>> response) {
analyzeAnswer(response, "getByCodMart", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<MtbAart>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<MtbAart>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
@ -152,15 +152,15 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
public void getStatoPartita(String codMart, String partitaMag, RunnableArgs<List<StatoArticoloDTO>> onComplete, RunnableArgs<Exception> onFailed) {
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
articoloRESTConsumer.getStatoPartita(codMart, partitaMag).enqueue(new Callback<>() {
articoloRESTConsumer.getStatoPartita(codMart, partitaMag).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<StatoArticoloDTO>>> call, Response<ServiceRESTResponse<List<StatoArticoloDTO>>> response) {
analyzeAnswer(response, "getStatoPartita", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<StatoArticoloDTO>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<StatoArticoloDTO>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
@ -250,7 +250,7 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
articoloRESTConsumerService
.updateBarcodeImballo(request)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "updateBarcodeImballo", m -> {
@ -259,8 +259,8 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -274,7 +274,7 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
articoloRESTConsumerService
.saveArticolo(request)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<SaveArticoloResponseDTO>> call, Response<ServiceRESTResponse<SaveArticoloResponseDTO>> response) {
analyzeAnswer(response, "saveArticolo", data -> {
@ -283,8 +283,8 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<SaveArticoloResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<SaveArticoloResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -1,13 +1,15 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.Azienda;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -15,15 +17,15 @@ public class AziendaRESTConsumer extends _BaseRESTConsumer {
public void retrieveAzienda(RunnableArgs<Azienda> onComplete, RunnableArgs<Exception> onFailed) {
AziendaRESTConsumerService aziendaRESTConsumerService = RESTBuilder.getService(AziendaRESTConsumerService.class);
aziendaRESTConsumerService.retrieveDefaultAzienda().enqueue(new Callback<>() {
aziendaRESTConsumerService.retrieveDefaultAzienda().enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Azienda>> call, Response<ServiceRESTResponse<Azienda>> response) {
analyzeAnswer(response, "Retrieve default azienda", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Azienda>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Azienda>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -1,5 +1,7 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
@ -7,6 +9,7 @@ import it.integry.integrywmsnative.core.model.MtbColr;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliCaricoRESTConsumerInterface;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCRequestDTO;
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCResponseDTO;
@ -18,7 +21,6 @@ import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowResponseDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -28,15 +30,15 @@ public class ColliAccettazioneRESTConsumer extends _BaseRESTConsumer implements
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
colliAccettazioneRESTConsumerService.createUDC(createUDCRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Response<ServiceRESTResponse<CreateUDCResponseDTO>> response) {
analyzeAnswer(response, "accettazione/createUDC", data -> onComplete.run(data.getMtbColt()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
@ -47,15 +49,15 @@ public class ColliAccettazioneRESTConsumer extends _BaseRESTConsumer implements
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
colliAccettazioneRESTConsumerService.closeUDC(closeUDCRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Response<ServiceRESTResponse<CloseUDCResponseDTO>> response) {
analyzeAnswer(response, "accettazione/closeUDC", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -65,15 +67,15 @@ public class ColliAccettazioneRESTConsumer extends _BaseRESTConsumer implements
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
colliAccettazioneRESTConsumerService.insertUDCRow(insertUDCRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDCRowResponseDTO>> response) {
analyzeAnswer(response, "accettazione/insertUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -83,15 +85,15 @@ public class ColliAccettazioneRESTConsumer extends _BaseRESTConsumer implements
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
colliAccettazioneRESTConsumerService.editUDCRow(editUDCRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDCRowResponseDTO>> response) {
analyzeAnswer(response, "accettazione/editUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -101,15 +103,15 @@ public class ColliAccettazioneRESTConsumer extends _BaseRESTConsumer implements
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
colliAccettazioneRESTConsumerService.deleteUDCRow(deleteUDCRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "accettazione/deleteUDCRow", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -118,15 +120,15 @@ public class ColliAccettazioneRESTConsumer extends _BaseRESTConsumer implements
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
colliAccettazioneRESTConsumerService.checkIfBarcodeUlAlreadyRegistered(barcodeUl)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Boolean>> call, Response<ServiceRESTResponse<Boolean>> response) {
analyzeAnswer(response, "accettazione/checkIfBarcodeUlAlreadyRegistered", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -1,5 +1,7 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import java.math.BigDecimal;
import javax.inject.Singleton;
@ -12,6 +14,7 @@ import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliCaricoRESTConsumerInterface;
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliScaricoRESTConsumerInterface;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCRequestDTO;
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCResponseDTO;
@ -34,7 +37,6 @@ import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -52,15 +54,15 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.createUDC(createUDCRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Response<ServiceRESTResponse<CreateUDCResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/createUDC", data -> onComplete.run(data.getMtbColt()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -70,15 +72,15 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.closeUDC(closeUDCRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Response<ServiceRESTResponse<CloseUDCResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/closeUDC", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -88,15 +90,15 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.insertUDCRow(insertUDCRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDCRowResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/insertUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -106,15 +108,15 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.editUDCRow(editUDCRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDCRowResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/editUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -123,15 +125,15 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.createUDS(createUDSRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Response<ServiceRESTResponse<CreateUDSResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/createUDS", data -> onComplete.run(data.getMtbColt()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
@ -142,15 +144,15 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.closeUDS(closeUDSRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Response<ServiceRESTResponse<CloseUDSResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/closeUDS", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -160,15 +162,15 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.insertUDSRow(insertUDSRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDSRowResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/insertUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -177,15 +179,15 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.editUDSRow(editUDSRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDSRowResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/editUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -195,15 +197,15 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.deleteUDSRow(deleteUDSRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "lavorazione/deleteUDSRow", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -213,15 +215,15 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.deleteUDCRow(deleteUDCRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "lavorazione/deleteUDCRow", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -252,15 +254,15 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.createUDSFromArt(createUDSFromArtRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "lavorazione/createUDSFromArt", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -1,5 +1,6 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import androidx.databinding.ObservableArrayList;
import com.annimon.stream.Optional;
@ -29,9 +30,11 @@ import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULResponseDTO;
import it.integry.integrywmsnative.core.rest.model.SpostaULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.UpdateTipoULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
@ -45,7 +48,6 @@ import it.integry.integrywmsnative.core.utility.UtilityQuery;
import it.integry.integrywmsnative.core.utility.UtilityString;
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -81,7 +83,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
.setMtbPartitaMag(null));
}
this.mEntityRESTConsumer.processEntity(mtbColtToSaveClone, new ISimpleOperationCallback<MtbColt>() {
this.mEntityRESTConsumer.processEntity(mtbColtToSaveClone, new ISimpleOperationCallback<>() {
@Override
public void onSuccess(MtbColt value) {
if (onComplete != null) onComplete.run(value);
@ -284,7 +286,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
public void getBySSCC(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new Callback<>() {
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
analyzeAnswer(response, "GetBySSCC", mtbColt -> {
@ -301,8 +303,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -325,7 +327,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
ArticoloRESTConsumer.getByCodMartsStatic(codMarts, arts -> {
if (arts != null && arts.size() > 0) {
if (arts != null && !arts.isEmpty()) {
for (MtbColt mtbColt : mtbColts) {
for (MtbColr mtbColr : mtbColt.getMtbColr()) {
@ -334,7 +336,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
List<MtbAart> mtbAartStream = Stream.of(arts)
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart())).toList();
if (mtbAartStream != null && mtbAartStream.size() > 0) {
if (mtbAartStream != null && !mtbAartStream.isEmpty()) {
foundMtbAart = mtbAartStream.get(0);
}
@ -384,27 +386,28 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.getColloInGiac(onlyResiduo, throwExcIfNull, testata).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
@Override
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
analyzeAnswer(response, "getColloInGiac", mtbColt -> {
colliMagazzinoRESTConsumerService.getColloInGiac(onlyResiduo, throwExcIfNull, testata)
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
analyzeAnswer(response, "getColloInGiac", mtbColt -> {
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
List<MtbColt> mtbColtList = new ArrayList<>();
mtbColtList.add(mtbColt);
fillMtbAartsOfMtbColts(mtbColtList, mtbColts -> onComplete.run(mtbColts.get(0)), onFailed);
} else {
onComplete.run(mtbColt);
if (mtbColt != null && mtbColt.getMtbColr() != null && !mtbColt.getMtbColr().isEmpty()) {
List<MtbColt> mtbColtList = new ArrayList<>();
mtbColtList.add(mtbColt);
fillMtbAartsOfMtbColts(mtbColtList, mtbColts -> onComplete.run(mtbColts.get(0)), onFailed);
} else {
onComplete.run(mtbColt);
}
}, onFailed);
}
}, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
@Override
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void spostaUL(MtbColt mtbColtToMove, String codMdep, String posizione, boolean createDocAutomatically, Runnable onComplete, RunnableArgs<Exception> onFailed) {
@ -425,7 +428,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService
.spostaUL(spostaUlRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "spostaUL", mtbColts -> {
@ -434,8 +437,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
@ -460,7 +463,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService
.updateTipoUL(updateTipoULRequest)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "updateTipoUL", mtbColts -> {
@ -469,8 +472,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
@ -494,7 +497,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
public static void retrieveBasketColli(RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.getColliInBasket(SettingsManager.i().getUserSession().getDepo().getCodMdep()).enqueue(new Callback<ServiceRESTResponse<List<MtbColt>>>() {
colliMagazzinoRESTConsumerService.getColliInBasket(SettingsManager.i().getUserSession().getDepo().getCodMdep()).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<MtbColt>>> call, Response<ServiceRESTResponse<List<MtbColt>>> response) {
analyzeAnswer(response, "getColliInBasket", mtbColts -> {
@ -503,8 +506,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<MtbColt>>> call, Throwable t) {
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<MtbColt>>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
@ -523,20 +526,20 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
colliMagazzinoRESTConsumerService.creaRettificaCollo(
SettingsManager.i().getUserSession().getDepo().getCodMdep(),
rettificaULDTO
).enqueue(new Callback<>() {
).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<MtbColr>> call, Response<ServiceRESTResponse<MtbColr>> response) {
analyzeAnswer(response, "creaRettificaCollo", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<MtbColr>> call, Throwable t) {
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<MtbColr>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destMtbColt, boolean flagForceUseRefs, RunnableArgs<List<MtbColr>> onComplete, RunnableArgs<Exception> onFailed) {
new Thread(() -> {
MtbColt mtbColtToMoveClone = (MtbColt) sourceMtbColt.clone();
MtbColt mtbColtDestClone = (MtbColt) destMtbColt.clone();
@ -551,20 +554,21 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO = new SpostaArtsTraULRequestDTO()
.setSourceMtbColt(mtbColtToMoveClone)
.setDestinationMtbColt(mtbColtDestClone);
.setDestinationMtbColt(mtbColtDestClone)
.setFlagForceUseRefs(flagForceUseRefs);
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.spostaArtsTraUL(spostaArtsTraULRequestDTO).enqueue(new Callback<>() {
colliMagazzinoRESTConsumerService.spostaArtsTraUL(spostaArtsTraULRequestDTO).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
public void onResponse(Call<ServiceRESTResponse<SpostaArtsTraULResponseDTO>> call, Response<ServiceRESTResponse<SpostaArtsTraULResponseDTO>> response) {
analyzeAnswer(response, "spostaArtsTraUL", data -> {
onComplete.run();
onComplete.run(data.getGeneratedMtbColr());
}, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<SpostaArtsTraULResponseDTO>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}).start();
@ -580,7 +584,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.assegnaLottoSuColloScarico(sourceMtbColtClone).enqueue(new Callback<>() {
colliMagazzinoRESTConsumerService.assegnaLottoSuColloScarico(sourceMtbColtClone).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
analyzeAnswer(response, "assegnaLottoSuColloScarico", data -> {
@ -589,8 +593,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
@ -605,7 +609,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.versamentoAutomaticoUL(sourceMtbColtClone).enqueue(new Callback<>() {
colliMagazzinoRESTConsumerService.versamentoAutomaticoUL(sourceMtbColtClone).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> call, Response<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> response) {
analyzeAnswer(response, "versamentoAutomaticoUL", data -> {
@ -642,8 +646,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> call, Throwable t) {
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
@ -653,7 +657,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
sourceMtbColtClone.setMtbColr(new ObservableArrayList<>());
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.confirmGiacenzaUL(sourceMtbColtClone).enqueue(new Callback<>() {
colliMagazzinoRESTConsumerService.confirmGiacenzaUL(sourceMtbColtClone).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
analyzeAnswer(response, "confirmGiacenzaUL", data -> {
@ -663,8 +667,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Object>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
@ -703,15 +707,15 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.canULBeDeleted(canULBeDeletedRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Boolean>> call, Response<ServiceRESTResponse<Boolean>> response) {
analyzeAnswer(response, "generic/canULBeDeleted", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
@ -721,15 +725,15 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.deleteUL(deleteULRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "generic/deleteUL", Void -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
@ -744,15 +748,15 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.printUL(printULRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "generic/printUL", Void -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});

View File

@ -7,6 +7,7 @@ import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULResponseDTO;
import it.integry.integrywmsnative.core.rest.model.SpostaULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.UpdateTipoULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
@ -40,7 +41,7 @@ public interface ColliMagazzinoRESTConsumerService {
Call<ServiceRESTResponse<Void>> spostaUL(@Body SpostaULRequestDTO requestDto);
@POST("wms/spostaArtsTraUL")
Call<ServiceRESTResponse<Void>> spostaArtsTraUL(@Body SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO);
Call<ServiceRESTResponse<SpostaArtsTraULResponseDTO>> spostaArtsTraUL(@Body SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO);
@POST("wms/assegnaLottoSuColloScarico")
Call<ServiceRESTResponse<MtbColt>> assegnaLottoSuColloScarico(@Body MtbColt mtbColt);

View File

@ -9,6 +9,7 @@ import it.integry.integrywmsnative.core.model.MtbColr;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliScaricoRESTConsumerInterface;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
@ -22,7 +23,6 @@ import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -33,15 +33,15 @@ public class ColliSpedizioneRESTConsumer extends _BaseRESTConsumer implements Co
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.createUDS(createUDSRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Response<ServiceRESTResponse<CreateUDSResponseDTO>> response) {
analyzeAnswer(response, "spedizione/createUDS", data -> onComplete.run(data.getMtbColt()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
@ -51,15 +51,15 @@ public class ColliSpedizioneRESTConsumer extends _BaseRESTConsumer implements Co
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.closeUDS(closeUDSRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Response<ServiceRESTResponse<CloseUDSResponseDTO>> response) {
analyzeAnswer(response, "spedizione/closeUDS", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
@ -69,15 +69,15 @@ public class ColliSpedizioneRESTConsumer extends _BaseRESTConsumer implements Co
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.insertUDSRow(insertUDSRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDSRowResponseDTO>> response) {
analyzeAnswer(response, "spedizione/insertUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -86,15 +86,15 @@ public class ColliSpedizioneRESTConsumer extends _BaseRESTConsumer implements Co
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.editUDSRow(editUDSRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDSRowResponseDTO>> response) {
analyzeAnswer(response, "spedizione/editUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -103,15 +103,15 @@ public class ColliSpedizioneRESTConsumer extends _BaseRESTConsumer implements Co
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.deleteUDSRow(deleteUDSRowRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "spedizione/deleteUDSRow", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
@ -121,14 +121,14 @@ public class ColliSpedizioneRESTConsumer extends _BaseRESTConsumer implements Co
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.duplicateUDS(duplicateUDSRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(@NonNull Call<ServiceRESTResponse<DuplicateUDSResponseDTO>> call, @NonNull Response<ServiceRESTResponse<DuplicateUDSResponseDTO>> response) {
analyzeAnswer(response, "spedizione/duplicateUDS", onComplete, onFailed);
}
@Override
public void onFailure(@NonNull Call<ServiceRESTResponse<DuplicateUDSResponseDTO>> call, @NonNull Throwable t) {
public void onFailure(@NonNull Call<ServiceRESTResponse<DuplicateUDSResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(new Exception());
}
});

View File

@ -1,12 +1,12 @@
package it.integry.integrywmsnative.core.rest.consumers;
import com.annimon.stream.Stream;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
import javax.inject.Singleton;
@ -26,15 +26,15 @@ public class CommessaRESTConsumer extends _BaseRESTConsumer {
public void getJtbComts(List<String> itemsToFind, RunnableArgs<List<JtbComt>> onComplete, RunnableArgs<Exception> onFailed) {
var whereCondMap = Stream.of(itemsToFind)
.withoutNulls()
var whereCondMap = itemsToFind.stream()
.filter(x -> !UtilityString.isNullOrEmpty(x))
.map(x -> {
HashMap<String, Object> vars = new HashMap<>();
vars.put("cod_jcom", x);
return vars;
HashMap<String, Object> codJcom = new HashMap<>() {{
put("cod_jcom", x);
}};
return codJcom;
})
.toList();
.collect(Collectors.toUnmodifiableList());
if(whereCondMap.isEmpty()) {
onComplete.run(new ArrayList<>());

View File

@ -2,7 +2,6 @@ package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import java.util.Date;
import java.util.List;
import javax.inject.Singleton;
@ -10,11 +9,11 @@ import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.DtbDoct;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.LoadColliDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.documento.RetrieveDocumentoArtsResponseDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -23,30 +22,30 @@ public class DocumentRESTConsumer extends _BaseRESTConsumer {
public void createDocsFromColli(List<LoadColliDTO> listColli, RunnableArgs<List<DtbDoct>> onComplete, RunnableArgs<Exception> onFailed) {
DocumentiRESTConsumerService documentiRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
documentiRESTConsumerService.createDocsFromColli(listColli).enqueue(new Callback<>() {
documentiRESTConsumerService.createDocsFromColli(listColli).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<DtbDoct>>> call, Response<ServiceRESTResponse<List<DtbDoct>>> response) {
analyzeAnswer(response, "createDocsFromColli", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<DtbDoct>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<DtbDoct>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void createDocFromColli(LoadColliDTO loadColliDTO, RunnableArgs<DtbDoct> onComplete, RunnableArgs<Exception> onFailed) {
DocumentiRESTConsumerService documentiRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
documentiRESTConsumerService.createDocFromColli(loadColliDTO).enqueue(new Callback<>() {
documentiRESTConsumerService.createDocFromColli(loadColliDTO).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<DtbDoct>> call, Response<ServiceRESTResponse<DtbDoct>> response) {
analyzeAnswer(response, "createDocFromColli", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<DtbDoct>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<DtbDoct>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -54,15 +53,15 @@ public class DocumentRESTConsumer extends _BaseRESTConsumer {
public void checkDocument(String fornitore, String numDoc, String dataDoc, String tipoDoc, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
var inventarioRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
inventarioRESTConsumerService.checkDocument(fornitore, numDoc,tipoDoc, dataDoc)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@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 onFailure(@NonNull Call<ServiceRESTResponse<Boolean>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -70,15 +69,15 @@ public class DocumentRESTConsumer extends _BaseRESTConsumer {
public void loadDocumentAvailableArts(String codDtip, String codMgrp, String codAnagForn, RunnableArgs<RetrieveDocumentoArtsResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
var inventarioRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
inventarioRESTConsumerService.retrieveArts(codDtip, codMgrp, codAnagForn)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> response) {
analyzeAnswer(response, "loadDocumentoArts", onComplete, onFailed);
}
@Override
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> call, @NonNull Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -1,6 +1,5 @@
package it.integry.integrywmsnative.core.rest.consumers;
import java.util.Date;
import java.util.List;
import it.integry.integrywmsnative.core.model.DtbDoct;

View File

@ -2,6 +2,8 @@ package it.integry.integrywmsnative.core.rest.consumers;
import android.util.Log;
import androidx.annotation.NonNull;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
@ -13,11 +15,11 @@ import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.EntityBase;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.EsitoType;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.utility.UtilityGson;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -33,7 +35,7 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
service
.processEntity(entityToSave)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
if (response.isSuccessful()) {
@ -59,9 +61,8 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
Log.e("EntityRESTConsumer", t.toString());
tmpFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, @NonNull final Exception e) {
tmpFailed.run(e);
}
});
@ -76,7 +77,7 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
Call<List<ServiceRESTResponse<JsonObject>>> request = service.processEntityList(singleTransaction, entitiesToSave);
request.enqueue(new Callback<>() {
request.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<List<ServiceRESTResponse<JsonObject>>> call, Response<List<ServiceRESTResponse<JsonObject>>> response) {
if (response.isSuccessful()) {
@ -112,9 +113,8 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<List<ServiceRESTResponse<JsonObject>>> call, Throwable t) {
Log.e("EntityRESTConsumer", t.toString());
tmpFailed.run(new Exception(t));
public void onFailure(Call<List<ServiceRESTResponse<JsonObject>>> call, @NonNull final Exception e) {
tmpFailed.run(e);
}
});
@ -126,7 +126,7 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
Call<ServiceRESTResponse<JsonObject>> request = service.processEntity(entityToSave);
request.enqueue(new Callback<>() {
request.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
if (response.isSuccessful()) {
@ -136,7 +136,7 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
Gson gson = UtilityGson.createObject();
List<JsonObject> jsons = response.body().getEntityList();
List<T> newList = new ArrayList<T>();
List<T> newList = new ArrayList<>();
if (jsons != null) {
for (int i = 0; i < jsons.size(); i++) {
@ -163,9 +163,8 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
Log.e("EntityRESTConsumer", t.toString());
callback.onFailed(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, @NonNull final Exception e) {
callback.onFailed(e);
}
});

View File

@ -1,6 +1,6 @@
package it.integry.integrywmsnative.core.rest.consumers;
import android.util.Log;
import androidx.annotation.NonNull;
import java.util.List;
import java.util.stream.Collectors;
@ -10,12 +10,11 @@ import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.StbGestSetup;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.GestSetupDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.settings.StbGestSetupReader;
import it.integry.integrywmsnative.core.utility.UtilityLogger;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -25,17 +24,15 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
service.getGestSetupValue(gestName, sectionName, keySection)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<GestSetupDTO>> call, Response<ServiceRESTResponse<GestSetupDTO>> response) {
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
Log.e("GestSetup", t.toString());
// UtilityLogger.errorMe(new Exception(t));
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
@ -52,17 +49,15 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
public void getValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
service.getGestSetupValue(gestName, sectionName, keySection, codMdep).enqueue(new Callback<ServiceRESTResponse<GestSetupDTO>>() {
service.getGestSetupValue(gestName, sectionName, keySection, codMdep).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<GestSetupDTO>> call, Response<ServiceRESTResponse<GestSetupDTO>> response) {
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
Log.e("PrintCollo", t.toString());
UtilityLogger.error(new Exception(t));
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
@ -82,7 +77,7 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
var stbGestSetups = stbGestSetupList.stream().map(x -> (StbGestSetup) x).collect(Collectors.toList());
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
service.getGestSetupValues(codMdep, stbGestSetups).enqueue(new Callback<>() {
service.getGestSetupValues(codMdep, stbGestSetups).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Response<ServiceRESTResponse<List<StbGestSetup>>> response) {
analyzeAnswer(response, "GestSetup", data -> {
@ -100,9 +95,8 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Throwable t) {
UtilityLogger.error(new Exception(t));
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<StbGestSetup>>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}

View File

@ -1,5 +1,7 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import com.annimon.stream.Optional;
import com.annimon.stream.Stream;
@ -13,13 +15,13 @@ import it.integry.integrywmsnative.core.model.MtbAart;
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationIncomingItemDto;
import it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationResponseDto;
import it.integry.integrywmsnative.core.utility.UtilityString;
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto.ArtsInGiacenzaDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -34,7 +36,7 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
public void getGiacenzeInPosizione(MtbDepoPosizione posizione, RunnableArgs<List<MvwSitArtUdcDetInventario>> onComplete, RunnableArgs<Exception> onFailed) {
GiacenzaRESTConsumerService giacenzaRESTConsumerService = RESTBuilder.getService(GiacenzaRESTConsumerService.class);
giacenzaRESTConsumerService.retrieveAvailableItems(posizione.getPosizione()).enqueue(new Callback<>() {
giacenzaRESTConsumerService.retrieveAvailableItems(posizione.getPosizione()).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Response<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> response) {
analyzeAnswer(response, "getGiacenzeInPosizione", inventarioList -> {
@ -68,15 +70,15 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
public void getGiacenzeInPosizione(List<String> posizioni, boolean withTestataCollo, RunnableArgs<List<ArtsInGiacenzaDTO>> onComplete, RunnableArgs<Exception> onFailed) {
GiacenzaRESTConsumerService giacenzaRESTConsumerService = RESTBuilder.getService(GiacenzaRESTConsumerService.class);
giacenzaRESTConsumerService.retrieveAvailableItems(posizioni, withTestataCollo).enqueue(new Callback<>() {
giacenzaRESTConsumerService.retrieveAvailableItems(posizioni, withTestataCollo).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> call, Response<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> response) {
analyzeAnswer(response, "getGiacenzeInPosizione", inventarioList -> {
@ -110,8 +112,8 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -122,7 +124,7 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
UtilityString.isNullOrEmpty(partitaMag) ?
giacenzaRESTConsumerService.retrieveAvailableItemsByArt(codMart) :
giacenzaRESTConsumerService.retrieveAvailableItemsByArt(codMart, partitaMag);
serviceRESTResponseCall.enqueue(new Callback<>() {
serviceRESTResponseCall.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Response<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> response) {
analyzeAnswer(response, "getGiacenzeByArticolo", inventarioList -> {
@ -153,8 +155,8 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -164,7 +166,7 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
GiacenzaRESTConsumerService giacenzaRESTConsumerService = RESTBuilder.getService(GiacenzaRESTConsumerService.class);
giacenzaRESTConsumerService.retrieveInstantItemSituation(codMdep, codMart, partitaMag, codJcom)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<InstantItemSituationResponseDto>> call, Response<ServiceRESTResponse<InstantItemSituationResponseDto>> response) {
analyzeAnswer(response, "getInstantItemSituation", data -> {
@ -174,8 +176,8 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<InstantItemSituationResponseDto>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<InstantItemSituationResponseDto>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -2,9 +2,7 @@ package it.integry.integrywmsnative.core.rest.consumers;
import java.util.List;
import it.integry.integrywmsnative.core.model.DtbDoct;
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
import it.integry.integrywmsnative.core.rest.model.LoadColliDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationResponseDto;
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto.ArtsInGiacenzaDTO;

View File

@ -9,12 +9,12 @@ import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbInvent;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.inventario.InsertInventarioRequestDTO;
import it.integry.integrywmsnative.core.rest.model.inventario.RetrieveInventarioArtsResponseDTO;
import it.integry.integrywmsnative.core.rest.model.inventario.RetrieveInventarioResponseDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -24,15 +24,15 @@ public class InventarioRESTConsumer extends _BaseRESTConsumer {
public void loadInventario(long inventoryId, RunnableArgs<RetrieveInventarioResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
var inventarioRESTConsumerService = RESTBuilder.getService(InventarioRESTConsumerService.class);
inventarioRESTConsumerService.retrieve(inventoryId)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveInventarioResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveInventarioResponseDTO>> response) {
analyzeAnswer(response, "loadInventario", onComplete, onFailed);
}
@Override
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveInventarioResponseDTO>> call, @NonNull Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveInventarioResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -41,15 +41,15 @@ public class InventarioRESTConsumer extends _BaseRESTConsumer {
public void loadInventarioArts(long inventoryId, RunnableArgs<RetrieveInventarioArtsResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
var inventarioRESTConsumerService = RESTBuilder.getService(InventarioRESTConsumerService.class);
inventarioRESTConsumerService.retrieveArts(inventoryId)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveInventarioArtsResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveInventarioArtsResponseDTO>> response) {
analyzeAnswer(response, "loadInventarioArts", onComplete, onFailed);
}
@Override
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveInventarioArtsResponseDTO>> call, @NonNull Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveInventarioArtsResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -73,15 +73,15 @@ public class InventarioRESTConsumer extends _BaseRESTConsumer {
var inventarioRESTConsumerService = RESTBuilder.getService(InventarioRESTConsumerService.class, 300);
inventarioRESTConsumerService
.insert(inventarioToInsert.getIdInventario(), request)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "insertInventario", ignored -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});

View File

@ -1,15 +1,17 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPickItemsRequestDTO;
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPutItemsRequestDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -18,15 +20,15 @@ public class MagazzinoAutomaticoRESTConsumer extends _BaseRESTConsumer {
public void pickItems(MtbDepoPosizione posizione, MagazzinoAutomaticoPickItemsRequestDTO magazzinoAutomaticoPickItemsRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
MagazzinoAutomaticoRESTConsumerService magazzinoAutomaticoRESTConsumerService = RESTBuilder.getService(MagazzinoAutomaticoRESTConsumerService.class);
magazzinoAutomaticoRESTConsumerService.pickItems(posizione.getPosizione(), magazzinoAutomaticoPickItemsRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "magazzino-automatico/pickItems", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
@ -36,15 +38,15 @@ public class MagazzinoAutomaticoRESTConsumer extends _BaseRESTConsumer {
public void putItems(MtbDepoPosizione posizione, MagazzinoAutomaticoPutItemsRequestDTO magazzinoAutomaticoPutItemsRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
MagazzinoAutomaticoRESTConsumerService magazzinoAutomaticoRESTConsumerService = RESTBuilder.getService(MagazzinoAutomaticoRESTConsumerService.class);
magazzinoAutomaticoRESTConsumerService.putItems(posizione.getPosizione(), magazzinoAutomaticoPutItemsRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "magazzino-automatico/putItems", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -1,15 +1,17 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.magazzino_buffer.MagazzinoBufferVersamentoMaterialeCloseRequestDTO;
import it.integry.integrywmsnative.core.rest.model.magazzino_buffer.MagazzinoBufferVersamentoMaterialeRequestDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -18,15 +20,15 @@ public class MagazzinoBufferRESTConsumer extends _BaseRESTConsumer {
public void isVersamentoStarted(MtbDepoPosizione posizione, MagazzinoBufferVersamentoMaterialeRequestDTO magazzinoBufferVersamentoMaterialeRequestDTO, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
MagazzinoBufferRESTConsumerService magazzinoBufferRESTConsumerService = RESTBuilder.getService(MagazzinoBufferRESTConsumerService.class);
magazzinoBufferRESTConsumerService.isVersamentoStarted(posizione.getPosizione(), magazzinoBufferVersamentoMaterialeRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Boolean>> call, Response<ServiceRESTResponse<Boolean>> response) {
analyzeAnswer(response, "magazzino-buffer/isVersamentoStarted", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -34,15 +36,15 @@ public class MagazzinoBufferRESTConsumer extends _BaseRESTConsumer {
public void startVersamentoMateriale(MtbDepoPosizione posizione, MagazzinoBufferVersamentoMaterialeRequestDTO magazzinoBufferVersamentoMaterialeRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
MagazzinoBufferRESTConsumerService magazzinoBufferRESTConsumerService = RESTBuilder.getService(MagazzinoBufferRESTConsumerService.class);
magazzinoBufferRESTConsumerService.startVersamentoMateriale(posizione.getPosizione(), magazzinoBufferVersamentoMaterialeRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "magazzino-buffer/startVersamentoMateriale", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -50,15 +52,15 @@ public class MagazzinoBufferRESTConsumer extends _BaseRESTConsumer {
public void endVersamentoMateriale(MtbDepoPosizione posizione, MagazzinoBufferVersamentoMaterialeCloseRequestDTO magazzinoBufferVersamentoMaterialeCloseRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
MagazzinoBufferRESTConsumerService magazzinoBufferRESTConsumerService = RESTBuilder.getService(MagazzinoBufferRESTConsumerService.class);
magazzinoBufferRESTConsumerService.endVersamentoMateriale(posizione.getPosizione(), magazzinoBufferVersamentoMaterialeCloseRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "magazzino-buffer/endVersamentoMateriale", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -9,14 +9,13 @@ import java.util.concurrent.ExecutorService;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.utility.UtilityDate;
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -33,15 +32,15 @@ public class MagazzinoRESTConsumer extends _BaseRESTConsumer {
public void saveTerminalinoWMS(SaveDTO saveDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
MagazzinoRESTConsumerService service = RESTBuilder.getService(MagazzinoRESTConsumerService.class);
service.saveTerminalinoWMS(saveDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "saveTerminalinoWMS", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -69,15 +68,15 @@ public class MagazzinoRESTConsumer extends _BaseRESTConsumer {
public void retrieveAllPartitaMag(List<String> codMarts, Date dataScad, RunnableArgs<List<MtbPartitaMag>> onComplete, RunnableArgs<Exception> onFailed) {
MagazzinoRESTConsumerService service = RESTBuilder.getService(MagazzinoRESTConsumerService.class);
service.retrieveAllPartitaMag(codMarts, UtilityDate.formatDate(dataScad, UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH))
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(@NonNull Call<ServiceRESTResponse<List<MtbPartitaMag>>> call, @NonNull Response<ServiceRESTResponse<List<MtbPartitaMag>>> response) {
analyzeAnswer(response, "retrieveAllPartitaMag", onComplete, onFailed);
}
@Override
public void onFailure(@NonNull Call<ServiceRESTResponse<List<MtbPartitaMag>>> call, @NonNull Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(@NonNull Call<ServiceRESTResponse<List<MtbPartitaMag>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -0,0 +1,44 @@
package it.integry.integrywmsnative.core.rest.consumers;
import java.util.concurrent.ExecutorService;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.model.materiali.RecuperaMaterialiRequestDTO;
@Singleton
public class MaterialiRESTConsumer extends _BaseRESTConsumer {
private final ExecutorService executorService;
public MaterialiRESTConsumer(ExecutorService executorService) {
this.executorService = executorService;
}
public MtbColt makeSynchronousRecuperaRequest(RecuperaMaterialiRequestDTO request) throws Exception {
var materialiRESTConsumerService = RESTBuilder.getService(MaterialiRESTConsumerService.class);
var response = materialiRESTConsumerService.recupera(request)
.execute();
var data = analyzeAnswer(response, "recuperaMateriali");
if (data == null) return null;
return data.getUpdatedMtbColtScarico();
}
public void makeRecuperaRequest(RecuperaMaterialiRequestDTO request, final RunnableArgs<MtbColt> onComplete, final RunnableArgs<Exception> onFailed) {
executorService.execute(() -> {
try {
var response = makeSynchronousRecuperaRequest(request);
if (onComplete != null) onComplete.run(response);
} catch (Exception ex) {
if (onFailed != null) onFailed.run(ex);
}
});
}
}

View File

@ -0,0 +1,15 @@
package it.integry.integrywmsnative.core.rest.consumers;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.materiali.RecuperaMaterialiRequestDTO;
import it.integry.integrywmsnative.core.rest.model.materiali.RecuperaMaterialiResponseDTO;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;
public interface MaterialiRESTConsumerService {
@POST("wms/materiali/recupera")
Call<ServiceRESTResponse<RecuperaMaterialiResponseDTO>> recupera(@Body RecuperaMaterialiRequestDTO request);
}

View File

@ -1,10 +1,11 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.inject.Singleton;
@ -12,12 +13,11 @@ import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.JtbFasi;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.utility.UtilityDB;
import it.integry.integrywmsnative.core.utility.UtilityDate;
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -33,15 +33,15 @@ public class MesRESTConsumer extends _BaseRESTConsumer {
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
mesRESTConsumerService.getOrdiniLavorazioneMateriale(codJfas, idMateriale)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
analyzeAnswer(response, "getOrdiniLavorazioneMateriale", (m) -> onComplete.run(response.body().getDto()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -50,15 +50,15 @@ public class MesRESTConsumer extends _BaseRESTConsumer {
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
mesRESTConsumerService.getOrdiniLavorazione(null, flagEvaso, codJfas, codAnag)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
analyzeAnswer(response, "getOrdiniLavorazione", (m) -> onComplete.run(response.body().getDto()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -68,15 +68,15 @@ public class MesRESTConsumer extends _BaseRESTConsumer {
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
mesRESTConsumerService.getOrdiniLavorazione(flagEvaso)
.enqueue(new Callback<ServiceRESTResponse<List<OrdineLavorazioneDTO>>>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
analyzeAnswer(response, "getOrdiniLavorazione", (m) -> onComplete.run(response.body().getDto()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -1,5 +1,7 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import com.annimon.stream.Optional;
import com.annimon.stream.Stream;
import com.google.gson.reflect.TypeToken;
@ -21,17 +23,16 @@ import it.integry.integrywmsnative.core.model.MtbPartitaMag;
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.GetPickingListDTO;
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
import it.integry.integrywmsnative.core.utility.UtilityDB;
import it.integry.integrywmsnative.core.utility.UtilityLogger;
import it.integry.integrywmsnative.core.utility.UtilityQuery;
import it.integry.integrywmsnative.core.utility.UtilityString;
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -49,7 +50,7 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class, 90);
service
.getSuggestedPickingList(codMdep, sitArtOrdList)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<PickingObjectDTO>>> call, Response<ServiceRESTResponse<List<PickingObjectDTO>>> response) {
analyzeAnswer(response, "getSuggestedPickingList", pickingObjects -> {
@ -109,8 +110,8 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<PickingObjectDTO>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<PickingObjectDTO>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
@ -126,7 +127,7 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class);
service.getOrdiniInevasi(codMdep, gestione.getText())
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> call, Response<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> response) {
analyzeAnswer(response, "getOrdiniInevasi", responseDtoList -> {
@ -139,9 +140,8 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> call, Throwable t) {
Logger.e(t, "Errore durante il caricamento degli ordini di lavorazione");
if (onFailed != null) onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> call, @NonNull final Exception e) {
if (onFailed != null) onFailed.run(e);
}
});
}
@ -158,7 +158,7 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class, 90);
service.getArticoliFromOrdini(codMdep, getPickingListDTOs).enqueue(new Callback<>() {
service.getArticoliFromOrdini(codMdep, getPickingListDTOs).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Response<ServiceRESTResponse<List<SitArtOrdDTO>>> response) {
analyzeAnswer(response, "retrieveListaArticoliFromOrdiniUscita", sitArtOrds -> {
@ -173,9 +173,8 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Throwable t) {
UtilityLogger.error(new Exception(t));
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -2,6 +2,8 @@ package it.integry.integrywmsnative.core.rest.consumers;
import android.util.Log;
import androidx.annotation.NonNull;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
@ -14,14 +16,13 @@ import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
import it.integry.integrywmsnative.core.data_store.db.view_model.OrdiniAcquistoGrigliaDTO;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.utility.UtilityDate;
import it.integry.integrywmsnative.core.utility.UtilityLogger;
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.ArtDTO;
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.OrdineDTO;
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -36,7 +37,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
public void retrieveArticoli(String codAlis, String codMdep, RunnableArgs<OrdiniAcquistoGrigliaDTO> onSuccess, RunnableArgs<Exception> onFailed) {
PVOrdiniAcquistoRESTConsumerService ordiniARestService = RESTBuilder.getService(PVOrdiniAcquistoRESTConsumerService.class, 300);
ordiniARestService.retrieveArticoli(codAlis, codMdep, null)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, Response<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> response) {
var startTime = new Date().getTime();
@ -47,8 +48,8 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -56,7 +57,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
public void retrieveArticolo(String codAlis, String codMdep, String barcode, RunnableArgs<OrdiniAcquistoGrigliaDTO> onSuccess, RunnableArgs<Exception> onFailed) {
PVOrdiniAcquistoRESTConsumerService ordiniARestService = RESTBuilder.getService(PVOrdiniAcquistoRESTConsumerService.class, 300);
ordiniARestService.retrieveArticoli(codAlis, codMdep, barcode)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, Response<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> response) {
var startTime = new Date().getTime();
@ -67,8 +68,8 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -91,7 +92,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
PVOrdiniAcquistoRESTConsumerService ordiniARestService = RESTBuilder.getService(PVOrdiniAcquistoRESTConsumerService.class, 300);
ordiniARestService.save(codMdep, saveDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
var startTime = new Date().getTime();
@ -113,10 +114,8 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
Log.e("saveOrdine", t.toString());
UtilityLogger.error(new Exception(t));
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Object>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});

View File

@ -1,5 +1,7 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
@ -12,10 +14,10 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.utility.UtilityDB;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -31,7 +33,7 @@ public class PosizioniRESTConsumer extends _BaseRESTConsumer {
String codMdep = null;
PosizioniRESTConsumerService posizioniRESTConsumerService = RESTBuilder.getService(PosizioniRESTConsumerService.class);
posizioniRESTConsumerService.getAvailablePosizioni(codMdep).enqueue(new Callback<>() {
posizioniRESTConsumerService.getAvailablePosizioni(codMdep).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<MtbDepoPosizione>>> call, Response<ServiceRESTResponse<List<MtbDepoPosizione>>> response) {
analyzeAnswer(response, "getAvailablePosizioni", (m) -> {
@ -40,8 +42,8 @@ public class PosizioniRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<MtbDepoPosizione>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<MtbDepoPosizione>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -1,6 +1,6 @@
package it.integry.integrywmsnative.core.rest.consumers;
import android.util.Log;
import androidx.annotation.NonNull;
import com.annimon.stream.Stream;
@ -10,20 +10,18 @@ import java.util.List;
import javax.inject.Singleton;
import it.integry.integrywmsnative.BuildConfig;
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.report.ReportType;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
import it.integry.integrywmsnative.core.rest.model.JasperPairDTO;
import it.integry.integrywmsnative.core.rest.model.ReportTypeDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.utility.UtilityLogger;
import it.integry.integrywmsnative.core.utility.UtilityString;
import it.integry.integrywmsnative.gest.spedizione.model.PrintOrderCloseDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -40,7 +38,7 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
String printerTypeStr = printerType != null ? printerType.toString() : null;
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
printerService.getAvailablePrinters(codMdep, printerTypeStr).enqueue(new Callback<>() {
printerService.getAvailablePrinters(codMdep, printerTypeStr).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
analyzeAnswer(response, "GetAvailablePrinters", printerList -> {
@ -50,10 +48,8 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, Throwable t) {
Log.e("GetAvailablePrinters", t.toString());
UtilityLogger.error(new Exception(t));
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -68,7 +64,7 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
printerService
.printCollo(testataColloToPrint)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
analyzeAnswer(response, "printCollo", data -> {
@ -77,10 +73,8 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
if (t.getMessage().contains("Printer not found")) {
onFailed.run(new NoPrintersFoundException());
} else onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Object>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -101,7 +95,7 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
printerService
.processPrintReport(printerName, quantity, jasperDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
analyzeAnswer(response, "printReport", data -> {
@ -110,10 +104,8 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
if (t.getMessage().contains("Printer not found")) {
onFailed.run(new NoPrintersFoundException());
} else onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Object>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -131,7 +123,7 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
printerService
.printReportType(reportTypeDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
analyzeAnswer(response, "printReportType", data -> {
@ -140,10 +132,8 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
if (t.getMessage().contains("Printer not found")) {
onFailed.run(new NoPrintersFoundException());
} else onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Object>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -164,7 +154,7 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class, 240);
Call<ServiceRESTResponse<Object>> callable = printerService.printClosedOrders(codMdep, dto);
callable.enqueue(new Callback<>() {
callable.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
analyzeAnswer(response, "printCollo", data -> {
@ -173,10 +163,8 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
if (t.getMessage().contains("Printer not found")) {
onFailed.run(new NoPrintersFoundException());
} else onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Object>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -1,5 +1,7 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import com.annimon.stream.Stream;
import com.google.gson.JsonObject;
@ -9,10 +11,10 @@ import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -21,7 +23,7 @@ public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
public void avviaLineaDiProduzione(String codJfas, Integer hrNum, Runnable onComplete, RunnableArgs<Exception> onFailed) {
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class);
Call<ServiceRESTResponse<JsonObject>> callable = restService.avviaLineaDiProduzione(codJfas, hrNum);
callable.enqueue(new Callback<>() {
callable.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
analyzeAnswer(response, "avviaLineaDiProduzione", data -> {
@ -30,8 +32,8 @@ public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -39,7 +41,7 @@ public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
public void arrestaLineaDiProduzione(String codJfas, Runnable onComplete, RunnableArgs<Exception> onFailed) {
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class);
Call<ServiceRESTResponse<JsonObject>> callable = restService.arrestaLineaDiProduzione(codJfas);
callable.enqueue(new Callback<>() {
callable.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
analyzeAnswer(response, "arrestaLineaDiProduzione", data -> {
@ -48,8 +50,8 @@ public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -57,7 +59,7 @@ public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
public void avviaProduzioneArticoloSuLinea(String codJfas, String codMart, String partitaMag, Runnable onComplete, RunnableArgs<Exception> onFailed) {
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class, 300);
Call<ServiceRESTResponse<JsonObject>> callable = restService.avviaProduzioneArticoloSuLinea(codJfas, codMart, partitaMag);
callable.enqueue(new Callback<>() {
callable.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
analyzeAnswer(response, "avviaProduzioneArticoloSuLinea", data -> {
@ -66,8 +68,8 @@ public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -75,15 +77,15 @@ public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
public void getStatoLinee(String codMdep, RunnableArgs<List<ProdLineStatusDTO>> onComplete, RunnableArgs<Exception> onFailed) {
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class);
Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> callable = restService.getStatoLinee(codMdep);
callable.enqueue(new Callback<>() {
callable.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Response<ServiceRESTResponse<List<ProdLineStatusDTO>>> response) {
analyzeAnswer(response, "getStatoLinee", onComplete::run, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -92,7 +94,7 @@ public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
public void getLineDetails(ProdLineStatusDTO lineaProd, RunnableArgs<ProdLineStatusDTO> onComplete, RunnableArgs<Exception> onFailed) {
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class);
Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> callable = restService.getStatoLinee(lineaProd.getCodMdepLav());
callable.enqueue(new Callback<>() {
callable.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Response<ServiceRESTResponse<List<ProdLineStatusDTO>>> response) {
analyzeAnswer(response, "getLineDetails", (lines) -> {
@ -102,8 +104,8 @@ public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -0,0 +1,40 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.produzione.CaricoProdFinDTO;
import retrofit2.Call;
import retrofit2.Response;
@Singleton
public class ProduzioneRESTConsumer extends _BaseRESTConsumer{
public void caricoProdFin(CaricoProdFinDTO caricoProdFin, Runnable onComplete, RunnableArgs<Exception> onFailed) {
ProduzioneRESTConsumerService service = RESTBuilder.getService(ProduzioneRESTConsumerService.class);
service.caricoProdFin(caricoProdFin)
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "caricoProdFin", Void -> onComplete.run(), ex -> {
if (onFailed != null) onFailed.run(ex);
});
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
}

View File

@ -0,0 +1,15 @@
package it.integry.integrywmsnative.core.rest.consumers;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.produzione.CaricoProdFinDTO;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;
public interface ProduzioneRESTConsumerService {
@POST("caricoProdFinJson")
Call<ServiceRESTResponse<Void>> caricoProdFin(@Body CaricoProdFinDTO caricoProdFin);
}

View File

@ -3,24 +3,24 @@ package it.integry.integrywmsnative.core.rest.consumers;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.NonNull;
import com.google.gson.Gson;
import com.orhanobut.logger.Logger;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.lang.reflect.Type;
import java.net.ConnectException;
import java.util.List;
import javax.inject.Singleton;
import it.integry.integrywmsnative.BuildConfig;
import it.integry.integrywmsnative.core.CommonConst;
import it.integry.integrywmsnative.core.exception.InvalidConnectionException;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
import it.integry.integrywmsnative.core.rest.model.MailRequestDTO;
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
@ -31,7 +31,6 @@ import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.UtilityGson;
import it.integry.integrywmsnative.core.utility.UtilityString;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -41,15 +40,20 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
public void retrieveUpdatesInfo(final RunnableArgs<LatestAppVersionInfoDTO> onSuccess, final RunnableArgs<Exception> onFailed) {
SystemRESTConsumerService systemRESTConsumerService = RESTBuilder.getService(SystemRESTConsumerService.class);
systemRESTConsumerService.retrieveUpdatesInfo()
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<LatestAppVersionInfoDTO> call, Response<LatestAppVersionInfoDTO> response) {
if(response.code() == 404) {
onSuccess.run(null);
return;
}
analyzeAnswerGeneric(response, "updates", onSuccess, onFailed);
}
@Override
public void onFailure(Call<LatestAppVersionInfoDTO> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<LatestAppVersionInfoDTO> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -61,15 +65,15 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
SystemRESTConsumerService systemRESTConsumerService = RESTBuilder.getService(SystemRESTConsumerService.class);
systemRESTConsumerService.registerDevice(registerDeviceRequestDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "device/register", Void -> onSuccess.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
@ -82,7 +86,7 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
service
.processSql(nativeSqlDTO)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
analyzeAnswer(response, "ProcessSql", o -> {
@ -100,13 +104,8 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
Logger.e(t, "ProcessSQL");
if (t instanceof ConnectException)
onFailed.run(new InvalidConnectionException(RESTBuilder.getDefaultHost(), RESTBuilder.getDefaultPort(), t));
else
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<Object>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -114,16 +113,15 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
public void getAvailableCodMdeps(final RunnableArgs<List<AvailableCodMdepsDTO>> onSuccess, RunnableArgs<Exception> onFailed) {
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
service.getAvailableCodMdeps().enqueue(new Callback<>() {
service.getAvailableCodMdeps().enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> call, Response<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> response) {
analyzeAnswer(response, "CodMdepsAvailable", onSuccess, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> call, final Throwable t) {
Log.e("CodMdepsAvailable", t.toString());
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -161,16 +159,16 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
public void sendMail(MailRequestDTO mailDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
service.sendMail(mailDTO).enqueue(new Callback<>() {
service.sendMail(mailDTO).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<String>> call, Response<ServiceRESTResponse<String>> response) {
if (onComplete != null) onComplete.run();
}
@Override
public void onFailure(Call<ServiceRESTResponse<String>> call, Throwable t) {
public void onFailure(Call<ServiceRESTResponse<String>> call, @NonNull final Exception e) {
if (onFailed != null) {
onFailed.run(new Exception(t));
onFailed.run(e);
}
}
});

View File

@ -9,7 +9,6 @@ import java.lang.reflect.Type;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import it.integry.integrywmsnative.core.utility.UtilityDate;
import it.integry.integrywmsnative.core.utility.UtilityString;
public class LocalDateDeserializer implements JsonDeserializer<LocalDate> {

View File

@ -0,0 +1,27 @@
package it.integry.integrywmsnative.core.rest.handler;
import androidx.annotation.NonNull;
import java.net.ConnectException;
import it.integry.integrywmsnative.core.exception.InvalidConnectionException;
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import retrofit2.Call;
import retrofit2.Callback;
public abstract class ManagedErrorCallback<T> implements Callback<T> {
@Override
public void onFailure(Call<T> call, Throwable t) {
if (t instanceof ConnectException connectException) {
t = new InvalidConnectionException(RESTBuilder.getDefaultHost(), RESTBuilder.getDefaultPort(), connectException);
} else if (t.getMessage() != null && t.getMessage().contains("Printer not found")) {
t = new NoPrintersFoundException();
}
onFailure(call, (Exception) t);
}
public abstract void onFailure(Call<T> call, @NonNull final Exception e);
}

View File

@ -0,0 +1,42 @@
package it.integry.integrywmsnative.core.rest.model;
import com.google.gson.annotations.SerializedName;
public enum CriterioDistribuzioneEnum {
@SerializedName("U")
U("U"), //AGGIORNA IL COLLO ESISTENTE
@SerializedName("O")
O("O"), //DIVIDE IL COLLO INIZIALE PER ORDINE
@SerializedName("G")
G("G"), //DIVIDE IL COLLO INIZIALE PER IL GRUPPO BOLLA DEGLI ARTICOLI
@SerializedName("UP")
UP("UP"), //SI TRATTA DI UN COLLO DI LAVORAZIONE CHE HA SULLE RIGHE I RIFERIMENTI DELL'ORDINE DI PRODUZIONE (GESTIONE_RIF = 'A')
//E VIENE LANCIATA LA NORMALE DISTRIBUZIONE MA NELL'AGGIORNARE IL COLLO VENGONO LETTI I RIFERIMENTI DELL'ORDINE DI LAVORAZIOKNE
// A CUI LA CHIAVE DATA,NUMERO E RIGA ORDINE FANNO RIFERIMENTO
@SerializedName("FASE")
FASE("FASE");
private final String text;
CriterioDistribuzioneEnum(String text) {
this.text = text;
}
public String getText() {
return this.text;
}
public static CriterioDistribuzioneEnum fromString(String text) {
for (CriterioDistribuzioneEnum b : CriterioDistribuzioneEnum.values()) {
if (b.text.equalsIgnoreCase(text)) return b;
}
return null;
}
}

View File

@ -9,6 +9,8 @@ public class SpostaArtsTraULRequestDTO {
private MtbColt destinationMtbColt;
private boolean flagForceUseRefs;
public MtbColt getSourceMtbColt() {
return sourceMtbColt;
}
@ -27,4 +29,12 @@ public class SpostaArtsTraULRequestDTO {
return this;
}
public boolean isFlagForceUseRefs() {
return flagForceUseRefs;
}
public SpostaArtsTraULRequestDTO setFlagForceUseRefs(boolean flagForceUseRefs) {
this.flagForceUseRefs = flagForceUseRefs;
return this;
}
}

View File

@ -0,0 +1,18 @@
package it.integry.integrywmsnative.core.rest.model;
import java.util.List;
import it.integry.integrywmsnative.core.model.MtbColr;
public class SpostaArtsTraULResponseDTO {
private List<MtbColr> generatedMtbColr;
public List<MtbColr> getGeneratedMtbColr() {
return generatedMtbColr;
}
public SpostaArtsTraULResponseDTO setGeneratedMtbColr(List<MtbColr> generatedMtbColr) {
this.generatedMtbColr = generatedMtbColr;
return this;
}
}

View File

@ -0,0 +1,237 @@
package it.integry.integrywmsnative.core.rest.model.materiali;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
import it.integry.integrywmsnative.core.model.MtbColt;
public class RecuperaMaterialiRequestDTO {
private String codMart;
private String partitaMag;
private BigDecimal numCnf;
private BigDecimal qtaCnf;
private BigDecimal qtaTot;
private int numCollo;
private LocalDate dataCollo;
private String gestione;
private String serCollo;
private int numColloRif;
private LocalDate dataColloRif;
private String gestioneRif;
private String serColloRif;
private List<Ordine> ordini;
private MtbColt mtbColtCarico;
public String getCodMart() {
return codMart;
}
public RecuperaMaterialiRequestDTO setCodMart(String codMart) {
this.codMart = codMart;
return this;
}
public String getPartitaMag() {
return partitaMag;
}
public RecuperaMaterialiRequestDTO setPartitaMag(String partitaMag) {
this.partitaMag = partitaMag;
return this;
}
public BigDecimal getNumCnf() {
return numCnf;
}
public RecuperaMaterialiRequestDTO setNumCnf(BigDecimal numCnf) {
this.numCnf = numCnf;
return this;
}
public BigDecimal getQtaCnf() {
return qtaCnf;
}
public RecuperaMaterialiRequestDTO setQtaCnf(BigDecimal qtaCnf) {
this.qtaCnf = qtaCnf;
return this;
}
public BigDecimal getQtaTot() {
return qtaTot;
}
public RecuperaMaterialiRequestDTO setQtaTot(BigDecimal qtaTot) {
this.qtaTot = qtaTot;
return this;
}
public int getNumCollo() {
return numCollo;
}
public RecuperaMaterialiRequestDTO setNumCollo(int numCollo) {
this.numCollo = numCollo;
return this;
}
public LocalDate getDataCollo() {
return dataCollo;
}
public RecuperaMaterialiRequestDTO setDataCollo(LocalDate dataCollo) {
this.dataCollo = dataCollo;
return this;
}
public String getGestione() {
return gestione;
}
public RecuperaMaterialiRequestDTO setGestione(String gestione) {
this.gestione = gestione;
return this;
}
public String getSerCollo() {
return serCollo;
}
public RecuperaMaterialiRequestDTO setSerCollo(String serCollo) {
this.serCollo = serCollo;
return this;
}
public int getNumColloRif() {
return numColloRif;
}
public RecuperaMaterialiRequestDTO setNumColloRif(int numColloRif) {
this.numColloRif = numColloRif;
return this;
}
public LocalDate getDataColloRif() {
return dataColloRif;
}
public RecuperaMaterialiRequestDTO setDataColloRif(LocalDate dataColloRif) {
this.dataColloRif = dataColloRif;
return this;
}
public String getGestioneRif() {
return gestioneRif;
}
public RecuperaMaterialiRequestDTO setGestioneRif(String gestioneRif) {
this.gestioneRif = gestioneRif;
return this;
}
public String getSerColloRif() {
return serColloRif;
}
public RecuperaMaterialiRequestDTO setSerColloRif(String serColloRif) {
this.serColloRif = serColloRif;
return this;
}
public List<Ordine> getOrdini() {
return ordini;
}
public RecuperaMaterialiRequestDTO setOrdini(List<Ordine> ordini) {
this.ordini = ordini;
return this;
}
public MtbColt getMtbColtCarico() {
return mtbColtCarico;
}
public RecuperaMaterialiRequestDTO setMtbColtCarico(MtbColt mtbColtCarico) {
this.mtbColtCarico = mtbColtCarico;
return this;
}
public static class Ordine {
private Integer numero;
private LocalDate data;
private String gestione;
private Integer rigaOrd;
private BigDecimal qtaCol;
private BigDecimal numCnf;
private Integer percentageHr;
public Integer getNumero() {
return numero;
}
public Ordine setNumero(Integer numero) {
this.numero = numero;
return this;
}
public LocalDate getData() {
return data;
}
public Ordine setData(LocalDate data) {
this.data = data;
return this;
}
public String getGestione() {
return gestione;
}
public Ordine setGestione(String gestione) {
this.gestione = gestione;
return this;
}
public Integer getRigaOrd() {
return rigaOrd;
}
public Ordine setRigaOrd(Integer rigaOrd) {
this.rigaOrd = rigaOrd;
return this;
}
public BigDecimal getQtaCol() {
return qtaCol;
}
public Ordine setQtaCol(BigDecimal qtaCol) {
this.qtaCol = qtaCol;
return this;
}
public BigDecimal getNumCnf() {
return numCnf;
}
public Ordine setNumCnf(BigDecimal numCnf) {
this.numCnf = numCnf;
return this;
}
public Integer getPercentageHr() {
return percentageHr;
}
public Ordine setPercentageHr(Integer percentageHr) {
this.percentageHr = percentageHr;
return this;
}
}
}

View File

@ -0,0 +1,12 @@
package it.integry.integrywmsnative.core.rest.model.materiali;
import it.integry.integrywmsnative.core.model.MtbColt;
public class RecuperaMaterialiResponseDTO {
private MtbColt updatedMtbColtScarico;
public MtbColt getUpdatedMtbColtScarico() {
return updatedMtbColtScarico;
}
}

View File

@ -0,0 +1,363 @@
package it.integry.integrywmsnative.core.rest.model.produzione;
import java.time.LocalDate;
import java.time.LocalDateTime;
public class CaricoProdFinDTO {
private CaricoProdFinProdottiDTO prodotti = new CaricoProdFinProdottiDTO();
private String gestione;
private String effettuaScaricoMateriali;
private String effettuaCaricoProdotto;
private String codAnag;
private String codMdep;
private String codMdepScar;
private String codDtipCar;
private String codDtipScar;
private String codDtipRien;
private String terminaLavorazione;
private String serDoc;
private String aggiornaStato;
private String creaCollo;
private String creaScaricoDaColloVers;
private String creaCaricoDaCollo;
private String creaScaricoDaCollo;
private String creaColloVersDaColloCarico;
private String creaRientroDaCollo;
private Integer numOrd;
private Integer idRiga;
private Integer idStep;
private LocalDate dataOrd;
private LocalDate dataProd;
private LocalDate dataDoc;
private Integer numDoc;
private LocalDateTime dataVersamento;
private String preparatoDa;
private String generateJson; /*24/01/2022(FABIO): da eliminare non appena abbiamo testato il salvataggio diretto con entity passo per passo*/
private String codJfas;
private String terminaLavorazioneLinea;
private String activityID;
private Integer idLotto;
private boolean escludiArticoliGestitiDaWmsInScarico;
public CaricoProdFinProdottiDTO getProdotti() {
return prodotti;
}
public CaricoProdFinDTO setProdotti(CaricoProdFinProdottiDTO prodotti) {
this.prodotti = prodotti;
return this;
}
public String getGestione() {
return gestione;
}
public CaricoProdFinDTO setGestione(String gestione) {
this.gestione = gestione;
return this;
}
public String getEffettuaScaricoMateriali() {
return effettuaScaricoMateriali;
}
public CaricoProdFinDTO setEffettuaScaricoMateriali(String effettuaScaricoMateriali) {
this.effettuaScaricoMateriali = effettuaScaricoMateriali;
return this;
}
public CaricoProdFinDTO setEffettuaScaricoMateriali(boolean effettuaScaricoMateriali) {
this.effettuaScaricoMateriali = effettuaScaricoMateriali ? "S" : "N";
return this;
}
public String getEffettuaCaricoProdotto() {
return effettuaCaricoProdotto;
}
public CaricoProdFinDTO setEffettuaCaricoProdotto(String effettuaCaricoProdotto) {
this.effettuaCaricoProdotto = effettuaCaricoProdotto;
return this;
}
public CaricoProdFinDTO setEffettuaCaricoProdotto(boolean effettuaCaricoProdotto) {
this.effettuaCaricoProdotto = effettuaCaricoProdotto ? "S" : "N";
return this;
}
public String getCodAnag() {
return codAnag;
}
public CaricoProdFinDTO setCodAnag(String codAnag) {
this.codAnag = codAnag;
return this;
}
public String getCodMdep() {
return codMdep;
}
public CaricoProdFinDTO setCodMdep(String codMdep) {
this.codMdep = codMdep;
return this;
}
public String getCodMdepScar() {
return codMdepScar;
}
public CaricoProdFinDTO setCodMdepScar(String codMdepScar) {
this.codMdepScar = codMdepScar;
return this;
}
public String getCodDtipCar() {
return codDtipCar;
}
public CaricoProdFinDTO setCodDtipCar(String codDtipCar) {
this.codDtipCar = codDtipCar;
return this;
}
public String getCodDtipScar() {
return codDtipScar;
}
public CaricoProdFinDTO setCodDtipScar(String codDtipScar) {
this.codDtipScar = codDtipScar;
return this;
}
public String getCodDtipRien() {
return codDtipRien;
}
public CaricoProdFinDTO setCodDtipRien(String codDtipRien) {
this.codDtipRien = codDtipRien;
return this;
}
public String getTerminaLavorazione() {
return terminaLavorazione;
}
public CaricoProdFinDTO setTerminaLavorazione(String terminaLavorazione) {
this.terminaLavorazione = terminaLavorazione;
return this;
}
public String getSerDoc() {
return serDoc;
}
public CaricoProdFinDTO setSerDoc(String serDoc) {
this.serDoc = serDoc;
return this;
}
public String getAggiornaStato() {
return aggiornaStato;
}
public CaricoProdFinDTO setAggiornaStato(String aggiornaStato) {
this.aggiornaStato = aggiornaStato;
return this;
}
public String getCreaCollo() {
return creaCollo;
}
public CaricoProdFinDTO setCreaCollo(String creaCollo) {
this.creaCollo = creaCollo;
return this;
}
public String getCreaScaricoDaColloVers() {
return creaScaricoDaColloVers;
}
public CaricoProdFinDTO setCreaScaricoDaColloVers(String creaScaricoDaColloVers) {
this.creaScaricoDaColloVers = creaScaricoDaColloVers;
return this;
}
public String getCreaCaricoDaCollo() {
return creaCaricoDaCollo;
}
public CaricoProdFinDTO setCreaCaricoDaCollo(String creaCaricoDaCollo) {
this.creaCaricoDaCollo = creaCaricoDaCollo;
return this;
}
public CaricoProdFinDTO setCreaCaricoDaCollo(boolean creaCaricoDaCollo) {
this.creaCaricoDaCollo = creaCaricoDaCollo ? "S" : "N";
return this;
}
public String getCreaScaricoDaCollo() {
return creaScaricoDaCollo;
}
public CaricoProdFinDTO setCreaScaricoDaCollo(String creaScaricoDaCollo) {
this.creaScaricoDaCollo = creaScaricoDaCollo;
return this;
}
public String getCreaColloVersDaColloCarico() {
return creaColloVersDaColloCarico;
}
public CaricoProdFinDTO setCreaColloVersDaColloCarico(String creaColloVersDaColloCarico) {
this.creaColloVersDaColloCarico = creaColloVersDaColloCarico;
return this;
}
public String getCreaRientroDaCollo() {
return creaRientroDaCollo;
}
public CaricoProdFinDTO setCreaRientroDaCollo(String creaRientroDaCollo) {
this.creaRientroDaCollo = creaRientroDaCollo;
return this;
}
public Integer getNumOrd() {
return numOrd;
}
public CaricoProdFinDTO setNumOrd(Integer numOrd) {
this.numOrd = numOrd;
return this;
}
public Integer getIdRiga() {
return idRiga;
}
public CaricoProdFinDTO setIdRiga(Integer idRiga) {
this.idRiga = idRiga;
return this;
}
public Integer getIdStep() {
return idStep;
}
public CaricoProdFinDTO setIdStep(Integer idStep) {
this.idStep = idStep;
return this;
}
public LocalDate getDataOrd() {
return dataOrd;
}
public CaricoProdFinDTO setDataOrd(LocalDate dataOrd) {
this.dataOrd = dataOrd;
return this;
}
public LocalDate getDataProd() {
return dataProd;
}
public CaricoProdFinDTO setDataProd(LocalDate dataProd) {
this.dataProd = dataProd;
return this;
}
public LocalDate getDataDoc() {
return dataDoc;
}
public CaricoProdFinDTO setDataDoc(LocalDate dataDoc) {
this.dataDoc = dataDoc;
return this;
}
public Integer getNumDoc() {
return numDoc;
}
public CaricoProdFinDTO setNumDoc(Integer numDoc) {
this.numDoc = numDoc;
return this;
}
public LocalDateTime getDataVersamento() {
return dataVersamento;
}
public CaricoProdFinDTO setDataVersamento(LocalDateTime dataVersamento) {
this.dataVersamento = dataVersamento;
return this;
}
public String getPreparatoDa() {
return preparatoDa;
}
public CaricoProdFinDTO setPreparatoDa(String preparatoDa) {
this.preparatoDa = preparatoDa;
return this;
}
public String getGenerateJson() {
return generateJson;
}
public CaricoProdFinDTO setGenerateJson(String generateJson) {
this.generateJson = generateJson;
return this;
}
public String getCodJfas() {
return codJfas;
}
public CaricoProdFinDTO setCodJfas(String codJfas) {
this.codJfas = codJfas;
return this;
}
public String getTerminaLavorazioneLinea() {
return terminaLavorazioneLinea;
}
public CaricoProdFinDTO setTerminaLavorazioneLinea(String terminaLavorazioneLinea) {
this.terminaLavorazioneLinea = terminaLavorazioneLinea;
return this;
}
public String getActivityID() {
return activityID;
}
public CaricoProdFinDTO setActivityID(String activityID) {
this.activityID = activityID;
return this;
}
public Integer getIdLotto() {
return idLotto;
}
public CaricoProdFinDTO setIdLotto(Integer idLotto) {
this.idLotto = idLotto;
return this;
}
public boolean isEscludiArticoliGestitiDaWmsInScarico() {
return escludiArticoliGestitiDaWmsInScarico;
}
public CaricoProdFinDTO setEscludiArticoliGestitiDaWmsInScarico(boolean escludiArticoliGestitiDaWmsInScarico) {
this.escludiArticoliGestitiDaWmsInScarico = escludiArticoliGestitiDaWmsInScarico;
return this;
}
}

View File

@ -0,0 +1,18 @@
package it.integry.integrywmsnative.core.rest.model.produzione;
import java.util.ArrayList;
import java.util.List;
public class CaricoProdFinProdottiDTO {
private List<CaricoProdFinProdottoDTO> row = new ArrayList<>();
public List<CaricoProdFinProdottoDTO> getRow() {
return row;
}
public CaricoProdFinProdottiDTO setRow(List<CaricoProdFinProdottoDTO> row) {
this.row = row;
return this;
}
}

View File

@ -0,0 +1,87 @@
package it.integry.integrywmsnative.core.rest.model.produzione;
import java.math.BigDecimal;
public class CaricoProdFinProdottoDTO {
private String partitaMag;
private String flagDig;
private String codTcol;
private BigDecimal qtaProdAna;
private BigDecimal qtaProdDig;
private BigDecimal qtaCnf;
private BigDecimal numCart;
private BigDecimal tara;
public String getPartitaMag() {
return partitaMag;
}
public CaricoProdFinProdottoDTO setPartitaMag(String partitaMag) {
this.partitaMag = partitaMag;
return this;
}
public String getFlagDig() {
return flagDig;
}
public CaricoProdFinProdottoDTO setFlagDig(String flagDig) {
this.flagDig = flagDig;
return this;
}
public String getCodTcol() {
return codTcol;
}
public CaricoProdFinProdottoDTO setCodTcol(String codTcol) {
this.codTcol = codTcol;
return this;
}
public BigDecimal getQtaProdAna() {
return qtaProdAna;
}
public CaricoProdFinProdottoDTO setQtaProdAna(BigDecimal qtaProdAna) {
this.qtaProdAna = qtaProdAna;
return this;
}
public BigDecimal getQtaProdDig() {
return qtaProdDig;
}
public CaricoProdFinProdottoDTO setQtaProdDig(BigDecimal qtaProdDig) {
this.qtaProdDig = qtaProdDig;
return this;
}
public BigDecimal getQtaCnf() {
return qtaCnf;
}
public CaricoProdFinProdottoDTO setQtaCnf(BigDecimal qtaCnf) {
this.qtaCnf = qtaCnf;
return this;
}
public BigDecimal getNumCart() {
return numCart;
}
public CaricoProdFinProdottoDTO setNumCart(BigDecimal numCart) {
this.numCart = numCart;
return this;
}
public BigDecimal getTara() {
return tara;
}
public CaricoProdFinProdottoDTO setTara(BigDecimal tara) {
this.tara = tara;
return this;
}
}

View File

@ -1,6 +1,7 @@
package it.integry.integrywmsnative.core.rest.model.uds;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.model.CriterioDistribuzioneEnum;
public class CloseUDSRequestDTO {
@ -8,6 +9,20 @@ public class CloseUDSRequestDTO {
private String orderCodMdep;
private MtbColt mtbColt;
private boolean createDocument;
private String documentCodDtip;
private String documentCodAnag;
private CriterioDistribuzioneEnum criterioDistribuzione;
public boolean isCreateDocument() {
return createDocument;
}
public String getDocumentCodDtip() {
return documentCodDtip;
}
public boolean isPrintSSCC() {
return printSSCC;
}
@ -34,4 +49,32 @@ public class CloseUDSRequestDTO {
this.mtbColt = mtbColt;
return this;
}
public CloseUDSRequestDTO setCreateDocument(boolean createDocument) {
this.createDocument = createDocument;
return this;
}
public CloseUDSRequestDTO setDocumentCodDtip(String documentCodDtip) {
this.documentCodDtip = documentCodDtip;
return this;
}
public String getDocumentCodAnag() {
return documentCodAnag;
}
public CloseUDSRequestDTO setDocumentCodAnag(String documentCodAnag) {
this.documentCodAnag = documentCodAnag;
return this;
}
public CriterioDistribuzioneEnum getCriterioDistribuzione() {
return criterioDistribuzione;
}
public CloseUDSRequestDTO setCriterioDistribuzione(CriterioDistribuzioneEnum criterioDistribuzione) {
this.criterioDistribuzione = criterioDistribuzione;
return this;
}
}

View File

@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.rest.model.uds;
import java.util.List;
import it.integry.integrywmsnative.core.model.DtbDoct;
import it.integry.integrywmsnative.core.model.MtbColt;
public class CloseUDSResponseDTO {
@ -9,6 +10,7 @@ public class CloseUDSResponseDTO {
private boolean deleted;
private List<MtbColt> generatedMtbColts;
private DtbDoct generatedDocument;
public boolean isSaved() {
return saved;
@ -21,4 +23,8 @@ public class CloseUDSResponseDTO {
public List<MtbColt> getGeneratedMtbColts() {
return generatedMtbColts;
}
public DtbDoct getGeneratedDocument() {
return generatedDocument;
}
}

View File

@ -18,6 +18,8 @@ public class InsertUDSRowRequestDTO {
private String partitaMag;
private LocalDate dataScad;
private String codJcom;
public MtbColr getSourceMtbColr() {
return sourceMtbColr;
}
@ -89,4 +91,13 @@ public class InsertUDSRowRequestDTO {
this.dataScad = dataScad;
return this;
}
public String getCodJcom() {
return codJcom;
}
public InsertUDSRowRequestDTO setCodJcom(String codJcom) {
this.codJcom = codJcom;
return this;
}
}

View File

@ -6,10 +6,8 @@ import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import java.lang.reflect.Type;
import java.time.LocalDateTime;
import it.integry.integrywmsnative.core.model.secondary.StatoPartitaMag;
import it.integry.integrywmsnative.core.utility.UtilityDate;
public class StatoPartitaMagSerializer implements JsonSerializer<StatoPartitaMag> {
@Override

View File

@ -26,6 +26,7 @@ public class DBSettingsModel {
private boolean flagMultiClienteOrdV;
private boolean flagUseCodAnagAziendale;
private boolean flagAskClienteInPickingLibero;
private boolean flagAskCommessaInPickingLiberoLav;
private boolean flagPickLiberoAllowEmptyCliente;
private boolean flagCanAddExtraItemSpedizione;
@ -88,6 +89,10 @@ public class DBSettingsModel {
private boolean suggestDataScad = false;
private boolean flagPositionChangeRequest = false;
private String docInterniRequestNumDoc;
private String produzioneCodDtipCar;
private boolean produzioneGeneraDocCar;
private String produzioneCodDtipScar;
private boolean produzioneGeneraDocScar;
private boolean flagEnableArtCreation;
private List<String> allowedCodMgrpForArtCreation;
private boolean flagAccettazioneGroupListForn = false;
@ -190,6 +195,15 @@ public class DBSettingsModel {
return this;
}
public boolean isFlagAskCommessaInPickingLiberoLav() {
return flagAskCommessaInPickingLiberoLav;
}
public DBSettingsModel setFlagAskCommessaInPickingLiberoLav(boolean flagAskCommessaInPickingLiberoLav) {
this.flagAskCommessaInPickingLiberoLav = flagAskCommessaInPickingLiberoLav;
return this;
}
public boolean isFlagPickLiberoAllowEmptyCliente() {
return flagPickLiberoAllowEmptyCliente;
}
@ -722,6 +736,42 @@ public class DBSettingsModel {
return this;
}
public String getProduzioneCodDtipCar() {
return produzioneCodDtipCar;
}
public DBSettingsModel setProduzioneCodDtipCar(String produzioneCodDtipCar) {
this.produzioneCodDtipCar = produzioneCodDtipCar;
return this;
}
public boolean isProduzioneGeneraDocCar() {
return produzioneGeneraDocCar;
}
public DBSettingsModel setProduzioneGeneraDocCar(boolean produzioneGeneraDocCar) {
this.produzioneGeneraDocCar = produzioneGeneraDocCar;
return this;
}
public String getProduzioneCodDtipScar() {
return produzioneCodDtipScar;
}
public DBSettingsModel setProduzioneCodDtipScar(String produzioneCodDtipScar) {
this.produzioneCodDtipScar = produzioneCodDtipScar;
return this;
}
public boolean isProduzioneGeneraDocScar() {
return produzioneGeneraDocScar;
}
public DBSettingsModel setProduzioneGeneraDocScar(boolean produzioneGeneraDocScar) {
this.produzioneGeneraDocScar = produzioneGeneraDocScar;
return this;
}
public List<String> getAllowedCodMgrpForArtCreation() {
return allowedCodMgrpForArtCreation;
}

View File

@ -190,7 +190,7 @@ public class SettingsManager {
mSystemRESTConsumer.getAvailableCodMdeps(availableCodMdeps -> {
dbSettingsModelIstance.setAvailableCodMdep(availableCodMdeps);
if (availableCodMdeps == null || availableCodMdeps.size() == 0) {
if (availableCodMdeps == null || availableCodMdeps.isEmpty()) {
onFailed.run(new Exception(mContext.getText(R.string.no_codmdep_available).toString()));
return;
}
@ -255,6 +255,11 @@ public class SettingsManager {
.setSection("PICKING_LIBERO")
.setKeySection("FLAG_ASK_CLIENTE")
.setSetter(dbSettingsModelIstance::setFlagAskClienteInPickingLibero));
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
.setGestName("PICKING")
.setSection("PICKING_LIBERO")
.setKeySection("FLAG_ASK_COMMESSA_LAV")
.setSetter(dbSettingsModelIstance::setFlagAskCommessaInPickingLiberoLav));
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
.setGestName("PICKING")
.setSection("PICKING_LIBERO")
@ -601,6 +606,30 @@ public class SettingsManager {
.setKeySection("REQUEST_NUM_DOC")
.setSetter(dbSettingsModelIstance::setDocInterniRequestNumDoc));
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
.setGestName("W_PORDI_RC")
.setSection("SETUP_DOCUMENTI")
.setKeySection("COD_DTIP_CAR")
.setSetter(dbSettingsModelIstance::setProduzioneCodDtipCar));
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
.setGestName("PICKING")
.setSection("PRODUZIONE")
.setKeySection("FLAG_GENERA_DOC_CAR")
.setSetter(dbSettingsModelIstance::setProduzioneGeneraDocCar));
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
.setGestName("W_PORDI_RC")
.setSection("SETUP_DOCUMENTI")
.setKeySection("COD_DTIP_SCAR")
.setSetter(dbSettingsModelIstance::setProduzioneCodDtipScar));
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
.setGestName("PICKING")
.setSection("PRODUZIONE")
.setKeySection("FLAG_GENERA_DOC_SCAR")
.setSetter(dbSettingsModelIstance::setProduzioneGeneraDocScar));
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
.setGestName("PICKING")
.setSection("SETUP")

View File

@ -219,7 +219,7 @@ public class Stash {
Type type = new GenericType(tClass);
return (ArrayList<T>) gson.fromJson(data, type);
}
return new ArrayList<T>();
return new ArrayList<>();
}
//clear single value

View File

@ -3,11 +3,11 @@ package it.integry.integrywmsnative.core.sound;
import android.content.Context;
import android.media.MediaPlayer;
import it.integry.integrywmsnative.R;
import javax.inject.Inject;
import javax.inject.Singleton;
import it.integry.integrywmsnative.R;
@Singleton
public class SoundAlertService {

View File

@ -7,19 +7,17 @@ import android.os.Environment;
import androidx.appcompat.app.AppCompatActivity;
import com.github.javiersantos.appupdater.AppUpdater;
import com.github.javiersantos.appupdater.enums.Display;
import com.github.javiersantos.appupdater.enums.UpdateFrom;
import java.io.File;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
import it.integry.integrywmsnative.core.rest.model.system.LatestAppVersionInfoDTO;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.FileDownloader;
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
import it.integry.integrywmsnative.view.dialogs.update_available.DialogUpdateAvailableView;
@Singleton
public class UpdatesManager {
@ -39,22 +37,33 @@ public class UpdatesManager {
systemRESTConsumer.retrieveUpdatesInfo(latestData -> {
AppUpdater appUpdater = new AppUpdater(mContext)
.setDisplay(Display.DIALOG)
.setUpdateFrom(UpdateFrom.JSON)
.setUpdateJSON(currentVersionUrl)
.setButtonDoNotShowAgain(null)
.setButtonUpdateClickListener((dialog, which) -> {
installAPK(currentDownloadUrl);
});
if (latestData == null)
return;
if(latestData.isForced())
appUpdater.setButtonDismiss(null);
showDialog(latestData, () -> {
installAPK(currentDownloadUrl);
});
appUpdater.start();
// AppUpdater appUpdater = new AppUpdater(mContext)
// .setDisplay(Display.DIALOG)
// .setUpdateFrom(UpdateFrom.JSON)
// .setUpdateJSON(currentVersionUrl)
// .setButtonDoNotShowAgain(null)
// .setButtonUpdateClickListener((dialog, which) -> {
// installAPK(currentDownloadUrl);
// });
//
// if (latestData.isForced())
// appUpdater.setButtonDismiss(null);
//
// appUpdater.start();
}, ex -> UtilityExceptions.defaultException(mContext, ex));
}
private void showDialog(LatestAppVersionInfoDTO updatesData, Runnable onUpdateStart) {
DialogUpdateAvailableView.newInstance(updatesData, onUpdateStart)
.show(mContext.getSupportFragmentManager(), "dialog-updates");
}
private void installAPK(String downloadURL) {

View File

@ -51,7 +51,7 @@ public class PermissionsHelper {
boolean allGranted = Stream.of(grantResults).allMatch(x -> x == PackageManager.PERMISSION_GRANTED);
// If request is cancelled, the result arrays are empty.
if (grantResults.size() > 0 && allGranted) {
if (!grantResults.isEmpty() && allGranted) {
onPermissionsConfirmed.run();
} else {

View File

@ -91,4 +91,8 @@ public class UtilityBigDecimal {
return input == null || equalsTo(input, BigDecimal.ZERO);
}
public static BigDecimal isNull(BigDecimal input1, BigDecimal input2) {
return input1 == null ? input2 : input1;
}
}

View File

@ -4,7 +4,7 @@ import com.annimon.stream.Stream;
import org.apache.commons.lang3.StringUtils;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
@ -25,9 +25,13 @@ public class UtilityDB {
} else {
valueString = "'" + valueString.replaceAll("'","''") + "'";
}
} else if (value instanceof Date){
} else if (value instanceof Date){
valueString = "'" + UtilityDate.formatDate((Date) value, UtilityDate.COMMONS_DATE_FORMATS.YMD_DASH) + "'";
} else if (value instanceof LocalDate){
valueString = "'" + UtilityDate.formatDate((LocalDate) value, UtilityDate.COMMONS_DATE_FORMATS.YMD_DASH) + "'";
} else if (value instanceof Integer) {
} else {

View File

@ -1,10 +1,10 @@
package it.integry.integrywmsnative.core.utility;
import android.content.Context;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import android.view.animation.AnimationUtils;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import it.integry.integrywmsnative.R;
/**

View File

@ -6,7 +6,7 @@ import androidx.lifecycle.Observer;
public class UtilityLiveData {
public static <T> void observeOnce(final LiveData<T> liveData, final Observer<T> observer) {
liveData.observeForever(new Observer<T>() {
liveData.observeForever(new Observer<>() {
@Override
public void onChanged(T t) {
liveData.removeObserver(this);

View File

@ -88,7 +88,7 @@ public class UtilityLogger {
}
return callerNew.length() > 0 ? callerNew.toString() : caller;
return !callerNew.isEmpty() ? callerNew.toString() : caller;
}

View File

@ -37,7 +37,7 @@ public class UtilityPosizione {
List<MtbDepoPosizione> tmpList = Stream.of(availablePosizioni)
.filter(x -> x.getPosizione().equalsIgnoreCase(posizione)).toList();
if(tmpList.size() > 0) return tmpList.get(0);
if(!tmpList.isEmpty()) return tmpList.get(0);
else return null;
}

View File

@ -15,7 +15,7 @@ import java.util.regex.Pattern;
*/
public class UtilityString {
private static final Map<String, String> DATE_FORMAT_REGEXPS = new HashMap<String, String>() {{
private static final Map<String, String> DATE_FORMAT_REGEXPS = new HashMap<>() {{
//-----------------------------------------------------------------------------------------
//giorno-mese-giorno

View File

@ -3,8 +3,6 @@ package it.integry.integrywmsnative.core.utility;
import android.content.Context;
import android.widget.Toast;
import it.integry.integrywmsnative.MainApplication;
public class UtilityToast {
private static Context context;

View File

@ -1,5 +1,7 @@
package it.integry.integrywmsnative.gest.accettazione_bolla_elenco.rest;
import androidx.annotation.NonNull;
import java.util.List;
import javax.inject.Singleton;
@ -7,6 +9,7 @@ import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.gest.accettazione_bolla_elenco.rest.dto.RetrieveElencoArticoliAccettazioneBollaRequestDTO;
import it.integry.integrywmsnative.gest.accettazione_bolla_elenco.rest.dto.RetrieveElencoArticoliAccettazioneBollaResponseDTO;
@ -14,7 +17,6 @@ import it.integry.integrywmsnative.gest.accettazione_bolla_elenco.rest.dto.Retri
import it.integry.integrywmsnative.gest.accettazione_bolla_elenco.rest.dto.SitBollaAccettazioneDTO;
import it.integry.integrywmsnative.gest.accettazione_bolla_elenco.rest.dto.TestataBollaAccettazioneDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -24,15 +26,15 @@ public class BolleAccettazioneRESTConsumer extends _BaseRESTConsumer {
public void retrieveBolleDaAccettare(RunnableArgs<List<TestataBollaAccettazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
BolleAccettazioneRESTConsumerService service = RESTBuilder.getService(BolleAccettazioneRESTConsumerService.class);
service.retrieveElencoBolle()
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<RetrieveElencoBolleAccettazioneResponseDTO>> call, Response<ServiceRESTResponse<RetrieveElencoBolleAccettazioneResponseDTO>> response) {
analyzeAnswer(response, "retrieveBolleDaAccettare", data -> onComplete.run(data.getBolleDaAccettare()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<RetrieveElencoBolleAccettazioneResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<RetrieveElencoBolleAccettazioneResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -44,15 +46,15 @@ public class BolleAccettazioneRESTConsumer extends _BaseRESTConsumer {
.setBolle(bolle);
service.retrievePickingListBolle(request)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<RetrieveElencoArticoliAccettazioneBollaResponseDTO>> call, Response<ServiceRESTResponse<RetrieveElencoArticoliAccettazioneBollaResponseDTO>> response) {
analyzeAnswer(response, "retrievePickingListBolle", data -> onComplete.run(data.getSitArticoli()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<RetrieveElencoArticoliAccettazioneBollaResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<RetrieveElencoArticoliAccettazioneBollaResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -16,7 +16,7 @@ import androidx.preference.PreferenceManager;
import com.annimon.stream.ComparatorCompat;
import com.annimon.stream.Stream;
import com.tfb.fbtoast.FBToast;
import com.google.android.material.snackbar.Snackbar;
import java.math.BigDecimal;
import java.time.LocalDate;
@ -377,7 +377,7 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
//Calc Num CNF
BigDecimal numCnfEvasa = BigDecimal.ZERO;
if (x.getWithdrawMtbColrs().size() > 0) {
if (!x.getWithdrawMtbColrs().isEmpty()) {
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs())
.map(MtbColr::getNumCnf)
.reduce(BigDecimal.ZERO, BigDecimal::add);
@ -386,7 +386,7 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
//Calc qta col
BigDecimal qtaEvasa = BigDecimal.ZERO;
if (x.getWithdrawMtbColrs().size() > 0) {
if (!x.getWithdrawMtbColrs().isEmpty()) {
qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
.map(MtbColr::getQtaCol)
.reduce(BigDecimal.ZERO, BigDecimal::add);
@ -487,7 +487,10 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
public void onLUOpened(MtbColt mtbColt) {
runOnUiThread(() -> {
noLUPresent.set(false);
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
Snackbar.make(mBindings.getRoot(), R.string.data_saved, Snackbar.LENGTH_SHORT)
.setBackgroundTint(getResources().getColor(R.color.colorSuccess))
.show();
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(mtbColt);
});
@ -506,7 +509,9 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
@Override
public void onRowSaved() {
runOnUiThread(() -> {
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
Snackbar.make(mBindings.getRoot(), R.string.data_saved, Snackbar.LENGTH_SHORT)
.setBackgroundTint(getResources().getColor(R.color.colorSuccess))
.show();
});
}

View File

@ -92,13 +92,7 @@ public class AccettazioneBollaPickingViewModel {
private final List<HistoryMtbAartDTO> mHistoryUsedAarts = new ArrayList<>();
@Inject
public AccettazioneBollaPickingViewModel(ArticoloRESTConsumer articoloRESTConsumer,
BarcodeRESTConsumer barcodeRESTConsumer,
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
PrinterRESTConsumer printerRESTConsumer,
AccettazioneBollaPickingRESTConsumer accettazioneBollaPickingRESTConsumer,
ColliAccettazioneRESTConsumer colliAccettazioneRESTConsumer,
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer) {
public AccettazioneBollaPickingViewModel(ArticoloRESTConsumer articoloRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, PrinterRESTConsumer printerRESTConsumer, AccettazioneBollaPickingRESTConsumer accettazioneBollaPickingRESTConsumer, ColliAccettazioneRESTConsumer colliAccettazioneRESTConsumer, ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer) {
this.mArticoloRESTConsumer = articoloRESTConsumer;
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
@ -668,8 +662,8 @@ public class AccettazioneBollaPickingViewModel {
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
.setMtbAart(pickingObjectDTO.getMtbAart());
pickingObjectDTO.getWithdrawMtbColrs().add(0, insertedMtbColr);
mCurrentMtbColt.getMtbColr().add(0, insertedMtbColr);
pickingObjectDTO.getWithdrawMtbColrs().add(insertedMtbColr);
mCurrentMtbColt.getMtbColr().add(insertedMtbColr);
//Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei
resetMatchedRows();

View File

@ -9,7 +9,6 @@ import com.annimon.stream.function.Predicate;
import java.util.List;
import java.util.Objects;
import it.integry.integrywmsnative.core.utility.UtilityString;
import it.integry.integrywmsnative.gest.accettazione_bolla_picking.dto.PickingObjectDTO;
public class AccettazioneBollaPickingFilterViewModel {

View File

@ -1,5 +1,7 @@
package it.integry.integrywmsnative.gest.accettazione_bolla_picking.rest;
import androidx.annotation.NonNull;
import java.util.ArrayList;
import java.util.List;
@ -7,15 +9,15 @@ import javax.inject.Inject;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUDCDTO;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.gest.accettazione_bolla_elenco.rest.dto.TestataBollaAccettazioneDTO;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUDCDTO;
import it.integry.integrywmsnative.gest.accettazione_bolla_picking.dto.RetrieveAlreadyRegisteredULAccettazioneBollaRequestDTO;
import it.integry.integrywmsnative.gest.accettazione_bolla_picking.dto.RetrieveAlreadyRegisteredULAccettazioneBollaResponseDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -33,7 +35,7 @@ public class AccettazioneBollaPickingRESTConsumer extends _BaseRESTConsumer {
.setBolle(bolle);
service.retrieveAlreadyRegisteredUDC(request)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<RetrieveAlreadyRegisteredULAccettazioneBollaResponseDTO>> call, Response<ServiceRESTResponse<RetrieveAlreadyRegisteredULAccettazioneBollaResponseDTO>> response) {
analyzeAnswer(response, "retrieveAlreadyRegisteredUDC",
@ -42,8 +44,8 @@ public class AccettazioneBollaPickingRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<RetrieveAlreadyRegisteredULAccettazioneBollaResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<RetrieveAlreadyRegisteredULAccettazioneBollaResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -18,10 +18,7 @@ import com.zhukic.sectionedrecyclerview.SectionedRecyclerViewAdapter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import it.integry.integrywmsnative.R;
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;

View File

@ -1,5 +1,7 @@
package it.integry.integrywmsnative.gest.accettazione_ordini_elenco.rest;
import androidx.annotation.NonNull;
import com.annimon.stream.Stream;
import java.util.List;
@ -9,13 +11,12 @@ import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.utility.UtilityLogger;
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.dto.GetPickingListAccettazioneDTO;
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.dto.OrdineAccettazioneInevasoDTO;
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.dto.SitArtOrdDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -24,15 +25,15 @@ public class OrdiniAccettazioneRESTConsumer extends _BaseRESTConsumer {
public void getOrdiniInevasi(String codMdep, RunnableArgs<List<OrdineAccettazioneInevasoDTO>> onComplete, RunnableArgs<Exception> onFailed) {
OrdiniAccettazioneRESTConsumerService service = RESTBuilder.getService(OrdiniAccettazioneRESTConsumerService.class);
service.listOrdiniInevasi(codMdep, "A").enqueue(new Callback<>() {
service.listOrdiniInevasi(codMdep, "A").enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> call, Response<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> response) {
analyzeAnswer(response, "getOrdiniInevasi", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -47,16 +48,15 @@ public class OrdiniAccettazioneRESTConsumer extends _BaseRESTConsumer {
.toList();
OrdiniAccettazioneRESTConsumerService service = RESTBuilder.getService(OrdiniAccettazioneRESTConsumerService.class);
service.getArticoliFromOrdiniAccettazione(getPickingListDTOs).enqueue(new Callback<ServiceRESTResponse<List<SitArtOrdDTO>>>() {
service.getArticoliFromOrdiniAccettazione(getPickingListDTOs).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Response<ServiceRESTResponse<List<SitArtOrdDTO>>> response) {
analyzeAnswer(response, "retrieveListaArticoliFromOrdiniAccettazione", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Throwable t) {
UtilityLogger.error(new Exception(t));
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -18,7 +18,7 @@ import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.annimon.stream.Stream;
import com.tfb.fbtoast.FBToast;
import com.google.android.material.snackbar.Snackbar;
import java.math.BigDecimal;
import java.time.LocalDate;
@ -355,7 +355,11 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
});
accettazioneOrdiniPickingListAdapter.setOnItemClicked(clickedItem -> {
this.mViewModel.dispatchOrdineRow(clickedItem);
this.mViewModel.dispatchOrdineRow(clickedItem, false);
});
accettazioneOrdiniPickingListAdapter.setOnItemLongClicked(clickedItem -> {
this.mViewModel.dispatchOrdineRow(clickedItem, true);
});
}
@ -410,14 +414,14 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
//Calc Num CNF
BigDecimal numCnfEvasa = BigDecimal.ZERO;
if (x.getWithdrawMtbColrs().size() > 0) {
if (!x.getWithdrawMtbColrs().isEmpty()) {
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getNumCnf).reduce(BigDecimal.ZERO, BigDecimal::add);
}
//Calc qta col
BigDecimal qtaEvasa = BigDecimal.ZERO;
if (x.getWithdrawMtbColrs().size() > 0) {
if (!x.getWithdrawMtbColrs().isEmpty()) {
qtaEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getQtaCol).reduce(BigDecimal.ZERO, BigDecimal::add);
}
@ -468,14 +472,14 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
//Calc Num CNF
BigDecimal numCnfEvasa = BigDecimal.ZERO;
if (x.getWithdrawMtbColrs().size() > 0) {
if (!x.getWithdrawMtbColrs().isEmpty()) {
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getNumCnf).reduce(BigDecimal.ZERO, BigDecimal::add);
}
//Calc qta col
BigDecimal qtaEvasa = BigDecimal.ZERO;
if (x.getWithdrawMtbColrs().size() > 0) {
if (!x.getWithdrawMtbColrs().isEmpty()) {
qtaEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getQtaCol).reduce(BigDecimal.ZERO, BigDecimal::add);
}
@ -523,14 +527,14 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
//Calc Num CNF
BigDecimal numCnfEvasa = BigDecimal.ZERO;
if (x.getWithdrawMtbColrs().size() > 0) {
if (!x.getWithdrawMtbColrs().isEmpty()) {
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getNumCnf).reduce(BigDecimal.ZERO, BigDecimal::add);
}
//Calc qta col
BigDecimal qtaEvasa = BigDecimal.ZERO;
if (x.getWithdrawMtbColrs().size() > 0) {
if (!x.getWithdrawMtbColrs().isEmpty()) {
qtaEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getQtaCol).reduce(BigDecimal.ZERO, BigDecimal::add);
}
@ -579,14 +583,14 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
//Calc Num CNF
BigDecimal numCnfEvasa = BigDecimal.ZERO;
if (x.getWithdrawMtbColrs().size() > 0) {
if (!x.getWithdrawMtbColrs().isEmpty()) {
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getNumCnf).reduce(BigDecimal.ZERO, BigDecimal::add);
}
//Calc qta col
BigDecimal qtaEvasa = BigDecimal.ZERO;
if (x.getWithdrawMtbColrs().size() > 0) {
if (!x.getWithdrawMtbColrs().isEmpty()) {
qtaEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getQtaCol).reduce(BigDecimal.ZERO, BigDecimal::add);
}
@ -776,7 +780,9 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
@Override
public void onRowSaved() {
runOnUiThread(() -> {
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
Snackbar.make(mBindings.getRoot(), R.string.data_saved, Snackbar.LENGTH_SHORT)
.setBackgroundTint(getResources().getColor(R. color. green_500))
.show();
});
}
@ -821,7 +827,9 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
public void onLUOpened(MtbColt mtbColt) {
runOnUiThread(() -> {
noLUPresent.set(false);
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
Snackbar.make(mBindings.getRoot(), R.string.data_saved, Snackbar.LENGTH_SHORT)
.setBackgroundTint(getResources().getColor(R. color. green_500))
.show();
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(mtbColt);
});

View File

@ -141,7 +141,7 @@ public class AccettazioneOrdiniPickingViewModel {
.distinct()
.collect(Collectors.toList());
if(codAnagsOrd.size() == 1) foundCodAnag = codAnagsOrd.get(0);
if (codAnagsOrd.size() == 1) foundCodAnag = codAnagsOrd.get(0);
//Definizione della gestione collo di default
@ -248,7 +248,7 @@ public class AccettazioneOrdiniPickingViewModel {
Ean128Model ean128Model = mEan128Service.decode(barcodeScanDTO);
mColliAccettazioneRESTConsumer.checkBarcodeUl(ean128Model.Sscc, result -> {
if (result){
if (result) {
this.sendWarning("Barcode ul già registrato!", onComplete);
} else {
//Nel caso trovo un SSCC lo aggiungo
@ -369,7 +369,7 @@ public class AccettazioneOrdiniPickingViewModel {
private void loadArticolo(String barcodeProd, PickDataDTO pickData, Runnable onComplete) {
this.mArticoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
if (mtbAartList != null && mtbAartList.size() > 0) {
if (mtbAartList != null && !mtbAartList.isEmpty()) {
this.searchArtFromAnag(mtbAartList.get(0), pickData, onComplete);
} else {
this.sendError(new NoResultFromBarcodeException(barcodeProd));
@ -395,13 +395,13 @@ public class AccettazioneOrdiniPickingViewModel {
}
private void loadMatchedRows(List<PickingObjectDTO> matchedRows) {
if (matchedRows == null || matchedRows.size() == 0) {
if (matchedRows == null || matchedRows.isEmpty()) {
this.sendError(new NoArtsFoundException());
} else if (matchedRows.size() == 1) {
this.dispatchOrdineRow(matchedRows.get(0));
this.dispatchOrdineRow(matchedRows.get(0), false);
} else {
//So che il codMart sarà solo 1
var firstCodMart = Stream.of(matchedRows)
var firstCodMart = matchedRows.stream()
.map(x -> x.getSitArtOrdDTO().getCodMart())
.distinct()
.findFirst()
@ -414,7 +414,7 @@ public class AccettazioneOrdiniPickingViewModel {
public void createNewLU(String customSSCC, Integer customNumCollo, String customSerCollo, boolean disablePrint, Runnable onComplete) {
this.sendOnInfoAggiuntiveRequest((additionalNotes, tCol) -> {
final List<CreateUDCRequestOrderDTO> orders = Stream.of(this.mOrders)
final List<CreateUDCRequestOrderDTO> orders = this.mOrders.stream()
.map(x -> {
final CreateUDCRequestOrderDTO createUDCRequestOrderDTO = new CreateUDCRequestOrderDTO()
.setDataCons(x.getDataConsD() != null ? UtilityDate.toLocalDate(x.getDataConsD()) : null)
@ -432,7 +432,7 @@ public class AccettazioneOrdiniPickingViewModel {
return createUDCRequestOrderDTO;
})
.toList();
.collect(Collectors.toList());
final CreateUDCRequestDTO createUDCRequestDTO = new CreateUDCRequestDTO()
.setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep())
@ -457,7 +457,7 @@ public class AccettazioneOrdiniPickingViewModel {
}
public void dispatchOrdineRow(final PickingObjectDTO pickingObjectDTO) {
public void dispatchOrdineRow(final PickingObjectDTO pickingObjectDTO, boolean executeImmediately) {
if (this.mCurrentMtbColt == null) return;
BigDecimal totalQtaOrd = pickingObjectDTO.getSitArtOrdDTO().getQtaOrd();
@ -467,18 +467,18 @@ public class AccettazioneOrdiniPickingViewModel {
AtomicBigDecimal numCnfWithdrawRows = new AtomicBigDecimal();
AtomicBigDecimal qtaColWithdrawRows = new AtomicBigDecimal();
Stream.of(pickingObjectDTO.getWithdrawMtbColrs())
pickingObjectDTO.getWithdrawMtbColrs()
.forEach(row -> {
numCnfWithdrawRows.addAndGet(row.getNumCnf());
qtaColWithdrawRows.addAndGet(row.getQtaCol());
});
BigDecimal numCnfDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getNumCnfDaEvadere().subtract(numCnfWithdrawRows.getBigDecimalValue());
BigDecimal qtaDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getQtaDaEvadere().subtract(qtaColWithdrawRows.getBigDecimalValue());
BigDecimal qtaColDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getQtaDaEvadere().subtract(qtaColWithdrawRows.getBigDecimalValue());
BigDecimal qtaCnfDaEvadere = qtaCnfOrd;
numCnfDaEvadere = UtilityBigDecimal.getGreaterBetween(numCnfDaEvadere, BigDecimal.ZERO);
qtaDaEvadere = UtilityBigDecimal.getGreaterBetween(qtaDaEvadere, BigDecimal.ZERO);
qtaColDaEvadere = UtilityBigDecimal.getGreaterBetween(qtaColDaEvadere, BigDecimal.ZERO);
BigDecimal numCnfDaPrelevare = null;
BigDecimal qtaColDaPrelevare = null;
@ -568,33 +568,47 @@ public class AccettazioneOrdiniPickingViewModel {
}
}
this.sendOnItemDispatched(
pickingObjectDTO,
pickingObjectDTO.getMtbAart(),
initialNumCnf, initialQtaCnf, initialQtaTot,
qtaDaEvadere,
numCnfDaEvadere,
qtaCnfDaEvadere,
qtaColDaPrelevare,
numCnfDaPrelevare,
qtaCnfDaPrelevare,
null,
null,
null,
partitaMag,
dataScad,
true,
pickingObjectDTO.getSitArtOrdDTO().getDescrizioneEstesaOrd(),
(pickedQuantityDTO, shouldCloseLU) -> {
this.saveNewRow(pickingObjectDTO,
pickedQuantityDTO.getNumCnf(),
pickedQuantityDTO.getQtaCnf(),
pickedQuantityDTO.getQtaTot(),
pickedQuantityDTO.getPartitaMag(),
pickedQuantityDTO.getDataScad(),
shouldCloseLU);
});
if (executeImmediately) {
BigDecimal numCnf = UtilityBigDecimal.isNull(numCnfDaPrelevare, numCnfDaEvadere);
BigDecimal qtaTot = UtilityBigDecimal.isNull(qtaColDaPrelevare, qtaColDaEvadere);
BigDecimal qtaCnf = UtilityBigDecimal.isNull(qtaCnfDaPrelevare, qtaCnfDaEvadere);
this.saveNewRow(pickingObjectDTO,
numCnf,
qtaCnf,
qtaTot,
partitaMag,
dataScad,
false);
} else {
this.sendOnItemDispatched(
pickingObjectDTO,
pickingObjectDTO.getMtbAart(),
initialNumCnf, initialQtaCnf, initialQtaTot,
qtaColDaEvadere,
numCnfDaEvadere,
qtaCnfDaEvadere,
qtaColDaPrelevare,
numCnfDaPrelevare,
qtaCnfDaPrelevare,
null,
null,
null,
partitaMag,
dataScad,
true,
pickingObjectDTO.getSitArtOrdDTO().getDescrizioneEstesaOrd(),
(pickedQuantityDTO, shouldCloseLU) -> {
this.saveNewRow(pickingObjectDTO,
pickedQuantityDTO.getNumCnf(),
pickedQuantityDTO.getQtaCnf(),
pickedQuantityDTO.getQtaTot(),
pickedQuantityDTO.getPartitaMag(),
pickedQuantityDTO.getDataScad(),
shouldCloseLU);
});
}
}

View File

@ -18,6 +18,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.stream.Collectors;
import it.integry.integrywmsnative.BR;
import it.integry.integrywmsnative.R;
@ -48,10 +49,10 @@ public class FilterCodArtLayoutView extends FilterLayoutView {
refreshList();
this.setSearchView(this.mBindings.searchView, newFilter -> {
hidden = Stream.of(all)
hidden = all.stream()
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)) &&
!x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
.toList();
.collect(Collectors.toList());
refreshList();
});

View File

@ -1,5 +1,7 @@
package it.integry.integrywmsnative.gest.accettazione_ordini_picking.rest;
import androidx.annotation.NonNull;
import java.util.ArrayList;
import java.util.List;
@ -11,12 +13,12 @@ import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUDCDTO;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.dto.OrdineAccettazioneInevasoDTO;
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.dto.RetrieveAlreadyRegisteredULAccettazioneOrdineRequestDTO;
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.dto.RetrieveAlreadyRegisteredULAccettazioneOrdineResponseDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -36,7 +38,7 @@ public class AccettazioneOrdiniPickingRESTConsumer extends _BaseRESTConsumer {
.setOrdini(ordiniToShow);
service.retrieveAlreadyRegisteredUDC(request)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<RetrieveAlreadyRegisteredULAccettazioneOrdineResponseDTO>> call, Response<ServiceRESTResponse<RetrieveAlreadyRegisteredULAccettazioneOrdineResponseDTO>> response) {
analyzeAnswer(response, "retrieveAlreadyRegisteredUDC",
@ -45,8 +47,8 @@ public class AccettazioneOrdiniPickingRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<RetrieveAlreadyRegisteredULAccettazioneOrdineResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<RetrieveAlreadyRegisteredULAccettazioneOrdineResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -21,7 +21,6 @@ import java.util.List;
import it.integry.integrywmsnative.R;
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.utility.UtilityDate;
import it.integry.integrywmsnative.core.utility.UtilityNumber;
import it.integry.integrywmsnative.core.utility.UtilityString;
import it.integry.integrywmsnative.databinding.AccettazioneOrdineInevasoMainListGroupHeaderBinding;
@ -35,6 +34,7 @@ public class AccettazioneOrdiniPickingListAdapter extends SectionedRecyclerViewA
private final List<AccettazioneOrdiniPickingListModel> mDataset = new ArrayList<>();
private RunnableArgs<PickingObjectDTO> mOnItemClicked;
private RunnableArgs<PickingObjectDTO> mOnItemLongClicked;
static class SubheaderHolder extends RecyclerView.ViewHolder {
@ -77,6 +77,10 @@ public class AccettazioneOrdiniPickingListAdapter extends SectionedRecyclerViewA
this.mOnItemClicked = onItemClicked;
}
public void setOnItemLongClicked(RunnableArgs<PickingObjectDTO> onItemLongClicked) {
this.mOnItemLongClicked = onItemLongClicked;
}
@Override
public SubheaderHolder onCreateSubheaderViewHolder(ViewGroup parent, int viewType) {
@ -154,6 +158,12 @@ public class AccettazioneOrdiniPickingListAdapter extends SectionedRecyclerViewA
if (this.mOnItemClicked != null)
this.mOnItemClicked.run(pickingObjectDTO.getOriginalModel());
});
holder.mBinding.getRoot().setOnLongClickListener(v -> {
if (this.mOnItemLongClicked != null)
this.mOnItemLongClicked.run(pickingObjectDTO.getOriginalModel());
return true;
});
}
@Override

View File

@ -3,7 +3,6 @@ package it.integry.integrywmsnative.gest.accettazione_ordini_picking.ui;
import org.jetbrains.annotations.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.dto.PickingObjectDTO;

View File

@ -2,7 +2,6 @@ package it.integry.integrywmsnative.gest.articoli_in_giacenza;
import dagger.Module;
import dagger.Provides;
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
@Module(subcomponents = ArticoliInGiacenzaComponent.class)

View File

@ -8,7 +8,6 @@ import java.util.List;
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.repository.MtbColtRepository;
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
@ -19,7 +18,6 @@ import it.integry.integrywmsnative.core.rest.consumers.DocumentRESTConsumer;
import it.integry.integrywmsnative.core.rest.model.documento.DocumentoArtDTO;
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.gest.contab_doc_interni.dialog.DialogSelectDocInfoResponseDTO;
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.FornitoreDTO;

View File

@ -1,7 +1,6 @@
package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.ui;
import android.content.Context;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.ViewGroup;
@ -12,12 +11,9 @@ import androidx.recyclerview.widget.RecyclerView;
import it.integry.integrywmsnative.R;
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.expansion.view.ExtendedRecyclerView;
import it.integry.integrywmsnative.core.utility.UtilityDate;
import it.integry.integrywmsnative.databinding.ActivityContabDocInternoRowListSingleItemBinding;
import it.integry.integrywmsnative.databinding.DocInterniListModelBinding;
public class DocumentRowsListAdapter extends ExtendedRecyclerView<SqlMtbColr, DocumentRowsListAdapter.SingleItemViewHolder> {

View File

@ -6,17 +6,16 @@ import java.util.List;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.exception.RestException;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.RetrieveLottiDTO;
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -30,15 +29,15 @@ public class DocInterniRESTConsumer extends _BaseRESTConsumer {
public void getDocInterniSetup(RunnableArgs<DocInterniSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
DocInterniRESTConsumerService service = RESTBuilder.getService(DocInterniRESTConsumerService.class);
service.getSetupDocInterni().enqueue(new Callback<>() {
service.getSetupDocInterni().enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<DocInterniSetupDTO>> call, Response<ServiceRESTResponse<DocInterniSetupDTO>> response) {
analyzeAnswer(response, "getSetupDocInterni", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<DocInterniSetupDTO>> call, Throwable t) {
onFailed.run(new RestException(t.getMessage()));
public void onFailure(Call<ServiceRESTResponse<DocInterniSetupDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -46,15 +45,15 @@ public class DocInterniRESTConsumer extends _BaseRESTConsumer {
public void retrieveLotti(String codProd, RunnableArgs<List<RetrieveLottiDTO>> onComplete, RunnableArgs<Exception> onFailed) {
DocInterniRESTConsumerService service = RESTBuilder.getService(DocInterniRESTConsumerService.class);
service.retrieveLotti(codProd)
.enqueue(new Callback<>() {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(@NonNull Call<ServiceRESTResponse<List<RetrieveLottiDTO>>> call, @NonNull Response<ServiceRESTResponse<List<RetrieveLottiDTO>>> response) {
analyzeAnswer(response, "retrieveLotti", onComplete, onFailed);
}
@Override
public void onFailure(@NonNull Call<ServiceRESTResponse<List<RetrieveLottiDTO>>> call, @NonNull Throwable t) {
onFailed.run(new RestException(t.getMessage()));
public void onFailure(@NonNull Call<ServiceRESTResponse<List<RetrieveLottiDTO>>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -3,7 +3,6 @@ package it.integry.integrywmsnative.gest.contab_doc_interni.rest;
import java.util.List;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.documento.RetrieveDocumentoArtsResponseDTO;
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.RetrieveLottiDTO;
import retrofit2.Call;

View File

@ -6,14 +6,12 @@ import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ObservableArrayList;
import androidx.recyclerview.widget.RecyclerView;
import it.integry.integrywmsnative.R;
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.expansion.view.ExtendedRecyclerView;
import it.integry.integrywmsnative.core.utility.UtilityDate;

View File

@ -1,7 +1,6 @@
package it.integry.integrywmsnative.gest.contab_doc_interni.ui;
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
public class DocInterniListModel {

View File

@ -1,6 +1,6 @@
package it.integry.integrywmsnative.gest.login.rest;
import android.util.Log;
import androidx.annotation.NonNull;
import javax.inject.Singleton;
@ -8,12 +8,12 @@ import it.integry.integrywmsnative.core.CommonConst;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.gest.login.dto.LoginAziendaDTO;
import it.integry.integrywmsnative.gest.login.dto.LoginResponseDTO;
import it.integry.integrywmsnative.gest.login.dto.LoginRequestDTO;
import it.integry.integrywmsnative.gest.login.dto.LoginResponseDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
@ -27,16 +27,15 @@ public class LoginRESTConsumer extends _BaseRESTConsumer {
int port = CommonConst.Login.Azienda.port;
LoginRESTConsumerService service = RESTBuilder.getService(LoginRESTConsumerService.class, protocol, host, port, false, true);
service.loginAzienda(codAzienda).enqueue(new Callback<>() {
service.loginAzienda(codAzienda).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<LoginAziendaDTO>> call, Response<ServiceRESTResponse<LoginAziendaDTO>> response) {
analyzeAnswer(response, "LoginAzienda", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<LoginAziendaDTO>> call, Throwable t) {
Log.e("LoginAzienda", t.toString());
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<LoginAziendaDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}
@ -49,7 +48,7 @@ public class LoginRESTConsumer extends _BaseRESTConsumer {
.setUsername(username)
.setPassword(password);
service.login(loginRequestDTO).enqueue(new Callback<>() {
service.login(loginRequestDTO).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<LoginResponseDTO>> call, Response<ServiceRESTResponse<LoginResponseDTO>> response) {
@ -57,9 +56,8 @@ public class LoginRESTConsumer extends _BaseRESTConsumer {
}
@Override
public void onFailure(Call<ServiceRESTResponse<LoginResponseDTO>> call, final Throwable t) {
Log.e("Login", t.toString());
onFailed.run(new Exception(t));
public void onFailure(Call<ServiceRESTResponse<LoginResponseDTO>> call, @NonNull final Exception e) {
onFailed.run(e);
}
});
}

View File

@ -12,10 +12,10 @@ import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterPaese
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterTermConsLayoutView;
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterVettoreLayoutView;
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterViaggioLayoutView;
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.filters.FilterCommessaLayoutView;
import it.integry.integrywmsnative.ui.filter_chips.filters.FilterCommessaLayoutView;
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
public class OrdiniUscitaElencoBindings {
public class OrdiniUscitaElencoFilterBindings {
public static final int DEPOSITO_FILTER_ID = 0;

Some files were not shown because too many files have changed in this diff Show More