Compare commits
283 Commits
v1.40.08(4
...
v1.44.07(4
| Author | SHA1 | Date | |
|---|---|---|---|
| 51f9e1f58c | |||
| 6747ee077b | |||
| e11e270101 | |||
| bc27355ed6 | |||
| 078d9af116 | |||
| 9b14e1186e | |||
| 779c606c2a | |||
| 581e56a245 | |||
| 7f468e19bd | |||
| e8a511d49e | |||
| 1988ad993f | |||
| 6105c44dab | |||
| d3b7cd8cd6 | |||
| 36c48f28d1 | |||
| 93b18531ab | |||
| 27edd84442 | |||
| e24e6858fb | |||
| fa10973626 | |||
| 521e2fe62b | |||
| 7e7938ea1a | |||
| 4fe48bd02a | |||
| f26bc28ba1 | |||
| aaf8b96070 | |||
| c5720059f3 | |||
| 361faf235d | |||
| f85f5d63a6 | |||
| 526bc11626 | |||
| 95d73b5bc5 | |||
| 73e0f03886 | |||
| 91bc82ed16 | |||
| c6a30588e6 | |||
| 26c09c02ab | |||
| c34e6723d8 | |||
| bf2a039700 | |||
| cebe5afd0a | |||
| 2e8e4c0ccc | |||
| 1c5c8c61cf | |||
| 726d9fd29c | |||
| d7eeeeeac2 | |||
| ee72f8364e | |||
| a95ff0b0e5 | |||
| 57ced048a0 | |||
| ca545e2d44 | |||
| 0b777137d5 | |||
| d19f4de424 | |||
| 56d509b07b | |||
| fe3a9d84d5 | |||
| dc38311125 | |||
| bce8f2a8b7 | |||
| 13ec0c745e | |||
| b5f7e12f5a | |||
| 90e8ff128c | |||
| 998b1057e0 | |||
| d4a7dee121 | |||
| e85e05a526 | |||
| 7f953e78cf | |||
| 8b536eb0b0 | |||
| f390548d66 | |||
| c6a2b8c6ea | |||
| a046e31412 | |||
| 716f6d4daa | |||
| 9b451ff1bc | |||
| 6d48182d90 | |||
| e3d8defa5b | |||
| dc24b43311 | |||
| 75f55ebd44 | |||
| 09cebb1c7e | |||
| 9dc0935cc1 | |||
| 5bfd695f2d | |||
| 8e0b05b6af | |||
| ddc441e76e | |||
| 20602cadb5 | |||
| 416ac0a2a5 | |||
| 49933c8493 | |||
| b1bc72a1a5 | |||
| c498a373f5 | |||
| bd04d6263e | |||
| fbe9244000 | |||
| 6e52a3c0c7 | |||
| 9f92274720 | |||
| 6d431bb251 | |||
| 5265b949af | |||
| db875491d0 | |||
| 778fdff69a | |||
| 4b54aa3c02 | |||
| 019688a5cc | |||
| 00fc3a59eb | |||
| e5244e75a3 | |||
| cb77c21656 | |||
| 7b0f7f16ba | |||
| e23446654d | |||
| b3641534c9 | |||
| a3a5f65e53 | |||
| d5c0f388db | |||
| 8ae3820aa2 | |||
| ac6f64d494 | |||
| 9d001f8896 | |||
| 24e9cffeea | |||
| b0f2763a85 | |||
| cc343c296f | |||
| bc9b60b0ac | |||
| 856592e1fe | |||
| cd28d01354 | |||
| 653cd3fd75 | |||
| 73b1a77a12 | |||
| 777d6a3c5b | |||
| 98f520427e | |||
| 403f2ec57c | |||
| e69d99fdf1 | |||
| b48b2fbac9 | |||
| 00515aaf9b | |||
| e70d5697c3 | |||
| fb6d206203 | |||
| d3a9c87d14 | |||
| 39841f6b0d | |||
| 7ed3b421a1 | |||
| 3b5eb32190 | |||
| be31b87eac | |||
| 3d341ac99d | |||
| 9df1c37ee9 | |||
| 385a28c29b | |||
| e26568cdf1 | |||
| 191953a003 | |||
| 47143fe97d | |||
| 387ce6a555 | |||
| 47ff01805c | |||
| 0e24f7188c | |||
| 8b3d1f2a2e | |||
| dcdc823b5f | |||
| 7201e5c8f8 | |||
| 929c52b94c | |||
| 2adfda5f30 | |||
| 421accaf15 | |||
| 574ad6176b | |||
| 290d737ff7 | |||
| 4b0fbd0b6b | |||
| 6327089a55 | |||
| 807c3a8cde | |||
| 665c261b9a | |||
| bdd6f21522 | |||
| 482243ceff | |||
| 9890fbfec0 | |||
| 2a0465dc0f | |||
| 3ebe311728 | |||
| 95a51ecc7a | |||
| 342753aeac | |||
| 2b467f56d7 | |||
| a27db0ab68 | |||
| 845a4c8faa | |||
| 7b9959e68d | |||
| 0328ebad85 | |||
| 77c5252bf6 | |||
| c42a597bb4 | |||
| b40781db84 | |||
| f5a0bf67c8 | |||
| 044d60fb66 | |||
| 7999e98bd9 | |||
| 7c14688ef3 | |||
| 8039d1942d | |||
| 6c8fd2518e | |||
| 03e2f4390b | |||
| 08656ae276 | |||
| 9f2ba56c59 | |||
| 34e1ba8f95 | |||
| 4e95f4f9c9 | |||
| 7ee59ea814 | |||
| 1463510b08 | |||
| a771335ff1 | |||
| 7b1f58412a | |||
| d897c83165 | |||
| 44b9bc3fc1 | |||
| fa95ed1391 | |||
| 26ca580ba4 | |||
| f65e69b745 | |||
| 5a147fb0de | |||
| 64e38ce05a | |||
| 6c79a1781d | |||
| 6177d84131 | |||
| c6975badce | |||
| c548c6484f | |||
| 9aae16521f | |||
| 559ff4e94c | |||
| 7b11f503d8 | |||
| bc788c3a34 | |||
| f936c71188 | |||
| 25a7982a87 | |||
| 74a3749e44 | |||
| 074fb10b44 | |||
| 4f490eb737 | |||
| 2b981b6c40 | |||
| bec80d980f | |||
| 8a5c8f5c94 | |||
| da301ec6b2 | |||
| a5a9cb1c50 | |||
| cef74ab71f | |||
| 3f647952c0 | |||
| 9bf55aae85 | |||
| f9a31faa78 | |||
| 9a643837d4 | |||
| f458a52b18 | |||
| 132437d134 | |||
| 022841c195 | |||
| bdbecfb037 | |||
| 1a501af172 | |||
| fe558a8be8 | |||
| 05d930d8f7 | |||
| 267aa85e01 | |||
| 89a98cac8b | |||
| efc052d622 | |||
| 6f61f3af9b | |||
| e7d06c9752 | |||
| 81e3c70960 | |||
| 76a0fe9b6f | |||
| a9bab6db56 | |||
| 85197c1f9b | |||
| ece434806f | |||
| 0962192144 | |||
| 38139a1ec9 | |||
| 56e5603256 | |||
| b5c2efa9e2 | |||
| 26f9f0e16c | |||
| 9abba0ce82 | |||
| c616a9d31a | |||
| e45a980ce3 | |||
| 91bca90e5d | |||
| c5d09b0d8b | |||
| 46c9fa184d | |||
| 3a31fba1b4 | |||
| 6cded1d2d1 | |||
| 027d0e891b | |||
| 0da31ef866 | |||
| 56f14c064e | |||
| 09c929803f | |||
| 93abea0823 | |||
| 5c5216e207 | |||
| 7a20ff6ddc | |||
| 048b7d7f56 | |||
| f009726cf0 | |||
| fb213cbdbb | |||
| 971dcaed87 | |||
| 7b132def2a | |||
| 998dc54292 | |||
| 157eaf8760 | |||
| 10ffcf7806 | |||
| 392dd18338 | |||
| d4c7cdf400 | |||
| cde96ae694 | |||
| e49d35fdbc | |||
| 55db6d362d | |||
| 925cb6ae07 | |||
| c4f1d53199 | |||
| e18ac7a390 | |||
| cc454aea1a | |||
| 5cf275e43c | |||
| 53fe1db488 | |||
| 64082fc5ee | |||
| f9c642ad13 | |||
| bd7edf2357 | |||
| b7605bd28c | |||
| ad01283511 | |||
| adeab93b17 | |||
| 51480c2b06 | |||
| d04b3797ce | |||
| 518a00becf | |||
| c808cf7ce3 | |||
| 8cb488d81f | |||
| ed3f84d0ea | |||
| d9b02c4402 | |||
| 23522c9370 | |||
| f79b40c574 | |||
| 835915b46a | |||
| e643f25aa3 | |||
| 230a32139d | |||
| b0272cd9e0 | |||
| fa9947f22b | |||
| 5d3bb333e1 | |||
| 9f7085dfed | |||
| 95f765756c | |||
| a846ec00d7 | |||
| 6edc1917e1 | |||
| 1b864253b5 | |||
| f212987547 | |||
| 76f9c7030b |
16
.idea/appInsightsSettings.xml
generated
16
.idea/appInsightsSettings.xml
generated
@@ -1,9 +1,23 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="AppInsightsSettings">
|
<component name="AppInsightsSettings">
|
||||||
<option name="selectedTabId" value="Android Vitals" />
|
<option name="selectedTabId" value="Firebase Crashlytics" />
|
||||||
<option name="tabSettings">
|
<option name="tabSettings">
|
||||||
<map>
|
<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">
|
<entry key="Firebase Crashlytics">
|
||||||
<value>
|
<value>
|
||||||
<InsightsFilterSettings>
|
<InsightsFilterSettings>
|
||||||
|
|||||||
18
.idea/deploymentTargetSelector.xml
generated
Normal file
18
.idea/deploymentTargetSelector.xml
generated
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="deploymentTargetSelector">
|
||||||
|
<selectionStates>
|
||||||
|
<SelectionState runConfigName="app">
|
||||||
|
<option name="selectionMode" value="DROPDOWN" />
|
||||||
|
<DropdownSelection timestamp="2025-01-27T15:42:06.256113400Z">
|
||||||
|
<Target type="DEFAULT_BOOT">
|
||||||
|
<handle>
|
||||||
|
<DeviceId pluginId="PhysicalDevice" identifier="serial=21088B8EFD" />
|
||||||
|
</handle>
|
||||||
|
</Target>
|
||||||
|
</DropdownSelection>
|
||||||
|
<DialogSelection />
|
||||||
|
</SelectionState>
|
||||||
|
</selectionStates>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
9
.idea/fileTemplates/Android Dialog.java
generated
9
.idea/fileTemplates/Android Dialog.java
generated
@@ -84,6 +84,11 @@ Create the following layout resource file [dialog_${dashName}.xml]
|
|||||||
|
|
||||||
private Dialog${NAME}View() {
|
private Dialog${NAME}View() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
MainApplication.appComponent
|
||||||
|
.dialog${NAME}Component()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -105,10 +110,6 @@ Create the following layout resource file [dialog_${dashName}.xml]
|
|||||||
[b] into interface body
|
[b] into interface body
|
||||||
Dialog${NAME}Component.Factory dialog${NAME}Component();
|
Dialog${NAME}Component.Factory dialog${NAME}Component();
|
||||||
*/
|
*/
|
||||||
MainApplication.appComponent
|
|
||||||
.dialog${NAME}Component()
|
|
||||||
.create()
|
|
||||||
.inject(this);
|
|
||||||
|
|
||||||
setCancelable(false);
|
setCancelable(false);
|
||||||
|
|
||||||
|
|||||||
2
.idea/kotlinc.xml
generated
2
.idea/kotlinc.xml
generated
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="KotlinJpsPluginSettings">
|
<component name="KotlinJpsPluginSettings">
|
||||||
<option name="version" value="1.9.0" />
|
<option name="version" value="1.9.25" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</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">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="app" type="AndroidRunConfigurationType" factoryName="Android App">
|
<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" value="true" />
|
||||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||||
<option name="DEPLOY_AS_INSTANT" 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: 'com.google.firebase.crashlytics'
|
||||||
apply plugin: 'kotlin-android'
|
//apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 425
|
def appVersionCode = 476
|
||||||
def appVersionName = '1.40.08'
|
def appVersionName = '1.44.07'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
@@ -34,10 +34,10 @@ android {
|
|||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "it.integry.integrywmsnative"
|
applicationId "it.integry.integrywmsnative"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 34
|
targetSdkVersion 35
|
||||||
versionCode appVersionCode
|
versionCode appVersionCode
|
||||||
versionName appVersionName
|
versionName appVersionName
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
|
|
||||||
javaCompileOptions {
|
javaCompileOptions {
|
||||||
@@ -75,48 +75,59 @@ android {
|
|||||||
build {
|
build {
|
||||||
doLast {
|
doLast {
|
||||||
delete "$projectDir/build/outputs/apk/release/version.txt"
|
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 {
|
gradle.projectsEvaluated {
|
||||||
tasks.withType(JavaCompile.class) {
|
tasks.withType(JavaCompile.class).tap {
|
||||||
options.compilerArgs << "-Xmaxerrs" << "10000"
|
configureEach {
|
||||||
|
options.compilerArgs << "-Xmaxerrs" << "10000"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lint {
|
lint {
|
||||||
abortOnError false
|
abortOnError false
|
||||||
}
|
}
|
||||||
namespace 'it.integry.integrywmsnative'
|
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 {
|
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')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', {
|
// androidTestImplementation('androidx.test.espresso:espresso-core:3.6.1', {
|
||||||
exclude group: 'com.android.support', module: 'support-annotations'
|
// exclude group: 'com.android.support', module: 'support-annotations'
|
||||||
})
|
// })
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
// implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
implementation 'com.github.lupaulus:logger:2.3.2'
|
implementation 'com.github.lupaulus:logger:2.3.2'
|
||||||
|
|
||||||
//Firebase
|
//Firebase
|
||||||
|
|
||||||
// Import the Firebase BoM
|
// Import the Firebase BoM
|
||||||
implementation platform('com.google.firebase:firebase-bom:29.1.0')
|
implementation platform('com.google.firebase:firebase-bom:33.8.0')
|
||||||
implementation 'com.google.firebase:firebase-analytics'
|
implementation 'com.google.firebase:firebase-analytics'
|
||||||
implementation 'com.google.firebase:firebase-core'
|
|
||||||
implementation 'com.google.firebase:firebase-crashlytics'
|
implementation 'com.google.firebase:firebase-crashlytics'
|
||||||
implementation 'com.google.firebase:firebase-perf'
|
implementation 'com.google.firebase:firebase-perf'
|
||||||
implementation 'com.google.android.gms:play-services-basement:18.2.0'
|
implementation 'com.google.android.gms:play-services-basement:18.5.0'
|
||||||
|
|
||||||
|
//JJWT
|
||||||
|
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
|
||||||
|
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
|
||||||
|
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5'
|
||||||
|
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'com.google.android.material:material:1.10.0'
|
implementation 'com.google.android.material:material:1.12.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
|
||||||
implementation 'androidx.cardview:cardview:1.0.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') {
|
implementation('androidx.preference:preference-ktx:1.2.1') {
|
||||||
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel'
|
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel'
|
||||||
@@ -128,12 +139,12 @@ dependencies {
|
|||||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
implementation 'com.annimon:stream:1.2.2'
|
implementation 'com.annimon:stream:1.2.2'
|
||||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
|
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.7'
|
||||||
// implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
// implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||||
implementation 'org.apache.commons:commons-text:1.9'
|
implementation 'org.apache.commons:commons-text:1.9'
|
||||||
|
|
||||||
//MVVM
|
//MVVM
|
||||||
def dagger2_version = '2.46.1'
|
def dagger2_version = '2.55'
|
||||||
api "com.google.dagger:dagger:$dagger2_version"
|
api "com.google.dagger:dagger:$dagger2_version"
|
||||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
||||||
api "com.google.dagger:dagger-android:$dagger2_version"
|
api "com.google.dagger:dagger-android:$dagger2_version"
|
||||||
@@ -144,10 +155,7 @@ dependencies {
|
|||||||
//FAB
|
//FAB
|
||||||
implementation 'com.github.clans:fab:1.6.4'
|
implementation 'com.github.clans:fab:1.6.4'
|
||||||
//CUSTOM VIEWS
|
//CUSTOM VIEWS
|
||||||
implementation 'com.github.NaimishTrivedi:FBToast:1.0'
|
|
||||||
implementation 'com.github.cachapa:ExpandableLayout:2.9.2'
|
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.zhukic:sectioned-recyclerview:1.2.3'
|
||||||
implementation 'com.github.pedromassango:doubleClick:3.0'
|
implementation 'com.github.pedromassango:doubleClick:3.0'
|
||||||
|
|
||||||
@@ -158,9 +166,6 @@ dependencies {
|
|||||||
annotationProcessor "androidx.room:room-compiler:$room_version"
|
annotationProcessor "androidx.room:room-compiler:$room_version"
|
||||||
implementation "androidx.room:room-rxjava3:$room_version"
|
implementation "androidx.room:room-rxjava3:$room_version"
|
||||||
|
|
||||||
//AppUpdate
|
|
||||||
implementation 'com.github.javiersantos:AppUpdater:2.7'
|
|
||||||
|
|
||||||
//Barcode
|
//Barcode
|
||||||
implementation project(':pointmobilescannerlibrary')
|
implementation project(':pointmobilescannerlibrary')
|
||||||
implementation project(':zebrascannerlibrary')
|
implementation project(':zebrascannerlibrary')
|
||||||
@@ -178,11 +183,16 @@ dependencies {
|
|||||||
|
|
||||||
|
|
||||||
//Bluetooth device manager
|
//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.
|
// RxJava is also required.
|
||||||
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
|
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
|
||||||
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||||
|
|
||||||
|
implementation 'org.greenrobot:eventbus:3.3.1'
|
||||||
|
|
||||||
|
//Barcode generator
|
||||||
|
implementation group: 'com.google.zxing', name: 'core', version: '3.5.3'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -24,8 +24,8 @@
|
|||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
|
android:label="@string/app_name"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme"
|
android:theme="@style/AppTheme"
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
@@ -33,31 +33,25 @@
|
|||||||
android:requestLegacyExternalStorage="true">
|
android:requestLegacyExternalStorage="true">
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.spedizione.SpedizioneActivity"
|
android:name=".gest.spedizione.SpedizioneActivity"
|
||||||
android:theme="@style/Light"
|
|
||||||
android:windowSoftInputMode="adjustNothing"
|
android:windowSoftInputMode="adjustNothing"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity"
|
android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity"
|
||||||
android:theme="@style/Light"
|
|
||||||
android:windowSoftInputMode="adjustNothing"
|
android:windowSoftInputMode="adjustNothing"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.prod_dettaglio_linea.ProdDettaglioLineaActivity"
|
android:name=".gest.prod_dettaglio_linea.ProdDettaglioLineaActivity"
|
||||||
android:theme="@style/Light"
|
|
||||||
android:windowSoftInputMode="adjustNothing"
|
android:windowSoftInputMode="adjustNothing"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
||||||
android:theme="@style/Light"
|
|
||||||
android:windowSoftInputMode="adjustNothing"
|
android:windowSoftInputMode="adjustNothing"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.picking_resi.PickingResiActivity"
|
android:name=".gest.picking_resi.PickingResiActivity"
|
||||||
android:theme="@style/Light"
|
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.main.MainActivity"
|
android:name=".gest.main.MainActivity"
|
||||||
android:theme="@style/Light"
|
|
||||||
android:windowSoftInputMode="adjustNothing"
|
android:windowSoftInputMode="adjustNothing"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -68,28 +62,23 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.login.LoginActivity"
|
android:name=".gest.login.LoginActivity"
|
||||||
android:theme="@style/Light"
|
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.accettazione_ordini_picking.AccettazioneOrdiniPickingActivity"
|
android:name=".gest.accettazione_ordini_picking.AccettazioneOrdiniPickingActivity"
|
||||||
android:theme="@style/Light"
|
android:windowSoftInputMode="adjustPan"
|
||||||
android:windowSoftInputMode="adjustNothing"
|
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.lista_bancali.ListaBancaliActivity"
|
android:name=".gest.lista_bancali.ListaBancaliActivity"
|
||||||
android:label="@string/activity_lista_bancali_title"
|
android:label="@string/activity_lista_bancali_title"
|
||||||
android:theme="@style/Light"
|
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.contenuto_bancale.ContenutoBancaleActivity"
|
android:name=".gest.contenuto_bancale.ContenutoBancaleActivity"
|
||||||
android:label="@string/activity_contenuto_bancale_title"
|
android:label="@string/activity_contenuto_bancale_title"
|
||||||
android:theme="@style/Light"
|
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.inventario.picking.PickingInventarioActivity"
|
android:name=".gest.inventario.picking.PickingInventarioActivity"
|
||||||
android:label="@string/activity_picking_inventario_title"
|
android:label="@string/activity_picking_inventario_title"
|
||||||
android:windowSoftInputMode="adjustNothing"
|
android:windowSoftInputMode="adjustNothing"
|
||||||
android:theme="@style/Light"
|
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden"/>
|
android:configChanges="orientation|screenSize|keyboardHidden"/>
|
||||||
|
|
||||||
<meta-data
|
<meta-data
|
||||||
@@ -110,8 +99,7 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.accettazione_bolla_picking.AccettazioneBollaPickingActivity"
|
android:name=".gest.accettazione_bolla_picking.AccettazioneBollaPickingActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait" />
|
||||||
android:theme="@style/Light" />
|
|
||||||
|
|
||||||
<provider
|
<provider
|
||||||
android:name=".core.update.GenericFileProvider"
|
android:name=".core.update.GenericFileProvider"
|
||||||
|
|||||||
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 |
@@ -19,6 +19,8 @@ import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.MainAccettazi
|
|||||||
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.MainAccettazioneOrdiniElencoModule;
|
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.MainAccettazioneOrdiniElencoModule;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.AccettazioneOrdiniPickingComponent;
|
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.AccettazioneOrdiniPickingComponent;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.AccettazioneOrdiniPickingModule;
|
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.AccettazioneOrdiniPickingModule;
|
||||||
|
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaModule;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniComponent;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniComponent;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniModule;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniModule;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoComponent;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoComponent;
|
||||||
@@ -27,10 +29,10 @@ 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.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.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.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.ContenutoBancaleComponent;
|
||||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
||||||
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaComponent;
|
|
||||||
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaModule;
|
|
||||||
import it.integry.integrywmsnative.gest.inventario.ElencoInventariComponent;
|
import it.integry.integrywmsnative.gest.inventario.ElencoInventariComponent;
|
||||||
import it.integry.integrywmsnative.gest.inventario.ElencoInventariModule;
|
import it.integry.integrywmsnative.gest.inventario.ElencoInventariModule;
|
||||||
import it.integry.integrywmsnative.gest.inventario.bottom_sheet__inventario_actions.BottomSheetInventarioActionsComponent;
|
import it.integry.integrywmsnative.gest.inventario.bottom_sheet__inventario_actions.BottomSheetInventarioActionsComponent;
|
||||||
@@ -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_recupero_materiale.ProdRecuperoMaterialeModule;
|
||||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceComponent;
|
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_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.ProdRiposizionamentoDaProdComponent;
|
||||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.ProdRiposizionamentoDaProdModule;
|
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.ProdRiposizionamentoDaProdModule;
|
||||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dialogs.info_giacenza.DialogInfoGiacenzaComponent;
|
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dialogs.info_giacenza.DialogInfoGiacenzaComponent;
|
||||||
@@ -110,10 +113,15 @@ 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.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalModule;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteComponent;
|
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_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.DialogAskLineaProdComponent;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.DialogAskLineaProdModule;
|
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.DialogAskLineaProdModule;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_unknown_barcode_notes.DialogAskUnknownBarcodeNotesComponent;
|
import it.integry.integrywmsnative.view.dialogs.ask_unknown_barcode_notes.DialogAskUnknownBarcodeNotesComponent;
|
||||||
import it.integry.integrywmsnative.view.dialogs.ask_unknown_barcode_notes.DialogAskUnknownBarcodeNotesModule;
|
import it.integry.integrywmsnative.view.dialogs.ask_unknown_barcode_notes.DialogAskUnknownBarcodeNotesModule;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.ask_vettore.DialogAskVettoreComponent;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.ask_vettore.DialogAskVettoreModule;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.basket_lu.DialogBasketLUComponent;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.basket_lu.DialogBasketLUModule;
|
||||||
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageComponent;
|
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageComponent;
|
||||||
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageModule;
|
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageModule;
|
||||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromMtbAartListComponent;
|
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromMtbAartListComponent;
|
||||||
@@ -122,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_arts_from_mtbcolr_list.DialogChooseArtsFromMtbColrListModule;
|
||||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotComponent;
|
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.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.DialogInfoAggiuntiveLUComponent;
|
||||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUModule;
|
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUModule;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdComponent;
|
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdComponent;
|
||||||
@@ -138,6 +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_art.DialogScanArtModule;
|
||||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUComponent;
|
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.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
|
// Definition of the Application graph
|
||||||
@Singleton
|
@Singleton
|
||||||
@@ -169,6 +185,7 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
|||||||
DialogInputLUProdModule.class,
|
DialogInputLUProdModule.class,
|
||||||
DialogScanArtModule.class,
|
DialogScanArtModule.class,
|
||||||
DialogScanOrCreateLUModule.class,
|
DialogScanOrCreateLUModule.class,
|
||||||
|
DialogBasketLUModule.class,
|
||||||
ProdFabbisognoLineeProdModule.class,
|
ProdFabbisognoLineeProdModule.class,
|
||||||
VersamentoMerceModule.class,
|
VersamentoMerceModule.class,
|
||||||
DialogAskMagazzinoProssimitaModule.class,
|
DialogAskMagazzinoProssimitaModule.class,
|
||||||
@@ -182,6 +199,7 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
|||||||
DialogSelectDocInfoModule.class,
|
DialogSelectDocInfoModule.class,
|
||||||
DocInterniEditFormModule.class,
|
DocInterniEditFormModule.class,
|
||||||
DialogSelectDocRowsModule.class,
|
DialogSelectDocRowsModule.class,
|
||||||
|
DialogSelectLottiModule.class,
|
||||||
DialogAskClienteModule.class,
|
DialogAskClienteModule.class,
|
||||||
DialogEditArticoloModule.class,
|
DialogEditArticoloModule.class,
|
||||||
DialogPrintOrderSSCCListModule.class,
|
DialogPrintOrderSSCCListModule.class,
|
||||||
@@ -209,7 +227,13 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
|||||||
DialogAskLineaProdModule.class,
|
DialogAskLineaProdModule.class,
|
||||||
ProdRiposizionamentoDaProdModule.class,
|
ProdRiposizionamentoDaProdModule.class,
|
||||||
DialogInfoGiacenzaModule.class,
|
DialogInfoGiacenzaModule.class,
|
||||||
ArticoliInGiacenzaModule.class
|
ArticoliInGiacenzaModule.class,
|
||||||
|
DialogTracciamentoImballiModule.class,
|
||||||
|
DialogAskVettoreModule.class,
|
||||||
|
DialogAskVettoreModule.class,
|
||||||
|
DialogCreateNewArtModule.class,
|
||||||
|
DialogSwitchUserDepoModule.class,
|
||||||
|
DialogUpdateAvailableModule.class
|
||||||
})
|
})
|
||||||
public interface MainApplicationComponent {
|
public interface MainApplicationComponent {
|
||||||
|
|
||||||
@@ -265,6 +289,8 @@ public interface MainApplicationComponent {
|
|||||||
|
|
||||||
DialogScanOrCreateLUComponent.Factory dialogScanOrCreateLUComponent();
|
DialogScanOrCreateLUComponent.Factory dialogScanOrCreateLUComponent();
|
||||||
|
|
||||||
|
DialogBasketLUComponent.Factory dialogBasketLUComponent();
|
||||||
|
|
||||||
ProdFabbisognoLineeProdComponent.Factory prodFabbisognoLineeProdComponent();
|
ProdFabbisognoLineeProdComponent.Factory prodFabbisognoLineeProdComponent();
|
||||||
|
|
||||||
VersamentoMerceComponent.Factory versamentoMerceComponent();
|
VersamentoMerceComponent.Factory versamentoMerceComponent();
|
||||||
@@ -326,6 +352,7 @@ public interface MainApplicationComponent {
|
|||||||
DialogInfoSituazioneArticoloComponent.Factory dialogInfoSituazioneArticoloComponent();
|
DialogInfoSituazioneArticoloComponent.Factory dialogInfoSituazioneArticoloComponent();
|
||||||
|
|
||||||
DialogSelectDocRowsComponent.Factory dialogSelectDocRowsNewComponent();
|
DialogSelectDocRowsComponent.Factory dialogSelectDocRowsNewComponent();
|
||||||
|
DialogSelectLottiComponent.Factory dialogSelectLottiComponent();
|
||||||
|
|
||||||
DialogSelectArtToOrderComponent.Factory dialogSelectArtToOrderNewComponent();
|
DialogSelectArtToOrderComponent.Factory dialogSelectArtToOrderNewComponent();
|
||||||
|
|
||||||
@@ -351,6 +378,20 @@ public interface MainApplicationComponent {
|
|||||||
|
|
||||||
ArticoliInGiacenzaComponent.Factory controlloGiacenzeComponent();
|
ArticoliInGiacenzaComponent.Factory controlloGiacenzeComponent();
|
||||||
|
|
||||||
|
DialogTracciamentoImballiComponent.Factory dialogTracciamentoImballiComponent();
|
||||||
|
|
||||||
|
DialogAskVettoreComponent.Factory dialogAskVettoreComponent();
|
||||||
|
|
||||||
|
DialogAskCommessaComponent.Factory dialogAskCommessaComponent();
|
||||||
|
|
||||||
|
DialogCreateNewArtComponent.Factory dialogCreateNewArtComponent();
|
||||||
|
|
||||||
|
DialogSwitchUserDepoComponent.Factory dialogSwitchUserDepoComponent();
|
||||||
|
|
||||||
|
ProdRientroMerceOrderListComponent.Factory prodRientroMerceOrderListComponent();
|
||||||
|
|
||||||
|
DialogUpdateAvailableComponent.Factory dialogUpdateAvailableComponent();
|
||||||
|
|
||||||
void inject(MainApplication mainApplication);
|
void inject(MainApplication mainApplication);
|
||||||
|
|
||||||
void inject(AppContext mainApplication);
|
void inject(AppContext mainApplication);
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
|||||||
import it.integry.integrywmsnative.core.ean128.Ean128Service;
|
import it.integry.integrywmsnative.core.ean128.Ean128Service;
|
||||||
import it.integry.integrywmsnative.core.menu.MenuRESTConsumer;
|
import it.integry.integrywmsnative.core.menu.MenuRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.menu.MenuService;
|
import it.integry.integrywmsnative.core.menu.MenuService;
|
||||||
|
import it.integry.integrywmsnative.core.rest.AuthInterceptor;
|
||||||
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.AziendaRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.AziendaRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
@@ -32,21 +34,26 @@ import it.integry.integrywmsnative.core.rest.consumers.DocumentRESTConsumer;
|
|||||||
import it.integry.integrywmsnative.core.rest.consumers.EntityRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.EntityRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ImballiRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoAutomaticoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoAutomaticoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoBufferRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoBufferRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
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.MesRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PVOrdiniAcquistoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PVOrdiniAcquistoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
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.SystemRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.VettoriRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.sound.SoundAlertService;
|
import it.integry.integrywmsnative.core.sound.SoundAlertService;
|
||||||
import it.integry.integrywmsnative.core.update.UpdatesManager;
|
import it.integry.integrywmsnative.core.update.UpdatesManager;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.gest.login.rest.AuthenticationRESTConsumer;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||||
@@ -80,8 +87,8 @@ public class MainApplicationModule {
|
|||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
public SettingsManager provideSettingsManager(SystemRESTConsumer systemRESTConsumer, AziendaRESTConsumer aziendaRESTConsumer, PosizioniRESTConsumer posizioniRESTConsumer, GestSetupRESTConsumer gestSetupRESTConsumer) {
|
public SettingsManager provideSettingsManager(SystemRESTConsumer systemRESTConsumer, ImballiRESTConsumer imballiRESTConsumer, AziendaRESTConsumer aziendaRESTConsumer, PosizioniRESTConsumer posizioniRESTConsumer, GestSetupRESTConsumer gestSetupRESTConsumer) {
|
||||||
return new SettingsManager(mApplication, systemRESTConsumer, aziendaRESTConsumer, gestSetupRESTConsumer, posizioniRESTConsumer);
|
return new SettingsManager(mApplication, systemRESTConsumer, imballiRESTConsumer, aziendaRESTConsumer, gestSetupRESTConsumer, posizioniRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@@ -92,8 +99,8 @@ public class MainApplicationModule {
|
|||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
MainContext providesMainContextNew(MenuService menuService, AppDatabase appDatabase, SystemRESTConsumer systemRESTConsumer) {
|
MainContext providesMainContextNew(MenuService menuService, AppDatabase appDatabase, SystemRESTConsumer systemRESTConsumer, AuthenticationRESTConsumer authenticationRESTConsumer) {
|
||||||
return new MainContext(mApplication.getApplicationContext(), menuService, appDatabase, systemRESTConsumer);
|
return new MainContext(mApplication.getApplicationContext(), menuService, appDatabase, systemRESTConsumer, authenticationRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@@ -110,6 +117,13 @@ public class MainApplicationModule {
|
|||||||
return new Ean128Service();
|
return new Ean128Service();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
RESTBuilder providesRESTBuilder(AuthInterceptor authInterceptor) {
|
||||||
|
return new RESTBuilder(authInterceptor);
|
||||||
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
MenuService provideMenuService(MenuRESTConsumer menuRESTConsumer) {
|
MenuService provideMenuService(MenuRESTConsumer menuRESTConsumer) {
|
||||||
@@ -118,8 +132,8 @@ public class MainApplicationModule {
|
|||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
UpdatesManager provideUpdatesManager() {
|
UpdatesManager provideUpdatesManager(ExecutorService executorService, Handler handler, SystemRESTConsumer systemRESTConsumer) {
|
||||||
return new UpdatesManager();
|
return new UpdatesManager(executorService, handler, systemRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@@ -136,20 +150,20 @@ public class MainApplicationModule {
|
|||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
OrdiniRESTConsumer provideOrdiniRESTConsumer(SystemRESTConsumer systemRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
OrdiniRESTConsumer provideOrdiniRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
||||||
return new OrdiniRESTConsumer(systemRESTConsumer, entityRESTConsumer);
|
return new OrdiniRESTConsumer(restBuilder, systemRESTConsumer, entityRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
GestSetupRESTConsumer provideGestSetupRESTConsumer() {
|
GestSetupRESTConsumer provideGestSetupRESTConsumer(RESTBuilder restBuilder) {
|
||||||
return new GestSetupRESTConsumer();
|
return new GestSetupRESTConsumer(restBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
ArticoloRESTConsumer provideArticoloRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
ArticoloRESTConsumer provideArticoloRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer) {
|
||||||
return new ArticoloRESTConsumer(systemRESTConsumer);
|
return new ArticoloRESTConsumer(restBuilder, systemRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@@ -166,41 +180,48 @@ public class MainApplicationModule {
|
|||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
MenuRESTConsumer provideMenuRESTConsumer() {
|
MenuRESTConsumer provideMenuRESTConsumer(RESTBuilder restBuilder) {
|
||||||
return new MenuRESTConsumer();
|
return new MenuRESTConsumer(restBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
MagazzinoRESTConsumer provideMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
MagazzinoRESTConsumer provideMagazzinoRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService, SystemRESTConsumer systemRESTConsumer) {
|
||||||
return new MagazzinoRESTConsumer(systemRESTConsumer);
|
return new MagazzinoRESTConsumer(restBuilder, executorService, systemRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
MesRESTConsumer provideMesRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
MesRESTConsumer provideMesRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer) {
|
||||||
return new MesRESTConsumer(systemRESTConsumer);
|
return new MesRESTConsumer(restBuilder, systemRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
EntityRESTConsumer provideEntityRESTConsumer() {
|
EntityRESTConsumer provideEntityRESTConsumer(RESTBuilder restBuilder) {
|
||||||
return new EntityRESTConsumer();
|
return new EntityRESTConsumer(restBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
ColliMagazzinoRESTConsumer provideColliMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer,
|
ColliMagazzinoRESTConsumer provideColliMagazzinoRESTConsumer(RESTBuilder restBuilder,
|
||||||
|
SystemRESTConsumer systemRESTConsumer,
|
||||||
ArticoloRESTConsumer articoloRESTConsumer,
|
ArticoloRESTConsumer articoloRESTConsumer,
|
||||||
EntityRESTConsumer entityRESTConsumer,
|
EntityRESTConsumer entityRESTConsumer,
|
||||||
SettingsManager settingsManager) {
|
SettingsManager settingsManager) {
|
||||||
return new ColliMagazzinoRESTConsumer(systemRESTConsumer, articoloRESTConsumer, entityRESTConsumer, settingsManager);
|
return new ColliMagazzinoRESTConsumer(restBuilder, systemRESTConsumer, articoloRESTConsumer, entityRESTConsumer, settingsManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
AziendaRESTConsumer provideAziendaRESTConsumer() {
|
AziendaRESTConsumer provideAziendaRESTConsumer(RESTBuilder restBuilder) {
|
||||||
return new AziendaRESTConsumer();
|
return new AziendaRESTConsumer(restBuilder);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
ProduzioneRESTConsumer provideProduzioneRESTConsumer(RESTBuilder restBuilder) {
|
||||||
|
return new ProduzioneRESTConsumer(restBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@@ -211,44 +232,56 @@ public class MainApplicationModule {
|
|||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
PrinterRESTConsumer providePrinterRESTConsumer() {
|
PrinterRESTConsumer providePrinterRESTConsumer(RESTBuilder restBuilder) {
|
||||||
return new PrinterRESTConsumer();
|
return new PrinterRESTConsumer(restBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
SystemRESTConsumer provideSystemRESTConsumer() {
|
SystemRESTConsumer provideSystemRESTConsumer(ExecutorService executorService, RESTBuilder restBuilder) {
|
||||||
return new SystemRESTConsumer();
|
return new SystemRESTConsumer(executorService, restBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
PVOrdiniAcquistoRESTConsumer providesPVOrdiniAcquistoRESTConsumer(MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
PVOrdiniAcquistoRESTConsumer providesPVOrdiniAcquistoRESTConsumer(RESTBuilder restBuilder, MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
||||||
return new PVOrdiniAcquistoRESTConsumer(magazzinoRESTConsumer);
|
return new PVOrdiniAcquistoRESTConsumer(restBuilder, magazzinoRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
PosizioniRESTConsumer providesPosizioniRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
PosizioniRESTConsumer providesPosizioniRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer) {
|
||||||
return new PosizioniRESTConsumer(systemRESTConsumer);
|
return new PosizioniRESTConsumer(restBuilder, systemRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
ProdFabbisognoLineeProdRESTConsumer providesProdFabbisognoLineeProdRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
ProdFabbisognoLineeProdRESTConsumer providesProdFabbisognoLineeProdRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer) {
|
||||||
return new ProdFabbisognoLineeProdRESTConsumer(systemRESTConsumer);
|
return new ProdFabbisognoLineeProdRESTConsumer(restBuilder, systemRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
DocInterniRESTConsumer provideDocInterniRESTConsumer(MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
DocInterniRESTConsumer provideDocInterniRESTConsumer(RESTBuilder restBuilder, MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
||||||
return new DocInterniRESTConsumer(magazzinoRESTConsumer);
|
return new DocInterniRESTConsumer(restBuilder, magazzinoRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
GiacenzaRESTConsumer provideGiacenzaRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
GiacenzaRESTConsumer provideGiacenzaRESTConsumer(RESTBuilder restBuilder, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||||
return new GiacenzaRESTConsumer(systemRESTConsumer, articoloRESTConsumer);
|
return new GiacenzaRESTConsumer(restBuilder, articoloRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
ImballiRESTConsumer provideImballiRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
|
||||||
|
return new ImballiRESTConsumer(restBuilder, executorService);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
VettoriRESTConsumer provideVettoriRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
|
||||||
|
return new VettoriRESTConsumer(restBuilder, executorService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@@ -259,44 +292,50 @@ public class MainApplicationModule {
|
|||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
ProductionLinesRESTConsumer provideProductionLinesRESTConsumer() {
|
ProductionLinesRESTConsumer provideProductionLinesRESTConsumer(RESTBuilder restBuilder) {
|
||||||
return new ProductionLinesRESTConsumer();
|
return new ProductionLinesRESTConsumer(restBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
DocumentRESTConsumer provideDocumentiRESTConsumer() {
|
DocumentRESTConsumer provideDocumentiRESTConsumer(RESTBuilder restBuilder) {
|
||||||
return new DocumentRESTConsumer();
|
return new DocumentRESTConsumer(restBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
ColliAccettazioneRESTConsumer provideColliAccettazioneRESTConsumer() {
|
ColliAccettazioneRESTConsumer provideColliAccettazioneRESTConsumer(RESTBuilder restBuilder) {
|
||||||
return new ColliAccettazioneRESTConsumer();
|
return new ColliAccettazioneRESTConsumer(restBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
ColliSpedizioneRESTConsumer provideColliSpedizioneRESTConsumer() {
|
ColliSpedizioneRESTConsumer provideColliSpedizioneRESTConsumer(RESTBuilder restBuilder) {
|
||||||
return new ColliSpedizioneRESTConsumer();
|
return new ColliSpedizioneRESTConsumer(restBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
ColliLavorazioneRESTConsumer provideColliLavorazioneRESTConsumer(SettingsManager settingsManager) {
|
ColliLavorazioneRESTConsumer provideColliLavorazioneRESTConsumer(RESTBuilder restBuilder, SettingsManager settingsManager) {
|
||||||
return new ColliLavorazioneRESTConsumer(settingsManager);
|
return new ColliLavorazioneRESTConsumer(restBuilder, settingsManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
MagazzinoAutomaticoRESTConsumer provideMagazzinoAutomaticoRESTConsumer() {
|
MagazzinoAutomaticoRESTConsumer provideMagazzinoAutomaticoRESTConsumer(RESTBuilder restBuilder) {
|
||||||
return new MagazzinoAutomaticoRESTConsumer();
|
return new MagazzinoAutomaticoRESTConsumer(restBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
MagazzinoBufferRESTConsumer provideMagazzinoBufferRESTConsumer() {
|
MagazzinoBufferRESTConsumer provideMagazzinoBufferRESTConsumer(RESTBuilder restBuilder) {
|
||||||
return new MagazzinoBufferRESTConsumer();
|
return new MagazzinoBufferRESTConsumer(restBuilder);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
MaterialiRESTConsumer provideMaterialiRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
|
||||||
|
return new MaterialiRESTConsumer(restBuilder, executorService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
|
|||||||
@@ -103,12 +103,12 @@ public class SplashActivity extends BaseActivity implements MainContext.Listener
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDBDataLoading(String item) {
|
public void onDBDataLoading(String item) {
|
||||||
mBinding.loadingInfoTextview.setText("Caricamento " + item);
|
runOnUiThread(() -> mBinding.loadingInfoTextview.setText("Caricamento " + item));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMenuLoading() {
|
public void onMenuLoading() {
|
||||||
mBinding.loadingInfoTextview.setText("Caricamento menù");
|
runOnUiThread(() -> mBinding.loadingInfoTextview.setText("Caricamento menù"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package it.integry.integrywmsnative.core.authentication;
|
||||||
|
|
||||||
|
import io.jsonwebtoken.Claims;
|
||||||
|
import io.jsonwebtoken.Jws;
|
||||||
|
import io.jsonwebtoken.Jwts;
|
||||||
|
import io.jsonwebtoken.io.Decoders;
|
||||||
|
import io.jsonwebtoken.security.Keys;
|
||||||
|
|
||||||
|
public class JwtUtils {
|
||||||
|
|
||||||
|
private final static String SIGNING_KEY = "gICy3bjD56i/YFnBZZKe5ibiz3Snsp08nybGGziCV4ZcvyXBbyqWUnJ2wTrRXhOuf/xdljPXX0yBaqdAgvKthQ==";
|
||||||
|
|
||||||
|
public static Claims parseJwt(String token) {
|
||||||
|
Jws<Claims> jws = Jwts.parserBuilder()
|
||||||
|
.setSigningKey(Keys.hmacShaKeyFor(Decoders.BASE64.decode(SIGNING_KEY)))
|
||||||
|
.build()
|
||||||
|
.parseClaimsJws(token);
|
||||||
|
|
||||||
|
return jws.getBody();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -85,7 +85,7 @@ public class BarcodeManager {
|
|||||||
|
|
||||||
private static BarcodeCallbackDTO getValidCallback() {
|
private static BarcodeCallbackDTO getValidCallback() {
|
||||||
|
|
||||||
if (mBarcodeCallbacksStacktrace.size() > 0) {
|
if (!mBarcodeCallbacksStacktrace.isEmpty()) {
|
||||||
return mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() - 1);
|
return mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() - 1);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
@@ -106,7 +106,7 @@ public class BarcodeManager {
|
|||||||
|
|
||||||
int newID = -1;
|
int newID = -1;
|
||||||
|
|
||||||
if (mBarcodeCallbacksStacktrace.size() > 0) {
|
if (!mBarcodeCallbacksStacktrace.isEmpty()) {
|
||||||
newID = mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() - 1).getID() + 1;
|
newID = mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() - 1).getID() + 1;
|
||||||
} else {
|
} else {
|
||||||
newID = 1;
|
newID = 1;
|
||||||
|
|||||||
@@ -88,7 +88,8 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
.setTitleText(R.string.free_picking)
|
.setTitleText(R.string.free_picking)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_picking_libero)
|
.setTitleIcon(R.drawable.ic_dashboard_picking_libero)
|
||||||
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
|
.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()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_resi_cliente)
|
.setID(R.id.nav_resi_cliente)
|
||||||
@@ -124,7 +125,8 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
.setTitleText(R.string.free_lav_picking)
|
.setTitleText(R.string.free_lav_picking)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_libero)
|
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_libero)
|
||||||
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
|
.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()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_prod_posizionamento_da_ord)
|
.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)
|
.setTitleText(R.string.prod_versamento_su_ordine_title_fragment)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_su_ord)
|
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_su_ord)
|
||||||
.setDrawerIcon(R.drawable.ic_black_external)
|
.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()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_prod_riposizionamento_da_ord)
|
.setID(R.id.nav_prod_riposizionamento_da_ord)
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
|||||||
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityThread;
|
import it.integry.integrywmsnative.core.utility.UtilityThread;
|
||||||
|
import it.integry.integrywmsnative.gest.login.rest.AuthenticationRESTConsumer;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class MainContext {
|
public class MainContext {
|
||||||
@@ -27,18 +28,19 @@ public class MainContext {
|
|||||||
private final MenuService menuService;
|
private final MenuService menuService;
|
||||||
private final AppDatabase appDatabase;
|
private final AppDatabase appDatabase;
|
||||||
private final SystemRESTConsumer systemRESTConsumer;
|
private final SystemRESTConsumer systemRESTConsumer;
|
||||||
|
private final AuthenticationRESTConsumer authenticationRESTConsumer;
|
||||||
|
|
||||||
private Listener mListener;
|
private Listener mListener;
|
||||||
|
|
||||||
public MainContext(Context applicationContext, MenuService menuService, AppDatabase appDatabase, SystemRESTConsumer systemRESTConsumer) {
|
public MainContext(Context applicationContext, MenuService menuService, AppDatabase appDatabase, SystemRESTConsumer systemRESTConsumer, AuthenticationRESTConsumer authenticationRESTConsumer) {
|
||||||
this.applicationContext = applicationContext;
|
this.applicationContext = applicationContext;
|
||||||
this.menuService = menuService;
|
this.menuService = menuService;
|
||||||
this.appDatabase = appDatabase;
|
this.appDatabase = appDatabase;
|
||||||
this.systemRESTConsumer = systemRESTConsumer;
|
this.systemRESTConsumer = systemRESTConsumer;
|
||||||
|
this.authenticationRESTConsumer = authenticationRESTConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
BarcodeManager.init(applicationContext);
|
BarcodeManager.init(applicationContext);
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
@@ -46,6 +48,7 @@ public class MainContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//this.initAuthSession(() -> {
|
||||||
this.initDeviceId(() -> {
|
this.initDeviceId(() -> {
|
||||||
this.initDBData(() -> {
|
this.initDBData(() -> {
|
||||||
this.initMenu(() -> {
|
this.initMenu(() -> {
|
||||||
@@ -54,12 +57,33 @@ public class MainContext {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
//});
|
||||||
|
|
||||||
|
|
||||||
this.initServerStatusChecker();
|
this.initServerStatusChecker();
|
||||||
|
|
||||||
|
// EventBus.getDefault().register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
// public void onSessionExpired(SessionExpiredEvent event) {
|
||||||
|
// DialogSimpleMessageView.makeErrorDialog(
|
||||||
|
// new SpannedString("La sessione è scaduta. Effettua nuovamente la login"),
|
||||||
|
// null,
|
||||||
|
// () -> {
|
||||||
|
// logout(MainApplication::exit);
|
||||||
|
// })
|
||||||
|
// .show(activity.getSupportFragmentManager(), "expired-session-error");
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
private void initAuthSession(Runnable onComplete) {
|
||||||
|
this.authenticationRESTConsumer.me(obj -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, ex -> {
|
||||||
|
if (mListener != null) mListener.onError(new SpannedString(ex.getMessage()));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void initDeviceId(Runnable onComplete) {
|
private void initDeviceId(Runnable onComplete) {
|
||||||
if (SettingsManager.i().getUserSession().getDeviceId() != null) {
|
if (SettingsManager.i().getUserSession().getDeviceId() != null) {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class DataCache {
|
|||||||
|
|
||||||
Object foundDataCache = null;
|
Object foundDataCache = null;
|
||||||
|
|
||||||
if(dataCacheTemp != null && dataCacheTemp.size() > 0) {
|
if(dataCacheTemp != null && !dataCacheTemp.isEmpty()) {
|
||||||
foundDataCache = dataCacheTemp.get(0).getItem();
|
foundDataCache = dataCacheTemp.get(0).getItem();
|
||||||
dataCacheList.remove(dataCacheTemp.get(0));
|
dataCacheList.remove(dataCacheTemp.get(0));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class ColliDataRecoverService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean thereIsAnExistantSession() {
|
public boolean thereIsAnExistantSession() {
|
||||||
return mtbColtsSessions != null && mtbColtsSessions.size() > 0;
|
return mtbColtsSessions != null && !mtbColtsSessions.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Integer> getAllSessionIDs() {
|
public List<Integer> getAllSessionIDs() {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import java.math.BigDecimal;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
|
||||||
public class BindableBigDecimal implements Observable {
|
public class BindableBigDecimal implements Observable {
|
||||||
|
|
||||||
BigDecimal mValue;
|
BigDecimal mValue;
|
||||||
|
|
||||||
|
|||||||
@@ -105,6 +105,28 @@ public class Converters {
|
|||||||
view.setTag(R.id.bound_observable, new Pair<>(observableField, watcher));
|
view.setTag(R.id.bound_observable, new Pair<>(observableField, watcher));
|
||||||
view.addTextChangedListener(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();
|
String newValue = observableField.get();
|
||||||
if (!view.getText().toString().equals(newValue)) {
|
if (!view.getText().toString().equals(newValue)) {
|
||||||
view.setText(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")
|
@BindingAdapter("binding")
|
||||||
public static void bindEditText(AutoCompleteTextView view, final ObservableField<String> observableString) {
|
public static void bindEditText(AutoCompleteTextView view, final ObservableField<String> observableString) {
|
||||||
Pair<ObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
Pair<ObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
@@ -211,16 +255,19 @@ public class Converters {
|
|||||||
@Override
|
@Override
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
BigDecimal value = null;
|
BigDecimal value = null;
|
||||||
|
|
||||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||||
value = new BigDecimal(s.toString());
|
value = new BigDecimal(s.toString());
|
||||||
|
|
||||||
observableBigDecimal.set(value);
|
observableBigDecimal.set(value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
view.setTag(R.id.bound_observable, new Pair<>(observableBigDecimal, watcher));
|
view.setTag(R.id.bound_observable, new Pair<>(observableBigDecimal, watcher));
|
||||||
view.addTextChangedListener(watcher);
|
view.addTextChangedListener(watcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
BigDecimal newValue = observableBigDecimal.get();
|
BigDecimal newValue = observableBigDecimal.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)) {
|
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||||
view.setText(UtilityNumber.decimalToString(newValue));
|
view.setText(UtilityNumber.decimalToString(newValue));
|
||||||
@@ -257,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")
|
@BindingAdapter("binding")
|
||||||
public static void bindTextInputEditTextBigDecimal(TextInputEditText view, final BindableBigDecimal bindableBigDecimal) {
|
public static void bindTextInputEditTextBigDecimal(TextInputEditText view, final BindableBigDecimal bindableBigDecimal) {
|
||||||
Pair<BindableBigDecimal, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
Pair<BindableBigDecimal, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
@@ -277,7 +354,7 @@ public class Converters {
|
|||||||
view.addTextChangedListener(watcher);
|
view.addTextChangedListener(watcher);
|
||||||
}
|
}
|
||||||
BigDecimal newValue = bindableBigDecimal.get();
|
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)) {
|
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||||
view.setText(UtilityNumber.decimalToString(newValue));
|
view.setText(UtilityNumber.decimalToString(newValue));
|
||||||
@@ -304,7 +381,7 @@ public class Converters {
|
|||||||
view.addTextChangedListener(watcher);
|
view.addTextChangedListener(watcher);
|
||||||
}
|
}
|
||||||
Integer newValue = bindableInteger.get();
|
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)) {
|
if (!(viewValue.compareTo(newValue) == 0)) {
|
||||||
view.setText(newValue.toString());
|
view.setText(newValue.toString());
|
||||||
@@ -355,7 +432,7 @@ public class Converters {
|
|||||||
view.addTextChangedListener(watcher);
|
view.addTextChangedListener(watcher);
|
||||||
}
|
}
|
||||||
Integer newValue = observableInteger.get();
|
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) {
|
if (!viewValue.equals(newValue) && newValue != null) {
|
||||||
view.setText(newValue.toString());
|
view.setText(newValue.toString());
|
||||||
@@ -382,7 +459,7 @@ public class Converters {
|
|||||||
view.addTextChangedListener(watcher);
|
view.addTextChangedListener(watcher);
|
||||||
}
|
}
|
||||||
Long newValue = observableLong.get();
|
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) {
|
if (!viewValue.equals(newValue) && newValue != null) {
|
||||||
view.setText(newValue.toString());
|
view.setText(newValue.toString());
|
||||||
@@ -654,6 +731,30 @@ public class Converters {
|
|||||||
view.setChecked(newValue);
|
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")
|
@BindingAdapter("checked")
|
||||||
public static void bindCheckbox(CheckBox view, final BindableBoolean bindableBoolean) {
|
public static void bindCheckbox(CheckBox view, final BindableBoolean bindableBoolean) {
|
||||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||||
@@ -718,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"})
|
@BindingAdapter({"reverse_visibility"})
|
||||||
public static void bindViewReverseVisibility(View view, final BindableBoolean bindableBoolean) {
|
public static void bindViewReverseVisibility(View view, final BindableBoolean bindableBoolean) {
|
||||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
if (view.getTag(R.id.bound_reverse_visibility) != bindableBoolean) {
|
||||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
view.setTag(R.id.bound_reverse_visibility, bindableBoolean);
|
||||||
}
|
}
|
||||||
bindableBoolean.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
bindableBoolean.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||||
@Override
|
@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 {
|
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;
|
package it.integry.integrywmsnative.core.di.binders;
|
||||||
|
|
||||||
import androidx.databinding.BindingAdapter;
|
import androidx.databinding.BindingAdapter;
|
||||||
|
|
||||||
import com.google.android.material.textfield.TextInputLayout;
|
import com.google.android.material.textfield.TextInputLayout;
|
||||||
|
|
||||||
public class TextInputLayoutBinders {
|
public class TextInputLayoutBinders {
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
package it.integry.integrywmsnative.core.di.binders.recyclerview;
|
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.DataBindingUtil;
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
import androidx.databinding.ObservableList;
|
import androidx.databinding.ObservableList;
|
||||||
import androidx.databinding.ViewDataBinding;
|
import androidx.databinding.ViewDataBinding;
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.Collection;
|
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 -> model.ShipToPost = aiValue.toString();
|
||||||
case SHIP_TO_POST_ISO ->
|
case SHIP_TO_POST_ISO ->
|
||||||
model.ShipToPostISO = convertToIsoValueModel(aiValue.toString(), 0,
|
model.ShipToPostISO = convertToIsoValueModel(aiValue.toString(), 0,
|
||||||
new Callable<String, String>() {
|
new Callable<>() {
|
||||||
@Override
|
@Override
|
||||||
public String call(String input) {
|
public String call(String input) {
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new CallableII<String, Integer, String>() {
|
new CallableII<>() {
|
||||||
@Override
|
@Override
|
||||||
public String call(String input, Integer input2) {
|
public String call(String input, Integer input2) {
|
||||||
return input;
|
return input;
|
||||||
@@ -300,7 +300,7 @@ public class Ean128Service {
|
|||||||
|
|
||||||
T value = castFunc.call(splitFunc.call(sourceString.substring(3), numberOfDecimalDigits));
|
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.ISOCode = isoCode;
|
||||||
isoModel.Value = value;
|
isoModel.Value = value;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package it.integry.integrywmsnative.core.event;
|
||||||
|
|
||||||
|
public class SessionExpiredEvent {
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
public class UnauthorizedAccessException extends Exception {
|
||||||
|
public UnauthorizedAccessException() {
|
||||||
|
super("Accesso non autorizzato. Si prega di effettuare nuovamente l'accesso e riprovare");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,6 +6,8 @@ import android.view.KeyEvent;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.MainApplication;
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
@@ -18,7 +20,8 @@ public class BaseActivity extends AppCompatActivity {
|
|||||||
@Inject
|
@Inject
|
||||||
public DialogProgressView mCurrentProgress;
|
public DialogProgressView mCurrentProgress;
|
||||||
|
|
||||||
private boolean progressOpened;
|
@Inject
|
||||||
|
public ExecutorService executorService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
@@ -47,28 +50,19 @@ public class BaseActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void openProgress() {
|
private void openProgress() {
|
||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
// executorService.execute(() -> {
|
||||||
this.progressOpened = true;
|
this.mCurrentProgress.show(getSupportFragmentManager());
|
||||||
runOnUiThread(() -> {
|
// });
|
||||||
try {
|
|
||||||
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
|
|
||||||
} catch (IllegalStateException ise) {
|
|
||||||
//ignored
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void closeProgress() {
|
private void closeProgress() {
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
if (progressOpened) {
|
// executorService.execute(() -> {
|
||||||
this.progressOpened = false;
|
mCurrentProgress.dismiss();
|
||||||
runOnUiThread(() -> {
|
// });
|
||||||
mCurrentProgress.dismiss();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -2,15 +2,11 @@ package it.integry.integrywmsnative.core.expansion;
|
|||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.pointmobilescannerlibrary.PointMobileBarcodeReader;
|
|
||||||
|
|
||||||
public class BaseDialog extends Dialog {
|
public class BaseDialog extends Dialog {
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import android.os.Bundle;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
@@ -12,6 +13,8 @@ import androidx.fragment.app.DialogFragment;
|
|||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.MainApplication;
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
@@ -19,11 +22,13 @@ import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
|
||||||
public class BaseDialogFragment extends DialogFragment implements DialogInterface.OnShowListener {
|
public abstract class BaseDialogFragment extends DialogFragment implements DialogInterface.OnShowListener {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public DialogProgressView mCurrentProgress;
|
public DialogProgressView mCurrentProgress;
|
||||||
private boolean progressOpened;
|
|
||||||
|
@Inject
|
||||||
|
public ExecutorService executorService;
|
||||||
|
|
||||||
private boolean mBarcodeListener = false;
|
private boolean mBarcodeListener = false;
|
||||||
|
|
||||||
@@ -69,28 +74,26 @@ public class BaseDialogFragment extends DialogFragment implements DialogInterfac
|
|||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void openProgress() {
|
private void openProgress() {
|
||||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
BarcodeManager.disable();
|
||||||
this.progressOpened = true;
|
// executorService.execute(() -> {
|
||||||
requireActivity().runOnUiThread(() -> {
|
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager());
|
||||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
// });
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void closeProgress() {
|
private void closeProgress() {
|
||||||
if (progressOpened) {
|
BarcodeManager.enable();
|
||||||
this.progressOpened = false;
|
// executorService.execute(() -> {
|
||||||
requireActivity().runOnUiThread(() -> {
|
mCurrentProgress.dismiss();
|
||||||
mCurrentProgress.dismiss();
|
// });
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
|
||||||
requireActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
this.onLoadingEnded();
|
|
||||||
UtilityExceptions.defaultException(requireActivity(), ex);
|
UtilityExceptions.defaultException(requireActivity(), ex);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -111,7 +114,14 @@ public class BaseDialogFragment extends DialogFragment implements DialogInterfac
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onShow(DialogInterface dialogInterface) {
|
public void onShow(DialogInterface dialogInterface) {
|
||||||
|
getDialog().getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
|
||||||
|
|
||||||
this.initialize();
|
this.initialize();
|
||||||
|
this.onInit(dialogInterface);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onInit(DialogInterface dialogInterface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initialize() {
|
private void initialize() {
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ public abstract class BaseFragment extends Fragment {
|
|||||||
protected ElevatedToolbar mToolbar;
|
protected ElevatedToolbar mToolbar;
|
||||||
|
|
||||||
protected final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
protected final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||||
private boolean progressOpened;
|
|
||||||
|
|
||||||
|
|
||||||
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
||||||
@@ -67,22 +66,16 @@ public abstract class BaseFragment extends Fragment {
|
|||||||
|
|
||||||
private void openProgress() {
|
private void openProgress() {
|
||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
// executorService.execute(() -> {
|
||||||
this.progressOpened = true;
|
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager());
|
||||||
executorService.execute(() -> {
|
// });
|
||||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void closeProgress() {
|
private void closeProgress() {
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
if (progressOpened) {
|
// executorService.execute(() -> {
|
||||||
this.progressOpened = false;
|
mCurrentProgress.dismiss();
|
||||||
executorService.execute(() -> {
|
// });
|
||||||
mCurrentProgress.dismissAllowingStateLoss();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package it.integry.integrywmsnative.core.helper;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityContext;
|
||||||
|
|
||||||
|
public final class ContextHelper {
|
||||||
|
|
||||||
|
public static FragmentManager getFragmentManagerFromContext(Context context) {
|
||||||
|
if (context == null) {
|
||||||
|
throw new IllegalArgumentException("Context cannot be null");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (context instanceof FragmentActivity) {
|
||||||
|
return ((FragmentActivity) context).getSupportFragmentManager();
|
||||||
|
} else if (UtilityContext.getMainActivity() != null) {
|
||||||
|
return UtilityContext.getMainActivity().getSupportFragmentManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.data_store.db.entity.InventarioRowRoomDTO;
|
||||||
import it.integry.integrywmsnative.core.model.MtbInvenr;
|
import it.integry.integrywmsnative.core.model.MtbInvenr;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
|
||||||
public class InventarioRowMapper extends BaseMapper<MtbInvenr, InventarioRowRoomDTO> {
|
public class InventarioRowMapper extends BaseMapper<MtbInvenr, InventarioRowRoomDTO> {
|
||||||
|
|
||||||
@@ -32,6 +33,7 @@ public class InventarioRowMapper extends BaseMapper<MtbInvenr, InventarioRowRoom
|
|||||||
data.setDataOraInv(inputData.getDataOraInv());
|
data.setDataOraInv(inputData.getDataOraInv());
|
||||||
data.setScanCodBarre(inputData.getScanCodBarre());
|
data.setScanCodBarre(inputData.getScanCodBarre());
|
||||||
data.setZona(inputData.getZona());
|
data.setZona(inputData.getZona());
|
||||||
|
data.setIdDisp(SettingsManager.i().getUserSession().getDeviceId());
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,30 +1,38 @@
|
|||||||
package it.integry.integrywmsnative.core.menu;
|
package it.integry.integrywmsnative.core.menu;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.StbMenu;
|
import it.integry.integrywmsnative.core.model.StbMenu;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class MenuRESTConsumer extends _BaseRESTConsumer {
|
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) {
|
public void retrieveMenu(String rootCodOpz, RunnableArgs<StbMenu> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MenuRESTConsumerService menuRESTConsumerService = RESTBuilder.getService(MenuRESTConsumerService.class);
|
MenuRESTConsumerService menuRESTConsumerService = restBuilder.getService(MenuRESTConsumerService.class);
|
||||||
menuRESTConsumerService.retrieveMenuConfig(rootCodOpz).enqueue(new Callback<>() {
|
menuRESTConsumerService.retrieveMenuConfig(rootCodOpz).enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<StbMenu>> call, Response<ServiceRESTResponse<StbMenu>> response) {
|
public void onResponse(Call<ServiceRESTResponse<StbMenu>> call, Response<ServiceRESTResponse<StbMenu>> response) {
|
||||||
analyzeAnswer(response, "retrieveMenu", onComplete, onFailed);
|
analyzeAnswer(response, "retrieveMenu", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<StbMenu>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<StbMenu>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.core.model;
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.model;
|
|||||||
public class JtbComt extends EntityBase {
|
public class JtbComt extends EntityBase {
|
||||||
|
|
||||||
private String codJcom;
|
private String codJcom;
|
||||||
|
private String codAnag;
|
||||||
private String codJfas;
|
private String codJfas;
|
||||||
private String codJflav;
|
private String codJflav;
|
||||||
private String descrizione;
|
private String descrizione;
|
||||||
@@ -20,6 +21,15 @@ public class JtbComt extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCodAnag() {
|
||||||
|
return codAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbComt setCodAnag(String codAnag) {
|
||||||
|
this.codAnag = codAnag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public String getCodJfas() {
|
public String getCodJfas() {
|
||||||
return codJfas;
|
return codJfas;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class MtbColr extends EntityBase {
|
|||||||
private String gestioneRif;
|
private String gestioneRif;
|
||||||
private String serColloRif;
|
private String serColloRif;
|
||||||
private String note;
|
private String note;
|
||||||
private String dataOrd;
|
private LocalDate dataOrd;
|
||||||
private String dataColloRif;
|
private String dataColloRif;
|
||||||
private BigDecimal qtaCnf;
|
private BigDecimal qtaCnf;
|
||||||
private BigDecimal qtaCol;
|
private BigDecimal qtaCol;
|
||||||
@@ -225,24 +225,15 @@ public class MtbColr extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDataOrdS() {
|
public LocalDate getDataOrd() {
|
||||||
return dataOrd;
|
return dataOrd;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getDataOrdD() {
|
public MtbColr setDataOrd(LocalDate dataOrd) {
|
||||||
return UtilityDate.recognizeDateWithExceptionHandler(getDataOrdS());
|
|
||||||
}
|
|
||||||
|
|
||||||
public MtbColr setDataOrd(String dataOrd) {
|
|
||||||
this.dataOrd = dataOrd;
|
this.dataOrd = dataOrd;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MtbColr setDataOrd(Date dataOrd) {
|
|
||||||
this.dataOrd = UtilityDate.formatDate(dataOrd, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDataColloRifS() {
|
public String getDataColloRifS() {
|
||||||
return dataColloRif;
|
return dataColloRif;
|
||||||
}
|
}
|
||||||
@@ -261,6 +252,11 @@ public class MtbColr extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MtbColr setDataColloRif(LocalDate dataColloRif) {
|
||||||
|
this.dataColloRif = UtilityDate.formatDate(dataColloRif, UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public BigDecimal getQtaCnf() {
|
public BigDecimal getQtaCnf() {
|
||||||
return qtaCnf;
|
return qtaCnf;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.model;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
import androidx.databinding.ObservableField;
|
||||||
|
|
||||||
import com.annimon.stream.Optional;
|
import com.annimon.stream.Optional;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
@@ -10,11 +11,13 @@ import com.annimon.stream.Stream;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.dto.InternalCodAnagsDTO;
|
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.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||||
@@ -63,7 +66,7 @@ public class MtbColt extends EntityBase {
|
|||||||
private BigDecimal altezzaCm;
|
private BigDecimal altezzaCm;
|
||||||
private String codJcom;
|
private String codJcom;
|
||||||
|
|
||||||
private MtbTCol mtbTCol;
|
private final ObservableField<ObservableMtbTcol> mtbTCol = new ObservableField<>();
|
||||||
|
|
||||||
private Boolean disablePrint;
|
private Boolean disablePrint;
|
||||||
private String ragSocCliente;
|
private String ragSocCliente;
|
||||||
@@ -160,6 +163,10 @@ public class MtbColt extends EntityBase {
|
|||||||
return UtilityDate.recognizeDateWithExceptionHandler(getDataColloS());
|
return UtilityDate.recognizeDateWithExceptionHandler(getDataColloS());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LocalDate getDataColloLD() {
|
||||||
|
return UtilityDate.recognizeLocalDateWithExceptionHandler(getDataColloS());
|
||||||
|
}
|
||||||
|
|
||||||
public MtbColt setDataCollo(String dataCollo) {
|
public MtbColt setDataCollo(String dataCollo) {
|
||||||
this.dataCollo = dataCollo;
|
this.dataCollo = dataCollo;
|
||||||
return this;
|
return this;
|
||||||
@@ -170,6 +177,11 @@ public class MtbColt extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MtbColt setDataCollo(LocalDate dataCollo) {
|
||||||
|
this.dataCollo = UtilityDate.formatDate(dataCollo, UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public String getSerCollo() {
|
public String getSerCollo() {
|
||||||
return serCollo;
|
return serCollo;
|
||||||
}
|
}
|
||||||
@@ -248,6 +260,16 @@ public class MtbColt extends EntityBase {
|
|||||||
|
|
||||||
public MtbColt setCodTcol(String codTcol) {
|
public MtbColt setCodTcol(String codTcol) {
|
||||||
this.codTcol = 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;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -522,15 +544,19 @@ public class MtbColt extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MtbTCol getMtbTCol() {
|
public ObservableMtbTcol getMtbTCol() {
|
||||||
return mtbTCol;
|
return mtbTCol.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MtbColt setMtbTCol(MtbTCol mtbTCol) {
|
public MtbColt setMtbTCol(ObservableMtbTcol mtbTCol) {
|
||||||
this.mtbTCol = mtbTCol;
|
this.mtbTCol.set(mtbTCol);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ObservableField<ObservableMtbTcol> mtbTcolProperty() {
|
||||||
|
return mtbTCol;
|
||||||
|
}
|
||||||
|
|
||||||
public void generaFiltroOrdineFromDTO(List<FiltroOrdineDTO> filtroOrdineDtos) {
|
public void generaFiltroOrdineFromDTO(List<FiltroOrdineDTO> filtroOrdineDtos) {
|
||||||
|
|
||||||
String xmlPrefix = "{\"whereCond\": \"";
|
String xmlPrefix = "{\"whereCond\": \"";
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class MtbDepo extends EntityBase implements Parcelable {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Creator<MtbDepo> CREATOR = new Creator<MtbDepo>() {
|
public static final Creator<MtbDepo> CREATOR = new Creator<>() {
|
||||||
@Override
|
@Override
|
||||||
public MtbDepo createFromParcel(Parcel in) {
|
public MtbDepo createFromParcel(Parcel in) {
|
||||||
return new MtbDepo(in);
|
return new MtbDepo(in);
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package it.integry.integrywmsnative.core.model;
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class MtbGrup extends EntityBase {
|
public class MtbGrup extends EntityBase {
|
||||||
|
|
||||||
private String codMgrp;
|
private String codMgrp;
|
||||||
@@ -8,6 +11,7 @@ public class MtbGrup extends EntityBase {
|
|||||||
private String logoWeb;
|
private String logoWeb;
|
||||||
private String criterioVal;
|
private String criterioVal;
|
||||||
private String tipoMgrp;
|
private String tipoMgrp;
|
||||||
|
private List<MtbSgrp> mtbSgrp = new ArrayList<>();
|
||||||
|
|
||||||
public MtbGrup() {
|
public MtbGrup() {
|
||||||
this.type = "mtb_grup";
|
this.type = "mtb_grup";
|
||||||
@@ -66,4 +70,13 @@ public class MtbGrup extends EntityBase {
|
|||||||
this.tipoMgrp = tipoMgrp;
|
this.tipoMgrp = tipoMgrp;
|
||||||
return this;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.model;
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
public class MtbTCol {
|
public class MtbTCol {
|
||||||
@@ -13,7 +15,7 @@ public class MtbTCol {
|
|||||||
private BigDecimal taraKg;
|
private BigDecimal taraKg;
|
||||||
private String descrizione;
|
private String descrizione;
|
||||||
private String codMart;
|
private String codMart;
|
||||||
private String flagUIUL;
|
private FlagUiUlEnum flagUiUl;
|
||||||
private String circuito;
|
private String circuito;
|
||||||
|
|
||||||
public String getCodTcol() {
|
public String getCodTcol() {
|
||||||
@@ -88,13 +90,12 @@ public class MtbTCol {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFlagUIUL() {
|
public FlagUiUlEnum getFlagUiUl() {
|
||||||
return flagUIUL;
|
return flagUiUl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MtbTCol setFlagUIUL(String flagUIUL) {
|
public void setFlagUiUl(FlagUiUlEnum flagUiUl) {
|
||||||
this.flagUIUL = flagUIUL;
|
this.flagUiUl = flagUiUl;
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCircuito() {
|
public String getCircuito() {
|
||||||
@@ -107,4 +108,29 @@ public class MtbTCol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public enum FlagUiUlEnum {
|
||||||
|
@SerializedName("UI")
|
||||||
|
UI("UI"),
|
||||||
|
|
||||||
|
@SerializedName("UL")
|
||||||
|
UL("UL");
|
||||||
|
|
||||||
|
private final String text;
|
||||||
|
FlagUiUlEnum(String text) {
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getText() {
|
||||||
|
return this.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FlagUiUlEnum fromString(String text) {
|
||||||
|
for (FlagUiUlEnum b : FlagUiUlEnum.values()) {
|
||||||
|
if (b.text.equalsIgnoreCase(text)) return b;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.core.model;
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public class StbGestSetup extends EntityBase{
|
public class StbGestSetup extends EntityBase{
|
||||||
|
|
||||||
private String gestName;
|
private String gestName;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class VtbDest extends EntityBase implements Parcelable {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Creator<VtbDest> CREATOR = new Creator<VtbDest>() {
|
public static final Creator<VtbDest> CREATOR = new Creator<>() {
|
||||||
@Override
|
@Override
|
||||||
public VtbDest createFromParcel(Parcel in) {
|
public VtbDest createFromParcel(Parcel in) {
|
||||||
return new VtbDest(in);
|
return new VtbDest(in);
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class VtbVetr extends EntityBase {
|
||||||
|
|
||||||
|
public VtbVetr() {
|
||||||
|
type = "vtb_vetr";
|
||||||
|
}
|
||||||
|
|
||||||
|
private String codVvet;
|
||||||
|
private String codSpes;
|
||||||
|
private String idRiga;
|
||||||
|
private BigDecimal daQta;
|
||||||
|
private BigDecimal aQta;
|
||||||
|
private BigDecimal impUnt;
|
||||||
|
private BigDecimal impFisso;
|
||||||
|
private String codDivi;
|
||||||
|
|
||||||
|
public String getCodVvet() {
|
||||||
|
return codVvet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVetr setCodVvet(String codVvet) {
|
||||||
|
this.codVvet = codVvet;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodSpes() {
|
||||||
|
return codSpes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVetr setCodSpes(String codSpes) {
|
||||||
|
this.codSpes = codSpes;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIdRiga() {
|
||||||
|
return idRiga;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVetr setIdRiga(String idRiga) {
|
||||||
|
this.idRiga = idRiga;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getDaQta() {
|
||||||
|
return daQta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVetr setDaQta(BigDecimal daQta) {
|
||||||
|
this.daQta = daQta;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getaQta() {
|
||||||
|
return aQta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVetr setaQta(BigDecimal aQta) {
|
||||||
|
this.aQta = aQta;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getImpUnt() {
|
||||||
|
return impUnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVetr setImpUnt(BigDecimal impUnt) {
|
||||||
|
this.impUnt = impUnt;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getImpFisso() {
|
||||||
|
return impFisso;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVetr setImpFisso(BigDecimal impFisso) {
|
||||||
|
this.impFisso = impFisso;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodDivi() {
|
||||||
|
return codDivi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVetr setCodDivi(String codDivi) {
|
||||||
|
this.codDivi = codDivi;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,273 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class VtbVett extends EntityBase {
|
||||||
|
|
||||||
|
public VtbVett() {
|
||||||
|
type = "vtb_vett";
|
||||||
|
}
|
||||||
|
|
||||||
|
private String codVvet;
|
||||||
|
private String codLettVett;
|
||||||
|
private String codAnag;
|
||||||
|
private String ragSoc;
|
||||||
|
private String indirizzo;
|
||||||
|
private String cap;
|
||||||
|
private String citta;
|
||||||
|
private String prov;
|
||||||
|
private String nazione;
|
||||||
|
private String telefono;
|
||||||
|
private String fax;
|
||||||
|
private String partIva;
|
||||||
|
private String note;
|
||||||
|
private String eMail;
|
||||||
|
private String modStamp;
|
||||||
|
private BigDecimal coefVol;
|
||||||
|
private String flagAttivo;
|
||||||
|
private String numAutoriz;
|
||||||
|
private List<VtbVetr> vtbVetr;
|
||||||
|
|
||||||
|
|
||||||
|
public String getCodVvet() {
|
||||||
|
return codVvet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setCodVvet(String codVvet) {
|
||||||
|
this.codVvet = codVvet;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodLettVett() {
|
||||||
|
return codLettVett;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setCodLettVett(String codLettVett) {
|
||||||
|
this.codLettVett = codLettVett;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodAnag() {
|
||||||
|
return codAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setCodAnag(String codAnag) {
|
||||||
|
this.codAnag = codAnag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRagSoc() {
|
||||||
|
return ragSoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setRagSoc(String ragSoc) {
|
||||||
|
this.ragSoc = ragSoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIndirizzo() {
|
||||||
|
return indirizzo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setIndirizzo(String indirizzo) {
|
||||||
|
this.indirizzo = indirizzo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCap() {
|
||||||
|
return cap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setCap(String cap) {
|
||||||
|
this.cap = cap;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCitta() {
|
||||||
|
return citta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setCitta(String citta) {
|
||||||
|
this.citta = citta;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProv() {
|
||||||
|
return prov;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setProv(String prov) {
|
||||||
|
this.prov = prov;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNazione() {
|
||||||
|
return nazione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setNazione(String nazione) {
|
||||||
|
this.nazione = nazione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTelefono() {
|
||||||
|
return telefono;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setTelefono(String telefono) {
|
||||||
|
this.telefono = telefono;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFax() {
|
||||||
|
return fax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setFax(String fax) {
|
||||||
|
this.fax = fax;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPartIva() {
|
||||||
|
return partIva;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setPartIva(String partIva) {
|
||||||
|
this.partIva = partIva;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNote() {
|
||||||
|
return note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setNote(String note) {
|
||||||
|
this.note = note;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String geteMail() {
|
||||||
|
return eMail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett seteMail(String eMail) {
|
||||||
|
this.eMail = eMail;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getModStamp() {
|
||||||
|
return modStamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setModStamp(String modStamp) {
|
||||||
|
this.modStamp = modStamp;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCoefVol() {
|
||||||
|
return coefVol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setCoefVol(BigDecimal coefVol) {
|
||||||
|
this.coefVol = coefVol;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagAttivo() {
|
||||||
|
return flagAttivo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setFlagAttivo(String flagAttivo) {
|
||||||
|
this.flagAttivo = flagAttivo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNumAutoriz() {
|
||||||
|
return numAutoriz;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setNumAutoriz(String numAutoriz) {
|
||||||
|
this.numAutoriz = numAutoriz;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<VtbVetr> getVtbVetr() {
|
||||||
|
return vtbVetr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VtbVett setVtbVetr(List<VtbVetr> vtbVetr) {
|
||||||
|
this.vtbVetr = vtbVetr;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
|
||||||
|
VtbVett vtbVett = (VtbVett) o;
|
||||||
|
|
||||||
|
if (!getCodVvet().equals(vtbVett.getCodVvet())) return false;
|
||||||
|
if (getCodLettVett() != null ? !getCodLettVett().equals(vtbVett.getCodLettVett()) : vtbVett.getCodLettVett() != null)
|
||||||
|
return false;
|
||||||
|
if (getCodAnag() != null ? !getCodAnag().equals(vtbVett.getCodAnag()) : vtbVett.getCodAnag() != null)
|
||||||
|
return false;
|
||||||
|
if (getRagSoc() != null ? !getRagSoc().equals(vtbVett.getRagSoc()) : vtbVett.getRagSoc() != null)
|
||||||
|
return false;
|
||||||
|
if (getIndirizzo() != null ? !getIndirizzo().equals(vtbVett.getIndirizzo()) : vtbVett.getIndirizzo() != null)
|
||||||
|
return false;
|
||||||
|
if (getCap() != null ? !getCap().equals(vtbVett.getCap()) : vtbVett.getCap() != null)
|
||||||
|
return false;
|
||||||
|
if (getCitta() != null ? !getCitta().equals(vtbVett.getCitta()) : vtbVett.getCitta() != null)
|
||||||
|
return false;
|
||||||
|
if (getProv() != null ? !getProv().equals(vtbVett.getProv()) : vtbVett.getProv() != null)
|
||||||
|
return false;
|
||||||
|
if (getNazione() != null ? !getNazione().equals(vtbVett.getNazione()) : vtbVett.getNazione() != null)
|
||||||
|
return false;
|
||||||
|
if (getTelefono() != null ? !getTelefono().equals(vtbVett.getTelefono()) : vtbVett.getTelefono() != null)
|
||||||
|
return false;
|
||||||
|
if (getFax() != null ? !getFax().equals(vtbVett.getFax()) : vtbVett.getFax() != null)
|
||||||
|
return false;
|
||||||
|
if (getPartIva() != null ? !getPartIva().equals(vtbVett.getPartIva()) : vtbVett.getPartIva() != null)
|
||||||
|
return false;
|
||||||
|
if (getNote() != null ? !getNote().equals(vtbVett.getNote()) : vtbVett.getNote() != null)
|
||||||
|
return false;
|
||||||
|
if (geteMail() != null ? !geteMail().equals(vtbVett.geteMail()) : vtbVett.geteMail() != null)
|
||||||
|
return false;
|
||||||
|
if (getModStamp() != null ? !getModStamp().equals(vtbVett.getModStamp()) : vtbVett.getModStamp() != null)
|
||||||
|
return false;
|
||||||
|
if (getCoefVol() != null ? !getCoefVol().equals(vtbVett.getCoefVol()) : vtbVett.getCoefVol() != null)
|
||||||
|
return false;
|
||||||
|
if (getFlagAttivo() != null ? !getFlagAttivo().equals(vtbVett.getFlagAttivo()) : vtbVett.getFlagAttivo() != null)
|
||||||
|
return false;
|
||||||
|
if (getNumAutoriz() != null ? !getNumAutoriz().equals(vtbVett.getNumAutoriz()) : vtbVett.getNumAutoriz() != null)
|
||||||
|
return false;
|
||||||
|
return getVtbVetr() != null ? getVtbVetr().equals(vtbVett.getVtbVetr()) : vtbVett.getVtbVetr() == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = getCodVvet().hashCode();
|
||||||
|
result = 31 * result + (getCodLettVett() != null ? getCodLettVett().hashCode() : 0);
|
||||||
|
result = 31 * result + (getCodAnag() != null ? getCodAnag().hashCode() : 0);
|
||||||
|
result = 31 * result + (getRagSoc() != null ? getRagSoc().hashCode() : 0);
|
||||||
|
result = 31 * result + (getIndirizzo() != null ? getIndirizzo().hashCode() : 0);
|
||||||
|
result = 31 * result + (getCap() != null ? getCap().hashCode() : 0);
|
||||||
|
result = 31 * result + (getCitta() != null ? getCitta().hashCode() : 0);
|
||||||
|
result = 31 * result + (getProv() != null ? getProv().hashCode() : 0);
|
||||||
|
result = 31 * result + (getNazione() != null ? getNazione().hashCode() : 0);
|
||||||
|
result = 31 * result + (getTelefono() != null ? getTelefono().hashCode() : 0);
|
||||||
|
result = 31 * result + (getFax() != null ? getFax().hashCode() : 0);
|
||||||
|
result = 31 * result + (getPartIva() != null ? getPartIva().hashCode() : 0);
|
||||||
|
result = 31 * result + (getNote() != null ? getNote().hashCode() : 0);
|
||||||
|
result = 31 * result + (geteMail() != null ? geteMail().hashCode() : 0);
|
||||||
|
result = 31 * result + (getModStamp() != null ? getModStamp().hashCode() : 0);
|
||||||
|
result = 31 * result + (getCoefVol() != null ? getCoefVol().hashCode() : 0);
|
||||||
|
result = 31 * result + (getFlagAttivo() != null ? getFlagAttivo().hashCode() : 0);
|
||||||
|
result = 31 * result + (getNumAutoriz() != null ? getNumAutoriz().hashCode() : 0);
|
||||||
|
result = 31 * result + (getVtbVetr() != null ? getVtbVetr().hashCode() : 0);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import io.jsonwebtoken.Claims;
|
||||||
|
import it.integry.integrywmsnative.core.authentication.JwtUtils;
|
||||||
|
import it.integry.integrywmsnative.core.exception.UnauthorizedAccessException;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
import it.integry.integrywmsnative.gest.login.rest.RefreshRESTConsumer;
|
||||||
|
import okhttp3.Interceptor;
|
||||||
|
import okhttp3.Protocol;
|
||||||
|
import okhttp3.Response;
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
|
||||||
|
public class AuthInterceptor implements Interceptor {
|
||||||
|
|
||||||
|
private final RefreshRESTConsumer refreshRESTConsumer;
|
||||||
|
|
||||||
|
public AuthInterceptor(RefreshRESTConsumer refreshRESTConsumer) {
|
||||||
|
this.refreshRESTConsumer = refreshRESTConsumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Response intercept(@NonNull Chain chain) throws IOException {
|
||||||
|
var originalRequest = chain.request();
|
||||||
|
|
||||||
|
if (SettingsManager.i().getUserSession() != null) {
|
||||||
|
|
||||||
|
var accessToken = SettingsManager.i().getUserSession().getAccessToken();
|
||||||
|
var accessTokenExpiryDate = SettingsManager.i().getUserSession().getAccessTokenExpiryDate();
|
||||||
|
|
||||||
|
if (accessToken != null && (accessTokenExpiryDate == null || UtilityDate.getNowTime().isAfter(accessTokenExpiryDate.minusSeconds(20)))) {
|
||||||
|
|
||||||
|
// Make the token refresh request
|
||||||
|
try {
|
||||||
|
var response = refreshRESTConsumer.makeSynchronousRefreshTokenRequest();
|
||||||
|
|
||||||
|
Claims claims = JwtUtils.parseJwt(response.getAccessToken());
|
||||||
|
|
||||||
|
SettingsManager.i().getUserSession()
|
||||||
|
.setAccessToken(response.getAccessToken())
|
||||||
|
.setAccessTokenExpiryDate(UtilityDate.toLocalDateTime(claims.getExpiration()))
|
||||||
|
.setRefreshToken(response.getRefreshToken())
|
||||||
|
.setRefreshTokenExpiryDate(response.getExpiryDate());
|
||||||
|
|
||||||
|
SettingsManager.update();
|
||||||
|
} catch (UnauthorizedAccessException uae) {
|
||||||
|
// Crea una risposta 401 manualmente
|
||||||
|
return new Response.Builder()
|
||||||
|
.request(originalRequest)
|
||||||
|
.protocol(Protocol.HTTP_1_1)
|
||||||
|
.code(401)
|
||||||
|
.message("Unauthorized")
|
||||||
|
.body(ResponseBody.create(new byte[0], null))
|
||||||
|
.build();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return chain.proceed(originalRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Add the access token to the request header
|
||||||
|
var authorizedRequest = originalRequest.newBuilder()
|
||||||
|
.header("Authorization", "Bearer " + SettingsManager.i().getUserSession().getAccessToken())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
return chain.proceed(authorizedRequest);
|
||||||
|
} else
|
||||||
|
return chain.proceed(originalRequest);
|
||||||
|
} else
|
||||||
|
return chain.proceed(originalRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
package it.integry.integrywmsnative.core.rest;
|
package it.integry.integrywmsnative.core.rest;
|
||||||
|
|
||||||
import android.util.Base64;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import okhttp3.HttpUrl;
|
import okhttp3.HttpUrl;
|
||||||
import okhttp3.Interceptor;
|
import okhttp3.Interceptor;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
@@ -20,25 +19,33 @@ public class HttpInterceptor implements Interceptor {
|
|||||||
public Response intercept(Chain chain) throws IOException {
|
public Response intercept(Chain chain) throws IOException {
|
||||||
|
|
||||||
final String PROFILE_DB = SettingsManager.i().getUserSession() == null ? null : SettingsManager.i().getUserSession().getProfileDB();
|
final String PROFILE_DB = SettingsManager.i().getUserSession() == null ? null : SettingsManager.i().getUserSession().getProfileDB();
|
||||||
final String USERNAME = SettingsManager.i().getUser().getUsername();
|
final String APP_TOKEN = "fa3a21af-606b-4129-a22b-aedc2a52c7b6";
|
||||||
final String PASSWORD = SettingsManager.i().getUser().getPassword();
|
|
||||||
final String DEVICE_ID = SettingsManager.i().getUserSession().getDeviceId();
|
|
||||||
|
|
||||||
final Request request = chain.request();
|
final Request request = chain.request();
|
||||||
final HttpUrl url = request.url().newBuilder()
|
final HttpUrl url = request.url().newBuilder()
|
||||||
.addQueryParameter("profileDb", PROFILE_DB)
|
.addQueryParameter("profileDb", PROFILE_DB)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
String string = "Basic " + Base64.encodeToString((USERNAME + ":" + PASSWORD).getBytes(), Base64.NO_WRAP);
|
Request.Builder builder = chain.request().newBuilder()
|
||||||
|
|
||||||
final Request newRequest = chain.request().newBuilder()
|
|
||||||
.addHeader("Authorization", string)
|
|
||||||
.addHeader("Content-Type", "application/json")
|
.addHeader("Content-Type", "application/json")
|
||||||
.addHeader("Accept", "*/*")
|
.addHeader("Accept", "*/*")
|
||||||
.addHeader("username", USERNAME != null ? USERNAME : "")
|
.addHeader("x-app-token", APP_TOKEN);
|
||||||
.addHeader("password", PASSWORD != null ? PASSWORD : "")
|
|
||||||
.addHeader("device_id", DEVICE_ID != null ? DEVICE_ID : "")
|
|
||||||
.url(url).build();
|
String accessToken = null;
|
||||||
|
|
||||||
|
//Nel caso in cui il token è scaduto e devo richiamare la refresh non bisogna passare il vecchio token
|
||||||
|
if(SettingsManager.i().getUserSession().getAccessTokenExpiryDate() != null &&
|
||||||
|
UtilityDate.getNowTime().isBefore(SettingsManager.i().getUserSession().getAccessTokenExpiryDate())) {
|
||||||
|
accessToken = SettingsManager.i().getUserSession().getAccessToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(accessToken != null)
|
||||||
|
builder.header("Authorization", "Bearer " + accessToken);
|
||||||
|
|
||||||
|
var newRequest = builder
|
||||||
|
.url(url)
|
||||||
|
.build();
|
||||||
|
|
||||||
return chain.proceed(newRequest);
|
return chain.proceed(newRequest);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import java.security.KeyManagementException;
|
|||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
import javax.net.ssl.SSLContext;
|
import javax.net.ssl.SSLContext;
|
||||||
import javax.net.ssl.TrustManager;
|
import javax.net.ssl.TrustManager;
|
||||||
import javax.net.ssl.X509TrustManager;
|
import javax.net.ssl.X509TrustManager;
|
||||||
@@ -20,29 +21,35 @@ import retrofit2.converter.gson.GsonConverterFactory;
|
|||||||
* Created by GiuseppeS on 06/03/2018.
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class RESTBuilder {
|
public class RESTBuilder {
|
||||||
|
|
||||||
private static final boolean ADD_LOGGER_INTERCEPTOR = false;
|
private final boolean ADD_LOGGER_INTERCEPTOR = false;
|
||||||
|
private final AuthInterceptor authInterceptor;
|
||||||
|
|
||||||
public static <T> T getService(final Class<T> service) {
|
public RESTBuilder(AuthInterceptor authInterceptor) {
|
||||||
|
this.authInterceptor = authInterceptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> T getService(final Class<T> service) {
|
||||||
return getService(service, SettingsManager.i().getServer().getProtocol(), SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true);
|
return getService(service, SettingsManager.i().getServer().getProtocol(), SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> T getService(final Class<T> service, int timeout) {
|
public <T> T getService(final Class<T> service, int timeout) {
|
||||||
return getService(service, SettingsManager.i().getServer().getProtocol(), SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true, true, timeout);
|
return getService(service, SettingsManager.i().getServer().getProtocol(), SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true, true, timeout);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addInterceptors) {
|
public <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addInterceptors) {
|
||||||
return getService(service, protocol, host, port, addInterceptors, true, 60);
|
return getService(service, protocol, host, port, addInterceptors, true, 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addInterceptors, boolean addEmsApi) {
|
public <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addInterceptors, boolean addEmsApi) {
|
||||||
return getService(service, protocol, host, port, addInterceptors, addEmsApi, 60);
|
return getService(service, protocol, host, port, addInterceptors, addEmsApi, 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addInterceptors, boolean addEmsApi, int timeout) {
|
public <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addInterceptors, boolean addEmsApi, int timeout) {
|
||||||
OkHttpClient.Builder clientBuilder = getDefaultHttpClient();
|
OkHttpClient.Builder clientBuilder = getDefaultHttpClient();
|
||||||
|
|
||||||
clientBuilder.connectTimeout(timeout, TimeUnit.SECONDS);
|
clientBuilder.connectTimeout(timeout, TimeUnit.SECONDS);
|
||||||
@@ -51,6 +58,7 @@ public class RESTBuilder {
|
|||||||
|
|
||||||
clientBuilder.retryOnConnectionFailure(true);
|
clientBuilder.retryOnConnectionFailure(true);
|
||||||
|
|
||||||
|
clientBuilder.addInterceptor(authInterceptor);
|
||||||
if (addInterceptors) clientBuilder.addInterceptor(new HttpInterceptor());
|
if (addInterceptors) clientBuilder.addInterceptor(new HttpInterceptor());
|
||||||
if (ADD_LOGGER_INTERCEPTOR) clientBuilder.addInterceptor(new HttpLoggerInterceptor());
|
if (ADD_LOGGER_INTERCEPTOR) clientBuilder.addInterceptor(new HttpLoggerInterceptor());
|
||||||
|
|
||||||
@@ -61,21 +69,16 @@ public class RESTBuilder {
|
|||||||
|
|
||||||
Gson gson = UtilityGson.createObject();
|
Gson gson = UtilityGson.createObject();
|
||||||
|
|
||||||
Retrofit retrofit = new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create(gson)).baseUrl(endpoint).client(client).build();
|
Retrofit retrofit = new Retrofit.Builder()
|
||||||
|
.addConverterFactory(GsonConverterFactory.create(gson))
|
||||||
|
.baseUrl(endpoint)
|
||||||
|
.client(client)
|
||||||
|
.build();
|
||||||
|
|
||||||
return retrofit.create(service);
|
return retrofit.create(service);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String getDefaultHost() {
|
|
||||||
return SettingsManager.i().getServer().getHost();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getDefaultPort() {
|
|
||||||
return SettingsManager.i().getServer().getPort();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static OkHttpClient.Builder getDefaultHttpClient() {
|
public static OkHttpClient.Builder getDefaultHttpClient() {
|
||||||
TrustManager[] trustAllCerts = new TrustManager[]{
|
TrustManager[] trustAllCerts = new TrustManager[]{
|
||||||
new X509TrustManager() {
|
new X509TrustManager() {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
@@ -17,27 +19,67 @@ import it.integry.integrywmsnative.core.model.MtbGrup;
|
|||||||
import it.integry.integrywmsnative.core.model.MtbUntMis;
|
import it.integry.integrywmsnative.core.model.MtbUntMis;
|
||||||
import it.integry.integrywmsnative.core.model.dto.StatoArticoloDTO;
|
import it.integry.integrywmsnative.core.model.dto.StatoArticoloDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.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.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.SearchArticoloByBarcodeRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.articolo.SearchArticoloByBarcodeResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.articolo.SearchArticoloByBarcodeResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.articolo.UpdateBarcodeImballoRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.articolo.UpdateBarcodeImballoRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
private final RESTBuilder restBuilder;
|
||||||
private final SystemRESTConsumer systemRESTConsumer;
|
private final SystemRESTConsumer systemRESTConsumer;
|
||||||
|
|
||||||
public ArticoloRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
public ArticoloRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer) {
|
||||||
|
this.restBuilder = restBuilder;
|
||||||
this.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) {
|
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()
|
var request = new SearchArticoloByBarcodeRequestDTO()
|
||||||
.setBarcode(barcodeProd)
|
.setBarcode(barcodeProd)
|
||||||
@@ -45,7 +87,7 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
articoloRESTConsumerService
|
articoloRESTConsumerService
|
||||||
.searchByBarcode(request)
|
.searchByBarcode(request)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> call, Response<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> call, Response<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "searchByBarcode", (m) -> {
|
analyzeAnswer(response, "searchByBarcode", (m) -> {
|
||||||
@@ -54,37 +96,51 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void findIfIsKit(MtbAart mtbAart, RunnableArgs<MtbAart> onComplete, RunnableArgs<Exception> onFailed){
|
||||||
|
ArticoloRESTConsumerService articoloRESTConsumerService = restBuilder.getService(ArticoloRESTConsumerService.class);
|
||||||
|
|
||||||
public void getByCodMarts(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
articoloRESTConsumerService
|
||||||
getByCodMartsStatic(codMartToFind, onComplete, onFailed);
|
.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 static void getByCodMartsStatic(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getByCodMarts(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
var codMarts = Stream.of(codMartToFind)
|
var codMarts = Stream.of(codMartToFind)
|
||||||
.withoutNulls()
|
.withoutNulls()
|
||||||
.distinct().toList();
|
.distinct().toList();
|
||||||
|
|
||||||
|
|
||||||
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
ArticoloRESTConsumerService articoloRESTConsumer = restBuilder.getService(ArticoloRESTConsumerService.class);
|
||||||
articoloRESTConsumer
|
articoloRESTConsumer
|
||||||
.getByCodMart(new RetrieveArticoloByCodMartRequestDTO()
|
.getByCodMart(new RetrieveArticoloByCodMartRequestDTO()
|
||||||
.setCodMarts(codMarts))
|
.setCodMarts(codMarts))
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<MtbAart>>> call, Response<ServiceRESTResponse<List<MtbAart>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<MtbAart>>> call, Response<ServiceRESTResponse<List<MtbAart>>> response) {
|
||||||
analyzeAnswer(response, "getByCodMart", onComplete, onFailed);
|
analyzeAnswer(response, "getByCodMart", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<MtbAart>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<MtbAart>>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -92,16 +148,16 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
public void getStatoPartita(String codMart, String partitaMag, RunnableArgs<List<StatoArticoloDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getStatoPartita(String codMart, String partitaMag, RunnableArgs<List<StatoArticoloDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
ArticoloRESTConsumerService articoloRESTConsumer = restBuilder.getService(ArticoloRESTConsumerService.class);
|
||||||
articoloRESTConsumer.getStatoPartita(codMart, partitaMag).enqueue(new Callback<>() {
|
articoloRESTConsumer.getStatoPartita(codMart, partitaMag).enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<StatoArticoloDTO>>> call, Response<ServiceRESTResponse<List<StatoArticoloDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<StatoArticoloDTO>>> call, Response<ServiceRESTResponse<List<StatoArticoloDTO>>> response) {
|
||||||
analyzeAnswer(response, "getStatoPartita", onComplete, onFailed);
|
analyzeAnswer(response, "getStatoPartita", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<StatoArticoloDTO>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<StatoArticoloDTO>>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -183,7 +239,7 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
|
|
||||||
public void updateBarcodeImballo(String codMart, String newBarcodeImballo, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
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()
|
var request = new UpdateBarcodeImballoRequestDTO()
|
||||||
.setCodMart(codMart)
|
.setCodMart(codMart)
|
||||||
@@ -191,7 +247,7 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
articoloRESTConsumerService
|
articoloRESTConsumerService
|
||||||
.updateBarcodeImballo(request)
|
.updateBarcodeImballo(request)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
analyzeAnswer(response, "updateBarcodeImballo", m -> {
|
analyzeAnswer(response, "updateBarcodeImballo", m -> {
|
||||||
@@ -200,8 +256,32 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
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 java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
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.model.dto.StatoArticoloDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
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.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.SearchArticoloByBarcodeRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.articolo.SearchArticoloByBarcodeResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.articolo.SearchArticoloByBarcodeResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.articolo.UpdateBarcodeImballoRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.articolo.UpdateBarcodeImballoRequestDTO;
|
||||||
@@ -17,9 +21,19 @@ import retrofit2.http.Query;
|
|||||||
|
|
||||||
public interface ArticoloRESTConsumerService {
|
public interface ArticoloRESTConsumerService {
|
||||||
|
|
||||||
|
|
||||||
|
@GET("wms/articolo/availableUntMis")
|
||||||
|
Call<ServiceRESTResponse<MtbUntMis>> retrieveAvailableUntMis();
|
||||||
|
|
||||||
|
@GET("wms/articolo/availableGruppiMerceologici")
|
||||||
|
Call<ServiceRESTResponse<MtbGrup>> retrieveAvailableGruppiMerceologici();
|
||||||
|
|
||||||
@POST("wms/articolo/searchByBarcode")
|
@POST("wms/articolo/searchByBarcode")
|
||||||
Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> searchByBarcode(@Body() SearchArticoloByBarcodeRequestDTO searchArticoloByBarcodeRequest);
|
Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> searchByBarcode(@Body() SearchArticoloByBarcodeRequestDTO searchArticoloByBarcodeRequest);
|
||||||
|
|
||||||
|
@POST("wms/articolo/findIfIsKit")
|
||||||
|
Call<ServiceRESTResponse<MtbAart>> findIfIsKit(@Body MtbAart mtbAart);
|
||||||
|
|
||||||
@POST("wms/articolo/retrieveByCodMart")
|
@POST("wms/articolo/retrieveByCodMart")
|
||||||
Call<ServiceRESTResponse<List<MtbAart>>> getByCodMart(@Body RetrieveArticoloByCodMartRequestDTO retrieveArticoloByCodMartRequest);
|
Call<ServiceRESTResponse<List<MtbAart>>> getByCodMart(@Body RetrieveArticoloByCodMartRequestDTO retrieveArticoloByCodMartRequest);
|
||||||
|
|
||||||
@@ -29,4 +43,7 @@ public interface ArticoloRESTConsumerService {
|
|||||||
@GET("getProductLotStatus")
|
@GET("getProductLotStatus")
|
||||||
Call<ServiceRESTResponse<List<StatoArticoloDTO>>> getStatoPartita(@Query("codMart") String codMart, @Query("partitaMag") String partitaMag);
|
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,29 +1,37 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.Azienda;
|
import it.integry.integrywmsnative.core.model.Azienda;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.ServiceRESTResponse;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class AziendaRESTConsumer extends _BaseRESTConsumer {
|
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) {
|
public void retrieveAzienda(RunnableArgs<Azienda> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
AziendaRESTConsumerService aziendaRESTConsumerService = RESTBuilder.getService(AziendaRESTConsumerService.class);
|
AziendaRESTConsumerService aziendaRESTConsumerService = restBuilder.getService(AziendaRESTConsumerService.class);
|
||||||
aziendaRESTConsumerService.retrieveDefaultAzienda().enqueue(new Callback<>() {
|
aziendaRESTConsumerService.retrieveDefaultAzienda().enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Azienda>> call, Response<ServiceRESTResponse<Azienda>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Azienda>> call, Response<ServiceRESTResponse<Azienda>> response) {
|
||||||
analyzeAnswer(response, "Retrieve default azienda", onComplete, onFailed);
|
analyzeAnswer(response, "Retrieve default azienda", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Azienda>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Azienda>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
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.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliCaricoRESTConsumerInterface;
|
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.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCResponseDTO;
|
||||||
@@ -18,25 +21,30 @@ 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.InsertUDCRowRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowResponseDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class ColliAccettazioneRESTConsumer extends _BaseRESTConsumer implements ColliCaricoRESTConsumerInterface {
|
public class ColliAccettazioneRESTConsumer extends _BaseRESTConsumer implements ColliCaricoRESTConsumerInterface {
|
||||||
|
|
||||||
|
private final RESTBuilder restBuilder;
|
||||||
|
|
||||||
|
public ColliAccettazioneRESTConsumer(RESTBuilder restBuilder) {
|
||||||
|
this.restBuilder = restBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
public void createUDC(CreateUDCRequestDTO createUDCRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createUDC(CreateUDCRequestDTO createUDCRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = restBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliAccettazioneRESTConsumerService.createUDC(createUDCRequestDTO)
|
colliAccettazioneRESTConsumerService.createUDC(createUDCRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Response<ServiceRESTResponse<CreateUDCResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Response<ServiceRESTResponse<CreateUDCResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "accettazione/createUDC", data -> onComplete.run(data.getMtbColt()), onFailed);
|
analyzeAnswer(response, "accettazione/createUDC", data -> onComplete.run(data.getMtbColt()), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -44,72 +52,89 @@ public class ColliAccettazioneRESTConsumer extends _BaseRESTConsumer implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeUDC(CloseUDCRequestDTO closeUDCRequestDTO, RunnableArgs<CloseUDCResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
public void closeUDC(CloseUDCRequestDTO closeUDCRequestDTO, RunnableArgs<CloseUDCResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = restBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliAccettazioneRESTConsumerService.closeUDC(closeUDCRequestDTO)
|
colliAccettazioneRESTConsumerService.closeUDC(closeUDCRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Response<ServiceRESTResponse<CloseUDCResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Response<ServiceRESTResponse<CloseUDCResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "accettazione/closeUDC", onComplete, onFailed);
|
analyzeAnswer(response, "accettazione/closeUDC", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void insertUDCRow(InsertUDCRowRequestDTO insertUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
public void insertUDCRow(InsertUDCRowRequestDTO insertUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = restBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliAccettazioneRESTConsumerService.insertUDCRow(insertUDCRowRequestDTO)
|
colliAccettazioneRESTConsumerService.insertUDCRow(insertUDCRowRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDCRowResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDCRowResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "accettazione/insertUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
analyzeAnswer(response, "accettazione/insertUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void editUDCRow(EditUDCRowRequestDTO editUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
public void editUDCRow(EditUDCRowRequestDTO editUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = restBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliAccettazioneRESTConsumerService.editUDCRow(editUDCRowRequestDTO)
|
colliAccettazioneRESTConsumerService.editUDCRow(editUDCRowRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDCRowResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDCRowResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "accettazione/editUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
analyzeAnswer(response, "accettazione/editUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteUDCRow(DeleteUDCRowRequestDTO deleteUDCRowRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void deleteUDCRow(DeleteUDCRowRequestDTO deleteUDCRowRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = restBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliAccettazioneRESTConsumerService.deleteUDCRow(deleteUDCRowRequestDTO)
|
colliAccettazioneRESTConsumerService.deleteUDCRow(deleteUDCRowRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
analyzeAnswer(response, "accettazione/deleteUDCRow", data -> onComplete.run(), onFailed);
|
analyzeAnswer(response, "accettazione/deleteUDCRow", data -> onComplete.run(), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
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 it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowResponseDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.http.Body;
|
import retrofit2.http.Body;
|
||||||
|
import retrofit2.http.GET;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
public interface ColliAccettazioneRESTConsumerService {
|
public interface ColliAccettazioneRESTConsumerService {
|
||||||
|
|
||||||
@@ -31,4 +33,7 @@ public interface ColliAccettazioneRESTConsumerService {
|
|||||||
@POST("wms/accettazione/deleteUDCRow")
|
@POST("wms/accettazione/deleteUDCRow")
|
||||||
Call<ServiceRESTResponse<Void>> deleteUDCRow(@Body DeleteUDCRowRequestDTO deleteUDCRowRequestDTO);
|
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;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
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.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliCaricoRESTConsumerInterface;
|
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliCaricoRESTConsumerInterface;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliScaricoRESTConsumerInterface;
|
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.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCResponseDTO;
|
||||||
@@ -34,104 +37,105 @@ import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements ColliCaricoRESTConsumerInterface, ColliScaricoRESTConsumerInterface {
|
public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements ColliCaricoRESTConsumerInterface, ColliScaricoRESTConsumerInterface {
|
||||||
|
|
||||||
|
|
||||||
|
private final RESTBuilder restBuilder;
|
||||||
private final SettingsManager settingsManager;
|
private final SettingsManager settingsManager;
|
||||||
|
|
||||||
public ColliLavorazioneRESTConsumer(SettingsManager settingsManager) {
|
public ColliLavorazioneRESTConsumer(RESTBuilder restBuilder, SettingsManager settingsManager) {
|
||||||
|
this.restBuilder = restBuilder;
|
||||||
this.settingsManager = settingsManager;
|
this.settingsManager = settingsManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createUDC(CreateUDCRequestDTO createUDCRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createUDC(CreateUDCRequestDTO createUDCRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliLavorazioneRESTConsumerService.createUDC(createUDCRequestDTO)
|
colliLavorazioneRESTConsumerService.createUDC(createUDCRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Response<ServiceRESTResponse<CreateUDCResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Response<ServiceRESTResponse<CreateUDCResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "lavorazione/createUDC", data -> onComplete.run(data.getMtbColt()), onFailed);
|
analyzeAnswer(response, "lavorazione/createUDC", data -> onComplete.run(data.getMtbColt()), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeUDC(CloseUDCRequestDTO closeUDCRequestDTO, RunnableArgs<CloseUDCResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
public void closeUDC(CloseUDCRequestDTO closeUDCRequestDTO, RunnableArgs<CloseUDCResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliLavorazioneRESTConsumerService.closeUDC(closeUDCRequestDTO)
|
colliLavorazioneRESTConsumerService.closeUDC(closeUDCRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Response<ServiceRESTResponse<CloseUDCResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Response<ServiceRESTResponse<CloseUDCResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "lavorazione/closeUDC", onComplete, onFailed);
|
analyzeAnswer(response, "lavorazione/closeUDC", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void insertUDCRow(InsertUDCRowRequestDTO insertUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
public void insertUDCRow(InsertUDCRowRequestDTO insertUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliLavorazioneRESTConsumerService.insertUDCRow(insertUDCRowRequestDTO)
|
colliLavorazioneRESTConsumerService.insertUDCRow(insertUDCRowRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDCRowResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDCRowResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "lavorazione/insertUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
analyzeAnswer(response, "lavorazione/insertUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void editUDCRow(EditUDCRowRequestDTO editUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
public void editUDCRow(EditUDCRowRequestDTO editUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliLavorazioneRESTConsumerService.editUDCRow(editUDCRowRequestDTO)
|
colliLavorazioneRESTConsumerService.editUDCRow(editUDCRowRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDCRowResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDCRowResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "lavorazione/editUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
analyzeAnswer(response, "lavorazione/editUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createUDS(CreateUDSRequestDTO createUDSRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createUDS(CreateUDSRequestDTO createUDSRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliLavorazioneRESTConsumerService.createUDS(createUDSRequestDTO)
|
colliLavorazioneRESTConsumerService.createUDS(createUDSRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Response<ServiceRESTResponse<CreateUDSResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Response<ServiceRESTResponse<CreateUDSResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "lavorazione/createUDS", data -> onComplete.run(data.getMtbColt()), onFailed);
|
analyzeAnswer(response, "lavorazione/createUDS", data -> onComplete.run(data.getMtbColt()), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -139,89 +143,89 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeUDS(CloseUDSRequestDTO closeUDSRequestDTO, RunnableArgs<CloseUDSResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
public void closeUDS(CloseUDSRequestDTO closeUDSRequestDTO, RunnableArgs<CloseUDSResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliLavorazioneRESTConsumerService.closeUDS(closeUDSRequestDTO)
|
colliLavorazioneRESTConsumerService.closeUDS(closeUDSRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Response<ServiceRESTResponse<CloseUDSResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Response<ServiceRESTResponse<CloseUDSResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "lavorazione/closeUDS", onComplete, onFailed);
|
analyzeAnswer(response, "lavorazione/closeUDS", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void insertUDSRow(InsertUDSRowRequestDTO insertUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
public void insertUDSRow(InsertUDSRowRequestDTO insertUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliLavorazioneRESTConsumerService.insertUDSRow(insertUDSRowRequestDTO)
|
colliLavorazioneRESTConsumerService.insertUDSRow(insertUDSRowRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDSRowResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDSRowResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "lavorazione/insertUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
analyzeAnswer(response, "lavorazione/insertUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void editUDSRow(EditUDSRowRequestDTO editUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
public void editUDSRow(EditUDSRowRequestDTO editUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliLavorazioneRESTConsumerService.editUDSRow(editUDSRowRequestDTO)
|
colliLavorazioneRESTConsumerService.editUDSRow(editUDSRowRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDSRowResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDSRowResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "lavorazione/editUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
analyzeAnswer(response, "lavorazione/editUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteUDSRow(DeleteUDSRowRequestDTO deleteUDSRowRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void deleteUDSRow(DeleteUDSRowRequestDTO deleteUDSRowRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliLavorazioneRESTConsumerService.deleteUDSRow(deleteUDSRowRequestDTO)
|
colliLavorazioneRESTConsumerService.deleteUDSRow(deleteUDSRowRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
analyzeAnswer(response, "lavorazione/deleteUDSRow", data -> onComplete.run(), onFailed);
|
analyzeAnswer(response, "lavorazione/deleteUDSRow", data -> onComplete.run(), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteUDCRow(DeleteUDCRowRequestDTO deleteUDCRowRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void deleteUDCRow(DeleteUDCRowRequestDTO deleteUDCRowRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliLavorazioneRESTConsumerService.deleteUDCRow(deleteUDCRowRequestDTO)
|
colliLavorazioneRESTConsumerService.deleteUDCRow(deleteUDCRowRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
analyzeAnswer(response, "lavorazione/deleteUDCRow", data -> onComplete.run(), onFailed);
|
analyzeAnswer(response, "lavorazione/deleteUDCRow", data -> onComplete.run(), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -249,18 +253,18 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
|
|||||||
createUDSFromArtRequestDTO
|
createUDSFromArtRequestDTO
|
||||||
.setCodJfas(posizione.getPosizione());
|
.setCodJfas(posizione.getPosizione());
|
||||||
}
|
}
|
||||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = restBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliLavorazioneRESTConsumerService.createUDSFromArt(createUDSFromArtRequestDTO)
|
colliLavorazioneRESTConsumerService.createUDSFromArt(createUDSFromArtRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
analyzeAnswer(response, "lavorazione/createUDSFromArt", data -> onComplete.run(), onFailed);
|
analyzeAnswer(response, "lavorazione/createUDSFromArt", data -> onComplete.run(), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
|
||||||
import com.annimon.stream.Optional;
|
import com.annimon.stream.Optional;
|
||||||
@@ -11,9 +12,12 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
@@ -28,9 +32,13 @@ import it.integry.integrywmsnative.core.model.MtbColt;
|
|||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.RettificaULDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
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.VersamentoAutomaticoULResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.CanULBeDeletedRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.CanULBeDeletedRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
|
||||||
@@ -42,21 +50,22 @@ import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
private final RESTBuilder restBuilder;
|
||||||
private final SystemRESTConsumer mSystemRESTConsumer;
|
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||||
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||||
private final EntityRESTConsumer mEntityRESTConsumer;
|
private final EntityRESTConsumer mEntityRESTConsumer;
|
||||||
private final SettingsManager mSettingsManager;
|
private final SettingsManager mSettingsManager;
|
||||||
|
|
||||||
public ColliMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer,
|
public ColliMagazzinoRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer,
|
||||||
ArticoloRESTConsumer articoloRESTConsumer,
|
ArticoloRESTConsumer articoloRESTConsumer,
|
||||||
EntityRESTConsumer entityRESTConsumer,
|
EntityRESTConsumer entityRESTConsumer,
|
||||||
SettingsManager settingsManager) {
|
SettingsManager settingsManager) {
|
||||||
|
this.restBuilder = restBuilder;
|
||||||
this.mSystemRESTConsumer = systemRESTConsumer;
|
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||||
this.mEntityRESTConsumer = entityRESTConsumer;
|
this.mEntityRESTConsumer = entityRESTConsumer;
|
||||||
@@ -78,7 +87,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.setMtbPartitaMag(null));
|
.setMtbPartitaMag(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mEntityRESTConsumer.processEntity(mtbColtToSaveClone, new ISimpleOperationCallback<MtbColt>() {
|
this.mEntityRESTConsumer.processEntity(mtbColtToSaveClone, new ISimpleOperationCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColt value) {
|
public void onSuccess(MtbColt value) {
|
||||||
if (onComplete != null) onComplete.run(value);
|
if (onComplete != null) onComplete.run(value);
|
||||||
@@ -280,13 +289,13 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getBySSCC(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getBySSCC(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new Callback<>() {
|
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||||
analyzeAnswer(response, "GetBySSCC", mtbColt -> {
|
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<>();
|
List<MtbColt> mtbColtList = new ArrayList<>();
|
||||||
mtbColtList.add(mtbColt);
|
mtbColtList.add(mtbColt);
|
||||||
fillMtbAartsOfMtbColts(mtbColtList, mtbColts -> onComplete.run(mtbColts.get(0)), onFailed);
|
fillMtbAartsOfMtbColts(mtbColtList, mtbColts -> onComplete.run(mtbColts.get(0)), onFailed);
|
||||||
@@ -298,40 +307,69 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fillMtbAartsOfMtbColts(List<MtbColt> mtbColts, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void fillMtbAartsOfMtbColrs(List<MtbColr> mtbColrs, RunnableArgs<List<MtbColr>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
fillMtbAartsOfMtbColtsStatic(mtbColts, onComplete, onFailed);
|
|
||||||
|
List<String> codMarts = new ArrayList<>(mtbColrs.stream()
|
||||||
|
.map(MtbColr::getCodMart)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toUnmodifiableList()));
|
||||||
|
|
||||||
|
mArticoloRESTConsumer.getByCodMarts(codMarts, arts -> {
|
||||||
|
|
||||||
|
if (arts != null && !arts.isEmpty()) {
|
||||||
|
for (MtbColr mtbColr : mtbColrs) {
|
||||||
|
|
||||||
|
MtbAart foundMtbAart = null;
|
||||||
|
|
||||||
|
List<MtbAart> mtbAartStream = arts.stream()
|
||||||
|
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
if (!mtbAartStream.isEmpty()) {
|
||||||
|
foundMtbAart = mtbAartStream.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
mtbColr.setMtbAart(foundMtbAart);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onComplete.run(mtbColrs);
|
||||||
|
}, onFailed);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void fillMtbAartsOfMtbColtsStatic(List<MtbColt> mtbColts, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void fillMtbAartsOfMtbColts(List<MtbColt> mtbColts, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
List<String> codMarts = new ArrayList<>();
|
List<String> codMarts = new ArrayList<>();
|
||||||
|
|
||||||
for (MtbColt mtbColt : mtbColts) {
|
for (MtbColt mtbColt : mtbColts) {
|
||||||
codMarts.addAll(Stream.of(mtbColt.getMtbColr())
|
codMarts.addAll(mtbColt.getMtbColr().stream()
|
||||||
.map(MtbColr::getCodMart)
|
.map(MtbColr::getCodMart)
|
||||||
.withoutNulls()
|
.filter(Objects::nonNull)
|
||||||
.distinct()
|
.distinct()
|
||||||
.toList());
|
.collect(Collectors.toUnmodifiableList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ArticoloRESTConsumer.getByCodMartsStatic(codMarts, arts -> {
|
mArticoloRESTConsumer.getByCodMarts(codMarts, arts -> {
|
||||||
|
|
||||||
if (arts != null && arts.size() > 0) {
|
if (arts != null && !arts.isEmpty()) {
|
||||||
for (MtbColt mtbColt : mtbColts) {
|
for (MtbColt mtbColt : mtbColts) {
|
||||||
for (MtbColr mtbColr : mtbColt.getMtbColr()) {
|
for (MtbColr mtbColr : mtbColt.getMtbColr()) {
|
||||||
|
|
||||||
MtbAart foundMtbAart = null;
|
MtbAart foundMtbAart = null;
|
||||||
|
|
||||||
List<MtbAart> mtbAartStream = Stream.of(arts)
|
List<MtbAart> mtbAartStream = arts.stream()
|
||||||
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart())).toList();
|
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
if (mtbAartStream != null && mtbAartStream.size() > 0) {
|
if (!mtbAartStream.isEmpty()) {
|
||||||
foundMtbAart = mtbAartStream.get(0);
|
foundMtbAart = mtbAartStream.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,35 +418,32 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
testata.setMtbColr(new ObservableArrayList<>());
|
testata.setMtbColr(new ObservableArrayList<>());
|
||||||
|
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
colliMagazzinoRESTConsumerService.getColloInGiac(onlyResiduo, throwExcIfNull, testata).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
|
colliMagazzinoRESTConsumerService.getColloInGiac(onlyResiduo, throwExcIfNull, testata)
|
||||||
@Override
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
@Override
|
||||||
analyzeAnswer(response, "getColloInGiac", mtbColt -> {
|
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) {
|
if (mtbColt != null && mtbColt.getMtbColr() != null && !mtbColt.getMtbColr().isEmpty()) {
|
||||||
List<MtbColt> mtbColtList = new ArrayList<>();
|
List<MtbColt> mtbColtList = new ArrayList<>();
|
||||||
mtbColtList.add(mtbColt);
|
mtbColtList.add(mtbColt);
|
||||||
fillMtbAartsOfMtbColts(mtbColtList, mtbColts -> onComplete.run(mtbColts.get(0)), onFailed);
|
fillMtbAartsOfMtbColts(mtbColtList, mtbColts -> onComplete.run(mtbColts.get(0)), onFailed);
|
||||||
} else {
|
} else {
|
||||||
onComplete.run(mtbColt);
|
onComplete.run(mtbColt);
|
||||||
|
}
|
||||||
|
|
||||||
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
}, onFailed);
|
@Override
|
||||||
}
|
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, @NonNull final Exception e) {
|
||||||
|
onFailed.run(e);
|
||||||
@Override
|
}
|
||||||
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
|
});
|
||||||
onFailed.run(new Exception(t));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void changePosizione(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void spostaUL(MtbColt mtbColtToMove, String codMdep, String posizione, boolean createDocAutomatically, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
String codMdep = posizione.getCodMdep();
|
|
||||||
String posizioneString = posizione.getPosizione();
|
|
||||||
|
|
||||||
MtbColt mtbColtToMoveClone = (MtbColt) mtbColtToMove.clone();
|
MtbColt mtbColtToMoveClone = (MtbColt) mtbColtToMove.clone();
|
||||||
|
|
||||||
for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) {
|
for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) {
|
||||||
@@ -417,26 +452,66 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.setMtbPartitaMag(null);
|
.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
|
colliMagazzinoRESTConsumerService
|
||||||
.spostaULInPosizione(codMdep,
|
.spostaUL(spostaUlRequestDTO)
|
||||||
posizioneString,
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
mtbColtToMoveClone)
|
|
||||||
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
analyzeAnswer(response, "changePosizione", mtbColts -> {
|
analyzeAnswer(response, "spostaUL", mtbColts -> {
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||||
if (onFailed != null) onFailed.run(new Exception(t));
|
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) {
|
public void updateDataFine(MtbColt mtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
MtbColt cloneMtbColt = (MtbColt) mtbColt.clone();
|
MtbColt cloneMtbColt = (MtbColt) mtbColt.clone();
|
||||||
@@ -453,19 +528,19 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void retrieveBasketColli(RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void retrieveBasketColli(RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
colliMagazzinoRESTConsumerService.getColliInBasket(SettingsManager.i().getUserSession().getDepo().getCodMdep()).enqueue(new Callback<ServiceRESTResponse<List<MtbColt>>>() {
|
colliMagazzinoRESTConsumerService.getColliInBasket(SettingsManager.i().getUserSession().getDepo().getCodMdep()).enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<MtbColt>>> call, Response<ServiceRESTResponse<List<MtbColt>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<MtbColt>>> call, Response<ServiceRESTResponse<List<MtbColt>>> response) {
|
||||||
analyzeAnswer(response, "getColliInBasket", mtbColts -> {
|
analyzeAnswer(response, "getColliInBasket", mtbColts -> {
|
||||||
fillMtbAartsOfMtbColtsStatic(mtbColts, onComplete, onFailed);
|
fillMtbAartsOfMtbColts(mtbColts, onComplete, onFailed);
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<MtbColt>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<MtbColt>>> call, @NonNull final Exception e) {
|
||||||
if (onFailed != null) onFailed.run(new Exception(t));
|
if (onFailed != null) onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -480,24 +555,24 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.setNewNumCnf(newNumCnf)
|
.setNewNumCnf(newNumCnf)
|
||||||
.setNewQtaCol(newQtaTot);
|
.setNewQtaCol(newQtaTot);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
colliMagazzinoRESTConsumerService.creaRettificaCollo(
|
colliMagazzinoRESTConsumerService.creaRettificaCollo(
|
||||||
SettingsManager.i().getUserSession().getDepo().getCodMdep(),
|
SettingsManager.i().getUserSession().getDepo().getCodMdep(),
|
||||||
rettificaULDTO
|
rettificaULDTO
|
||||||
).enqueue(new Callback<>() {
|
).enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<MtbColr>> call, Response<ServiceRESTResponse<MtbColr>> response) {
|
public void onResponse(Call<ServiceRESTResponse<MtbColr>> call, Response<ServiceRESTResponse<MtbColr>> response) {
|
||||||
analyzeAnswer(response, "creaRettificaCollo", onComplete, onFailed);
|
analyzeAnswer(response, "creaRettificaCollo", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<MtbColr>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<MtbColr>> call, @NonNull final Exception e) {
|
||||||
if (onFailed != null) onFailed.run(new Exception(t));
|
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(() -> {
|
new Thread(() -> {
|
||||||
MtbColt mtbColtToMoveClone = (MtbColt) sourceMtbColt.clone();
|
MtbColt mtbColtToMoveClone = (MtbColt) sourceMtbColt.clone();
|
||||||
MtbColt mtbColtDestClone = (MtbColt) destMtbColt.clone();
|
MtbColt mtbColtDestClone = (MtbColt) destMtbColt.clone();
|
||||||
@@ -512,20 +587,23 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO = new SpostaArtsTraULRequestDTO()
|
SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO = new SpostaArtsTraULRequestDTO()
|
||||||
.setSourceMtbColt(mtbColtToMoveClone)
|
.setSourceMtbColt(mtbColtToMoveClone)
|
||||||
.setDestinationMtbColt(mtbColtDestClone);
|
.setDestinationMtbColt(mtbColtDestClone)
|
||||||
|
.setFlagForceUseRefs(flagForceUseRefs);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
colliMagazzinoRESTConsumerService.spostaArtsTraUL(spostaArtsTraULRequestDTO).enqueue(new Callback<>() {
|
colliMagazzinoRESTConsumerService.spostaArtsTraUL(spostaArtsTraULRequestDTO).enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@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 -> {
|
analyzeAnswer(response, "spostaArtsTraUL", data -> {
|
||||||
onComplete.run();
|
|
||||||
|
fillMtbAartsOfMtbColrs(data.getGeneratedMtbColr(), onComplete, onFailed);
|
||||||
|
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<SpostaArtsTraULResponseDTO>> call, @NonNull final Exception e) {
|
||||||
if (onFailed != null) onFailed.run(new Exception(t));
|
if (onFailed != null) onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}).start();
|
}).start();
|
||||||
@@ -540,8 +618,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.setMtbPartitaMag(null);
|
.setMtbPartitaMag(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
colliMagazzinoRESTConsumerService.assegnaLottoSuColloScarico(sourceMtbColtClone).enqueue(new Callback<>() {
|
colliMagazzinoRESTConsumerService.assegnaLottoSuColloScarico(sourceMtbColtClone).enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||||
analyzeAnswer(response, "assegnaLottoSuColloScarico", data -> {
|
analyzeAnswer(response, "assegnaLottoSuColloScarico", data -> {
|
||||||
@@ -550,8 +628,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, @NonNull final Exception e) {
|
||||||
if (onFailed != null) onFailed.run(new Exception(t));
|
if (onFailed != null) onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -565,8 +643,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.setMtbPartitaMag(null);
|
.setMtbPartitaMag(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
colliMagazzinoRESTConsumerService.versamentoAutomaticoUL(sourceMtbColtClone).enqueue(new Callback<>() {
|
colliMagazzinoRESTConsumerService.versamentoAutomaticoUL(sourceMtbColtClone).enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> call, Response<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> call, Response<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "versamentoAutomaticoUL", data -> {
|
analyzeAnswer(response, "versamentoAutomaticoUL", data -> {
|
||||||
@@ -603,8 +681,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> call, @NonNull final Exception e) {
|
||||||
if (onFailed != null) onFailed.run(new Exception(t));
|
if (onFailed != null) onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -613,8 +691,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
MtbColt sourceMtbColtClone = (MtbColt) sourceMtbColt.clone();
|
MtbColt sourceMtbColtClone = (MtbColt) sourceMtbColt.clone();
|
||||||
sourceMtbColtClone.setMtbColr(new ObservableArrayList<>());
|
sourceMtbColtClone.setMtbColr(new ObservableArrayList<>());
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
colliMagazzinoRESTConsumerService.confirmGiacenzaUL(sourceMtbColtClone).enqueue(new Callback<>() {
|
colliMagazzinoRESTConsumerService.confirmGiacenzaUL(sourceMtbColtClone).enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
analyzeAnswer(response, "confirmGiacenzaUL", data -> {
|
analyzeAnswer(response, "confirmGiacenzaUL", data -> {
|
||||||
@@ -624,8 +702,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, @NonNull final Exception e) {
|
||||||
if (onFailed != null) onFailed.run(new Exception(t));
|
if (onFailed != null) onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -661,36 +739,36 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
CanULBeDeletedRequestDTO canULBeDeletedRequestDTO = new CanULBeDeletedRequestDTO()
|
CanULBeDeletedRequestDTO canULBeDeletedRequestDTO = new CanULBeDeletedRequestDTO()
|
||||||
.setMtbColt(mtbColt);
|
.setMtbColt(mtbColt);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
|
|
||||||
colliMagazzinoRESTConsumerService.canULBeDeleted(canULBeDeletedRequestDTO)
|
colliMagazzinoRESTConsumerService.canULBeDeleted(canULBeDeletedRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Boolean>> call, Response<ServiceRESTResponse<Boolean>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Boolean>> call, Response<ServiceRESTResponse<Boolean>> response) {
|
||||||
analyzeAnswer(response, "generic/canULBeDeleted", onComplete, onFailed);
|
analyzeAnswer(response, "generic/canULBeDeleted", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteUL(DeleteULRequestDTO deleteULRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
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)
|
colliMagazzinoRESTConsumerService.deleteUL(deleteULRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
analyzeAnswer(response, "generic/deleteUL", Void -> onComplete.run(), onFailed);
|
analyzeAnswer(response, "generic/deleteUL", Void -> onComplete.run(), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -702,18 +780,18 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
|
|
||||||
colliMagazzinoRESTConsumerService.printUL(printULRequestDTO)
|
colliMagazzinoRESTConsumerService.printUL(printULRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
analyzeAnswer(response, "generic/printUL", Void -> onComplete.run(), onFailed);
|
analyzeAnswer(response, "generic/printUL", Void -> onComplete.run(), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
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.RettificaULDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
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.VersamentoAutomaticoULResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.CanULBeDeletedRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.CanULBeDeletedRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
|
||||||
@@ -31,11 +34,14 @@ public interface ColliMagazzinoRESTConsumerService {
|
|||||||
@POST("creaRettificaCollo")
|
@POST("creaRettificaCollo")
|
||||||
Call<ServiceRESTResponse<MtbColr>> creaRettificaCollo(@Query("codMdep") String codMdep, @Body RettificaULDTO rettificaULDTO);
|
Call<ServiceRESTResponse<MtbColr>> creaRettificaCollo(@Query("codMdep") String codMdep, @Body RettificaULDTO rettificaULDTO);
|
||||||
|
|
||||||
@POST("wms/spostaULInPosizione")
|
@POST("wms/updateTipoUL")
|
||||||
Call<ServiceRESTResponse<Object>> spostaULInPosizione(@Query("codMdep") String codMdep, @Query("posizione") String posizione, @Body MtbColt mtbColtToMove);
|
Call<ServiceRESTResponse<Void>> updateTipoUL(@Body UpdateTipoULRequestDTO requestDto);
|
||||||
|
|
||||||
|
@POST("wms/spostaUL")
|
||||||
|
Call<ServiceRESTResponse<Void>> spostaUL(@Body SpostaULRequestDTO requestDto);
|
||||||
|
|
||||||
@POST("wms/spostaArtsTraUL")
|
@POST("wms/spostaArtsTraUL")
|
||||||
Call<ServiceRESTResponse<Object>> spostaArtsTraUL(@Body SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO);
|
Call<ServiceRESTResponse<SpostaArtsTraULResponseDTO>> spostaArtsTraUL(@Body SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO);
|
||||||
|
|
||||||
@POST("wms/assegnaLottoSuColloScarico")
|
@POST("wms/assegnaLottoSuColloScarico")
|
||||||
Call<ServiceRESTResponse<MtbColt>> assegnaLottoSuColloScarico(@Body MtbColt mtbColt);
|
Call<ServiceRESTResponse<MtbColt>> assegnaLottoSuColloScarico(@Body MtbColt mtbColt);
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
@@ -7,110 +9,134 @@ import it.integry.integrywmsnative.core.model.MtbColr;
|
|||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliScaricoRESTConsumerInterface;
|
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.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
|
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.CloseUDSResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
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.CreateUDSResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
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.EditUDSRowRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
|
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.InsertUDSRowRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class ColliSpedizioneRESTConsumer extends _BaseRESTConsumer implements ColliScaricoRESTConsumerInterface {
|
public class ColliSpedizioneRESTConsumer extends _BaseRESTConsumer implements ColliScaricoRESTConsumerInterface {
|
||||||
|
|
||||||
|
private final RESTBuilder restBuilder;
|
||||||
|
|
||||||
|
public ColliSpedizioneRESTConsumer(RESTBuilder restBuilder) {
|
||||||
|
this.restBuilder = restBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
public void createUDS(CreateUDSRequestDTO createUDSRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createUDS(CreateUDSRequestDTO createUDSRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
|
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = restBuilder.getService(ColliSpedizioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliSpedizioneRESTConsumerService.createUDS(createUDSRequestDTO)
|
colliSpedizioneRESTConsumerService.createUDS(createUDSRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Response<ServiceRESTResponse<CreateUDSResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Response<ServiceRESTResponse<CreateUDSResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "spedizione/createUDS", data -> onComplete.run(data.getMtbColt()), onFailed);
|
analyzeAnswer(response, "spedizione/createUDS", data -> onComplete.run(data.getMtbColt()), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void closeUDS(CloseUDSRequestDTO closeUDSRequestDTO, RunnableArgs<CloseUDSResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
public void closeUDS(CloseUDSRequestDTO closeUDSRequestDTO, RunnableArgs<CloseUDSResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
|
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = restBuilder.getService(ColliSpedizioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliSpedizioneRESTConsumerService.closeUDS(closeUDSRequestDTO)
|
colliSpedizioneRESTConsumerService.closeUDS(closeUDSRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Response<ServiceRESTResponse<CloseUDSResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Response<ServiceRESTResponse<CloseUDSResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "spedizione/closeUDS", onComplete, onFailed);
|
analyzeAnswer(response, "spedizione/closeUDS", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void insertUDSRow(InsertUDSRowRequestDTO insertUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
public void insertUDSRow(InsertUDSRowRequestDTO insertUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
|
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = restBuilder.getService(ColliSpedizioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliSpedizioneRESTConsumerService.insertUDSRow(insertUDSRowRequestDTO)
|
colliSpedizioneRESTConsumerService.insertUDSRow(insertUDSRowRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDSRowResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDSRowResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "spedizione/insertUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
analyzeAnswer(response, "spedizione/insertUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void editUDSRow(EditUDSRowRequestDTO editUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
public void editUDSRow(EditUDSRowRequestDTO editUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
|
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = restBuilder.getService(ColliSpedizioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliSpedizioneRESTConsumerService.editUDSRow(editUDSRowRequestDTO)
|
colliSpedizioneRESTConsumerService.editUDSRow(editUDSRowRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDSRowResponseDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDSRowResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "spedizione/editUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
analyzeAnswer(response, "spedizione/editUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteUDSRow(DeleteUDSRowRequestDTO deleteUDSRowRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void deleteUDSRow(DeleteUDSRowRequestDTO deleteUDSRowRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
|
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = restBuilder.getService(ColliSpedizioneRESTConsumerService.class);
|
||||||
|
|
||||||
colliSpedizioneRESTConsumerService.deleteUDSRow(deleteUDSRowRequestDTO)
|
colliSpedizioneRESTConsumerService.deleteUDSRow(deleteUDSRowRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
analyzeAnswer(response, "spedizione/deleteUDSRow", data -> onComplete.run(), onFailed);
|
analyzeAnswer(response, "spedizione/deleteUDSRow", data -> onComplete.run(), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
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.CreateUDSRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
|
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.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.EditUDSRowRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
|
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.InsertUDSRowRequestDTO;
|
||||||
@@ -35,4 +37,7 @@ public interface ColliSpedizioneRESTConsumerService {
|
|||||||
@POST("wms/spedizione/deleteUDSRow")
|
@POST("wms/spedizione/deleteUDSRow")
|
||||||
Call<ServiceRESTResponse<Void>> deleteUDSRow(@Body DeleteUDSRowRequestDTO deleteUDSRowRequestDTO);
|
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;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
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) {
|
public void getJtbComts(List<String> itemsToFind, RunnableArgs<List<JtbComt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
var whereCondMap = Stream.of(itemsToFind)
|
var whereCondMap = itemsToFind.stream()
|
||||||
.withoutNulls()
|
|
||||||
.filter(x -> !UtilityString.isNullOrEmpty(x))
|
.filter(x -> !UtilityString.isNullOrEmpty(x))
|
||||||
.map(x -> {
|
.map(x -> {
|
||||||
HashMap<String, Object> vars = new HashMap<>();
|
HashMap<String, Object> codJcom = new HashMap<>() {{
|
||||||
vars.put("cod_jcom", x);
|
put("cod_jcom", x);
|
||||||
return vars;
|
}};
|
||||||
|
return codJcom;
|
||||||
})
|
})
|
||||||
.toList();
|
.collect(Collectors.toUnmodifiableList());
|
||||||
|
|
||||||
if(whereCondMap.isEmpty()) {
|
if(whereCondMap.isEmpty()) {
|
||||||
onComplete.run(new ArrayList<>());
|
onComplete.run(new ArrayList<>());
|
||||||
|
|||||||
@@ -9,62 +9,80 @@ import javax.inject.Singleton;
|
|||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.DtbDoct;
|
import it.integry.integrywmsnative.core.model.DtbDoct;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.LoadColliDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.documento.RetrieveDocumentoArtsResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.documento.RetrieveDocumentoArtsResponseDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class DocumentRESTConsumer extends _BaseRESTConsumer {
|
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) {
|
public void createDocsFromColli(List<LoadColliDTO> listColli, RunnableArgs<List<DtbDoct>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
DocumentiRESTConsumerService documentiRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
DocumentiRESTConsumerService documentiRESTConsumerService = restBuilder.getService(DocumentiRESTConsumerService.class);
|
||||||
documentiRESTConsumerService.createDocsFromColli(listColli).enqueue(new Callback<>() {
|
documentiRESTConsumerService.createDocsFromColli(listColli).enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<DtbDoct>>> call, Response<ServiceRESTResponse<List<DtbDoct>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<DtbDoct>>> call, Response<ServiceRESTResponse<List<DtbDoct>>> response) {
|
||||||
analyzeAnswer(response, "createDocsFromColli", onComplete, onFailed);
|
analyzeAnswer(response, "createDocsFromColli", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<DtbDoct>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<DtbDoct>>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createDocFromColli(LoadColliDTO loadColliDTO, RunnableArgs<DtbDoct> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createDocFromColli(LoadColliDTO loadColliDTO, RunnableArgs<DtbDoct> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
DocumentiRESTConsumerService documentiRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
DocumentiRESTConsumerService documentiRESTConsumerService = restBuilder.getService(DocumentiRESTConsumerService.class);
|
||||||
documentiRESTConsumerService.createDocFromColli(loadColliDTO).enqueue(new Callback<>() {
|
documentiRESTConsumerService.createDocFromColli(loadColliDTO).enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<DtbDoct>> call, Response<ServiceRESTResponse<DtbDoct>> response) {
|
public void onResponse(Call<ServiceRESTResponse<DtbDoct>> call, Response<ServiceRESTResponse<DtbDoct>> response) {
|
||||||
analyzeAnswer(response, "createDocFromColli", onComplete, onFailed);
|
analyzeAnswer(response, "createDocFromColli", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<DtbDoct>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<DtbDoct>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
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) {
|
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)
|
inventarioRESTConsumerService.retrieveArts(codDtip, codMgrp, codAnagForn)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> response) {
|
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "loadDocumentoArts", onComplete, onFailed);
|
analyzeAnswer(response, "loadDocumentoArts", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> call, @NonNull Throwable t) {
|
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,8 +20,12 @@ public interface DocumentiRESTConsumerService {
|
|||||||
@POST("createDocFromColli")
|
@POST("createDocFromColli")
|
||||||
Call<ServiceRESTResponse<DtbDoct>> createDocFromColli(@Body LoadColliDTO listColli);
|
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")
|
@GET("wms/documento/arts")
|
||||||
Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> retrieveArts(
|
Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> retrieveArts(
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
@@ -13,16 +15,21 @@ import javax.inject.Singleton;
|
|||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.EntityBase;
|
import it.integry.integrywmsnative.core.model.EntityBase;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.EsitoType;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityGson;
|
import it.integry.integrywmsnative.core.utility.UtilityGson;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class EntityRESTConsumer extends _BaseRESTConsumer {
|
public class EntityRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
private final RESTBuilder restBuilder;
|
||||||
|
|
||||||
|
public EntityRESTConsumer(RESTBuilder restBuilder) {
|
||||||
|
this.restBuilder = restBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
public <T extends EntityBase> void processEntity(T entityToSave, final ISimpleOperationCallback<T> callback, Class<T> type) {
|
public <T extends EntityBase> void processEntity(T entityToSave, final ISimpleOperationCallback<T> callback, Class<T> type) {
|
||||||
|
|
||||||
@@ -30,10 +37,10 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
|
|||||||
if (callback != null) callback.onFailed(ex);
|
if (callback != null) callback.onFailed(ex);
|
||||||
};
|
};
|
||||||
|
|
||||||
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
|
EntityRESTConsumerService service = restBuilder.getService(EntityRESTConsumerService.class);
|
||||||
service
|
service
|
||||||
.processEntity(entityToSave)
|
.processEntity(entityToSave)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
@@ -59,9 +66,8 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, @NonNull final Exception e) {
|
||||||
Log.e("EntityRESTConsumer", t.toString());
|
tmpFailed.run(e);
|
||||||
tmpFailed.run(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -74,9 +80,9 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
|
|||||||
if (onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
};
|
};
|
||||||
|
|
||||||
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
|
EntityRESTConsumerService service = restBuilder.getService(EntityRESTConsumerService.class);
|
||||||
Call<List<ServiceRESTResponse<JsonObject>>> request = service.processEntityList(singleTransaction, entitiesToSave);
|
Call<List<ServiceRESTResponse<JsonObject>>> request = service.processEntityList(singleTransaction, entitiesToSave);
|
||||||
request.enqueue(new Callback<>() {
|
request.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<List<ServiceRESTResponse<JsonObject>>> call, Response<List<ServiceRESTResponse<JsonObject>>> response) {
|
public void onResponse(Call<List<ServiceRESTResponse<JsonObject>>> call, Response<List<ServiceRESTResponse<JsonObject>>> response) {
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
@@ -112,9 +118,8 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<List<ServiceRESTResponse<JsonObject>>> call, Throwable t) {
|
public void onFailure(Call<List<ServiceRESTResponse<JsonObject>>> call, @NonNull final Exception e) {
|
||||||
Log.e("EntityRESTConsumer", t.toString());
|
tmpFailed.run(e);
|
||||||
tmpFailed.run(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -124,9 +129,9 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
public <T extends EntityBase> void selectEntity(T entityToSave, final ISimpleOperationCallback<List<T>> callback, Class type) {
|
public <T extends EntityBase> void selectEntity(T entityToSave, final ISimpleOperationCallback<List<T>> callback, Class type) {
|
||||||
|
|
||||||
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
|
EntityRESTConsumerService service = restBuilder.getService(EntityRESTConsumerService.class);
|
||||||
Call<ServiceRESTResponse<JsonObject>> request = service.processEntity(entityToSave);
|
Call<ServiceRESTResponse<JsonObject>> request = service.processEntity(entityToSave);
|
||||||
request.enqueue(new Callback<>() {
|
request.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
@@ -136,7 +141,7 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
|
|||||||
Gson gson = UtilityGson.createObject();
|
Gson gson = UtilityGson.createObject();
|
||||||
List<JsonObject> jsons = response.body().getEntityList();
|
List<JsonObject> jsons = response.body().getEntityList();
|
||||||
|
|
||||||
List<T> newList = new ArrayList<T>();
|
List<T> newList = new ArrayList<>();
|
||||||
|
|
||||||
if (jsons != null) {
|
if (jsons != null) {
|
||||||
for (int i = 0; i < jsons.size(); i++) {
|
for (int i = 0; i < jsons.size(); i++) {
|
||||||
@@ -163,9 +168,8 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, @NonNull final Exception e) {
|
||||||
Log.e("EntityRESTConsumer", t.toString());
|
callback.onFailed(e);
|
||||||
callback.onFailed(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
import android.util.Log;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -10,32 +10,35 @@ import javax.inject.Singleton;
|
|||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.StbGestSetup;
|
import it.integry.integrywmsnative.core.model.StbGestSetup;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.GestSetupDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.settings.StbGestSetupReader;
|
import it.integry.integrywmsnative.core.settings.StbGestSetupReader;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
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) {
|
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)
|
service.getGestSetupValue(gestName, sectionName, keySection)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<GestSetupDTO>> call, Response<ServiceRESTResponse<GestSetupDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<GestSetupDTO>> call, Response<ServiceRESTResponse<GestSetupDTO>> response) {
|
||||||
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
|
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, @NonNull final Exception e) {
|
||||||
Log.e("GestSetup", t.toString());
|
if (onFailed != null) onFailed.run(e);
|
||||||
// UtilityLogger.errorMe(new Exception(t));
|
|
||||||
if (onFailed != null) onFailed.run(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -51,18 +54,16 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
|
GestSetupRESTConsumerService service = restBuilder.getService(GestSetupRESTConsumerService.class);
|
||||||
service.getGestSetupValue(gestName, sectionName, keySection, codMdep).enqueue(new Callback<ServiceRESTResponse<GestSetupDTO>>() {
|
service.getGestSetupValue(gestName, sectionName, keySection, codMdep).enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<GestSetupDTO>> call, Response<ServiceRESTResponse<GestSetupDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<GestSetupDTO>> call, Response<ServiceRESTResponse<GestSetupDTO>> response) {
|
||||||
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
|
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, @NonNull final Exception e) {
|
||||||
Log.e("PrintCollo", t.toString());
|
if (onFailed != null) onFailed.run(e);
|
||||||
UtilityLogger.error(new Exception(t));
|
|
||||||
if (onFailed != null) onFailed.run(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -81,8 +82,8 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
|||||||
public void getValues(String codMdep, List<StbGestSetupReader> stbGestSetupList, RunnableArgs<List<StbGestSetupReader>> onComplete, RunnableArgs<Exception> onFailed) {
|
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());
|
var stbGestSetups = stbGestSetupList.stream().map(x -> (StbGestSetup) x).collect(Collectors.toList());
|
||||||
|
|
||||||
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
|
GestSetupRESTConsumerService service = restBuilder.getService(GestSetupRESTConsumerService.class);
|
||||||
service.getGestSetupValues(codMdep, stbGestSetups).enqueue(new Callback<>() {
|
service.getGestSetupValues(codMdep, stbGestSetups).enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Response<ServiceRESTResponse<List<StbGestSetup>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Response<ServiceRESTResponse<List<StbGestSetup>>> response) {
|
||||||
analyzeAnswer(response, "GestSetup", data -> {
|
analyzeAnswer(response, "GestSetup", data -> {
|
||||||
@@ -100,9 +101,8 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<StbGestSetup>>> call, @NonNull final Exception e) {
|
||||||
UtilityLogger.error(new Exception(t));
|
if (onFailed != null) onFailed.run(e);
|
||||||
if (onFailed != null) onFailed.run(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.annimon.stream.Optional;
|
import com.annimon.stream.Optional;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
@@ -13,30 +15,30 @@ import it.integry.integrywmsnative.core.model.MtbAart;
|
|||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationIncomingItemDto;
|
import it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationIncomingItemDto;
|
||||||
import it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationResponseDto;
|
import it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationResponseDto;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto.ArtsInGiacenzaDTO;
|
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto.ArtsInGiacenzaDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
private final SystemRESTConsumer mSystemRESTConsumer;
|
private final RESTBuilder restBuilder;
|
||||||
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||||
|
|
||||||
public GiacenzaRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
public GiacenzaRESTConsumer(RESTBuilder restBuilder, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||||
this.mSystemRESTConsumer = systemRESTConsumer;
|
this.restBuilder = restBuilder;
|
||||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getGiacenzeInPosizione(MtbDepoPosizione posizione, RunnableArgs<List<MvwSitArtUdcDetInventario>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getGiacenzeInPosizione(MtbDepoPosizione posizione, RunnableArgs<List<MvwSitArtUdcDetInventario>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
GiacenzaRESTConsumerService giacenzaRESTConsumerService = RESTBuilder.getService(GiacenzaRESTConsumerService.class);
|
GiacenzaRESTConsumerService giacenzaRESTConsumerService = restBuilder.getService(GiacenzaRESTConsumerService.class);
|
||||||
giacenzaRESTConsumerService.retrieveAvailableItems(posizione.getPosizione()).enqueue(new Callback<>() {
|
giacenzaRESTConsumerService.retrieveAvailableItems(posizione.getPosizione()).enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Response<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Response<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> response) {
|
||||||
analyzeAnswer(response, "getGiacenzeInPosizione", inventarioList -> {
|
analyzeAnswer(response, "getGiacenzeInPosizione", inventarioList -> {
|
||||||
@@ -70,15 +72,15 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getGiacenzeInPosizione(List<String> posizioni, boolean withTestataCollo, RunnableArgs<List<ArtsInGiacenzaDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getGiacenzeInPosizione(List<String> posizioni, boolean withTestataCollo, RunnableArgs<List<ArtsInGiacenzaDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
GiacenzaRESTConsumerService giacenzaRESTConsumerService = RESTBuilder.getService(GiacenzaRESTConsumerService.class);
|
GiacenzaRESTConsumerService giacenzaRESTConsumerService = restBuilder.getService(GiacenzaRESTConsumerService.class);
|
||||||
giacenzaRESTConsumerService.retrieveAvailableItems(posizioni, withTestataCollo).enqueue(new Callback<>() {
|
giacenzaRESTConsumerService.retrieveAvailableItems(posizioni, withTestataCollo).enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> call, Response<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> call, Response<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> response) {
|
||||||
analyzeAnswer(response, "getGiacenzeInPosizione", inventarioList -> {
|
analyzeAnswer(response, "getGiacenzeInPosizione", inventarioList -> {
|
||||||
@@ -112,19 +114,19 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getGiacenzeByArticolo(String codMart, String partitaMag, RunnableArgs<List<MvwSitArtUdcDetInventario>> onComplete, RunnableArgs<Exception> onFailed) {
|
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 =
|
var serviceRESTResponseCall =
|
||||||
UtilityString.isNullOrEmpty(partitaMag) ?
|
UtilityString.isNullOrEmpty(partitaMag) ?
|
||||||
giacenzaRESTConsumerService.retrieveAvailableItemsByArt(codMart) :
|
giacenzaRESTConsumerService.retrieveAvailableItemsByArt(codMart) :
|
||||||
giacenzaRESTConsumerService.retrieveAvailableItemsByArt(codMart, partitaMag);
|
giacenzaRESTConsumerService.retrieveAvailableItemsByArt(codMart, partitaMag);
|
||||||
serviceRESTResponseCall.enqueue(new Callback<>() {
|
serviceRESTResponseCall.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Response<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Response<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> response) {
|
||||||
analyzeAnswer(response, "getGiacenzeByArticolo", inventarioList -> {
|
analyzeAnswer(response, "getGiacenzeByArticolo", inventarioList -> {
|
||||||
@@ -155,18 +157,18 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void getInstantItemSituation(String codMdep, String codMart, String partitaMag, String codJcom, RunnableArgs<InstantItemSituationResponseDto> onComplete, RunnableArgs<Exception> onFailed) {
|
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)
|
giacenzaRESTConsumerService.retrieveInstantItemSituation(codMdep, codMart, partitaMag, codJcom)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<InstantItemSituationResponseDto>> call, Response<ServiceRESTResponse<InstantItemSituationResponseDto>> response) {
|
public void onResponse(Call<ServiceRESTResponse<InstantItemSituationResponseDto>> call, Response<ServiceRESTResponse<InstantItemSituationResponseDto>> response) {
|
||||||
analyzeAnswer(response, "getInstantItemSituation", data -> {
|
analyzeAnswer(response, "getInstantItemSituation", data -> {
|
||||||
@@ -176,8 +178,8 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<InstantItemSituationResponseDto>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<InstantItemSituationResponseDto>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,7 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.DtbDoct;
|
|
||||||
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
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.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationResponseDto;
|
import it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationResponseDto;
|
||||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto.ArtsInGiacenzaDTO;
|
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto.ArtsInGiacenzaDTO;
|
||||||
|
|||||||
@@ -0,0 +1,99 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
|
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;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.imballi.RegistraCaricoImballiRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.imballi.RegistraScaricoImballiRequestDTO;
|
||||||
|
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;
|
||||||
|
this.executorService = executorService;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<ObservableMtbTcol> retrieveImballiSyncronized(MtbTCol.FlagUiUlEnum tipoImballo) throws Exception {
|
||||||
|
ImballiRESTConsumerService service = restBuilder.getService(ImballiRESTConsumerService.class);
|
||||||
|
Response<ServiceRESTResponse<List<MtbTCol>>> response = service.retrieveImballi(tipoImballo)
|
||||||
|
.execute();
|
||||||
|
|
||||||
|
List<MtbTCol> retrieveTipiCollo = analyzeAnswer(response, "retrieveTipiCollo");
|
||||||
|
retrieveTipiCollo = retrieveTipiCollo == null ? new ArrayList<>() : retrieveTipiCollo;
|
||||||
|
return MtbTcolMapper.fromDTOList(retrieveTipiCollo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void retrieveImballi(MtbTCol.FlagUiUlEnum tipoImballo, RunnableArgs<List<ObservableMtbTcol>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
executorService.execute(() -> {
|
||||||
|
try {
|
||||||
|
var response = retrieveImballiSyncronized(tipoImballo);
|
||||||
|
if (onComplete != null) onComplete.run(response);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
if (onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void registraCaricoSyncronized(String codAnag, List<ImballoQuantityDTO> imballi) throws Exception {
|
||||||
|
ImballiRESTConsumerService service = restBuilder.getService(ImballiRESTConsumerService.class);
|
||||||
|
Response<ServiceRESTResponse<Void>> response = service.registraCarico(
|
||||||
|
new RegistraCaricoImballiRequestDTO()
|
||||||
|
.setCodAnag(codAnag)
|
||||||
|
.setUsedImballi(imballi))
|
||||||
|
.execute();
|
||||||
|
|
||||||
|
analyzeAnswer(response, "registraCarico");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void registraCarico(String codAnag, List<ImballoQuantityDTO> imballi, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
executorService.execute(() -> {
|
||||||
|
try {
|
||||||
|
registraCaricoSyncronized(codAnag, imballi);
|
||||||
|
if (onComplete != null) onComplete.run();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
if (onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void registraScaricoSyncronized(String codVettore, List<ImballoQuantityDTO> imballi) throws Exception {
|
||||||
|
ImballiRESTConsumerService service = restBuilder.getService(ImballiRESTConsumerService.class);
|
||||||
|
Response<ServiceRESTResponse<Void>> response = service.registraScarico(
|
||||||
|
new RegistraScaricoImballiRequestDTO()
|
||||||
|
.setCodVettore(codVettore)
|
||||||
|
.setUsedImballi(imballi))
|
||||||
|
.execute();
|
||||||
|
|
||||||
|
analyzeAnswer(response, "registraScarico");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void registraScarico(String idVettore, List<ImballoQuantityDTO> imballi, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
executorService.execute(() -> {
|
||||||
|
try {
|
||||||
|
registraScaricoSyncronized(idVettore, imballi);
|
||||||
|
if (onComplete != null) onComplete.run();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
if (onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.imballi.RegistraCaricoImballiRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.imballi.RegistraScaricoImballiRequestDTO;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.Body;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Path;
|
||||||
|
|
||||||
|
public interface ImballiRESTConsumerService {
|
||||||
|
|
||||||
|
|
||||||
|
@GET("wms/imballi/retrieve/{tipo}")
|
||||||
|
Call<ServiceRESTResponse<List<MtbTCol>>> retrieveImballi(@Path("tipo") MtbTCol.FlagUiUlEnum tipo);
|
||||||
|
|
||||||
|
@POST("wms/imballi/registraCarico")
|
||||||
|
Call<ServiceRESTResponse<Void>> registraCarico(@Body RegistraCaricoImballiRequestDTO registraCaricoImballiRequest);
|
||||||
|
|
||||||
|
@POST("wms/imballi/registraScarico")
|
||||||
|
Call<ServiceRESTResponse<Void>> registraScarico(@Body RegistraScaricoImballiRequestDTO registraScaricoImballiRequest);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,58 +4,65 @@ import androidx.annotation.NonNull;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbInvent;
|
import it.integry.integrywmsnative.core.model.MtbInvent;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.inventario.InsertInventarioRequestDTO;
|
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.RetrieveInventarioArtsResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.inventario.RetrieveInventarioResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.inventario.RetrieveInventarioResponseDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class InventarioRESTConsumer extends _BaseRESTConsumer {
|
public class InventarioRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
private final RESTBuilder restBuilder;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public InventarioRESTConsumer(RESTBuilder restBuilder) {
|
||||||
|
this.restBuilder = restBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
public void loadInventario(long inventoryId, RunnableArgs<RetrieveInventarioResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
public void loadInventario(long inventoryId, RunnableArgs<RetrieveInventarioResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
var inventarioRESTConsumerService = RESTBuilder.getService(InventarioRESTConsumerService.class);
|
var inventarioRESTConsumerService = restBuilder.getService(InventarioRESTConsumerService.class);
|
||||||
inventarioRESTConsumerService.retrieve(inventoryId)
|
inventarioRESTConsumerService.retrieve(inventoryId)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveInventarioResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveInventarioResponseDTO>> response) {
|
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveInventarioResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveInventarioResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "loadInventario", onComplete, onFailed);
|
analyzeAnswer(response, "loadInventario", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveInventarioResponseDTO>> call, @NonNull Throwable t) {
|
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveInventarioResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void loadInventarioArts(long inventoryId, RunnableArgs<RetrieveInventarioArtsResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
public void loadInventarioArts(long inventoryId, RunnableArgs<RetrieveInventarioArtsResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
var inventarioRESTConsumerService = RESTBuilder.getService(InventarioRESTConsumerService.class);
|
var inventarioRESTConsumerService = restBuilder.getService(InventarioRESTConsumerService.class);
|
||||||
inventarioRESTConsumerService.retrieveArts(inventoryId)
|
inventarioRESTConsumerService.retrieveArts(inventoryId)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveInventarioArtsResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveInventarioArtsResponseDTO>> response) {
|
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveInventarioArtsResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveInventarioArtsResponseDTO>> response) {
|
||||||
analyzeAnswer(response, "loadInventarioArts", onComplete, onFailed);
|
analyzeAnswer(response, "loadInventarioArts", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveInventarioArtsResponseDTO>> call, @NonNull Throwable t) {
|
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveInventarioArtsResponseDTO>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MtbInvent> makeSynchronousRetrieveRequest() throws Exception {
|
public List<MtbInvent> makeSynchronousRetrieveRequest() throws Exception {
|
||||||
var inventarioRESTConsumerService = RESTBuilder.getService(InventarioRESTConsumerService.class, 120);
|
var inventarioRESTConsumerService = restBuilder.getService(InventarioRESTConsumerService.class, 120);
|
||||||
|
|
||||||
var response = inventarioRESTConsumerService.retrieve()
|
var response = inventarioRESTConsumerService.retrieve()
|
||||||
.execute();
|
.execute();
|
||||||
@@ -70,18 +77,18 @@ public class InventarioRESTConsumer extends _BaseRESTConsumer {
|
|||||||
var request = new InsertInventarioRequestDTO()
|
var request = new InsertInventarioRequestDTO()
|
||||||
.setMtbInvent(inventarioToInsert);
|
.setMtbInvent(inventarioToInsert);
|
||||||
|
|
||||||
var inventarioRESTConsumerService = RESTBuilder.getService(InventarioRESTConsumerService.class, 300);
|
var inventarioRESTConsumerService = restBuilder.getService(InventarioRESTConsumerService.class, 300);
|
||||||
inventarioRESTConsumerService
|
inventarioRESTConsumerService
|
||||||
.insert(inventarioToInsert.getIdInventario(), request)
|
.insert(inventarioToInsert.getIdInventario(), request)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
analyzeAnswer(response, "insertInventario", ignored -> onComplete.run(), onFailed);
|
analyzeAnswer(response, "insertInventario", ignored -> onComplete.run(), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,32 +1,41 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPickItemsRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPickItemsRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPutItemsRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPutItemsRequestDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class MagazzinoAutomaticoRESTConsumer extends _BaseRESTConsumer {
|
public class MagazzinoAutomaticoRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
|
||||||
|
private final RESTBuilder restBuilder;
|
||||||
|
|
||||||
|
public MagazzinoAutomaticoRESTConsumer(RESTBuilder restBuilder) {
|
||||||
|
this.restBuilder = restBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
public void pickItems(MtbDepoPosizione posizione, MagazzinoAutomaticoPickItemsRequestDTO magazzinoAutomaticoPickItemsRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void pickItems(MtbDepoPosizione posizione, MagazzinoAutomaticoPickItemsRequestDTO magazzinoAutomaticoPickItemsRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MagazzinoAutomaticoRESTConsumerService magazzinoAutomaticoRESTConsumerService = RESTBuilder.getService(MagazzinoAutomaticoRESTConsumerService.class);
|
MagazzinoAutomaticoRESTConsumerService magazzinoAutomaticoRESTConsumerService = restBuilder.getService(MagazzinoAutomaticoRESTConsumerService.class);
|
||||||
magazzinoAutomaticoRESTConsumerService.pickItems(posizione.getPosizione(), magazzinoAutomaticoPickItemsRequestDTO)
|
magazzinoAutomaticoRESTConsumerService.pickItems(posizione.getPosizione(), magazzinoAutomaticoPickItemsRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
analyzeAnswer(response, "magazzino-automatico/pickItems", data -> onComplete.run(), onFailed);
|
analyzeAnswer(response, "magazzino-automatico/pickItems", data -> onComplete.run(), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -34,17 +43,17 @@ public class MagazzinoAutomaticoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
|
|
||||||
public void putItems(MtbDepoPosizione posizione, MagazzinoAutomaticoPutItemsRequestDTO magazzinoAutomaticoPutItemsRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void putItems(MtbDepoPosizione posizione, MagazzinoAutomaticoPutItemsRequestDTO magazzinoAutomaticoPutItemsRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MagazzinoAutomaticoRESTConsumerService magazzinoAutomaticoRESTConsumerService = RESTBuilder.getService(MagazzinoAutomaticoRESTConsumerService.class);
|
MagazzinoAutomaticoRESTConsumerService magazzinoAutomaticoRESTConsumerService = restBuilder.getService(MagazzinoAutomaticoRESTConsumerService.class);
|
||||||
magazzinoAutomaticoRESTConsumerService.putItems(posizione.getPosizione(), magazzinoAutomaticoPutItemsRequestDTO)
|
magazzinoAutomaticoRESTConsumerService.putItems(posizione.getPosizione(), magazzinoAutomaticoPutItemsRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
analyzeAnswer(response, "magazzino-automatico/putItems", data -> onComplete.run(), onFailed);
|
analyzeAnswer(response, "magazzino-automatico/putItems", data -> onComplete.run(), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,64 +1,72 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.magazzino_buffer.MagazzinoBufferVersamentoMaterialeCloseRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.magazzino_buffer.MagazzinoBufferVersamentoMaterialeCloseRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.magazzino_buffer.MagazzinoBufferVersamentoMaterialeRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.magazzino_buffer.MagazzinoBufferVersamentoMaterialeRequestDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class MagazzinoBufferRESTConsumer extends _BaseRESTConsumer {
|
public class MagazzinoBufferRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
private final RESTBuilder restBuilder;
|
||||||
|
|
||||||
|
public MagazzinoBufferRESTConsumer(RESTBuilder restBuilder) {
|
||||||
|
this.restBuilder = restBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
public void isVersamentoStarted(MtbDepoPosizione posizione, MagazzinoBufferVersamentoMaterialeRequestDTO magazzinoBufferVersamentoMaterialeRequestDTO, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
public void isVersamentoStarted(MtbDepoPosizione posizione, MagazzinoBufferVersamentoMaterialeRequestDTO magazzinoBufferVersamentoMaterialeRequestDTO, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MagazzinoBufferRESTConsumerService magazzinoBufferRESTConsumerService = RESTBuilder.getService(MagazzinoBufferRESTConsumerService.class);
|
MagazzinoBufferRESTConsumerService magazzinoBufferRESTConsumerService = restBuilder.getService(MagazzinoBufferRESTConsumerService.class);
|
||||||
magazzinoBufferRESTConsumerService.isVersamentoStarted(posizione.getPosizione(), magazzinoBufferVersamentoMaterialeRequestDTO)
|
magazzinoBufferRESTConsumerService.isVersamentoStarted(posizione.getPosizione(), magazzinoBufferVersamentoMaterialeRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Boolean>> call, Response<ServiceRESTResponse<Boolean>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Boolean>> call, Response<ServiceRESTResponse<Boolean>> response) {
|
||||||
analyzeAnswer(response, "magazzino-buffer/isVersamentoStarted", onComplete, onFailed);
|
analyzeAnswer(response, "magazzino-buffer/isVersamentoStarted", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startVersamentoMateriale(MtbDepoPosizione posizione, MagazzinoBufferVersamentoMaterialeRequestDTO magazzinoBufferVersamentoMaterialeRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void startVersamentoMateriale(MtbDepoPosizione posizione, MagazzinoBufferVersamentoMaterialeRequestDTO magazzinoBufferVersamentoMaterialeRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MagazzinoBufferRESTConsumerService magazzinoBufferRESTConsumerService = RESTBuilder.getService(MagazzinoBufferRESTConsumerService.class);
|
MagazzinoBufferRESTConsumerService magazzinoBufferRESTConsumerService = restBuilder.getService(MagazzinoBufferRESTConsumerService.class);
|
||||||
magazzinoBufferRESTConsumerService.startVersamentoMateriale(posizione.getPosizione(), magazzinoBufferVersamentoMaterialeRequestDTO)
|
magazzinoBufferRESTConsumerService.startVersamentoMateriale(posizione.getPosizione(), magazzinoBufferVersamentoMaterialeRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
analyzeAnswer(response, "magazzino-buffer/startVersamentoMateriale", data -> onComplete.run(), onFailed);
|
analyzeAnswer(response, "magazzino-buffer/startVersamentoMateriale", data -> onComplete.run(), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void endVersamentoMateriale(MtbDepoPosizione posizione, MagazzinoBufferVersamentoMaterialeCloseRequestDTO magazzinoBufferVersamentoMaterialeCloseRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void endVersamentoMateriale(MtbDepoPosizione posizione, MagazzinoBufferVersamentoMaterialeCloseRequestDTO magazzinoBufferVersamentoMaterialeCloseRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MagazzinoBufferRESTConsumerService magazzinoBufferRESTConsumerService = RESTBuilder.getService(MagazzinoBufferRESTConsumerService.class);
|
MagazzinoBufferRESTConsumerService magazzinoBufferRESTConsumerService = restBuilder.getService(MagazzinoBufferRESTConsumerService.class);
|
||||||
magazzinoBufferRESTConsumerService.endVersamentoMateriale(posizione.getPosizione(), magazzinoBufferVersamentoMaterialeCloseRequestDTO)
|
magazzinoBufferRESTConsumerService.endVersamentoMateriale(posizione.getPosizione(), magazzinoBufferVersamentoMaterialeCloseRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
analyzeAnswer(response, "magazzino-buffer/endVersamentoMateriale", data -> onComplete.run(), onFailed);
|
analyzeAnswer(response, "magazzino-buffer/endVersamentoMateriale", data -> onComplete.run(), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,106 +2,83 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
import java.util.Date;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.DtbOrdt;
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
||||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class MagazzinoRESTConsumer extends _BaseRESTConsumer {
|
public class MagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
private final SystemRESTConsumer mSystemRESTConsumer;
|
private final RESTBuilder restBuilder;
|
||||||
|
private final ExecutorService executorService;
|
||||||
|
private final SystemRESTConsumer systemRESTConsumer;
|
||||||
|
|
||||||
public MagazzinoRESTConsumer(SystemRESTConsumer mSystemRESTConsumer) {
|
public MagazzinoRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService, SystemRESTConsumer systemRESTConsumer) {
|
||||||
this.mSystemRESTConsumer = mSystemRESTConsumer;
|
this.restBuilder = restBuilder;
|
||||||
}
|
this.executorService = executorService;
|
||||||
|
this.systemRESTConsumer = systemRESTConsumer;
|
||||||
|
|
||||||
public void getTipiCollo(RunnableArgs<List<MtbTCol>> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
String baseSql = "SELECT * " +
|
|
||||||
"FROM mtb_tcol ";
|
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbTCol>>() {
|
|
||||||
}.getType();
|
|
||||||
|
|
||||||
mSystemRESTConsumer.<ArrayList<MtbTCol>>processSql(baseSql, typeOfObjectsList, values -> {
|
|
||||||
if (onComplete != null) {
|
|
||||||
onComplete.run(values);
|
|
||||||
}
|
|
||||||
}, ex -> {
|
|
||||||
if (onFailed != null) onFailed.run(ex);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void saveOrdine(SaveDTO saveDTO, RunnableArgs<DtbOrdt> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
MagazzinoRESTConsumerService service = RESTBuilder.getService(MagazzinoRESTConsumerService.class, 240);
|
|
||||||
service.saveOrdine(saveDTO)
|
|
||||||
.enqueue(new Callback<>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Call<List<ServiceRESTResponse<DtbOrdt>>> call, Response<List<ServiceRESTResponse<DtbOrdt>>> response) {
|
|
||||||
if (response.body() != null && response.body().size() > 0) {
|
|
||||||
analyzeListOfAnswers(response, "saveOrdine", dtoList -> {
|
|
||||||
if (dtoList.size() > 0) {
|
|
||||||
onComplete.run(dtoList.get(0));
|
|
||||||
} else {
|
|
||||||
onFailed.run(new Exception("Nessun ordine generato"));
|
|
||||||
}
|
|
||||||
}, onFailed);
|
|
||||||
} else {
|
|
||||||
onFailed.run(new Exception("Nessun ordine generato"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Call<List<ServiceRESTResponse<DtbOrdt>>> call, Throwable t) {
|
|
||||||
onFailed.run(new Exception(t));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveTerminalinoWMS(SaveDTO saveDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void saveTerminalinoWMS(SaveDTO saveDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MagazzinoRESTConsumerService service = RESTBuilder.getService(MagazzinoRESTConsumerService.class);
|
MagazzinoRESTConsumerService service = restBuilder.getService(MagazzinoRESTConsumerService.class);
|
||||||
service.saveTerminalinoWMS(saveDTO)
|
service.saveTerminalinoWMS(saveDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
analyzeAnswer(response, "saveTerminalinoWMS", data -> onComplete.run(), onFailed);
|
analyzeAnswer(response, "saveTerminalinoWMS", data -> onComplete.run(), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void retrievePartitaMag(String partitaMag, String codMart, RunnableArgs<MtbPartitaMag> onComplete, RunnableArgs<Exception> onFailed){
|
|
||||||
MagazzinoRESTConsumerService service = RESTBuilder.getService(MagazzinoRESTConsumerService.class);
|
public MtbPartitaMag retrievePartitaMagSyncronized(String partitaMag, String codMart) throws Exception {
|
||||||
service.retrievePartitaMag(codMart, partitaMag)
|
MagazzinoRESTConsumerService service = restBuilder.getService(MagazzinoRESTConsumerService.class);
|
||||||
.enqueue(new Callback<>() {
|
Response<ServiceRESTResponse<MtbPartitaMag>> response = service.retrievePartitaMag(codMart, partitaMag)
|
||||||
|
.execute();
|
||||||
|
|
||||||
|
return analyzeAnswer(response, "retrievePartitaMag");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void retrievePartitaMag(String partitaMag, String codMart, RunnableArgs<MtbPartitaMag> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
executorService.execute(() -> {
|
||||||
|
try {
|
||||||
|
var response = retrievePartitaMagSyncronized(partitaMag, codMart);
|
||||||
|
if (onComplete != null) onComplete.run(response);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
if (onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
@Override
|
||||||
public void onResponse(@NonNull Call<ServiceRESTResponse<MtbPartitaMag>> call, @NonNull Response<ServiceRESTResponse<MtbPartitaMag>> response) {
|
public void onResponse(@NonNull Call<ServiceRESTResponse<List<MtbPartitaMag>>> call, @NonNull Response<ServiceRESTResponse<List<MtbPartitaMag>>> response) {
|
||||||
analyzeAnswer(response, "retrievePartitaMag", onComplete, onFailed);
|
analyzeAnswer(response, "retrieveAllPartitaMag", onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(@NonNull Call<ServiceRESTResponse<MtbPartitaMag>> call, @NonNull Throwable t) {
|
public void onFailure(@NonNull Call<ServiceRESTResponse<List<MtbPartitaMag>>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.DtbOrdt;
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
||||||
@@ -17,11 +16,11 @@ public interface MagazzinoRESTConsumerService {
|
|||||||
@POST("SM2SaveTerminalinoWMS")
|
@POST("SM2SaveTerminalinoWMS")
|
||||||
Call<ServiceRESTResponse<Void>> saveTerminalinoWMS(@Body SaveDTO saveDTO);
|
Call<ServiceRESTResponse<Void>> saveTerminalinoWMS(@Body SaveDTO saveDTO);
|
||||||
|
|
||||||
@POST("SM2SaveTerminalino")
|
|
||||||
Call<List<ServiceRESTResponse<DtbOrdt>>> saveOrdine(@Body SaveDTO saveDTO);
|
|
||||||
|
|
||||||
@GET("wms/partita-magazzino/retrievePartitaMag")
|
@GET("wms/partita-magazzino/retrievePartitaMag")
|
||||||
Call<ServiceRESTResponse<MtbPartitaMag>> retrievePartitaMag(@Query("codMart") String codMart,
|
Call<ServiceRESTResponse<MtbPartitaMag>> retrievePartitaMag(@Query("codMart") String codMart,
|
||||||
@Query("partitaMag") String partitaMag);
|
@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,46 @@
|
|||||||
|
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 RESTBuilder restBuilder;
|
||||||
|
private final ExecutorService executorService;
|
||||||
|
|
||||||
|
public MaterialiRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
|
||||||
|
this.restBuilder = restBuilder;
|
||||||
|
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,10 +1,11 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
@@ -12,71 +13,72 @@ import javax.inject.Singleton;
|
|||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.JtbFasi;
|
import it.integry.integrywmsnative.core.model.JtbFasi;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
|
||||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class MesRESTConsumer extends _BaseRESTConsumer {
|
public class MesRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
private final SystemRESTConsumer mSystemRESTConsumer;
|
private final RESTBuilder restBuilder;
|
||||||
|
private final SystemRESTConsumer systemRESTConsumer;
|
||||||
|
|
||||||
public MesRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
public MesRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer) {
|
||||||
this.mSystemRESTConsumer = systemRESTConsumer;
|
this.restBuilder = restBuilder;
|
||||||
|
this.systemRESTConsumer = systemRESTConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getOrdiniLavorazioneMateriale(String codJfas, String idMateriale, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getOrdiniLavorazioneMateriale(String codJfas, String idMateriale, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
MesRESTConsumerService mesRESTConsumerService = restBuilder.getService(MesRESTConsumerService.class);
|
||||||
|
|
||||||
mesRESTConsumerService.getOrdiniLavorazioneMateriale(codJfas, idMateriale)
|
mesRESTConsumerService.getOrdiniLavorazioneMateriale(codJfas, idMateriale)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
||||||
analyzeAnswer(response, "getOrdiniLavorazioneMateriale", (m) -> onComplete.run(response.body().getDto()), onFailed);
|
analyzeAnswer(response, "getOrdiniLavorazioneMateriale", (m) -> onComplete.run(response.body().getDto()), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getOrdiniLavorazione(String flagEvaso, String codJfas, String codAnag, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getOrdiniLavorazione(String flagEvaso, String codJfas, String codAnag, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
MesRESTConsumerService mesRESTConsumerService = restBuilder.getService(MesRESTConsumerService.class);
|
||||||
|
|
||||||
mesRESTConsumerService.getOrdiniLavorazione(null, flagEvaso, codJfas, codAnag)
|
mesRESTConsumerService.getOrdiniLavorazione(null, flagEvaso, codJfas, codAnag)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
||||||
analyzeAnswer(response, "getOrdiniLavorazione", (m) -> onComplete.run(response.body().getDto()), onFailed);
|
analyzeAnswer(response, "getOrdiniLavorazione", (m) -> onComplete.run(response.body().getDto()), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void getOrdiniLavorazione(String flagEvaso, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getOrdiniLavorazione(String flagEvaso, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
MesRESTConsumerService mesRESTConsumerService = restBuilder.getService(MesRESTConsumerService.class);
|
||||||
|
|
||||||
mesRESTConsumerService.getOrdiniLavorazione(flagEvaso)
|
mesRESTConsumerService.getOrdiniLavorazione(flagEvaso)
|
||||||
.enqueue(new Callback<ServiceRESTResponse<List<OrdineLavorazioneDTO>>>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
||||||
analyzeAnswer(response, "getOrdiniLavorazione", (m) -> onComplete.run(response.body().getDto()), onFailed);
|
analyzeAnswer(response, "getOrdiniLavorazione", (m) -> onComplete.run(response.body().getDto()), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -85,7 +87,7 @@ public class MesRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<JtbFasi>>() {
|
Type typeOfObjectsList = new TypeToken<ArrayList<JtbFasi>>() {
|
||||||
}.getType();
|
}.getType();
|
||||||
this.mSystemRESTConsumer.processSql(
|
this.systemRESTConsumer.processSql(
|
||||||
"SELECT * FROM jtb_fasi WHERE cod_jfas_parent = " + UtilityDB.valueToString(codJfasParent),
|
"SELECT * FROM jtb_fasi WHERE cod_jfas_parent = " + UtilityDB.valueToString(codJfasParent),
|
||||||
typeOfObjectsList,
|
typeOfObjectsList,
|
||||||
onComplete,
|
onComplete,
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.annimon.stream.Optional;
|
import com.annimon.stream.Optional;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
@@ -21,35 +23,37 @@ import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
|||||||
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.GetPickingListDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
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.UtilityQuery;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
private final RESTBuilder restBuilder;
|
||||||
|
|
||||||
private final SystemRESTConsumer mSystemRESTConsumer;
|
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||||
private final EntityRESTConsumer mEntityRESTConsumer;
|
private final EntityRESTConsumer mEntityRESTConsumer;
|
||||||
|
|
||||||
public OrdiniRESTConsumer(SystemRESTConsumer systemRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
public OrdiniRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
||||||
|
this.restBuilder = restBuilder;
|
||||||
this.mSystemRESTConsumer = systemRESTConsumer;
|
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||||
this.mEntityRESTConsumer = entityRESTConsumer;
|
this.mEntityRESTConsumer = entityRESTConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getSuggestedPickingList(String codMdep, List<SitArtOrdDTO> sitArtOrdList, RunnableArgs<List<PickingObjectDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getSuggestedPickingList(String codMdep, List<SitArtOrdDTO> sitArtOrdList, RunnableArgs<List<PickingObjectDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class, 90);
|
OrdiniRESTConsumerService service = restBuilder.getService(OrdiniRESTConsumerService.class, 90);
|
||||||
service
|
service
|
||||||
.getSuggestedPickingList(codMdep, sitArtOrdList)
|
.getSuggestedPickingList(codMdep, sitArtOrdList)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<PickingObjectDTO>>> call, Response<ServiceRESTResponse<List<PickingObjectDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<PickingObjectDTO>>> call, Response<ServiceRESTResponse<List<PickingObjectDTO>>> response) {
|
||||||
analyzeAnswer(response, "getSuggestedPickingList", pickingObjects -> {
|
analyzeAnswer(response, "getSuggestedPickingList", pickingObjects -> {
|
||||||
@@ -109,8 +113,8 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<PickingObjectDTO>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<PickingObjectDTO>>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -123,10 +127,10 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
public void getOrdiniInevasi(String codMdep, GestioneEnum gestione, RunnableArgs<List<OrdineUscitaInevasoDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getOrdiniInevasi(String codMdep, GestioneEnum gestione, RunnableArgs<List<OrdineUscitaInevasoDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class);
|
OrdiniRESTConsumerService service = restBuilder.getService(OrdiniRESTConsumerService.class);
|
||||||
|
|
||||||
service.getOrdiniInevasi(codMdep, gestione.getText())
|
service.getOrdiniInevasi(codMdep, gestione.getText())
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> call, Response<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> call, Response<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> response) {
|
||||||
analyzeAnswer(response, "getOrdiniInevasi", responseDtoList -> {
|
analyzeAnswer(response, "getOrdiniInevasi", responseDtoList -> {
|
||||||
@@ -139,9 +143,8 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> call, @NonNull final Exception e) {
|
||||||
Logger.e(t, "Errore durante il caricamento degli ordini di lavorazione");
|
if (onFailed != null) onFailed.run(e);
|
||||||
if (onFailed != null) onFailed.run(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -156,9 +159,9 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.setIdViaggio(x.getIdViaggio()))
|
.setIdViaggio(x.getIdViaggio()))
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class, 90);
|
OrdiniRESTConsumerService service = restBuilder.getService(OrdiniRESTConsumerService.class, 90);
|
||||||
|
|
||||||
service.getArticoliFromOrdini(codMdep, getPickingListDTOs).enqueue(new Callback<>() {
|
service.getArticoliFromOrdini(codMdep, getPickingListDTOs).enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Response<ServiceRESTResponse<List<SitArtOrdDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Response<ServiceRESTResponse<List<SitArtOrdDTO>>> response) {
|
||||||
analyzeAnswer(response, "retrieveListaArticoliFromOrdiniUscita", sitArtOrds -> {
|
analyzeAnswer(response, "retrieveListaArticoliFromOrdiniUscita", sitArtOrds -> {
|
||||||
@@ -173,14 +176,12 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, @NonNull final Exception e) {
|
||||||
UtilityLogger.error(new Exception(t));
|
onFailed.run(e);
|
||||||
onFailed.run(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void getBancaliGiaRegistrati(List<OrdineInevasoDTO> orders, GestioneEnum gestione, int segno, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getBancaliGiaRegistrati(List<OrdineInevasoDTO> orders, GestioneEnum gestione, int segno, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
String whereCondGestione = "";
|
String whereCondGestione = "";
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -14,70 +16,62 @@ 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.data_store.db.view_model.OrdiniAcquistoGrigliaDTO;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
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.ArtDTO;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.OrdineDTO;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.OrdineDTO;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
private final RESTBuilder restBuilder;
|
||||||
private final MagazzinoRESTConsumer magazzinoRESTConsumer;
|
private final MagazzinoRESTConsumer magazzinoRESTConsumer;
|
||||||
|
|
||||||
public PVOrdiniAcquistoRESTConsumer(MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
public PVOrdiniAcquistoRESTConsumer(RESTBuilder restBuilder, MagazzinoRESTConsumer magazzinoRESTConsumer) {
|
||||||
|
this.restBuilder = restBuilder;
|
||||||
this.magazzinoRESTConsumer = magazzinoRESTConsumer;
|
this.magazzinoRESTConsumer = magazzinoRESTConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void retrieveArticoli(String codAlis, String codMdep, RunnableArgs<OrdiniAcquistoGrigliaDTO> onSuccess, RunnableArgs<Exception> onFailed) {
|
public void retrieveArticoli(String codAlis, String codMdep, RunnableArgs<OrdiniAcquistoGrigliaDTO> onSuccess, RunnableArgs<Exception> onFailed) {
|
||||||
PVOrdiniAcquistoRESTConsumerService ordiniARestService = RESTBuilder.getService(PVOrdiniAcquistoRESTConsumerService.class, 300);
|
PVOrdiniAcquistoRESTConsumerService ordiniARestService = restBuilder.getService(PVOrdiniAcquistoRESTConsumerService.class, 300);
|
||||||
ordiniARestService.retrieveArticoli(codAlis, codMdep, null)
|
ordiniARestService.retrieveArticoli(codAlis, codMdep, null)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, Response<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, Response<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> response) {
|
||||||
var startTime = new Date().getTime();
|
var startTime = new Date().getTime();
|
||||||
analyzeAnswer(response, "retrieveArticoliOrdine", articoliOrdineWrapper -> {
|
analyzeAnswer(response, "retrieveArticoliOrdine", articoliOrdineWrapper -> {
|
||||||
UtilityThread.executeParallel(() -> {
|
Log.d("LOADING TIME 1", "MS: " + (new Date().getTime() - startTime));
|
||||||
Log.d("LOADING TIME 1", "MS: " + (new Date().getTime() - startTime));
|
onSuccess.run(articoliOrdineWrapper);
|
||||||
onSuccess.run(articoliOrdineWrapper);
|
|
||||||
}, false);
|
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, @NonNull final Exception e) {
|
||||||
Log.e("getArticoliListino_pv", t.toString());
|
onFailed.run(e);
|
||||||
UtilityLogger.error(new Exception(t));
|
|
||||||
onFailed.run(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void retrieveArticolo(String codAlis, String codMdep, String barcode, RunnableArgs<OrdiniAcquistoGrigliaDTO> onSuccess, RunnableArgs<Exception> onFailed) {
|
public void retrieveArticolo(String codAlis, String codMdep, String barcode, RunnableArgs<OrdiniAcquistoGrigliaDTO> onSuccess, RunnableArgs<Exception> onFailed) {
|
||||||
PVOrdiniAcquistoRESTConsumerService ordiniARestService = RESTBuilder.getService(PVOrdiniAcquistoRESTConsumerService.class, 300);
|
PVOrdiniAcquistoRESTConsumerService ordiniARestService = restBuilder.getService(PVOrdiniAcquistoRESTConsumerService.class, 300);
|
||||||
ordiniARestService.retrieveArticoli(codAlis, codMdep, barcode)
|
ordiniARestService.retrieveArticoli(codAlis, codMdep, barcode)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, Response<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> response) {
|
public void onResponse(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, Response<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> response) {
|
||||||
var startTime = new Date().getTime();
|
var startTime = new Date().getTime();
|
||||||
analyzeAnswer(response, "retrieveArticoliOrdine", articoliOrdineWrapper -> {
|
analyzeAnswer(response, "retrieveArticoliOrdine", articoliOrdineWrapper -> {
|
||||||
UtilityThread.executeParallel(() -> {
|
Log.d("LOADING TIME 1", "MS: " + (new Date().getTime() - startTime));
|
||||||
Log.d("LOADING TIME 1", "MS: " + (new Date().getTime() - startTime));
|
onSuccess.run(articoliOrdineWrapper);
|
||||||
onSuccess.run(articoliOrdineWrapper);
|
|
||||||
}, false);
|
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, @NonNull final Exception e) {
|
||||||
Log.e("getArticoliListino_pv", t.toString());
|
onFailed.run(e);
|
||||||
UtilityLogger.error(new Exception(t));
|
|
||||||
onFailed.run(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -98,14 +92,14 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
saveDTO.setGestione("O");
|
saveDTO.setGestione("O");
|
||||||
saveDTO.setOrdineDTO(ordineDTO);
|
saveDTO.setOrdineDTO(ordineDTO);
|
||||||
|
|
||||||
PVOrdiniAcquistoRESTConsumerService ordiniARestService = RESTBuilder.getService(PVOrdiniAcquistoRESTConsumerService.class, 300);
|
PVOrdiniAcquistoRESTConsumerService ordiniARestService = restBuilder.getService(PVOrdiniAcquistoRESTConsumerService.class, 300);
|
||||||
ordiniARestService.save(codMdep, saveDTO)
|
ordiniARestService.save(codMdep, saveDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
var startTime = new Date().getTime();
|
var startTime = new Date().getTime();
|
||||||
analyzeAnswer(response, "retrieveArticoliOrdine", articoliOrdineWrapper -> {
|
analyzeAnswer(response, "retrieveArticoliOrdine", articoliOrdineWrapper -> {
|
||||||
UtilityThread.executeParallel(() -> {
|
// UtilityThread.executeParallel(() -> {
|
||||||
// if (data == null) {
|
// if (data == null) {
|
||||||
// onFailed.run(new Exception("Nessun ordine generato"));
|
// onFailed.run(new Exception("Nessun ordine generato"));
|
||||||
// return;
|
// return;
|
||||||
@@ -117,15 +111,13 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
// ordine.setCodMdep(data.getCodMdep());
|
// ordine.setCodMdep(data.getCodMdep());
|
||||||
// ordine.setNumOrd(data.getNumOrd());
|
// ordine.setNumOrd(data.getNumOrd());
|
||||||
onSuccess.run(ordine);
|
onSuccess.run(ordine);
|
||||||
}, false);
|
// }, false);
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, @NonNull final Exception e) {
|
||||||
Log.e("saveOrdine", t.toString());
|
onFailed.run(e);
|
||||||
UtilityLogger.error(new Exception(t));
|
|
||||||
onFailed.run(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
@@ -12,26 +14,28 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class PosizioniRESTConsumer extends _BaseRESTConsumer {
|
public class PosizioniRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
private final RESTBuilder restBuilder;
|
||||||
private final SystemRESTConsumer mSystemRESTConsumer;
|
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||||
|
|
||||||
public PosizioniRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
public PosizioniRESTConsumer(RESTBuilder restBuilder, SystemRESTConsumer systemRESTConsumer) {
|
||||||
|
this.restBuilder = restBuilder;
|
||||||
this.mSystemRESTConsumer = systemRESTConsumer;
|
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getAvailablePosizioni(RunnableArgs<List<MtbDepoPosizione>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getAvailablePosizioni(RunnableArgs<List<MtbDepoPosizione>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
String codMdep = null;
|
String codMdep = null;
|
||||||
|
|
||||||
PosizioniRESTConsumerService posizioniRESTConsumerService = RESTBuilder.getService(PosizioniRESTConsumerService.class);
|
PosizioniRESTConsumerService posizioniRESTConsumerService = restBuilder.getService(PosizioniRESTConsumerService.class);
|
||||||
posizioniRESTConsumerService.getAvailablePosizioni(codMdep).enqueue(new Callback<>() {
|
posizioniRESTConsumerService.getAvailablePosizioni(codMdep).enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<MtbDepoPosizione>>> call, Response<ServiceRESTResponse<List<MtbDepoPosizione>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<MtbDepoPosizione>>> call, Response<ServiceRESTResponse<List<MtbDepoPosizione>>> response) {
|
||||||
analyzeAnswer(response, "getAvailablePosizioni", (m) -> {
|
analyzeAnswer(response, "getAvailablePosizioni", (m) -> {
|
||||||
@@ -40,8 +44,8 @@ public class PosizioniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<MtbDepoPosizione>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<MtbDepoPosizione>>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,61 +1,34 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
import android.util.Log;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.BuildConfig;
|
import it.integry.integrywmsnative.BuildConfig;
|
||||||
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.report.ReportType;
|
import it.integry.integrywmsnative.core.report.ReportType;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.JasperDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.JasperPairDTO;
|
import it.integry.integrywmsnative.core.rest.model.JasperPairDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ReportTypeDTO;
|
import it.integry.integrywmsnative.core.rest.model.ReportTypeDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
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 it.integry.integrywmsnative.gest.spedizione.model.PrintOrderCloseDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
public enum Type {
|
private final RESTBuilder restBuilder;
|
||||||
PRIMARIA,
|
|
||||||
SECONDARIA
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public PrinterRESTConsumer(RESTBuilder restBuilder) {
|
||||||
public void getAvailablePrinters(String codMdep, Type printerType, RunnableArgs<List<String>> onComplete, RunnableArgs<Exception> onFailed) {
|
this.restBuilder = restBuilder;
|
||||||
|
|
||||||
String printerTypeStr = printerType != null ? printerType.toString() : null;
|
|
||||||
|
|
||||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
|
||||||
printerService.getAvailablePrinters(codMdep, printerTypeStr).enqueue(new Callback<>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
|
||||||
analyzeAnswer(response, "GetAvailablePrinters", printerList -> {
|
|
||||||
printerList = Stream.of(printerList).filter(x -> !UtilityString.isNullOrEmpty(x)).toList();
|
|
||||||
onComplete.run(printerList);
|
|
||||||
}, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
@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 printCollo(MtbColt testataColloToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void printCollo(MtbColt testataColloToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
@@ -65,10 +38,10 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
PrinterRESTConsumerService printerService = restBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
printerService
|
printerService
|
||||||
.printCollo(testataColloToPrint)
|
.printCollo(testataColloToPrint)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
analyzeAnswer(response, "printCollo", data -> {
|
analyzeAnswer(response, "printCollo", data -> {
|
||||||
@@ -77,10 +50,8 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, @NonNull final Exception e) {
|
||||||
if (t.getMessage().contains("Printer not found")) {
|
onFailed.run(e);
|
||||||
onFailed.run(new NoPrintersFoundException());
|
|
||||||
} else onFailed.run(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -98,10 +69,10 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
Stream.of(params)
|
Stream.of(params)
|
||||||
.forEach(x -> jasperDTO.getParams().add(new JasperPairDTO(x.getKey(), x.getValue())));
|
.forEach(x -> jasperDTO.getParams().add(new JasperPairDTO(x.getKey(), x.getValue())));
|
||||||
|
|
||||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
PrinterRESTConsumerService printerService = restBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
printerService
|
printerService
|
||||||
.processPrintReport(printerName, quantity, jasperDTO)
|
.processPrintReport(printerName, quantity, jasperDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
analyzeAnswer(response, "printReport", data -> {
|
analyzeAnswer(response, "printReport", data -> {
|
||||||
@@ -110,10 +81,8 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, @NonNull final Exception e) {
|
||||||
if (t.getMessage().contains("Printer not found")) {
|
onFailed.run(e);
|
||||||
onFailed.run(new NoPrintersFoundException());
|
|
||||||
} else onFailed.run(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -128,10 +97,10 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
Stream.of(params)
|
Stream.of(params)
|
||||||
.forEach(x -> reportTypeDTO.getParams().add(new JasperPairDTO(x.getKey(), x.getValue())));
|
.forEach(x -> reportTypeDTO.getParams().add(new JasperPairDTO(x.getKey(), x.getValue())));
|
||||||
|
|
||||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
PrinterRESTConsumerService printerService = restBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
printerService
|
printerService
|
||||||
.printReportType(reportTypeDTO)
|
.printReportType(reportTypeDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
analyzeAnswer(response, "printReportType", data -> {
|
analyzeAnswer(response, "printReportType", data -> {
|
||||||
@@ -140,10 +109,8 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, @NonNull final Exception e) {
|
||||||
if (t.getMessage().contains("Printer not found")) {
|
onFailed.run(e);
|
||||||
onFailed.run(new NoPrintersFoundException());
|
|
||||||
} else onFailed.run(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -162,9 +129,9 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class, 240);
|
PrinterRESTConsumerService printerService = restBuilder.getService(PrinterRESTConsumerService.class, 240);
|
||||||
Call<ServiceRESTResponse<Object>> callable = printerService.printClosedOrders(codMdep, dto);
|
Call<ServiceRESTResponse<Object>> callable = printerService.printClosedOrders(codMdep, dto);
|
||||||
callable.enqueue(new Callback<>() {
|
callable.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
analyzeAnswer(response, "printCollo", data -> {
|
analyzeAnswer(response, "printCollo", data -> {
|
||||||
@@ -173,10 +140,8 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, @NonNull final Exception e) {
|
||||||
if (t.getMessage().contains("Printer not found")) {
|
onFailed.run(e);
|
||||||
onFailed.run(new NoPrintersFoundException());
|
|
||||||
} else onFailed.run(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
@@ -9,19 +11,25 @@ import javax.inject.Singleton;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
|
public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
private final RESTBuilder restBuilder;
|
||||||
|
|
||||||
|
public ProductionLinesRESTConsumer(RESTBuilder restBuilder) {
|
||||||
|
this.restBuilder = restBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
public void avviaLineaDiProduzione(String codJfas, Integer hrNum, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void avviaLineaDiProduzione(String codJfas, Integer hrNum, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class);
|
ProductionLinesRESTConsumerService restService = restBuilder.getService(ProductionLinesRESTConsumerService.class);
|
||||||
Call<ServiceRESTResponse<JsonObject>> callable = restService.avviaLineaDiProduzione(codJfas, hrNum);
|
Call<ServiceRESTResponse<JsonObject>> callable = restService.avviaLineaDiProduzione(codJfas, hrNum);
|
||||||
callable.enqueue(new Callback<>() {
|
callable.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||||
analyzeAnswer(response, "avviaLineaDiProduzione", data -> {
|
analyzeAnswer(response, "avviaLineaDiProduzione", data -> {
|
||||||
@@ -30,16 +38,16 @@ public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void arrestaLineaDiProduzione(String codJfas, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void arrestaLineaDiProduzione(String codJfas, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class);
|
ProductionLinesRESTConsumerService restService = restBuilder.getService(ProductionLinesRESTConsumerService.class);
|
||||||
Call<ServiceRESTResponse<JsonObject>> callable = restService.arrestaLineaDiProduzione(codJfas);
|
Call<ServiceRESTResponse<JsonObject>> callable = restService.arrestaLineaDiProduzione(codJfas);
|
||||||
callable.enqueue(new Callback<>() {
|
callable.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||||
analyzeAnswer(response, "arrestaLineaDiProduzione", data -> {
|
analyzeAnswer(response, "arrestaLineaDiProduzione", data -> {
|
||||||
@@ -48,16 +56,16 @@ public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void avviaProduzioneArticoloSuLinea(String codJfas, String codMart, String partitaMag, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void avviaProduzioneArticoloSuLinea(String codJfas, String codMart, String partitaMag, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class, 300);
|
ProductionLinesRESTConsumerService restService = restBuilder.getService(ProductionLinesRESTConsumerService.class, 300);
|
||||||
Call<ServiceRESTResponse<JsonObject>> callable = restService.avviaProduzioneArticoloSuLinea(codJfas, codMart, partitaMag);
|
Call<ServiceRESTResponse<JsonObject>> callable = restService.avviaProduzioneArticoloSuLinea(codJfas, codMart, partitaMag);
|
||||||
callable.enqueue(new Callback<>() {
|
callable.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||||
analyzeAnswer(response, "avviaProduzioneArticoloSuLinea", data -> {
|
analyzeAnswer(response, "avviaProduzioneArticoloSuLinea", data -> {
|
||||||
@@ -66,33 +74,33 @@ public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getStatoLinee(String codMdep, RunnableArgs<List<ProdLineStatusDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getStatoLinee(String codMdep, RunnableArgs<List<ProdLineStatusDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class);
|
ProductionLinesRESTConsumerService restService = restBuilder.getService(ProductionLinesRESTConsumerService.class);
|
||||||
Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> callable = restService.getStatoLinee(codMdep);
|
Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> callable = restService.getStatoLinee(codMdep);
|
||||||
callable.enqueue(new Callback<>() {
|
callable.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Response<ServiceRESTResponse<List<ProdLineStatusDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Response<ServiceRESTResponse<List<ProdLineStatusDTO>>> response) {
|
||||||
analyzeAnswer(response, "getStatoLinee", onComplete::run, onFailed);
|
analyzeAnswer(response, "getStatoLinee", onComplete::run, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void getLineDetails(ProdLineStatusDTO lineaProd, RunnableArgs<ProdLineStatusDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getLineDetails(ProdLineStatusDTO lineaProd, RunnableArgs<ProdLineStatusDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class);
|
ProductionLinesRESTConsumerService restService = restBuilder.getService(ProductionLinesRESTConsumerService.class);
|
||||||
Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> callable = restService.getStatoLinee(lineaProd.getCodMdepLav());
|
Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> callable = restService.getStatoLinee(lineaProd.getCodMdepLav());
|
||||||
callable.enqueue(new Callback<>() {
|
callable.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Response<ServiceRESTResponse<List<ProdLineStatusDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Response<ServiceRESTResponse<List<ProdLineStatusDTO>>> response) {
|
||||||
analyzeAnswer(response, "getLineDetails", (lines) -> {
|
analyzeAnswer(response, "getLineDetails", (lines) -> {
|
||||||
@@ -102,8 +110,8 @@ public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
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 {
|
||||||
|
|
||||||
|
private final RESTBuilder restBuilder;
|
||||||
|
|
||||||
|
public ProduzioneRESTConsumer(RESTBuilder restBuilder) {
|
||||||
|
this.restBuilder = restBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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,73 +3,89 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
|
||||||
import com.google.gson.JsonDeserializer;
|
|
||||||
import com.google.gson.JsonParseException;
|
|
||||||
import com.orhanobut.logger.Logger;
|
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.net.ConnectException;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.BuildConfig;
|
import it.integry.integrywmsnative.BuildConfig;
|
||||||
import it.integry.integrywmsnative.core.CommonConst;
|
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.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
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.AvailableCodMdepsDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.MailRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.MailRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
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.rest.model.system.RegisterDeviceRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityGson;
|
import it.integry.integrywmsnative.core.utility.UtilityGson;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class SystemRESTConsumer extends _BaseRESTConsumer {
|
public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
private final ExecutorService executorService;
|
||||||
|
private final RESTBuilder restBuilder;
|
||||||
|
|
||||||
|
public SystemRESTConsumer(ExecutorService executorService, RESTBuilder restBuilder) {
|
||||||
|
this.executorService = executorService;
|
||||||
|
this.restBuilder = restBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LatestAppVersionInfoDTO retrieveUpdatesInfoSynchronized(boolean betaVersion) throws Exception {
|
||||||
|
SystemRESTConsumerService systemRESTConsumerService = restBuilder.getService(SystemRESTConsumerService.class);
|
||||||
|
var response = systemRESTConsumerService.retrieveUpdatesInfo(betaVersion ? "beta" : null)
|
||||||
|
.execute();
|
||||||
|
|
||||||
|
if (response.code() == 404) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return analyzeAnswerGeneric(response, "updates");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void registerDevice(final Runnable onSuccess, final RunnableArgs<Exception> onFailed) {
|
public void registerDevice(final Runnable onSuccess, final RunnableArgs<Exception> onFailed) {
|
||||||
RegisterDeviceRequestDTO registerDeviceRequestDTO = new RegisterDeviceRequestDTO()
|
RegisterDeviceRequestDTO registerDeviceRequestDTO = new RegisterDeviceRequestDTO()
|
||||||
.setApp("WMS");
|
.setApp("WMS");
|
||||||
|
|
||||||
SystemRESTConsumerService systemRESTConsumerService = RESTBuilder.getService(SystemRESTConsumerService.class);
|
SystemRESTConsumerService systemRESTConsumerService = restBuilder.getService(SystemRESTConsumerService.class);
|
||||||
systemRESTConsumerService.registerDevice(registerDeviceRequestDTO)
|
systemRESTConsumerService.registerDevice(registerDeviceRequestDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
analyzeAnswer(response, "device/register", Void -> onSuccess.run(), onFailed);
|
analyzeAnswer(response, "device/register", Void -> onSuccess.run(), onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, @NonNull final Exception e) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> void processSql(String nativeSql, final Type clazz, final RunnableArgs<T> onComplete, final RunnableArgs<Exception> onFailed) {
|
public <T> void processSql(String nativeSql, final Type clazz, final RunnableArgs<T> onComplete, final RunnableArgs<Exception> onFailed) {
|
||||||
NativeSqlRequestDTO nativeSqlDTO = new NativeSqlRequestDTO();
|
NativeSqlRequestDTO nativeSqlDTO = new NativeSqlRequestDTO()
|
||||||
nativeSqlDTO.nativeSql = nativeSql;
|
.setNativeSql(nativeSql);
|
||||||
|
|
||||||
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
SystemRESTConsumerService service = restBuilder.getService(SystemRESTConsumerService.class);
|
||||||
service
|
service
|
||||||
.processSql(nativeSqlDTO)
|
.processSql(nativeSqlDTO)
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
analyzeAnswer(response, "ProcessSql", o -> {
|
analyzeAnswer(response, "ProcessSql", o -> {
|
||||||
@@ -87,30 +103,24 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, @NonNull final Exception e) {
|
||||||
Logger.e(t, "ProcessSQL");
|
onFailed.run(e);
|
||||||
|
|
||||||
if (t instanceof ConnectException)
|
|
||||||
onFailed.run(new InvalidConnectionException(RESTBuilder.getDefaultHost(), RESTBuilder.getDefaultPort(), t));
|
|
||||||
else
|
|
||||||
onFailed.run(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void getAvailableCodMdeps(final RunnableArgs<List<AvailableCodMdepsDTO>> onSuccess, RunnableArgs<Exception> onFailed) {
|
public void getAvailableCodMdeps(final RunnableArgs<List<AvailableCodMdepsDTO>> onSuccess, RunnableArgs<Exception> onFailed) {
|
||||||
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
SystemRESTConsumerService service = restBuilder.getService(SystemRESTConsumerService.class);
|
||||||
service.getAvailableCodMdeps().enqueue(new Callback<>() {
|
service.getAvailableCodMdeps().enqueue(new ManagedErrorCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> call, Response<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> call, Response<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> response) {
|
||||||
analyzeAnswer(response, "CodMdepsAvailable", onSuccess, onFailed);
|
analyzeAnswer(response, "CodMdepsAvailable", onSuccess, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> call, final Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> call, @NonNull final Exception e) {
|
||||||
Log.e("CodMdepsAvailable", t.toString());
|
onFailed.run(e);
|
||||||
onFailed.run(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -145,20 +155,19 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void sendMailSynchronized(MailRequestDTO mailDTO) throws Exception {
|
||||||
|
SystemRESTConsumerService service = restBuilder.getService(SystemRESTConsumerService.class);
|
||||||
|
var response = service.sendMail(mailDTO).execute();
|
||||||
|
analyzeAnswer(response, "sendMail");
|
||||||
|
}
|
||||||
|
|
||||||
public void sendMail(MailRequestDTO mailDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void sendMail(MailRequestDTO mailDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
executorService.execute(() -> {
|
||||||
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
try {
|
||||||
service.sendMail(mailDTO).enqueue(new Callback<>() {
|
sendMailSynchronized(mailDTO);
|
||||||
@Override
|
|
||||||
public void onResponse(Call<ServiceRESTResponse<String>> call, Response<ServiceRESTResponse<String>> response) {
|
|
||||||
if (onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
}
|
} catch (Exception ex) {
|
||||||
|
if (onFailed != null) onFailed.run(ex);
|
||||||
@Override
|
|
||||||
public void onFailure(Call<ServiceRESTResponse<String>> call, Throwable t) {
|
|
||||||
if (onFailed != null) {
|
|
||||||
onFailed.run(new Exception(t));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.MailRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
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.rest.model.system.RegisterDeviceRequestDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.http.Body;
|
import retrofit2.http.Body;
|
||||||
@@ -15,6 +16,9 @@ import retrofit2.http.Query;
|
|||||||
|
|
||||||
public interface SystemRESTConsumerService {
|
public interface SystemRESTConsumerService {
|
||||||
|
|
||||||
|
@GET("wms/currentVersion")
|
||||||
|
Call<LatestAppVersionInfoDTO> retrieveUpdatesInfo(@Query("suffix") String suffix);
|
||||||
|
|
||||||
@POST("device/register")
|
@POST("device/register")
|
||||||
Call<ServiceRESTResponse<Void>> registerDevice(@Body RegisterDeviceRequestDTO registerDeviceRequestDTO);
|
Call<ServiceRESTResponse<Void>> registerDevice(@Body RegisterDeviceRequestDTO registerDeviceRequestDTO);
|
||||||
|
|
||||||
@@ -28,6 +32,6 @@ public interface SystemRESTConsumerService {
|
|||||||
Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> getAvailableCodMdeps();
|
Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> getAvailableCodMdeps();
|
||||||
|
|
||||||
@POST("sendEmail")
|
@POST("sendEmail")
|
||||||
Call<ServiceRESTResponse<String>> sendMail(@Body MailRequestDTO mailDto);
|
Call<ServiceRESTResponse<Void>> sendMail(@Body MailRequestDTO mailDto);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.VtbVett;
|
||||||
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
public class VettoriRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
private final RESTBuilder restBuilder;
|
||||||
|
private final ExecutorService executorService;
|
||||||
|
|
||||||
|
public VettoriRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
|
||||||
|
this.restBuilder = restBuilder;
|
||||||
|
this.executorService = executorService;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<VtbVett> retrieveRecentlyUsedInOrdersSyncronized(GestioneEnum gestione) throws Exception {
|
||||||
|
var service = restBuilder.getService(VettoriRESTConsumerService.class);
|
||||||
|
Response<ServiceRESTResponse<List<VtbVett>>> response = service.retrieveRecentlyUsedInOrders(gestione)
|
||||||
|
.execute();
|
||||||
|
|
||||||
|
return analyzeAnswer(response, "retrieveRecentlyUsedInOrders");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void retrieveRecentlyUsedInOrders(GestioneEnum gestione, RunnableArgs<List<VtbVett>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
executorService.execute(() -> {
|
||||||
|
try {
|
||||||
|
var response = retrieveRecentlyUsedInOrdersSyncronized(gestione);
|
||||||
|
if (onComplete != null) onComplete.run(response);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
if (onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.VtbVett;
|
||||||
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface VettoriRESTConsumerService {
|
||||||
|
|
||||||
|
@GET("wms/vettore/recentlyUsedInOrders")
|
||||||
|
Call<ServiceRESTResponse<List<VtbVett>>> retrieveRecentlyUsedInOrders(@Query("gestione") GestioneEnum gestioneEnum);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.exception.InvalidLicenseException;
|
import it.integry.integrywmsnative.core.exception.InvalidLicenseException;
|
||||||
|
import it.integry.integrywmsnative.core.exception.UnauthorizedAccessException;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.rest.CommonRESTException;
|
import it.integry.integrywmsnative.core.rest.CommonRESTException;
|
||||||
import it.integry.integrywmsnative.core.rest.model.EsitoType;
|
import it.integry.integrywmsnative.core.rest.model.EsitoType;
|
||||||
@@ -15,6 +16,32 @@ import retrofit2.Response;
|
|||||||
|
|
||||||
public abstract class _BaseRESTConsumer {
|
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 {
|
public static <T> T analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle) throws Exception {
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
if (response.body() != null) {
|
if (response.body() != null) {
|
||||||
@@ -39,7 +66,10 @@ public abstract class _BaseRESTConsumer {
|
|||||||
throw new Exception(response.message());
|
throw new Exception(response.message());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (response.code() == 404) {
|
if (response.code() == 401) {
|
||||||
|
Log.e(logTitle, "Errore " + response.code() + ": Accesso non autorizzato. Si prega di controllare le credenziali e riprovare");
|
||||||
|
throw new UnauthorizedAccessException();
|
||||||
|
} else if (response.code() == 404) {
|
||||||
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url() + ")");
|
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url() + ")");
|
||||||
throw new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")");
|
throw new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")");
|
||||||
} else if (response.code() == 550)
|
} else if (response.code() == 550)
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import java.lang.reflect.Type;
|
|||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
|
||||||
public class LocalDateDeserializer implements JsonDeserializer<LocalDate> {
|
public class LocalDateDeserializer implements JsonDeserializer<LocalDate> {
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.deserializer;
|
||||||
|
|
||||||
|
import com.google.gson.JsonDeserializationContext;
|
||||||
|
import com.google.gson.JsonDeserializer;
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
import com.google.gson.JsonParseException;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||||
|
|
||||||
|
public class MtbTcolFlagUiUlDeserializer implements JsonDeserializer<MtbTCol.FlagUiUlEnum> {
|
||||||
|
@Override
|
||||||
|
public MtbTCol.FlagUiUlEnum deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
||||||
|
if (json.isJsonNull()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String text = json.getAsString();
|
||||||
|
return MtbTCol.FlagUiUlEnum.fromString(text);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
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 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(call.request().url().host(), call.request().url().port(), 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);
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user