Merge branch 'develop' into feature/TokenAuthentication
# Conflicts: # .idea/deploymentTargetSelector.xml # app/build.gradle # app/src/main/java/it/integry/integrywmsnative/core/menu/MenuRESTConsumer.java # app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ArticoloRESTConsumer.java # app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/AziendaRESTConsumer.java # app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumer.java # app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/DocumentRESTConsumer.java # app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/GestSetupRESTConsumer.java # app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/GiacenzaRESTConsumer.java # app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ImballiRESTConsumer.java # app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/PosizioniRESTConsumer.java # app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/PrinterRESTConsumer.java # app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/SystemRESTConsumer.java # app/src/main/java/it/integry/integrywmsnative/gest/accettazione_ordini_elenco/rest/OrdiniAccettazioneRESTConsumer.java # app/src/main/java/it/integry/integrywmsnative/gest/contab_doc_interni/rest/DocInterniRESTConsumer.java # app/src/main/java/it/integry/integrywmsnative/gest/login/rest/LoginRESTConsumer.java # app/src/main/java/it/integry/integrywmsnative/gest/prod_accettazione_ord_produzione/rest/ProdOrdineProduzioneRESTConsumer.java # app/src/main/java/it/integry/integrywmsnative/gest/prod_rientro_merce/order_detail/ProdRientroMerceOrderDetailModule.java # app/src/main/java/it/integry/integrywmsnative/gest/prod_rientro_merce/order_detail/rest/ProdRientroMerceOrderDetailRESTConsumer.java
This commit is contained in:
commit
d7eeeeeac2
16
.idea/appInsightsSettings.xml
generated
16
.idea/appInsightsSettings.xml
generated
@ -1,9 +1,23 @@
|
||||
<?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">
|
||||
<value>
|
||||
<InsightsFilterSettings>
|
||||
<option name="connection">
|
||||
<ConnectionSetting>
|
||||
<option name="appId" value="it.integry.ordify.dulciar" />
|
||||
</ConnectionSetting>
|
||||
</option>
|
||||
<option name="signal" value="SIGNAL_UNSPECIFIED" />
|
||||
<option name="timeIntervalDays" value="SEVEN_DAYS" />
|
||||
<option name="visibilityType" value="ALL" />
|
||||
</InsightsFilterSettings>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="Firebase Crashlytics">
|
||||
<value>
|
||||
<InsightsFilterSettings>
|
||||
|
||||
7
.idea/deploymentTargetSelector.xml
generated
7
.idea/deploymentTargetSelector.xml
generated
@ -2,15 +2,12 @@
|
||||
<project version="4">
|
||||
<component name="deploymentTargetSelector">
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="Prod_Android.WMS.app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2024-05-07T15:55:53.714883500Z">
|
||||
<DropdownSelection timestamp="2025-01-27T15:42:06.256113400Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=23324B6867" />
|
||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=21088B8EFD" />
|
||||
</handle>
|
||||
</Target>
|
||||
</DropdownSelection>
|
||||
|
||||
2
.idea/kotlinc.xml
generated
2
.idea/kotlinc.xml
generated
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="1.9.20" />
|
||||
<option name="version" value="1.9.25" />
|
||||
</component>
|
||||
</project>
|
||||
17
.idea/runConfigurations.xml
generated
Normal file
17
.idea/runConfigurations.xml
generated
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
2
.idea/runConfigurations/app.xml
generated
2
.idea/runConfigurations/app.xml
generated
@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="app" type="AndroidRunConfigurationType" factoryName="Android App">
|
||||
<module name="WMS_Native.app.main" />
|
||||
<module name="WMS.app.main" />
|
||||
<option name="DEPLOY" value="true" />
|
||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||
|
||||
@ -5,13 +5,13 @@ if (!project.hasProperty("disable-performance-plugin")) {
|
||||
}
|
||||
|
||||
apply plugin: 'com.google.firebase.crashlytics'
|
||||
apply plugin: 'kotlin-android'
|
||||
//apply plugin: 'kotlin-android'
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 434
|
||||
def appVersionName = '1.40.17'
|
||||
def appVersionCode = 468
|
||||
def appVersionName = '1.43.03'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@ -34,10 +34,10 @@ android {
|
||||
defaultConfig {
|
||||
applicationId "it.integry.integrywmsnative"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 34
|
||||
targetSdkVersion 35
|
||||
versionCode appVersionCode
|
||||
versionName appVersionName
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
signingConfig signingConfigs.release
|
||||
|
||||
javaCompileOptions {
|
||||
@ -75,47 +75,54 @@ android {
|
||||
build {
|
||||
doLast {
|
||||
delete "$projectDir/build/outputs/apk/release/version.txt"
|
||||
file("$projectDir/build/outputs/apk/release/version.txt").text = appVersionCode + '\n' + appVersionName
|
||||
file("$projectDir/build/outputs/apk/release/version.txt").text = appVersionCode + '\n' + appVersionName + '\n' + 'forced=true'
|
||||
}
|
||||
}
|
||||
|
||||
gradle.projectsEvaluated {
|
||||
tasks.withType(JavaCompile.class) {
|
||||
options.compilerArgs << "-Xmaxerrs" << "10000"
|
||||
tasks.withType(JavaCompile.class).tap {
|
||||
configureEach {
|
||||
options.compilerArgs << "-Xmaxerrs" << "10000"
|
||||
}
|
||||
}
|
||||
}
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
namespace 'it.integry.integrywmsnative'
|
||||
compileSdk 34
|
||||
compileSdk 35
|
||||
}
|
||||
|
||||
configurations {
|
||||
all*.exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
|
||||
all*.exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4'
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
})
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
// androidTestImplementation('androidx.test.espresso:espresso-core:3.6.1', {
|
||||
// exclude group: 'com.android.support', module: 'support-annotations'
|
||||
// })
|
||||
// implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
implementation 'com.github.lupaulus:logger:2.3.2'
|
||||
|
||||
//Firebase
|
||||
|
||||
// Import the Firebase BoM
|
||||
implementation platform('com.google.firebase:firebase-bom:32.8.1')
|
||||
implementation platform('com.google.firebase:firebase-bom:33.8.0')
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
implementation 'com.google.firebase:firebase-crashlytics'
|
||||
implementation 'com.google.firebase:firebase-perf'
|
||||
implementation 'com.google.android.gms:play-services-basement:18.3.0'
|
||||
implementation 'com.google.android.gms:play-services-basement:18.5.0'
|
||||
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.android.material:material:1.11.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'com.google.android.material:material:1.12.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.3.2'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.4.0'
|
||||
|
||||
implementation('androidx.preference:preference-ktx:1.2.1') {
|
||||
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel'
|
||||
@ -127,12 +134,12 @@ dependencies {
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||
implementation 'com.annimon:stream:1.2.2'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.7'
|
||||
// implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||
implementation 'org.apache.commons:commons-text:1.9'
|
||||
|
||||
//MVVM
|
||||
def dagger2_version = '2.46.1'
|
||||
def dagger2_version = '2.55'
|
||||
api "com.google.dagger:dagger:$dagger2_version"
|
||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
||||
api "com.google.dagger:dagger-android:$dagger2_version"
|
||||
@ -143,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'
|
||||
|
||||
@ -157,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')
|
||||
@ -177,14 +178,14 @@ 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'
|
||||
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
|
||||
//JWTUtils
|
||||
implementation 'com.auth0.android:jwtdecode:2.0.2'
|
||||
//Barcode generator
|
||||
implementation group: 'com.google.zxing', name: 'core', version: '3.5.3'
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
@ -24,8 +24,8 @@
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
|
||||
BIN
app/src/main/ic_launcher-playstore.png
Normal file
BIN
app/src/main/ic_launcher-playstore.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
@ -29,6 +29,8 @@ import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniE
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsComponent;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectLotti.DialogSelectLottiComponent;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectLotti.DialogSelectLottiModule;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleComponent;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
||||
import it.integry.integrywmsnative.gest.inventario.ElencoInventariComponent;
|
||||
@ -69,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;
|
||||
@ -110,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;
|
||||
@ -126,6 +130,8 @@ import it.integry.integrywmsnative.view.dialogs.choose_arts_from_mtbcolr_list.Di
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_mtbcolr_list.DialogChooseArtsFromMtbColrListModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.create_new_art.DialogCreateNewArtComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.create_new_art.DialogCreateNewArtModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdComponent;
|
||||
@ -142,8 +148,12 @@ import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.switch_user_depo.DialogSwitchUserDepoComponent;
|
||||
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
|
||||
@ -189,6 +199,7 @@ import it.integry.integrywmsnative.view.dialogs.tracciamento_imballi.DialogTracc
|
||||
DialogSelectDocInfoModule.class,
|
||||
DocInterniEditFormModule.class,
|
||||
DialogSelectDocRowsModule.class,
|
||||
DialogSelectLottiModule.class,
|
||||
DialogAskClienteModule.class,
|
||||
DialogEditArticoloModule.class,
|
||||
DialogPrintOrderSSCCListModule.class,
|
||||
@ -218,7 +229,11 @@ import it.integry.integrywmsnative.view.dialogs.tracciamento_imballi.DialogTracc
|
||||
DialogInfoGiacenzaModule.class,
|
||||
ArticoliInGiacenzaModule.class,
|
||||
DialogTracciamentoImballiModule.class,
|
||||
DialogAskVettoreModule.class
|
||||
DialogAskVettoreModule.class,
|
||||
DialogAskVettoreModule.class,
|
||||
DialogCreateNewArtModule.class,
|
||||
DialogSwitchUserDepoModule.class,
|
||||
DialogUpdateAvailableModule.class
|
||||
})
|
||||
public interface MainApplicationComponent {
|
||||
|
||||
@ -337,6 +352,7 @@ public interface MainApplicationComponent {
|
||||
DialogInfoSituazioneArticoloComponent.Factory dialogInfoSituazioneArticoloComponent();
|
||||
|
||||
DialogSelectDocRowsComponent.Factory dialogSelectDocRowsNewComponent();
|
||||
DialogSelectLottiComponent.Factory dialogSelectLottiComponent();
|
||||
|
||||
DialogSelectArtToOrderComponent.Factory dialogSelectArtToOrderNewComponent();
|
||||
|
||||
@ -366,6 +382,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);
|
||||
|
||||
@ -38,12 +38,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;
|
||||
@ -85,8 +87,8 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
public SettingsManager provideSettingsManager(SystemRESTConsumer systemRESTConsumer, AziendaRESTConsumer aziendaRESTConsumer, PosizioniRESTConsumer posizioniRESTConsumer, GestSetupRESTConsumer gestSetupRESTConsumer) {
|
||||
return new SettingsManager(mApplication, systemRESTConsumer, aziendaRESTConsumer, gestSetupRESTConsumer, posizioniRESTConsumer);
|
||||
public SettingsManager provideSettingsManager(SystemRESTConsumer systemRESTConsumer, ImballiRESTConsumer imballiRESTConsumer, AziendaRESTConsumer aziendaRESTConsumer, PosizioniRESTConsumer posizioniRESTConsumer, GestSetupRESTConsumer gestSetupRESTConsumer) {
|
||||
return new SettingsManager(mApplication, systemRESTConsumer, imballiRESTConsumer, aziendaRESTConsumer, gestSetupRESTConsumer, posizioniRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@ -216,6 +218,12 @@ public class MainApplicationModule {
|
||||
return new AziendaRESTConsumer(restBuilder);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ProduzioneRESTConsumer provideProduzioneRESTConsumer() {
|
||||
return new ProduzioneRESTConsumer();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
BarcodeRESTConsumer provideBarcodeRESTConsumer(Ean128Service ean128Service) {
|
||||
@ -324,6 +332,12 @@ public class MainApplicationModule {
|
||||
return new MagazzinoBufferRESTConsumer(restBuilder);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MaterialiRESTConsumer provideMaterialiRESTConsumer(ExecutorService executorService) {
|
||||
return new MaterialiRESTConsumer(executorService);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
SoundAlertService provideSoundAlertService() {
|
||||
|
||||
@ -103,12 +103,12 @@ public class SplashActivity extends BaseActivity implements MainContext.Listener
|
||||
|
||||
@Override
|
||||
public void onDBDataLoading(String item) {
|
||||
mBinding.loadingInfoTextview.setText("Caricamento " + item);
|
||||
runOnUiThread(() -> mBinding.loadingInfoTextview.setText("Caricamento " + item));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMenuLoading() {
|
||||
mBinding.loadingInfoTextview.setText("Caricamento menù");
|
||||
runOnUiThread(() -> mBinding.loadingInfoTextview.setText("Caricamento menù"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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));
|
||||
}
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -9,7 +9,7 @@ import java.math.BigDecimal;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class BindableBigDecimal implements Observable {
|
||||
public class BindableBigDecimal implements Observable {
|
||||
|
||||
BigDecimal mValue;
|
||||
|
||||
|
||||
@ -105,6 +105,28 @@ public class Converters {
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableField, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
String newValue = observableField != null ? observableField.get() : "";
|
||||
if (!view.getText().toString().equals(newValue)) {
|
||||
view.setText(newValue);
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindEditText(AppCompatTextView view, final ValidatableObservableField<String> observableField) {
|
||||
Pair<ValidatableObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != observableField) {
|
||||
if (pair != null) {
|
||||
view.removeTextChangedListener(pair.second);
|
||||
}
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
if (observableField != null) observableField.set(s.toString());
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableField, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
String newValue = observableField.get();
|
||||
if (!view.getText().toString().equals(newValue)) {
|
||||
view.setText(newValue);
|
||||
@ -156,6 +178,28 @@ public class Converters {
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindEditText(EditText view, final ValidatableObservableField<String> observableString) {
|
||||
Pair<ValidatableObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != observableString) {
|
||||
if (pair != null) {
|
||||
view.removeTextChangedListener(pair.second);
|
||||
}
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
observableString.set(s.toString());
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableString, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
String newValue = observableString.get();
|
||||
if (!view.getText().toString().equals(newValue)) {
|
||||
view.setText(newValue);
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindEditText(AutoCompleteTextView view, final ObservableField<String> observableString) {
|
||||
Pair<ObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
@ -260,6 +304,36 @@ public class Converters {
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindTextInputEditTextBigDecimal(EditText view, final ValidatableObservableField<BigDecimal> observableBigDecimal) {
|
||||
Pair<ValidatableObservableField<BigDecimal>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != observableBigDecimal) {
|
||||
if (pair != null) {
|
||||
view.removeTextChangedListener(pair.second);
|
||||
}
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
BigDecimal value = null;
|
||||
String newValueString = s.toString().trim();
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(newValueString))
|
||||
value = new BigDecimal(newValueString);
|
||||
|
||||
observableBigDecimal.set(value);
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableBigDecimal, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
BigDecimal newValue = observableBigDecimal.get();
|
||||
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
|
||||
|
||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||
view.setText(UtilityNumber.decimalToString(newValue));
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindTextInputEditTextBigDecimal(TextInputEditText view, final BindableBigDecimal bindableBigDecimal) {
|
||||
Pair<BindableBigDecimal, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
@ -280,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));
|
||||
@ -307,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());
|
||||
@ -358,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());
|
||||
@ -385,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());
|
||||
@ -657,6 +731,30 @@ public class Converters {
|
||||
view.setChecked(newValue);
|
||||
}
|
||||
|
||||
@BindingAdapter("checked")
|
||||
public static void bindCheckbox(AppCompatCheckBox view, final ObservableField<Boolean> bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
view.setOnCheckedChangeListener((compoundButton, b) -> {
|
||||
bindableBoolean.set(b);
|
||||
});
|
||||
}
|
||||
Boolean newValue = bindableBoolean.get();
|
||||
view.setChecked(newValue);
|
||||
}
|
||||
|
||||
@BindingAdapter("checked")
|
||||
public static void bindCheckbox(AppCompatCheckBox view, final ValidatableObservableField<Boolean> bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
view.setOnCheckedChangeListener((compoundButton, b) -> {
|
||||
bindableBoolean.set(b);
|
||||
});
|
||||
}
|
||||
Boolean newValue = bindableBoolean.get();
|
||||
view.setChecked(newValue);
|
||||
}
|
||||
|
||||
@BindingAdapter("checked")
|
||||
public static void bindCheckbox(CheckBox view, final BindableBoolean bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
@ -721,10 +819,55 @@ public class Converters {
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter("visibilityWhenNotNull")
|
||||
public static void bindViewVisibilityWhenNotNull(View view, ObservableField<?> bindableObject) {
|
||||
if(bindableObject == null) return;
|
||||
|
||||
if (view.getTag(R.id.bound_observable) != bindableObject) {
|
||||
view.setTag(R.id.bound_observable, bindableObject);
|
||||
}
|
||||
|
||||
bindableObject.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
view.setVisibility(bindableObject.get() == null ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
view.setVisibility(bindableObject.get() == null ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@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) {
|
||||
|
||||
if (view.getTag(R.id.bound_observable_visibility) != bindableObject) {
|
||||
view.setTag(R.id.bound_observable_visibility, bindableObject);
|
||||
}
|
||||
|
||||
view.setVisibility(bindableObject == null || bindableObject.get() == null ? View.VISIBLE : View.GONE);
|
||||
|
||||
if(bindableObject == null) return;
|
||||
|
||||
bindableObject.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
view.setVisibility(bindableObject.get() == null ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter({"reverse_visibility"})
|
||||
public static void bindViewReverseVisibility(View view, final BindableBoolean bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
if (view.getTag(R.id.bound_reverse_visibility) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_reverse_visibility, bindableBoolean);
|
||||
}
|
||||
bindableBoolean.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
|
||||
@ -0,0 +1,65 @@
|
||||
package it.integry.integrywmsnative.core.di;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.BaseObservable;
|
||||
import androidx.databinding.Bindable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.core.di.validators.Validator;
|
||||
|
||||
public class ValidatableObservableField<T> extends BaseObservable {
|
||||
private T mValue;
|
||||
private final List<Validator<T>> validators = new ArrayList<>();
|
||||
public String errorMessage;
|
||||
|
||||
public ValidatableObservableField() {
|
||||
}
|
||||
|
||||
public ValidatableObservableField(T value) {
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the stored value.
|
||||
*/
|
||||
@Nullable
|
||||
public T get() {
|
||||
return mValue;
|
||||
}
|
||||
|
||||
public void set(T value) {
|
||||
if (value != mValue) {
|
||||
mValue = value;
|
||||
notifyChange();
|
||||
validate();
|
||||
}
|
||||
}
|
||||
|
||||
public void addValidator(Validator<T> validator) {
|
||||
validators.add(validator);
|
||||
}
|
||||
|
||||
public boolean validate() {
|
||||
for (Validator<T> validator : validators) {
|
||||
if (!validator.isValid(mValue)) {
|
||||
setErrorMessage(validator.getErrorMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
setErrorMessage(null);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
private void setErrorMessage(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
notifyPropertyChanged(BR.errorMessage); // Notifica il cambiamento di errorMessage
|
||||
}
|
||||
}
|
||||
@ -2,5 +2,25 @@ package it.integry.integrywmsnative.core.di.binders;
|
||||
|
||||
public class AutoCompleteTextViewBinders {
|
||||
|
||||
|
||||
// @BindingAdapter("binding")
|
||||
// public static void bindUntMisText(AppCompatAutoCompleteTextView view, ObservableField<MtbUntMis> untMisField) {
|
||||
// Pair<ObservableField<MtbUntMis>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
// if (pair == null || pair.first != untMisField) {
|
||||
// if (pair != null) {
|
||||
// view.removeTextChangedListener(pair.second);
|
||||
// }
|
||||
// TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
// @Override
|
||||
// public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
// if (untMisField != null) untMisField.set(s.toString());
|
||||
// }
|
||||
// };
|
||||
// view.setTag(R.id.bound_observable, new Pair<>(untMisField, watcher));
|
||||
// view.addTextChangedListener(watcher);
|
||||
// }
|
||||
// String newValue = untMisField != null && untMisField.get() != null ? Objects.requireNonNull(untMisField.get()).getUntMis() : "";
|
||||
// if (!view.getText().toString().equals(newValue)) {
|
||||
// view.setText(newValue);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.di.binders;
|
||||
|
||||
import androidx.databinding.BindingAdapter;
|
||||
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
|
||||
public class TextInputLayoutBinders {
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
package it.integry.integrywmsnative.core.di.validators;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class GreaterThenValidator implements Validator<BigDecimal> {
|
||||
private final String errorMessage;
|
||||
private final BigDecimal greaterThanValue;
|
||||
|
||||
public GreaterThenValidator(BigDecimal greaterThanValue, String errorMessage) {
|
||||
this.greaterThanValue = greaterThanValue;
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(BigDecimal value) {
|
||||
return value != null && value.compareTo(greaterThanValue) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package it.integry.integrywmsnative.core.di.validators;
|
||||
|
||||
public class MinLengthValidator implements Validator<String> {
|
||||
private final int minLength;
|
||||
private final String errorMessage;
|
||||
|
||||
public MinLengthValidator(int minLength, String errorMessage) {
|
||||
this.minLength = minLength;
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(String value) {
|
||||
return value != null && value.length() >= minLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package it.integry.integrywmsnative.core.di.validators;
|
||||
|
||||
public class NotEmptyValidator implements Validator<String> {
|
||||
private final String errorMessage;
|
||||
|
||||
public NotEmptyValidator(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(String value) {
|
||||
return value != null && !value.trim().isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package it.integry.integrywmsnative.core.di.validators;
|
||||
|
||||
public class NotNullValidator<T> implements Validator<T>{
|
||||
private final String errorMessage;
|
||||
|
||||
public NotNullValidator(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(T value) {
|
||||
return value != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.di.validators;
|
||||
|
||||
public interface Validator<T> {
|
||||
boolean isValid(T value);
|
||||
|
||||
String getErrorMessage();
|
||||
}
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -6,6 +6,8 @@ import android.view.KeyEvent;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
@ -18,7 +20,8 @@ public class BaseActivity extends AppCompatActivity {
|
||||
@Inject
|
||||
public DialogProgressView mCurrentProgress;
|
||||
|
||||
private boolean progressOpened;
|
||||
@Inject
|
||||
public ExecutorService executorService;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
@ -47,28 +50,19 @@ public class BaseActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void openProgress() {
|
||||
BarcodeManager.disable();
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
||||
this.progressOpened = true;
|
||||
runOnUiThread(() -> {
|
||||
try {
|
||||
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
|
||||
} catch (IllegalStateException ise) {
|
||||
//ignored
|
||||
}
|
||||
});
|
||||
}
|
||||
// executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(getSupportFragmentManager());
|
||||
// });
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
BarcodeManager.enable();
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
runOnUiThread(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
});
|
||||
}
|
||||
// executorService.execute(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -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 {
|
||||
|
||||
|
||||
@ -13,6 +13,8 @@ import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
@ -24,7 +26,9 @@ public abstract class BaseDialogFragment extends DialogFragment implements Dialo
|
||||
|
||||
@Inject
|
||||
public DialogProgressView mCurrentProgress;
|
||||
private boolean progressOpened;
|
||||
|
||||
@Inject
|
||||
public ExecutorService executorService;
|
||||
|
||||
private boolean mBarcodeListener = false;
|
||||
|
||||
@ -70,28 +74,26 @@ public abstract class BaseDialogFragment extends DialogFragment implements Dialo
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
|
||||
private void openProgress() {
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
||||
this.progressOpened = true;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
BarcodeManager.disable();
|
||||
// executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager());
|
||||
// });
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
});
|
||||
}
|
||||
BarcodeManager.enable();
|
||||
// executorService.execute(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
public void onError(Exception ex) {
|
||||
this.onLoadingEnded();
|
||||
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.onLoadingEnded();
|
||||
UtilityExceptions.defaultException(requireActivity(), ex);
|
||||
});
|
||||
}
|
||||
|
||||
@ -33,7 +33,6 @@ public abstract class BaseFragment extends Fragment {
|
||||
protected ElevatedToolbar mToolbar;
|
||||
|
||||
protected final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||
private boolean progressOpened;
|
||||
|
||||
|
||||
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
||||
@ -67,22 +66,16 @@ public abstract class BaseFragment extends Fragment {
|
||||
|
||||
private void openProgress() {
|
||||
BarcodeManager.disable();
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
||||
this.progressOpened = true;
|
||||
executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
// executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager());
|
||||
// });
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
BarcodeManager.enable();
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
executorService.execute(() -> {
|
||||
mCurrentProgress.dismissAllowingStateLoss();
|
||||
});
|
||||
}
|
||||
// executorService.execute(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
// });
|
||||
}
|
||||
|
||||
public void onError(Exception ex) {
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
package it.integry.integrywmsnative.core.helper;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
|
||||
public final class GestioneToTextConverter {
|
||||
|
||||
public static String convert(GestioneEnum gestioneEnum) {
|
||||
return switch (gestioneEnum) {
|
||||
case ACQUISTO -> "Acquisto";
|
||||
case PRODUZIONE -> "Produzione";
|
||||
case LAVORAZIONE -> "Lavorazione";
|
||||
case VENDITA -> "Vendita";
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.mapper;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRowRoomDTO;
|
||||
import it.integry.integrywmsnative.core.model.MtbInvenr;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
|
||||
public class InventarioRowMapper extends BaseMapper<MtbInvenr, InventarioRowRoomDTO> {
|
||||
|
||||
@ -32,6 +33,7 @@ public class InventarioRowMapper extends BaseMapper<MtbInvenr, InventarioRowRoom
|
||||
data.setDataOraInv(inputData.getDataOraInv());
|
||||
data.setScanCodBarre(inputData.getScanCodBarre());
|
||||
data.setZona(inputData.getZona());
|
||||
data.setIdDisp(SettingsManager.i().getUserSession().getDeviceId());
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,36 +1,32 @@
|
||||
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
|
||||
public class MenuRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final RESTBuilder restBuilder;
|
||||
|
||||
public MenuRESTConsumer(RESTBuilder restBuilder) {
|
||||
this.restBuilder = restBuilder;
|
||||
}
|
||||
|
||||
public void retrieveMenu(String rootCodOpz, RunnableArgs<StbMenu> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
MenuRESTConsumerService menuRESTConsumerService = restBuilder.getService(MenuRESTConsumerService.class);
|
||||
menuRESTConsumerService.retrieveMenuConfig(rootCodOpz).enqueue(new Callback<>() {
|
||||
MenuRESTConsumerService menuRESTConsumerService = RESTBuilder.getService(MenuRESTConsumerService.class);
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
@ -261,6 +252,11 @@ public class MtbColr extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbColr setDataColloRif(LocalDate dataColloRif) {
|
||||
this.dataColloRif = UtilityDate.formatDate(dataColloRif, UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnf() {
|
||||
return qtaCnf;
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.model;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.databinding.ObservableField;
|
||||
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
@ -10,11 +11,13 @@ import com.annimon.stream.Stream;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.dto.InternalCodAnagsDTO;
|
||||
import it.integry.integrywmsnative.core.model.observable.ObservableMtbTcol;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||
@ -63,7 +66,7 @@ public class MtbColt extends EntityBase {
|
||||
private BigDecimal altezzaCm;
|
||||
private String codJcom;
|
||||
|
||||
private MtbTCol mtbTCol;
|
||||
private final ObservableField<ObservableMtbTcol> mtbTCol = new ObservableField<>();
|
||||
|
||||
private Boolean disablePrint;
|
||||
private String ragSocCliente;
|
||||
@ -160,6 +163,10 @@ public class MtbColt extends EntityBase {
|
||||
return UtilityDate.recognizeDateWithExceptionHandler(getDataColloS());
|
||||
}
|
||||
|
||||
public LocalDate getDataColloLD() {
|
||||
return UtilityDate.recognizeLocalDateWithExceptionHandler(getDataColloS());
|
||||
}
|
||||
|
||||
public MtbColt setDataCollo(String dataCollo) {
|
||||
this.dataCollo = dataCollo;
|
||||
return this;
|
||||
@ -170,6 +177,11 @@ public class MtbColt extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbColt setDataCollo(LocalDate dataCollo) {
|
||||
this.dataCollo = UtilityDate.formatDate(dataCollo, UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSerCollo() {
|
||||
return serCollo;
|
||||
}
|
||||
@ -248,6 +260,16 @@ public class MtbColt extends EntityBase {
|
||||
|
||||
public MtbColt setCodTcol(String codTcol) {
|
||||
this.codTcol = codTcol;
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(codTcol)) {
|
||||
var fountMtbTcolObservable = SettingsManager.iDB().getInternalImballi().stream()
|
||||
.filter(x -> x.getCodTcol().equalsIgnoreCase(codTcol))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
this.setMtbTCol(fountMtbTcolObservable);
|
||||
} else
|
||||
this.setMtbTCol(null);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -522,15 +544,19 @@ public class MtbColt extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbTCol getMtbTCol() {
|
||||
return mtbTCol;
|
||||
public ObservableMtbTcol getMtbTCol() {
|
||||
return mtbTCol.get();
|
||||
}
|
||||
|
||||
public MtbColt setMtbTCol(MtbTCol mtbTCol) {
|
||||
this.mtbTCol = mtbTCol;
|
||||
public MtbColt setMtbTCol(ObservableMtbTcol mtbTCol) {
|
||||
this.mtbTCol.set(mtbTCol);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ObservableField<ObservableMtbTcol> mtbTcolProperty() {
|
||||
return mtbTCol;
|
||||
}
|
||||
|
||||
public void generaFiltroOrdineFromDTO(List<FiltroOrdineDTO> filtroOrdineDtos) {
|
||||
|
||||
String xmlPrefix = "{\"whereCond\": \"";
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MtbGrup extends EntityBase {
|
||||
|
||||
private String codMgrp;
|
||||
@ -8,6 +11,7 @@ public class MtbGrup extends EntityBase {
|
||||
private String logoWeb;
|
||||
private String criterioVal;
|
||||
private String tipoMgrp;
|
||||
private List<MtbSgrp> mtbSgrp = new ArrayList<>();
|
||||
|
||||
public MtbGrup() {
|
||||
this.type = "mtb_grup";
|
||||
@ -66,4 +70,13 @@ public class MtbGrup extends EntityBase {
|
||||
this.tipoMgrp = tipoMgrp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbSgrp> getMtbSgrp() {
|
||||
return mtbSgrp;
|
||||
}
|
||||
|
||||
public MtbGrup setMtbSgrp(List<MtbSgrp> mtbSgrp) {
|
||||
this.mtbSgrp = mtbSgrp;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,49 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
public class MtbSfam extends EntityBase {
|
||||
|
||||
private String codMgrp;
|
||||
private String codMsgr;
|
||||
private String codMsfa;
|
||||
private String descrizione;
|
||||
|
||||
public MtbSfam() {
|
||||
this.type = "mtb_sfam";
|
||||
}
|
||||
|
||||
public String getCodMgrp() {
|
||||
return codMgrp;
|
||||
}
|
||||
|
||||
public MtbSfam setCodMgrp(String codMgrp) {
|
||||
this.codMgrp = codMgrp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMsgr() {
|
||||
return codMsgr;
|
||||
}
|
||||
|
||||
public MtbSfam setCodMsgr(String codMsgr) {
|
||||
this.codMsgr = codMsgr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMsfa() {
|
||||
return codMsfa;
|
||||
}
|
||||
|
||||
public MtbSfam setCodMsfa(String codMsfa) {
|
||||
this.codMsfa = codMsfa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public MtbSfam setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,112 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MtbSgrp extends EntityBase {
|
||||
|
||||
private String codMgrp;
|
||||
private String codMsgr;
|
||||
private String descrizione;
|
||||
private String inclInStat;
|
||||
private String contoRimFin;
|
||||
private Integer ordinamento;
|
||||
private Boolean chkGiacenzaNeg;
|
||||
private Boolean flagReso;
|
||||
private String codCconWip;
|
||||
private List<MtbSfam> mtbSfam = new ArrayList<>();
|
||||
|
||||
public MtbSgrp() {
|
||||
this.type = "mtb_sgrp";
|
||||
}
|
||||
|
||||
public String getCodMgrp() {
|
||||
return codMgrp;
|
||||
}
|
||||
|
||||
public MtbSgrp setCodMgrp(String codMgrp) {
|
||||
this.codMgrp = codMgrp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMsgr() {
|
||||
return codMsgr;
|
||||
}
|
||||
|
||||
public MtbSgrp setCodMsgr(String codMsgr) {
|
||||
this.codMsgr = codMsgr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public MtbSgrp setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getInclInStat() {
|
||||
return inclInStat;
|
||||
}
|
||||
|
||||
public MtbSgrp setInclInStat(String inclInStat) {
|
||||
this.inclInStat = inclInStat;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getContoRimFin() {
|
||||
return contoRimFin;
|
||||
}
|
||||
|
||||
public MtbSgrp setContoRimFin(String contoRimFin) {
|
||||
this.contoRimFin = contoRimFin;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getOrdinamento() {
|
||||
return ordinamento;
|
||||
}
|
||||
|
||||
public MtbSgrp setOrdinamento(Integer ordinamento) {
|
||||
this.ordinamento = ordinamento;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getChkGiacenzaNeg() {
|
||||
return chkGiacenzaNeg;
|
||||
}
|
||||
|
||||
public MtbSgrp setChkGiacenzaNeg(Boolean chkGiacenzaNeg) {
|
||||
this.chkGiacenzaNeg = chkGiacenzaNeg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getFlagReso() {
|
||||
return flagReso;
|
||||
}
|
||||
|
||||
public MtbSgrp setFlagReso(Boolean flagReso) {
|
||||
this.flagReso = flagReso;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodCconWip() {
|
||||
return codCconWip;
|
||||
}
|
||||
|
||||
public MtbSgrp setCodCconWip(String codCconWip) {
|
||||
this.codCconWip = codCconWip;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbSfam> getMtbSfam() {
|
||||
return mtbSfam;
|
||||
}
|
||||
|
||||
public MtbSgrp setMtbSfam(List<MtbSfam> mtbSfam) {
|
||||
this.mtbSfam = mtbSfam;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -15,7 +15,7 @@ public class MtbTCol {
|
||||
private BigDecimal taraKg;
|
||||
private String descrizione;
|
||||
private String codMart;
|
||||
private FlagUiUlEnum flagUIUL;
|
||||
private FlagUiUlEnum flagUiUl;
|
||||
private String circuito;
|
||||
|
||||
public String getCodTcol() {
|
||||
@ -90,12 +90,12 @@ public class MtbTCol {
|
||||
return this;
|
||||
}
|
||||
|
||||
public FlagUiUlEnum getFlagUIUL() {
|
||||
return flagUIUL;
|
||||
public FlagUiUlEnum getFlagUiUl() {
|
||||
return flagUiUl;
|
||||
}
|
||||
|
||||
public void setFlagUIUL(FlagUiUlEnum flagUIUL) {
|
||||
this.flagUIUL = flagUIUL;
|
||||
public void setFlagUiUl(FlagUiUlEnum flagUiUl) {
|
||||
this.flagUiUl = flagUiUl;
|
||||
}
|
||||
|
||||
public String getCircuito() {
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class StbGestSetup extends EntityBase{
|
||||
|
||||
private String gestName;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class VtbVetr extends EntityBase {
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
package it.integry.integrywmsnative.core.model.mapper;
|
||||
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.databinding.ObservableList;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.model.observable.ObservableMtbTcol;
|
||||
|
||||
public class MtbTcolMapper {
|
||||
|
||||
public static ObservableMtbTcol fromDTO(MtbTCol dto) {
|
||||
ObservableMtbTcol mtbTcol = new ObservableMtbTcol();
|
||||
mtbTcol.updateFromDTO(dto);
|
||||
return mtbTcol;
|
||||
}
|
||||
|
||||
public static ObservableList<ObservableMtbTcol> fromDTOList(List<MtbTCol> dto) {
|
||||
ObservableList<ObservableMtbTcol> mtbTCols = new ObservableArrayList<>();
|
||||
|
||||
mtbTCols.addAll(dto.stream().map(MtbTcolMapper::fromDTO)
|
||||
.collect(Collectors.toUnmodifiableList()));
|
||||
|
||||
return mtbTCols;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,127 @@
|
||||
package it.integry.integrywmsnative.core.model.observable;
|
||||
|
||||
import androidx.databinding.BaseObservable;
|
||||
import androidx.databinding.Bindable;
|
||||
import androidx.databinding.ObservableField;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
|
||||
public class ObservableMtbTcol extends BaseObservable {
|
||||
|
||||
private final ObservableField<String> codTcol = new ObservableField<>();
|
||||
private final ObservableField<BigDecimal> pesoKg = new ObservableField<>();
|
||||
private final ObservableField<BigDecimal> lunghezzaCm = new ObservableField<>();
|
||||
private final ObservableField<BigDecimal> larghezzaCm = new ObservableField<>();
|
||||
private final ObservableField<BigDecimal> altezzaCm = new ObservableField<>();
|
||||
private final ObservableField<BigDecimal> taraKg = new ObservableField<>();
|
||||
private final ObservableField<String> descrizione = new ObservableField<>();
|
||||
private final ObservableField<String> codMart = new ObservableField<>();
|
||||
private final ObservableField<MtbTCol.FlagUiUlEnum> flagUIUL = new ObservableField<>();
|
||||
private final ObservableField<String> circuito = new ObservableField<>();
|
||||
|
||||
@Bindable
|
||||
public String getCodTcol() {
|
||||
return codTcol.get();
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public BigDecimal getPesoKg() {
|
||||
return pesoKg.get();
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public BigDecimal getLunghezzaCm() {
|
||||
return lunghezzaCm.get();
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public BigDecimal getLarghezzaCm() {
|
||||
return larghezzaCm.get();
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public BigDecimal getAltezzaCm() {
|
||||
return altezzaCm.get();
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public BigDecimal getTaraKg() {
|
||||
return taraKg.get();
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public String getDescrizione() {
|
||||
return descrizione.get();
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public String getCodMart() {
|
||||
return codMart.get();
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public MtbTCol.FlagUiUlEnum getFlagUIUL() {
|
||||
return flagUIUL.get();
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public String getCircuito() {
|
||||
return circuito.get();
|
||||
}
|
||||
|
||||
|
||||
public ObservableField<String> codTcolProperty() {
|
||||
return codTcol;
|
||||
}
|
||||
|
||||
public ObservableField<BigDecimal> pesoKgProperty() {
|
||||
return pesoKg;
|
||||
}
|
||||
|
||||
public ObservableField<BigDecimal> lunghezzaCmProperty() {
|
||||
return lunghezzaCm;
|
||||
}
|
||||
|
||||
public ObservableField<BigDecimal> larghezzaCmProperty() {
|
||||
return larghezzaCm;
|
||||
}
|
||||
|
||||
public ObservableField<BigDecimal> altezzaCmProperty() {
|
||||
return altezzaCm;
|
||||
}
|
||||
|
||||
public ObservableField<BigDecimal> taraKgProperty() {
|
||||
return taraKg;
|
||||
}
|
||||
|
||||
public ObservableField<String> descrizioneProperty() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public ObservableField<String> codMartProperty() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public ObservableField<MtbTCol.FlagUiUlEnum> flagUIULProperty() {
|
||||
return flagUIUL;
|
||||
}
|
||||
|
||||
public ObservableField<String> circuitoProperty() {
|
||||
return circuito;
|
||||
}
|
||||
|
||||
public void updateFromDTO(MtbTCol mtbTCol) {
|
||||
codTcol.set(mtbTCol.getCodTcol());
|
||||
pesoKg.set(mtbTCol.getPesoKg());
|
||||
lunghezzaCm.set(mtbTCol.getLunghezzaCm());
|
||||
larghezzaCm.set(mtbTCol.getLarghezzaCm());
|
||||
altezzaCm.set(mtbTCol.getAltezzaCm());
|
||||
taraKg.set(mtbTCol.getTaraKg());
|
||||
descrizione.set(mtbTCol.getDescrizione());
|
||||
codMart.set(mtbTCol.getCodMart());
|
||||
flagUIUL.set(mtbTCol.getFlagUiUl());
|
||||
circuito.set(mtbTCol.getCircuito());
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
@ -17,29 +19,65 @@ 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;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.SaveArticoloRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.SaveArticoloResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.SearchArticoloByBarcodeRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.SearchArticoloByBarcodeResponseDTO;
|
||||
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
|
||||
public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final RESTBuilder restBuilder;
|
||||
private final SystemRESTConsumer systemRESTConsumer;
|
||||
|
||||
public ArticoloRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer) {
|
||||
this.restBuilder = restBuilder;
|
||||
public ArticoloRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
this.systemRESTConsumer = systemRESTConsumer;
|
||||
}
|
||||
|
||||
|
||||
public void retrieveAvailableUntMis(RunnableArgs<List<MtbUntMis>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
articoloRESTConsumerService
|
||||
.retrieveAvailableUntMis()
|
||||
.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, @NonNull final Exception e) {
|
||||
onFailed.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void retrieveAvailableGruppiMerceologici(RunnableArgs<List<MtbGrup>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
articoloRESTConsumerService
|
||||
.retrieveAvailableGruppiMerceologici()
|
||||
.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, @NonNull final Exception e) {
|
||||
onFailed.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void searchByBarcode(String barcodeProd, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ArticoloRESTConsumerService articoloRESTConsumerService = restBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
|
||||
var request = new SearchArticoloByBarcodeRequestDTO()
|
||||
.setBarcode(barcodeProd)
|
||||
@ -47,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) -> {
|
||||
@ -56,32 +94,56 @@ 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void findIfIsKit(MtbAart mtbAart, RunnableArgs<MtbAart> onComplete, RunnableArgs<Exception> onFailed){
|
||||
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
|
||||
articoloRESTConsumerService
|
||||
.findIfIsKit(mtbAart)
|
||||
.enqueue(new ManagedErrorCallback<>() {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<ServiceRESTResponse<MtbAart>> call, @NonNull Response<ServiceRESTResponse<MtbAart>> response) {
|
||||
analyzeAnswer(response, "findIfIsKit", (m) -> {
|
||||
onComplete.run(response.body().getDto());
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<MtbAart>> call, @NonNull Exception e) {
|
||||
onFailed.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getByCodMarts(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
getByCodMartsStatic(codMartToFind, onComplete, onFailed);
|
||||
}
|
||||
|
||||
public static void getByCodMartsStatic(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
var codMarts = Stream.of(codMartToFind)
|
||||
.withoutNulls()
|
||||
.distinct().toList();
|
||||
|
||||
|
||||
ArticoloRESTConsumerService articoloRESTConsumer = restBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
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);
|
||||
}
|
||||
});
|
||||
|
||||
@ -89,16 +151,16 @@ 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<>() {
|
||||
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
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);
|
||||
}
|
||||
});
|
||||
|
||||
@ -180,7 +242,7 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
public void updateBarcodeImballo(String codMart, String newBarcodeImballo, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ArticoloRESTConsumerService articoloRESTConsumerService = restBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
|
||||
var request = new UpdateBarcodeImballoRequestDTO()
|
||||
.setCodMart(codMart)
|
||||
@ -188,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 -> {
|
||||
@ -197,8 +259,32 @@ 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void saveArticolo(ArticoloDTO articoloToSave, RunnableArgs<String> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
|
||||
var request = new SaveArticoloRequestDTO()
|
||||
.setArtToSave(articoloToSave);
|
||||
|
||||
articoloRESTConsumerService
|
||||
.saveArticolo(request)
|
||||
.enqueue(new ManagedErrorCallback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<SaveArticoloResponseDTO>> call, Response<ServiceRESTResponse<SaveArticoloResponseDTO>> response) {
|
||||
analyzeAnswer(response, "saveArticolo", data -> {
|
||||
onComplete.run(data.getCodMart());
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<SaveArticoloResponseDTO>> call, @NonNull final Exception e) {
|
||||
onFailed.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -3,9 +3,13 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
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.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.RetrieveArticoloByCodMartRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.SaveArticoloRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.SaveArticoloResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.SearchArticoloByBarcodeRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.SearchArticoloByBarcodeResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.UpdateBarcodeImballoRequestDTO;
|
||||
@ -17,9 +21,19 @@ import retrofit2.http.Query;
|
||||
|
||||
public interface ArticoloRESTConsumerService {
|
||||
|
||||
|
||||
@GET("wms/articolo/availableUntMis")
|
||||
Call<ServiceRESTResponse<MtbUntMis>> retrieveAvailableUntMis();
|
||||
|
||||
@GET("wms/articolo/availableGruppiMerceologici")
|
||||
Call<ServiceRESTResponse<MtbGrup>> retrieveAvailableGruppiMerceologici();
|
||||
|
||||
@POST("wms/articolo/searchByBarcode")
|
||||
Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> searchByBarcode(@Body() SearchArticoloByBarcodeRequestDTO searchArticoloByBarcodeRequest);
|
||||
|
||||
@POST("wms/articolo/findIfIsKit")
|
||||
Call<ServiceRESTResponse<MtbAart>> findIfIsKit(@Body MtbAart mtbAart);
|
||||
|
||||
@POST("wms/articolo/retrieveByCodMart")
|
||||
Call<ServiceRESTResponse<List<MtbAart>>> getByCodMart(@Body RetrieveArticoloByCodMartRequestDTO retrieveArticoloByCodMartRequest);
|
||||
|
||||
@ -29,4 +43,7 @@ public interface ArticoloRESTConsumerService {
|
||||
@GET("getProductLotStatus")
|
||||
Call<ServiceRESTResponse<List<StatoArticoloDTO>>> getStatoPartita(@Query("codMart") String codMart, @Query("partitaMag") String partitaMag);
|
||||
|
||||
@POST("wms/articolo/saveArticolo")
|
||||
Call<ServiceRESTResponse<SaveArticoloResponseDTO>> saveArticolo(@Body SaveArticoloRequestDTO saveArticoloRequest);
|
||||
|
||||
}
|
||||
|
||||
@ -1,35 +1,31 @@
|
||||
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
|
||||
public class AziendaRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final RESTBuilder restBuilder;
|
||||
|
||||
public AziendaRESTConsumer(RESTBuilder restBuilder) {
|
||||
this.restBuilder = restBuilder;
|
||||
}
|
||||
|
||||
public void retrieveAzienda(RunnableArgs<Azienda> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
AziendaRESTConsumerService aziendaRESTConsumerService = restBuilder.getService(AziendaRESTConsumerService.class);
|
||||
aziendaRESTConsumerService.retrieveDefaultAzienda().enqueue(new Callback<>() {
|
||||
AziendaRESTConsumerService aziendaRESTConsumerService = RESTBuilder.getService(AziendaRESTConsumerService.class);
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -34,15 +36,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);
|
||||
}
|
||||
});
|
||||
|
||||
@ -53,15 +55,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -71,15 +73,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -89,15 +91,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -107,15 +109,32 @@ 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void checkBarcodeUl(String barcodeUl, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed){
|
||||
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
||||
|
||||
colliAccettazioneRESTConsumerService.checkIfBarcodeUlAlreadyRegistered(barcodeUl)
|
||||
.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, @NonNull final Exception e) {
|
||||
onFailed.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -12,7 +12,9 @@ import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowResponseDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface ColliAccettazioneRESTConsumerService {
|
||||
|
||||
@ -31,4 +33,7 @@ public interface ColliAccettazioneRESTConsumerService {
|
||||
@POST("wms/accettazione/deleteUDCRow")
|
||||
Call<ServiceRESTResponse<Void>> deleteUDCRow(@Body DeleteUDCRowRequestDTO deleteUDCRowRequestDTO);
|
||||
|
||||
@GET("wms/accettazione/checkIfBarcodeUlAlreadyRegistered")
|
||||
Call<ServiceRESTResponse<Boolean>> checkIfBarcodeUlAlreadyRegistered(@Query("barcodeUl") String barcodeUl);
|
||||
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -54,15 +56,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -72,15 +74,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -90,15 +92,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -108,15 +110,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -125,15 +127,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);
|
||||
}
|
||||
});
|
||||
|
||||
@ -144,15 +146,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -162,15 +164,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -179,15 +181,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -197,15 +199,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -215,15 +217,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -254,15 +256,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
|
||||
import com.annimon.stream.Optional;
|
||||
@ -11,6 +12,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.lang.reflect.Type;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@ -28,9 +30,13 @@ 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;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CanULBeDeletedRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
|
||||
@ -42,27 +48,24 @@ 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
|
||||
public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final RESTBuilder restBuilder;
|
||||
private final SystemRESTConsumer systemRESTConsumer;
|
||||
private final ArticoloRESTConsumer articoloRESTConsumer;
|
||||
private final EntityRESTConsumer entityRESTConsumer;
|
||||
private final SettingsManager settingsManager;
|
||||
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||
private final EntityRESTConsumer mEntityRESTConsumer;
|
||||
private final SettingsManager mSettingsManager;
|
||||
|
||||
public ColliMagazzinoRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer,
|
||||
public ColliMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer,
|
||||
ArticoloRESTConsumer articoloRESTConsumer,
|
||||
EntityRESTConsumer entityRESTConsumer,
|
||||
SettingsManager settingsManager) {
|
||||
this.restBuilder = restBuilder;
|
||||
this.systemRESTConsumer = systemRESTConsumer;
|
||||
this.articoloRESTConsumer = articoloRESTConsumer;
|
||||
this.entityRESTConsumer = entityRESTConsumer;
|
||||
this.settingsManager = settingsManager;
|
||||
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||
this.mEntityRESTConsumer = entityRESTConsumer;
|
||||
this.mSettingsManager = settingsManager;
|
||||
}
|
||||
|
||||
public void saveCollo(MtbColt mtbColtToSave, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
@ -80,7 +83,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
.setMtbPartitaMag(null));
|
||||
}
|
||||
|
||||
this.entityRESTConsumer.processEntity(mtbColtToSaveClone, new ISimpleOperationCallback<MtbColt>() {
|
||||
this.mEntityRESTConsumer.processEntity(mtbColtToSaveClone, new ISimpleOperationCallback<>() {
|
||||
@Override
|
||||
public void onSuccess(MtbColt value) {
|
||||
if (onComplete != null) onComplete.run(value);
|
||||
@ -104,7 +107,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
}
|
||||
|
||||
this.entityRESTConsumer.processEntityList(mtbColtsToSave, true, MtbColt.class, onComplete, onFailed);
|
||||
this.mEntityRESTConsumer.processEntityList(mtbColtsToSave, true, MtbColt.class, onComplete, onFailed);
|
||||
|
||||
}
|
||||
|
||||
@ -282,13 +285,13 @@ 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 colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new ManagedErrorCallback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||
analyzeAnswer(response, "GetBySSCC", mtbColt -> {
|
||||
|
||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||
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);
|
||||
@ -300,13 +303,17 @@ 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void fillMtbAartsOfMtbColts(List<MtbColt> mtbColts, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
fillMtbAartsOfMtbColtsStatic(mtbColts, onComplete, onFailed);
|
||||
}
|
||||
|
||||
public static void fillMtbAartsOfMtbColtsStatic(List<MtbColt> mtbColts, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
List<String> codMarts = new ArrayList<>();
|
||||
|
||||
for (MtbColt mtbColt : mtbColts) {
|
||||
@ -318,7 +325,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
articoloRESTConsumer.getByCodMarts(codMarts, arts -> {
|
||||
ArticoloRESTConsumer.getByCodMartsStatic(codMarts, arts -> {
|
||||
|
||||
if (arts != null && !arts.isEmpty()) {
|
||||
for (MtbColt mtbColt : mtbColts) {
|
||||
@ -329,7 +336,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
List<MtbAart> mtbAartStream = Stream.of(arts)
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart())).toList();
|
||||
|
||||
if (!mtbAartStream.isEmpty()) {
|
||||
if (mtbAartStream != null && !mtbAartStream.isEmpty()) {
|
||||
foundMtbAart = mtbAartStream.get(0);
|
||||
}
|
||||
|
||||
@ -378,35 +385,32 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
testata.setMtbColr(new ObservableArrayList<>());
|
||||
|
||||
|
||||
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 colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
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 changePosizione(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
String codMdep = posizione.getCodMdep();
|
||||
String posizioneString = posizione.getPosizione();
|
||||
|
||||
public void spostaUL(MtbColt mtbColtToMove, String codMdep, String posizione, boolean createDocAutomatically, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
MtbColt mtbColtToMoveClone = (MtbColt) mtbColtToMove.clone();
|
||||
|
||||
for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) {
|
||||
@ -415,26 +419,66 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
.setMtbPartitaMag(null);
|
||||
}
|
||||
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
SpostaULRequestDTO spostaUlRequestDTO = new SpostaULRequestDTO()
|
||||
.setCodMdep(codMdep)
|
||||
.setPosizione(posizione)
|
||||
.setMtbColtsToMove(Collections.singletonList(mtbColtToMoveClone))
|
||||
.setCreateDocAutomatically(createDocAutomatically);
|
||||
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService
|
||||
.spostaULInPosizione(codMdep,
|
||||
posizioneString,
|
||||
mtbColtToMoveClone)
|
||||
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
||||
.spostaUL(spostaUlRequestDTO)
|
||||
.enqueue(new ManagedErrorCallback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
analyzeAnswer(response, "changePosizione", mtbColts -> {
|
||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||
analyzeAnswer(response, "spostaUL", mtbColts -> {
|
||||
onComplete.run();
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Object>> 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void spostaUL(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
String codMdep = posizione.getCodMdep();
|
||||
String posizioneString = posizione.getPosizione();
|
||||
|
||||
spostaUL(mtbColtToMove, codMdep, posizioneString, true, onComplete, onFailed);
|
||||
}
|
||||
|
||||
public void updateTipoUL(MtbColt mtbColt, String codTcol, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
MtbColt mtbColtClone = (MtbColt) mtbColt.clone();
|
||||
mtbColtClone.setMtbColr(new ObservableArrayList<>());
|
||||
|
||||
UpdateTipoULRequestDTO updateTipoULRequest = new UpdateTipoULRequestDTO()
|
||||
.setMtbColt(mtbColtClone)
|
||||
.setCodTcol(codTcol);
|
||||
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService
|
||||
.updateTipoUL(updateTipoULRequest)
|
||||
.enqueue(new ManagedErrorCallback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||
analyzeAnswer(response, "updateTipoUL", mtbColts -> {
|
||||
onComplete.run();
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||
if (onFailed != null) onFailed.run(e);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void updateDataFine(MtbColt mtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
MtbColt cloneMtbColt = (MtbColt) mtbColt.clone();
|
||||
@ -451,19 +495,19 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
public 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>>>() {
|
||||
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 ManagedErrorCallback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<MtbColt>>> call, Response<ServiceRESTResponse<List<MtbColt>>> response) {
|
||||
analyzeAnswer(response, "getColliInBasket", mtbColts -> {
|
||||
fillMtbAartsOfMtbColts(mtbColts, onComplete, onFailed);
|
||||
fillMtbAartsOfMtbColtsStatic(mtbColts, onComplete, onFailed);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -478,24 +522,24 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
.setNewNumCnf(newNumCnf)
|
||||
.setNewQtaCol(newQtaTot);
|
||||
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
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();
|
||||
@ -510,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 colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService.spostaArtsTraUL(spostaArtsTraULRequestDTO).enqueue(new ManagedErrorCallback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> 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<Object>> 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();
|
||||
@ -538,8 +583,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
.setMtbPartitaMag(null);
|
||||
}
|
||||
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService.assegnaLottoSuColloScarico(sourceMtbColtClone).enqueue(new Callback<>() {
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService.assegnaLottoSuColloScarico(sourceMtbColtClone).enqueue(new ManagedErrorCallback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||
analyzeAnswer(response, "assegnaLottoSuColloScarico", data -> {
|
||||
@ -548,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -563,8 +608,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
.setMtbPartitaMag(null);
|
||||
}
|
||||
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService.versamentoAutomaticoUL(sourceMtbColtClone).enqueue(new Callback<>() {
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService.versamentoAutomaticoUL(sourceMtbColtClone).enqueue(new ManagedErrorCallback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> call, Response<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> response) {
|
||||
analyzeAnswer(response, "versamentoAutomaticoUL", data -> {
|
||||
@ -578,7 +623,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
.map(x -> x.getCodMart().trim())
|
||||
.toList();
|
||||
|
||||
articoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
|
||||
mArticoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
|
||||
for (var mtbColr : allMtbColr) {
|
||||
|
||||
MtbAart foundMtbAart = null;
|
||||
@ -601,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -611,8 +656,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
MtbColt sourceMtbColtClone = (MtbColt) sourceMtbColt.clone();
|
||||
sourceMtbColtClone.setMtbColr(new ObservableArrayList<>());
|
||||
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService.confirmGiacenzaUL(sourceMtbColtClone).enqueue(new Callback<>() {
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService.confirmGiacenzaUL(sourceMtbColtClone).enqueue(new ManagedErrorCallback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
analyzeAnswer(response, "confirmGiacenzaUL", data -> {
|
||||
@ -622,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -649,7 +694,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {
|
||||
}.getType();
|
||||
this.systemRESTConsumer.<ArrayList<MtbColt>>processSql(query, typeOfObjectsList, data -> {
|
||||
this.mSystemRESTConsumer.<ArrayList<MtbColt>>processSql(query, typeOfObjectsList, data -> {
|
||||
onComplete.run(data.get(0));
|
||||
}, onFailed);
|
||||
}
|
||||
@ -659,36 +704,36 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
CanULBeDeletedRequestDTO canULBeDeletedRequestDTO = new CanULBeDeletedRequestDTO()
|
||||
.setMtbColt(mtbColt);
|
||||
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
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);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void deleteUL(DeleteULRequestDTO deleteULRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
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);
|
||||
}
|
||||
});
|
||||
|
||||
@ -700,18 +745,18 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
return;
|
||||
}
|
||||
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -7,6 +7,9 @@ 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;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CanULBeDeletedRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
|
||||
@ -31,11 +34,14 @@ public interface ColliMagazzinoRESTConsumerService {
|
||||
@POST("creaRettificaCollo")
|
||||
Call<ServiceRESTResponse<MtbColr>> creaRettificaCollo(@Query("codMdep") String codMdep, @Body RettificaULDTO rettificaULDTO);
|
||||
|
||||
@POST("wms/spostaULInPosizione")
|
||||
Call<ServiceRESTResponse<Object>> spostaULInPosizione(@Query("codMdep") String codMdep, @Query("posizione") String posizione, @Body MtbColt mtbColtToMove);
|
||||
@POST("wms/updateTipoUL")
|
||||
Call<ServiceRESTResponse<Void>> updateTipoUL(@Body UpdateTipoULRequestDTO requestDto);
|
||||
|
||||
@POST("wms/spostaUL")
|
||||
Call<ServiceRESTResponse<Void>> spostaUL(@Body SpostaULRequestDTO requestDto);
|
||||
|
||||
@POST("wms/spostaArtsTraUL")
|
||||
Call<ServiceRESTResponse<Object>> spostaArtsTraUL(@Body SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO);
|
||||
Call<ServiceRESTResponse<SpostaArtsTraULResponseDTO>> spostaArtsTraUL(@Body SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO);
|
||||
|
||||
@POST("wms/assegnaLottoSuColloScarico")
|
||||
Call<ServiceRESTResponse<MtbColt>> assegnaLottoSuColloScarico(@Body MtbColt mtbColt);
|
||||
|
||||
@ -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,18 +9,20 @@ 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;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DuplicateUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DuplicateUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
|
||||
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
|
||||
@ -34,15 +38,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);
|
||||
}
|
||||
});
|
||||
|
||||
@ -52,15 +56,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);
|
||||
}
|
||||
});
|
||||
|
||||
@ -70,15 +74,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -87,15 +91,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -104,18 +108,35 @@ 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);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void duplicateUDS(DuplicateUDSRequestDTO duplicateUDSRequestDTO, RunnableArgs<DuplicateUDSResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
|
||||
|
||||
colliSpedizioneRESTConsumerService.duplicateUDS(duplicateUDSRequestDTO)
|
||||
.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 final Exception e) {
|
||||
onFailed.run(new Exception());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6,6 +6,8 @@ import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DuplicateUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DuplicateUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
|
||||
@ -35,4 +37,7 @@ public interface ColliSpedizioneRESTConsumerService {
|
||||
@POST("wms/spedizione/deleteUDSRow")
|
||||
Call<ServiceRESTResponse<Void>> deleteUDSRow(@Body DeleteUDSRowRequestDTO deleteUDSRowRequestDTO);
|
||||
|
||||
@POST("wms/spedizione/duplicateUDS")
|
||||
Call<ServiceRESTResponse<DuplicateUDSResponseDTO>> duplicateUDS(@Body DuplicateUDSRequestDTO duplicateUDSRequestDTO);
|
||||
|
||||
}
|
||||
|
||||
@ -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<>());
|
||||
|
||||
@ -9,68 +9,75 @@ 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
|
||||
public class DocumentRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
private final RESTBuilder restBuilder;
|
||||
|
||||
public DocumentRESTConsumer(RESTBuilder restBuilder) {
|
||||
this.restBuilder = restBuilder;
|
||||
}
|
||||
|
||||
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 documentiRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
||||
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 documentiRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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 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 final Exception e) {
|
||||
onFailed.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void loadDocumentAvailableArts(String codDtip, String codMgrp, String codAnagForn, RunnableArgs<RetrieveDocumentoArtsResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
var inventarioRESTConsumerService = restBuilder.getService(DocumentiRESTConsumerService.class);
|
||||
var inventarioRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -20,8 +20,12 @@ public interface DocumentiRESTConsumerService {
|
||||
@POST("createDocFromColli")
|
||||
Call<ServiceRESTResponse<DtbDoct>> createDocFromColli(@Body LoadColliDTO listColli);
|
||||
|
||||
|
||||
|
||||
@GET("wms/documento/checkDoc")
|
||||
Call<ServiceRESTResponse<Boolean>> checkDocument(
|
||||
@Query("fornitore") String fornitore,
|
||||
@Query("numDoc") String numDoc,
|
||||
@Query("tipoDoc") String tipoDoc,
|
||||
@Query("dataDoc") String dataDoc);
|
||||
|
||||
@GET("wms/documento/arts")
|
||||
Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> retrieveArts(
|
||||
|
||||
@ -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
|
||||
@ -38,7 +40,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()) {
|
||||
@ -64,9 +66,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);
|
||||
}
|
||||
});
|
||||
|
||||
@ -81,7 +82,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()) {
|
||||
@ -117,9 +118,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);
|
||||
}
|
||||
});
|
||||
|
||||
@ -131,7 +131,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()) {
|
||||
@ -141,7 +141,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++) {
|
||||
@ -168,9 +168,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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -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,38 +10,29 @@ 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
|
||||
public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
||||
private final RESTBuilder restBuilder;
|
||||
|
||||
public GestSetupRESTConsumer(RESTBuilder restBuilder) {
|
||||
this.restBuilder = restBuilder;
|
||||
}
|
||||
|
||||
|
||||
public void getValue(String gestName, String sectionName, String keySection, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
GestSetupRESTConsumerService service = restBuilder.getService(GestSetupRESTConsumerService.class);
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -57,18 +48,16 @@ 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>>() {
|
||||
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -87,8 +76,8 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
||||
public void getValues(String codMdep, List<StbGestSetupReader> stbGestSetupList, RunnableArgs<List<StbGestSetupReader>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
var stbGestSetups = stbGestSetupList.stream().map(x -> (StbGestSetup) x).collect(Collectors.toList());
|
||||
|
||||
GestSetupRESTConsumerService service = restBuilder.getService(GestSetupRESTConsumerService.class);
|
||||
service.getGestSetupValues(codMdep, stbGestSetups).enqueue(new Callback<>() {
|
||||
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
|
||||
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 -> {
|
||||
@ -106,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -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,30 +15,28 @@ 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
|
||||
public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final RESTBuilder restBuilder;
|
||||
private final ArticoloRESTConsumer articoloRESTConsumer;
|
||||
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||
|
||||
public GiacenzaRESTConsumer(RESTBuilder restBuilder, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
this.restBuilder = restBuilder;
|
||||
this.articoloRESTConsumer = articoloRESTConsumer;
|
||||
public GiacenzaRESTConsumer(ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||
|
||||
}
|
||||
|
||||
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 giacenzaRESTConsumerService = RESTBuilder.getService(GiacenzaRESTConsumerService.class);
|
||||
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 -> {
|
||||
@ -46,7 +46,7 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||
.map(x -> x.getCodMart().trim())
|
||||
.toList();
|
||||
|
||||
articoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
|
||||
mArticoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
|
||||
for (var row : inventarioList) {
|
||||
|
||||
MtbAart foundMtbAart = null;
|
||||
@ -70,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 giacenzaRESTConsumerService = RESTBuilder.getService(GiacenzaRESTConsumerService.class);
|
||||
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 -> {
|
||||
@ -87,7 +87,7 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||
.map(x -> x.getCodMart().trim())
|
||||
.toList();
|
||||
|
||||
articoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
|
||||
mArticoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
|
||||
for (var articoli : inventarioList) {
|
||||
List<MvwSitArtUdcDetInventario> mvwSitArtUdcDetInventario = articoli.getMvwSitArtUdcDetInventarioDTO();
|
||||
if (mvwSitArtUdcDetInventario != null && !mvwSitArtUdcDetInventario.isEmpty()){
|
||||
@ -112,19 +112,19 @@ 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getGiacenzeByArticolo(String codMart, String partitaMag, RunnableArgs<List<MvwSitArtUdcDetInventario>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
GiacenzaRESTConsumerService giacenzaRESTConsumerService = restBuilder.getService(GiacenzaRESTConsumerService.class);
|
||||
GiacenzaRESTConsumerService giacenzaRESTConsumerService = RESTBuilder.getService(GiacenzaRESTConsumerService.class);
|
||||
var serviceRESTResponseCall =
|
||||
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 -> {
|
||||
@ -134,7 +134,7 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
articoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
|
||||
mArticoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
|
||||
for (var row : inventarioList) {
|
||||
|
||||
MtbAart foundMtbAart = null;
|
||||
@ -155,18 +155,18 @@ 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 getInstantItemSituation(String codMdep, String codMart, String partitaMag, String codJcom, RunnableArgs<InstantItemSituationResponseDto> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
GiacenzaRESTConsumerService giacenzaRESTConsumerService = restBuilder.getService(GiacenzaRESTConsumerService.class);
|
||||
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 -> {
|
||||
@ -176,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -202,9 +202,9 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||
return;
|
||||
}
|
||||
|
||||
articoloRESTConsumer.getByCodMarts(inputCodMarts, mtbAarts -> {
|
||||
mArticoloRESTConsumer.getByCodMarts(inputCodMarts, mtbAarts -> {
|
||||
|
||||
articoloRESTConsumer.fillMtbAartsWithMtbUntMis(mtbAarts, newMtbAarts -> {
|
||||
mArticoloRESTConsumer.fillMtbAartsWithMtbUntMis(mtbAarts, newMtbAarts -> {
|
||||
if (data.getIncomingItems() != null && !data.getIncomingItems().isEmpty()) {
|
||||
for (var item : data.getIncomingItems()) {
|
||||
var mtbAart = Stream.of(newMtbAarts).filter(x -> x.getCodMart().equalsIgnoreCase(item.getCodMart()))
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
@ -7,6 +8,8 @@ import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.model.mapper.MtbTcolMapper;
|
||||
import it.integry.integrywmsnative.core.model.observable.ObservableMtbTcol;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.imballi.ImballoQuantityDTO;
|
||||
@ -17,27 +20,27 @@ import retrofit2.Response;
|
||||
@Singleton
|
||||
public class ImballiRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final RESTBuilder restBuilder;
|
||||
private final ExecutorService executorService;
|
||||
|
||||
public ImballiRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
|
||||
this.restBuilder = restBuilder;
|
||||
public ImballiRESTConsumer(ExecutorService executorService) {
|
||||
this.executorService = executorService;
|
||||
}
|
||||
|
||||
|
||||
public List<MtbTCol> retrieveTipiColloSyncronized(MtbTCol.FlagUiUlEnum tipoImballo) throws Exception {
|
||||
ImballiRESTConsumerService service = restBuilder.getService(ImballiRESTConsumerService.class);
|
||||
Response<ServiceRESTResponse<List<MtbTCol>>> response = service.retrieveTipiCollo(tipoImballo)
|
||||
public List<ObservableMtbTcol> retrieveImballiSyncronized(MtbTCol.FlagUiUlEnum tipoImballo) throws Exception {
|
||||
ImballiRESTConsumerService service = RESTBuilder.getService(ImballiRESTConsumerService.class);
|
||||
Response<ServiceRESTResponse<List<MtbTCol>>> response = service.retrieveImballi(tipoImballo)
|
||||
.execute();
|
||||
|
||||
return analyzeAnswer(response, "retrieveTipiCollo");
|
||||
List<MtbTCol> retrieveTipiCollo = analyzeAnswer(response, "retrieveTipiCollo");
|
||||
retrieveTipiCollo = retrieveTipiCollo == null ? new ArrayList<>() : retrieveTipiCollo;
|
||||
return MtbTcolMapper.fromDTOList(retrieveTipiCollo);
|
||||
}
|
||||
|
||||
public void retrieveTipiCollo(MtbTCol.FlagUiUlEnum tipoImballo, RunnableArgs<List<MtbTCol>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public void retrieveImballi(MtbTCol.FlagUiUlEnum tipoImballo, RunnableArgs<List<ObservableMtbTcol>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
var response = retrieveTipiColloSyncronized(tipoImballo);
|
||||
var response = retrieveImballiSyncronized(tipoImballo);
|
||||
if (onComplete != null) onComplete.run(response);
|
||||
} catch (Exception ex) {
|
||||
if (onFailed != null) onFailed.run(ex);
|
||||
@ -47,7 +50,7 @@ public class ImballiRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
public void registraCaricoSyncronized(String codAnag, List<ImballoQuantityDTO> imballi) throws Exception {
|
||||
ImballiRESTConsumerService service = restBuilder.getService(ImballiRESTConsumerService.class);
|
||||
ImballiRESTConsumerService service = RESTBuilder.getService(ImballiRESTConsumerService.class);
|
||||
Response<ServiceRESTResponse<Void>> response = service.registraCarico(
|
||||
new RegistraCaricoImballiRequestDTO()
|
||||
.setCodAnag(codAnag)
|
||||
@ -70,7 +73,7 @@ public class ImballiRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
public void registraScaricoSyncronized(String codVettore, List<ImballoQuantityDTO> imballi) throws Exception {
|
||||
ImballiRESTConsumerService service = restBuilder.getService(ImballiRESTConsumerService.class);
|
||||
ImballiRESTConsumerService service = RESTBuilder.getService(ImballiRESTConsumerService.class);
|
||||
Response<ServiceRESTResponse<Void>> response = service.registraScarico(
|
||||
new RegistraScaricoImballiRequestDTO()
|
||||
.setCodVettore(codVettore)
|
||||
|
||||
@ -16,7 +16,7 @@ public interface ImballiRESTConsumerService {
|
||||
|
||||
|
||||
@GET("wms/imballi/retrieve/{tipo}")
|
||||
Call<ServiceRESTResponse<List<MtbTCol>>> retrieveTipiCollo(@Path("tipo") MtbTCol.FlagUiUlEnum tipo);
|
||||
Call<ServiceRESTResponse<List<MtbTCol>>> retrieveImballi(@Path("tipo") MtbTCol.FlagUiUlEnum tipo);
|
||||
|
||||
@POST("wms/imballi/registraCarico")
|
||||
Call<ServiceRESTResponse<Void>> registraCarico(@Body RegistraCaricoImballiRequestDTO registraCaricoImballiRequest);
|
||||
|
||||
@ -10,12 +10,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
|
||||
@ -31,15 +31,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -48,15 +48,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -80,15 +80,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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -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
|
||||
@ -25,15 +27,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);
|
||||
}
|
||||
});
|
||||
|
||||
@ -43,15 +45,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -24,15 +26,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -40,15 +42,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -56,15 +58,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
@ -7,10 +11,11 @@ import javax.inject.Singleton;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
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
|
||||
@ -29,15 +34,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -61,4 +66,20 @@ 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 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 final Exception e) {
|
||||
onFailed.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,14 +3,12 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Path;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface MagazzinoRESTConsumerService {
|
||||
@ -22,6 +20,7 @@ public interface MagazzinoRESTConsumerService {
|
||||
Call<ServiceRESTResponse<MtbPartitaMag>> retrievePartitaMag(@Query("codMart") String codMart,
|
||||
@Query("partitaMag") String partitaMag);
|
||||
|
||||
|
||||
|
||||
@POST("wms/partita-magazzino/retrieveAllPartitaMag")
|
||||
Call<ServiceRESTResponse<List<MtbPartitaMag>>> retrieveAllPartitaMag(@Body List<String> codMarts,
|
||||
@Query("dataScad") String dataScad);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
@ -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;
|
||||
@ -11,11 +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.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
@Singleton
|
||||
@ -33,15 +35,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 +52,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 +70,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -52,7 +53,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 -> {
|
||||
@ -112,8 +113,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);
|
||||
}
|
||||
});
|
||||
|
||||
@ -129,7 +130,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 -> {
|
||||
@ -142,9 +143,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -161,7 +161,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 -> {
|
||||
@ -176,9 +176,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -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,15 +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.core.utility.UtilityThread;
|
||||
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
|
||||
@ -39,23 +39,19 @@ 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();
|
||||
analyzeAnswer(response, "retrieveArticoliOrdine", articoliOrdineWrapper -> {
|
||||
UtilityThread.executeParallel(() -> {
|
||||
Log.d("LOADING TIME 1", "MS: " + (new Date().getTime() - startTime));
|
||||
onSuccess.run(articoliOrdineWrapper);
|
||||
}, false);
|
||||
Log.d("LOADING TIME 1", "MS: " + (new Date().getTime() - startTime));
|
||||
onSuccess.run(articoliOrdineWrapper);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, Throwable t) {
|
||||
Log.e("getArticoliListino_pv", t.toString());
|
||||
UtilityLogger.error(new Exception(t));
|
||||
onFailed.run(new Exception(t));
|
||||
public void onFailure(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, @NonNull final Exception e) {
|
||||
onFailed.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -63,23 +59,19 @@ 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();
|
||||
analyzeAnswer(response, "retrieveArticoliOrdine", articoliOrdineWrapper -> {
|
||||
UtilityThread.executeParallel(() -> {
|
||||
Log.d("LOADING TIME 1", "MS: " + (new Date().getTime() - startTime));
|
||||
onSuccess.run(articoliOrdineWrapper);
|
||||
}, false);
|
||||
Log.d("LOADING TIME 1", "MS: " + (new Date().getTime() - startTime));
|
||||
onSuccess.run(articoliOrdineWrapper);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, Throwable t) {
|
||||
Log.e("getArticoliListino_pv", t.toString());
|
||||
UtilityLogger.error(new Exception(t));
|
||||
onFailed.run(new Exception(t));
|
||||
public void onFailure(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, @NonNull final Exception e) {
|
||||
onFailed.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -102,12 +94,12 @@ 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();
|
||||
analyzeAnswer(response, "retrieveArticoliOrdine", articoliOrdineWrapper -> {
|
||||
UtilityThread.executeParallel(() -> {
|
||||
// UtilityThread.executeParallel(() -> {
|
||||
// if (data == null) {
|
||||
// onFailed.run(new Exception("Nessun ordine generato"));
|
||||
// return;
|
||||
@ -119,15 +111,13 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
||||
// ordine.setCodMdep(data.getCodMdep());
|
||||
// ordine.setNumOrd(data.getNumOrd());
|
||||
onSuccess.run(ordine);
|
||||
}, false);
|
||||
// }, false);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -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,28 +14,26 @@ 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
|
||||
public class PosizioniRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final RESTBuilder restBuilder;
|
||||
private final SystemRESTConsumer systemRESTConsumer;
|
||||
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||
|
||||
public PosizioniRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer) {
|
||||
this.restBuilder = restBuilder;
|
||||
this.systemRESTConsumer = systemRESTConsumer;
|
||||
public PosizioniRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||
}
|
||||
|
||||
public void getAvailablePosizioni(RunnableArgs<List<MtbDepoPosizione>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
String codMdep = null;
|
||||
|
||||
PosizioniRESTConsumerService posizioniRESTConsumerService = restBuilder.getService(PosizioniRESTConsumerService.class);
|
||||
posizioniRESTConsumerService.getAvailablePosizioni(codMdep).enqueue(new Callback<>() {
|
||||
PosizioniRESTConsumerService posizioniRESTConsumerService = RESTBuilder.getService(PosizioniRESTConsumerService.class);
|
||||
posizioniRESTConsumerService.getAvailablePosizioni(codMdep).enqueue(new ManagedErrorCallback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<MtbDepoPosizione>>> call, Response<ServiceRESTResponse<List<MtbDepoPosizione>>> response) {
|
||||
analyzeAnswer(response, "getAvailablePosizioni", (m) -> {
|
||||
@ -42,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -59,7 +59,7 @@ public class PosizioniRESTConsumer extends _BaseRESTConsumer {
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {
|
||||
}.getType();
|
||||
|
||||
systemRESTConsumer.<ArrayList<MtbColt>>processSql(sql, typeOfObjectsList, value -> {
|
||||
mSystemRESTConsumer.<ArrayList<MtbColt>>processSql(sql, typeOfObjectsList, value -> {
|
||||
if (onComplete != null) onComplete.run(value);
|
||||
}, ex -> {
|
||||
if (onFailed != null) onFailed.run(ex);
|
||||
|
||||
@ -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,31 +10,23 @@ 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
|
||||
public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final RESTBuilder restBuilder;
|
||||
|
||||
public PrinterRESTConsumer(RESTBuilder restBuilder) {
|
||||
this.restBuilder = restBuilder;
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
PRIMARIA,
|
||||
SECONDARIA
|
||||
@ -45,8 +37,8 @@ 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<>() {
|
||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||
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 -> {
|
||||
@ -56,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -71,10 +61,10 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
return;
|
||||
}
|
||||
|
||||
PrinterRESTConsumerService printerService = restBuilder.getService(PrinterRESTConsumerService.class);
|
||||
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 -> {
|
||||
@ -83,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -104,10 +92,10 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
Stream.of(params)
|
||||
.forEach(x -> jasperDTO.getParams().add(new JasperPairDTO(x.getKey(), x.getValue())));
|
||||
|
||||
PrinterRESTConsumerService printerService = restBuilder.getService(PrinterRESTConsumerService.class);
|
||||
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 -> {
|
||||
@ -116,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -134,10 +120,10 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
Stream.of(params)
|
||||
.forEach(x -> reportTypeDTO.getParams().add(new JasperPairDTO(x.getKey(), x.getValue())));
|
||||
|
||||
PrinterRESTConsumerService printerService = restBuilder.getService(PrinterRESTConsumerService.class);
|
||||
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 -> {
|
||||
@ -146,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -168,9 +152,9 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
return;
|
||||
}
|
||||
|
||||
PrinterRESTConsumerService printerService = restBuilder.getService(PrinterRESTConsumerService.class, 240);
|
||||
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 -> {
|
||||
@ -179,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -27,7 +29,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 -> {
|
||||
@ -36,8 +38,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -45,7 +47,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 -> {
|
||||
@ -54,8 +56,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -63,7 +65,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 -> {
|
||||
@ -72,8 +74,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -81,15 +83,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -98,7 +100,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) -> {
|
||||
@ -108,8 +110,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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@ -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);
|
||||
|
||||
}
|
||||
@ -3,111 +3,125 @@ 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;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.system.LatestAppVersionInfoDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.system.RegisterDeviceRequestDTO;
|
||||
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
|
||||
public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final RESTBuilder restBuilder;
|
||||
|
||||
public SystemRESTConsumer(RESTBuilder restBuilder) {
|
||||
this.restBuilder = restBuilder;
|
||||
public void retrieveUpdatesInfo(final RunnableArgs<LatestAppVersionInfoDTO> onSuccess, final RunnableArgs<Exception> onFailed) {
|
||||
SystemRESTConsumerService systemRESTConsumerService = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||
systemRESTConsumerService.retrieveUpdatesInfo()
|
||||
.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, @NonNull final Exception e) {
|
||||
onFailed.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void registerDevice(final Runnable onSuccess, final RunnableArgs<Exception> onFailed) {
|
||||
RegisterDeviceRequestDTO registerDeviceRequestDTO = new RegisterDeviceRequestDTO().setApp("WMS");
|
||||
RegisterDeviceRequestDTO registerDeviceRequestDTO = new RegisterDeviceRequestDTO()
|
||||
.setApp("WMS");
|
||||
|
||||
SystemRESTConsumerService systemRESTConsumerService = restBuilder.getService(SystemRESTConsumerService.class);
|
||||
systemRESTConsumerService.registerDevice(registerDeviceRequestDTO).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||
analyzeAnswer(response, "device/register", Void -> onSuccess.run(), onFailed);
|
||||
}
|
||||
SystemRESTConsumerService systemRESTConsumerService = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||
systemRESTConsumerService.registerDevice(registerDeviceRequestDTO)
|
||||
.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));
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||
onFailed.run(e);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public <T> void processSql(String nativeSql, final Type clazz, final RunnableArgs<T> onComplete, final RunnableArgs<Exception> onFailed) {
|
||||
NativeSqlRequestDTO nativeSqlDTO = new NativeSqlRequestDTO().setNativeSql(nativeSql);
|
||||
NativeSqlRequestDTO nativeSqlDTO = new NativeSqlRequestDTO();
|
||||
nativeSqlDTO.nativeSql = nativeSql;
|
||||
|
||||
SystemRESTConsumerService service = restBuilder.getService(SystemRESTConsumerService.class);
|
||||
service.processSql(nativeSqlDTO).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
analyzeAnswer(response, "ProcessSql", o -> {
|
||||
Gson gson = UtilityGson.createObject();
|
||||
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||
service
|
||||
.processSql(nativeSqlDTO)
|
||||
.enqueue(new ManagedErrorCallback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
analyzeAnswer(response, "ProcessSql", o -> {
|
||||
Gson gson = UtilityGson.createObject();
|
||||
|
||||
|
||||
String json = gson.toJson(o);
|
||||
String json = gson.toJson(o);
|
||||
|
||||
InputStream ims = new ByteArrayInputStream(json.getBytes());
|
||||
Reader reader = new InputStreamReader(ims);
|
||||
T gsonObj = gson.fromJson(reader, clazz);
|
||||
InputStream ims = new ByteArrayInputStream(json.getBytes());
|
||||
Reader reader = new InputStreamReader(ims);
|
||||
T gsonObj = gson.fromJson(reader, clazz);
|
||||
|
||||
onComplete.run(gsonObj);
|
||||
}, onFailed);
|
||||
}
|
||||
onComplete.run(gsonObj);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||
Logger.e(t, "ProcessSQL");
|
||||
|
||||
if (t instanceof ConnectException)
|
||||
onFailed.run(new InvalidConnectionException(
|
||||
SettingsManager.i().getServer().getHost(),
|
||||
SettingsManager.i().getServer().getPort(),
|
||||
t));
|
||||
else onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, @NonNull final Exception e) {
|
||||
onFailed.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void getAvailableCodMdeps(final RunnableArgs<List<AvailableCodMdepsDTO>> onSuccess, RunnableArgs<Exception> onFailed) {
|
||||
SystemRESTConsumerService service = restBuilder.getService(SystemRESTConsumerService.class);
|
||||
service.getAvailableCodMdeps().enqueue(new Callback<>() {
|
||||
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||
service.getAvailableCodMdeps().enqueue(new ManagedErrorCallback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> call, Response<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> response) {
|
||||
analyzeAnswer(response, "getAvailableCodMdeps", onSuccess, onFailed);
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -125,7 +139,13 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
MailRequestDTO mailDTO = new MailRequestDTO().setFrom("sender@integry.it").setFromName((BuildConfig.DEBUG ? "[DEBUG] " : "") + "WMS Android").setTo(dest).setSubject("Bug notification" + currentAzienda).setMsgText(message).setHtml(true);
|
||||
MailRequestDTO mailDTO = new MailRequestDTO()
|
||||
.setFrom("sender@integry.it")
|
||||
.setFromName((BuildConfig.DEBUG ? "[DEBUG] " : "") + "WMS Android")
|
||||
.setTo(dest)
|
||||
.setSubject("Bug notification" + currentAzienda)
|
||||
.setMsgText(message)
|
||||
.setHtml(true);
|
||||
|
||||
sendMail(mailDTO, () -> {
|
||||
if (onComplete != null) onComplete.run();
|
||||
@ -138,17 +158,17 @@ 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<>() {
|
||||
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -6,6 +6,7 @@ import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.MailRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.system.LatestAppVersionInfoDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.system.RegisterDeviceRequestDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
@ -15,6 +16,9 @@ import retrofit2.http.Query;
|
||||
|
||||
public interface SystemRESTConsumerService {
|
||||
|
||||
@GET("wms/currentVersion")
|
||||
Call<LatestAppVersionInfoDTO> retrieveUpdatesInfo();
|
||||
|
||||
@POST("device/register")
|
||||
Call<ServiceRESTResponse<Void>> registerDevice(@Body RegisterDeviceRequestDTO registerDeviceRequestDTO);
|
||||
|
||||
|
||||
@ -16,6 +16,32 @@ import retrofit2.Response;
|
||||
|
||||
public abstract class _BaseRESTConsumer {
|
||||
|
||||
|
||||
public static <T> void analyzeAnswerGeneric(Response<T> response, String logTitle, RunnableArgs<T> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
try {
|
||||
var data = analyzeAnswerGeneric(response, logTitle);
|
||||
onComplete.run(data);
|
||||
} catch (Exception e) {
|
||||
onFailed.run(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> T analyzeAnswerGeneric(Response<T> response, String logTitle) throws Exception {
|
||||
if (response.isSuccessful()) {
|
||||
return response.body();
|
||||
} else {
|
||||
if (response.code() == 404) {
|
||||
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url() + ")");
|
||||
throw new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")");
|
||||
} else if (response.code() == 550)
|
||||
throw new InvalidLicenseException();
|
||||
else {
|
||||
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
||||
throw new Exception("Status " + response.code() + ": " + response.message());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> T analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle) throws Exception {
|
||||
if (response.isSuccessful()) {
|
||||
if (response.body() != null) {
|
||||
|
||||
@ -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> {
|
||||
|
||||
@ -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);
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package it.integry.integrywmsnative.core.rest.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
|
||||
public class SpostaULRequestDTO {
|
||||
|
||||
private String codMdep;
|
||||
private String posizione;
|
||||
private String annotazioni;
|
||||
private boolean createDocAutomatically = true;
|
||||
private List<MtbColt> mtbColtsToMove = new ArrayList<>();
|
||||
|
||||
|
||||
public String getCodMdep() {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public SpostaULRequestDTO setCodMdep(String codMdep) {
|
||||
this.codMdep = codMdep;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPosizione() {
|
||||
return posizione;
|
||||
}
|
||||
|
||||
public SpostaULRequestDTO setPosizione(String posizione) {
|
||||
this.posizione = posizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAnnotazioni() {
|
||||
return annotazioni;
|
||||
}
|
||||
|
||||
public SpostaULRequestDTO setAnnotazioni(String annotazioni) {
|
||||
this.annotazioni = annotazioni;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isCreateDocAutomatically() {
|
||||
return createDocAutomatically;
|
||||
}
|
||||
|
||||
public SpostaULRequestDTO setCreateDocAutomatically(boolean createDocAutomatically) {
|
||||
this.createDocAutomatically = createDocAutomatically;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbColt> getMtbColtsToMove() {
|
||||
return mtbColtsToMove;
|
||||
}
|
||||
|
||||
public SpostaULRequestDTO setMtbColtsToMove(List<MtbColt> mtbColtsToMove) {
|
||||
this.mtbColtsToMove = mtbColtsToMove;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package it.integry.integrywmsnative.core.rest.model;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
|
||||
public class UpdateTipoULRequestDTO {
|
||||
|
||||
private MtbColt mtbColt;
|
||||
private String codTcol;
|
||||
|
||||
public MtbColt getMtbColt() {
|
||||
return mtbColt;
|
||||
}
|
||||
|
||||
public UpdateTipoULRequestDTO setMtbColt(MtbColt mtbColt) {
|
||||
this.mtbColt = mtbColt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodTcol() {
|
||||
return codTcol;
|
||||
}
|
||||
|
||||
public UpdateTipoULRequestDTO setCodTcol(String codTcol) {
|
||||
this.codTcol = codTcol;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,257 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.articolo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class ArticoloDTO {
|
||||
|
||||
private String codMart;
|
||||
private String descrizione;
|
||||
private String untMis;
|
||||
private String barcode;
|
||||
private BigDecimal qtaCnf;
|
||||
private String codAliq;
|
||||
private String articoloComposto;
|
||||
private String descrizioneEstesa;
|
||||
private String note;
|
||||
private String posizione;
|
||||
private String codMgrp;
|
||||
private String codMsfa;
|
||||
private String codMsgr;
|
||||
private String codMstp;
|
||||
private String codMtip;
|
||||
private boolean flagStato;
|
||||
private String barcodeImballo;
|
||||
private String diacod;
|
||||
private boolean flagQtaCnfFissa;
|
||||
private String idArtEqui;
|
||||
private boolean flagKit;
|
||||
private String precode;
|
||||
private String gruppo;
|
||||
private String sottoGruppo;
|
||||
private String sottoFamiglia;
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public ArticoloDTO setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public ArticoloDTO setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
public ArticoloDTO setUntMis(String untMis) {
|
||||
this.untMis = untMis;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarcode() {
|
||||
return barcode;
|
||||
}
|
||||
|
||||
public ArticoloDTO setBarcode(String barcode) {
|
||||
this.barcode = barcode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnf() {
|
||||
return qtaCnf;
|
||||
}
|
||||
|
||||
public ArticoloDTO setQtaCnf(BigDecimal qtaCnf) {
|
||||
this.qtaCnf = qtaCnf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodAliq() {
|
||||
return codAliq;
|
||||
}
|
||||
|
||||
public ArticoloDTO setCodAliq(String codAliq) {
|
||||
this.codAliq = codAliq;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getArticoloComposto() {
|
||||
return articoloComposto;
|
||||
}
|
||||
|
||||
public ArticoloDTO setArticoloComposto(String articoloComposto) {
|
||||
this.articoloComposto = articoloComposto;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizioneEstesa() {
|
||||
return descrizioneEstesa;
|
||||
}
|
||||
|
||||
public ArticoloDTO setDescrizioneEstesa(String descrizioneEstesa) {
|
||||
this.descrizioneEstesa = descrizioneEstesa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public ArticoloDTO setNote(String note) {
|
||||
this.note = note;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPosizione() {
|
||||
return posizione;
|
||||
}
|
||||
|
||||
public ArticoloDTO setPosizione(String posizione) {
|
||||
this.posizione = posizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMgrp() {
|
||||
return codMgrp;
|
||||
}
|
||||
|
||||
public ArticoloDTO setCodMgrp(String codMgrp) {
|
||||
this.codMgrp = codMgrp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMsfa() {
|
||||
return codMsfa;
|
||||
}
|
||||
|
||||
public ArticoloDTO setCodMsfa(String codMsfa) {
|
||||
this.codMsfa = codMsfa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMsgr() {
|
||||
return codMsgr;
|
||||
}
|
||||
|
||||
public ArticoloDTO setCodMsgr(String codMsgr) {
|
||||
this.codMsgr = codMsgr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMstp() {
|
||||
return codMstp;
|
||||
}
|
||||
|
||||
public ArticoloDTO setCodMstp(String codMstp) {
|
||||
this.codMstp = codMstp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMtip() {
|
||||
return codMtip;
|
||||
}
|
||||
|
||||
public ArticoloDTO setCodMtip(String codMtip) {
|
||||
this.codMtip = codMtip;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagStato() {
|
||||
return flagStato;
|
||||
}
|
||||
|
||||
public ArticoloDTO setFlagStato(boolean flagStato) {
|
||||
this.flagStato = flagStato;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarcodeImballo() {
|
||||
return barcodeImballo;
|
||||
}
|
||||
|
||||
public ArticoloDTO setBarcodeImballo(String barcodeImballo) {
|
||||
this.barcodeImballo = barcodeImballo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDiacod() {
|
||||
return diacod;
|
||||
}
|
||||
|
||||
public ArticoloDTO setDiacod(String diacod) {
|
||||
this.diacod = diacod;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagQtaCnfFissa() {
|
||||
return flagQtaCnfFissa;
|
||||
}
|
||||
|
||||
public ArticoloDTO setFlagQtaCnfFissa(boolean flagQtaCnfFissa) {
|
||||
this.flagQtaCnfFissa = flagQtaCnfFissa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIdArtEqui() {
|
||||
return idArtEqui;
|
||||
}
|
||||
|
||||
public ArticoloDTO setIdArtEqui(String idArtEqui) {
|
||||
this.idArtEqui = idArtEqui;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagKit() {
|
||||
return flagKit;
|
||||
}
|
||||
|
||||
public ArticoloDTO setFlagKit(boolean flagKit) {
|
||||
this.flagKit = flagKit;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPrecode() {
|
||||
return precode;
|
||||
}
|
||||
|
||||
public ArticoloDTO setPrecode(String precode) {
|
||||
this.precode = precode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGruppo() {
|
||||
return gruppo;
|
||||
}
|
||||
|
||||
public ArticoloDTO setGruppo(String gruppo) {
|
||||
this.gruppo = gruppo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSottoGruppo() {
|
||||
return sottoGruppo;
|
||||
}
|
||||
|
||||
public ArticoloDTO setSottoGruppo(String sottoGruppo) {
|
||||
this.sottoGruppo = sottoGruppo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSottoFamiglia() {
|
||||
return sottoFamiglia;
|
||||
}
|
||||
|
||||
public ArticoloDTO setSottoFamiglia(String sottoFamiglia) {
|
||||
this.sottoFamiglia = sottoFamiglia;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.articolo;
|
||||
|
||||
public class SaveArticoloRequestDTO {
|
||||
private ArticoloDTO artToSave;
|
||||
|
||||
public ArticoloDTO getArtToSave() {
|
||||
return artToSave;
|
||||
}
|
||||
|
||||
public SaveArticoloRequestDTO setArtToSave(ArticoloDTO artToSave) {
|
||||
this.artToSave = artToSave;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.articolo;
|
||||
|
||||
public class SaveArticoloResponseDTO {
|
||||
private String codMart;
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user