Compare commits

...

131 Commits

Author SHA1 Message Date
af5d19eb55 Finish v1.32.08(348) 2023-03-14 11:33:23 +01:00
b0a7a93f85 -> v1.32.08 (348) 2023-03-14 11:33:04 +01:00
10f888b5d5 [ESSEGRANDE] Miglioramenti alla sync degli inventari 2023-03-14 11:32:11 +01:00
95807fbfbc Finish v1.32.07(347) 2023-03-13 19:25:07 +01:00
4317e083a6 Finish v1.32.07(347) 2023-03-13 19:25:07 +01:00
0c54a32e39 -> v1.32.07 (347) 2023-03-13 19:25:00 +01:00
62dc62aa99 Fix sull'eliminazione di un documento interno 2023-03-13 19:23:52 +01:00
2182a970ac Finish v1.32.06(346) 2023-03-13 18:19:30 +01:00
9b823fdca8 Finish v1.32.06(346) 2023-03-13 18:19:30 +01:00
904c825472 -> v1.32.06 (346) 2023-03-13 18:19:24 +01:00
a15d225998 Rinominati servizi giacenza 2023-03-13 18:18:50 +01:00
e3b8373bb9 Finish v1.32.05(345) 2023-03-13 16:32:01 +01:00
0cdbbc096c Finish v1.32.05(345) 2023-03-13 16:32:00 +01:00
895c21cee4 -> v1.32.05 (345) 2023-03-13 16:31:55 +01:00
d541761ac6 Sistemata creazione documento solo per colli rettificati V- 2023-03-13 16:31:22 +01:00
72773deaf1 Implementato nuovo servizio di modifica righe UDS (rimossa processEntity) 2023-03-10 12:34:43 +01:00
165568b7e3 Finish v1.32.04(344) 2023-03-08 17:20:07 +01:00
3396e295fa Finish v1.32.04(344) 2023-03-08 17:20:06 +01:00
0f3f593abd -> v1.32.04 (344) 2023-03-08 17:19:59 +01:00
df48ea3b32 Fix su stbGestSetup nulle 2023-03-08 17:19:27 +01:00
5e52d83c40 Finish v1.32.03(343) 2023-03-07 18:49:58 +01:00
0a71f54814 Finish v1.32.03(343) 2023-03-07 18:49:57 +01:00
c18828cdda -> v1.32.03 (343) 2023-03-07 18:49:52 +01:00
92073fa8bb Aggiunta gestione del protocollo in AppUpdater 2023-03-07 18:49:21 +01:00
4131dd7e97 Finish v1.32.02(342) 2023-03-07 18:16:23 +01:00
3c4fdea0ec Finish v1.32.02(342) 2023-03-07 18:16:22 +01:00
71c73e8cde -> v1.32.02 (342) 2023-03-07 18:16:16 +01:00
1a66d4f541 Fix per retrieve ordini lavorazione/produzione 2023-03-07 18:15:01 +01:00
d9c33dc5f5 Vario per Essegrande 2023-03-07 17:57:42 +01:00
1edcba63aa Finish v1.32.01(341) 2023-03-03 14:01:23 +01:00
2566311f96 Finish v1.32.01(341) 2023-03-03 14:01:23 +01:00
c01cbc1bac -> v1.32.01 (341) 2023-03-03 14:01:00 +01:00
9c95b107d5 Sostituita vecchia getElencoArticoli dei documenti con nuovo servizio 2023-03-03 13:59:31 +01:00
c2e1c048be Finish v1.32.00(340) 2023-03-02 11:51:51 +01:00
c3bfe70093 Finish v1.32.00(340) 2023-03-02 11:51:50 +01:00
a6cb8c9c9c -> v1.32.00 (340) 2023-03-02 11:51:43 +01:00
5908e076a4 Gestita parzialmente rotazione schermo 2023-03-02 11:50:09 +01:00
4445e9aff2 Rimossa domanda di cambio posizione per le rettifiche di spedizione. Cambiata response di save doc in rettifica di spedizione. 2023-03-02 11:10:03 +01:00
9cd0855dcf Refactoring dialog di filtro dei documenti interni 2023-03-01 19:59:27 +01:00
d807ab1f31 Completata chiamata di saveDoc in fase di Rettifica spedizione 2023-02-24 19:32:36 +01:00
69b88b1f6d Sistemata UI del log esportato via Mail 2023-02-24 19:05:39 +01:00
35f1495ebc Sostituite icone da PNG a SVG. Implementata voce di Rettifica spedizione che carica colli V. 2023-02-24 16:46:36 +01:00
7fdc964687 Finish v1.31.05(339) 2023-02-24 16:03:10 +01:00
8322303351 Finish v1.31.05(339) 2023-02-24 16:03:10 +01:00
a7f5f5f505 -> v1.31.05 (339) 2023-02-24 16:03:03 +01:00
9b1a00d09c Fix su creazione nuova UDS nel caso in cui non è presente la data cons 2023-02-24 16:02:19 +01:00
72ebf8f135 Finish v1.31.04(338) 2023-02-23 14:05:29 +01:00
be58e333b6 Finish v1.31.04(338) 2023-02-23 14:05:28 +01:00
42620bd324 -> v1.31.04 (338) 2023-02-23 14:05:18 +01:00
d4deade046 Ripristinata rimozione dalla sessione dei colli il collo correttamente chiuso 2023-02-23 14:04:44 +01:00
846393304a Finish v1.31.03(337) 2023-02-20 17:28:58 +01:00
c3ceae8027 Finish v1.31.03(337) 2023-02-20 17:28:58 +01:00
7b4d7db265 -> v1.31.03 (337) 2023-02-20 17:28:51 +01:00
1c6cf9a02b Fix su protocol null per le chiamate rest nel caso in cui l'app abbia già una sessione utente avviata 2023-02-20 17:28:04 +01:00
fd2d4fb47b Finish v1.31.02(336) 2023-02-20 17:12:40 +01:00
094f9b68f6 Finish v1.31.02(336) 2023-02-20 17:12:39 +01:00
be418d3d26 -> v1.31.02 (336) 2023-02-20 17:12:35 +01:00
25813a6362 Sistemata gestione delle eccezioni non gestite e creato sistema di esportazione Log 2023-02-20 17:10:50 +01:00
51c5d3a0c7 Merge remote-tracking branch 'origin/develop' into develop 2023-02-20 11:35:22 +01:00
e964220655 Implementata retrieve inventari 2023-02-20 11:35:17 +01:00
e493f1796b Implementata retrieve inventari 2023-02-20 11:34:51 +01:00
4882645311 Little refactoring per Essegrande 2023-02-15 20:10:47 +01:00
468f1e5b58 Finish v1.31.1(335) 2023-02-14 12:20:17 +01:00
79add4f60a Finish v1.31.1(335) 2023-02-14 12:20:17 +01:00
975763f400 -> v1.31.1 (335) 2023-02-14 12:20:11 +01:00
5eac3f14cc BugFix Picking da ordine: errore in caso di lista commesse vuota 2023-02-14 12:19:16 +01:00
bed5b36ade Finish v1.31.0(334) 2023-02-14 11:42:10 +01:00
7678ce1a50 Finish v1.31.0(334) 2023-02-14 11:42:10 +01:00
b3faf38455 -> v1.31.0 (334) 2023-02-14 11:42:05 +01:00
283cb59d42 rimosse configurazioni di esecuzione non utilizzate e corretta gestione setup 2023-02-14 11:41:05 +01:00
1867ac8742 Rimossa parte delle dynamic feature 2023-02-14 11:13:10 +01:00
d210e3b3e0 Rimossa parte delle dynamic feature 2023-02-14 11:00:33 +01:00
8bb2f48090 Finish v1.30.15(333) 2023-02-13 17:48:27 +01:00
15b4d728e6 Finish v1.30.15(333) 2023-02-13 17:48:27 +01:00
3018123110 -> v1.30.15 (333) 2023-02-13 17:48:01 +01:00
b02eaf02a8 aggiornamento progetto a AGP 8.1 2023-02-13 17:46:57 +01:00
ad9795a3a3 test compilazione jenkins con desugaring 2023-02-13 14:25:56 +01:00
170411383f Finish v1.30.14(332) 2023-02-13 13:09:26 +01:00
9e87130d6c Finish v1.30.14(332) 2023-02-13 13:09:26 +01:00
0f6a9cdae2 -> v1.30.14 (332) 2023-02-13 13:09:20 +01:00
79ec6430f6 implementata libreria compatibilità LocalDate 2023-02-13 13:08:09 +01:00
0c46fb09c1 Finish v1.30.13(331) 2023-02-13 11:59:27 +01:00
8aad7337bf Finish v1.30.13(331) 2023-02-13 11:59:27 +01:00
c49197d002 -> v1.30.13 (331) 2023-02-13 11:59:20 +01:00
16f611c147 Merge branch 'master' into develop 2023-02-13 11:56:18 +01:00
7b623913d8 Aggiunto controllo in avvio chiamate rest per evitare che i terminali con android inferiore all'8.0 2023-02-13 11:56:03 +01:00
0a8997f30b Finish v1.30.12(330)#2 2023-02-09 12:09:36 +01:00
702d0a7348 Finish v1.30.12(330)#2 2023-02-09 12:09:36 +01:00
f4ae1fbed3 -> v1.30.12 (330) #2 2023-02-09 12:09:29 +01:00
8c0639be9b Finish v1.30.12(330) 2023-02-09 12:08:34 +01:00
c9ea13a1d2 Finish v1.30.12(330) 2023-02-09 12:08:34 +01:00
bef5423a06 -> v1.30.12 (330) 2023-02-09 12:08:28 +01:00
22b072aff7 Fix su nessun elemento selezionato in DialogChooseArtsFromMtbColrList 2023-02-09 12:07:50 +01:00
50acee47e9 Finish v1.30.11(329) 2023-02-08 17:29:03 +01:00
ba041d1133 Finish v1.30.11(329) 2023-02-08 17:29:03 +01:00
21c26ab3ad -> v1.30.11 (329) 2023-02-08 17:28:55 +01:00
5288ad8bb0 Fix su qta inviate al magazzino automatico 2023-02-08 17:15:47 +01:00
0ccff458f7 Finish v1.30.10(328) 2023-02-08 10:56:46 +01:00
a1c8a52dd2 Finish v1.30.10(328) 2023-02-08 10:56:45 +01:00
e6e8b22554 -> v1.30.10 (328) 2023-02-08 10:56:35 +01:00
9371e5824f Implementato pick extra item sui magazzini automatici 2023-02-08 10:55:33 +01:00
bda1328dec Migliorie nel KeyboardEmulatorBarcodeReader 2023-02-06 18:36:15 +01:00
2030893249 Finish Hotfix-1 2023-02-06 12:59:21 +01:00
fa695ca9a4 Merge branch 'master' into develop 2023-02-06 12:59:21 +01:00
8b9c9437ae -> v1.30.09 (327) #2 2023-02-06 12:59:11 +01:00
6f026145ef Finish v1.30.09(327) 2023-02-06 12:43:23 +01:00
0744d3713e Finish v1.30.09(327) 2023-02-06 12:43:23 +01:00
3275422af8 -> v1.30.09 (327) 2023-02-06 12:43:12 +01:00
a49aab1fb0 Implementata gestione del magazzino automatico in posizionamento merce 2023-02-06 12:33:15 +01:00
e25cc9e825 Refactoring DialogChooseArtsFromMtbColr 2023-02-06 10:46:46 +01:00
92e9529cc5 Merge remote-tracking branch 'origin/develop' into develop 2023-02-02 19:49:25 +01:00
7990f38c37 Completata implementazione del magazzino automatico in Picking Libero 2023-02-02 19:49:18 +01:00
134dff5aba Merge remote-tracking branch 'origin/develop' into develop 2023-02-02 16:47:52 +01:00
0c359e5110 [CARELLI - ORDINI ACQUISTO]
- incrementato tempo di timeout in salvataggio per evitare che gli operatori salvino più volte lo stesso ordine in caso di errore
- aggiunto controllo in caso di qtaProporta nulla
2023-02-02 16:47:44 +01:00
7b913e607e Completata implementazione del magazzino automatico in Picking di Uscita 2023-01-30 19:11:33 +01:00
ee5d30ff80 Rinominato DialogChooseArtsFromListaArts in DialogChooseArtsFromMtbColrList 2023-01-27 10:09:42 +01:00
6c41506a97 Prima implementazione magazzino automatico 2023-01-25 17:44:32 +01:00
ab14d6736c Refactoring dei servizi utilizzati nelle gestioni di Lavorazione / Vendita.
Fix su scansione articoli in Documenti Interni.
2023-01-25 17:11:25 +01:00
b6c82c869e Merge tag 'v1.30.07__325' into develop
v1.30.07 (325)
2023-01-16 12:17:23 +01:00
f3f04e9473 Merge branch 'release/v1.30.07__325' 2023-01-16 12:17:22 +01:00
ef753f9bcd -> v1.30.07 (325) 2023-01-16 12:15:20 +01:00
e764ad1148 Implementata gestione Ean Peso in rettifica giacenze 2023-01-16 11:42:24 +01:00
82cc4f989c Finish v1.30.06__324 2022-12-27 19:05:57 +01:00
650d1670de Finish v1.30.06__324 2022-12-27 19:05:57 +01:00
6ca7943d78 -> v1.30.06 (324) 2022-12-27 19:05:47 +01:00
013646eae3 [CARELLI - ORDINI ACQUISTI] rimossa data cons in salvataggio ordini 2022-12-27 19:03:20 +01:00
341359d871 Merge branch 'release/v1.30.05__323' 2022-12-16 12:54:12 +01:00
545081444c Merge tag 'v1.30.05__323' into develop
v1.30.05__323
2022-12-16 12:54:12 +01:00
b35819c9c9 -> v1.30.05 (323) 2022-12-16 12:52:13 +01:00
ec44275e41 aggiunto destinatario in creazione documenti trasferimento
corretta gestione modifica articolo in ordini acquisto pv
2022-12-16 12:50:56 +01:00
f5d78edfd1 Merge tag 'v1.30.04__322' into develop
v1.30.04__322
2022-12-15 16:20:44 +01:00
308 changed files with 7426 additions and 5128 deletions

View File

@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<runningDeviceTargetSelectedWithDropDown>
<Target>
<type value="RUNNING_DEVICE_TARGET" />
<deviceKey>
<Key>
<type value="SERIAL_NUMBER" />
<value value="20119B1E55" />
</Key>
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2022-12-12T15:40:54.351888Z" />
</component>
</project>

15
.idea/git_toolbox_prj.xml generated Normal file
View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GitToolBoxProjectSettings">
<option name="commitMessageIssueKeyValidationOverride">
<BoolValueOverride>
<option name="enabled" value="true" />
</BoolValueOverride>
</option>
<option name="commitMessageValidationEnabledOverride">
<BoolValueOverride>
<option name="enabled" value="true" />
</BoolValueOverride>
</option>
</component>
</project>

View File

@@ -0,0 +1,8 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true">
<option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,com.annimon.stream.Stream,of" />
</inspection_tool>
</profile>
</component>

6
.idea/kotlinc.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="1.8.0" />
</component>
</project>

View File

@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="app_base" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
<module name="WMS.app" />
<configuration default="false" name="app" type="AndroidRunConfigurationType" factoryName="Android App">
<module name="WMS.app.main" />
<option name="DEPLOY" value="true" />
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
<option name="DEPLOY_AS_INSTANT" value="false" />
@@ -8,13 +8,12 @@
<option name="PM_INSTALL_OPTIONS" value="" />
<option name="ALL_USERS" value="false" />
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS.dynamic_vgalimenti" />
<option name="CLEAR_APP_STORAGE" value="false" />
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS.dynamic__base,WMS.dynamic_vgalimenti" />
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
<option name="MODE" value="default_activity" />
<option name="CLEAR_LOGCAT" value="true" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
<option name="FORCE_STOP_RUNNING_APP" value="true" />
<option name="CLEAR_LOGCAT" value="false" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
<option name="INSPECTION_WITHOUT_ACTIVITY_RESTART" value="false" />
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
@@ -46,7 +45,7 @@
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
<option name="STARTUP_PROFILING_ENABLED" value="false" />
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Callstack Sample" />
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Java/Kotlin Method Sample (legacy)" />
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
</Profilers>

View File

@@ -1,61 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="app_vglimenti" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
<module name="WMS.app" />
<option name="DEPLOY" value="true" />
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
<option name="DEPLOY_AS_INSTANT" value="false" />
<option name="ARTIFACT_NAME" value="" />
<option name="PM_INSTALL_OPTIONS" value="" />
<option name="ALL_USERS" value="false" />
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS.dynamic__base" />
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
<option name="MODE" value="default_activity" />
<option name="CLEAR_LOGCAT" value="true" />
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
<option name="FORCE_STOP_RUNNING_APP" value="true" />
<option name="INSPECTION_WITHOUT_ACTIVITY_RESTART" value="false" />
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
<option name="DEBUGGER_TYPE" value="Auto" />
<Auto>
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
<option name="SHOW_STATIC_VARS" value="true" />
<option name="WORKING_DIR" value="" />
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
</Auto>
<Hybrid>
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
<option name="SHOW_STATIC_VARS" value="true" />
<option name="WORKING_DIR" value="" />
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
</Hybrid>
<Java />
<Native>
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
<option name="SHOW_STATIC_VARS" value="true" />
<option name="WORKING_DIR" value="" />
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
</Native>
<Profilers>
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
<option name="STARTUP_PROFILING_ENABLED" value="false" />
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Callstack Sample" />
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
</Profilers>
<option name="DEEP_LINK" value="" />
<option name="ACTIVITY_CLASS" value="" />
<option name="SEARCH_ACTIVITY_IN_GLOBAL_SCOPE" value="false" />
<option name="SKIP_ACTIVITY_VALIDATION" value="false" />
<method v="2">
<option name="Android.Gradle.BeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

View File

@@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
android {
def appVersionCode = 322
def appVersionName = '1.30.04'
def appVersionCode = 348
def appVersionName = '1.32.08'
signingConfigs {
release {
@@ -31,12 +31,12 @@ android {
}
}
compileSdkVersion 32
compileSdkVersion 33
defaultConfig {
applicationId "it.integry.integrywmsnative"
minSdkVersion 21
targetSdkVersion 32
targetSdkVersion 33
versionCode appVersionCode
versionName appVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -62,6 +62,7 @@ android {
}
android.buildFeatures.dataBinding true
android.buildFeatures.buildConfig true
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
@@ -85,9 +86,6 @@ android {
options.compilerArgs << "-Xmaxerrs" << "10000"
}
}
dynamicFeatures = [":dynamic__base", ":dynamic_vgalimenti"]
lint {
abortOnError false
}
@@ -97,6 +95,7 @@ android {
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.2'
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', {
exclude group: 'com.android.support', module: 'support-annotations'
@@ -115,9 +114,9 @@ dependencies {
implementation 'com.google.android.gms:play-services-basement:18.1.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
@@ -156,12 +155,12 @@ dependencies {
implementation 'com.github.pedromassango:doubleClick:3.0'
//SQLite ROOM
def room_version = "2.4.3"
def room_version = "2.5.0"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-rxjava3:$room_version"
androidTestImplementation "androidx.room:room-testing:2.4.3"
androidTestImplementation "androidx.room:room-testing:2.5.0"
//AppUpdate
implementation 'com.github.javiersantos:AppUpdater:2.7'
@@ -188,9 +187,6 @@ dependencies {
// RxJava is also required.
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.0'
}
repositories {

View File

@@ -2,7 +2,7 @@
"formatVersion": 1,
"database": {
"version": 13,
"identityHash": "bc3841159bac7a7731fe39a5fa4f0f4e",
"identityHash": "bef89b513f0a4d5ecd9c2111e2e614a4",
"entities": [
{
"tableName": "articoli_griglia",
@@ -112,10 +112,10 @@
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"articolo_griglia_id"
],
"autoGenerate": true
]
},
"indices": [
{
@@ -172,10 +172,10 @@
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"griglia_id"
],
"autoGenerate": true
]
},
"indices": [
{
@@ -262,10 +262,10 @@
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"ordine_id"
],
"autoGenerate": true
]
},
"indices": [],
"foreignKeys": []
@@ -366,10 +366,10 @@
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"articolo_ordine_id"
],
"autoGenerate": true
]
},
"indices": [
{
@@ -580,10 +580,10 @@
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"id"
],
"autoGenerate": true
]
},
"indices": [
{
@@ -829,10 +829,10 @@
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"id"
],
"autoGenerate": true
]
},
"indices": [
{
@@ -874,7 +874,7 @@
},
{
"tableName": "inventari",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `id_inventario` INTEGER, `cod_mdep` TEXT NOT NULL, `data_inventario` INTEGER, `data_reg` INTEGER, `data_ver` INTEGER, `filtro` TEXT, `flag_stato` TEXT, `flag_operazione` TEXT, `cod_anag` TEXT, `cod_dtip` TEXT, `inserito_da` TEXT, `registrato_da` TEXT, `verificato_da` TEXT, `data_ora_inizio` INTEGER, `data_ora_fine` INTEGER, `causale` TEXT, `zona` TEXT, `remote_sync_date` INTEGER)",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `id_inventario` INTEGER, `cod_mdep` TEXT NOT NULL, `data_inventario` INTEGER, `data_reg` INTEGER, `data_ver` INTEGER, `filtro` TEXT, `flag_stato` TEXT, `flag_operazione` TEXT, `cod_anag` TEXT, `cod_dtip` TEXT, `inserito_da` TEXT, `registrato_da` TEXT, `verificato_da` TEXT, `data_ora_inizio` INTEGER, `data_ora_fine` INTEGER, `causale` TEXT, `zona` TEXT, `new` INTEGER, `remote_sync_date` INTEGER)",
"fields": [
{
"fieldPath": "id",
@@ -984,6 +984,12 @@
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "isNew",
"columnName": "new",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "remoteSyncDate",
"columnName": "remote_sync_date",
@@ -992,10 +998,10 @@
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"_id"
],
"autoGenerate": true
]
},
"indices": [
{
@@ -1107,10 +1113,10 @@
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"_id"
],
"autoGenerate": true
]
},
"indices": [
{
@@ -1150,7 +1156,7 @@
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'bc3841159bac7a7731fe39a5fa4f0f4e')"
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'bef89b513f0a4d5ecd9c2111e2e614a4')"
]
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="32"
tools:ignore="ScopedStorage" />
<application
android:name=".MainApplication"
android:allowBackup="true"
@@ -23,28 +33,28 @@
android:requestLegacyExternalStorage="true">
<activity
android:name=".gest.spedizione.SpedizioneActivity"
android:screenOrientation="portrait"
android:theme="@style/Light"
android:windowSoftInputMode="adjustNothing" />
android:windowSoftInputMode="adjustNothing"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity"
android:screenOrientation="portrait"
android:theme="@style/Light"
android:windowSoftInputMode="adjustNothing" />
android:windowSoftInputMode="adjustNothing"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.prod_dettaglio_linea.ProdDettaglioLineaActivity"
android:screenOrientation="portrait"
android:theme="@style/Light"
android:windowSoftInputMode="adjustNothing" />
android:windowSoftInputMode="adjustNothing"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
android:screenOrientation="portrait"
android:theme="@style/Light"
android:windowSoftInputMode="adjustNothing" />
android:windowSoftInputMode="adjustNothing"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.picking_resi.PickingResiActivity"
android:screenOrientation="portrait"
android:theme="@style/Light" />
android:theme="@style/Light"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.main.MainActivity"
android:theme="@style/Light"
@@ -56,30 +66,31 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".gest.accettazione_picking.AccettazionePickingActivity"
android:screenOrientation="portrait"
android:theme="@style/Light"
android:windowSoftInputMode="adjustNothing" />
<activity
android:name=".gest.login.LoginActivity"
android:theme="@style/Light" />
android:theme="@style/Light"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.accettazione_picking.AccettazionePickingActivity"
android:theme="@style/Light"
android:windowSoftInputMode="adjustNothing"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.lista_bancali.ListaBancaliActivity"
android:label="@string/activity_lista_bancali_title"
android:screenOrientation="portrait"
android:theme="@style/Light" />
android:theme="@style/Light"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.contenuto_bancale.ContenutoBancaleActivity"
android:label="@string/activity_contenuto_bancale_title"
android:screenOrientation="portrait"
android:theme="@style/Light" />
android:theme="@style/Light"
android:configChanges="orientation|screenSize|keyboardHidden" />
<activity
android:name=".gest.inventario.picking.PickingInventarioActivity"
android:label="@string/activity_picking_inventario_title"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustNothing"
android:theme="@style/Light"/>
android:theme="@style/Light"
android:configChanges="orientation|screenSize|keyboardHidden"/>
<meta-data
android:name="firebase_crashlytics_collection_enabled"

View File

@@ -3,11 +3,13 @@ package it.integry.integrywmsnative;
import android.app.Application;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.util.Log;
import javax.inject.Inject;
import it.integry.integrywmsnative.core.context.AppContext;
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
import it.integry.integrywmsnative.core.utility.UtilityLogger;
public class MainApplication extends Application {
@@ -19,6 +21,8 @@ public class MainApplication extends Application {
public static MainApplicationModule appModule;
public static RoomModule roomModule;
private Thread.UncaughtExceptionHandler defaultUncaughtExceptionHandler;
@Inject
AppContext appContext;
@@ -40,6 +44,9 @@ public class MainApplication extends Application {
appComponent.inject(this);
res = getResources();
defaultUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler(_unCaughtExceptionHandler);
}
// Called by the system when the device configuration changes while your component is running.
@@ -61,4 +68,22 @@ public class MainApplication extends Application {
System.exit(0);
}
// handler listener
private Thread.UncaughtExceptionHandler _unCaughtExceptionHandler =
new Thread.UncaughtExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable ex) {
try {
UtilityLogger.error(new Exception(ex));
} catch (Exception e) {
Log.e("Uncaught error", "Exception Logger failed!", e);
//MainApplication.exit();
}
// re-throw critical exception further to the os (important)
defaultUncaughtExceptionHandler.uncaughtException(thread, ex);
}
};
}

View File

@@ -74,6 +74,8 @@ import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigl
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.dialogs.DialogScanGrigliaAcquistoComponent;
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeComponent;
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeModule;
import it.integry.integrywmsnative.gest.settings.MainSettingsComponent;
import it.integry.integrywmsnative.gest.settings.MainSettingsModule;
import it.integry.integrywmsnative.gest.spedizione.SpedizioneComponent;
import it.integry.integrywmsnative.gest.spedizione.SpedizioneModule;
import it.integry.integrywmsnative.gest.spedizione.dialogs.print_sscc_list.DialogPrintOrderSSCCListComponent;
@@ -92,8 +94,10 @@ import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetM
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalModule;
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteComponent;
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteModule;
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsComponent;
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsModule;
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromMtbAartListComponent;
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromMtbAartListModule;
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_mtbcolr_list.DialogChooseArtsFromMtbColrListComponent;
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_mtbcolr_list.DialogChooseArtsFromMtbColrListModule;
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotComponent;
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotModule;
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialogComponent;
@@ -148,7 +152,7 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
ProdOrdineProduzioneElencoModule.class,
ProdRecuperoMaterialeModule.class,
ProdVersamentoMaterialeModule.class,
DialogChooseArtsFromListaArtsModule.class,
DialogChooseArtsFromMtbColrListModule.class,
DocInterniModule.class,
DialogSelectDocInfoModule.class,
DocInterniEditFormModule.class,
@@ -166,6 +170,9 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
BottomSheetInventarioActionsModule.class,
BottomSheetInventarioRowActionsModule.class,
BottomSheetMtbColrEditModalModule.class,
DialogChooseArtsFromMtbAartListModule.class,
MainSettingsModule.class,
})
public interface MainApplicationComponent {
@@ -243,11 +250,11 @@ public interface MainApplicationComponent {
ProdVersamentoMaterialeComponent.Factory prodVersamentoMaterialeComponent();
DialogChooseArtsFromListaArtsComponent.Factory dialogChooseArtsFromListaArtsComponent();
DialogChooseArtsFromMtbColrListComponent.Factory dialogChooseArtsFromListaArtsComponent();
DocInterniComponent.Factory docInterniComponent();
DialogSelectDocInfoComponent.Factory dialogSelectMgrpDtipPairComponent();
DialogSelectDocInfoComponent.Factory dialogSelectDocInfoNewViewComponent();
DialogSelectDocRowsComponent.Factory dialogSelectDocRowsComponent();
@@ -279,6 +286,10 @@ public interface MainApplicationComponent {
BottomSheetMtbColrEditModalComponent.Factory bottomSheetMtbColrEditModalComponent();
DialogChooseArtsFromMtbAartListComponent.Factory dialogDialogDialogChooseArtsFromMtbAartListViewComponent();
MainSettingsComponent.Factory mainSettingsFragmentComponent();
void inject(MainApplication mainApplication);
void inject(AppContext mainApplication);

View File

@@ -22,13 +22,16 @@ import it.integry.integrywmsnative.core.menu.MenuService;
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.AziendaRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.ColliSpedizioneRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.CommessaRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.DocumentiRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.DocumentRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.EntityRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoAutomaticoRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
@@ -250,8 +253,26 @@ public class MainApplicationModule {
@Provides
@Singleton
DocumentiRESTConsumer provideDocumentiRESTConsumer() {
return new DocumentiRESTConsumer();
DocumentRESTConsumer provideDocumentiRESTConsumer() {
return new DocumentRESTConsumer();
}
@Provides
@Singleton
ColliSpedizioneRESTConsumer provideColliSpedizioneRESTConsumer() {
return new ColliSpedizioneRESTConsumer();
}
@Provides
@Singleton
ColliLavorazioneRESTConsumer provideColliLavorazioneRESTConsumer() {
return new ColliLavorazioneRESTConsumer();
}
@Provides
@Singleton
MagazzinoAutomaticoRESTConsumer provideMagazzinoAutomaticoRESTConsumer() {
return new MagazzinoAutomaticoRESTConsumer();
}
}

View File

@@ -5,8 +5,9 @@ public class CommonConst {
public static class Login {
public static class Azienda {
public static String protocol = "https";
public static String host = "www2.studioml.it";
public static int port = 80;
public static int port = 443;
}
}

View File

@@ -14,7 +14,6 @@ import java.util.List;
import it.integry.barcode_base_android_library.interfaces.BarcodeReaderInterface;
import it.integry.barcode_base_android_library.model.BarcodeSetting;
import it.integry.honeywellscannerlibrary.HoneyWellBarcodeReader;
import it.integry.integrywmsnative.core.utility.UtilityLogger;
import it.integry.integrywmsnative.gest.settings.MainSettingsFragment;
import it.integry.keyobardemulatorscannerlibrary.KeyboardEmulatorBarcodeReader;
import it.integry.pointmobilescannerlibrary.PointMobileBarcodeReader;
@@ -136,12 +135,12 @@ public class BarcodeManager {
public static void disable() {
mEnabled = false;
UtilityLogger.trace("Barcode reader disabled");
// UtilityLogger.info("Barcode reader disabled");
}
public static void enable() {
mEnabled = true;
UtilityLogger.trace("Barcode reader enabled");
// UtilityLogger.info("Barcode reader enabled");
}
public static boolean isEnabled() {

View File

@@ -1,29 +0,0 @@
package it.integry.integrywmsnative.core.class_router;
import java.util.HashMap;
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
import it.integry.integrywmsnative.core.utility.UtilityHashMap;
public class BaseCustomConfiguration implements ICustomConfiguration {
public static class Keys {
public static int FLAG_SHOW_COD_FORN_IN_SPEDIZIONE = 1;
public static int CUSTOM_DYNAMIC_VERSION_PATH = 2;
public static int FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC = 3;
}
protected HashMap<Integer, Object> configurations = new HashMap<>() {{
put(Keys.FLAG_SHOW_COD_FORN_IN_SPEDIZIONE, true);
put(Keys.FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC, false);
}};
@Override
public <T> T getConfig(int key) {
return UtilityHashMap.getValue(configurations, key);
}
}

View File

@@ -1,84 +0,0 @@
package it.integry.integrywmsnative.core.class_router;
import android.content.Context;
import android.util.Pair;
import java.util.ArrayList;
import java.util.List;
public class ClassRouter {
public enum PATH {
FILTRO_ORDINI_VENDITA,
ORDINI_VENDITA,
CUSTOM_CONFIGURATION,
BARCODE_CUSTOMIZATION
}
private static Context context;
private static List<Pair<PATH, Object>> mRouteClasses = new ArrayList<>();
public static void init() {
// ClassRouter.context = context;
}
private static boolean checkIClassExists(PATH path) {
boolean methodAlreadyDeclared = false;
for(int i = 0; i < mRouteClasses.size() && !methodAlreadyDeclared; i++) {
if(mRouteClasses.get(i).first == path) methodAlreadyDeclared = true;
}
return methodAlreadyDeclared;
}
private static int getClassIndex(PATH path) {
for(int i = 0; i < mRouteClasses.size(); i++) {
if(mRouteClasses.get(i).first == path) return i;
}
return -1;
}
public static void registerPath(PATH path, Class clazz) {
if(checkIClassExists(path)) {
//throw new MethodPathAlreadyDeclaredException(path);
}
try {
mRouteClasses.add(new Pair<>(path, clazz.newInstance()));
} catch (IllegalAccessException | InstantiationException e) {
e.printStackTrace();
}
}
public static void deregisterPath(PATH path) {
if(checkIClassExists(path)) {
mRouteClasses.remove(getClassIndex(path));
}
}
public static <T> T getInstance(PATH path) {
try {
if (!checkIClassExists(path)) {
// throw new MethodPathNotRegisteredException(path);
}
Object instance = mRouteClasses.get(getClassIndex(path)).second;
return (T)instance;
} catch (Exception ex) {
// UtilityExceptions.defaultException(null, ex, true);
}
return null;
}
}

View File

@@ -57,9 +57,17 @@ public class MenuConfiguration extends BaseMenuConfiguration {
.setCodMenu("MG046")
.setTitleText(R.string.vendita_title_fragment)
.setTitleIcon(R.drawable.ic_dashboard_spedizione)
.setDrawerIcon(R.drawable.ic_black_upload)
.setDrawerIcon(R.drawable.ic_upload)
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.VENDITA, null, -1, null)))
.addItem(new MenuItem()
.setID(R.id.nav_rettifica_spedizione)
.setCodMenu("MG064")
.setTitleText(R.string.rettifica_spedizione_fragment_title)
.setTitleIcon(R.drawable.ic_dashboard_rettifica_spedizione)
.setDrawerIcon(R.drawable.ic_rettifica_spedizione_drawer)
.setFragmentFactory(() -> RettificaGiacenzeFragment.newInstance(GestioneEnum.VENDITA)))
.addItem(new MenuItem()
.setID(R.id.nav_free_picking)
.setCodMenu("MG047")

View File

@@ -1,11 +0,0 @@
package it.integry.integrywmsnative.core.class_router.exceptions;
import it.integry.integrywmsnative.core.class_router.ClassRouter;
public class MethodPathNotRegisteredException extends Exception {
public MethodPathNotRegisteredException(ClassRouter.PATH path) {
super(String.format("Path %s is not registered", path.toString()));
}
}

View File

@@ -1,7 +0,0 @@
package it.integry.integrywmsnative.core.class_router.interfaces;
public interface IBarcodeCustomization {
boolean shouldForceToEan13(String barcode);
}

View File

@@ -1,7 +0,0 @@
package it.integry.integrywmsnative.core.class_router.interfaces;
public interface ICustomConfiguration {
<T>T getConfig(int key);
}

View File

@@ -1,11 +0,0 @@
package it.integry.integrywmsnative.core.class_router.interfaces;
public interface IFiltroOrdiniVendita {
boolean shoudShowCodMdepFilter();
boolean shoudShowIdViaggioFilter();
boolean shoudShowAgenteFilter();
}

View File

@@ -1,13 +0,0 @@
package it.integry.integrywmsnative.core.class_router.interfaces;
import java.util.List;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
public interface IOrdiniVendita {
void distribuisciCollo(MtbColt mtbColt, List<OrdineUscitaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed);
}

View File

@@ -34,6 +34,8 @@ public class AppContext {
@Inject
SettingsManager mSettingsManager;
private File logsFolder;
public AppContext(Context context) {
this.mApplicationContext = context;
@@ -53,6 +55,10 @@ public class AppContext {
this.initLogger();
}
public File getLogFilePath() {
return logsFolder;
}
private void initSettings() {
Stash.init(mApplicationContext);
@@ -82,10 +88,9 @@ public class AppContext {
private void initLogger() {
Logger.addLogAdapter(new AndroidLogAdapter());
File logsFolder = new File(mApplicationContext.getExternalFilesDir(null).getAbsolutePath());
logsFolder = new File(mApplicationContext.getExternalFilesDir(null).getAbsolutePath());
int maxBytesSize = 5 * 1024 * 1024;
Logger.addLogAdapter(new DiskLogAdapter(logsFolder, maxBytesSize));
}
}

View File

@@ -6,13 +6,11 @@ import android.text.SpannableString;
import android.text.Spanned;
import android.text.SpannedString;
import java.lang.reflect.Method;
import java.net.ConnectException;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
import it.integry.integrywmsnative.core.class_router.ClassRouter;
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
import it.integry.integrywmsnative.core.menu.MenuService;
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
@@ -44,8 +42,7 @@ public class MainContext {
this.initDBData(() -> {
this.initMenu(() -> {
this.initReflections();
if (mListener != null) mListener.onContextInitialized();
});
});
@@ -103,30 +100,6 @@ public class MainContext {
});
}
private void initReflections() {
ClassRouter.init();
try {
String initMethod = "init";
Class dynamicContextClass = Class.forName("it.integry.wms.dynamic_customization.DynamicContext");
Method[] methods = dynamicContextClass.getMethods();
for (Method m : methods) {
if (initMethod.equals(m.getName())) {
// for static methods we can use null as instance of class
final Object newInstance = dynamicContextClass.newInstance();
m.invoke(newInstance, applicationContext);
break;
}
}
} catch (Exception e) {
// UtilityExceptions.defaultException(mContext, e, true);
}
}
public MainContext setListener(Listener listener) {
this.mListener = listener;

View File

@@ -40,7 +40,7 @@ import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
InventarioRoomDTO.class,
InventarioRowRoomDTO.class
},
version = 13,
version = 14,
exportSchema = true)
@TypeConverters({
DateConverter.class,
@@ -66,7 +66,8 @@ public abstract class AppDatabase extends RoomDatabase {
AppDatabase.class, "integry_wms")
.addMigrations(MIGRATION_10_11)
.addMigrations(MIGRATION_11_12)
.addMigrations(MIGRATION_12_13);
.addMigrations(MIGRATION_12_13)
.addMigrations(MIGRATION_13_14);
sInstance = builder.build();
}
@@ -126,4 +127,12 @@ public abstract class AppDatabase extends RoomDatabase {
database.execSQL("CREATE INDEX IF NOT EXISTS index_inventario_rows__parent_id ON inventario_rows (parent_id)");
}
};
static final Migration MIGRATION_13_14 = new Migration(13, 14) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase database) {
database.execSQL("ALTER TABLE inventari"
+ " ADD COLUMN new INTEGER");
}
};
}

View File

@@ -184,7 +184,7 @@ public class RoomModule {
InventarioLocalDataSource inventarioLocalDataSource,
InventarioRESTConsumer inventarioRESTConsumer,
InventarioMapper inventarioMapper) {
return new InventarioRepository(inventarioLocalDataSource, inventarioRESTConsumer, inventarioMapper, handler);
return new InventarioRepository(inventarioLocalDataSource, inventarioRESTConsumer, inventarioMapper, handler, executorService);
}
@Singleton

View File

@@ -255,7 +255,7 @@ public class ArticoloOrdine {
public int checkQtaProposta() {
int check = 0;
if (!qtaProposta.equals(BigDecimal.ZERO)) {
if (qtaProposta != null && !qtaProposta.equals(BigDecimal.ZERO)) {
check = BigDecimal.valueOf(qtaOrd).compareTo(qtaProposta);
}
return check;

View File

@@ -35,6 +35,7 @@ public class InventarioRoomDTO extends BaseSyncDTO implements EntityModelInterfa
public static final String DATA_ORA_FINE = "data_ora_fine";
public static final String CAUSALE = "causale";
public static final String ZONA = "zona";
public static final String IS_NEW = "new";
}
/** The unique ID of the cheese. */
@@ -95,6 +96,9 @@ public class InventarioRoomDTO extends BaseSyncDTO implements EntityModelInterfa
@ColumnInfo(name = Columns.ZONA)
private String zona;
@ColumnInfo(name = Columns.IS_NEW)
private Boolean isNew = Boolean.TRUE;
@Ignore
private List<InventarioRowRoomDTO> inventarioRowList;
@@ -235,6 +239,14 @@ public class InventarioRoomDTO extends BaseSyncDTO implements EntityModelInterfa
this.zona = zona;
}
public Boolean isNew() {
return isNew;
}
public void setNew(Boolean aNew) {
isNew = aNew;
}
public List<InventarioRowRoomDTO> getInventarioRowList() {
return inventarioRowList;
}

View File

@@ -15,6 +15,7 @@ import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoliOrdineRepository;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.utility.UtilityDate;
public class ArticoliOrdineDataSource extends BaseDataSource implements ArticoliOrdineRepository {
@@ -53,6 +54,7 @@ public class ArticoliOrdineDataSource extends BaseDataSource implements Articoli
}
public void saveArticoloToOrdine(ArticoloOrdine articolo, Runnable onSuccess, RunnableArgs<Exception> onError) {
articolo.setDataIns(UtilityDate.getDateInstance());
if (articolo.getArticoloOrdineId() != null && articolo.getArticoloOrdineId() > 0) {
execute(() -> mArticoloOrdineDao.update(articolo), onSuccess, onError);
} else {

View File

@@ -1,12 +1,16 @@
package it.integry.integrywmsnative.core.data_store.db.respository_new;
import android.os.Handler;
import android.util.Log;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
import javax.inject.Inject;
@@ -17,9 +21,12 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.mapper.InventarioMapper;
import it.integry.integrywmsnative.core.model.MtbInvent;
import it.integry.integrywmsnative.core.rest.consumers.InventarioRESTConsumer;
import it.integry.integrywmsnative.core.utility.UtilityLiveData;
public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioRoomDTO, InventarioMapper, InventarioLocalDataSource, InventarioRESTConsumer> {
private final ExecutorService executorService;
private final Handler handler;
private final MutableLiveData<List<InventarioRoomDTO>> internalLiveData = new MutableLiveData<>();
@@ -28,22 +35,50 @@ public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioR
public InventarioRepository(InventarioLocalDataSource localDataSource,
InventarioRESTConsumer remoteDataSource,
InventarioMapper dataMapper,
Handler handler) {
Handler handler,
ExecutorService executorService) {
super(dataMapper, localDataSource, remoteDataSource);
this.handler = handler;
this.executorService = executorService;
}
public LiveData<List<InventarioRoomDTO>> retrieve() {
public LiveData<List<InventarioRoomDTO>> retrieve(Runnable onComplete, RunnableArgs<Exception> onError) {
localDataSource.makeSynchronousRetrieveAllLive(false)
.observeOn(Schedulers.io())
.subscribe(internalLiveData::postValue);
// refresh(onComplete, onError);
UtilityLiveData.observeOnce(internalLiveData, inventories -> {
refresh(onComplete, onError);
});
return internalLiveData;
}
public void refresh(Runnable onComplete, RunnableArgs<Exception> onError) {
executorService.execute(() -> {
try {
var startRetrieve = new Date();
var remoteData = remoteDataSource.makeSynchronousRetrieveRequest();
Log.d("Timing [INVENTORIES RETRIEVE]", ((new Date().getTime() - startRetrieve.getTime()) / 1000) + " secs");
if (remoteData == null) remoteData = new ArrayList<>();
resolveFetch(remoteData, internalLiveData.getValue(),
(remoteItem, localItem) -> Objects.equals(remoteItem.getIdInventario(), localItem.getIdInventario()),
(remoteItem, localItem) -> {
remoteItem.setRemoteSyncDate(localItem.getRemoteSyncDate());
remoteItem.setNew(false);
}, onComplete, onError);
} catch (Exception e) {
onError.run(e);
}
});
}
public void insert(InventarioRoomDTO inventarioDTO, Runnable onComplete, RunnableArgs<Exception> onError) {
localDataSource.makeInsertRequest(inventarioDTO, localResult -> {
if (onComplete != null) handler.post(onComplete);
@@ -60,7 +95,7 @@ public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioR
}, onError);
}
public void delete(InventarioRoomDTO inventarioDTO, Runnable onComplete, RunnableArgs<Exception> onError){
public void delete(InventarioRoomDTO inventarioDTO, Runnable onComplete, RunnableArgs<Exception> onError) {
localDataSource.makeDeleteRequest(inventarioDTO, onComplete, onError);
}

View File

@@ -18,7 +18,6 @@ public class BindableBoolean implements Observable {
this.mValue = startValue;
}
@Override
public void addOnPropertyChangedCallback(@NonNull OnPropertyChangedCallback callback) {
synchronized (this) {

View File

@@ -24,6 +24,7 @@ import androidx.databinding.BindingAdapter;
import androidx.databinding.BindingConversion;
import androidx.databinding.Observable;
import androidx.databinding.ObservableField;
import androidx.lifecycle.MutableLiveData;
import com.google.android.material.datepicker.MaterialDatePicker;
import com.google.android.material.textfield.TextInputEditText;

View File

@@ -1,74 +0,0 @@
package it.integry.integrywmsnative.core.exception;
import android.app.Activity;
import android.os.Environment;
import android.os.Looper;
import android.util.Log;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import it.integry.integrywmsnative.MainApplication;
import it.integry.integrywmsnative.core.utility.UtilityLogger;
import it.integry.integrywmsnative.view.dialogs.exception.DialogException;
public class ExceptionsHandler implements Thread.UncaughtExceptionHandler {
private final static String TAG = ExceptionsHandler.class.getSimpleName();
private final Activity context;
public static void init(Activity context) {
new ExceptionsHandler(context);
}
private ExceptionsHandler(Activity context) {
this.context = context;
//if (!BuildConfig.DEBUG) {
Thread.setDefaultUncaughtExceptionHandler(this);
//}
}
@Override
public void uncaughtException(final Thread thread, final Throwable ex) {
try {
UtilityLogger.error(new Exception(ex));
} catch (Exception e) {
Log.e(TAG, "Exception Logger failed!", e);
MainApplication.exit();
}
appendToFile(new Exception(ex));
new Thread() {
@Override
public void run() {
Looper.prepare();
DialogException.make(context, context::finish).show();
Looper.loop();
}
}.start();
}
public void appendToFile(Exception e) {
try {
File yourFile = new File(Environment.getExternalStorageDirectory(), "log.txt");
FileWriter fstream = new FileWriter(yourFile.getPath(), true);
BufferedWriter out = new BufferedWriter(fstream);
PrintWriter pWriter = new PrintWriter(out, true);
e.printStackTrace(pWriter);
}
catch (Exception ie) {
throw new RuntimeException("Could not write Exception to file", ie);
}
}
}

View File

@@ -37,14 +37,12 @@ public class BaseActivity extends AppCompatActivity {
public void onLoadingEnded() {
this.closeProgress();
BarcodeManager.enable();
}
public void onError(Exception ex) {
this.runOnUiThread(() -> {
this.closeProgress();
UtilityExceptions.defaultException(this, ex);
BarcodeManager.enable();
});
}

View File

@@ -1,5 +1,6 @@
package it.integry.integrywmsnative.core.expansion;
import android.content.DialogInterface;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
@@ -18,7 +19,7 @@ import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
public class BaseDialogFragment extends DialogFragment {
public class BaseDialogFragment extends DialogFragment implements DialogInterface.OnShowListener {
@Inject
public DialogProgressView mCurrentProgress;
@@ -41,20 +42,7 @@ public class BaseDialogFragment extends DialogFragment {
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
MainApplication.appComponent
.baseDialogFragmentComponent()
.create()
.inject(this);
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
getDialog().setOnKeyListener((dialog, keyCode, event) -> {
if (mBarcodeListener && (event.getAction() == KeyEvent.ACTION_DOWN || event.getAction() == KeyEvent.ACTION_MULTIPLE) && !isControlKey(event)) {
return BarcodeManager.onKeyDown(event.getKeyCode(), event);
}
return false;
});
}
this.initialize();
}
public void onLoadingStarted() {
@@ -107,4 +95,24 @@ public class BaseDialogFragment extends DialogFragment {
}
@Override
public void onShow(DialogInterface dialogInterface) {
this.initialize();
}
private void initialize() {
MainApplication.appComponent
.baseDialogFragmentComponent()
.create()
.inject(this);
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator() && getDialog() != null) {
getDialog().setOnKeyListener((dialog, keyCode, event) -> {
if (mBarcodeListener && (event.getAction() == KeyEvent.ACTION_DOWN || event.getAction() == KeyEvent.ACTION_MULTIPLE) && !isControlKey(event)) {
return BarcodeManager.onKeyDown(event.getKeyCode(), event);
}
return false;
});
}
}
}

View File

@@ -0,0 +1,6 @@
package it.integry.integrywmsnative.core.expansion;
public interface RunnableArgsssss<S, T, U, V, X> {
void run(S data1, T data2, U data3, V data4, X data5);
}

View File

@@ -19,9 +19,7 @@ public class MenuRESTConsumer extends _BaseRESTConsumer {
menuRESTConsumerService.retrieveMenuConfig(rootCodOpz).enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<StbMenu>> call, Response<ServiceRESTResponse<StbMenu>> response) {
analyzeAnswer(response, "retrieveMenu", (m) -> {
onComplete.run(response.body().getEntity());
}, onFailed);
analyzeAnswer(response, "retrieveMenu", onComplete, onFailed);
}
@Override

View File

@@ -2,16 +2,16 @@ package it.integry.integrywmsnative.core.model;
import androidx.databinding.Observable;
import it.integry.integrywmsnative.core.di.BindableBoolean;
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsItemModel;
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_mtbcolr_list.DialogChooseArtsFromMtbColrListItemModel;
public class CheckableMtbColr {
private DialogChooseArtsFromListaArtsItemModel item;
private DialogChooseArtsFromMtbColrListItemModel item;
private BindableBoolean checked = new BindableBoolean(false);
private BindableBoolean hidden = new BindableBoolean(false);
public CheckableMtbColr(DialogChooseArtsFromListaArtsItemModel item) {
public CheckableMtbColr(DialogChooseArtsFromMtbColrListItemModel item) {
this.item = item;
this.item.getHidden().addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
@@ -22,11 +22,11 @@ public class CheckableMtbColr {
});
}
public DialogChooseArtsFromListaArtsItemModel getItem() {
public DialogChooseArtsFromMtbColrListItemModel getItem() {
return item;
}
public CheckableMtbColr setItem(DialogChooseArtsFromListaArtsItemModel item) {
public CheckableMtbColr setItem(DialogChooseArtsFromMtbColrListItemModel item) {
this.item = item;
this.item.getHidden().addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
@@ -60,8 +60,4 @@ public class CheckableMtbColr {
this.hidden = hidden;
return this;
}
public void toggleCheck() {
this.checked.set(!this.checked.get());
}
}

View File

@@ -600,33 +600,6 @@ public class MtbColt extends EntityBase {
}
}
/*if (filtroOrdineDtos != null && filtroOrdineDtos.size() > 0) {
for (int i = 0; i < filtroOrdineDtos.size(); i++) {
FiltroOrdineDTO x = filtroOrdineDtos.get(i);
try {
whereCond.append("(");
whereCond.append(String.format("d.g = %s AND d.d = %s and d.n = %s",
UtilityDB.valueToString(x.getGestioneOrd()),
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH)),
UtilityDB.valueToString(x.getNumOrd())));
if (!UtilityString.isNullOrEmpty(x.getDataConsS())) {
whereCond.append(String.format(" AND dr.dc = %s",
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH))));
}
whereCond.append(")");
if (i < filtroOrdineDtos.size() - 1) {
whereCond.append(" OR ");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}*/
whereCond = TextUtils.join(" OR ", conditions);
this.filtroOrdini = xmlPrefix + whereCond + xmlSuffix;

View File

@@ -1,6 +1,7 @@
package it.integry.integrywmsnative.core.model;
import it.integry.integrywmsnative.core.utility.UtilityLogger;
import it.integry.integrywmsnative.core.utility.UtilityString;
public class MtbDepoPosizione {
@@ -11,6 +12,8 @@ public class MtbDepoPosizione {
private String flagLineaProduzione;
private Integer priorita;
private String tipoMagazAutomatico;
public MtbDepoPosizione clone() {
@@ -85,4 +88,17 @@ public class MtbDepoPosizione {
this.priorita = priorita;
return this;
}
public String getTipoMagazAutomatico() {
return tipoMagazAutomatico;
}
public MtbDepoPosizione setTipoMagazAutomatico(String tipoMagazAutomatico) {
this.tipoMagazAutomatico = tipoMagazAutomatico;
return this;
}
public boolean isMagazzinoAutomatico() {
return !UtilityString.isNullOrEmpty(getTipoMagazAutomatico());
}
}

View File

@@ -270,4 +270,23 @@ public class MvwSitArtUdcDetInventario {
this.mtbAart = mtbAart;
return this;
}
public MtbColr toMtbColr() {
return new MtbColr()
.setCodJcom(getCodJcom())
.setCodMart(getCodMart())
.setDataCollo(getDataCollo())
.setNumCollo(getNumCollo())
.setSerCollo(getSerCollo())
.setGestione(getGestione())
.setMtbAart(getMtbAart())
.setNumCnf(getNumCnf())
.setQtaCnf(getQtaCnf())
.setQtaCol(getQtaCol())
.setPartitaMag(getPartitaMag())
.setPesoNettoKg(getPesoNettoKg())
.setPesoLordoKg(getPesoLordoKg())
.setUntMis(getUntMis());
}
}

View File

@@ -4,10 +4,16 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.lang.reflect.Modifier;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import it.integry.integrywmsnative.core.rest.deserializer.LocalDateDeserializer;
import it.integry.integrywmsnative.core.rest.deserializer.LocalDateTimeDeserializer;
import it.integry.integrywmsnative.core.rest.serializer.LocalDateSerializer;
@@ -26,25 +32,25 @@ public class RESTBuilder {
private static final boolean ADD_LOGGER_INTERCEPTOR = false;
public static <T> T getService(final Class<T> service) {
return getService(service, 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) {
return getService(service, 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 host, int port, boolean addInterceptors) {
return getService(service, host, port, addInterceptors, true, 60);
public static <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addInterceptors) {
return getService(service, protocol, host, port, addInterceptors, true, 60);
}
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors, boolean addEmsApi) {
return getService(service, host, port, addInterceptors, addEmsApi, 60);
public static <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);
}
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors, boolean addEmsApi, int timeout) {
OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder();
public static <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addInterceptors, boolean addEmsApi, int timeout) {
OkHttpClient.Builder clientBuilder = getDefaultHttpClient();
clientBuilder.connectTimeout(timeout, TimeUnit.SECONDS);
clientBuilder.readTimeout(timeout, TimeUnit.SECONDS);
@@ -57,22 +63,19 @@ public class RESTBuilder {
OkHttpClient client = clientBuilder.build();
String endpoint = "http://" + host + ":" + port + "/" + (addEmsApi ? "ems-api/" : "");
String endpoint = protocol + "://" + host + ":" + port + "/" + (addEmsApi ? "ems-api/" : "");
Gson gson = new GsonBuilder()
.setDateFormat("dd/MM/yyyy HH:mm:ss")
.excludeFieldsWithModifiers(Modifier.TRANSIENT)
.registerTypeAdapter(LocalDate.class, new LocalDateDeserializer())
.registerTypeAdapter(LocalDate.class, new LocalDateSerializer())
.registerTypeAdapter(LocalDateTime.class, new LocalDateTimeDeserializer())
.registerTypeAdapter(LocalDateTime.class, new LocalDateTimeSerializer())
.excludeFieldsWithModifiers(Modifier.TRANSIENT)
.create();
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);
}
@@ -85,4 +88,39 @@ public class RESTBuilder {
public static int getDefaultPort() {
return SettingsManager.i().getServer().getPort();
}
public static OkHttpClient.Builder getDefaultHttpClient() {
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) {
}
@Override
public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) {
}
@Override
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return new java.security.cert.X509Certificate[]{};
}
}
};
SSLContext sslContext = null;
try {
sslContext = SSLContext.getInstance("SSL");
sslContext.init(null, trustAllCerts, new java.security.SecureRandom());
} catch (KeyManagementException | NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
OkHttpClient.Builder client = new OkHttpClient.Builder()
.sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustAllCerts[0])
.hostnameVerifier((hostname, session) -> true);
return client;
}
}

View File

@@ -3,8 +3,6 @@ package it.integry.integrywmsnative.core.rest.consumers;
import javax.inject.Singleton;
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
import it.integry.integrywmsnative.core.class_router.ClassRouter;
import it.integry.integrywmsnative.core.class_router.interfaces.IBarcodeCustomization;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
@@ -18,15 +16,6 @@ public class BarcodeRESTConsumer extends _BaseRESTConsumer {
public void decodeEan128(BarcodeScanDTO barcodeObj, RunnableArgs<Ean128Model> onComplete, RunnableArgs<Exception> onFailed) {
IBarcodeCustomization barcodeCustomization = ClassRouter.getInstance(ClassRouter.PATH.BARCODE_CUSTOMIZATION);
if (barcodeCustomization != null && barcodeCustomization.shouldForceToEan13(barcodeObj.getStringValue())) {
Ean128Model ean128Model = new Ean128Model();
ean128Model.Gtin = barcodeObj.getStringValue();
onComplete.run(ean128Model);
return;
}
String ean128 = barcodeObj.getStringValue().replaceAll("" + ((char) 29), "|");
BarcodeRESTConsumerService barcodeRESTConsumerService = RESTBuilder.getService(BarcodeRESTConsumerService.class);

View File

@@ -0,0 +1,177 @@
package it.integry.integrywmsnative.core.rest.consumers;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbColr;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliScaricoRESTConsumerInterface;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.uds.CanUDSBeDeletedRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.PrintUDSRequestDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements ColliScaricoRESTConsumerInterface {
public void createUDS(CreateUDSRequestDTO createUDSRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.createUDS(createUDSRequestDTO)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Response<ServiceRESTResponse<CreateUDSResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/createUDS", data -> onComplete.run(data.getMtbColt()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}
@Override
public void closeUDS(CloseUDSRequestDTO closeUDSRequestDTO, RunnableArgs<CloseUDSResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.closeUDS(closeUDSRequestDTO)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Response<ServiceRESTResponse<CloseUDSResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/closeUDS", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}
@Override
public void canUDSBeDeleted(CanUDSBeDeletedRequestDTO canUDSBeDeletedRequestDTO, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.canUDSBeDeleted(canUDSBeDeletedRequestDTO)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Boolean>> call, Response<ServiceRESTResponse<Boolean>> response) {
analyzeAnswer(response, "lavorazione/canUDSBeDeleted", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}
@Override
public void deleteUDS(DeleteUDSRequestDTO deleteUDSRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.deleteUDS(deleteUDSRequestDTO)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "lavorazione/deleteUDS", Void -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}
@Override
public void printUDS(PrintUDSRequestDTO printUDSRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.printUDS(printUDSRequestDTO)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "lavorazione/printUDS", Void -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}
@Override
public void insertUDSRow(InsertUDSRowRequestDTO insertUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.insertUDSRow(insertUDSRowRequestDTO)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDSRowResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/insertUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}
public void editUDSRow(EditUDSRowRequestDTO editUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.editUDSRow(editUDSRowRequestDTO)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDSRowResponseDTO>> response) {
analyzeAnswer(response, "lavorazione/editUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}
@Override
public void deleteUDSRow(DeleteUDSRowRequestDTO deleteUDSRowRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
colliLavorazioneRESTConsumerService.deleteUDSRow(deleteUDSRowRequestDTO)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "lavorazione/deleteUDSRow", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}
}

View File

@@ -0,0 +1,46 @@
package it.integry.integrywmsnative.core.rest.consumers;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.uds.CanUDSBeDeletedRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.PrintUDSRequestDTO;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;
public interface ColliLavorazioneRESTConsumerService {
@POST("wms/lavorazione/createUDS")
Call<ServiceRESTResponse<CreateUDSResponseDTO>> createUDS(@Body CreateUDSRequestDTO createUDSRequestDTO);
@POST("wms/lavorazione/closeUDS")
Call<ServiceRESTResponse<CloseUDSResponseDTO>> closeUDS(@Body CloseUDSRequestDTO createUDSRequestDTO);
@POST("wms/lavorazione/canUDSBeDeleted")
Call<ServiceRESTResponse<Boolean>> canUDSBeDeleted(@Body CanUDSBeDeletedRequestDTO canUDSBeDeletedRequestDTO);
@POST("wms/lavorazione/deleteUDS")
Call<ServiceRESTResponse<Void>> deleteUDS(@Body DeleteUDSRequestDTO deleteUDSRequestDTO);
@POST("wms/lavorazione/printUDS")
Call<ServiceRESTResponse<Void>> printUDS(@Body PrintUDSRequestDTO printUDSRequestDTO);
@POST("wms/lavorazione/insertUDSRow")
Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> insertUDSRow(@Body InsertUDSRowRequestDTO insertUDSRowRequestDTO);
@POST("wms/lavorazione/editUDSRow")
Call<ServiceRESTResponse<EditUDSRowResponseDTO>> editUDSRow(@Body EditUDSRowRequestDTO editUDSRowRequestDTO);
@POST("wms/lavorazione/deleteUDSRow")
Call<ServiceRESTResponse<Void>> deleteUDSRow(@Body DeleteUDSRowRequestDTO deleteUDSRowRequestDTO);
}

View File

@@ -4,8 +4,6 @@ import androidx.databinding.ObservableArrayList;
import com.annimon.stream.Optional;
import com.annimon.stream.Stream;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import org.jetbrains.annotations.NotNull;
@@ -29,7 +27,6 @@ import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
@@ -280,48 +277,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
if (onComplete != null) onComplete.run();
}, onFailed);
}
public static void distribuisciCollo(MtbColt mtbColtToDistribute, DistribuzioneColloDTO.CriterioDistribuzione criterioDistribuzione, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
DistribuzioneColloDTO distribuzioneColloDTO = new DistribuzioneColloDTO()
.setCriterioDistribuzione(criterioDistribuzione)
.setDataCollo(mtbColtToDistribute.getDataColloS())
.setNumCollo(mtbColtToDistribute.getNumCollo())
.setGestione(mtbColtToDistribute.getGestione())
.setSerCollo(mtbColtToDistribute.getSerCollo());
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.distribuisciCollo(distribuzioneColloDTO)
.enqueue(new Callback<ServiceRESTResponse<JsonObject>>() {
@Override
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
analyzeAnswerList(response, "DistribuzioneCollo", obj -> {
Gson gson = new Gson();
List<JsonObject> jsons = response.body().getEntityList();
List<MtbColt> newList = new ArrayList<>();
if (jsons != null) {
for (int i = 0; i < jsons.size(); i++) {
JsonObject jsonTmp = jsons.get(i);
newList.add(gson.fromJson(jsonTmp, MtbColt.class));
}
}
onComplete.run(newList);
}, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}
public void getBySSCC(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new Callback<>() {

View File

@@ -1,12 +1,9 @@
package it.integry.integrywmsnative.core.rest.consumers;
import com.google.gson.JsonObject;
import java.util.List;
import it.integry.integrywmsnative.core.model.MtbColr;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
@@ -19,9 +16,6 @@ import retrofit2.http.Query;
public interface ColliMagazzinoRESTConsumerService {
@POST("wms/distribuzioneRigheCollo")
Call<ServiceRESTResponse<JsonObject>> distribuisciCollo(@Body DistribuzioneColloDTO distribuzioneCollo);
@POST("getColloByBarcode")
Call<ServiceRESTResponse<MtbColt>> getColloByBarcode(@Query("codBarreCollo") String sscc, @Query("onlyResiduo") boolean onlyResiduo, @Query("throwExcIfNull") boolean throwExcIfNull);

View File

@@ -0,0 +1,173 @@
package it.integry.integrywmsnative.core.rest.consumers;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbColr;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliScaricoRESTConsumerInterface;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.uds.CanUDSBeDeletedRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.PrintUDSRequestDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
public class ColliSpedizioneRESTConsumer extends _BaseRESTConsumer implements ColliScaricoRESTConsumerInterface {
public void createUDS(CreateUDSRequestDTO createUDSRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.createUDS(createUDSRequestDTO)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Response<ServiceRESTResponse<CreateUDSResponseDTO>> response) {
analyzeAnswer(response, "spedizione/createUDS", data -> onComplete.run(data.getMtbColt()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CreateUDSResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}
public void closeUDS(CloseUDSRequestDTO closeUDSRequestDTO, RunnableArgs<CloseUDSResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.closeUDS(closeUDSRequestDTO)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Response<ServiceRESTResponse<CloseUDSResponseDTO>> response) {
analyzeAnswer(response, "spedizione/closeUDS", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<CloseUDSResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}
public void canUDSBeDeleted(CanUDSBeDeletedRequestDTO canUDSBeDeletedRequestDTO, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.canUDSBeDeleted(canUDSBeDeletedRequestDTO)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Boolean>> call, Response<ServiceRESTResponse<Boolean>> response) {
analyzeAnswer(response, "spedizione/canUDSBeDeleted", onComplete, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}
public void deleteUDS(DeleteUDSRequestDTO deleteUDSRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.deleteUDS(deleteUDSRequestDTO)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "spedizione/deleteUDS", Void -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}
public void printUDS(PrintUDSRequestDTO printUDSRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.printUDS(printUDSRequestDTO)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "spedizione/printUDS", Void -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}
public void insertUDSRow(InsertUDSRowRequestDTO insertUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.insertUDSRow(insertUDSRowRequestDTO)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDSRowResponseDTO>> response) {
analyzeAnswer(response, "spedizione/insertUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}
public void editUDSRow(EditUDSRowRequestDTO editUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.editUDSRow(editUDSRowRequestDTO)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDSRowResponseDTO>> response) {
analyzeAnswer(response, "spedizione/editUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<EditUDSRowResponseDTO>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}
public void deleteUDSRow(DeleteUDSRowRequestDTO deleteUDSRowRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
colliSpedizioneRESTConsumerService.deleteUDSRow(deleteUDSRowRequestDTO)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "spedizione/deleteUDSRow", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}
}

View File

@@ -0,0 +1,46 @@
package it.integry.integrywmsnative.core.rest.consumers;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.uds.CanUDSBeDeletedRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.PrintUDSRequestDTO;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;
public interface ColliSpedizioneRESTConsumerService {
@POST("wms/spedizione/createUDS")
Call<ServiceRESTResponse<CreateUDSResponseDTO>> createUDS(@Body CreateUDSRequestDTO createUDSRequestDTO);
@POST("wms/spedizione/closeUDS")
Call<ServiceRESTResponse<CloseUDSResponseDTO>> closeUDS(@Body CloseUDSRequestDTO createUDSRequestDTO);
@POST("wms/spedizione/canUDSBeDeleted")
Call<ServiceRESTResponse<Boolean>> canUDSBeDeleted(@Body CanUDSBeDeletedRequestDTO canUDSBeDeletedRequestDTO);
@POST("wms/spedizione/deleteUDS")
Call<ServiceRESTResponse<Void>> deleteUDS(@Body DeleteUDSRequestDTO deleteUDSRequestDTO);
@POST("wms/spedizione/printUDS")
Call<ServiceRESTResponse<Void>> printUDS(@Body PrintUDSRequestDTO printUDSRequestDTO);
@POST("wms/spedizione/insertUDSRow")
Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> insertUDSRow(@Body InsertUDSRowRequestDTO insertUDSRowRequestDTO);
@POST("wms/spedizione/editUDSRow")
Call<ServiceRESTResponse<EditUDSRowResponseDTO>> editUDSRow(@Body EditUDSRowRequestDTO editUDSRowRequestDTO);
@POST("wms/spedizione/deleteUDSRow")
Call<ServiceRESTResponse<Void>> deleteUDSRow(@Body DeleteUDSRowRequestDTO deleteUDSRowRequestDTO);
}

View File

@@ -1,5 +1,7 @@
package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import java.util.List;
import javax.inject.Singleton;
@@ -9,12 +11,13 @@ import it.integry.integrywmsnative.core.model.DtbDoct;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.model.LoadColliDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.documento.RetrieveDocumentoArtsResponseDTO;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
public class DocumentiRESTConsumer extends _BaseRESTConsumer {
public class DocumentRESTConsumer extends _BaseRESTConsumer {
public void createDocsFromColli(List<LoadColliDTO> listColli, RunnableArgs<List<DtbDoct>> onComplete, RunnableArgs<Exception> onFailed) {
@@ -48,4 +51,21 @@ public class DocumentiRESTConsumer extends _BaseRESTConsumer {
}
public void loadDocumentoAvailableArts(String codDtip, String codMgrp, RunnableArgs<RetrieveDocumentoArtsResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
var inventarioRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
inventarioRESTConsumerService.retrieveArts(codDtip, codMgrp)
.enqueue(new Callback<>() {
@Override
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> response) {
analyzeAnswer(response, "loadDocumentoArts", onComplete, onFailed);
}
@Override
public void onFailure(@NonNull Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> call, @NonNull Throwable t) {
onFailed.run(new Exception(t));
}
});
}
}

View File

@@ -5,9 +5,12 @@ import java.util.List;
import it.integry.integrywmsnative.core.model.DtbDoct;
import it.integry.integrywmsnative.core.rest.model.LoadColliDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.documento.RetrieveDocumentoArtsResponseDTO;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
public interface DocumentiRESTConsumerService {
@@ -17,4 +20,12 @@ public interface DocumentiRESTConsumerService {
@POST("createDocFromColli")
Call<ServiceRESTResponse<DtbDoct>> createDocFromColli(@Body LoadColliDTO listColli);
@GET("wms/documento/arts")
Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> retrieveArts(
@Query("codDtip") String codDtip,
@Query("codMgrp") String codMgrp);
}

View File

@@ -20,12 +20,10 @@ import retrofit2.Response;
public class GestSetupRESTConsumer extends _BaseRESTConsumer {
public void getValue(String gestName, String sectionName, String keySection, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
getValueStatic(gestName, sectionName, keySection, onComplete, onFailed);
}
public static void getValueStatic(String gestName, String sectionName, String keySection, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
service.getGestSetupValue(gestName, sectionName, keySection).enqueue(new Callback<ServiceRESTResponse<GestSetupDTO>>() {
service.getGestSetupValue(gestName, sectionName, keySection)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<GestSetupDTO>> call, Response<ServiceRESTResponse<GestSetupDTO>> response) {
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
@@ -40,8 +38,8 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
});
}
public static void getBooleanValue(String gestName, String sectionName, String keySection, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
getValueStatic(gestName, sectionName, keySection, value -> {
public void getBooleanValue(String gestName, String sectionName, String keySection, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
getValue(gestName, sectionName, keySection, value -> {
if (value != null) {
onComplete.run("S".equalsIgnoreCase(value.value));
} else onComplete.run(false);
@@ -50,7 +48,7 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
});
}
public static void getValueStatic(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);
service.getGestSetupValue(gestName, sectionName, keySection, codMdep).enqueue(new Callback<ServiceRESTResponse<GestSetupDTO>>() {
@Override
@@ -67,8 +65,8 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
});
}
public static void getBooleanValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
getValueStatic(gestName, sectionName, keySection, codMdep, value -> {
public void getBooleanValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
getValue(gestName, sectionName, keySection, codMdep, value -> {
if (value != null) {
onComplete.run("S".equalsIgnoreCase(value.value));
} else onComplete.run(false);

View File

@@ -2,11 +2,7 @@ package it.integry.integrywmsnative.core.rest.consumers;
import com.annimon.stream.Optional;
import com.annimon.stream.Stream;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import javax.inject.Singleton;
@@ -15,7 +11,11 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbAart;
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
import it.integry.integrywmsnative.core.utility.UtilityQuery;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@Singleton
public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
@@ -30,39 +30,41 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
}
public void getGiacenzeInPosizione(MtbDepoPosizione posizione, RunnableArgs<List<MvwSitArtUdcDetInventario>> onComplete, RunnableArgs<Exception> onFailed) {
GiacenzaRESTConsumerService giacenzaRESTConsumerService = RESTBuilder.getService(GiacenzaRESTConsumerService.class);
giacenzaRESTConsumerService.retrieveAvailableItems(posizione.getPosizione()).enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Response<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> response) {
analyzeAnswer(response, "getGiacenzeInPosizione", inventarioList -> {
HashMap<String, Object> params = new HashMap<>();
params.put("posizione", posizione.getPosizione());
String whereCond = UtilityQuery.concatFieldsInWhereCond(params);
String query = "SELECT * from mvw_sitart_udc_det_inventario" +
" WHERE " + whereCond;
List<String> codMarts = Stream.of(inventarioList)
.map(x -> x.getCodMart().trim())
.toList();
mArticoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
for (var row : inventarioList) {
Type typeOfObjectsList = new TypeToken<ArrayList<MvwSitArtUdcDetInventario>>() {
}.getType();
this.mSystemRESTConsumer.<ArrayList<MvwSitArtUdcDetInventario>>processSql(query, typeOfObjectsList, inventarioList -> {
List<String> codMarts = Stream.of(inventarioList)
.map(x -> x.getCodMart().trim())
.toList();
MtbAart foundMtbAart = null;
Optional<MtbAart> mtbAartOpt = Stream.of(mtbAarts)
.filter(x -> x.getCodMart().equalsIgnoreCase(row.getCodMart()))
.findFirst();
mArticoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
for (var row : inventarioList) {
if (mtbAartOpt.isPresent()) {
foundMtbAart = mtbAartOpt.get();
}
MtbAart foundMtbAart = null;
Optional<MtbAart> mtbAartOpt = Stream.of(mtbAarts)
.filter(x -> x.getCodMart().equalsIgnoreCase(row.getCodMart()))
.findFirst();
row.setMtbAart(foundMtbAart);
}
if (mtbAartOpt.isPresent()) {
foundMtbAart = mtbAartOpt.get();
}
onComplete.run(inventarioList);
}, onFailed);
}, onFailed);
}
row.setMtbAart(foundMtbAart);
}
onComplete.run(inventarioList);
}, onFailed);
}, onFailed);
@Override
public void onFailure(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}

View File

@@ -1,4 +1,26 @@
package it.integry.integrywmsnative.core.rest.consumers;
import java.util.List;
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;
public interface GiacenzaRESTConsumerService {
@GET("wms/giacenza/availableItemsByPosizione")
Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> retrieveAvailableItems(
@Query("posizione") String posizione);
@GET("wms/giacenza/availableItemsByArticolo")
Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> retrieveAvailableItemsByArt(
@Query("codMart") String codMart);
@GET("wms/giacenza/availableItemsByArticolo")
Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> retrieveAvailableItemsByArt(
@Query("codMart") String codMart,
@Query("partitaMag") String partitaMag);
}

View File

@@ -2,6 +2,8 @@ package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import java.util.List;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
@@ -42,7 +44,7 @@ public class InventarioRESTConsumer extends _BaseRESTConsumer {
.enqueue(new Callback<>() {
@Override
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveInventarioArtsResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveInventarioArtsResponseDTO>> response) {
analyzeAnswer(response, "loadInventario", onComplete, onFailed);
analyzeAnswer(response, "loadInventarioArts", onComplete, onFailed);
}
@Override
@@ -52,6 +54,17 @@ public class InventarioRESTConsumer extends _BaseRESTConsumer {
});
}
public List<MtbInvent> makeSynchronousRetrieveRequest() throws Exception {
var inventarioRESTConsumerService = RESTBuilder.getService(InventarioRESTConsumerService.class, 120);
var response = inventarioRESTConsumerService.retrieve()
.execute();
var data = analyzeAnswer(response, "retrieveInventario");
if (data == null) return null;
return data.getInventories();
}
public void makeInsertRequest(MtbInvent inventarioToInsert, final Runnable onComplete, final RunnableArgs<Exception> onFailed) {
var request = new InsertInventarioRequestDTO()
@@ -59,18 +72,18 @@ public class InventarioRESTConsumer extends _BaseRESTConsumer {
var inventarioRESTConsumerService = RESTBuilder.getService(InventarioRESTConsumerService.class, 120);
inventarioRESTConsumerService
.insert(inventarioToInsert.getIdInventario(), request)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "insertInventario", ignored -> onComplete.run(), onFailed);
}
.insert(inventarioToInsert.getIdInventario(), request)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "insertInventario", ignored -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
@Override
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
}

View File

@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.rest.consumers;
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.RetrieveInventariResponseDTO;
import it.integry.integrywmsnative.core.rest.model.inventario.RetrieveInventarioArtsResponseDTO;
import it.integry.integrywmsnative.core.rest.model.inventario.RetrieveInventarioResponseDTO;
import retrofit2.Call;
@@ -12,6 +13,9 @@ import retrofit2.http.Path;
public interface InventarioRESTConsumerService {
@GET("wms/inventario/")
Call<ServiceRESTResponse<RetrieveInventariResponseDTO>> retrieve();
@GET("wms/inventario/{inventoryId}")
Call<ServiceRESTResponse<RetrieveInventarioResponseDTO>> retrieve(
@Path("inventoryId") long inventoryId);

View File

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

View File

@@ -0,0 +1,22 @@
package it.integry.integrywmsnative.core.rest.consumers;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPickItemsRequestDTO;
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPutItemsRequestDTO;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;
import retrofit2.http.Path;
public interface MagazzinoAutomaticoRESTConsumerService {
@POST("wms/magazzino-automatico/{posizione}/pickItems")
Call<ServiceRESTResponse<Void>> pickItems(
@Path("posizione") String posizione,
@Body MagazzinoAutomaticoPickItemsRequestDTO magazzinoAutomaticoPickItemsRequestDTO);
@POST("wms/magazzino-automatico/{posizione}/putItems")
Call<ServiceRESTResponse<Void>> putItems(
@Path("posizione") String posizione,
@Body MagazzinoAutomaticoPutItemsRequestDTO magazzinoAutomaticoPutItemsRequestDTO);
}

View File

@@ -1,6 +1,5 @@
package it.integry.integrywmsnative.core.rest.consumers;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
@@ -47,7 +46,7 @@ public class MagazzinoRESTConsumer extends _BaseRESTConsumer {
public void saveOrdine(SaveDTO saveDTO, RunnableArgs<DtbOrdt> onComplete, RunnableArgs<Exception> onFailed) {
MagazzinoRESTConsumerService service = RESTBuilder.getService(MagazzinoRESTConsumerService.class);
MagazzinoRESTConsumerService service = RESTBuilder.getService(MagazzinoRESTConsumerService.class, 240);
service.saveOrdine(saveDTO)
.enqueue(new Callback<>() {
@Override
@@ -72,17 +71,17 @@ public class MagazzinoRESTConsumer extends _BaseRESTConsumer {
});
}
public void saveTerminalinoWMS(SaveDTO saveDTO, RunnableArgs<JsonObject> onComplete, RunnableArgs<Exception> onFailed) {
public void saveTerminalinoWMS(SaveDTO saveDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
MagazzinoRESTConsumerService service = RESTBuilder.getService(MagazzinoRESTConsumerService.class);
service.saveTerminalinoWMS(saveDTO)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
analyzeAnswer(response, "saveTerminalinoWMS", onComplete, onFailed);
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
analyzeAnswer(response, "saveTerminalinoWMS", data -> onComplete.run(), onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});

View File

@@ -1,7 +1,5 @@
package it.integry.integrywmsnative.core.rest.consumers;
import com.google.gson.JsonObject;
import java.util.List;
import it.integry.integrywmsnative.core.model.DtbOrdt;
@@ -14,7 +12,7 @@ import retrofit2.http.POST;
public interface MagazzinoRESTConsumerService {
@POST("SM2SaveTerminalinoWMS")
Call<ServiceRESTResponse<JsonObject>> saveTerminalinoWMS(@Body SaveDTO saveDTO);
Call<ServiceRESTResponse<Void>> saveTerminalinoWMS(@Body SaveDTO saveDTO);
@POST("SM2SaveTerminalino")
Call<List<ServiceRESTResponse<DtbOrdt>>> saveOrdine(@Body SaveDTO saveDTO);

View File

@@ -46,9 +46,7 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
}
public void getSuggestedPickingList(String codMdep, List<SitArtOrdDTO> sitArtOrdList, RunnableArgs<List<PickingObjectDTO>> onComplete, RunnableArgs<Exception> onFailed) {
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class, 90);
service
.getSuggestedPickingList(codMdep, sitArtOrdList)
.enqueue(new Callback<>() {
@@ -109,7 +107,6 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
@Override
public void onFailure(Call<ServiceRESTResponse<List<PickingObjectDTO>>> call, Throwable t) {
UtilityLogger.error(new Exception(t));
onFailed.run(new Exception(t));
}
});

View File

@@ -97,7 +97,6 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
}
ordineDTO.setChiaveGriglia(ordine.getCodAlis());
ordineDTO.setDataCons(UtilityDate.getDateInstance());
ordineDTO.setArtRows(artRows);
saveDTO.setGestione("O");
saveDTO.setOrdineDTO(ordineDTO);

View File

@@ -66,24 +66,23 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
}
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
Call<ServiceRESTResponse<Object>> callable = null;
callable = printerService.printCollo(testataColloToPrint);
printerService
.printCollo(testataColloToPrint)
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
analyzeAnswer(response, "printCollo", data -> {
onComplete.run();
}, onFailed);
}
callable.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
analyzeAnswer(response, "printCollo", data -> {
onComplete.run();
}, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
if (t.getMessage().contains("Printer not found")) {
onFailed.run(new NoPrintersFoundException());
} else onFailed.run(new Exception(t));
}
});
@Override
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
if (t.getMessage().contains("Printer not found")) {
onFailed.run(new NoPrintersFoundException());
} else onFailed.run(new Exception(t));
}
});
}

View File

@@ -101,12 +101,7 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
}
public static void sendErrorLogMail(String message) {
sendErrorLogMail(message, null, null);
}
public static void sendErrorLogMail(String message, Runnable onComplete, RunnableArgs<Exception> onFailed) {
public void sendErrorLogMail(String message, Runnable onComplete, RunnableArgs<Exception> onFailed) {
String currentAzienda = UtilityString.isNullOrEmpty(SettingsManager.i().getUserSession().getProfileDB()) ? "" : " [" + SettingsManager.i().getUserSession().getProfileDB() + "]";
@@ -135,10 +130,10 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
}
public static void sendMail(MailRequestDTO mailDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
public void sendMail(MailRequestDTO mailDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
service.sendMail(mailDTO).enqueue(new Callback<ServiceRESTResponse<String>>() {
service.sendMail(mailDTO).enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<String>> call, Response<ServiceRESTResponse<String>> response) {
if (onComplete != null) onComplete.run();

View File

@@ -15,40 +15,48 @@ import retrofit2.Response;
public abstract class _BaseRESTConsumer {
public static <T> void analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle, RunnableArgs<T> onComplete, RunnableArgs<Exception> onFailed) {
public static <T> T analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle) throws Exception {
if (response.isSuccessful()) {
if (response.body() != null) {
if (response.body().getEsito() == EsitoType.OK) {
if (!UtilityString.isNullOrEmpty(response.body().getErrorMessage())) {
onFailed.run(new Exception(response.body().getErrorMessage()));
throw new Exception(response.body().getErrorMessage());
} else {
T dataObj = response.body().getDto() != null ?
response.body().getDto() :
response.body().getEntity();
onComplete.run(dataObj);
return dataObj;
}
} else {
Log.e(logTitle, response.body().getErrorMessage());
onFailed.run(CommonRESTException.tryRecognizeException(response.body().getErrorMessage()));
String errorMessage = UtilityString.isNull(response.body().getErrorMessage(), "Empty message");
Log.e(logTitle, errorMessage);
throw CommonRESTException.tryRecognizeException(errorMessage);
}
} else {
Log.e(logTitle, response.message());
onFailed.run(new Exception(response.message()));
throw new Exception(response.message());
}
} else {
if (response.code() == 404) {
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url().toString() + ")");
onFailed.run(new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")"));
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)
onFailed.run(new InvalidLicenseException());
throw new InvalidLicenseException();
else {
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
onFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
throw new Exception("Status " + response.code() + ": " + response.message());
}
}
}
public static <T> void analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle, RunnableArgs<T> onComplete, RunnableArgs<Exception> onFailed) {
try {
var data = analyzeAnswer(response, logTitle);
onComplete.run(data);
} catch (Exception e) {
onFailed.run(e);
}
}
@@ -93,6 +101,7 @@ public abstract class _BaseRESTConsumer {
if (response.getEsito() == EsitoType.OK) {
if (!UtilityString.isNullOrEmpty(response.getErrorMessage())) {
onFailed.run(new Exception(response.getErrorMessage()));
return;
} else {
T dataObj = response.getDto() != null ?
response.getDto() :

View File

@@ -0,0 +1,33 @@
package it.integry.integrywmsnative.core.rest.consumers.interfaces;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbColr;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.model.uds.CanUDSBeDeletedRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.PrintUDSRequestDTO;
public interface ColliScaricoRESTConsumerInterface {
void createUDS(CreateUDSRequestDTO createUDSRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed);
void closeUDS(CloseUDSRequestDTO closeUDSRequestDTO, RunnableArgs<CloseUDSResponseDTO> onComplete, RunnableArgs<Exception> onFailed);
void canUDSBeDeleted(CanUDSBeDeletedRequestDTO canUDSBeDeletedRequestDTO, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed);
void deleteUDS(DeleteUDSRequestDTO deleteUDSRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed);
void printUDS(PrintUDSRequestDTO printUDSRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed);
void insertUDSRow(InsertUDSRowRequestDTO insertUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed);
void editUDSRow(EditUDSRowRequestDTO editUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed);
void deleteUDSRow(DeleteUDSRowRequestDTO deleteUDSRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed);
}

View File

@@ -1,84 +0,0 @@
package it.integry.integrywmsnative.core.rest.model;
public class DistribuzioneColloDTO {
private String gestione;
private String dataCollo;
private Integer numCollo;
private String serCollo;
private String criterioDistribuzione;
public String getGestione() {
return gestione;
}
public DistribuzioneColloDTO setGestione(String gestione) {
this.gestione = gestione;
return this;
}
public String getDataCollo() {
return dataCollo;
}
public DistribuzioneColloDTO setDataCollo(String dataCollo) {
this.dataCollo = dataCollo;
return this;
}
public Integer getNumCollo() {
return numCollo;
}
public DistribuzioneColloDTO setNumCollo(Integer numCollo) {
this.numCollo = numCollo;
return this;
}
public String getSerCollo() {
return serCollo;
}
public DistribuzioneColloDTO setSerCollo(String serCollo) {
this.serCollo = serCollo;
return this;
}
public String getCriterioDistribuzione() {
return criterioDistribuzione;
}
public CriterioDistribuzione getCriterioDistribuzioneEnum() {
return CriterioDistribuzione.fromString(criterioDistribuzione);
}
public DistribuzioneColloDTO setCriterioDistribuzione(String criterioDistribuzione) {
this.criterioDistribuzione = criterioDistribuzione;
return this;
}
public DistribuzioneColloDTO setCriterioDistribuzione(CriterioDistribuzione criterioDistribuzione) {
this.criterioDistribuzione = criterioDistribuzione != null ? criterioDistribuzione.getText() : null;
return this;
}
public enum CriterioDistribuzione {
UPDATE("U"), //UPDATE COLLO GIA' ESISTENTE
SPLIT_ORDINE("O"); //UPDATE COLLO GIA' ESISTENTE
private String text;
CriterioDistribuzione(String text) {
this.text = text;
}
public String getText() {
return this.text;
}
public static CriterioDistribuzione fromString(String text) {
for (CriterioDistribuzione b : CriterioDistribuzione.values()) {
if (b.text.equalsIgnoreCase(text)) return b;
}
return null;
}
}
}

View File

@@ -0,0 +1,25 @@
package it.integry.integrywmsnative.core.rest.model;
public class MailAttachmentDTO {
private String fileName;
private String fileb64Content;
public String getFileName() {
return fileName;
}
public MailAttachmentDTO setFileName(String fileName) {
this.fileName = fileName;
return this;
}
public String getFileb64Content() {
return fileb64Content;
}
public MailAttachmentDTO setFileb64Content(String fileb64Content) {
this.fileb64Content = fileb64Content;
return this;
}
}

View File

@@ -1,5 +1,7 @@
package it.integry.integrywmsnative.core.rest.model;
import java.util.List;
public class MailRequestDTO {
private String from;
@@ -11,6 +13,7 @@ public class MailRequestDTO {
private String ccn;
private String subject;
private String msgText;
private List<MailAttachmentDTO> attachments;
private boolean isHtml = false;
private boolean isDebug = false;
@@ -95,6 +98,15 @@ public class MailRequestDTO {
return this;
}
public List<MailAttachmentDTO> getAttachments() {
return attachments;
}
public MailRequestDTO setAttachments(List<MailAttachmentDTO> attachments) {
this.attachments = attachments;
return this;
}
public boolean isHtml() {
return isHtml;
}

View File

@@ -26,6 +26,7 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
private String ragSocCom;
private String ragSocOrd;
private String destinatario;
private String codVdes;
private String citta;
private String provincia;
private String indirizzo;
@@ -424,4 +425,13 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
return this;
}
}
public String getCodVdes() {
return codVdes;
}
public OrdineUscitaInevasoDTO setCodVdes(String codVdes) {
this.codVdes = codVdes;
return this;
}
}

View File

@@ -1,22 +1,29 @@
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
package it.integry.integrywmsnative.core.rest.model;
import com.annimon.stream.Stream;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
public class DocFromPickingDTO {
String codAnag, codVdes, tipoLista, noteDoc;
Date dataDoc;
Integer numDoc;
List<DatiCollo> colli;
List<Pedane> pedane;
import it.integry.integrywmsnative.core.model.MtbColt;
public class SaveDocFromPickingRequestDTO {
private String codAnag;
private String codVdes;
private String tipoLista;
private String noteDoc;
private Date dataDoc;
private Integer numDoc;
private List<DatiCollo> colli;
private List<Pedane> pedane;
public String getCodAnag() {
return codAnag;
}
public DocFromPickingDTO setCodAnag(String codAnag) {
public SaveDocFromPickingRequestDTO setCodAnag(String codAnag) {
this.codAnag = codAnag;
return this;
}
@@ -25,7 +32,7 @@ public class DocFromPickingDTO {
return codVdes;
}
public DocFromPickingDTO setCodVdes(String codVdes) {
public SaveDocFromPickingRequestDTO setCodVdes(String codVdes) {
this.codVdes = codVdes;
return this;
}
@@ -34,7 +41,7 @@ public class DocFromPickingDTO {
return tipoLista;
}
public DocFromPickingDTO setTipoLista(String tipoLista) {
public SaveDocFromPickingRequestDTO setTipoLista(String tipoLista) {
this.tipoLista = tipoLista;
return this;
}
@@ -43,7 +50,7 @@ public class DocFromPickingDTO {
return noteDoc;
}
public DocFromPickingDTO setNoteDoc(String noteDoc) {
public SaveDocFromPickingRequestDTO setNoteDoc(String noteDoc) {
this.noteDoc = noteDoc;
return this;
}
@@ -52,7 +59,7 @@ public class DocFromPickingDTO {
return dataDoc;
}
public DocFromPickingDTO setDataDoc(Date dataDoc) {
public SaveDocFromPickingRequestDTO setDataDoc(Date dataDoc) {
this.dataDoc = dataDoc;
return this;
}
@@ -61,7 +68,7 @@ public class DocFromPickingDTO {
return numDoc;
}
public DocFromPickingDTO setNumDoc(Integer numDoc) {
public SaveDocFromPickingRequestDTO setNumDoc(Integer numDoc) {
this.numDoc = numDoc;
return this;
}
@@ -70,11 +77,24 @@ public class DocFromPickingDTO {
return colli;
}
public DocFromPickingDTO setColli(List<DatiCollo> colli) {
public SaveDocFromPickingRequestDTO setColli(List<DatiCollo> colli) {
this.colli = colli;
return this;
}
public SaveDocFromPickingRequestDTO setColliFromMtbColts(List<MtbColt> colli) {
if(colli == null) return this;
this.colli = Stream.of(colli)
.map(x -> new DatiCollo()
.setDataCollo(x.getDataColloD())
.setSerCollo(x.getSerCollo())
.setNumCollo(x.getNumCollo())
.setGestione(x.getGestione()))
.toList();
return this;
}
public List<Pedane> getPedane() {
return pedane;
}

View File

@@ -1,10 +1,7 @@
package it.integry.integrywmsnative.core.rest.model;
import java.util.Date;
import java.util.List;
import it.integry.integrywmsnative.core.utility.UtilityDate;
/**
* Created by GiuseppeS on 06/03/2018.
*/
@@ -12,7 +9,6 @@ import it.integry.integrywmsnative.core.utility.UtilityDate;
public class ServiceRESTResponse<T> {
private int esito;
private String execDate;
private String profileDB;
private String errorMessage;
@@ -24,9 +20,6 @@ public class ServiceRESTResponse<T> {
return EsitoType.fromIntValue(esito);
}
public Date getExecDate() {
return UtilityDate.recognizeDateWithExceptionHandler(execDate);
}
public String getProfileDB() {
return profileDB;

View File

@@ -0,0 +1,119 @@
package it.integry.integrywmsnative.core.rest.model.documento;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
public class DocumentoArtDTO {
private String codMart;
private String descrizione;
private String untMis;
private BigDecimal qtaCnf;
private ArrayList<String> barcode;
private boolean flagTracciabilita;
private boolean flagQtaCnfFissa;
private BigDecimal giacenza;
private boolean plu;
private BigDecimal przVendIva;
private boolean untMisDigitale;
public String getCodMart() {
return codMart;
}
public DocumentoArtDTO setCodMart(String codMart) {
this.codMart = codMart;
return this;
}
public String getDescrizione() {
return descrizione;
}
public DocumentoArtDTO setDescrizione(String descrizione) {
this.descrizione = descrizione;
return this;
}
public String getUntMis() {
return untMis;
}
public DocumentoArtDTO setUntMis(String untMis) {
this.untMis = untMis;
return this;
}
public BigDecimal getQtaCnf() {
return qtaCnf;
}
public DocumentoArtDTO setQtaCnf(BigDecimal qtaCnf) {
this.qtaCnf = qtaCnf;
return this;
}
public List<String> getBarcode() {
return barcode;
}
public DocumentoArtDTO setBarcode(ArrayList<String> barcode) {
this.barcode = barcode;
return this;
}
public boolean isFlagTracciabilita() {
return flagTracciabilita;
}
public DocumentoArtDTO setFlagTracciabilita(boolean flagTracciabilita) {
this.flagTracciabilita = flagTracciabilita;
return this;
}
public boolean isFlagQtaCnfFissa() {
return flagQtaCnfFissa;
}
public DocumentoArtDTO setFlagQtaCnfFissa(boolean flagQtaCnfFissa) {
this.flagQtaCnfFissa = flagQtaCnfFissa;
return this;
}
public BigDecimal getGiacenza() {
return giacenza;
}
public DocumentoArtDTO setGiacenza(BigDecimal giacenza) {
this.giacenza = giacenza;
return this;
}
public boolean isPlu() {
return plu;
}
public DocumentoArtDTO setPlu(boolean plu) {
this.plu = plu;
return this;
}
public BigDecimal getPrzVendIva() {
return przVendIva;
}
public DocumentoArtDTO setPrzVendIva(BigDecimal przVendIva) {
this.przVendIva = przVendIva;
return this;
}
public boolean isUntMisDigitale() {
return untMisDigitale;
}
public DocumentoArtDTO setUntMisDigitale(boolean untMisDigitale) {
this.untMisDigitale = untMisDigitale;
return this;
}
}

View File

@@ -0,0 +1,12 @@
package it.integry.integrywmsnative.core.rest.model.documento;
import java.util.List;
public class RetrieveDocumentoArtsResponseDTO {
private List<DocumentoArtDTO> arts;
public List<DocumentoArtDTO> getArts() {
return arts;
}
}

View File

@@ -2,9 +2,11 @@ package it.integry.integrywmsnative.core.rest.model.inventario;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import it.integry.integrywmsnative.core.model.MtbAart;
import it.integry.integrywmsnative.core.model.MtbUntMis;
public class InventarioArtDTO {
@@ -18,6 +20,7 @@ public class InventarioArtDTO {
private BigDecimal giacenza;
private boolean plu;
private BigDecimal przVendIva;
private boolean untMisDigitale;
public String getCodMart() {
return codMart;
@@ -109,7 +112,21 @@ public class InventarioArtDTO {
return this;
}
public boolean isUntMisDigitale() {
return untMisDigitale;
}
public InventarioArtDTO setUntMisDigitale(boolean untMisDigitale) {
this.untMisDigitale = untMisDigitale;
return this;
}
public MtbAart toMtbAart() {
MtbUntMis mtbUntMis = new MtbUntMis()
.setUntMis(getUntMis())
.setFlagDig(isUntMisDigitale() ? "S" : "N");
List<MtbUntMis> mtbUntMisList = Collections.singletonList(mtbUntMis);
return new MtbAart()
.setCodMart(getCodMart())
.setDescrizione(getDescrizione())
@@ -119,6 +136,7 @@ public class InventarioArtDTO {
.setQtaCnf(getQtaCnf())
.setPlu(isPlu() ? "S" : "N")
.setFlagTracciabilita(isFlagTracciabilita() ? "S" : "N")
.setFlagQtaCnfFissa(isFlagQtaCnfFissa() ? "S" : "N");
.setFlagQtaCnfFissa(isFlagQtaCnfFissa() ? "S" : "N")
.setMtbUntMis(mtbUntMisList);
}
}

View File

@@ -0,0 +1,14 @@
package it.integry.integrywmsnative.core.rest.model.inventario;
import java.util.List;
import it.integry.integrywmsnative.core.model.MtbInvent;
public class RetrieveInventariResponseDTO {
private List<MtbInvent> inventories;
public List<MtbInvent> getInventories() {
return inventories;
}
}

View File

@@ -0,0 +1,71 @@
package it.integry.integrywmsnative.core.rest.model.magazzino_automatico;
import java.math.BigDecimal;
public class MagazzinoAutomaticoPickItemRequestDTO {
private String codMart;
private String partitaMag;
private String untMis;
private BigDecimal qtaTot;
private BigDecimal qtaCnf;
private BigDecimal numCnf;
public MagazzinoAutomaticoPickItemRequestDTO(String codMart) {
this.codMart = codMart;
}
public String getCodMart() {
return codMart;
}
public MagazzinoAutomaticoPickItemRequestDTO setCodMart(String codMart) {
this.codMart = codMart;
return this;
}
public String getPartitaMag() {
return partitaMag;
}
public MagazzinoAutomaticoPickItemRequestDTO setPartitaMag(String partitaMag) {
this.partitaMag = partitaMag;
return this;
}
public String getUntMis() {
return untMis;
}
public MagazzinoAutomaticoPickItemRequestDTO setUntMis(String untMis) {
this.untMis = untMis;
return this;
}
public BigDecimal getQtaTot() {
return qtaTot;
}
public MagazzinoAutomaticoPickItemRequestDTO setQtaTot(BigDecimal qtaTot) {
this.qtaTot = qtaTot;
return this;
}
public BigDecimal getQtaCnf() {
return qtaCnf;
}
public MagazzinoAutomaticoPickItemRequestDTO setQtaCnf(BigDecimal qtaCnf) {
this.qtaCnf = qtaCnf;
return this;
}
public BigDecimal getNumCnf() {
return numCnf;
}
public MagazzinoAutomaticoPickItemRequestDTO setNumCnf(BigDecimal numCnf) {
this.numCnf = numCnf;
return this;
}
}

View File

@@ -0,0 +1,59 @@
package it.integry.integrywmsnative.core.rest.model.magazzino_automatico;
import java.util.List;
import it.integry.integrywmsnative.core.model.MtbColt;
public class MagazzinoAutomaticoPickItemsRequestDTO {
private boolean shouldCreateUDS;
private String defaultGestioneOfNewUDS;
private List<MagazzinoAutomaticoPickOrderRequestDTO> ordersOfNewUDS;
private MtbColt inputMtbColt;
private List<MagazzinoAutomaticoPickItemRequestDTO> itemsToPick;
public boolean isShouldCreateUDS() {
return shouldCreateUDS;
}
public MagazzinoAutomaticoPickItemsRequestDTO setShouldCreateUDS(boolean shouldCreateUDS) {
this.shouldCreateUDS = shouldCreateUDS;
return this;
}
public String getDefaultGestioneOfNewUDS() {
return defaultGestioneOfNewUDS;
}
public MagazzinoAutomaticoPickItemsRequestDTO setDefaultGestioneOfNewUDS(String defaultGestioneOfNewUDS) {
this.defaultGestioneOfNewUDS = defaultGestioneOfNewUDS;
return this;
}
public List<MagazzinoAutomaticoPickOrderRequestDTO> getOrdersOfNewUDS() {
return ordersOfNewUDS;
}
public MagazzinoAutomaticoPickItemsRequestDTO setOrdersOfNewUDS(List<MagazzinoAutomaticoPickOrderRequestDTO> ordersOfNewUDS) {
this.ordersOfNewUDS = ordersOfNewUDS;
return this;
}
public MtbColt getInputMtbColt() {
return inputMtbColt;
}
public MagazzinoAutomaticoPickItemsRequestDTO setInputMtbColt(MtbColt inputMtbColt) {
this.inputMtbColt = inputMtbColt;
return this;
}
public List<MagazzinoAutomaticoPickItemRequestDTO> getItemsToPick() {
return itemsToPick;
}
public MagazzinoAutomaticoPickItemsRequestDTO setItemsToPick(List<MagazzinoAutomaticoPickItemRequestDTO> itemsToPick) {
this.itemsToPick = itemsToPick;
return this;
}
}

View File

@@ -0,0 +1,43 @@
package it.integry.integrywmsnative.core.rest.model.magazzino_automatico;
import java.time.LocalDate;
public class MagazzinoAutomaticoPickOrderRequestDTO {
private final String type = "dtb_ordr";
private LocalDate dataCons;
private LocalDate dataOrd;
private String gestione;
private int numOrd;
public MagazzinoAutomaticoPickOrderRequestDTO(LocalDate dataOrd, String gestione, int numOrd) {
this.dataOrd = dataOrd;
this.gestione = gestione;
this.numOrd = numOrd;
}
public LocalDate getDataOrd() {
return dataOrd;
}
public String getGestione() {
return gestione;
}
public int getNumOrd() {
return numOrd;
}
public LocalDate getDataCons() {
return dataCons;
}
public MagazzinoAutomaticoPickOrderRequestDTO setDataCons(LocalDate dataCons) {
this.dataCons = dataCons;
return this;
}
public String getType() {
return type;
}
}

View File

@@ -0,0 +1,18 @@
package it.integry.integrywmsnative.core.rest.model.magazzino_automatico;
import it.integry.integrywmsnative.core.model.MtbColt;
public class MagazzinoAutomaticoPutItemsRequestDTO {
private MtbColt inputMtbColt;
public MtbColt getInputMtbColt() {
return inputMtbColt;
}
public MagazzinoAutomaticoPutItemsRequestDTO setInputMtbColt(MtbColt inputMtbColt) {
this.inputMtbColt = inputMtbColt;
return this;
}
}

View File

@@ -0,0 +1,18 @@
package it.integry.integrywmsnative.core.rest.model.uds;
import it.integry.integrywmsnative.core.model.MtbColt;
public class CanUDSBeDeletedRequestDTO {
private MtbColt mtbColt;
public MtbColt getMtbColt() {
return mtbColt;
}
public CanUDSBeDeletedRequestDTO setMtbColt(MtbColt mtbColt) {
this.mtbColt = mtbColt;
return this;
}
}

View File

@@ -0,0 +1,37 @@
package it.integry.integrywmsnative.core.rest.model.uds;
import it.integry.integrywmsnative.core.model.MtbColt;
public class CloseUDSRequestDTO {
private boolean printSSCC;
private String orderCodMdep;
private MtbColt mtbColt;
public boolean isPrintSSCC() {
return printSSCC;
}
public CloseUDSRequestDTO setPrintSSCC(boolean printSSCC) {
this.printSSCC = printSSCC;
return this;
}
public String getOrderCodMdep() {
return orderCodMdep;
}
public CloseUDSRequestDTO setOrderCodMdep(String orderCodMdep) {
this.orderCodMdep = orderCodMdep;
return this;
}
public MtbColt getMtbColt() {
return mtbColt;
}
public CloseUDSRequestDTO setMtbColt(MtbColt mtbColt) {
this.mtbColt = mtbColt;
return this;
}
}

View File

@@ -0,0 +1,24 @@
package it.integry.integrywmsnative.core.rest.model.uds;
import java.util.List;
import it.integry.integrywmsnative.core.model.MtbColt;
public class CloseUDSResponseDTO {
private boolean saved;
private boolean deleted;
private List<MtbColt> generatedMtbColts;
public boolean isSaved() {
return saved;
}
public boolean isDeleted() {
return deleted;
}
public List<MtbColt> getGeneratedMtbColts() {
return generatedMtbColts;
}
}

View File

@@ -0,0 +1,85 @@
package it.integry.integrywmsnative.core.rest.model.uds;
import java.util.List;
public class CreateUDSRequestDTO {
private String codMdep;
private int segno;
private String ragSoc;
private Integer numCollo;
private String serCollo;
private int causaleCollo;
private List<CreateUDSRequestOrderDTO> orders;
public String getCodMdep() {
return codMdep;
}
public CreateUDSRequestDTO setCodMdep(String codMdep) {
this.codMdep = codMdep;
return this;
}
public int getSegno() {
return segno;
}
public CreateUDSRequestDTO setSegno(int segno) {
this.segno = segno;
return this;
}
public String getRagSoc() {
return ragSoc;
}
public CreateUDSRequestDTO setRagSoc(String ragSoc) {
this.ragSoc = ragSoc;
return this;
}
public Integer getNumCollo() {
return numCollo;
}
public CreateUDSRequestDTO setNumCollo(Integer numCollo) {
this.numCollo = numCollo;
return this;
}
public String getSerCollo() {
return serCollo;
}
public CreateUDSRequestDTO setSerCollo(String serCollo) {
this.serCollo = serCollo;
return this;
}
public int getCausaleCollo() {
return causaleCollo;
}
public CreateUDSRequestDTO setCausaleCollo(int causaleCollo) {
this.causaleCollo = causaleCollo;
return this;
}
public List<CreateUDSRequestOrderDTO> getOrders() {
return orders;
}
public CreateUDSRequestDTO setOrders(List<CreateUDSRequestOrderDTO> orders) {
this.orders = orders;
return this;
}
public static class Causale {
public static final int SCARICO = 0;
public static final int POSIZIONAMENTO = 1;
}
}

View File

@@ -0,0 +1,49 @@
package it.integry.integrywmsnative.core.rest.model.uds;
import java.time.LocalDate;
public class CreateUDSRequestOrderDTO {
private String gestione;
private LocalDate dataOrd;
private LocalDate dataCons;
private int numOrd;
public String getGestione() {
return gestione;
}
public CreateUDSRequestOrderDTO setGestione(String gestione) {
this.gestione = gestione;
return this;
}
public LocalDate getDataOrd() {
return dataOrd;
}
public CreateUDSRequestOrderDTO setDataOrd(LocalDate dataOrd) {
this.dataOrd = dataOrd;
return this;
}
public LocalDate getDataCons() {
return dataCons;
}
public CreateUDSRequestOrderDTO setDataCons(LocalDate dataCons) {
this.dataCons = dataCons;
return this;
}
public int getNumOrd() {
return numOrd;
}
public CreateUDSRequestOrderDTO setNumOrd(int numOrd) {
this.numOrd = numOrd;
return this;
}
}

View File

@@ -0,0 +1,12 @@
package it.integry.integrywmsnative.core.rest.model.uds;
import it.integry.integrywmsnative.core.model.MtbColt;
public class CreateUDSResponseDTO {
private MtbColt mtbColt;
public MtbColt getMtbColt() {
return mtbColt;
}
}

View File

@@ -0,0 +1,17 @@
package it.integry.integrywmsnative.core.rest.model.uds;
import it.integry.integrywmsnative.core.model.MtbColt;
public class DeleteUDSRequestDTO {
private MtbColt mtbColt;
public MtbColt getMtbColt() {
return mtbColt;
}
public DeleteUDSRequestDTO setMtbColt(MtbColt mtbColt) {
this.mtbColt = mtbColt;
return this;
}
}

View File

@@ -0,0 +1,17 @@
package it.integry.integrywmsnative.core.rest.model.uds;
import it.integry.integrywmsnative.core.model.MtbColr;
public class DeleteUDSRowRequestDTO {
private MtbColr mtbColrToDelete;
public MtbColr getMtbColrToDelete() {
return mtbColrToDelete;
}
public DeleteUDSRowRequestDTO setMtbColrToDelete(MtbColr mtbColrToDelete) {
this.mtbColrToDelete = mtbColrToDelete;
return this;
}
}

View File

@@ -0,0 +1,50 @@
package it.integry.integrywmsnative.core.rest.model.uds;
import java.math.BigDecimal;
import it.integry.integrywmsnative.core.model.MtbColr;
public class EditUDSRowRequestDTO {
private MtbColr sourceMtbColr;
private BigDecimal newQtaTot;
private BigDecimal newQtaCnf;
private BigDecimal newNumCnf;
public MtbColr getSourceMtbColr() {
return sourceMtbColr;
}
public EditUDSRowRequestDTO setSourceMtbColr(MtbColr sourceMtbColr) {
this.sourceMtbColr = sourceMtbColr;
return this;
}
public BigDecimal getNewQtaTot() {
return newQtaTot;
}
public EditUDSRowRequestDTO setNewQtaTot(BigDecimal newQtaTot) {
this.newQtaTot = newQtaTot;
return this;
}
public BigDecimal getNewQtaCnf() {
return newQtaCnf;
}
public EditUDSRowRequestDTO setNewQtaCnf(BigDecimal newQtaCnf) {
this.newQtaCnf = newQtaCnf;
return this;
}
public BigDecimal getNewNumCnf() {
return newNumCnf;
}
public EditUDSRowRequestDTO setNewNumCnf(BigDecimal newNumCnf) {
this.newNumCnf = newNumCnf;
return this;
}
}

View File

@@ -0,0 +1,16 @@
package it.integry.integrywmsnative.core.rest.model.uds;
import it.integry.integrywmsnative.core.model.MtbColr;
public class EditUDSRowResponseDTO {
private MtbColr savedMtbColr;
public MtbColr getSavedMtbColr() {
return savedMtbColr;
}
public EditUDSRowResponseDTO setSavedMtbColr(MtbColr savedMtbColr) {
this.savedMtbColr = savedMtbColr;
return this;
}
}

View File

@@ -0,0 +1,92 @@
package it.integry.integrywmsnative.core.rest.model.uds;
import java.math.BigDecimal;
import java.time.LocalDate;
import it.integry.integrywmsnative.core.model.MtbColr;
import it.integry.integrywmsnative.core.model.MtbColt;
public class InsertUDSRowRequestDTO {
private MtbColr sourceMtbColr;
private MtbColt targetMtbColt;
private String codMart;
private BigDecimal qtaTot;
private BigDecimal qtaCnf;
private BigDecimal numCnf;
private String partitaMag;
private LocalDate dataScad;
public MtbColr getSourceMtbColr() {
return sourceMtbColr;
}
public InsertUDSRowRequestDTO setSourceMtbColr(MtbColr sourceMtbColr) {
this.sourceMtbColr = sourceMtbColr;
return this;
}
public MtbColt getTargetMtbColt() {
return targetMtbColt;
}
public InsertUDSRowRequestDTO setTargetMtbColt(MtbColt targetMtbColt) {
this.targetMtbColt = targetMtbColt;
return this;
}
public String getCodMart() {
return codMart;
}
public InsertUDSRowRequestDTO setCodMart(String codMart) {
this.codMart = codMart;
return this;
}
public BigDecimal getQtaTot() {
return qtaTot;
}
public InsertUDSRowRequestDTO setQtaTot(BigDecimal qtaTot) {
this.qtaTot = qtaTot;
return this;
}
public BigDecimal getQtaCnf() {
return qtaCnf;
}
public InsertUDSRowRequestDTO setQtaCnf(BigDecimal qtaCnf) {
this.qtaCnf = qtaCnf;
return this;
}
public BigDecimal getNumCnf() {
return numCnf;
}
public InsertUDSRowRequestDTO setNumCnf(BigDecimal numCnf) {
this.numCnf = numCnf;
return this;
}
public String getPartitaMag() {
return partitaMag;
}
public InsertUDSRowRequestDTO setPartitaMag(String partitaMag) {
this.partitaMag = partitaMag;
return this;
}
public LocalDate getDataScad() {
return dataScad;
}
public InsertUDSRowRequestDTO setDataScad(LocalDate dataScad) {
this.dataScad = dataScad;
return this;
}
}

View File

@@ -0,0 +1,12 @@
package it.integry.integrywmsnative.core.rest.model.uds;
import it.integry.integrywmsnative.core.model.MtbColr;
public class InsertUDSRowResponseDTO {
private MtbColr savedMtbColr;
public MtbColr getSavedMtbColr() {
return savedMtbColr;
}
}

View File

@@ -0,0 +1,19 @@
package it.integry.integrywmsnative.core.rest.model.uds;
import java.util.List;
import it.integry.integrywmsnative.core.model.MtbColt;
public class PrintUDSRequestDTO {
private List<MtbColt> mtbColts;
public List<MtbColt> getMtbColts() {
return mtbColts;
}
public PrintUDSRequestDTO setMtbColts(List<MtbColt> mtbColts) {
this.mtbColts = mtbColts;
return this;
}
}

View File

@@ -12,12 +12,12 @@ import it.integry.integrywmsnative.core.utility.UtilityString;
public class ServerStatusChecker {
private static ServerStatusChecker instance = new ServerStatusChecker();
private static final ServerStatusChecker instance = new ServerStatusChecker();
private List<RunnableArgs<Boolean>> mCallback = new ArrayList<>();
private final List<RunnableArgs<Boolean>> mCallback = new ArrayList<>();
private RunnableArgs<Boolean> mInternalCallback = value -> {
for (RunnableArgs callback : mCallback) {
private final RunnableArgs<Boolean> mInternalCallback = value -> {
for (RunnableArgs<Boolean> callback : mCallback) {
callback.run(value);
}
};
@@ -26,12 +26,13 @@ public class ServerStatusChecker {
private final long MILLIS_DELAY = 5 * 1000;
private Handler handler = new Handler();
private Runnable runnableCode = new Runnable() {
private final Handler handler = new Handler();
private final Runnable runnableCode = new Runnable() {
@Override
public void run() {
if (shouldExecute && !UtilityString.isNullOrEmpty(SettingsManager.i().getServer().getHost())) {
UtilityServer.isEmsApiAvailable(
SettingsManager.i().getServer().getProtocol(),
SettingsManager.i().getServer().getHost(),
SettingsManager.i().getServer().getPort(),
() -> mInternalCallback.run(true),

View File

@@ -7,7 +7,6 @@ import it.integry.integrywmsnative.core.model.Azienda;
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.model.dto.InternalCodAnagsDTO;
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
public class DBSettingsModel {
@@ -22,7 +21,6 @@ public class DBSettingsModel {
private boolean flagMultiClienteOrdV;
private boolean flagUseCodAnagAziendale;
private String defaultCausaleRettificaGiacenze;
private DistribuzioneColloDTO.CriterioDistribuzione defaultCriterioDistribuzione;
private boolean flagAskClienteInPickingLibero;
private boolean flagPickLiberoAllowEmptyCliente;
@@ -53,6 +51,10 @@ public class DBSettingsModel {
private String codDtipOrdTrasfV;
private boolean notifyLotStatus = false;
private boolean groupShippingByCommodityGroup = true;
private boolean showCodFornSpedizione = true;
private boolean flagCanCreateInventario = true;
public boolean isFlagSpedizioneEnableFakeGiacenza() {
return flagSpedizioneEnableFakeGiacenza;
}
@@ -133,15 +135,6 @@ public class DBSettingsModel {
return this;
}
public DistribuzioneColloDTO.CriterioDistribuzione getDefaultCriterioDistribuzione() {
return defaultCriterioDistribuzione;
}
public DBSettingsModel setDefaultCriterioDistribuzione(String defaultCriterioDistribuzione) {
this.defaultCriterioDistribuzione = DistribuzioneColloDTO.CriterioDistribuzione.fromString(defaultCriterioDistribuzione);
return this;
}
public boolean isFlagAskClienteInPickingLibero() {
return flagAskClienteInPickingLibero;
}
@@ -215,15 +208,6 @@ public class DBSettingsModel {
return this;
}
public boolean isFlagUseNewPickingListSpedizione() {
return flagUseNewPickingListSpedizione;
}
public DBSettingsModel setFlagUseNewPickingListSpedizione(boolean flagUseNewPickingListSpedizione) {
this.flagUseNewPickingListSpedizione = flagUseNewPickingListSpedizione;
return this;
}
public boolean isFlagVersamentoDirettoProduzione() {
return flagVersamentoDirettoProduzione;
}
@@ -395,4 +379,31 @@ public class DBSettingsModel {
this.notifyLotStatus = notifyLotStatus;
return this;
}
public boolean isGroupShippingByCommodityGroup() {
return groupShippingByCommodityGroup;
}
public DBSettingsModel setGroupShippingByCommodityGroup(boolean groupShippingByCommodityGroup) {
this.groupShippingByCommodityGroup = groupShippingByCommodityGroup;
return this;
}
public boolean isShowCodFornSpedizione() {
return showCodFornSpedizione;
}
public DBSettingsModel setShowCodFornSpedizione(boolean showCodFornSpedizione) {
this.showCodFornSpedizione = showCodFornSpedizione;
return this;
}
public boolean isFlagCanCreateInventario() {
return flagCanCreateInventario;
}
public DBSettingsModel setFlagCanCreateInventario(boolean flagCanCreateInventario) {
this.flagCanCreateInventario = flagCanCreateInventario;
return this;
}
}

View File

@@ -341,13 +341,24 @@ public class SettingsManager {
.setGestName("PICKING")
.setSection("SPEDIZIONE")
.setKeySection("FLAG_NOTIFICA_STATO_PARTITA"));
stbGestSetupList.add(new StbGestSetup()
.setGestName("PICKING")
.setSection("SPEDIZIONE")
.setKeySection("FLAG_SHOW_COD_FORN"));
stbGestSetupList.add(new StbGestSetup()
.setGestName("PICKING")
.setSection("SPEDIZIONE")
.setKeySection("FLAG_GROUP_BY_GRP_MERC"));
stbGestSetupList.add(new StbGestSetup()
.setGestName("PICKING")
.setSection("INVENTARIO")
.setKeySection("FLAG_CAN_CREATE_INVENTARIO"));
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
mGestSetupRESTConsumer.getValues(codMdep, stbGestSetupList, list -> {
dbSettingsModelIstance.setEnableCheckPartitaMagCheckPickingV(getValueFromList(list, "SETUP", "ENABLE_CHECK_PARTITA_MAG_PICKING_V", Boolean.class));
dbSettingsModelIstance.setFlagMultiClienteOrdV(getValueFromList(list, "SETUP", "FLAG_MULTI_CLIENTE_ORD_VENDITA", Boolean.class));
dbSettingsModelIstance.setFlagUseCodAnagAziendale(getValueFromList(list, "SETUP", "FLAG_USE_COD_ANAG_AZIENDALE", Boolean.class));
dbSettingsModelIstance.setDefaultCriterioDistribuzione(getValueFromList(list, "SETUP", "DEFAULT_CRITERIO_DISTRIBUZIONE", String.class));
dbSettingsModelIstance.setFlagAskClienteInPickingLibero(getValueFromList(list, "PICKING_LIBERO", "FLAG_ASK_CLIENTE", Boolean.class));
dbSettingsModelIstance.setFlagPickLiberoAllowEmptyCliente(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_CLIENTE", Boolean.class));
dbSettingsModelIstance.setFlagCanAddExtraItemSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_ADD_EXTRA_ITEMS", Boolean.class));
@@ -356,7 +367,6 @@ public class SettingsManager {
dbSettingsModelIstance.setFlagEnableCheckDepositoSpedizione(getValueFromList(list, "SPEDIZIONE", "ENABLE_CHECK_DEPOSITO", Boolean.class));
dbSettingsModelIstance.setFlagForceAllToColli(getValueFromList(list, "SETUP", "FLAG_FORCE_ALL_TO_COLLI", Boolean.class));
dbSettingsModelIstance.setFlagAskPesoColloSpedizione(getValueFromList(list, "SETUP", "FLAG_ASK_PESO_COLLO", Boolean.class));
dbSettingsModelIstance.setFlagUseNewPickingListSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_USE_NEW_PICKING_LIST", Boolean.class));
dbSettingsModelIstance.setFlagVersamentoDirettoProduzione(getValueFromList(list, "PRODUZIONE", "FLAG_VERSAMENTO_DIRETTO", Boolean.class));
dbSettingsModelIstance.setFlagSpedizioneEnableManualPick(getValueFromList(list, "SPEDIZIONE", "ENABLE_MANUAL_PICK", Boolean.class));
dbSettingsModelIstance.setFlagSpedizioneEnableFakeGiacenza(getValueFromList(list, "SPEDIZIONE", "ENABLE_FAKE_GIACENZA", Boolean.class));
@@ -373,6 +383,9 @@ public class SettingsManager {
dbSettingsModelIstance.setFilterFornitoreProd(getValueFromList(list, "PRODUZIONE", "FILTER_FORNTIORE_PROD", String.class));
dbSettingsModelIstance.setCodDtipOrdTrasfV(getValueFromList(list, "SPEDIZIONE", "COD_DTIP_ORD_TRASF", String.class));
dbSettingsModelIstance.setNotifyLotStatus(getValueFromList(list, "SPEDIZIONE", "FLAG_NOTIFICA_STATO_PARTITA", Boolean.class));
dbSettingsModelIstance.setShowCodFornSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_SHOW_COD_FORN", Boolean.class, Boolean.TRUE));
dbSettingsModelIstance.setGroupShippingByCommodityGroup(getValueFromList(list, "SPEDIZIONE", "FLAG_GROUP_BY_GRP_MERC", Boolean.class, Boolean.FALSE));
dbSettingsModelIstance.setFlagCanCreateInventario(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_CREATE_INVENTARIO", Boolean.class, Boolean.TRUE));
String notePerdita = getValueFromList(list, "DOC_INTERNI", "NOTE_PERDITA", String.class);
if (notePerdita != null)
@@ -393,19 +406,26 @@ public class SettingsManager {
public static <T> T getValueFromList(List<StbGestSetup> stbGestSetupList, String section, String keySectionName, Class<T> clazz) {
return getValueFromList(stbGestSetupList, section, keySectionName, clazz, null);
}
public static <T> T getValueFromList(List<StbGestSetup> stbGestSetupList, String section, String keySectionName, Class<T> clazz, T defaultValue) {
StbGestSetup value = Stream.of(stbGestSetupList)
.filter(x -> x.getSection().equalsIgnoreCase(section) && x.getKeySection().equalsIgnoreCase(keySectionName))
.findFirstOrElse(new StbGestSetup());
.findFirstOrElse(null);
if (clazz == String.class) {
return clazz.cast(value.getValue());
} else if (clazz == Boolean.class) {
return clazz.cast("S".equalsIgnoreCase(value.getValue()));
} else if (clazz == Integer.class && value.getValue() != null) {
return clazz.cast(Integer.parseInt(value.getValue()));
} else return null;
if(value != null) {
if (clazz == String.class) {
return clazz.cast(value.getValue());
} else if (clazz == Boolean.class) {
return clazz.cast("S".equalsIgnoreCase(value.getValue()));
} else if (clazz == Integer.class && value.getValue() != null) {
return clazz.cast(Integer.parseInt(value.getValue()));
}
}
return defaultValue;
}
}

View File

@@ -20,6 +20,7 @@ public class SettingsModel {
public static class Server {
private String codAzienda;
private String protocol;
private String host;
private int port;
@@ -32,6 +33,15 @@ public class SettingsModel {
return this;
}
public String getProtocol() {
return protocol == null ? "http" : protocol;
}
public Server setProtocol(String protocol) {
this.protocol = protocol;
return this;
}
public String getHost() {
return host;
}

View File

@@ -15,9 +15,6 @@ import java.io.File;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.class_router.BaseCustomConfiguration;
import it.integry.integrywmsnative.core.class_router.ClassRouter;
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.FileDownloader;
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
@@ -30,19 +27,9 @@ public class UpdatesManager {
public void init(AppCompatActivity activityContext) {
this.mContext = activityContext;
String suffix;
ICustomConfiguration customConfiguration = ClassRouter.getInstance(ClassRouter.PATH.CUSTOM_CONFIGURATION);
try {
suffix = customConfiguration.getConfig(BaseCustomConfiguration.Keys.CUSTOM_DYNAMIC_VERSION_PATH);
if (suffix == null) {
suffix = "";
}
} catch (Exception e) {
suffix = "";
}
String currentVersionUrl = "http://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/currentVersion";
String currentDownloadUrl = "http://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/android-release" + suffix + ".apk";
String currentVersionUrl = SettingsManager.i().getServer().getProtocol() + "://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/currentVersion";
String currentDownloadUrl = SettingsManager.i().getServer().getProtocol() + "://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/android-release.apk";
AppUpdater appUpdater = new AppUpdater(mContext)

View File

@@ -20,11 +20,7 @@ public class PermissionsHelper {
public static void askPermissions(SplashActivity activity, Runnable onPermissionsConfirmed, RunnableArgs<Boolean> onPermissionsDenied) {
List<String> permissionsToAsk = new ArrayList<>();
permissionsToAsk.add(Manifest.permission.READ_EXTERNAL_STORAGE);
permissionsToAsk.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
permissionsToAsk.add(Manifest.permission.CAMERA);
//permissionsToAsk.add(Manifest.permission.INTERNET);
//permissionsToAsk.add(Manifest.permission.ACCESS_WIFI_STATE);
if(Build.VERSION.SDK_INT >= 23) {
@@ -34,6 +30,15 @@ public class PermissionsHelper {
permissionsToAsk.add(Manifest.permission.BLUETOOTH_CONNECT);
}
if(Build.VERSION.SDK_INT < 33) {
permissionsToAsk.add(Manifest.permission.READ_EXTERNAL_STORAGE);
permissionsToAsk.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
} else {
permissionsToAsk.add(Manifest.permission.READ_MEDIA_IMAGES);
permissionsToAsk.add(Manifest.permission.READ_MEDIA_AUDIO);
permissionsToAsk.add(Manifest.permission.READ_MEDIA_VIDEO);
}
String[] permissionArray = new String[permissionsToAsk.size()];

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