Compare commits
243 Commits
v1.16.17(1
...
v1.19.2(24
| Author | SHA1 | Date | |
|---|---|---|---|
| 21f9a9819a | |||
| 4059335e61 | |||
| 14252f0f4b | |||
| c13eee355e | |||
| 51528fda6f | |||
| 1486d39eb8 | |||
| 1951d8e2a4 | |||
| 420fdf6b4c | |||
| a14a593e4f | |||
| 5d7ffa02c4 | |||
| 4942807104 | |||
| 20dafb1250 | |||
| eb0746de0c | |||
| 2e255e0c47 | |||
| 6baebda5e1 | |||
| 8f943829ec | |||
| bd19d8c1a2 | |||
| 3e79d0a07a | |||
| d2111e36ee | |||
| 47a1ab8223 | |||
| 45df794280 | |||
| 7a9bd15cfa | |||
| f902439086 | |||
| e7334d358b | |||
| 262986f02c | |||
| 76188aa792 | |||
| eb67d2fc65 | |||
| 6e176c0b7f | |||
| 83b2327247 | |||
| 7605c4d70a | |||
| 5a8935675c | |||
| 1645fba77c | |||
| 6929a386db | |||
| 93c3350cb2 | |||
| 2b97faaa65 | |||
| 9260379c5f | |||
| 35e7fd60be | |||
| 1bbe5818f8 | |||
| 65d372c04c | |||
| be1c5ecd0b | |||
| 30e16fb765 | |||
| effff99e9a | |||
| c40bb8d7b0 | |||
| a7063c70eb | |||
| 512f5b0de3 | |||
| e306c28723 | |||
| f361701ad9 | |||
| aa00c440b0 | |||
| df2a566322 | |||
| eb83f8babb | |||
| e21946fe23 | |||
| 30b5053a22 | |||
| 914618cfeb | |||
| 53ebf6ff14 | |||
| 34c2065041 | |||
| db7ceedb4a | |||
| 1ef70c4f3a | |||
| e1eae00e01 | |||
| f8533daeed | |||
| ff4d71e616 | |||
| 8015961054 | |||
| a9164109da | |||
| 4a884b92ad | |||
| 6f15169157 | |||
| eb99c9d8cf | |||
| 0cc31a4a8e | |||
| a6664102db | |||
| eaeef05e64 | |||
| 98b6a32126 | |||
| fcddda8e3f | |||
| 9033548455 | |||
| 18b4b08e1b | |||
| 627d3646a6 | |||
| 8d87970a75 | |||
| ea6b26e00f | |||
| 624a880ad5 | |||
| fbcda5eaf6 | |||
| fbe095b7f7 | |||
| d4bd92ec90 | |||
| c3ee5519b4 | |||
| 1394725286 | |||
| b4cf8f629c | |||
| ec49384b58 | |||
| 0404863e3d | |||
| b71d627f99 | |||
| 403541c8e0 | |||
| f1e2a3a536 | |||
| 23bb284cff | |||
| 449955f182 | |||
| 15d3b1858a | |||
| cfb3acc33d | |||
| 61768fb2d0 | |||
| d782e8667a | |||
| e3d366b7a5 | |||
| c64112835b | |||
| 7ebc5de620 | |||
| aa93dc489e | |||
| 6c1be3a7bc | |||
| 18593c7fa0 | |||
| 3a6b87ba47 | |||
| 95ee04fc2a | |||
| 1d3113ce2e | |||
| ef3bac3b0b | |||
| d5f590bfda | |||
| 1b0f9fb4de | |||
| b1e309dc1c | |||
| 6da020c5cc | |||
| da4d66ecfe | |||
| 18efcb31a0 | |||
| d31cb71f9e | |||
| 86c99a99ca | |||
| ba1a70e73e | |||
| c822c3e0ef | |||
| 42746b3656 | |||
| 2782c4b477 | |||
| 5f13f7a634 | |||
| e811514764 | |||
| 21137b1224 | |||
| 7da0a5ade9 | |||
| 86d92b947d | |||
| 374127dfe9 | |||
| 91b43d1974 | |||
| c167893544 | |||
| 4c9a1bbaa9 | |||
| f970eb6cac | |||
| 1e1163c04d | |||
| 48f1307095 | |||
| 64fdda43db | |||
| 6611617a81 | |||
| f488e6bad0 | |||
| 266b3d707f | |||
| a726631925 | |||
| 0b634154e4 | |||
| 3e4d4300f1 | |||
| fb527c443f | |||
| 259c719344 | |||
| 178787d907 | |||
| a51cf2e899 | |||
| 9f587ac8b1 | |||
| df97d5c4a2 | |||
| 697bd1e85e | |||
| 5ace80ba28 | |||
| 1c8abcaa58 | |||
| 96ab52821c | |||
| ecd58dea14 | |||
| 9cdc4f299e | |||
| 39af233380 | |||
| 2576d423da | |||
| 234c21c7a1 | |||
| 6d5b6b0260 | |||
| f03976595c | |||
| 54dbade661 | |||
| 6d54bda9b4 | |||
| 4c244c1927 | |||
| ee3ee54e69 | |||
| 82d4607375 | |||
| 7ecdbd1f11 | |||
| a4c30b7fdd | |||
| 3ca75ca11a | |||
| f2f8594a18 | |||
| 7b7b3e554b | |||
| 7913771b2a | |||
| ebcd8eea0a | |||
| 97bf8c291a | |||
| e4f783862b | |||
| 653d4def4e | |||
| 3cf63fc1f1 | |||
| 45ddca1928 | |||
| f4ff33a942 | |||
| ca5b5d3151 | |||
| e22f7cf5c7 | |||
| 8ea38fd31c | |||
| ea7acf6053 | |||
| 3a0d4d290c | |||
| c8053831db | |||
| e0c07ea06e | |||
| 3e79b52e23 | |||
| 7d7712e57a | |||
| 6d7a047e8e | |||
| 72e4f2a0b9 | |||
| ef6cdc6a86 | |||
| 23b86e68cc | |||
| 2e46f9f665 | |||
| 88b1c56360 | |||
| 1d71ac10bd | |||
| 8eb677ecdf | |||
| 74efbac452 | |||
| 9c6375083f | |||
| b24d5271a4 | |||
| b5626e5b08 | |||
| fd2e1fa4f4 | |||
| a3f5072646 | |||
| 1258e8c3e6 | |||
| ccef0fe528 | |||
| 9bb5d1adce | |||
| ac446d953c | |||
| 407ff0b264 | |||
| 10e748b9d4 | |||
| e30273fe42 | |||
| 44564245a7 | |||
| 920f306907 | |||
| 90aa52ab55 | |||
| 93f3eb65f0 | |||
| eb94944928 | |||
| 28698ba306 | |||
| c713bbebbc | |||
| 38e2a02766 | |||
| dd8bf264a4 | |||
| 9488c1994d | |||
| 16099cdaf6 | |||
| f061f2bfc9 | |||
| f7253fd44c | |||
| e12d371567 | |||
| 5596f71c03 | |||
| 8669b812f5 | |||
| 3243484dd0 | |||
| 37114dc4d1 | |||
| d5af79abba | |||
| b50aa7a9d2 | |||
| cc333c3147 | |||
| fc5044134c | |||
| 93a3e39332 | |||
| 3eaf187136 | |||
| 36f9fa1e36 | |||
| 0f89913609 | |||
| 4cda247ddc | |||
| e88ea0a45c | |||
| 726cf80dc0 | |||
| a779d8b94d | |||
| f41e1f3a02 | |||
| aa75a77913 | |||
| 639be21ab5 | |||
| dfc241e7f6 | |||
| 7948c7fa97 | |||
| 2ae311c28a | |||
| 56ba43183c | |||
| b93b309ea8 | |||
| f5a2d012e5 | |||
| bf07e3d0f0 | |||
| 91f075976d | |||
| ee70faefa9 | |||
| 13cca99b09 | |||
| 62d4b6f724 |
23
.idea/codeStyles/Project.xml
generated
23
.idea/codeStyles/Project.xml
generated
@@ -1,24 +1,12 @@
|
|||||||
<component name="ProjectCodeStyleConfiguration">
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
<code_scheme name="Project" version="173">
|
<code_scheme name="Project" version="173">
|
||||||
<JetCodeStyleSettings>
|
<JetCodeStyleSettings>
|
||||||
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
|
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||||
<value>
|
|
||||||
<package name="java.util" alias="false" withSubpackages="false" />
|
|
||||||
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
|
|
||||||
<package name="io.ktor" alias="false" withSubpackages="true" />
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
<option name="PACKAGES_IMPORT_LAYOUT">
|
|
||||||
<value>
|
|
||||||
<package name="" alias="false" withSubpackages="true" />
|
|
||||||
<package name="java" alias="false" withSubpackages="true" />
|
|
||||||
<package name="javax" alias="false" withSubpackages="true" />
|
|
||||||
<package name="kotlin" alias="false" withSubpackages="true" />
|
|
||||||
<package name="" alias="true" withSubpackages="true" />
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
</JetCodeStyleSettings>
|
</JetCodeStyleSettings>
|
||||||
<codeStyleSettings language="XML">
|
<codeStyleSettings language="XML">
|
||||||
|
<indentOptions>
|
||||||
|
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||||
|
</indentOptions>
|
||||||
<arrangement>
|
<arrangement>
|
||||||
<rules>
|
<rules>
|
||||||
<section>
|
<section>
|
||||||
@@ -127,5 +115,8 @@
|
|||||||
</rules>
|
</rules>
|
||||||
</arrangement>
|
</arrangement>
|
||||||
</codeStyleSettings>
|
</codeStyleSettings>
|
||||||
|
<codeStyleSettings language="kotlin">
|
||||||
|
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||||
|
</codeStyleSettings>
|
||||||
</code_scheme>
|
</code_scheme>
|
||||||
</component>
|
</component>
|
||||||
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||||
|
</state>
|
||||||
|
</component>
|
||||||
16
.idea/deploymentTargetDropDown.xml
generated
Normal file
16
.idea/deploymentTargetDropDown.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="deploymentTargetDropDown">
|
||||||
|
<runningDeviceTargetsSelectedWithDialog>
|
||||||
|
<Target>
|
||||||
|
<type value="RUNNING_DEVICE_TARGET" />
|
||||||
|
<deviceKey>
|
||||||
|
<Key>
|
||||||
|
<type value="SERIAL_NUMBER" />
|
||||||
|
<value value="20119B1E55" />
|
||||||
|
</Key>
|
||||||
|
</deviceKey>
|
||||||
|
</Target>
|
||||||
|
</runningDeviceTargetsSelectedWithDialog>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
12
.idea/runConfigurations.xml
generated
12
.idea/runConfigurations.xml
generated
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="RunConfigurationProducerService">
|
|
||||||
<option name="ignoredProducers">
|
|
||||||
<set>
|
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
|
||||||
</set>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
5
.idea/runConfigurations/app_base.xml
generated
5
.idea/runConfigurations/app_base.xml
generated
@@ -1,13 +1,14 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="app_base" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
<configuration default="false" name="app_base" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
||||||
<module name="WMS_Native.app" />
|
<module name="WMS.app" />
|
||||||
<option name="DEPLOY" value="true" />
|
<option name="DEPLOY" value="true" />
|
||||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||||
<option name="ARTIFACT_NAME" value="" />
|
<option name="ARTIFACT_NAME" value="" />
|
||||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||||
<option name="ALL_USERS" value="false" />
|
<option name="ALL_USERS" value="false" />
|
||||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS_Native.dynamic_frudis,WMS_Native.dynamic_gramm,WMS_Native.dynamic_ime,WMS_Native.dynamic_saporiveri,WMS_Native.dynamic_saporiveri_pv,WMS_Native.dynamic_vgalimenti,dynamic_frudis,dynamic_gramm,dynamic_ime,dynamic_saporiveri,dynamic_saporiveri_pv,dynamic_vgalimenti" />
|
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||||
|
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS.dynamic_vgalimenti" />
|
||||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||||
<option name="MODE" value="default_activity" />
|
<option name="MODE" value="default_activity" />
|
||||||
<option name="CLEAR_LOGCAT" value="true" />
|
<option name="CLEAR_LOGCAT" value="true" />
|
||||||
|
|||||||
59
.idea/runConfigurations/app_frudis.xml
generated
59
.idea/runConfigurations/app_frudis.xml
generated
@@ -1,59 +0,0 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="app_frudis" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
|
||||||
<module name="WMS_Native.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="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS_Native.dynamic__base,WMS_Native.dynamic_gramm,WMS_Native.dynamic_ime,WMS_Native.dynamic_saporiveri,WMS_Native.dynamic_saporiveri_pv,WMS_Native.dynamic_vgalimenti,dynamic__base,dynamic_gramm,dynamic_ime,dynamic_saporiveri,dynamic_saporiveri_pv,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="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="true" />
|
|
||||||
<option name="STARTUP_PROFILING_ENABLED" value="false" />
|
|
||||||
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
|
|
||||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Sample Java Methods" />
|
|
||||||
<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>
|
|
||||||
59
.idea/runConfigurations/app_gramm.xml
generated
59
.idea/runConfigurations/app_gramm.xml
generated
@@ -1,59 +0,0 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="app_gramm" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
|
||||||
<module name="WMS_Native.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="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS_Native.dynamic__base,WMS_Native.dynamic_frudis,WMS_Native.dynamic_ime,WMS_Native.dynamic_saporiveri,WMS_Native.dynamic_saporiveri_pv,WMS_Native.dynamic_vgalimenti,dynamic__base,dynamic_frudis,dynamic_ime,dynamic_saporiveri,dynamic_saporiveri_pv,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="false" />
|
|
||||||
<option name="FORCE_STOP_RUNNING_APP" value="true" />
|
|
||||||
<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="Sample Java Methods" />
|
|
||||||
<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>
|
|
||||||
59
.idea/runConfigurations/app_ime.xml
generated
59
.idea/runConfigurations/app_ime.xml
generated
@@ -1,59 +0,0 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="app_ime" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
|
||||||
<module name="WMS_Native.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="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS_Native.dynamic__base,WMS_Native.dynamic_frudis,WMS_Native.dynamic_gramm,WMS_Native.dynamic_saporiveri,WMS_Native.dynamic_saporiveri_pv,WMS_Native.dynamic_vgalimenti,dynamic__base,dynamic_frudis,dynamic_gramm,dynamic_saporiveri,dynamic_saporiveri_pv,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="false" />
|
|
||||||
<option name="FORCE_STOP_RUNNING_APP" value="true" />
|
|
||||||
<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="Sample Java Methods" />
|
|
||||||
<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>
|
|
||||||
59
.idea/runConfigurations/app_saporiveri.xml
generated
59
.idea/runConfigurations/app_saporiveri.xml
generated
@@ -1,59 +0,0 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="app_saporiveri" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
|
||||||
<module name="WMS_Native.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="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS_Native.dynamic__base,WMS_Native.dynamic_frudis,WMS_Native.dynamic_gramm,WMS_Native.dynamic_ime,WMS_Native.dynamic_saporiveri_pv,WMS_Native.dynamic_vgalimenti,dynamic__base,dynamic_frudis,dynamic_gramm,dynamic_ime,dynamic_saporiveri_pv,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="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="Sample Java Methods" />
|
|
||||||
<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>
|
|
||||||
59
.idea/runConfigurations/app_saporiveri_pv.xml
generated
59
.idea/runConfigurations/app_saporiveri_pv.xml
generated
@@ -1,59 +0,0 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="app_saporiveri_pv" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
|
||||||
<module name="WMS_Native.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="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS_Native.dynamic__base,WMS_Native.dynamic_frudis,WMS_Native.dynamic_gramm,WMS_Native.dynamic_ime,WMS_Native.dynamic_saporiveri,WMS_Native.dynamic_vgalimenti,dynamic__base,dynamic_frudis,dynamic_gramm,dynamic_ime,dynamic_saporiveri,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="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="Sample Java Methods" />
|
|
||||||
<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>
|
|
||||||
5
.idea/runConfigurations/app_vglimenti.xml
generated
5
.idea/runConfigurations/app_vglimenti.xml
generated
@@ -1,13 +1,14 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="app_vglimenti" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
<configuration default="false" name="app_vglimenti" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
||||||
<module name="WMS_Native.app" />
|
<module name="WMS.app" />
|
||||||
<option name="DEPLOY" value="true" />
|
<option name="DEPLOY" value="true" />
|
||||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||||
<option name="ARTIFACT_NAME" value="" />
|
<option name="ARTIFACT_NAME" value="" />
|
||||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||||
<option name="ALL_USERS" value="false" />
|
<option name="ALL_USERS" value="false" />
|
||||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS_Native.dynamic__base,WMS_Native.dynamic_frudis,WMS_Native.dynamic_gramm,WMS_Native.dynamic_ime,WMS_Native.dynamic_saporiveri,WMS_Native.dynamic_saporiveri_pv,dynamic__base,dynamic_frudis,dynamic_gramm,dynamic_ime,dynamic_saporiveri,dynamic_saporiveri_pv" />
|
<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="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||||
<option name="MODE" value="default_activity" />
|
<option name="MODE" value="default_activity" />
|
||||||
<option name="CLEAR_LOGCAT" value="true" />
|
<option name="CLEAR_LOGCAT" value="true" />
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ apply plugin: 'com.google.gms.google-services'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 199
|
def appVersionCode = 243
|
||||||
def appVersionName = '1.16.17'
|
def appVersionName = '1.19.2'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
@@ -15,6 +15,9 @@ android {
|
|||||||
keyPassword 'inpmiy'
|
keyPassword 'inpmiy'
|
||||||
storeFile file('Integry.jks')
|
storeFile file('Integry.jks')
|
||||||
storePassword 'inpmiy'
|
storePassword 'inpmiy'
|
||||||
|
|
||||||
|
enableV3Signing true
|
||||||
|
enableV4Signing true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,12 +27,12 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compileSdkVersion 29
|
compileSdkVersion 30
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "it.integry.integrywmsnative"
|
applicationId "it.integry.integrywmsnative"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 29
|
targetSdkVersion 30
|
||||||
versionCode appVersionCode
|
versionCode appVersionCode
|
||||||
versionName appVersionName
|
versionName appVersionName
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
@@ -50,8 +53,9 @@ android {
|
|||||||
android.buildFeatures.dataBinding true
|
android.buildFeatures.dataBinding true
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
targetCompatibility 1.8
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
sourceCompatibility 1.8
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
|
||||||
}
|
}
|
||||||
productFlavors {
|
productFlavors {
|
||||||
}
|
}
|
||||||
@@ -74,7 +78,7 @@ android {
|
|||||||
abortOnError false
|
abortOnError false
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamicFeatures = [":dynamic__base", ":dynamic_vgalimenti", ":dynamic_ime", ":dynamic_frudis", ":dynamic_saporiveri_pv", ":dynamic_saporiveri", ':dynamic_gramm']
|
dynamicFeatures = [":dynamic__base", ":dynamic_vgalimenti"]
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -99,24 +103,24 @@ dependencies {
|
|||||||
implementation 'com.google.android.gms:play-services-basement:17.6.0'
|
implementation 'com.google.android.gms:play-services-basement:17.6.0'
|
||||||
|
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
implementation 'androidx.appcompat:appcompat:1.3.1'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'com.google.android.material:material:1.3.0-rc01'
|
implementation 'com.google.android.material:material:1.4.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
implementation 'androidx.preference:preference-ktx:1.1.1'
|
implementation 'androidx.preference:preference-ktx:1.1.1'
|
||||||
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
|
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
implementation 'com.annimon:stream:1.2.1'
|
implementation 'com.annimon:stream:1.2.2'
|
||||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0'
|
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
|
||||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||||
implementation 'androidx.lifecycle:lifecycle-common-java8:2.3.0'
|
implementation 'androidx.lifecycle:lifecycle-common-java8:2.3.1'
|
||||||
implementation 'org.apache.commons:commons-text:1.9'
|
implementation 'org.apache.commons:commons-text:1.9'
|
||||||
|
|
||||||
//MVVM
|
//MVVM
|
||||||
def dagger2_version = '2.29.1'
|
def dagger2_version = '2.35.1'
|
||||||
api "com.google.dagger:dagger:$dagger2_version"
|
api "com.google.dagger:dagger:$dagger2_version"
|
||||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
||||||
api "com.google.dagger:dagger-android:$dagger2_version"
|
api "com.google.dagger:dagger-android:$dagger2_version"
|
||||||
@@ -127,16 +131,16 @@ dependencies {
|
|||||||
implementation 'com.github.clans:fab:1.6.4'
|
implementation 'com.github.clans:fab:1.6.4'
|
||||||
//CUSTOM VIEWS
|
//CUSTOM VIEWS
|
||||||
implementation 'com.github.NaimishTrivedi:FBToast:1.0'
|
implementation 'com.github.NaimishTrivedi:FBToast:1.0'
|
||||||
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
|
implementation 'com.github.cachapa:ExpandableLayout:2.9.2'
|
||||||
implementation 'com.github.frankiesardo:linearlistview:1.0.1@aar'
|
implementation 'com.github.frankiesardo:linearlistview:1.0.1@aar'
|
||||||
implementation 'com.fede987:status-bar-alert:1.0.1'
|
implementation 'com.github.fede87:StatusBarAlert:1.0.1'
|
||||||
implementation 'com.fxn769:stash:1.2'
|
implementation 'com.github.akshay2211:Stash:master'
|
||||||
testImplementation 'junit:junit:4.13.1'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
implementation 'com.github.zhukic:sectioned-recyclerview:1.2.3'
|
implementation 'com.github.zhukic:sectioned-recyclerview:1.2.3'
|
||||||
implementation 'com.github.pedromassango:doubleClick:3.0'
|
implementation 'com.github.pedromassango:doubleClick:3.0'
|
||||||
|
|
||||||
//SQLite ROOM
|
//SQLite ROOM
|
||||||
def room_version = "2.2.6"
|
def room_version = "2.3.0"
|
||||||
|
|
||||||
implementation "androidx.room:room-runtime:$room_version"
|
implementation "androidx.room:room-runtime:$room_version"
|
||||||
annotationProcessor "androidx.room:room-compiler:$room_version"
|
annotationProcessor "androidx.room:room-compiler:$room_version"
|
||||||
@@ -150,11 +154,16 @@ dependencies {
|
|||||||
implementation project(':barcode_base_android_library')
|
implementation project(':barcode_base_android_library')
|
||||||
implementation project(':honeywellscannerlibrary')
|
implementation project(':honeywellscannerlibrary')
|
||||||
implementation project(':keyobardemulatorscannerlibrary')
|
implementation project(':keyobardemulatorscannerlibrary')
|
||||||
implementation project(':barcode_kaiteki')
|
androidTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1'
|
||||||
androidTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
|
androidTestImplementation 'org.testng:testng:7.4.0'
|
||||||
androidTestImplementation 'org.testng:testng:7.3.0'
|
|
||||||
|
|
||||||
|
implementation 'com.github.RaviKoradiya:LiveAdapter:1.3.4'
|
||||||
|
implementation 'org.reflections:reflections:0.10.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
google()
|
google()
|
||||||
|
maven { url 'https://jitpack.io' }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.WRITE_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.REQUEST_INSTALL_PACKAGES" />
|
||||||
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".MainApplication"
|
android:name=".MainApplication"
|
||||||
@@ -24,16 +25,18 @@
|
|||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/Light"
|
android:theme="@style/Light"
|
||||||
android:windowSoftInputMode="adjustNothing" />
|
android:windowSoftInputMode="adjustNothing" />
|
||||||
<activity android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity" />
|
<activity android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/Light"
|
||||||
|
android:windowSoftInputMode="adjustNothing" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.picking_resi.PickingResiActivity"
|
android:name=".gest.picking_resi.PickingResiActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/Light" />
|
android:theme="@style/Light" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".gest.main.MainActivity"
|
||||||
android:screenOrientation="portrait"
|
|
||||||
android:theme="@style/Light"
|
android:theme="@style/Light"
|
||||||
android:windowSoftInputMode="adjustPan">
|
android:windowSoftInputMode="adjustNothing">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.CLIENTBARCODEACTIVITY" />
|
<action android:name="android.intent.action.CLIENTBARCODEACTIVITY" />
|
||||||
|
|
||||||
@@ -47,7 +50,6 @@
|
|||||||
android:windowSoftInputMode="adjustNothing" />
|
android:windowSoftInputMode="adjustNothing" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.login.LoginActivity"
|
android:name=".gest.login.LoginActivity"
|
||||||
android:screenOrientation="portrait"
|
|
||||||
android:theme="@style/Light" />
|
android:theme="@style/Light" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.lista_bancali.ListaBancaliActivity"
|
android:name=".gest.lista_bancali.ListaBancaliActivity"
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import android.app.Application;
|
|||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.context.AppContext;
|
import it.integry.integrywmsnative.core.context.AppContext;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
||||||
|
|
||||||
@@ -17,7 +19,8 @@ public class MainApplication extends Application {
|
|||||||
public static MainApplicationModule appModule;
|
public static MainApplicationModule appModule;
|
||||||
public static RoomModule roomModule;
|
public static RoomModule roomModule;
|
||||||
|
|
||||||
private AppContext appContext = new AppContext(this);
|
@Inject
|
||||||
|
AppContext appContext;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -27,16 +30,15 @@ public class MainApplication extends Application {
|
|||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
|
||||||
appModule = new MainApplicationModule(MainApplication.this, this);
|
appModule = new MainApplicationModule(this);
|
||||||
roomModule = new RoomModule(this);
|
roomModule = new RoomModule(this);
|
||||||
appComponent = DaggerMainApplicationComponent.builder()
|
appComponent = DaggerMainApplicationComponent.builder()
|
||||||
.mainApplicationModule(appModule)
|
.mainApplicationModule(appModule)
|
||||||
.roomModule(roomModule)
|
.roomModule(roomModule)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
appComponent.inject(appContext);
|
appComponent.inject(this);
|
||||||
|
|
||||||
appContext.init();
|
|
||||||
res = getResources();
|
res = getResources();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,22 +5,40 @@ import javax.inject.Singleton;
|
|||||||
import dagger.Component;
|
import dagger.Component;
|
||||||
import it.integry.integrywmsnative.core.context.AppContext;
|
import it.integry.integrywmsnative.core.context.AppContext;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneModule;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingComponent;
|
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingComponent;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingModule;
|
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingModule;
|
||||||
|
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
||||||
|
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliModule;
|
||||||
|
import it.integry.integrywmsnative.gest.main.MainActivityComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.main.MainActivityModule;
|
||||||
|
import it.integry.integrywmsnative.gest.main.MainFragmentComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.main.MainFragmentModule;
|
||||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoComponent;
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoComponent;
|
||||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoModule;
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoModule;
|
||||||
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoComponent;
|
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoComponent;
|
||||||
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoModule;
|
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoModule;
|
||||||
import it.integry.integrywmsnative.gest.picking_resi.PickingResiComponent;
|
import it.integry.integrywmsnative.gest.picking_resi.PickingResiComponent;
|
||||||
import it.integry.integrywmsnative.gest.picking_resi.PickingResiModule;
|
import it.integry.integrywmsnative.gest.picking_resi.PickingResiModule;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoModule;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdComponent;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdComponent;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdModule;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdModule;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaComponent;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaComponent;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaModule;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaModule;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeModule;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_rientro_merce.order_detail.ProdRientroMerceOrderDetailComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeModule;
|
||||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditComponent;
|
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditComponent;
|
||||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditModule;
|
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditModule;
|
||||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdineAcquistoGrigliaComponent;
|
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaComponent;
|
||||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdineAcquistoGrigliaModule;
|
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaModule;
|
||||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeComponent;
|
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeComponent;
|
||||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeModule;
|
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeModule;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.SpedizioneComponent;
|
import it.integry.integrywmsnative.gest.spedizione.SpedizioneComponent;
|
||||||
@@ -31,18 +49,33 @@ import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneCl
|
|||||||
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneClienteModule;
|
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneClienteModule;
|
||||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreComponent;
|
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreComponent;
|
||||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreModule;
|
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreModule;
|
||||||
|
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceModule;
|
||||||
|
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_batch_lot.DialogChooseBatchLotComponent;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotModule;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdComponent;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdModule;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2Component;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2Component;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2Module;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2Module;
|
||||||
import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtComponent;
|
import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtComponent;
|
||||||
import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtModule;
|
import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtModule;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUComponent;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUModule;
|
||||||
|
|
||||||
// Definition of the Application graph
|
// Definition of the Application graph
|
||||||
@Singleton
|
@Singleton
|
||||||
@Component(modules = {
|
@Component(modules = {
|
||||||
MainApplicationModule.class,
|
|
||||||
RoomModule.class,
|
RoomModule.class,
|
||||||
|
SplashActivityModule.class,
|
||||||
|
MainApplicationModule.class,
|
||||||
MainActivityModule.class,
|
MainActivityModule.class,
|
||||||
PVOrdineAcquistoGrigliaModule.class,
|
MainFragmentModule.class,
|
||||||
|
MainAccettazioneModule.class,
|
||||||
|
ListaBancaliModule.class,
|
||||||
|
ContenutoBancaleModule.class,
|
||||||
|
PVOrdiniAcquistoGrigliaModule.class,
|
||||||
PVOrdineAcquistoEditModule.class,
|
PVOrdineAcquistoEditModule.class,
|
||||||
PickingLiberoModule.class,
|
PickingLiberoModule.class,
|
||||||
RettificaGiacenzeModule.class,
|
RettificaGiacenzeModule.class,
|
||||||
@@ -53,14 +86,28 @@ import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtModule;
|
|||||||
PickingResiModule.class,
|
PickingResiModule.class,
|
||||||
OrdiniUscitaElencoModule.class,
|
OrdiniUscitaElencoModule.class,
|
||||||
DialogInputQuantityV2Module.class,
|
DialogInputQuantityV2Module.class,
|
||||||
|
DialogInputLUProdModule.class,
|
||||||
DialogScanArtModule.class,
|
DialogScanArtModule.class,
|
||||||
|
DialogScanOrCreateLUModule.class,
|
||||||
ProdFabbisognoLineeProdModule.class,
|
ProdFabbisognoLineeProdModule.class,
|
||||||
|
VersamentoMerceModule.class,
|
||||||
DialogAskMagazzinoProssimitaModule.class,
|
DialogAskMagazzinoProssimitaModule.class,
|
||||||
DialogRowInfoProdFabbisognoLineeProdModule.class})
|
DialogChooseBatchLotModule.class,
|
||||||
|
DialogRowInfoProdFabbisognoLineeProdModule.class,
|
||||||
|
ProdOrdineProduzioneElencoModule.class,
|
||||||
|
ProdRecuperoMaterialeModule.class,
|
||||||
|
ProdVersamentoMaterialeModule.class,
|
||||||
|
DialogChooseArtsFromListaArtsModule.class
|
||||||
|
})
|
||||||
public interface MainApplicationComponent {
|
public interface MainApplicationComponent {
|
||||||
|
|
||||||
|
SplashActivityComponent.Factory splashActivityComponent();
|
||||||
MainActivityComponent.Factory mainActivityComponent();
|
MainActivityComponent.Factory mainActivityComponent();
|
||||||
PVOrdineAcquistoGrigliaComponent.Factory pvOrdineAcquistoGrigliaComponent();
|
MainFragmentComponent.Factory mainFragmentComponent();
|
||||||
|
MainAccettazioneComponent.Factory mainAccettazioneComponent();
|
||||||
|
ListaBancaliComponent.Factory listaBancaliComponent();
|
||||||
|
ContenutoBancaleComponent.Factory contenutoBancaleComponent();
|
||||||
|
PVOrdiniAcquistoGrigliaComponent.Factory pvOrdineAcquistoGrigliaComponent();
|
||||||
PVOrdineAcquistoEditComponent.Factory pvOrdineAcquistoEditComponent();
|
PVOrdineAcquistoEditComponent.Factory pvOrdineAcquistoEditComponent();
|
||||||
PickingLiberoComponent.Factory pickingLiberoComponent();
|
PickingLiberoComponent.Factory pickingLiberoComponent();
|
||||||
RettificaGiacenzeComponent.Factory rettificaGiacenzeComponent();
|
RettificaGiacenzeComponent.Factory rettificaGiacenzeComponent();
|
||||||
@@ -71,12 +118,23 @@ public interface MainApplicationComponent {
|
|||||||
PickingResiComponent.Factory pickingResiComponent();
|
PickingResiComponent.Factory pickingResiComponent();
|
||||||
OrdiniUscitaElencoComponent.Factory prodOrdineLavorazioneElencoComponent();
|
OrdiniUscitaElencoComponent.Factory prodOrdineLavorazioneElencoComponent();
|
||||||
DialogInputQuantityV2Component.Factory dialogInputQuantityV2Component();
|
DialogInputQuantityV2Component.Factory dialogInputQuantityV2Component();
|
||||||
|
DialogInputLUProdComponent.Factory dialogInputLUProdComponent();
|
||||||
DialogScanArtComponent.Factory dialogScanArtComponent();
|
DialogScanArtComponent.Factory dialogScanArtComponent();
|
||||||
|
DialogScanOrCreateLUComponent.Factory dialogScanOrCreateLUComponent();
|
||||||
ProdFabbisognoLineeProdComponent.Factory prodFabbisognoLineeProdComponent();
|
ProdFabbisognoLineeProdComponent.Factory prodFabbisognoLineeProdComponent();
|
||||||
|
VersamentoMerceComponent.Factory versamentoMerceComponent();
|
||||||
DialogAskMagazzinoProssimitaComponent.Factory dialogAskMagazzinoProssimitaComponent();
|
DialogAskMagazzinoProssimitaComponent.Factory dialogAskMagazzinoProssimitaComponent();
|
||||||
|
DialogChooseBatchLotComponent.Factory dialogChooseBatchLotComponent();
|
||||||
DialogRowInfoProdFabbisognoLineeProdComponent.Factory dialogRowInfoProdFabbisognoLineeProdComponent();
|
DialogRowInfoProdFabbisognoLineeProdComponent.Factory dialogRowInfoProdFabbisognoLineeProdComponent();
|
||||||
|
ProdRientroMerceComponent.Factory prodRientroMerceComponent();
|
||||||
|
ProdRientroMerceOrderDetailComponent.Factory prodRientroMerceOrderDetailComponent();
|
||||||
|
ProdOrdineProduzioneElencoComponent.Factory prodOrdineProduzioneElencoComponent();
|
||||||
|
ProdRecuperoMaterialeComponent.Factory prodRecuperoMaterialeComponent();
|
||||||
|
ProdVersamentoMaterialeComponent.Factory prodVersamentoMaterialeComponent();
|
||||||
|
DialogChooseArtsFromListaArtsComponent.Factory dialogChooseArtsFromListaArtsComponent();
|
||||||
|
|
||||||
|
|
||||||
void inject(AppContext appContext);
|
void inject(MainApplication mainApplication);
|
||||||
|
void inject(AppContext mainApplication);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,25 @@
|
|||||||
package it.integry.integrywmsnative;
|
package it.integry.integrywmsnative;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
import dagger.Provides;
|
import dagger.Provides;
|
||||||
|
import it.integry.integrywmsnative.core.context.AppContext;
|
||||||
|
import it.integry.integrywmsnative.core.context.MainContext;
|
||||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
||||||
|
import it.integry.integrywmsnative.core.menu.MenuRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.menu.MenuService;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.EntityRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
@@ -21,11 +29,9 @@ import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabb
|
|||||||
@Module
|
@Module
|
||||||
public class MainApplicationModule {
|
public class MainApplicationModule {
|
||||||
|
|
||||||
private final Context mContext;
|
|
||||||
private final Application mApplication;
|
private final Application mApplication;
|
||||||
|
|
||||||
public MainApplicationModule(Context context, Application application) {
|
public MainApplicationModule(Application application) {
|
||||||
this.mContext = context;
|
|
||||||
this.mApplication = application;
|
this.mApplication = application;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,14 +43,34 @@ public class MainApplicationModule {
|
|||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
ColliDataRecoverService provideColliDataRecoverService() {
|
AppContext providesAppContext() {
|
||||||
return new ColliDataRecoverService();
|
return new AppContext(mApplication);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
OrdiniRESTConsumer provideOrdiniRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
MainContext providesMainContextNew(MenuService menuService, AppDatabase appDatabase) {
|
||||||
return new OrdiniRESTConsumer(systemRESTConsumer);
|
return new MainContext(mApplication.getApplicationContext(), menuService, appDatabase);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
ColliDataRecoverService provideColliDataRecoverService() {
|
||||||
|
ColliDataRecoverService colliDataRecoverService = new ColliDataRecoverService(mApplication.getApplicationContext());
|
||||||
|
colliDataRecoverService.init();
|
||||||
|
return colliDataRecoverService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
MenuService provideMenuService(MenuRESTConsumer menuRESTConsumer) {
|
||||||
|
return new MenuService(menuRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
OrdiniRESTConsumer provideOrdiniRESTConsumer(SystemRESTConsumer systemRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
||||||
|
return new OrdiniRESTConsumer(systemRESTConsumer, entityRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@@ -55,14 +81,44 @@ public class MainApplicationModule {
|
|||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
ArticoloRESTConsumer provideArticoloRESTConsumer() {
|
ArticoloRESTConsumer provideArticoloRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||||
return new ArticoloRESTConsumer();
|
return new ArticoloRESTConsumer(systemRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
ColliMagazzinoRESTConsumer provideColliMagazzinoRESTConsumer(ArticoloRESTConsumer articoloRESTConsumer) {
|
DepositoRESTConsumer provideDepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer, SystemRESTConsumer systemRESTConsumer) {
|
||||||
return new ColliMagazzinoRESTConsumer(articoloRESTConsumer);
|
return new DepositoRESTConsumer(entityRESTConsumer, systemRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
MenuRESTConsumer provideMenuRESTConsumer() {
|
||||||
|
return new MenuRESTConsumer();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
MagazzinoRESTConsumer provideMagazzinoRESTConsumer() {
|
||||||
|
return new MagazzinoRESTConsumer();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
MesRESTConsumer provideMesRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||||
|
return new MesRESTConsumer(systemRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
EntityRESTConsumer provideEntityRESTConsumer() {
|
||||||
|
return new EntityRESTConsumer();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
ColliMagazzinoRESTConsumer provideColliMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
||||||
|
return new ColliMagazzinoRESTConsumer(systemRESTConsumer, articoloRESTConsumer, entityRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@@ -96,5 +152,4 @@ public class MainApplicationModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import android.content.pm.PackageInfo;
|
|||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
import android.text.Spanned;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
@@ -12,6 +13,8 @@ import androidx.databinding.DataBindingUtil;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.context.MainContext;
|
import it.integry.integrywmsnative.core.context.MainContext;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgsss;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgsss;
|
||||||
@@ -20,14 +23,18 @@ import it.integry.integrywmsnative.core.utility.PermissionsHelper;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityContext;
|
import it.integry.integrywmsnative.core.utility.UtilityContext;
|
||||||
import it.integry.integrywmsnative.databinding.ActivitySplashBinding;
|
import it.integry.integrywmsnative.databinding.ActivitySplashBinding;
|
||||||
import it.integry.integrywmsnative.gest.login.LoginActivity;
|
import it.integry.integrywmsnative.gest.login.LoginActivity;
|
||||||
|
import it.integry.integrywmsnative.gest.main.MainActivity;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
public class SplashActivity extends BaseActivity {
|
public class SplashActivity extends BaseActivity implements MainContext.Listener {
|
||||||
|
|
||||||
|
|
||||||
private ActivitySplashBinding mBinding;
|
private ActivitySplashBinding mBinding;
|
||||||
|
|
||||||
private MainContext mainContext = new MainContext(this);
|
// private MainContext mainContext = new MainContext(this);
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
MainContext mainContext;
|
||||||
|
|
||||||
private RunnableArgsss<Integer, String[], List<Integer>> onRequestPermissionResult;
|
private RunnableArgsss<Integer, String[], List<Integer>> onRequestPermissionResult;
|
||||||
|
|
||||||
@@ -35,32 +42,23 @@ public class SplashActivity extends BaseActivity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
MainApplication.appComponent
|
||||||
|
.splashActivityComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
|
mainContext.setListener(this);
|
||||||
|
|
||||||
mBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.activity_splash, null, false);
|
mBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.activity_splash, null, false);
|
||||||
setContentView(mBinding.getRoot());
|
setContentView(mBinding.getRoot());
|
||||||
|
|
||||||
UtilityContext.initMainActivity(this);
|
UtilityContext.initMainActivity(this);
|
||||||
|
|
||||||
initAppVersion();
|
|
||||||
|
|
||||||
|
initAppVersion();
|
||||||
initPermissions(this::init);
|
initPermissions(this::init);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initPermissions(Runnable onComplete) {
|
|
||||||
PermissionsHelper.askPermissions(this, () -> {
|
|
||||||
onComplete.run();
|
|
||||||
}, permanentlyDenied -> {
|
|
||||||
if(permanentlyDenied) {
|
|
||||||
DialogSimpleMessageView.makeErrorDialog(new SpannableString(getText(R.string.permissions_permanently_denied)), null, () -> {
|
|
||||||
this.finish();
|
|
||||||
})
|
|
||||||
.show(getSupportFragmentManager(), "tag");
|
|
||||||
} else {
|
|
||||||
initPermissions(onComplete);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void initAppVersion() {
|
private void initAppVersion() {
|
||||||
try {
|
try {
|
||||||
PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
|
PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
|
||||||
@@ -68,7 +66,7 @@ public class SplashActivity extends BaseActivity {
|
|||||||
|
|
||||||
String debugText = "";
|
String debugText = "";
|
||||||
|
|
||||||
if(BuildConfig.DEBUG) debugText += "\n[DEBUG VERSION]";
|
if (BuildConfig.DEBUG) debugText += "\n[DEBUG VERSION]";
|
||||||
|
|
||||||
mBinding.appVersionTextview.setText("v" + version + debugText);
|
mBinding.appVersionTextview.setText("v" + version + debugText);
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
@@ -76,15 +74,39 @@ public class SplashActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initPermissions(Runnable onComplete) {
|
||||||
|
PermissionsHelper.askPermissions(this, onComplete, permanentlyDenied -> {
|
||||||
|
if (permanentlyDenied) {
|
||||||
|
onError(new SpannableString(getText(R.string.permissions_permanently_denied)));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
initPermissions(onComplete);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
if(!SettingsManager.i().isUserLoggedIn()){
|
if (!SettingsManager.i().isUserLoggedIn()) {
|
||||||
startLoginActivity();
|
startLoginActivity();
|
||||||
} else {
|
} else {
|
||||||
mainContext.init(this::startMainActivity);
|
mainContext.init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDBDataLoading(String item) {
|
||||||
|
mBinding.loadingInfoTextview.setText("Caricamento " + item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMenuLoading() {
|
||||||
|
mBinding.loadingInfoTextview.setText("Caricamento menù");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onContextInitialized() {
|
||||||
|
startMainActivity();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setOnRequestPermissionsResult(RunnableArgsss<Integer, String[], List<Integer>> onRequestPermissionResult) {
|
public void setOnRequestPermissionsResult(RunnableArgsss<Integer, String[], List<Integer>> onRequestPermissionResult) {
|
||||||
@@ -94,9 +116,10 @@ public class SplashActivity extends BaseActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
|
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
|
||||||
if(this.onRequestPermissionResult != null) {
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
|
if (this.onRequestPermissionResult != null) {
|
||||||
List<Integer> grantResultsList = new ArrayList<>();
|
List<Integer> grantResultsList = new ArrayList<>();
|
||||||
for(int i = 0; i < grantResults.length; i++) {
|
for (int i = 0; i < grantResults.length; i++) {
|
||||||
grantResultsList.add(grantResults[i]);
|
grantResultsList.add(grantResults[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,20 +128,26 @@ public class SplashActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void startLoginActivity() {
|
||||||
|
|
||||||
|
|
||||||
private void startLoginActivity(){
|
|
||||||
this.finish();
|
this.finish();
|
||||||
Intent myIntent = new Intent(this, LoginActivity.class);
|
Intent myIntent = new Intent(this, LoginActivity.class);
|
||||||
startActivity(myIntent);
|
startActivity(myIntent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startMainActivity(){
|
private void startMainActivity() {
|
||||||
this.finish();
|
this.finish();
|
||||||
Intent myIntent = new Intent(this, MainActivity.class);
|
Intent myIntent = new Intent(this, MainActivity.class);
|
||||||
startActivity(myIntent);
|
startActivity(myIntent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Spanned message) {
|
||||||
|
|
||||||
|
DialogSimpleMessageView.makeErrorDialog(
|
||||||
|
message, null, this::finish, R.string.logout, () -> {
|
||||||
|
this.mainContext.logout(MainApplication::exit);
|
||||||
|
})
|
||||||
|
.show(this.getSupportFragmentManager(), "tag");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package it.integry.integrywmsnative;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface SplashActivityComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
|
||||||
|
SplashActivityComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(SplashActivity mainActivity);
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
|
||||||
|
@Module(subcomponents = SplashActivityComponent.class)
|
||||||
|
public class SplashActivityModule {
|
||||||
|
}
|
||||||
@@ -1,33 +1,27 @@
|
|||||||
package it.integry.integrywmsnative.core.barcode_reader;
|
package it.integry.integrywmsnative.core.barcode_reader;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.barcode_base_android_library.exception.BarcodeAdapterNotFoundException;
|
|
||||||
import it.integry.barcode_base_android_library.interfaces.BarcodeReaderInterface;
|
import it.integry.barcode_base_android_library.interfaces.BarcodeReaderInterface;
|
||||||
import it.integry.honeywellscannerlibrary.HoneyWellBarcodeReader;
|
import it.integry.honeywellscannerlibrary.HoneyWellBarcodeReader;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
|
||||||
import it.integry.keyobardemulatorscannerlibrary.KeyboardEmulatorBarcodeReader;
|
import it.integry.keyobardemulatorscannerlibrary.KeyboardEmulatorBarcodeReader;
|
||||||
import it.integry.pointmobilescannerlibrary.PointMobileBarcodeReader;
|
import it.integry.pointmobilescannerlibrary.PointMobileBarcodeReader;
|
||||||
import it.integry.zebrascannerlibrary.ZebraBarcodeReader;
|
import it.integry.zebrascannerlibrary.ZebraBarcodeReader;
|
||||||
|
|
||||||
public class BarcodeManager {
|
public class BarcodeManager {
|
||||||
|
|
||||||
private static AppCompatActivity context;
|
|
||||||
|
|
||||||
private static BarcodeReaderInterface mCurrentBarcodeInterface;
|
private static BarcodeReaderInterface mCurrentBarcodeInterface;
|
||||||
private static List<BarcodeCallbackDTO> mBarcodeCallbacksStacktrace = new ArrayList<>();
|
private static final List<BarcodeCallbackDTO> mBarcodeCallbacksStacktrace = new ArrayList<>();
|
||||||
|
|
||||||
private static boolean mEnabled = true;
|
private static boolean mEnabled = true;
|
||||||
|
|
||||||
|
|
||||||
private static Class<? extends BarcodeReaderInterface>[] registeredBarcodeReaderInterfaces = new Class[]{
|
private static final Class<? extends BarcodeReaderInterface>[] registeredBarcodeReaderInterfaces = new Class[]{
|
||||||
PointMobileBarcodeReader.class,
|
PointMobileBarcodeReader.class,
|
||||||
ZebraBarcodeReader.class,
|
ZebraBarcodeReader.class,
|
||||||
HoneyWellBarcodeReader.class,
|
HoneyWellBarcodeReader.class,
|
||||||
@@ -35,73 +29,60 @@ public class BarcodeManager {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
public static void init(AppCompatActivity context) {
|
public static void init(Context applicationContext) throws Exception {
|
||||||
BarcodeManager.context = context;
|
|
||||||
|
|
||||||
initBarcodeReader();
|
initBarcodeReader(applicationContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void initBarcodeReader() {
|
private static void initBarcodeReader(Context applicationContext) throws Exception {
|
||||||
|
|
||||||
for (Class<? extends BarcodeReaderInterface> readerInterface : registeredBarcodeReaderInterfaces){
|
for (Class<? extends BarcodeReaderInterface> readerInterface : registeredBarcodeReaderInterfaces) {
|
||||||
|
|
||||||
Constructor<?> cons = null;
|
Constructor<?> cons = Class.forName(readerInterface.getName()).getConstructors()[0];
|
||||||
try {
|
BarcodeReaderInterface object = (BarcodeReaderInterface) cons.newInstance(applicationContext);
|
||||||
cons = Class.forName(readerInterface.getName()).getConstructors()[0];
|
|
||||||
BarcodeReaderInterface object = (BarcodeReaderInterface) cons.newInstance(context);
|
|
||||||
|
|
||||||
if(object.isRightAdapter()) {
|
if (object.isRightAdapter()) {
|
||||||
mCurrentBarcodeInterface = object;
|
mCurrentBarcodeInterface = object;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
UtilityExceptions.defaultException(context,e);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mCurrentBarcodeInterface != null) {
|
if (mCurrentBarcodeInterface != null) {
|
||||||
|
|
||||||
try {
|
mCurrentBarcodeInterface.init(() -> {
|
||||||
mCurrentBarcodeInterface.init(() -> {
|
|
||||||
|
|
||||||
mCurrentBarcodeInterface.register(data -> {
|
|
||||||
BarcodeCallbackDTO callback = getValidCallback();
|
|
||||||
if(callback != null && mEnabled) {
|
|
||||||
callback.getOnScanSuccessfull().run(data);
|
|
||||||
}
|
|
||||||
}, ex -> {
|
|
||||||
BarcodeCallbackDTO callback = getValidCallback();
|
|
||||||
if(callback != null && mEnabled) {
|
|
||||||
callback.getOnScanFailed().run(ex);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
mCurrentBarcodeInterface.register(data -> {
|
||||||
|
BarcodeCallbackDTO callback = getValidCallback();
|
||||||
|
if (callback != null && mEnabled) {
|
||||||
|
callback.getOnScanSuccessfull().run(data);
|
||||||
|
}
|
||||||
|
}, ex -> {
|
||||||
|
BarcodeCallbackDTO callback = getValidCallback();
|
||||||
|
if (callback != null && mEnabled) {
|
||||||
|
callback.getOnScanFailed().run(ex);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} catch (BarcodeAdapterNotFoundException ex) {
|
|
||||||
UtilityExceptions.defaultException(context, ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static BarcodeCallbackDTO getValidCallback() {
|
private static BarcodeCallbackDTO getValidCallback() {
|
||||||
|
|
||||||
if(mBarcodeCallbacksStacktrace.size() > 0) {
|
if (mBarcodeCallbacksStacktrace.size() > 0) {
|
||||||
return mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() -1);
|
return mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() - 1);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean onKeyDown(int keyCode, KeyEvent keyEvent){
|
public static boolean onKeyDown(int keyCode, KeyEvent keyEvent) {
|
||||||
if (mCurrentBarcodeInterface != null)
|
if (mCurrentBarcodeInterface != null)
|
||||||
mCurrentBarcodeInterface.onKeyEvent(keyEvent);
|
mCurrentBarcodeInterface.onKeyEvent(keyEvent);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,8 +94,8 @@ public class BarcodeManager {
|
|||||||
|
|
||||||
int newID = -1;
|
int newID = -1;
|
||||||
|
|
||||||
if(mBarcodeCallbacksStacktrace.size() > 0) {
|
if (mBarcodeCallbacksStacktrace.size() > 0) {
|
||||||
newID = mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() -1).getID() + 1;
|
newID = mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() - 1).getID() + 1;
|
||||||
} else {
|
} else {
|
||||||
newID = 1;
|
newID = 1;
|
||||||
}
|
}
|
||||||
@@ -131,7 +112,7 @@ public class BarcodeManager {
|
|||||||
//Rimuovo la callback con l'ID trovato e tutte quelle con >ID in modo che rimuovo tutte le call aggiunte successivamente
|
//Rimuovo la callback con l'ID trovato e tutte quelle con >ID in modo che rimuovo tutte le call aggiunte successivamente
|
||||||
|
|
||||||
for (int i = 0; i < mBarcodeCallbacksStacktrace.size(); i++) {
|
for (int i = 0; i < mBarcodeCallbacksStacktrace.size(); i++) {
|
||||||
if(mBarcodeCallbacksStacktrace.get(i).getID() == ID || callbackObjFound) {
|
if (mBarcodeCallbacksStacktrace.get(i).getID() == ID || callbackObjFound) {
|
||||||
mBarcodeCallbacksStacktrace.remove(i);
|
mBarcodeCallbacksStacktrace.remove(i);
|
||||||
|
|
||||||
callbackObjFound = true;
|
callbackObjFound = true;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package it.integry.integrywmsnative.core.class_router;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.class_router.configs.MenuConfiguration;
|
|
||||||
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityHashMap;
|
import it.integry.integrywmsnative.core.utility.UtilityHashMap;
|
||||||
|
|
||||||
@@ -10,14 +9,12 @@ public class BaseCustomConfiguration implements ICustomConfiguration {
|
|||||||
|
|
||||||
|
|
||||||
public static class Keys {
|
public static class Keys {
|
||||||
public static int MENU_CONFIGURATION = 0;
|
|
||||||
public static int FLAG_SHOW_COD_FORN_IN_SPEDIZIONE = 1;
|
public static int FLAG_SHOW_COD_FORN_IN_SPEDIZIONE = 1;
|
||||||
public static int CUSTOM_DYNAMIC_VERSION_PATH = 2;
|
public static int CUSTOM_DYNAMIC_VERSION_PATH = 2;
|
||||||
public static int FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC = 3;
|
public static int FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected HashMap<Integer, Object> configurations = new HashMap<Integer, Object>() {{
|
protected HashMap<Integer, Object> configurations = new HashMap<>() {{
|
||||||
put(Keys.MENU_CONFIGURATION, new MenuConfiguration());
|
|
||||||
put(Keys.FLAG_SHOW_COD_FORN_IN_SPEDIZIONE, true);
|
put(Keys.FLAG_SHOW_COD_FORN_IN_SPEDIZIONE, true);
|
||||||
put(Keys.FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC, false);
|
put(Keys.FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC, false);
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import android.util.Pair;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.class_router.exceptions.MethodPathNotRegisteredException;
|
|
||||||
|
|
||||||
public class ClassRouter {
|
public class ClassRouter {
|
||||||
|
|
||||||
public enum PATH {
|
public enum PATH {
|
||||||
@@ -21,8 +19,8 @@ public class ClassRouter {
|
|||||||
|
|
||||||
private static List<Pair<PATH, Object>> mRouteClasses = new ArrayList<>();
|
private static List<Pair<PATH, Object>> mRouteClasses = new ArrayList<>();
|
||||||
|
|
||||||
public static void init(Context context) {
|
public static void init() {
|
||||||
ClassRouter.context = context;
|
// ClassRouter.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean checkIClassExists(PATH path) {
|
private static boolean checkIClassExists(PATH path) {
|
||||||
@@ -51,9 +49,7 @@ public class ClassRouter {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
mRouteClasses.add(new Pair<>(path, clazz.newInstance()));
|
mRouteClasses.add(new Pair<>(path, clazz.newInstance()));
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException | InstantiationException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (InstantiationException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -69,15 +65,15 @@ public class ClassRouter {
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
if (!checkIClassExists(path)) {
|
if (!checkIClassExists(path)) {
|
||||||
throw new MethodPathNotRegisteredException(path);
|
// throw new MethodPathNotRegisteredException(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
Object instance = mRouteClasses.get(getClassIndex(path)).second;
|
Object instance = mRouteClasses.get(getClassIndex(path)).second;
|
||||||
|
|
||||||
return (T)instance;
|
return (T)instance;
|
||||||
|
|
||||||
} catch (MethodPathNotRegisteredException ex) {
|
} catch (Exception ex) {
|
||||||
// UtilityExceptions.defaultException(null, ex, true);
|
// UtilityExceptions.defaultException(null, ex, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ public class BaseMenuConfiguration {
|
|||||||
@IdRes
|
@IdRes
|
||||||
private int mGroupId;
|
private int mGroupId;
|
||||||
|
|
||||||
|
private String codMenu;
|
||||||
|
|
||||||
private List<MenuItem> mItems = new ArrayList<>();
|
private List<MenuItem> mItems = new ArrayList<>();
|
||||||
|
|
||||||
public @IdRes int getGroupId() {
|
public @IdRes int getGroupId() {
|
||||||
@@ -52,6 +54,15 @@ public class BaseMenuConfiguration {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCodMenu() {
|
||||||
|
return codMenu;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MenuGroup setCodMenu(String codMenu) {
|
||||||
|
this.codMenu = codMenu;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public List<MenuItem> getItems() {
|
public List<MenuItem> getItems() {
|
||||||
return mItems;
|
return mItems;
|
||||||
}
|
}
|
||||||
@@ -67,6 +78,7 @@ public class BaseMenuConfiguration {
|
|||||||
@StringRes private int mTitleText;
|
@StringRes private int mTitleText;
|
||||||
@DrawableRes private int mTitleIcon;
|
@DrawableRes private int mTitleIcon;
|
||||||
@DrawableRes private int mDrawerIcon;
|
@DrawableRes private int mDrawerIcon;
|
||||||
|
private String codMenu;
|
||||||
private RunnableWithReturn<Fragment> fragmentFactory;
|
private RunnableWithReturn<Fragment> fragmentFactory;
|
||||||
|
|
||||||
public int getID() {
|
public int getID() {
|
||||||
@@ -105,6 +117,15 @@ public class BaseMenuConfiguration {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCodMenu() {
|
||||||
|
return codMenu;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MenuItem setCodMenu(String codMenu) {
|
||||||
|
this.codMenu = codMenu;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public RunnableWithReturn<Fragment> getFragmentFactory() {
|
public RunnableWithReturn<Fragment> getFragmentFactory() {
|
||||||
return fragmentFactory;
|
return fragmentFactory;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrd
|
|||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdFragment;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdFragment;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
|
||||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment;
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment;
|
||||||
|
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaFragment;
|
||||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeFragment;
|
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeFragment;
|
||||||
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneClienteFragment;
|
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneClienteFragment;
|
||||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreFragment;
|
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreFragment;
|
||||||
@@ -24,9 +25,11 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
new MenuGroup()
|
new MenuGroup()
|
||||||
.setGroupText(R.string.purchase)
|
.setGroupText(R.string.purchase)
|
||||||
.setGroupId(R.id.nav_group_acquisto)
|
.setGroupId(R.id.nav_group_acquisto)
|
||||||
|
.setCodMenu("MM008")
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_accettazione)
|
.setID(R.id.nav_accettazione)
|
||||||
|
.setCodMenu("MG044")
|
||||||
.setTitleText(R.string.accettazione_title_fragment)
|
.setTitleText(R.string.accettazione_title_fragment)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_accettazione)
|
.setTitleIcon(R.drawable.ic_dashboard_accettazione)
|
||||||
.setDrawerIcon(R.drawable.ic_black_download)
|
.setDrawerIcon(R.drawable.ic_black_download)
|
||||||
@@ -34,6 +37,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_resi_fornitore)
|
.setID(R.id.nav_resi_fornitore)
|
||||||
|
.setCodMenu("MG045")
|
||||||
.setTitleText(R.string.fragment_ultime_arrivi_fornitore_title)
|
.setTitleText(R.string.fragment_ultime_arrivi_fornitore_title)
|
||||||
.setTitleIcon(R.drawable.ic_latest_delivery)
|
.setTitleIcon(R.drawable.ic_latest_delivery)
|
||||||
.setDrawerIcon(R.drawable.ic_black_latest_delivery)
|
.setDrawerIcon(R.drawable.ic_black_latest_delivery)
|
||||||
@@ -42,9 +46,11 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
new MenuGroup()
|
new MenuGroup()
|
||||||
.setGroupText(R.string.checkout)
|
.setGroupText(R.string.checkout)
|
||||||
.setGroupId(R.id.nav_group_spedizione)
|
.setGroupId(R.id.nav_group_spedizione)
|
||||||
|
.setCodMenu("MM010")
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_spedizione)
|
.setID(R.id.nav_spedizione)
|
||||||
|
.setCodMenu("MG046")
|
||||||
.setTitleText(R.string.vendita_title_fragment)
|
.setTitleText(R.string.vendita_title_fragment)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_spedizione)
|
.setTitleIcon(R.drawable.ic_dashboard_spedizione)
|
||||||
.setDrawerIcon(R.drawable.ic_black_upload)
|
.setDrawerIcon(R.drawable.ic_black_upload)
|
||||||
@@ -52,6 +58,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_free_picking)
|
.setID(R.id.nav_free_picking)
|
||||||
|
.setCodMenu("MG047")
|
||||||
.setTitleText(R.string.free_picking)
|
.setTitleText(R.string.free_picking)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_picking_libero)
|
.setTitleIcon(R.drawable.ic_dashboard_picking_libero)
|
||||||
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
|
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
|
||||||
@@ -59,6 +66,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_resi_cliente)
|
.setID(R.id.nav_resi_cliente)
|
||||||
|
.setCodMenu("MG048")
|
||||||
.setTitleText(R.string.fragment_ultime_consegne_cliente_title)
|
.setTitleText(R.string.fragment_ultime_consegne_cliente_title)
|
||||||
.setTitleIcon(R.drawable.ic_latest_delivery_customer)
|
.setTitleIcon(R.drawable.ic_latest_delivery_customer)
|
||||||
.setDrawerIcon(R.drawable.ic_black_latest_delivery)
|
.setDrawerIcon(R.drawable.ic_black_latest_delivery)
|
||||||
@@ -66,9 +74,11 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
).addGroup(new MenuGroup()
|
).addGroup(new MenuGroup()
|
||||||
.setGroupText(R.string.manufacture)
|
.setGroupText(R.string.manufacture)
|
||||||
.setGroupId(R.id.nav_group_produzione)
|
.setGroupId(R.id.nav_group_produzione)
|
||||||
|
.setCodMenu("MM009")
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_prod_ordine_produzione)
|
.setID(R.id.nav_prod_ordine_produzione)
|
||||||
|
.setCodMenu("MG049")
|
||||||
.setTitleText(R.string.prod_ordine_produzione_title_fragment)
|
.setTitleText(R.string.prod_ordine_produzione_title_fragment)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_prod_accettazione_produzione)
|
.setTitleIcon(R.drawable.ic_dashboard_prod_accettazione_produzione)
|
||||||
.setDrawerIcon(R.drawable.ic_black_external)
|
.setDrawerIcon(R.drawable.ic_black_external)
|
||||||
@@ -76,6 +86,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_prod_ordine_lavorazione)
|
.setID(R.id.nav_prod_ordine_lavorazione)
|
||||||
|
.setCodMenu("MG050")
|
||||||
.setTitleText(R.string.prod_ordine_lavorazione_title_fragment)
|
.setTitleText(R.string.prod_ordine_lavorazione_title_fragment)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_lavorazione)
|
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_lavorazione)
|
||||||
.setDrawerIcon(R.drawable.ic_black_external)
|
.setDrawerIcon(R.drawable.ic_black_external)
|
||||||
@@ -83,6 +94,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_free_lav_picking)
|
.setID(R.id.nav_free_lav_picking)
|
||||||
|
.setCodMenu("MG051")
|
||||||
.setTitleText(it.integry.integrywmsnative.R.string.free_lav_picking)
|
.setTitleText(it.integry.integrywmsnative.R.string.free_lav_picking)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_libero)
|
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_libero)
|
||||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_barcode_scanner)
|
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_barcode_scanner)
|
||||||
@@ -90,6 +102,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_prod_posizionamento_da_ord)
|
.setID(R.id.nav_prod_posizionamento_da_ord)
|
||||||
|
.setCodMenu("MG052")
|
||||||
.setTitleText(R.string.prod_fabbisogno_linee_prod_title)
|
.setTitleText(R.string.prod_fabbisogno_linee_prod_title)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_merce)
|
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_merce)
|
||||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_load_shelf)
|
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_load_shelf)
|
||||||
@@ -97,6 +110,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_prod_versamento_materiale)
|
.setID(R.id.nav_prod_versamento_materiale)
|
||||||
|
.setCodMenu("MG053")
|
||||||
.setTitleText(R.string.prod_versamento_materiale_title_fragment)
|
.setTitleText(R.string.prod_versamento_materiale_title_fragment)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_materiale)
|
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_materiale)
|
||||||
.setDrawerIcon(R.drawable.ic_black_external)
|
.setDrawerIcon(R.drawable.ic_black_external)
|
||||||
@@ -104,32 +118,55 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_prod_recupero_materiale)
|
.setID(R.id.nav_prod_recupero_materiale)
|
||||||
|
.setCodMenu("MG054")
|
||||||
.setTitleText(R.string.prod_recupero_materiale_title_fragment)
|
.setTitleText(R.string.prod_recupero_materiale_title_fragment)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_prod_recupero_materiale)
|
.setTitleIcon(R.drawable.ic_dashboard_prod_recupero_materiale)
|
||||||
.setDrawerIcon(R.drawable.ic_black_external)
|
.setDrawerIcon(R.drawable.ic_black_external)
|
||||||
.setFragmentFactory(ProdRecuperoMaterialeFragment::newInstance))
|
.setFragmentFactory(ProdRecuperoMaterialeFragment::newInstance))
|
||||||
)
|
).addGroup(
|
||||||
.addGroup(
|
new MenuGroup()
|
||||||
new MenuGroup()
|
.setGroupText(R.string.internal_handling)
|
||||||
.setGroupText(R.string.internal_handling)
|
.setGroupId(R.id.nav_group_movimentazione_interna)
|
||||||
.setGroupId(R.id.nav_group_movimentazione_interna)
|
.setCodMenu("MM011")
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_versamento_merce)
|
.setID(R.id.nav_versamento_merce)
|
||||||
.setTitleText(R.string.versamento_merce_fragment_title)
|
.setCodMenu("MG055")
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_versamento_merce)
|
.setTitleText(R.string.versamento_merce_fragment_title)
|
||||||
.setDrawerIcon(R.drawable.ic_black_load_shelf)
|
.setTitleIcon(R.drawable.ic_dashboard_versamento_merce)
|
||||||
.setFragmentFactory(VersamentoMerceFragment::newInstance))
|
.setDrawerIcon(R.drawable.ic_black_load_shelf)
|
||||||
|
.setFragmentFactory(VersamentoMerceFragment::newInstance))
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_rettifica_giacenze)
|
.setID(R.id.nav_rettifica_giacenze)
|
||||||
.setTitleText(R.string.rettifica_giacenze_fragment_title)
|
.setCodMenu("MG056")
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_rettifica_giacenze)
|
.setTitleText(R.string.rettifica_giacenze_fragment_title)
|
||||||
.setDrawerIcon(R.drawable.ic_black_empty_box)
|
.setTitleIcon(R.drawable.ic_dashboard_rettifica_giacenze)
|
||||||
.setFragmentFactory(RettificaGiacenzeFragment::newInstance))
|
.setDrawerIcon(R.drawable.ic_black_empty_box)
|
||||||
|
.setFragmentFactory(RettificaGiacenzeFragment::newInstance))
|
||||||
|
|
||||||
|
|
||||||
);
|
).addGroup(
|
||||||
|
new MenuGroup()
|
||||||
|
.setCodMenu("MM012")
|
||||||
|
.setGroupText(it.integry.integrywmsnative.R.string.punto_vendita)
|
||||||
|
.setGroupId(it.integry.integrywmsnative.R.id.nav_group_puntivendita)
|
||||||
|
|
||||||
|
.addItem(new MenuItem()
|
||||||
|
.setCodMenu("MG057")
|
||||||
|
.setID(it.integry.integrywmsnative.R.id.nav_pv_ordini_acquisto)
|
||||||
|
.setTitleText(it.integry.integrywmsnative.R.string.generate_orders)
|
||||||
|
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
|
||||||
|
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
|
||||||
|
.setFragmentFactory(PVOrdiniAcquistoGrigliaFragment::newInstance))
|
||||||
|
|
||||||
|
// .addItem(new MenuItem()
|
||||||
|
// .setID(it.integry.integrywmsnative.R.id.nav_pv_ordini_acquisto_trasmessi)
|
||||||
|
// .setTitleText(it.integry.integrywmsnative.R.string.transmitted_orders)
|
||||||
|
// .setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_trasmitted_orders_list)
|
||||||
|
// .setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_trasmitted_orders_list)
|
||||||
|
// .setFragmentClass(PVOrdiniAcquistoTransmittedListFragment.newInstance()))
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,31 +7,38 @@ import com.orhanobut.logger.AndroidLogAdapter;
|
|||||||
import com.orhanobut.logger.Logger;
|
import com.orhanobut.logger.Logger;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.BuildConfig;
|
import it.integry.integrywmsnative.BuildConfig;
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.settings.Stash;
|
import it.integry.integrywmsnative.core.settings.Stash;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityContext;
|
import it.integry.integrywmsnative.core.utility.UtilityContext;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilitySettings;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class AppContext {
|
public class AppContext {
|
||||||
|
|
||||||
//Note: this is the Application Context NOT the Activity Context
|
//Note: this is the Application Context NOT the Activity Context
|
||||||
private final Context mContext;
|
private final Context mApplicationContext;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
AppDatabase mAppDatabase;
|
AppDatabase mAppDatabase;
|
||||||
|
|
||||||
public AppContext(Context context) {
|
public AppContext(Context context) {
|
||||||
this.mContext = context;
|
this.mApplicationContext = context;
|
||||||
|
|
||||||
|
MainApplication.appComponent
|
||||||
|
.inject(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Inject
|
||||||
public void init() {
|
public void init() {
|
||||||
this.initUtilities();
|
this.initUtilities();
|
||||||
|
|
||||||
@@ -43,10 +50,9 @@ public class AppContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void initSettings() {
|
private void initSettings() {
|
||||||
Stash.init(mContext);
|
Stash.init(mApplicationContext);
|
||||||
SettingsManager.init(mContext);
|
SettingsManager.init(mApplicationContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initCrashlytics() {
|
private void initCrashlytics() {
|
||||||
@@ -64,15 +70,13 @@ public class AppContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initUtilities() {
|
private void initUtilities() {
|
||||||
UtilityContext.initApplicationContext(mContext);
|
UtilityContext.initApplicationContext(mApplicationContext);
|
||||||
UtilityResources.init(mContext);
|
UtilityResources.init(mApplicationContext);
|
||||||
UtilityToast.init(mContext);
|
UtilityToast.init(mApplicationContext);
|
||||||
UtilitySettings.init(mAppDatabase);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initLogger() {
|
private void initLogger() {
|
||||||
Logger.addLogAdapter(new AndroidLogAdapter());
|
Logger.addLogAdapter(new AndroidLogAdapter());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,54 +4,81 @@ import android.content.Context;
|
|||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
|
import android.text.SpannedString;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.net.ConnectException;
|
import java.net.ConnectException;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.MainApplication;
|
import javax.inject.Singleton;
|
||||||
import it.integry.integrywmsnative.R;
|
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecover;
|
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
||||||
|
import it.integry.integrywmsnative.core.menu.MenuService;
|
||||||
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityThread;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilitySettings;
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class MainContext {
|
public class MainContext {
|
||||||
|
|
||||||
private final AppCompatActivity mContext;
|
private final Context applicationContext;
|
||||||
|
private final MenuService menuService;
|
||||||
|
private final AppDatabase appDatabase;
|
||||||
|
|
||||||
public MainContext(AppCompatActivity context) {
|
private Listener mListener;
|
||||||
this.mContext = context;
|
|
||||||
|
public MainContext(Context applicationContext, MenuService menuService, AppDatabase appDatabase) {
|
||||||
|
this.applicationContext = applicationContext;
|
||||||
|
this.menuService = menuService;
|
||||||
|
this.appDatabase = appDatabase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void init() {
|
||||||
|
|
||||||
public void init(Runnable onContextInitialized) {
|
try {
|
||||||
|
BarcodeManager.init(applicationContext);
|
||||||
|
} catch (Exception exception) {
|
||||||
|
|
||||||
BarcodeManager.init(mContext);
|
}
|
||||||
|
|
||||||
this.initDBData(() -> {
|
this.initDBData(() -> {
|
||||||
onContextInitialized.run();
|
this.initMenu(() -> {
|
||||||
|
|
||||||
|
this.initReflections();
|
||||||
|
if (mListener != null) mListener.onContextInitialized();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.initReflections();
|
|
||||||
|
|
||||||
this.initServerStatusChecker();
|
this.initServerStatusChecker();
|
||||||
|
|
||||||
ColliDataRecover.init(mContext);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void logout(Runnable onLoggedOut) {
|
||||||
|
menuService.invalidateCache();
|
||||||
|
UtilityThread.executeParallel(() -> {
|
||||||
|
SettingsManager.i().setUser(null);
|
||||||
|
SettingsManager.i().setUserSession(null);
|
||||||
|
SettingsManager.update();
|
||||||
|
appDatabase.clearAllTables();
|
||||||
|
|
||||||
|
onLoggedOut.run();
|
||||||
|
}, true);
|
||||||
|
}
|
||||||
|
|
||||||
private void initServerStatusChecker() {
|
private void initServerStatusChecker() {
|
||||||
ServerStatusChecker.init();
|
ServerStatusChecker.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initDBData(Runnable onComplete) {
|
private void initDBData(Runnable onComplete) {
|
||||||
SettingsManager.loadDBVariables(onComplete, ex -> {
|
|
||||||
|
|
||||||
|
SettingsManager.loadDBVariables(item -> {
|
||||||
|
if (mListener != null) mListener.onDBDataLoading(item);
|
||||||
|
},
|
||||||
|
onComplete,
|
||||||
|
ex -> {
|
||||||
|
|
||||||
Spanned message = null;
|
Spanned message = null;
|
||||||
|
|
||||||
@@ -63,18 +90,21 @@ public class MainContext {
|
|||||||
message = new SpannableString(ex.getMessage());
|
message = new SpannableString(ex.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogSimpleMessageView.makeErrorDialog(
|
if (mListener != null) mListener.onError(message);
|
||||||
message, null, mContext::finish, R.string.logout, () -> {
|
|
||||||
UtilitySettings.logout();
|
|
||||||
MainApplication.exit();
|
|
||||||
})
|
|
||||||
.show(mContext.getSupportFragmentManager(), "tag");
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initMenu(Runnable onComplete) {
|
||||||
|
if (mListener != null) mListener.onMenuLoading();
|
||||||
|
this.menuService.init(onComplete, ex -> {
|
||||||
|
if (mListener != null) mListener.onError(new SpannedString(ex.getMessage()));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void initReflections() {
|
private void initReflections() {
|
||||||
ClassRouter.init(mContext);
|
ClassRouter.init();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String initMethod = "init";
|
String initMethod = "init";
|
||||||
@@ -87,14 +117,29 @@ public class MainContext {
|
|||||||
// for static methods we can use null as instance of class
|
// for static methods we can use null as instance of class
|
||||||
final Object newInstance = dynamicContextClass.newInstance();
|
final Object newInstance = dynamicContextClass.newInstance();
|
||||||
|
|
||||||
m.invoke(newInstance, (Context) mContext);
|
m.invoke(newInstance, applicationContext);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
UtilityExceptions.defaultException(mContext, e, true);
|
// UtilityExceptions.defaultException(mContext, e, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public MainContext setListener(Listener listener) {
|
||||||
|
this.mListener = listener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface Listener {
|
||||||
|
void onDBDataLoading(String item);
|
||||||
|
|
||||||
|
void onMenuLoading();
|
||||||
|
|
||||||
|
void onContextInitialized();
|
||||||
|
|
||||||
|
void onError(Spanned message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,233 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.data_recover;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import com.annimon.stream.Optional;
|
|
||||||
import com.annimon.stream.Stream;
|
|
||||||
import com.google.android.gms.common.util.IOUtils;
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.lang.reflect.Type;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.CommonConst;
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|
||||||
|
|
||||||
public class ColliDataRecover {
|
|
||||||
|
|
||||||
public static class RecoverDTO {
|
|
||||||
private int id;
|
|
||||||
private int numCollo;
|
|
||||||
private String serCollo;
|
|
||||||
private String dataCollo;
|
|
||||||
private String gestioneCollo;
|
|
||||||
private String filtro;
|
|
||||||
|
|
||||||
private List<OrdineUscitaInevasoDTO> testateOrdini;
|
|
||||||
|
|
||||||
public int getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public RecoverDTO setId(int id) {
|
|
||||||
this.id = id;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getNumCollo() {
|
|
||||||
return numCollo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public RecoverDTO setNumCollo(int numCollo) {
|
|
||||||
this.numCollo = numCollo;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSerCollo() {
|
|
||||||
return serCollo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public RecoverDTO setSerCollo(String serCollo) {
|
|
||||||
this.serCollo = serCollo;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDataCollo() {
|
|
||||||
return dataCollo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public RecoverDTO setDataCollo(String dataCollo) {
|
|
||||||
this.dataCollo = dataCollo;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getGestioneCollo() {
|
|
||||||
return gestioneCollo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public RecoverDTO setGestioneCollo(String gestioneCollo) {
|
|
||||||
this.gestioneCollo = gestioneCollo;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFiltro() {
|
|
||||||
return filtro;
|
|
||||||
}
|
|
||||||
|
|
||||||
public RecoverDTO setFiltro(String filtro) {
|
|
||||||
this.filtro = filtro;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<OrdineUscitaInevasoDTO> getTestateOrdini() {
|
|
||||||
return testateOrdini;
|
|
||||||
}
|
|
||||||
|
|
||||||
public RecoverDTO setTestateOrdini(List<OrdineUscitaInevasoDTO> testateOrdini) {
|
|
||||||
this.testateOrdini = testateOrdini;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public MtbColt getMtbColt() {
|
|
||||||
return new MtbColt()
|
|
||||||
.setNumCollo(getNumCollo())
|
|
||||||
.setSerCollo(getSerCollo())
|
|
||||||
.setGestione(getGestioneCollo())
|
|
||||||
.setDataCollo(getDataCollo())
|
|
||||||
.setFiltroOrdini(getFiltro());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static AppCompatActivity mContext;
|
|
||||||
|
|
||||||
private static List<RecoverDTO> mtbColtsSessions = new ArrayList<>();
|
|
||||||
|
|
||||||
public static void init(AppCompatActivity context) {
|
|
||||||
mContext = context;
|
|
||||||
|
|
||||||
if(isFilePresent(CommonConst.Files.RECOVER_COLLO_FILE)) {
|
|
||||||
loadLocalFile();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean thereIsAnExistantSession() {
|
|
||||||
return mtbColtsSessions.size() > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<Integer> getAllSessionIDs() {
|
|
||||||
if(thereIsAnExistantSession()) {
|
|
||||||
|
|
||||||
return Stream.of(mtbColtsSessions)
|
|
||||||
.map(RecoverDTO::getId)
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
} else return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static RecoverDTO getSession(Integer sessionID) {
|
|
||||||
|
|
||||||
if(sessionID == null) return null;
|
|
||||||
|
|
||||||
return getIfExists(sessionID);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static RecoverDTO getIfExists(int id) {
|
|
||||||
Optional<RecoverDTO> recoverDTOOptional = Stream.of(mtbColtsSessions)
|
|
||||||
.filter(x -> x.getId() == id)
|
|
||||||
.findSingle();
|
|
||||||
|
|
||||||
|
|
||||||
return recoverDTOOptional.isPresent() ? recoverDTOOptional.get() : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int startNewSession(MtbColt mtbColtSession, List<OrdineUscitaInevasoDTO> testateOrdini) {
|
|
||||||
Integer newId = null;
|
|
||||||
|
|
||||||
while(newId == null) {
|
|
||||||
int randomId = new Random().nextInt(1000);
|
|
||||||
RecoverDTO dto = getIfExists(randomId);
|
|
||||||
if(dto == null) newId = randomId;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
RecoverDTO recoverDTO = new RecoverDTO()
|
|
||||||
.setId(newId)
|
|
||||||
.setDataCollo(mtbColtSession.getDataColloS())
|
|
||||||
.setNumCollo(mtbColtSession.getNumCollo())
|
|
||||||
.setSerCollo(mtbColtSession.getSerCollo())
|
|
||||||
.setGestioneCollo(mtbColtSession.getGestione())
|
|
||||||
.setFiltro(mtbColtSession.getFiltroOrdini())
|
|
||||||
.setTestateOrdini(testateOrdini);
|
|
||||||
|
|
||||||
mtbColtsSessions.add(recoverDTO);
|
|
||||||
updateLocalFile();
|
|
||||||
return newId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void closeSession(int ID) {
|
|
||||||
RecoverDTO dto = getIfExists(ID);
|
|
||||||
|
|
||||||
if(dto != null) {
|
|
||||||
mtbColtsSessions.remove(dto);
|
|
||||||
updateLocalFile();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private static void loadLocalFile() {
|
|
||||||
InputStream inputStream;
|
|
||||||
|
|
||||||
Gson gson = new Gson();
|
|
||||||
|
|
||||||
try {
|
|
||||||
inputStream = mContext.openFileInput(CommonConst.Files.RECOVER_COLLO_FILE);
|
|
||||||
|
|
||||||
byte[] bytes = IOUtils.readInputStreamFully(inputStream);
|
|
||||||
String jsonString = new String(bytes);
|
|
||||||
|
|
||||||
Type listType = new TypeToken<ArrayList<RecoverDTO>>(){}.getType();
|
|
||||||
mtbColtsSessions = gson.fromJson(jsonString, listType);
|
|
||||||
|
|
||||||
inputStream.close();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
UtilityExceptions.defaultException(mContext, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private static void updateLocalFile() {
|
|
||||||
FileOutputStream outputStream;
|
|
||||||
|
|
||||||
Gson gson = new Gson();
|
|
||||||
String jsonText = gson.toJson(mtbColtsSessions);
|
|
||||||
|
|
||||||
try {
|
|
||||||
outputStream = mContext.openFileOutput(CommonConst.Files.RECOVER_COLLO_FILE, Context.MODE_PRIVATE);
|
|
||||||
outputStream.write(jsonText.getBytes());
|
|
||||||
outputStream.close();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
UtilityExceptions.defaultException(mContext, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean isFilePresent(String fileName) {
|
|
||||||
String path = mContext.getFilesDir().getAbsolutePath() + "/" + fileName;
|
|
||||||
File file = new File(path);
|
|
||||||
return file.exists();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -2,8 +2,6 @@ package it.integry.integrywmsnative.core.data_recover;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import com.annimon.stream.Optional;
|
import com.annimon.stream.Optional;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.google.android.gms.common.util.IOUtils;
|
import com.google.android.gms.common.util.IOUtils;
|
||||||
@@ -24,22 +22,20 @@ import javax.inject.Singleton;
|
|||||||
import it.integry.integrywmsnative.core.CommonConst;
|
import it.integry.integrywmsnative.core.CommonConst;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class ColliDataRecoverService {
|
public class ColliDataRecoverService {
|
||||||
|
|
||||||
|
|
||||||
private AppCompatActivity mContext;
|
private final Context mApplicationContext;
|
||||||
private List<ColliDataRecoverDTO> mtbColtsSessions = new ArrayList<>();
|
private List<ColliDataRecoverDTO> mtbColtsSessions = new ArrayList<>();
|
||||||
|
|
||||||
@Inject
|
public ColliDataRecoverService(Context applicationContext) {
|
||||||
public ColliDataRecoverService() {
|
this.mApplicationContext = applicationContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init(AppCompatActivity appCompatActivity) {
|
@Inject
|
||||||
this.mContext = appCompatActivity;
|
public void init() {
|
||||||
|
|
||||||
if(isFilePresent(CommonConst.Files.RECOVER_COLLO_FILE)) {
|
if(isFilePresent(CommonConst.Files.RECOVER_COLLO_FILE)) {
|
||||||
loadLocalFile();
|
loadLocalFile();
|
||||||
}
|
}
|
||||||
@@ -114,7 +110,7 @@ public class ColliDataRecoverService {
|
|||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
inputStream = mContext.openFileInput(CommonConst.Files.RECOVER_COLLO_FILE);
|
inputStream = mApplicationContext.openFileInput(CommonConst.Files.RECOVER_COLLO_FILE);
|
||||||
|
|
||||||
byte[] bytes = IOUtils.readInputStreamFully(inputStream);
|
byte[] bytes = IOUtils.readInputStreamFully(inputStream);
|
||||||
String jsonString = new String(bytes);
|
String jsonString = new String(bytes);
|
||||||
@@ -125,7 +121,7 @@ public class ColliDataRecoverService {
|
|||||||
inputStream.close();
|
inputStream.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
UtilityExceptions.defaultException(mContext, e);
|
// UtilityExceptions.defaultException(mContext, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,17 +133,17 @@ public class ColliDataRecoverService {
|
|||||||
String jsonText = gson.toJson(mtbColtsSessions);
|
String jsonText = gson.toJson(mtbColtsSessions);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
outputStream = mContext.openFileOutput(CommonConst.Files.RECOVER_COLLO_FILE, Context.MODE_PRIVATE);
|
outputStream = mApplicationContext.openFileOutput(CommonConst.Files.RECOVER_COLLO_FILE, Context.MODE_PRIVATE);
|
||||||
outputStream.write(jsonText.getBytes());
|
outputStream.write(jsonText.getBytes());
|
||||||
outputStream.close();
|
outputStream.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
UtilityExceptions.defaultException(mContext, e);
|
// UtilityExceptions.defaultException(mContext, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isFilePresent(String fileName) {
|
private boolean isFilePresent(String fileName) {
|
||||||
String path = mContext.getFilesDir().getAbsolutePath() + "/" + fileName;
|
String path = mApplicationContext.getFilesDir().getAbsolutePath() + "/" + fileName;
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
return file.exists();
|
return file.exists();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import androidx.room.Update;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.GrigliaWrapper;
|
import it.integry.integrywmsnative.core.data_store.db.wrappers.GrigliaWrapper;
|
||||||
|
|
||||||
@@ -17,7 +16,7 @@ public interface GrigliaDao {
|
|||||||
@Query("SELECT * from griglie")
|
@Query("SELECT * from griglie")
|
||||||
List<Griglia> getAll();
|
List<Griglia> getAll();
|
||||||
|
|
||||||
@Query("SELECT *, COUNT(articoli_griglia.articolo_griglia_id) as countArticoli from griglie LEFT JOIN articoli_griglia ON (griglie.griglia_id = articoli_griglia.id_griglia) where cod_alis = :codAlis GROUP BY griglie.griglia_id")
|
@Query("SELECT griglie.*, COUNT(articoli_griglia.articolo_griglia_id) as countArticoli from griglie LEFT JOIN articoli_griglia ON (griglie.griglia_id = articoli_griglia.id_griglia) where cod_alis = :codAlis GROUP BY griglie.griglia_id")
|
||||||
GrigliaWrapper findByCodAlis(String codAlis);
|
GrigliaWrapper findByCodAlis(String codAlis);
|
||||||
|
|
||||||
@Insert
|
@Insert
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import androidx.room.PrimaryKey;
|
|||||||
@Index(value = "cod_alis", unique = true)
|
@Index(value = "cod_alis", unique = true)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
public class Griglia {
|
public class Griglia {
|
||||||
@PrimaryKey(autoGenerate = true)
|
@PrimaryKey(autoGenerate = true)
|
||||||
@ColumnInfo(name = "griglia_id")
|
@ColumnInfo(name = "griglia_id")
|
||||||
|
|||||||
@@ -0,0 +1,110 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.databinding.Bindable;
|
||||||
|
import androidx.databinding.Observable;
|
||||||
|
import androidx.databinding.PropertyChangeRegistry;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class BindableBigDecimal implements Observable {
|
||||||
|
|
||||||
|
BigDecimal mValue;
|
||||||
|
|
||||||
|
private transient PropertyChangeRegistry mCallbacks;
|
||||||
|
|
||||||
|
public BindableBigDecimal() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBigDecimal(BigDecimal startValue) {
|
||||||
|
this.mValue = startValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addOnPropertyChangedCallback(@NonNull OnPropertyChangedCallback callback) {
|
||||||
|
synchronized (this) {
|
||||||
|
if (mCallbacks == null) {
|
||||||
|
mCallbacks = new PropertyChangeRegistry();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mCallbacks.add(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addOnPropertyChangedCallback(@NonNull Runnable callback) {
|
||||||
|
synchronized (this) {
|
||||||
|
if (mCallbacks == null) {
|
||||||
|
mCallbacks = new PropertyChangeRegistry();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mCallbacks.add(new OnPropertyChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||||
|
callback.run();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeOnPropertyChangedCallback(@NonNull OnPropertyChangedCallback callback) {
|
||||||
|
synchronized (this) {
|
||||||
|
if (mCallbacks == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mCallbacks.remove(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void resetOnPropertyChangedCallback() {
|
||||||
|
synchronized (this) {
|
||||||
|
if (mCallbacks == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mCallbacks.clear();
|
||||||
|
mCallbacks = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notifies listeners that all properties of this instance have changed.
|
||||||
|
*/
|
||||||
|
public void notifyChange() {
|
||||||
|
synchronized (this) {
|
||||||
|
if (mCallbacks == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mCallbacks.notifyCallbacks(this, 0, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notifies listeners that a specific property has changed. The getter for the property
|
||||||
|
* that changes should be marked with {@link Bindable} to generate a field in
|
||||||
|
* <code>BR</code> to be used as <code>fieldId</code>.
|
||||||
|
*
|
||||||
|
* @param fieldId The generated BR id for the Bindable field.
|
||||||
|
*/
|
||||||
|
public void notifyPropertyChanged(int fieldId) {
|
||||||
|
synchronized (this) {
|
||||||
|
if (mCallbacks == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mCallbacks.notifyCallbacks(this, fieldId, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal get() {
|
||||||
|
return mValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(BigDecimal value) {
|
||||||
|
this.set(value, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(BigDecimal value, boolean forceRefresh) {
|
||||||
|
if (!mValue.equals(value) || forceRefresh) {
|
||||||
|
this.mValue = value;
|
||||||
|
notifyChange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
package it.integry.integrywmsnative.core.di;
|
package it.integry.integrywmsnative.core.di;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.databinding.BaseObservable;
|
|
||||||
import androidx.databinding.Bindable;
|
import androidx.databinding.Bindable;
|
||||||
import androidx.databinding.Observable;
|
import androidx.databinding.Observable;
|
||||||
import androidx.databinding.PropertyChangeRegistry;
|
import androidx.databinding.PropertyChangeRegistry;
|
||||||
|
|
||||||
public class BindableBoolean implements Observable {
|
public class BindableBoolean implements Observable {
|
||||||
|
|
||||||
boolean mValue;
|
boolean mValue;
|
||||||
|
|
||||||
@@ -105,5 +104,9 @@ public class BindableBoolean implements Observable {
|
|||||||
notifyChange();
|
notifyChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void toggle() {
|
||||||
|
set(!get());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.di;
|
|||||||
|
|
||||||
import android.app.DatePickerDialog;
|
import android.app.DatePickerDialog;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
|
import android.text.SpannableString;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AutoCompleteTextView;
|
import android.widget.AutoCompleteTextView;
|
||||||
@@ -37,11 +38,13 @@ import java.util.Locale;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.MainApplication;
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
public class Converters {
|
public class Converters {
|
||||||
|
|
||||||
@@ -84,6 +87,28 @@ public class Converters {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BindingAdapter("binding")
|
||||||
|
public static void bindEditText(AppCompatTextView view, final ObservableField<String> observableField) {
|
||||||
|
Pair<ObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
|
if (pair == null || pair.first != observableField) {
|
||||||
|
if (pair != null) {
|
||||||
|
view.removeTextChangedListener(pair.second);
|
||||||
|
}
|
||||||
|
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
if(observableField != null) observableField.set(s.toString());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
view.setTag(R.id.bound_observable, new Pair<>(observableField, watcher));
|
||||||
|
view.addTextChangedListener(watcher);
|
||||||
|
}
|
||||||
|
String newValue = observableField.get();
|
||||||
|
if (!view.getText().toString().equals(newValue)) {
|
||||||
|
view.setText(newValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@BindingAdapter("binding")
|
@BindingAdapter("binding")
|
||||||
public static void bindEditText(EditText view, final BindableString bindableString) {
|
public static void bindEditText(EditText view, final BindableString bindableString) {
|
||||||
Pair<BindableString, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
Pair<BindableString, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
@@ -106,6 +131,50 @@ public class Converters {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BindingAdapter("binding")
|
||||||
|
public static void bindEditText(EditText view, final ObservableField<String> observableString) {
|
||||||
|
Pair<ObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
|
if (pair == null || pair.first != observableString) {
|
||||||
|
if (pair != null) {
|
||||||
|
view.removeTextChangedListener(pair.second);
|
||||||
|
}
|
||||||
|
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
observableString.set(s.toString());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
view.setTag(R.id.bound_observable, new Pair<>(observableString, watcher));
|
||||||
|
view.addTextChangedListener(watcher);
|
||||||
|
}
|
||||||
|
String newValue = observableString.get();
|
||||||
|
if (!view.getText().toString().equals(newValue)) {
|
||||||
|
view.setText(newValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@BindingAdapter("binding")
|
||||||
|
public static void bindEditText(AutoCompleteTextView view, final ObservableField<String> observableString) {
|
||||||
|
Pair<ObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
|
if (pair == null || pair.first != observableString) {
|
||||||
|
if (pair != null) {
|
||||||
|
view.removeTextChangedListener(pair.second);
|
||||||
|
}
|
||||||
|
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
observableString.set(s.toString());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
view.setTag(R.id.bound_observable, new Pair<>(observableString, watcher));
|
||||||
|
view.addTextChangedListener(watcher);
|
||||||
|
}
|
||||||
|
String newValue = observableString.get();
|
||||||
|
if (!view.getText().toString().equals(newValue)) {
|
||||||
|
view.setText(newValue, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@BindingAdapter("binding")
|
@BindingAdapter("binding")
|
||||||
public static void bindTextInputEditText(TextInputEditText view, final BindableString bindableString) {
|
public static void bindTextInputEditText(TextInputEditText view, final BindableString bindableString) {
|
||||||
Pair<BindableString, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
Pair<BindableString, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
@@ -178,8 +247,8 @@ public class Converters {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@BindingAdapter({"binding"})
|
@BindingAdapter(value = {"binding", "parentView", "warningOnOldDates"}, requireAll = false)
|
||||||
public static void bindTextInputEditTextDate(TextInputEditText view, final ObservableField<Date> observableDate) {
|
public static void bindTextInputEditTextDate(TextInputEditText view, final ObservableField<Date> observableDate, BaseDialogFragment parentFragment, boolean warningOnOldDates) {
|
||||||
Pair<ObservableField<Date>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
Pair<ObservableField<Date>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
if (pair == null || pair.first != observableDate) {
|
if (pair == null || pair.first != observableDate) {
|
||||||
if (pair != null) {
|
if (pair != null) {
|
||||||
@@ -208,8 +277,20 @@ public class Converters {
|
|||||||
DatePickerDialog datePickerDialog = new DatePickerDialog(view.getContext(),
|
DatePickerDialog datePickerDialog = new DatePickerDialog(view.getContext(),
|
||||||
(cView, year, month, day) -> {
|
(cView, year, month, day) -> {
|
||||||
Date resultDate = new GregorianCalendar(year, month, day).getTime();
|
Date resultDate = new GregorianCalendar(year, month, day).getTime();
|
||||||
view.setText(UtilityDate.formatDate(resultDate, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
|
||||||
observableDate.set(resultDate);
|
if(parentFragment != null && warningOnOldDates && resultDate.before(new Date())) {
|
||||||
|
DialogSimpleMessageView
|
||||||
|
.makeWarningDialog(new SpannableString("Hai scelto una data precedente a quella odierna. Continuare?"), null, () -> {
|
||||||
|
view.setText(UtilityDate.formatDate(resultDate, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||||
|
observableDate.set(resultDate);
|
||||||
|
}, () -> {
|
||||||
|
|
||||||
|
})
|
||||||
|
.show(parentFragment.requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
} else {
|
||||||
|
view.setText(UtilityDate.formatDate(resultDate, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||||
|
observableDate.set(resultDate);
|
||||||
|
}
|
||||||
}, mYear, mMonth, mDay);
|
}, mYear, mMonth, mDay);
|
||||||
datePickerDialog.show();
|
datePickerDialog.show();
|
||||||
};
|
};
|
||||||
@@ -396,7 +477,7 @@ public class Converters {
|
|||||||
|
|
||||||
|
|
||||||
@BindingAdapter("visibility")
|
@BindingAdapter("visibility")
|
||||||
public static void bindView(View view, final ObservableField<Boolean> bindableBoolean) {
|
public static void bindViewVisibility(View view, final ObservableField<Boolean> bindableBoolean) {
|
||||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||||
}
|
}
|
||||||
@@ -411,6 +492,38 @@ public class Converters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@BindingAdapter({"reverse_visibility"})
|
||||||
|
public static void bindViewReverseVisibility(View view, final BindableBoolean bindableBoolean) {
|
||||||
|
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||||
|
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||||
|
}
|
||||||
|
bindableBoolean.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||||
|
view.setVisibility(bindableBoolean.get() ? View.GONE : View.VISIBLE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
view.setVisibility(bindableBoolean.get() ? View.GONE : View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@BindingAdapter("reverse_visibility")
|
||||||
|
public static void bindViewReverseVisibility(View view, final ObservableField<Boolean> bindableBoolean) {
|
||||||
|
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||||
|
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||||
|
}
|
||||||
|
bindableBoolean.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||||
|
view.setVisibility(bindableBoolean.get() ? View.GONE : View.VISIBLE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
view.setVisibility(bindableBoolean.get() ? View.GONE : View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@BindingAdapter("android:layout_weight")
|
@BindingAdapter("android:layout_weight")
|
||||||
public static void setLayoutWeight(View view, final Float weight) {
|
public static void setLayoutWeight(View view, final Float weight) {
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di.binders;
|
||||||
|
|
||||||
|
public class AutoCompleteTextViewBinders {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
|
||||||
|
public class AlreadyAttachedDocumentToLUException extends Exception {
|
||||||
|
|
||||||
|
public AlreadyAttachedDocumentToLUException() {
|
||||||
|
super(UtilityResources.getString(R.string.lu_already_attache_to_doc));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.exception;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.io.StringWriter;
|
|
||||||
|
|
||||||
public class MyExceptionHandler implements
|
|
||||||
java.lang.Thread.UncaughtExceptionHandler {
|
|
||||||
private final Context myContext;
|
|
||||||
private final Class<?> myActivityClass;
|
|
||||||
|
|
||||||
public MyExceptionHandler(Context context, Class<?> c) {
|
|
||||||
|
|
||||||
myContext = context;
|
|
||||||
myActivityClass = c;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void uncaughtException(Thread thread, Throwable exception) {
|
|
||||||
|
|
||||||
StringWriter stackTrace = new StringWriter();
|
|
||||||
exception.printStackTrace(new PrintWriter(stackTrace));
|
|
||||||
System.err.println(stackTrace);// You can use LogCat too
|
|
||||||
// Intent intent = new Intent(myContext, myActivityClass);
|
|
||||||
// String s = stackTrace.toString();
|
|
||||||
// //you can use this String to know what caused the exception and in which Activity
|
|
||||||
// intent.putExtra("uncaughtException",
|
|
||||||
// "Exception is: " + stackTrace.toString());
|
|
||||||
// intent.putExtra("stacktrace", s);
|
|
||||||
// myContext.startActivity(intent);
|
|
||||||
//for restarting the Activity
|
|
||||||
// Process.killProcess(Process.myPid());
|
|
||||||
// System.exit(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
|
||||||
|
public class NoArtsInLUException extends Exception {
|
||||||
|
|
||||||
|
public NoArtsInLUException() {
|
||||||
|
super(UtilityResources.getString(R.string.no_items_found_message));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
|
||||||
|
public class TooManyLUFoundInMonoLUPositionException extends Exception {
|
||||||
|
|
||||||
|
public TooManyLUFoundInMonoLUPositionException() {
|
||||||
|
super(UtilityResources.getString(R.string.too_much_lu_found_message_in_mono_lu));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ import android.view.KeyEvent;
|
|||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
|
|
||||||
public class BaseActivity extends AppCompatActivity {
|
public class BaseActivity extends AppCompatActivity {
|
||||||
@@ -38,17 +39,45 @@ public class BaseActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void openProgress() {
|
protected void openProgress() {
|
||||||
if (this.mCurrentProgress == null) {
|
runOnUiThread(() -> {
|
||||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(this);
|
BarcodeManager.disable();
|
||||||
}
|
if (this.mCurrentProgress == null) {
|
||||||
|
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(this);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void closeProgress() {
|
protected void closeProgress() {
|
||||||
if (mCurrentProgress != null) {
|
runOnUiThread(() -> {
|
||||||
mCurrentProgress.dismiss();
|
BarcodeManager.enable();
|
||||||
mCurrentProgress = null;
|
if (mCurrentProgress != null) {
|
||||||
}
|
mCurrentProgress.dismiss();
|
||||||
|
mCurrentProgress = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onLoadingStarted() {
|
||||||
|
new Thread(() -> {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
this.openProgress();
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onLoadingEnded() {
|
||||||
|
new Thread(() -> {
|
||||||
|
this.closeProgress();
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onError(Exception ex) {
|
||||||
|
this.runOnUiThread(() -> {
|
||||||
|
this.closeProgress();
|
||||||
|
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
||||||
|
BarcodeManager.enable();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,14 +2,18 @@ package it.integry.integrywmsnative.core.expansion;
|
|||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.DialogFragment;
|
import androidx.fragment.app.DialogFragment;
|
||||||
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
|
|
||||||
public class BaseDialogFragment extends DialogFragment {
|
public class BaseDialogFragment extends DialogFragment {
|
||||||
@@ -22,6 +26,17 @@ public class BaseDialogFragment extends DialogFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void show(FragmentManager manager, String tag) {
|
||||||
|
try {
|
||||||
|
FragmentTransaction ft = manager.beginTransaction();
|
||||||
|
ft.add(this, tag);
|
||||||
|
ft.commit();
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
Log.d("ABSDIALOGFRAG", "Exception", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
@@ -49,16 +64,46 @@ public class BaseDialogFragment extends DialogFragment {
|
|||||||
this.mBarcodeListener = listen;
|
this.mBarcodeListener = listen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void onLoadingStarted() {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
this.openProgress();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onLoadingEnded() {
|
||||||
|
this.closeProgress();
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}
|
||||||
|
|
||||||
protected void openProgress() {
|
protected void openProgress() {
|
||||||
if (this.mCurrentProgress == null) {
|
|
||||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
// new Thread(() -> {
|
||||||
}
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
if (this.mCurrentProgress == null) {
|
||||||
|
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// }).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void closeProgress() {
|
protected void closeProgress() {
|
||||||
if (mCurrentProgress != null) {
|
// new Thread(() -> {
|
||||||
mCurrentProgress.dismiss();
|
requireActivity().runOnUiThread(() -> {
|
||||||
mCurrentProgress = null;
|
if (mCurrentProgress != null) {
|
||||||
}
|
mCurrentProgress.dismiss();
|
||||||
|
mCurrentProgress = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// }).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onError(Exception ex) {
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
this.closeProgress();
|
||||||
|
UtilityExceptions.defaultException(requireActivity(), ex);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,27 +4,90 @@ import android.app.Dialog;
|
|||||||
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class BaseFragment extends Fragment {
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.IPoppableActivity;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
|
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||||
|
|
||||||
|
public abstract class BaseFragment extends Fragment {
|
||||||
|
|
||||||
protected Dialog mCurrentProgress;
|
protected Dialog mCurrentProgress;
|
||||||
|
|
||||||
|
protected ElevatedToolbar mToolbar;
|
||||||
|
|
||||||
|
protected final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
||||||
|
mToolbar = toolbar;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void addOnPreDestroy(Runnable onPreDestroy) {
|
||||||
|
this.mOnPreDestroyList.add(onPreDestroy);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void onLoadingStarted() {
|
||||||
|
new Thread(() -> {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
this.openProgress();
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onLoadingEnded() {
|
||||||
|
new Thread(() -> {
|
||||||
|
this.closeProgress();
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onError(Exception ex) {
|
||||||
|
this.getActivity().runOnUiThread(() -> {
|
||||||
|
this.closeProgress();
|
||||||
|
UtilityExceptions.defaultException(getActivity(), ex, mCurrentProgress);
|
||||||
|
BarcodeManager.enable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
|
||||||
|
for (Runnable onPreDestroy : mOnPreDestroyList) {
|
||||||
|
onPreDestroy.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void openProgress() {
|
protected void openProgress() {
|
||||||
if (this.mCurrentProgress == null) {
|
|
||||||
getActivity().runOnUiThread(() -> {
|
getActivity().runOnUiThread(() -> {
|
||||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
if (this.mCurrentProgress == null) {
|
||||||
|
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void closeProgress() {
|
protected void closeProgress() {
|
||||||
if (mCurrentProgress != null) {
|
|
||||||
getActivity().runOnUiThread(() -> {
|
getActivity().runOnUiThread(() -> {
|
||||||
mCurrentProgress.dismiss();
|
if (mCurrentProgress != null) {
|
||||||
mCurrentProgress = null;
|
mCurrentProgress.dismiss();
|
||||||
|
mCurrentProgress = null;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void popMe() {
|
||||||
|
((IPoppableActivity) requireActivity()).pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import androidx.databinding.Observable;
|
||||||
|
|
||||||
|
public abstract class OnGeneralChangedCallback extends Observable.OnPropertyChangedCallback implements Runnable{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||||
|
run();
|
||||||
|
}
|
||||||
|
|
||||||
|
// public abstract void run();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ import androidx.databinding.ObservableList;
|
|||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
||||||
|
|
||||||
@@ -38,6 +39,28 @@ public abstract class ExtendedRecyclerView<T, VH extends RecyclerView.ViewHolder
|
|||||||
return mDataset.size();
|
return mDataset.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearDataset() {
|
||||||
|
mDataset.clear();
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateDataset(List<T> updatedDataset) {
|
||||||
|
mDataset.clear();
|
||||||
|
|
||||||
|
if(updatedDataset != null && !updatedDataset.isEmpty()) {
|
||||||
|
mDataset.addAll(updatedDataset);
|
||||||
|
}
|
||||||
|
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addDataset(List<T> insertDataset) {
|
||||||
|
if(insertDataset != null && !insertDataset.isEmpty()) {
|
||||||
|
mDataset.addAll(insertDataset);
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public ExtendedRecyclerView<T, VH> setEmptyView(View emptyView) {
|
public ExtendedRecyclerView<T, VH> setEmptyView(View emptyView) {
|
||||||
this.mEmptyView = emptyView;
|
this.mEmptyView = emptyView;
|
||||||
this.checkIfEmpty();
|
this.checkIfEmpty();
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package it.integry.integrywmsnative.core.menu;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.StbMenu;
|
||||||
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
public class MenuRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
public void retrieveMenu(String rootCodOpz, RunnableArgs<StbMenu> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
MenuRESTConsumerService menuRESTConsumerService = RESTBuilder.getService(MenuRESTConsumerService.class);
|
||||||
|
menuRESTConsumerService.retrieveMenuConfig(rootCodOpz).enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<StbMenu>> call, Response<ServiceRESTResponse<StbMenu>> response) {
|
||||||
|
analyzeAnswer(response, "retrieveMenu", (m) -> {
|
||||||
|
onComplete.run(response.body().getEntity());
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<StbMenu>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package it.integry.integrywmsnative.core.menu;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.StbMenu;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface MenuRESTConsumerService {
|
||||||
|
|
||||||
|
@GET("retrieveMenuConfig")
|
||||||
|
Call<ServiceRESTResponse<StbMenu>> retrieveMenuConfig(@Query("rootCodOpz") String rootCodOpz);
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package it.integry.integrywmsnative.core.menu;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.class_router.configs.BaseMenuConfiguration;
|
||||||
|
import it.integry.integrywmsnative.core.class_router.configs.MenuConfiguration;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.menu.exception.MenuNotFoundException;
|
||||||
|
import it.integry.integrywmsnative.core.model.StbMenu;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
public class MenuService {
|
||||||
|
|
||||||
|
private static final String MENU_COD_OPZ = "MM007";
|
||||||
|
|
||||||
|
private final MenuRESTConsumer menuRESTConsumer;
|
||||||
|
|
||||||
|
private List<StbMenu> mInternalCachedMenu;
|
||||||
|
private List<StbMenu> mInternalCachedFlatMenu;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public MenuService(MenuRESTConsumer menuRESTConsumer) {
|
||||||
|
this.menuRESTConsumer = menuRESTConsumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(Runnable onMenuInitialized, RunnableArgs<Exception> onFailed) {
|
||||||
|
menuRESTConsumer.retrieveMenu(MENU_COD_OPZ, menu -> {
|
||||||
|
if(menu != null) {
|
||||||
|
this.mInternalCachedMenu = menu.getStbMenuChildren();
|
||||||
|
this.mInternalCachedFlatMenu = new ArrayList<>();
|
||||||
|
flattenMenu(this.mInternalCachedMenu);
|
||||||
|
}
|
||||||
|
|
||||||
|
onMenuInitialized.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<StbMenu> getMenu() throws Exception {
|
||||||
|
if(mInternalCachedMenu == null) throw new MenuNotFoundException();
|
||||||
|
|
||||||
|
return mInternalCachedMenu;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isGroupEnabled(MenuConfiguration.MenuGroup androidMenuGroup) throws Exception {
|
||||||
|
List<StbMenu> dbMenu = getMenu();
|
||||||
|
|
||||||
|
return Stream.of(this.mInternalCachedFlatMenu)
|
||||||
|
.anyMatch(x -> x.getCodOpz().equalsIgnoreCase(androidMenuGroup.getCodMenu()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isItemEnabled(BaseMenuConfiguration.MenuItem androidMenuItem) throws Exception {
|
||||||
|
List<StbMenu> dbMenu = getMenu();
|
||||||
|
|
||||||
|
return Stream.of(this.mInternalCachedFlatMenu)
|
||||||
|
.anyMatch(x -> x.getCodOpz().equalsIgnoreCase(androidMenuItem.getCodMenu()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void flattenMenu(List<StbMenu> menu) {
|
||||||
|
for(StbMenu stbMenu : menu) {
|
||||||
|
this.mInternalCachedFlatMenu.add(stbMenu);
|
||||||
|
|
||||||
|
if(stbMenu.getStbMenuChildren() != null && !stbMenu.getStbMenuChildren().isEmpty()) {
|
||||||
|
flattenMenu(stbMenu.getStbMenuChildren());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void invalidateCache() {
|
||||||
|
this.mInternalCachedMenu = null;
|
||||||
|
this.mInternalCachedFlatMenu = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package it.integry.integrywmsnative.core.menu.exception;
|
||||||
|
|
||||||
|
public class MenuNotFoundException extends Exception{
|
||||||
|
|
||||||
|
public MenuNotFoundException() {
|
||||||
|
super("Non è stato possibile caricare il menù");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.model;
|
|
||||||
|
|
||||||
import androidx.databinding.Observable;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
|
||||||
import it.integry.integrywmsnative.core.di.BindableFloat;
|
|
||||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.core.ChooseOrdsLavFromListItemModel;
|
|
||||||
|
|
||||||
public class CheckableOrdineLavoro {
|
|
||||||
|
|
||||||
|
|
||||||
private ChooseOrdsLavFromListItemModel item;
|
|
||||||
private BindableBoolean checked = new BindableBoolean(false);
|
|
||||||
|
|
||||||
private String testata;
|
|
||||||
|
|
||||||
public CheckableOrdineLavoro(ChooseOrdsLavFromListItemModel item) {
|
|
||||||
this.item = item;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ChooseOrdsLavFromListItemModel getItem() {
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CheckableOrdineLavoro setItem(ChooseOrdsLavFromListItemModel item) {
|
|
||||||
this.item = item;
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BindableBoolean getChecked() {
|
|
||||||
return checked;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CheckableOrdineLavoro setChecked(BindableBoolean checked) {
|
|
||||||
this.checked = checked;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BindableFloat getQtaCol() {
|
|
||||||
return item.getOrdineLav().getQtaColVersamento();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setQtaCol(float qtaCnf) {
|
|
||||||
this.item.getOrdineLav().setQtaColVersamento(qtaCnf);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void toggleCheck() {
|
|
||||||
this.checked.set(!this.checked.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isChecked() {
|
|
||||||
return checked.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTestata() {
|
|
||||||
return testata;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTestata(String testata) {
|
|
||||||
this.testata = testata;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BindableFloat getNumCnf() {
|
|
||||||
return item.getOrdineLav().getNumCnfVersamento();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNumCnf(float numCnf) {
|
|
||||||
this.item.getOrdineLav().setNumCnfVersamento(numCnf);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,348 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class DtbOrdSteps extends EntityBase {
|
||||||
|
|
||||||
|
private String dataOrd;
|
||||||
|
private String gestione;
|
||||||
|
private Integer idRiga;
|
||||||
|
private Integer idStep;
|
||||||
|
private Integer numOrd;
|
||||||
|
private String activityId;
|
||||||
|
private String codAnag;
|
||||||
|
private String codDtip;
|
||||||
|
private String codJfas;
|
||||||
|
private String codMdep;
|
||||||
|
private String codProdPri;
|
||||||
|
private String dataDoc;
|
||||||
|
private String dataFine;
|
||||||
|
private String dataIniz;
|
||||||
|
private String descrizioneAttivita;
|
||||||
|
private String flagTipoTempo;
|
||||||
|
private Integer hrNum;
|
||||||
|
private BigDecimal hrTime;
|
||||||
|
private String idRigaDoc;
|
||||||
|
private String note;
|
||||||
|
private String numDoc;
|
||||||
|
private Integer numFase;
|
||||||
|
private BigDecimal qtaAllocata;
|
||||||
|
private BigDecimal qtaDisp;
|
||||||
|
private BigDecimal qtaDispImmessa;
|
||||||
|
private BigDecimal qtaImmesse;
|
||||||
|
private BigDecimal qtaInProd;
|
||||||
|
private BigDecimal qtaLav;
|
||||||
|
private BigDecimal qtaProd;
|
||||||
|
private BigDecimal qtaScartate;
|
||||||
|
private BigDecimal qtaTrasferite;
|
||||||
|
private BigDecimal rapConvLav;
|
||||||
|
private String serDoc;
|
||||||
|
private String untMisLav;
|
||||||
|
|
||||||
|
|
||||||
|
public String getDataOrd() {
|
||||||
|
return dataOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setDataOrd(String dataOrd) {
|
||||||
|
this.dataOrd = dataOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGestione() {
|
||||||
|
return gestione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setGestione(String gestione) {
|
||||||
|
this.gestione = gestione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getIdRiga() {
|
||||||
|
return idRiga;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setIdRiga(Integer idRiga) {
|
||||||
|
this.idRiga = idRiga;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getIdStep() {
|
||||||
|
return idStep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setIdStep(Integer idStep) {
|
||||||
|
this.idStep = idStep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumOrd() {
|
||||||
|
return numOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setNumOrd(Integer numOrd) {
|
||||||
|
this.numOrd = numOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getActivityId() {
|
||||||
|
return activityId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setActivityId(String activityId) {
|
||||||
|
this.activityId = activityId;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodAnag() {
|
||||||
|
return codAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setCodAnag(String codAnag) {
|
||||||
|
this.codAnag = codAnag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodDtip() {
|
||||||
|
return codDtip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setCodDtip(String codDtip) {
|
||||||
|
this.codDtip = codDtip;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodJfas() {
|
||||||
|
return codJfas;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setCodJfas(String codJfas) {
|
||||||
|
this.codJfas = codJfas;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodProdPri() {
|
||||||
|
return codProdPri;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setCodProdPri(String codProdPri) {
|
||||||
|
this.codProdPri = codProdPri;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataDoc() {
|
||||||
|
return dataDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setDataDoc(String dataDoc) {
|
||||||
|
this.dataDoc = dataDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataFine() {
|
||||||
|
return dataFine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setDataFine(String dataFine) {
|
||||||
|
this.dataFine = dataFine;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataIniz() {
|
||||||
|
return dataIniz;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setDataIniz(String dataIniz) {
|
||||||
|
this.dataIniz = dataIniz;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizioneAttivita() {
|
||||||
|
return descrizioneAttivita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setDescrizioneAttivita(String descrizioneAttivita) {
|
||||||
|
this.descrizioneAttivita = descrizioneAttivita;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagTipoTempo() {
|
||||||
|
return flagTipoTempo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setFlagTipoTempo(String flagTipoTempo) {
|
||||||
|
this.flagTipoTempo = flagTipoTempo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getHrNum() {
|
||||||
|
return hrNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setHrNum(Integer hrNum) {
|
||||||
|
this.hrNum = hrNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getHrTime() {
|
||||||
|
return hrTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setHrTime(BigDecimal hrTime) {
|
||||||
|
this.hrTime = hrTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIdRigaDoc() {
|
||||||
|
return idRigaDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setIdRigaDoc(String idRigaDoc) {
|
||||||
|
this.idRigaDoc = idRigaDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNote() {
|
||||||
|
return note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setNote(String note) {
|
||||||
|
this.note = note;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNumDoc() {
|
||||||
|
return numDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setNumDoc(String numDoc) {
|
||||||
|
this.numDoc = numDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumFase() {
|
||||||
|
return numFase;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setNumFase(Integer numFase) {
|
||||||
|
this.numFase = numFase;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaAllocata() {
|
||||||
|
return qtaAllocata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setQtaAllocata(BigDecimal qtaAllocata) {
|
||||||
|
this.qtaAllocata = qtaAllocata;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaDisp() {
|
||||||
|
return qtaDisp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setQtaDisp(BigDecimal qtaDisp) {
|
||||||
|
this.qtaDisp = qtaDisp;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaDispImmessa() {
|
||||||
|
return qtaDispImmessa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setQtaDispImmessa(BigDecimal qtaDispImmessa) {
|
||||||
|
this.qtaDispImmessa = qtaDispImmessa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaImmesse() {
|
||||||
|
return qtaImmesse;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setQtaImmesse(BigDecimal qtaImmesse) {
|
||||||
|
this.qtaImmesse = qtaImmesse;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaInProd() {
|
||||||
|
return qtaInProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setQtaInProd(BigDecimal qtaInProd) {
|
||||||
|
this.qtaInProd = qtaInProd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaLav() {
|
||||||
|
return qtaLav;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setQtaLav(BigDecimal qtaLav) {
|
||||||
|
this.qtaLav = qtaLav;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaProd() {
|
||||||
|
return qtaProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setQtaProd(BigDecimal qtaProd) {
|
||||||
|
this.qtaProd = qtaProd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaScartate() {
|
||||||
|
return qtaScartate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setQtaScartate(BigDecimal qtaScartate) {
|
||||||
|
this.qtaScartate = qtaScartate;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaTrasferite() {
|
||||||
|
return qtaTrasferite;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setQtaTrasferite(BigDecimal qtaTrasferite) {
|
||||||
|
this.qtaTrasferite = qtaTrasferite;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getRapConvLav() {
|
||||||
|
return rapConvLav;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setRapConvLav(BigDecimal rapConvLav) {
|
||||||
|
this.rapConvLav = rapConvLav;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSerDoc() {
|
||||||
|
return serDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setSerDoc(String serDoc) {
|
||||||
|
this.serDoc = serDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUntMisLav() {
|
||||||
|
return untMisLav;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbOrdSteps setUntMisLav(String untMisLav) {
|
||||||
|
this.untMisLav = untMisLav;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import java.math.BigDecimal;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
|
||||||
public class MtbColr extends EntityBase {
|
public class MtbColr extends EntityBase {
|
||||||
@@ -52,10 +53,16 @@ public class MtbColr extends EntityBase {
|
|||||||
private MtbAart mtbAart;
|
private MtbAart mtbAart;
|
||||||
private MtbPartitaMag mtbPartitaMag;
|
private MtbPartitaMag mtbPartitaMag;
|
||||||
|
|
||||||
|
|
||||||
|
private transient int id;
|
||||||
private transient MtbColr refMtbColr;
|
private transient MtbColr refMtbColr;
|
||||||
|
|
||||||
public MtbColr() {
|
public MtbColr() {
|
||||||
type = "mtb_colr";
|
type = "mtb_colr";
|
||||||
|
|
||||||
|
if(SettingsManager.i().isUserLoggedIn()) {
|
||||||
|
setUtente(SettingsManager.i().getUser().getFullname());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -511,6 +518,15 @@ public class MtbColr extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public MtbColr getRefMtbColr() {
|
public MtbColr getRefMtbColr() {
|
||||||
return refMtbColr;
|
return refMtbColr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,6 +99,10 @@ public class MtbColt extends EntityBase {
|
|||||||
type = "mtb_colt";
|
type = "mtb_colt";
|
||||||
setDataCollo(UtilityDate.getDateInstance());
|
setDataCollo(UtilityDate.getDateInstance());
|
||||||
setSerCollo("/");
|
setSerCollo("/");
|
||||||
|
|
||||||
|
if(SettingsManager.i().isUserLoggedIn()) {
|
||||||
|
setPreparatoDa(SettingsManager.i().getUser().getFullname());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MtbColt initDefaultFields() {
|
public MtbColt initDefaultFields() {
|
||||||
@@ -381,6 +385,18 @@ public class MtbColt extends EntityBase {
|
|||||||
return dataVers;
|
return dataVers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getDataVersD() {
|
||||||
|
return UtilityDate.recognizeDateWithExceptionHandler(getDataVers());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTimeVers() {
|
||||||
|
Date dataColloD = getDataVersD();
|
||||||
|
|
||||||
|
if(dataColloD != null){
|
||||||
|
return UtilityDate.formatDate(dataColloD, UtilityDate.COMMONS_DATE_FORMATS.TIME);
|
||||||
|
} else return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public MtbColt setDataVers(String dataVers) {
|
public MtbColt setDataVers(String dataVers) {
|
||||||
this.dataVers = dataVers;
|
this.dataVers = dataVers;
|
||||||
@@ -524,13 +540,13 @@ public class MtbColt extends EntityBase {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
whereCond.append("(");
|
whereCond.append("(");
|
||||||
whereCond.append(String.format("dtb_ordt.gestione = %s AND dtb_ordt.data_ord = %s and dtb_ordt.num_ord = %s",
|
whereCond.append(String.format("d.g = %s AND d.d = %s and d.n = %s",
|
||||||
UtilityDB.valueToString(x.getGestioneOrd()),
|
UtilityDB.valueToString(x.getGestioneOrd()),
|
||||||
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH)),
|
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH)),
|
||||||
UtilityDB.valueToString(x.getNumOrd())));
|
UtilityDB.valueToString(x.getNumOrd())));
|
||||||
|
|
||||||
if(!UtilityString.isNullOrEmpty(x.getDataConsS())) {
|
if(!UtilityString.isNullOrEmpty(x.getDataConsS())) {
|
||||||
whereCond.append(String.format(" AND dtb_ordr.data_cons = %s",
|
whereCond.append(String.format(" AND dr.dc = %s",
|
||||||
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH))));
|
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH))));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -538,8 +554,6 @@ public class MtbColt extends EntityBase {
|
|||||||
if(i < filtroOrdineDtos.size()-1) {
|
if(i < filtroOrdineDtos.size()-1) {
|
||||||
whereCond.append(" OR ");
|
whereCond.append(" OR ");
|
||||||
}
|
}
|
||||||
|
|
||||||
//whereCond.append("<DTB_ORDT COND=\"OR\"><GESTIONE type=\"V\">" + x.getGestioneOrd() + "</GESTIONE><DATA_ORD type=\"D\">" + UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH) + "</DATA_ORD><NUM_ORD type=\"N\">" + x.getNumOrd() + "</NUM_ORD></DTB_ORDT>");
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,12 +36,12 @@ public class MtbDepo extends EntityBase implements Parcelable {
|
|||||||
private String flagTipoNegozio;
|
private String flagTipoNegozio;
|
||||||
private String codMdepReso;
|
private String codMdepReso;
|
||||||
|
|
||||||
|
|
||||||
public MtbDepo() {
|
public MtbDepo() {
|
||||||
type = "mtb_depo";
|
type = "mtb_depo";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected MtbDepo(Parcel in) {
|
protected MtbDepo(Parcel in) {
|
||||||
type = "mtb_depo";
|
|
||||||
codMdep = in.readString();
|
codMdep = in.readString();
|
||||||
descrizione = in.readString();
|
descrizione = in.readString();
|
||||||
flagVal = in.readString();
|
flagVal = in.readString();
|
||||||
@@ -357,4 +357,19 @@ public class MtbDepo extends EntityBase implements Parcelable {
|
|||||||
this.codMdepReso = codMdepReso;
|
this.codMdepReso = codMdepReso;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
|
||||||
|
MtbDepo mtbDepo = (MtbDepo) o;
|
||||||
|
|
||||||
|
return getCodMdep().equals(mtbDepo.getCodMdep());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return getCodMdep().hashCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
public class MtbGrup extends EntityBase {
|
||||||
|
|
||||||
|
private String codMgrp;
|
||||||
|
private String descrizione;
|
||||||
|
private String flagValMag;
|
||||||
|
private String logoWeb;
|
||||||
|
private String criterioVal;
|
||||||
|
private String tipoMgrp;
|
||||||
|
|
||||||
|
public MtbGrup() {
|
||||||
|
this.type = "mtb_grup";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMgrp() {
|
||||||
|
return codMgrp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbGrup setCodMgrp(String codMgrp) {
|
||||||
|
this.codMgrp = codMgrp;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbGrup setDescrizione(String descrizione) {
|
||||||
|
this.descrizione = descrizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagValMag() {
|
||||||
|
return flagValMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbGrup setFlagValMag(String flagValMag) {
|
||||||
|
this.flagValMag = flagValMag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLogoWeb() {
|
||||||
|
return logoWeb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbGrup setLogoWeb(String logoWeb) {
|
||||||
|
this.logoWeb = logoWeb;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCriterioVal() {
|
||||||
|
return criterioVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbGrup setCriterioVal(String criterioVal) {
|
||||||
|
this.criterioVal = criterioVal;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTipoMgrp() {
|
||||||
|
return tipoMgrp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbGrup setTipoMgrp(String tipoMgrp) {
|
||||||
|
this.tipoMgrp = tipoMgrp;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import java.util.Date;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
|
||||||
public class MtbPartitaMag {
|
public class MtbPartitaMag extends EntityBase{
|
||||||
private String codMart;
|
private String codMart;
|
||||||
|
|
||||||
private String partitaMag;
|
private String partitaMag;
|
||||||
@@ -30,6 +30,10 @@ public class MtbPartitaMag {
|
|||||||
private String partitaMagSec;
|
private String partitaMagSec;
|
||||||
private BigDecimal qtaAttesa;
|
private BigDecimal qtaAttesa;
|
||||||
|
|
||||||
|
public MtbPartitaMag() {
|
||||||
|
this.type = "mtb_partita_mag";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getCodMart() {
|
public String getCodMart() {
|
||||||
return codMart;
|
return codMart;
|
||||||
|
|||||||
@@ -105,4 +105,6 @@ public class MtbTCol {
|
|||||||
this.circuito = circuito;
|
this.circuito = circuito;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,217 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class StbMenu extends EntityBase {
|
||||||
|
|
||||||
|
public StbMenu() {
|
||||||
|
this.type = "stb_menu";
|
||||||
|
}
|
||||||
|
|
||||||
|
private String codOpz;
|
||||||
|
private String codParent;
|
||||||
|
private String tipoAzienda;
|
||||||
|
private String descrizione;
|
||||||
|
private String descrizioneEstesa;
|
||||||
|
private String entityName;
|
||||||
|
private String flagAttivo;
|
||||||
|
private String flagPrinterSetup;
|
||||||
|
private String gestName;
|
||||||
|
private String note;
|
||||||
|
private String objectType;
|
||||||
|
private String openType;
|
||||||
|
private String parameter;
|
||||||
|
private String pictureMenu;
|
||||||
|
private String pictureSelect;
|
||||||
|
private Integer pos;
|
||||||
|
private Integer posCliente;
|
||||||
|
private Integer posTipoAzienda;
|
||||||
|
private String urlDescrizione;
|
||||||
|
|
||||||
|
private final List<StbMenu> stbMenuChildren = new ArrayList<>();
|
||||||
|
|
||||||
|
public String getCodOpz() {
|
||||||
|
return codOpz;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setCodOpz(String codOpz) {
|
||||||
|
this.codOpz = codOpz;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodParent() {
|
||||||
|
return codParent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setCodParent(String codParent) {
|
||||||
|
this.codParent = codParent;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTipoAzienda() {
|
||||||
|
return tipoAzienda;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setTipoAzienda(String tipoAzienda) {
|
||||||
|
this.tipoAzienda = tipoAzienda;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setDescrizione(String descrizione) {
|
||||||
|
this.descrizione = descrizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizioneEstesa() {
|
||||||
|
return descrizioneEstesa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setDescrizioneEstesa(String descrizioneEstesa) {
|
||||||
|
this.descrizioneEstesa = descrizioneEstesa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEntityName() {
|
||||||
|
return entityName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setEntityName(String entityName) {
|
||||||
|
this.entityName = entityName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagAttivo() {
|
||||||
|
return flagAttivo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setFlagAttivo(String flagAttivo) {
|
||||||
|
this.flagAttivo = flagAttivo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagPrinterSetup() {
|
||||||
|
return flagPrinterSetup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setFlagPrinterSetup(String flagPrinterSetup) {
|
||||||
|
this.flagPrinterSetup = flagPrinterSetup;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGestName() {
|
||||||
|
return gestName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setGestName(String gestName) {
|
||||||
|
this.gestName = gestName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNote() {
|
||||||
|
return note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setNote(String note) {
|
||||||
|
this.note = note;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getObjectType() {
|
||||||
|
return objectType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setObjectType(String objectType) {
|
||||||
|
this.objectType = objectType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOpenType() {
|
||||||
|
return openType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setOpenType(String openType) {
|
||||||
|
this.openType = openType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParameter() {
|
||||||
|
return parameter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setParameter(String parameter) {
|
||||||
|
this.parameter = parameter;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPictureMenu() {
|
||||||
|
return pictureMenu;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setPictureMenu(String pictureMenu) {
|
||||||
|
this.pictureMenu = pictureMenu;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPictureSelect() {
|
||||||
|
return pictureSelect;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setPictureSelect(String pictureSelect) {
|
||||||
|
this.pictureSelect = pictureSelect;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPos() {
|
||||||
|
return pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setPos(Integer pos) {
|
||||||
|
this.pos = pos;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPosCliente() {
|
||||||
|
return posCliente;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setPosCliente(Integer posCliente) {
|
||||||
|
this.posCliente = posCliente;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPosTipoAzienda() {
|
||||||
|
return posTipoAzienda;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setPosTipoAzienda(Integer posTipoAzienda) {
|
||||||
|
this.posTipoAzienda = posTipoAzienda;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrlDescrizione() {
|
||||||
|
return urlDescrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbMenu setUrlDescrizione(String urlDescrizione) {
|
||||||
|
this.urlDescrizione = urlDescrizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<StbMenu> getStbMenuChildren() {
|
||||||
|
return stbMenuChildren;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,10 +3,9 @@ package it.integry.integrywmsnative.core.rest;
|
|||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
|
|
||||||
import java.sql.Date;
|
import java.lang.reflect.Modifier;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.rest.deserializer.DateDeserializer;
|
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import retrofit2.Retrofit;
|
import retrofit2.Retrofit;
|
||||||
@@ -19,12 +18,10 @@ import retrofit2.converter.gson.GsonConverterFactory;
|
|||||||
public class RESTBuilder {
|
public class RESTBuilder {
|
||||||
|
|
||||||
public static <T> T getService(final Class<T> service) {
|
public static <T> T getService(final Class<T> service) {
|
||||||
// return getService(service, "192.168.2.13", 8080);
|
|
||||||
return getService(service, SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true);
|
return getService(service, SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true);
|
||||||
|
|
||||||
}
|
}
|
||||||
public static <T> T getService(final Class<T> service, int timeout) {
|
public static <T> T getService(final Class<T> service, int timeout) {
|
||||||
// return getService(service, "192.168.2.13", 8080);
|
|
||||||
return getService(service, SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true, true, timeout);
|
return getService(service, SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true, true, timeout);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -53,19 +50,16 @@ public class RESTBuilder {
|
|||||||
String endpoint = "http://" + host + ":" + port + "/" + (addEmsApi ? "ems-api/" : "");
|
String endpoint = "http://" + host + ":" + port + "/" + (addEmsApi ? "ems-api/" : "");
|
||||||
|
|
||||||
Gson gson = new GsonBuilder()
|
Gson gson = new GsonBuilder()
|
||||||
.registerTypeAdapter(Date.class, new DateDeserializer())
|
.setDateFormat("dd/MM/yyyy HH:mm:ss")
|
||||||
|
.excludeFieldsWithModifiers(Modifier.TRANSIENT)
|
||||||
.create();
|
.create();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Retrofit retrofit = new Retrofit.Builder()
|
Retrofit retrofit = new Retrofit.Builder()
|
||||||
.addConverterFactory(GsonConverterFactory.create(gson))
|
.addConverterFactory(GsonConverterFactory.create(gson))
|
||||||
.baseUrl(endpoint)
|
.baseUrl(endpoint)
|
||||||
.client(client)
|
.client(client)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return retrofit.create(service);
|
return retrofit.create(service);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,15 +2,21 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import com.annimon.stream.Collectors;
|
import com.annimon.stream.Collectors;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||||
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
@@ -18,7 +24,13 @@ import retrofit2.Response;
|
|||||||
@Singleton
|
@Singleton
|
||||||
public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
public static void getByBarcodeProdStatic(String barcodeProd, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
private final SystemRESTConsumer systemRESTConsumer;
|
||||||
|
|
||||||
|
public ArticoloRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||||
|
this.systemRESTConsumer = systemRESTConsumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getByBarcodeProd(String barcodeProd, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||||
articoloRESTConsumerService.getByBarcodeProd(barcodeProd).enqueue(new Callback<ServiceRESTResponse<MtbAart>>() {
|
articoloRESTConsumerService.getByBarcodeProd(barcodeProd).enqueue(new Callback<ServiceRESTResponse<MtbAart>>() {
|
||||||
@Override
|
@Override
|
||||||
@@ -35,16 +47,12 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getByBarcodeProd(String barcodeProd, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
getByBarcodeProdStatic(barcodeProd, onComplete, onFailed);
|
public void getByCodMarts(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
getByCodMartsStatic(codMartToFind, onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void getByCodMartsStatic(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
public void getByCodMart(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
getByCodMartStatic(codMartToFind, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void getByCodMartStatic(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
|
|
||||||
String joinedCods = Stream.of(codMartToFind)
|
String joinedCods = Stream.of(codMartToFind)
|
||||||
.collect(Collectors.joining(","));
|
.collect(Collectors.joining(","));
|
||||||
@@ -67,4 +75,43 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void getByCodMart(String codMartToFind, RunnableArgs<MtbAart> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||||
|
articoloRESTConsumer.getByCodMart(codMartToFind).enqueue(new Callback<ServiceRESTResponse<MtbAart>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||||
|
analyzeAnswer(response, "getByCodMart", (m) -> {
|
||||||
|
if(response.body().getEntityList() != null && !response.body().getEntityList().isEmpty()) {
|
||||||
|
onComplete.run(response.body().getEntityList().get(0));
|
||||||
|
} else onComplete.run(null);
|
||||||
|
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<MtbAart>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void getArtsGroups(List<String> groupsToFind, RunnableArgs<List<MtbGrup>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
var whereCondMap = Stream.of(groupsToFind)
|
||||||
|
.map(x -> {
|
||||||
|
HashMap<String, Object> vars = new HashMap<>();
|
||||||
|
vars.put("cod_mgrp", x);
|
||||||
|
return vars;
|
||||||
|
})
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
var whereCond = " WHERE " + UtilityQuery.concatFieldListInWhereCond(whereCondMap);
|
||||||
|
|
||||||
|
Type typeOfObjectsList = new TypeToken<ArrayList<MtbGrup>>() {}.getType();
|
||||||
|
this.systemRESTConsumer.processSql("SELECT * FROM mtb_grup " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import retrofit2.Response;
|
|||||||
@Singleton
|
@Singleton
|
||||||
public class BarcodeRESTConsumer extends _BaseRESTConsumer {
|
public class BarcodeRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
public static void decodeEan128Static(BarcodeScanDTO barcodeObj, RunnableArgs<Ean128Model> onComplete, RunnableArgs<Exception> onFailed) {
|
public void decodeEan128(BarcodeScanDTO barcodeObj, RunnableArgs<Ean128Model> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
IBarcodeCustomization barcodeCustomization = ClassRouter.getInstance(ClassRouter.PATH.BARCODE_CUSTOMIZATION);
|
IBarcodeCustomization barcodeCustomization = ClassRouter.getInstance(ClassRouter.PATH.BARCODE_CUSTOMIZATION);
|
||||||
|
|
||||||
@@ -42,8 +42,4 @@ public class BarcodeRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void decodeEan128(BarcodeScanDTO barcodeObj, RunnableArgs<Ean128Model> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
BarcodeRESTConsumer.decodeEan128Static(barcodeObj, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@@ -32,6 +31,7 @@ import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
@@ -45,30 +45,19 @@ import retrofit2.Response;
|
|||||||
@Singleton
|
@Singleton
|
||||||
public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
private ArticoloRESTConsumer mArticoloRESTConsumer;
|
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||||
|
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||||
|
private final EntityRESTConsumer mEntityRESTConsumer;
|
||||||
|
|
||||||
public ColliMagazzinoRESTConsumer(ArticoloRESTConsumer articoloRESTConsumer) {
|
public ColliMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer,
|
||||||
|
ArticoloRESTConsumer articoloRESTConsumer,
|
||||||
|
EntityRESTConsumer entityRESTConsumer) {
|
||||||
|
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||||
}
|
this.mEntityRESTConsumer = entityRESTConsumer;
|
||||||
|
|
||||||
|
|
||||||
public static void saveColloStatic(MtbColt mtbColtToSave, final ISimpleOperationCallback<MtbColt> callback) {
|
|
||||||
|
|
||||||
for (int i = 0; i < mtbColtToSave.getMtbColr().size(); i++) {
|
|
||||||
mtbColtToSave.getMtbColr().get(i)
|
|
||||||
.setMtbAart(null)
|
|
||||||
.setMtbPartitaMag(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
EntityRESTConsumer.processEntity(mtbColtToSave, callback, MtbColt.class);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveCollo(MtbColt mtbColtToSave, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void saveCollo(MtbColt mtbColtToSave, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliMagazzinoRESTConsumer.saveColloStatic(mtbColtToSave, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void saveColloStatic(MtbColt mtbColtToSave, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
MtbColt mtbColtToSaveClone = (MtbColt) mtbColtToSave.clone();
|
MtbColt mtbColtToSaveClone = (MtbColt) mtbColtToSave.clone();
|
||||||
mtbColtToSave.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
mtbColtToSave.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
@@ -81,7 +70,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.setMtbPartitaMag(null));
|
.setMtbPartitaMag(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityRESTConsumer.processEntity(mtbColtToSaveClone, new ISimpleOperationCallback<MtbColt>() {
|
this.mEntityRESTConsumer.processEntity(mtbColtToSaveClone, new ISimpleOperationCallback<MtbColt>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(MtbColt value) {
|
public void onSuccess(MtbColt value) {
|
||||||
if (onComplete != null) onComplete.run(value);
|
if (onComplete != null) onComplete.run(value);
|
||||||
@@ -96,10 +85,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void saveColli(List<MtbColt> mtbColtsToSave, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void saveColli(List<MtbColt> mtbColtsToSave, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
saveColliStatic(mtbColtsToSave, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void saveColliStatic(List<MtbColt> mtbColtsToSave, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
|
|
||||||
for (MtbColt mtbColt : mtbColtsToSave) {
|
for (MtbColt mtbColt : mtbColtsToSave) {
|
||||||
mtbColt.setMtbCols(null);
|
mtbColt.setMtbCols(null);
|
||||||
@@ -111,21 +96,11 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityRESTConsumer.processEntityList(mtbColtsToSave, new ISimpleOperationCallback<List<MtbColt>>() {
|
this.mEntityRESTConsumer.processEntityList(mtbColtsToSave, true, MtbColt.class, onComplete, onFailed);
|
||||||
@Override
|
|
||||||
public void onSuccess(List<MtbColt> value) {
|
|
||||||
if (onComplete != null) onComplete.run(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
if (onFailed != null) onFailed.run(ex);
|
|
||||||
}
|
|
||||||
}, true, MtbColt.class);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void createColloLavorazione(int segno, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createColloLavorazione(int segno, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MtbColt mtbColtToCreate = new MtbColt()
|
MtbColt mtbColtToCreate = new MtbColt()
|
||||||
.setSegno(segno)
|
.setSegno(segno)
|
||||||
.setGestione(GestioneEnum.LAVORAZIONE);
|
.setGestione(GestioneEnum.LAVORAZIONE);
|
||||||
@@ -136,20 +111,14 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
|
|
||||||
|
|
||||||
saveColloStatic(mtbColtToCreate, new ISimpleOperationCallback<MtbColt>() {
|
saveCollo(mtbColtToCreate, value -> {
|
||||||
@Override
|
if (onComplete != null) onComplete.run(value);
|
||||||
public void onSuccess(MtbColt value) {
|
}, ex -> {
|
||||||
if (onComplete != null) onComplete.run(value);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
if (onFailed != null) onFailed.run(ex);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void createColloScaricoDaCarico(MtbColt sourceMtbColt, MtbDepoPosizione posizione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createColloScaricoDaCarico(MtbColt sourceMtbColt, MtbDepoPosizione posizione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
MtbColt newMtbColt = new MtbColt()
|
MtbColt newMtbColt = new MtbColt()
|
||||||
.initDefaultFields()
|
.initDefaultFields()
|
||||||
@@ -199,20 +168,10 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
saveColloStatic(newMtbColt, new ISimpleOperationCallback<MtbColt>() {
|
saveCollo(newMtbColt, onComplete, onFailed);
|
||||||
@Override
|
|
||||||
public void onSuccess(MtbColt value) {
|
|
||||||
if (onComplete != null) onComplete.run(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
if (onFailed != null) onFailed.run(ex);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void createColliScaricoDaOrdineLavorazione(MtbColt sourceMtbColt,MtbColr sourceMtbColr, MtbDepoPosizione posizione, List<OrdineLavorazioneDTO> ordini, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createColliScaricoDaOrdineLavorazione(MtbColt sourceMtbColt, MtbColr sourceMtbColr, MtbDepoPosizione posizione, List<OrdineLavorazioneDTO> ordini, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
MtbColt newMtbColt = new MtbColt()
|
MtbColt newMtbColt = new MtbColt()
|
||||||
.initDefaultFields()
|
.initDefaultFields()
|
||||||
@@ -220,8 +179,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.setGestione(GestioneEnum.LAVORAZIONE)
|
.setGestione(GestioneEnum.LAVORAZIONE)
|
||||||
.setSegno(-1)
|
.setSegno(-1)
|
||||||
.setCodTcol(sourceMtbColt.getCodTcol())
|
.setCodTcol(sourceMtbColt.getCodTcol())
|
||||||
.setPesoKg(sourceMtbColt.getPesoKg())
|
// .setPesoKg(sourceMtbColt.getPesoKg())
|
||||||
.setPesoNettoKg(sourceMtbColt.getPesoNettoKg())
|
// .setPesoNettoKg(sourceMtbColt.getPesoNettoKg())
|
||||||
.setLarghezzaCm(sourceMtbColt.getLarghezzaCm())
|
.setLarghezzaCm(sourceMtbColt.getLarghezzaCm())
|
||||||
.setLunghezzaCm(sourceMtbColt.getLunghezzaCm())
|
.setLunghezzaCm(sourceMtbColt.getLunghezzaCm())
|
||||||
.setAltezzaCm(sourceMtbColt.getAltezzaCm())
|
.setAltezzaCm(sourceMtbColt.getAltezzaCm())
|
||||||
@@ -262,7 +221,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.setPartitaMag(original.getPartitaMag())
|
.setPartitaMag(original.getPartitaMag())
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
for (OrdineLavorazioneDTO ordLav : ordini) {
|
for (OrdineLavorazioneDTO ordLav : ordini) {
|
||||||
if (ordLav.getQtaColVersamento().getBigDecimal().compareTo(BigDecimal.ZERO) > 0){
|
if (ordLav.getQtaColVersamento().getBigDecimal().compareTo(BigDecimal.ZERO) > 0) {
|
||||||
MtbColr ordColr = (MtbColr) mtbColrClone.clone();
|
MtbColr ordColr = (MtbColr) mtbColrClone.clone();
|
||||||
ordColr.setQtaCol(ordLav.getQtaColVersamento().getBigDecimal());
|
ordColr.setQtaCol(ordLav.getQtaColVersamento().getBigDecimal());
|
||||||
ordColr.setNumCnf(ordLav.getNumCnfVersamento().getBigDecimal());
|
ordColr.setNumCnf(ordLav.getNumCnfVersamento().getBigDecimal());
|
||||||
@@ -275,27 +234,15 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
saveCollo(newMtbColt, onComplete, onFailed);
|
||||||
saveColloStatic(newMtbColt, new ISimpleOperationCallback<MtbColt>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(MtbColt value) {
|
|
||||||
if (onComplete != null) onComplete.run(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
if (onFailed != null) onFailed.run(ex);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void createColloFromEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createColloFromEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
createColloFromEtichettaAnonima(barcodeScanDTO.getStringValue(), gestione, onComplete, onFailed);
|
createColloFromEtichettaAnonima(barcodeScanDTO.getStringValue(), gestione, onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void createColloFromEtichettaAnonima(String barcode, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
public static void createColloFromEtichettaAnonima(String barcode, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
|
|
||||||
MtbColt mtbColtToCreate = new MtbColt()
|
MtbColt mtbColtToCreate = new MtbColt()
|
||||||
.setGestione(gestione);
|
.setGestione(gestione);
|
||||||
@@ -321,39 +268,16 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
mtbColtToCreate
|
mtbColtToCreate
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
|
|
||||||
saveColloStatic(mtbColtToCreate, new ISimpleOperationCallback<MtbColt>() {
|
saveCollo(mtbColtToCreate, onComplete, onFailed);
|
||||||
@Override
|
|
||||||
public void onSuccess(MtbColt value) {
|
|
||||||
if (onComplete != null) onComplete.run(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
if (onFailed != null) onFailed.run(ex);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteCollo(MtbColt mtbColtToDelete, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void deleteCollo(MtbColt mtbColtToDelete, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliMagazzinoRESTConsumer.deleteColloStatic(mtbColtToDelete, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void deleteColloStatic(MtbColt mtbColtToDelete, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
|
|
||||||
mtbColtToDelete.setOperation(CommonModelConsts.OPERATION.DELETE);
|
mtbColtToDelete.setOperation(CommonModelConsts.OPERATION.DELETE);
|
||||||
|
|
||||||
saveColloStatic(mtbColtToDelete, new ISimpleOperationCallback<MtbColt>() {
|
saveCollo(mtbColtToDelete, value -> {
|
||||||
@Override
|
if (onComplete != null) onComplete.run();
|
||||||
public void onSuccess(MtbColt value) {
|
}, onFailed);
|
||||||
if (onComplete != null) onComplete.run();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
if (onFailed != null) onFailed.run(ex);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void distribuisciCollo(MtbColt mtbColtToDistribute, DistribuzioneColloDTO.CriterioDistribuzione criterioDistribuzione, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void distribuisciCollo(MtbColt mtbColtToDistribute, DistribuzioneColloDTO.CriterioDistribuzione criterioDistribuzione, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
@@ -398,10 +322,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getBySSCC(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getBySSCC(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliMagazzinoRESTConsumer.getBySSCCStatic(ssccString, onlyResiduo, throwExcIfNull, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void getBySSCCStatic(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
|
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
|
||||||
@Override
|
@Override
|
||||||
@@ -442,7 +362,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ArticoloRESTConsumer.getByCodMartStatic(codMarts, arts -> {
|
ArticoloRESTConsumer.getByCodMartsStatic(codMarts, arts -> {
|
||||||
|
|
||||||
if (arts != null && arts.size() > 0) {
|
if (arts != null && arts.size() > 0) {
|
||||||
for (MtbColt mtbColt : mtbColts) {
|
for (MtbColt mtbColt : mtbColts) {
|
||||||
@@ -471,10 +391,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getMultipleByTestate(List<MtbColt> testate, boolean onlyResiduo, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getMultipleByTestate(List<MtbColt> testate, boolean onlyResiduo, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliMagazzinoRESTConsumer.getMultipleByTestateStatic(testate, onlyResiduo, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void getMultipleByTestateStatic(List<MtbColt> testate, boolean onlyResiduo, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
ArrayList<MtbColt> resultMtbColt = new ArrayList<>();
|
ArrayList<MtbColt> resultMtbColt = new ArrayList<>();
|
||||||
cyclicGetMultipleByTestate(testate.iterator(), onlyResiduo, resultMtbColt, () -> {
|
cyclicGetMultipleByTestate(testate.iterator(), onlyResiduo, resultMtbColt, () -> {
|
||||||
onComplete.run(resultMtbColt);
|
onComplete.run(resultMtbColt);
|
||||||
@@ -482,9 +398,9 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void cyclicGetMultipleByTestate(@NotNull Iterator<MtbColt> sourceMtbColts, boolean onlyResiduo, ArrayList<MtbColt> resultMtbColt, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
private void cyclicGetMultipleByTestate(@NotNull Iterator<MtbColt> sourceMtbColts, boolean onlyResiduo, ArrayList<MtbColt> resultMtbColt, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||||
if (sourceMtbColts.hasNext()) {
|
if (sourceMtbColts.hasNext()) {
|
||||||
getByTestataStatic(sourceMtbColts.next(), onlyResiduo, false, mtbColt -> {
|
getByTestata(sourceMtbColts.next(), onlyResiduo, false, mtbColt -> {
|
||||||
resultMtbColt.add(mtbColt);
|
resultMtbColt.add(mtbColt);
|
||||||
cyclicGetMultipleByTestate(sourceMtbColts, onlyResiduo, resultMtbColt, onComplete, onAbort);
|
cyclicGetMultipleByTestate(sourceMtbColts, onlyResiduo, resultMtbColt, onComplete, onAbort);
|
||||||
}, onAbort);
|
}, onAbort);
|
||||||
@@ -500,105 +416,79 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.setDataCollo(dataCollo)
|
.setDataCollo(dataCollo)
|
||||||
.setSerCollo(serCollo);
|
.setSerCollo(serCollo);
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.getByTestataStatic(mtbColtToRetrieve, onlyResiduo, throwExcIfNull, onComplete, onFailed);
|
getByTestata(mtbColtToRetrieve, onlyResiduo, throwExcIfNull, onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getByTestata(MtbColt testata, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getByTestata(MtbColt testata, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliMagazzinoRESTConsumer.getByTestataStatic(testata, onlyResiduo, throwExcIfNull, onComplete, onFailed);
|
testata.setMtbColr(new ObservableArrayList<>());
|
||||||
}
|
|
||||||
|
|
||||||
public static void getByTestataStatic(MtbColt testata, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
String ssccString = null;
|
|
||||||
|
|
||||||
if (testata.getSerCollo().equalsIgnoreCase(CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE)) {
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
ssccString = "U";
|
colliMagazzinoRESTConsumerService.getColloInGiac(onlyResiduo, throwExcIfNull, testata).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||||
|
analyzeAnswer(response, "getColloInGiac", mtbColt -> {
|
||||||
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yy");
|
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||||
ssccString += sdf.format(testata.getDataColloD());
|
List<MtbColt> mtbColtList = new ArrayList<>();
|
||||||
|
mtbColtList.add(mtbColt);
|
||||||
|
fillMtbAartsOfMtbColtsStatic(mtbColtList, mtbColts -> onComplete.run(mtbColts.get(0)), onFailed);
|
||||||
|
} else {
|
||||||
|
onComplete.run(mtbColt);
|
||||||
|
}
|
||||||
|
|
||||||
ssccString += String.format("%07d", testata.getNumCollo());
|
}, onFailed);
|
||||||
} else {
|
|
||||||
ssccString = "";
|
|
||||||
|
|
||||||
switch (testata.getGestioneEnum()) {
|
|
||||||
case ACQUISTO:
|
|
||||||
ssccString += "1";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LAVORAZIONE:
|
|
||||||
ssccString += "2";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case VENDITA:
|
|
||||||
ssccString += "3";
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yy");
|
@Override
|
||||||
ssccString += sdf.format(testata.getDataColloD());
|
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
ssccString += String.format("%05d", testata.getNumCollo());
|
|
||||||
ssccString += "0";
|
public void changePosizione(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
String codMdep = posizione.getCodMdep();
|
||||||
|
String posizioneString = posizione.getPosizione();
|
||||||
|
|
||||||
|
MtbColt mtbColtToMoveClone = (MtbColt) mtbColtToMove.clone();
|
||||||
|
|
||||||
|
for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) {
|
||||||
|
mtbColtToMoveClone.getMtbColr().get(i)
|
||||||
|
.setMtbAart(null)
|
||||||
|
.setMtbPartitaMag(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
getBySSCCStatic(ssccString, onlyResiduo, throwExcIfNull, onComplete, onFailed);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
}
|
colliMagazzinoRESTConsumerService
|
||||||
|
.spostaULInPosizione(codMdep,
|
||||||
|
posizioneString,
|
||||||
public static void changePosizione(MtbColt mtbColtToSave, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
mtbColtToMoveClone)
|
||||||
MtbColt mtbColtToSaveClone = (MtbColt) mtbColtToSave.clone();
|
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
||||||
|
@Override
|
||||||
mtbColtToSaveClone.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
mtbColtToSaveClone.setMtbColr(new ObservableArrayList<>());
|
analyzeAnswer(response, "changePosizione", mtbColts -> {
|
||||||
|
onComplete.run();
|
||||||
if (posizione == null) mtbColtToSaveClone.setPosizione(null);
|
}, onFailed);
|
||||||
else mtbColtToSaveClone
|
}
|
||||||
.setPosizione(posizione.getPosizione())
|
|
||||||
.setCodMdep(posizione.getCodMdep());
|
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveColloStatic(mtbColtToSaveClone, mtbColt -> {
|
|
||||||
if (onComplete != null) onComplete.run();
|
|
||||||
}, ex -> {
|
|
||||||
if (onFailed != null) onFailed.run(ex);
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void updateRiga(MtbColr mtbColrToUpdate, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
updateRigaStatic(mtbColrToUpdate, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void updateRigaStatic(MtbColr mtbColrToUpdate, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
MtbColt mtbColt = new MtbColt()
|
|
||||||
.setGestione(mtbColrToUpdate.getGestioneEnum())
|
|
||||||
.setNumCollo(mtbColrToUpdate.getNumCollo())
|
|
||||||
.setSerCollo(mtbColrToUpdate.getSerCollo())
|
|
||||||
.setDataCollo(mtbColrToUpdate.getDataColloS());
|
|
||||||
|
|
||||||
mtbColt.getMtbColr().add(mtbColrToUpdate);
|
|
||||||
|
|
||||||
mtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
|
||||||
mtbColrToUpdate.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
|
||||||
|
|
||||||
EntityRESTConsumer.processEntity(mtbColt, value -> {
|
|
||||||
if(onComplete != null) onComplete.run();
|
|
||||||
}, onFailed, MtbColt.class);
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||||
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateDataFine(MtbColt mtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void updateDataFine(MtbColt mtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliMagazzinoRESTConsumer.updateDataFineStatic(mtbColt, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void updateDataFineStatic(MtbColt mtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
|
|
||||||
MtbColt cloneMtbColt = (MtbColt) mtbColt.clone();
|
MtbColt cloneMtbColt = (MtbColt) mtbColt.clone();
|
||||||
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
||||||
cloneMtbColt.setOraFinePrep(UtilityDate.getDateInstance());
|
cloneMtbColt.setOraFinePrep(UtilityDate.getDateInstance());
|
||||||
cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveColloStatic(cloneMtbColt, value -> {
|
saveCollo(cloneMtbColt, value -> {
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
if (onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
@@ -607,10 +497,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void canLUBeDeleted(MtbColt mtbColt, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
public void canLUBeDeleted(MtbColt mtbColt, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliMagazzinoRESTConsumer.canLUBeDeletedStatic(mtbColt, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void canLUBeDeletedStatic(MtbColt mtbColt, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
|
|
||||||
HashMap<String, Object> params = new HashMap<>();
|
HashMap<String, Object> params = new HashMap<>();
|
||||||
params.put("mtb_colt.gestione", mtbColt.getGestione());
|
params.put("mtb_colt.gestione", mtbColt.getGestione());
|
||||||
@@ -652,7 +538,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {
|
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {
|
||||||
}.getType();
|
}.getType();
|
||||||
SystemRESTConsumer.<ArrayList<MtbColt>>processSqlStatic(query, typeOfObjectsList, data -> {
|
this.mSystemRESTConsumer.<ArrayList<MtbColt>>processSql(query, typeOfObjectsList, data -> {
|
||||||
onComplete.run(data != null && data.size() > 0);
|
onComplete.run(data != null && data.size() > 0);
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
@@ -675,12 +561,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void creaRettificaCollo(MtbColr sourceMtbColrOriginal, BigDecimal newNumCnf, BigDecimal newQtaTot, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void creaRettificaColloStatic(MtbColr sourceMtbColrOriginal, BigDecimal newNumCnf, BigDecimal newQtaTot, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
MtbColr sourceMtbColr = (MtbColr) sourceMtbColrOriginal.clone();
|
MtbColr sourceMtbColr = (MtbColr) sourceMtbColrOriginal.clone();
|
||||||
sourceMtbColr.setMtbPartitaMag(null);
|
sourceMtbColr.setMtbPartitaMag(null);
|
||||||
sourceMtbColr.setMtbAart(null);
|
sourceMtbColr.setMtbAart(null);
|
||||||
@@ -694,25 +575,75 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
colliMagazzinoRESTConsumerService.creaRettificaCollo(
|
colliMagazzinoRESTConsumerService.creaRettificaCollo(
|
||||||
SettingsManager.i().getUserSession().getDepo().getCodMdep(),
|
SettingsManager.i().getUserSession().getDepo().getCodMdep(),
|
||||||
rettificaULDTO
|
rettificaULDTO
|
||||||
).enqueue(new Callback<ServiceRESTResponse<MtbColr>>() {
|
).enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<MtbColr>> call, Response<ServiceRESTResponse<MtbColr>> response) {
|
public void onResponse(Call<ServiceRESTResponse<MtbColr>> call, Response<ServiceRESTResponse<MtbColr>> response) {
|
||||||
analyzeAnswer(response, "creaRettificaCollo", data -> {
|
analyzeAnswer(response, "creaRettificaCollo", onComplete, onFailed);
|
||||||
onComplete.run(data);
|
|
||||||
}, onFailed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<MtbColr>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<MtbColr>> call, Throwable t) {
|
||||||
if(onFailed != null) onFailed.run(new Exception(t));
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
MtbColt mtbColtToMoveClone = (MtbColt) sourceMtbColt.clone();
|
||||||
|
MtbColt mtbColtDestClone = (MtbColt) destMtbColt.clone();
|
||||||
|
|
||||||
|
for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) {
|
||||||
|
mtbColtToMoveClone.getMtbColr().get(i)
|
||||||
|
.setMtbAart(null)
|
||||||
|
.setMtbPartitaMag(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
mtbColtDestClone.setMtbColr(null);
|
||||||
|
|
||||||
|
SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO = new SpostaArtsTraULRequestDTO()
|
||||||
|
.setSourceMtbColt(mtbColtToMoveClone)
|
||||||
|
.setDestinationMtbColt(mtbColtDestClone);
|
||||||
|
|
||||||
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
|
colliMagazzinoRESTConsumerService.spostaArtsTraUL(spostaArtsTraULRequestDTO).enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
|
analyzeAnswer(response, "spostaArtsTraUL", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||||
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void assegnaLottoSuColloScarico(MtbColt sourceMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
MtbColt sourceMtbColtClone = (MtbColt) sourceMtbColt.clone();
|
||||||
|
|
||||||
public void creaRettificaCollo(MtbColr sourceMtbColrOriginal, BigDecimal newNumCnf, BigDecimal newQtaTot, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
for (int i = 0; i < sourceMtbColtClone.getMtbColr().size(); i++) {
|
||||||
creaRettificaColloStatic(sourceMtbColrOriginal, newNumCnf, newQtaTot, onComplete, onFailed);
|
sourceMtbColtClone.getMtbColr().get(i)
|
||||||
|
.setMtbAart(null)
|
||||||
|
.setMtbPartitaMag(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
|
colliMagazzinoRESTConsumerService.assegnaLottoSuColloScarico(sourceMtbColtClone).enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||||
|
analyzeAnswer(response, "assegnaLottoSuColloScarico", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
|
||||||
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import it.integry.integrywmsnative.core.model.MtbColt;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.http.Body;
|
import retrofit2.http.Body;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
@@ -17,16 +18,28 @@ import retrofit2.http.Query;
|
|||||||
|
|
||||||
public interface ColliMagazzinoRESTConsumerService {
|
public interface ColliMagazzinoRESTConsumerService {
|
||||||
|
|
||||||
@POST("SM2DistribuzioneRigheCollo")
|
@POST("wms/distribuzioneRigheCollo")
|
||||||
Call<ServiceRESTResponse<JsonObject>> distribuisciCollo(@Body DistribuzioneColloDTO distribuzioneCollo);
|
Call<ServiceRESTResponse<JsonObject>> distribuisciCollo(@Body DistribuzioneColloDTO distribuzioneCollo);
|
||||||
|
|
||||||
@POST("getColloByBarcode")
|
@POST("getColloByBarcode")
|
||||||
Call<ServiceRESTResponse<MtbColt>> getColloByBarcode(@Query("codBarreCollo") String sscc, @Query("onlyResiduo") boolean onlyResiduo, @Query("throwExcIfNull") boolean throwExcIfNull);
|
Call<ServiceRESTResponse<MtbColt>> getColloByBarcode(@Query("codBarreCollo") String sscc, @Query("onlyResiduo") boolean onlyResiduo, @Query("throwExcIfNull") boolean throwExcIfNull);
|
||||||
|
|
||||||
|
@POST("getColloInGiac")
|
||||||
|
Call<ServiceRESTResponse<MtbColt>> getColloInGiac(@Query("onlyResiduo") boolean onlyResiduo, @Query("throwExcIfNull") boolean throwExcIfNull, @Body MtbColt mtbColt);
|
||||||
|
|
||||||
@GET("getColliInBasket")
|
@GET("getColliInBasket")
|
||||||
Call<ServiceRESTResponse<List<MtbColt>>> getColliInBasket(@Query("codMdep") String codMdep);
|
Call<ServiceRESTResponse<List<MtbColt>>> getColliInBasket(@Query("codMdep") String codMdep);
|
||||||
|
|
||||||
@POST("creaRettificaCollo")
|
@POST("creaRettificaCollo")
|
||||||
Call<ServiceRESTResponse<MtbColr>> creaRettificaCollo(@Query("codMdep") String codMdep, @Body RettificaULDTO rettificaULDTO);
|
Call<ServiceRESTResponse<MtbColr>> creaRettificaCollo(@Query("codMdep") String codMdep, @Body RettificaULDTO rettificaULDTO);
|
||||||
|
|
||||||
|
@POST("wms/spostaULInPosizione")
|
||||||
|
Call<ServiceRESTResponse<Object>> spostaULInPosizione(@Query("codMdep") String codMdep, @Query("posizione") String posizione, @Body MtbColt mtbColtToMove);
|
||||||
|
|
||||||
|
@POST("wms/spostaArtsTraUL")
|
||||||
|
Call<ServiceRESTResponse<Object>> spostaArtsTraUL(@Body SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO);
|
||||||
|
|
||||||
|
@POST("wms/assegnaLottoSuColloScarico")
|
||||||
|
Call<ServiceRESTResponse<MtbColt>> assegnaLottoSuColloScarico(@Body MtbColt mtbColt);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +1,52 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepo;
|
import it.integry.integrywmsnative.core.model.MtbDepo;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
|
||||||
|
|
||||||
public class DepositoRESTConsumer {
|
@Singleton
|
||||||
|
public class DepositoRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
public static void getDepoByCodMdep(String codMdep, RunnableArgs<MtbDepo> onComplete) {
|
private final EntityRESTConsumer entityRESTConsumer;
|
||||||
|
private final SystemRESTConsumer systemRESTConsumer;
|
||||||
|
|
||||||
|
public DepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer, SystemRESTConsumer systemRESTConsumer) {
|
||||||
|
this.entityRESTConsumer = entityRESTConsumer;
|
||||||
|
this.systemRESTConsumer = systemRESTConsumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getAll(RunnableArgs<List<MtbDepo>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
Type typeOfObjectsList = new TypeToken<ArrayList<MtbDepo>>() {
|
||||||
|
}.getType();
|
||||||
|
this.systemRESTConsumer.processSql("SELECT * FROM mtb_depo", typeOfObjectsList, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getDepoByCodMdep(String codMdep, RunnableArgs<MtbDepo> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
MtbDepo mtbDepo = new MtbDepo();
|
MtbDepo mtbDepo = new MtbDepo();
|
||||||
mtbDepo.setCodMdep(codMdep);
|
mtbDepo.setCodMdep(codMdep);
|
||||||
mtbDepo.setOperation(CommonModelConsts.OPERATION.SELECT);
|
mtbDepo.setOperation(CommonModelConsts.OPERATION.SELECT);
|
||||||
mtbDepo.setOnlyPkMaster(false);
|
mtbDepo.setOnlyPkMaster(false);
|
||||||
|
|
||||||
EntityRESTConsumer.selectEntity(mtbDepo, new ISimpleOperationCallback<List<MtbDepo>>() {
|
this.entityRESTConsumer.selectEntity(mtbDepo, new ISimpleOperationCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<MtbDepo> value) {
|
public void onSuccess(List<MtbDepo> value) {
|
||||||
if(value != null && value.size() > 0) {
|
if (value != null && value.size() > 0) {
|
||||||
onComplete.run(value.get(0));
|
onComplete.run(value.get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(Exception ex) {
|
public void onFailed(Exception ex) {
|
||||||
UtilityLogger.errorMe(ex);
|
onFailed.run(ex);
|
||||||
}
|
}
|
||||||
}, MtbDepo.class);
|
}, MtbDepo.class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,42 +4,26 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.reflect.TypeToken;
|
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.EntityBase;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.model.EsitoType;
|
import it.integry.integrywmsnative.core.rest.model.EsitoType;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.model.EntityBase;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
public class EntityRESTConsumer {
|
@Singleton
|
||||||
|
public class EntityRESTConsumer extends _BaseRESTConsumer {
|
||||||
public static <T extends EntityBase> void processEntity(T entityToSave, RunnableArgs<T> onComplete, RunnableArgs<Exception> onFailed, Class<T> type) {
|
|
||||||
|
|
||||||
processEntity(entityToSave, new ISimpleOperationCallback<T>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(T value) {
|
|
||||||
if(onComplete != null) onComplete.run(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
if(onFailed != null) onFailed.run(ex);
|
|
||||||
}
|
|
||||||
}, type);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static <T extends EntityBase> void processEntity(T entityToSave, final ISimpleOperationCallback<T> callback, Class<T> type) {
|
public <T extends EntityBase> void processEntity(T entityToSave, final ISimpleOperationCallback<T> callback, Class<T> type) {
|
||||||
|
|
||||||
RunnableArgs<Exception> tmpFailed = ex -> {
|
RunnableArgs<Exception> tmpFailed = ex -> {
|
||||||
if (callback != null) callback.onFailed(ex);
|
if (callback != null) callback.onFailed(ex);
|
||||||
@@ -48,7 +32,7 @@ public class EntityRESTConsumer {
|
|||||||
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
|
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
|
||||||
service
|
service
|
||||||
.processEntity(entityToSave)
|
.processEntity(entityToSave)
|
||||||
.enqueue(new Callback<ServiceRESTResponse<JsonObject>>() {
|
.enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
@@ -82,16 +66,16 @@ public class EntityRESTConsumer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T extends EntityBase> void processEntityList(List<T> entitiesToSave, final ISimpleOperationCallback<List<T>> callback, boolean singleTransaction, Class<T> type) {
|
public <T extends EntityBase> void processEntityList(List<T> entitiesToSave, boolean singleTransaction, Class<T> type, final RunnableArgs<List<T>> onComplete, final RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
RunnableArgs<Exception> tmpFailed = ex -> {
|
RunnableArgs<Exception> tmpFailed = ex -> {
|
||||||
// UtilityExceptions.defaultException(null, ex);
|
// UtilityExceptions.defaultException(null, ex);
|
||||||
if (callback != null) callback.onFailed(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
};
|
};
|
||||||
|
|
||||||
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
|
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
|
||||||
Call<List<ServiceRESTResponse<JsonObject>>> request = service.processEntityList(singleTransaction, entitiesToSave);
|
Call<List<ServiceRESTResponse<JsonObject>>> request = service.processEntityList(singleTransaction, entitiesToSave);
|
||||||
request.enqueue(new Callback<List<ServiceRESTResponse<JsonObject>>>() {
|
request.enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<List<ServiceRESTResponse<JsonObject>>> call, Response<List<ServiceRESTResponse<JsonObject>>> response) {
|
public void onResponse(Call<List<ServiceRESTResponse<JsonObject>>> call, Response<List<ServiceRESTResponse<JsonObject>>> response) {
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
@@ -115,7 +99,7 @@ public class EntityRESTConsumer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
callback.onSuccess(responseList);
|
onComplete.run(responseList);
|
||||||
} else {
|
} else {
|
||||||
Log.e("EntityRESTConsumer", response.message());
|
Log.e("EntityRESTConsumer", response.message());
|
||||||
tmpFailed.run(new Exception(response.message()));
|
tmpFailed.run(new Exception(response.message()));
|
||||||
@@ -136,7 +120,7 @@ public class EntityRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static <T extends EntityBase> void selectEntity(T entityToSave, final ISimpleOperationCallback<List<T>> callback, Class type) {
|
public <T extends EntityBase> void selectEntity(T entityToSave, final ISimpleOperationCallback<List<T>> callback, Class type) {
|
||||||
|
|
||||||
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
|
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
|
||||||
Call<ServiceRESTResponse<JsonObject>> request = service.processEntity(entityToSave);
|
Call<ServiceRESTResponse<JsonObject>> request = service.processEntity(entityToSave);
|
||||||
|
|||||||
@@ -6,15 +6,18 @@ import java.lang.reflect.Type;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class MagazzinoRESTConsumer extends _BaseRESTConsumer {
|
public class MagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void getTipoCollo(String codTcol, RunnableArgs<MtbTCol> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getTipoCollo(String codTcol, RunnableArgs<MtbTCol> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
String baseSql = "SELECT * " +
|
String baseSql = "SELECT * " +
|
||||||
"FROM mtb_tcol " +
|
"FROM mtb_tcol " +
|
||||||
"WHERE cod_tcol = " + UtilityDB.valueToString(codTcol);
|
"WHERE cod_tcol = " + UtilityDB.valueToString(codTcol);
|
||||||
@@ -36,7 +39,11 @@ public class MagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void getTipiCollo(RunnableArgs<List<MtbTCol>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getTipiCollo(RunnableArgs<List<MtbTCol>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
getTipiColloStatic(onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getTipiColloStatic(RunnableArgs<List<MtbTCol>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
String baseSql = "SELECT * " +
|
String baseSql = "SELECT * " +
|
||||||
"FROM mtb_tcol ";
|
"FROM mtb_tcol ";
|
||||||
|
|
||||||
|
|||||||
@@ -1,31 +1,93 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.JtbFasi;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class MesRESTConsumer extends _BaseRESTConsumer {
|
public class MesRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
public static void getOrdiniLavorazioneMateriale(String codJfas, String idMateriale, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed){
|
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||||
|
|
||||||
|
public MesRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||||
|
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getOrdiniLavorazioneMateriale(String codJfas, String idMateriale, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
||||||
mesRESTConsumerService.getOrdiniLavorazioneMateriale(codJfas,idMateriale).enqueue(new Callback<ServiceRESTResponse<List<OrdineLavorazioneDTO>>>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
|
||||||
analyzeAnswer(response, "getAvailablePosizioni", (m) -> onComplete.run(response.body().getDto()), onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
mesRESTConsumerService.getOrdiniLavorazioneMateriale(codJfas, idMateriale)
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Throwable t) {
|
.enqueue(new Callback<>() {
|
||||||
onFailed.run(new Exception(t));
|
@Override
|
||||||
}
|
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
||||||
});
|
analyzeAnswer(response, "getOrdiniLavorazioneMateriale", (m) -> onComplete.run(response.body().getDto()), onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getOrdiniLavorazione(String flagEvaso, String codJfas, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
||||||
|
|
||||||
|
mesRESTConsumerService.getOrdiniLavorazione(flagEvaso, codJfas)
|
||||||
|
.enqueue(new Callback<ServiceRESTResponse<List<OrdineLavorazioneDTO>>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
||||||
|
analyzeAnswer(response, "getOrdiniLavorazione", (m) -> onComplete.run(response.body().getDto()), onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getOrdiniLavorazione(Date dateStart, String flagEvaso, String codJfas, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
||||||
|
|
||||||
|
mesRESTConsumerService.getOrdiniLavorazione(UtilityDate.formatDate(dateStart, UtilityDate.COMMONS_DATE_FORMATS.YMD_DASH), flagEvaso, codJfas)
|
||||||
|
.enqueue(new Callback<ServiceRESTResponse<List<OrdineLavorazioneDTO>>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
||||||
|
analyzeAnswer(response, "getOrdiniLavorazione", (m) -> onComplete.run(response.body().getDto()), onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getLineeProduzione(String codJfasParent, RunnableArgs<List<JtbFasi>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
Type typeOfObjectsList = new TypeToken<ArrayList<JtbFasi>>() {}.getType();
|
||||||
|
this.mSystemRESTConsumer.processSql(
|
||||||
|
"SELECT * FROM jtb_fasi WHERE cod_jfas_parent = " + UtilityDB.valueToString(codJfasParent),
|
||||||
|
typeOfObjectsList,
|
||||||
|
onComplete,
|
||||||
|
onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,4 +14,12 @@ public interface MesRESTConsumerService {
|
|||||||
@GET("mes_v2/getOrdiniLavorazioneMateriale")
|
@GET("mes_v2/getOrdiniLavorazioneMateriale")
|
||||||
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazioneMateriale(@Query("codJfas") String codJfas, @Query("idMateriale") String idMateriale);
|
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazioneMateriale(@Query("codJfas") String codJfas, @Query("idMateriale") String idMateriale);
|
||||||
|
|
||||||
|
|
||||||
|
@GET("mes_v2/getOrdiniLavorazione")
|
||||||
|
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazione(@Query("flagEvaso") String flagEvaso, @Query("codJfas") String codJfas);
|
||||||
|
|
||||||
|
|
||||||
|
@GET("mes_v2/getOrdiniLavorazione")
|
||||||
|
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazione(@Query("startDate") String startDate, @Query("flagEvaso") String flagEvaso, @Query("codJfas") String codJfas);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import com.annimon.stream.Optional;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import com.orhanobut.logger.Logger;
|
import com.orhanobut.logger.Logger;
|
||||||
@@ -8,22 +9,27 @@ import java.lang.reflect.Type;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
||||||
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.GetPickingListDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.GetPickingListDTO;
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
@@ -32,9 +38,11 @@ import retrofit2.Response;
|
|||||||
public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
private final SystemRESTConsumer mSystemRESTConsumer;
|
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||||
|
private final EntityRESTConsumer mEntityRESTConsumer;
|
||||||
|
|
||||||
public OrdiniRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
public OrdiniRESTConsumer(SystemRESTConsumer systemRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
||||||
this.mSystemRESTConsumer = systemRESTConsumer;
|
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||||
|
this.mEntityRESTConsumer = entityRESTConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getSuggestedPickingList(String codMdep, List<SitArtOrdDTO> sitArtOrdList, RunnableArgs<List<PickingObjectDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getSuggestedPickingList(String codMdep, List<SitArtOrdDTO> sitArtOrdList, RunnableArgs<List<PickingObjectDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
@@ -43,10 +51,59 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
service
|
service
|
||||||
.getSuggestedPickingList(codMdep, sitArtOrdList)
|
.getSuggestedPickingList(codMdep, sitArtOrdList)
|
||||||
.enqueue(new Callback<ServiceRESTResponse<List<PickingObjectDTO>>>() {
|
.enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<PickingObjectDTO>>> call, Response<ServiceRESTResponse<List<PickingObjectDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<PickingObjectDTO>>> call, Response<ServiceRESTResponse<List<PickingObjectDTO>>> response) {
|
||||||
analyzeAnswer(response, "getSuggestedPickingList", onComplete, onFailed);
|
analyzeAnswer(response, "getSuggestedPickingList", pickingObjects -> {
|
||||||
|
List<MtbPartitaMag> batchLotsToSearch = new ArrayList<>();
|
||||||
|
|
||||||
|
for (PickingObjectDTO pickingObjectDTO : pickingObjects) {
|
||||||
|
for (MtbColt mtbColt : pickingObjectDTO.getMtbColts()) {
|
||||||
|
Stream.of(mtbColt.getMtbColr())
|
||||||
|
.filter(x -> !UtilityString.isNullOrEmpty(x.getPartitaMag()))
|
||||||
|
.forEach(x -> {
|
||||||
|
|
||||||
|
if (!Stream.of(batchLotsToSearch).anyMatch(batchLotToSearch -> batchLotToSearch.getCodMart().equalsIgnoreCase(x.getCodMart()) && batchLotToSearch.getPartitaMag().equalsIgnoreCase(x.getPartitaMag()))) {
|
||||||
|
MtbPartitaMag mtbPartitaMag = new MtbPartitaMag()
|
||||||
|
.setCodMart(x.getCodMart())
|
||||||
|
.setPartitaMag(x.getPartitaMag());
|
||||||
|
|
||||||
|
mtbPartitaMag.setOperation(CommonModelConsts.OPERATION.SELECT_OBJECT);
|
||||||
|
mtbPartitaMag.setOnlyPkMaster(false);
|
||||||
|
|
||||||
|
batchLotsToSearch.add(mtbPartitaMag);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Random rand = new Random();
|
||||||
|
|
||||||
|
|
||||||
|
retrievePartiteMag(batchLotsToSearch, partite -> {
|
||||||
|
|
||||||
|
for (PickingObjectDTO pickingObjectDTO : pickingObjects) {
|
||||||
|
for (MtbColt mtbColt : pickingObjectDTO.getMtbColts()) {
|
||||||
|
for (MtbColr mtbColr : mtbColt.getMtbColr()) {
|
||||||
|
|
||||||
|
mtbColr.setId(rand.nextInt());
|
||||||
|
|
||||||
|
Optional<MtbPartitaMag> optionalMtbPartitaMag = Stream.of(partite)
|
||||||
|
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart())
|
||||||
|
&& (!UtilityString.isNullOrEmpty(x.getPartitaMag()) && x.getPartitaMag().equalsIgnoreCase(mtbColr.getPartitaMag())))
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
if (optionalMtbPartitaMag.isPresent()) mtbColr.setMtbPartitaMag(optionalMtbPartitaMag.get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onComplete.run(pickingObjects);
|
||||||
|
|
||||||
|
}, onFailed);
|
||||||
|
|
||||||
|
|
||||||
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -58,6 +115,11 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void retrievePartiteMag(List<MtbPartitaMag> partitaMag, RunnableArgs<List<MtbPartitaMag>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
this.mEntityRESTConsumer.processEntityList(partitaMag, true, MtbPartitaMag.class, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
public void getOrdiniInevasi(String codMdep, GestioneEnum gestione, RunnableArgs<List<OrdineUscitaInevasoDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getOrdiniInevasi(String codMdep, GestioneEnum gestione, RunnableArgs<List<OrdineUscitaInevasoDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class);
|
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class);
|
||||||
@@ -67,18 +129,18 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> call, Response<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> call, Response<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> response) {
|
||||||
analyzeAnswer(response, "getOrdiniInevasi", responseDtoList -> {
|
analyzeAnswer(response, "getOrdiniInevasi", responseDtoList -> {
|
||||||
if(responseDtoList == null) responseDtoList = new ArrayList<>();
|
if (responseDtoList == null) responseDtoList = new ArrayList<>();
|
||||||
onComplete.run(responseDtoList);
|
onComplete.run(responseDtoList);
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
Logger.e(ex, "Errore durante il caricamento degli ordini di lavorazione");
|
Logger.e(ex, "Errore durante il caricamento degli ordini di lavorazione");
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> call, Throwable t) {
|
||||||
Logger.e(t, "Errore durante il caricamento degli ordini di lavorazione");
|
Logger.e(t, "Errore durante il caricamento degli ordini di lavorazione");
|
||||||
if(onFailed != null) onFailed.run(new Exception(t));
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -113,7 +175,7 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
public void getBancaliGiaRegistrati(List<OrdineInevasoDTO> orders, GestioneEnum gestione, int segno, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getBancaliGiaRegistrati(List<OrdineInevasoDTO> orders, GestioneEnum gestione, int segno, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
String whereCondGestione = "";
|
String whereCondGestione = "";
|
||||||
|
|
||||||
if(gestione != null) {
|
if (gestione != null) {
|
||||||
whereCondGestione = "mtb_colt.gestione = " + UtilityDB.valueToString(gestione.getText()) + " ";
|
whereCondGestione = "mtb_colt.gestione = " + UtilityDB.valueToString(gestione.getText()) + " ";
|
||||||
} else {
|
} else {
|
||||||
whereCondGestione = "(mtb_colt.gestione = 'V' OR mtb_colt.gestione = 'L') ";
|
whereCondGestione = "(mtb_colt.gestione = 'V' OR mtb_colt.gestione = 'L') ";
|
||||||
@@ -142,12 +204,13 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
baseSql += "(" + UtilityQuery.concatFieldListInWhereCond(whereCondMapList) + ")";
|
baseSql += "(" + UtilityQuery.concatFieldListInWhereCond(whereCondMapList) + ")";
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {}.getType();
|
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {
|
||||||
|
}.getType();
|
||||||
this.mSystemRESTConsumer.<List<MtbColt>>processSql(baseSql, typeOfObjectsList, value -> {
|
this.mSystemRESTConsumer.<List<MtbColt>>processSql(baseSql, typeOfObjectsList, value -> {
|
||||||
if(onComplete != null) onComplete.run(value);
|
if (onComplete != null) onComplete.run(value);
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
griglia.setGrigliaAcquistiChild(listaArticoli);
|
griglia.setGrigliaAcquistiChild(listaArticoli);
|
||||||
onSuccess.run(griglia);
|
onSuccess.run(griglia);
|
||||||
});
|
}, false);
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,11 +68,8 @@ public class PosizioniRESTConsumer extends _BaseRESTConsumer{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getBancaliInPosizione(MtbDepoPosizione mtbDepoPosizione, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
getBancaliInPosizioneStatic(mtbDepoPosizione, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void getBancaliInPosizioneStatic(MtbDepoPosizione mtbDepoPosizione, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getBancaliInPosizione(MtbDepoPosizione mtbDepoPosizione, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
String sql = "SELECT * FROM mtb_colt WHERE segno > 0 AND cod_mdep = " + UtilityDB.valueToString(mtbDepoPosizione.getCodMdep()) + " AND posizione = " + UtilityDB.valueToString(mtbDepoPosizione.getPosizione());
|
String sql = "SELECT * FROM mtb_colt WHERE segno > 0 AND cod_mdep = " + UtilityDB.valueToString(mtbDepoPosizione.getCodMdep()) + " AND posizione = " + UtilityDB.valueToString(mtbDepoPosizione.getPosizione());
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ import javax.inject.Singleton;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.BuildConfig;
|
import it.integry.integrywmsnative.BuildConfig;
|
||||||
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.JasperPairDTO;
|
import it.integry.integrywmsnative.core.rest.model.JasperPairDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
@@ -32,64 +32,12 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void getAvailablePrintersStatic(final ISimpleOperationCallback<List<String>> callback) {
|
|
||||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
|
||||||
printerService.getAvailablePrinters().enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
|
||||||
analyzeAnswer(response, "GetAvailablePrinters", callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, Throwable t) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getAvailablePrinters(String codMdep, final RunnableArgs<List<String>> onComplete, final RunnableArgs<Exception> onFailed) {
|
|
||||||
getAvailablePrintersStatic(codMdep, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void getAvailablePrintersStatic(String codMdep, final RunnableArgs<List<String>> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
|
|
||||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
|
||||||
printerService.getAvailablePrinters(codMdep).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
|
||||||
analyzeAnswer(response, "GetAvailablePrinters", new ISimpleOperationCallback<List<String>>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<String> value) {
|
|
||||||
onComplete.run(value != null ? Stream.of(value).withoutNulls().toList() : null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
onFailed.run(ex);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, Throwable t) {
|
|
||||||
Log.e("GetAvailablePrinters", t.toString());
|
|
||||||
UtilityLogger.errorMe(new Exception(t));
|
|
||||||
onFailed.run(new Exception(t));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void getAvailablePrinters(String codMdep, Type printerType, RunnableArgs<List<String>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getAvailablePrinters(String codMdep, Type printerType, RunnableArgs<List<String>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
PrinterRESTConsumer.getAvailablePrintersStatic(codMdep, printerType, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void getAvailablePrintersStatic(String codMdep, Type printerType, RunnableArgs<List<String>> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
|
|
||||||
String printerTypeStr = printerType != null ? printerType.toString() : null;
|
String printerTypeStr = printerType != null ? printerType.toString() : null;
|
||||||
|
|
||||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
printerService.getAvailablePrinters(codMdep, printerTypeStr).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
printerService.getAvailablePrinters(codMdep, printerTypeStr).enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
||||||
analyzeAnswer(response, "GetAvailablePrinters", printerList -> {
|
analyzeAnswer(response, "GetAvailablePrinters", printerList -> {
|
||||||
@@ -107,54 +55,43 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void printCollo(String printerName, MtbColt testataColloToPrint, int quantity, String reportName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void printCollo(Type printerType, MtbColt testataColloToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
printColloStatic(printerName, testataColloToPrint, quantity, reportName, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void printColloStatic(String printerName, MtbColt testataColloToPrint, int quantity, String reportName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
if (BuildConfig.DEBUG) {
|
||||||
|
|
||||||
if(BuildConfig.DEBUG) {
|
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(UtilityString.isNullOrEmpty(printerName)) {
|
|
||||||
onFailed.run(new Exception("Nessuna stampante configurata: valore null"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
printerService.printCollo(
|
Call<ServiceRESTResponse<Object>> callable = null;
|
||||||
printerName,
|
if (printerType != null)
|
||||||
testataColloToPrint.getDataColloS(),
|
callable = printerService.printCollo(printerType.toString(), testataColloToPrint);
|
||||||
testataColloToPrint.getGestione(),
|
else
|
||||||
testataColloToPrint.getSerCollo(),
|
callable = printerService.printCollo(testataColloToPrint);
|
||||||
testataColloToPrint.getNumCollo(),
|
|
||||||
quantity,
|
|
||||||
reportName)
|
|
||||||
|
|
||||||
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
callable.enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
analyzeAnswer(response, "printCollo", data -> {
|
analyzeAnswer(response, "printCollo", data -> {
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||||
if(t.getMessage().contains("Printer not found")) {
|
if (t.getMessage().contains("Printer not found")) {
|
||||||
onFailed.run(new NoPrintersFoundException());
|
onFailed.run(new NoPrintersFoundException());
|
||||||
} else onFailed.run(new Exception(t));
|
} else onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void printReport(String printerName, String reportName, HashMap<String, Object> params, int quantity, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void printReport(String printerName, String reportName, HashMap<String, Object> params, int quantity, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
// if(BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
// onComplete.run();
|
onComplete.run();
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
JasperDTO jasperDTO = new JasperDTO();
|
JasperDTO jasperDTO = new JasperDTO();
|
||||||
jasperDTO.setReportName(reportName);
|
jasperDTO.setReportName(reportName);
|
||||||
@@ -165,7 +102,7 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
printerService
|
printerService
|
||||||
.processPrintReport(printerName, quantity, jasperDTO)
|
.processPrintReport(printerName, quantity, jasperDTO)
|
||||||
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
.enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
analyzeAnswer(response, "printReport", data -> {
|
analyzeAnswer(response, "printReport", data -> {
|
||||||
@@ -175,11 +112,11 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||||
if(t.getMessage().contains("Printer not found")) {
|
if (t.getMessage().contains("Printer not found")) {
|
||||||
onFailed.run(new NoPrintersFoundException());
|
onFailed.run(new NoPrintersFoundException());
|
||||||
} else onFailed.run(new Exception(t));
|
} else onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,20 +2,16 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.http.Body;
|
import retrofit2.http.Body;
|
||||||
import retrofit2.http.Field;
|
|
||||||
import retrofit2.http.FormUrlEncoded;
|
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
import retrofit2.http.Query;
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
public interface PrinterRESTConsumerService {
|
public interface PrinterRESTConsumerService {
|
||||||
|
|
||||||
@POST("getAvailablePrinters")
|
|
||||||
Call<ServiceRESTResponse<List<String>>> getAvailablePrinters();
|
|
||||||
|
|
||||||
@POST("getAvailablePrinters")
|
@POST("getAvailablePrinters")
|
||||||
Call<ServiceRESTResponse<List<String>>> getAvailablePrinters(@Query("codMdep") String codMdep);
|
Call<ServiceRESTResponse<List<String>>> getAvailablePrinters(@Query("codMdep") String codMdep);
|
||||||
|
|
||||||
@@ -23,19 +19,6 @@ public interface PrinterRESTConsumerService {
|
|||||||
Call<ServiceRESTResponse<List<String>>> getAvailablePrinters(@Query("codMdep") String codMdep, @Query("printerType") String printerType);
|
Call<ServiceRESTResponse<List<String>>> getAvailablePrinters(@Query("codMdep") String codMdep, @Query("printerType") String printerType);
|
||||||
|
|
||||||
|
|
||||||
@POST("pkgPrintLabel")
|
|
||||||
@FormUrlEncoded
|
|
||||||
Call<ServiceRESTResponse<Object>> printCollo(
|
|
||||||
@Query("printerName") String printerName,
|
|
||||||
@Field("dataCollo") String dataCollo,
|
|
||||||
@Field("gestione") String gestione,
|
|
||||||
@Field("serCollo") String serCollo,
|
|
||||||
@Field("numCollo") int numCollo,
|
|
||||||
@Query("printQuantity") int printQuantity,
|
|
||||||
@Query("reportName") String reportName
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
@POST("processPrintReport")
|
@POST("processPrintReport")
|
||||||
Call<ServiceRESTResponse<Object>> processPrintReport(
|
Call<ServiceRESTResponse<Object>> processPrintReport(
|
||||||
@Query("printerName") String printerName,
|
@Query("printerName") String printerName,
|
||||||
@@ -43,4 +26,16 @@ public interface PrinterRESTConsumerService {
|
|||||||
@Body JasperDTO jasperDTO
|
@Body JasperDTO jasperDTO
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@POST("wms/printEtichettaSSCC")
|
||||||
|
Call<ServiceRESTResponse<Object>> printCollo(
|
||||||
|
@Query("printerType") String printerType,
|
||||||
|
@Body MtbColt mtbColtToPrint
|
||||||
|
);
|
||||||
|
|
||||||
|
@POST("wms/printEtichettaSSCC")
|
||||||
|
Call<ServiceRESTResponse<Object>> printCollo(
|
||||||
|
@Body MtbColt mtbColtToPrint
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,27 +42,19 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
nativeSqlDTO.nativeSql = nativeSql;
|
nativeSqlDTO.nativeSql = nativeSql;
|
||||||
|
|
||||||
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||||
service.processSql(nativeSqlDTO).enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
service.processSql(nativeSqlDTO).enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
analyzeAnswer(response, "ProcessSql", new ISimpleOperationCallback<Object>() {
|
analyzeAnswer(response, "ProcessSql", o -> {
|
||||||
@Override
|
Gson gson = new Gson();
|
||||||
public void onSuccess(Object value) {
|
String json = gson.toJson(o);
|
||||||
Gson gson = new Gson();
|
|
||||||
String json = gson.toJson(value);
|
|
||||||
|
|
||||||
InputStream ims = new ByteArrayInputStream(json.getBytes());
|
InputStream ims = new ByteArrayInputStream(json.getBytes());
|
||||||
Reader reader = new InputStreamReader(ims);
|
Reader reader = new InputStreamReader(ims);
|
||||||
T gsonObj = gson.fromJson(reader, clazz);
|
T gsonObj = gson.fromJson(reader, clazz);
|
||||||
|
|
||||||
onComplete.run(gsonObj);
|
onComplete.run(gsonObj);
|
||||||
}
|
}, onFailed);
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
if(onFailed != null) onFailed.run(ex);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -73,6 +65,7 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> void processSqlStatic(String nativeSql, final Type clazz, final ISimpleOperationCallback<T> callback) {
|
public static <T> void processSqlStatic(String nativeSql, final Type clazz, final ISimpleOperationCallback<T> callback) {
|
||||||
|
|
||||||
processSqlStatic(nativeSql, clazz, data -> {
|
processSqlStatic(nativeSql, clazz, data -> {
|
||||||
@@ -86,19 +79,19 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void getAvailableProfiles(final ISimpleOperationCallback<List<String>> callback){
|
public static void getAvailableProfiles(final RunnableArgs<List<String>> onSuccess, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||||
service.getAvailableProfiles(SettingsManager.i().getUser().getUsername(), SettingsManager.i().getUser().getPassword()).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
service.getAvailableProfiles(SettingsManager.i().getUser().getUsername(), SettingsManager.i().getUser().getPassword()).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
||||||
analyzeAnswer(response, "ProfilesAvailable", callback);
|
analyzeAnswer(response, "ProfilesAvailable", onSuccess, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, final Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, final Throwable t) {
|
||||||
Log.e("ProfilesAvailable", t.toString());
|
Log.e("ProfilesAvailable", t.toString());
|
||||||
callback.onFailed(new Exception(t));
|
onFailed.run(new Exception(t));
|
||||||
UtilityLogger.errorMe(new Exception(t));
|
UtilityLogger.errorMe(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -107,23 +100,19 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void getAvailableCodMdeps(final RunnableArgs<List<AvailableCodMdepsDTO>> onSuccess, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
|
||||||
public static void getAvailableCodMdeps(final ISimpleOperationCallback<List<AvailableCodMdepsDTO>> callback){
|
|
||||||
|
|
||||||
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||||
service.getAvailableCodMdeps().enqueue(new Callback<ServiceRESTResponse<List<AvailableCodMdepsDTO>>>() {
|
service.getAvailableCodMdeps().enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> call, Response<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> call, Response<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> response) {
|
||||||
analyzeAnswer(response, "CodMdepsAvailable", callback);
|
analyzeAnswer(response, "CodMdepsAvailable", onSuccess, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> call, final Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> call, final Throwable t) {
|
||||||
Log.e("CodMdepsAvailable", t.toString());
|
Log.e("CodMdepsAvailable", t.toString());
|
||||||
callback.onFailed(new Exception(t));
|
onFailed.run(new Exception(t));
|
||||||
// UtilityLogger.errorMe(new Exception(t));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -139,7 +128,7 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
String currentAzienda = UtilityString.isNullOrEmpty(SettingsManager.i().getUserSession().getProfileDB()) ? "" : " [" + SettingsManager.i().getUserSession().getProfileDB() + "]";
|
String currentAzienda = UtilityString.isNullOrEmpty(SettingsManager.i().getUserSession().getProfileDB()) ? "" : " [" + SettingsManager.i().getUserSession().getProfileDB() + "]";
|
||||||
|
|
||||||
String dest = "";
|
String dest = "";
|
||||||
if(BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
dest = TextUtils.join(";", CommonConst.Mail.forErrorsDebug);
|
dest = TextUtils.join(";", CommonConst.Mail.forErrorsDebug);
|
||||||
} else {
|
} else {
|
||||||
dest = TextUtils.join(";", CommonConst.Mail.forErrors);
|
dest = TextUtils.join(";", CommonConst.Mail.forErrors);
|
||||||
@@ -155,10 +144,10 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.setHtml(true);
|
.setHtml(true);
|
||||||
|
|
||||||
sendMail(mailDTO, () -> {
|
sendMail(mailDTO, () -> {
|
||||||
if(onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
Log.e(SystemRESTConsumer.class.getName(), "", ex);
|
Log.e(SystemRESTConsumer.class.getName(), "", ex);
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,12 +158,12 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
service.sendMail(mailDTO).enqueue(new Callback<ServiceRESTResponse<String>>() {
|
service.sendMail(mailDTO).enqueue(new Callback<ServiceRESTResponse<String>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<String>> call, Response<ServiceRESTResponse<String>> response) {
|
public void onResponse(Call<ServiceRESTResponse<String>> call, Response<ServiceRESTResponse<String>> response) {
|
||||||
if(onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<String>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<String>> call, Throwable t) {
|
||||||
if(onFailed != null) {
|
if (onFailed != null) {
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -182,21 +171,21 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void getAzienda(RunnableArgs<Azienda> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void getAzienda(RunnableArgs<Azienda> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
String sql = "SELECT TOP 1 * FROM azienda";
|
String sql = "SELECT TOP 1 * FROM azienda";
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<Azienda>>() {}.getType();
|
Type typeOfObjectsList = new TypeToken<ArrayList<Azienda>>() {
|
||||||
|
}.getType();
|
||||||
SystemRESTConsumer.processSqlStatic(sql, typeOfObjectsList, new ISimpleOperationCallback<List<Azienda>>() {
|
SystemRESTConsumer.processSqlStatic(sql, typeOfObjectsList, new ISimpleOperationCallback<List<Azienda>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<Azienda> value) {
|
public void onSuccess(List<Azienda> value) {
|
||||||
if(onComplete != null) onComplete.run(value.get(0));
|
if (onComplete != null) onComplete.run(value.get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(Exception ex) {
|
public void onFailed(Exception ex) {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -14,96 +14,78 @@ import retrofit2.Response;
|
|||||||
|
|
||||||
public class _BaseRESTConsumer {
|
public class _BaseRESTConsumer {
|
||||||
|
|
||||||
|
public static <T> void analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle, RunnableArgs<T> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
public static <T> void analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle, final ISimpleOperationCallback<T> callback) {
|
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
if (response.body() != null) {
|
if (response.body() != null) {
|
||||||
if (response.body().getEsito() == EsitoType.OK) {
|
if (response.body().getEsito() == EsitoType.OK) {
|
||||||
if (!UtilityString.isNullOrEmpty(response.body().getErrorMessage())) {
|
if (!UtilityString.isNullOrEmpty(response.body().getErrorMessage())) {
|
||||||
callback.onFailed(new Exception(response.body().getErrorMessage()));
|
onFailed.run(new Exception(response.body().getErrorMessage()));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
T dataObj = response.body().getDto() != null ?
|
T dataObj = response.body().getDto() != null ?
|
||||||
response.body().getDto() :
|
response.body().getDto() :
|
||||||
response.body().getEntity();
|
response.body().getEntity();
|
||||||
|
|
||||||
callback.onSuccess(dataObj);
|
onComplete.run(dataObj);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.e(logTitle, response.body().getErrorMessage());
|
Log.e(logTitle, response.body().getErrorMessage());
|
||||||
// callback.onFailed(new Exception(response.body().getErrorMessage()));
|
// callback.onFailed(new Exception(response.body().getErrorMessage()));
|
||||||
callback.onFailed(CommonRESTException.tryRecognizeException(response.body().getErrorMessage()));
|
onFailed.run(CommonRESTException.tryRecognizeException(response.body().getErrorMessage()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.e(logTitle, response.message());
|
Log.e(logTitle, response.message());
|
||||||
callback.onFailed(new Exception(response.message()));
|
onFailed.run(new Exception(response.message()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
if (response.code() == 404) {
|
||||||
callback.onFailed(new Exception("Status " + response.code() + ": " + response.message()));
|
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 + ")"));
|
||||||
}
|
|
||||||
|
|
||||||
public static <T> void analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle, RunnableArgs<T> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
analyzeAnswer(response, logTitle, new ISimpleOperationCallback<T>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(T value) {
|
|
||||||
onComplete.run(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
onFailed.run(ex);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static <T> void analyzeAnswerList(Response<ServiceRESTResponse<T>> response, String logTitle, final ISimpleOperationCallback<List<T>> callback) {
|
|
||||||
if (response.isSuccessful()) {
|
|
||||||
if (response.body() != null) {
|
|
||||||
if (response.body().getEsito() == EsitoType.OK) {
|
|
||||||
if (!UtilityString.isNullOrEmpty(response.body().getErrorMessage())) {
|
|
||||||
callback.onFailed(new Exception(response.body().getErrorMessage()));
|
|
||||||
} else {
|
|
||||||
|
|
||||||
List<T> dataObj = response.body().getEntityList();
|
|
||||||
|
|
||||||
callback.onSuccess(dataObj);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.e(logTitle, response.body().getErrorMessage());
|
|
||||||
callback.onFailed(new Exception(response.body().getErrorMessage()));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Log.e(logTitle, response.message());
|
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
||||||
callback.onFailed(new Exception(response.message()));
|
onFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
|
||||||
callback.onFailed(new Exception("Status " + response.code() + ": " + response.message()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> void analyzeAnswerList(Response<ServiceRESTResponse<T>> response, String logTitle, RunnableArgs<List<T>> onComplete, RunnableArgs<Exception> onFailed) {
|
public static <T> void analyzeAnswerList(Response<ServiceRESTResponse<T>> response, String logTitle, RunnableArgs<List<T>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
analyzeAnswerList(response, logTitle, new ISimpleOperationCallback<List<T>>() {
|
if (response.isSuccessful()) {
|
||||||
@Override
|
if (response.body() != null) {
|
||||||
public void onSuccess(List<T> value) {
|
if (response.body().getEsito() == EsitoType.OK) {
|
||||||
onComplete.run(value);
|
if (!UtilityString.isNullOrEmpty(response.body().getErrorMessage())) {
|
||||||
}
|
onFailed.run(new Exception(response.body().getErrorMessage()));
|
||||||
|
} else {
|
||||||
|
|
||||||
@Override
|
List<T> dataObj = response.body().getEntityList();
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
onFailed.run(ex);
|
onComplete.run(dataObj);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.e(logTitle, response.body().getErrorMessage());
|
||||||
|
onFailed.run(new Exception(response.body().getErrorMessage()));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.e(logTitle, response.message());
|
||||||
|
onFailed.run(new Exception(response.message()));
|
||||||
}
|
}
|
||||||
});
|
} else {
|
||||||
|
if (response.code() == 404) {
|
||||||
|
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata");
|
||||||
|
onFailed.run(new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")"));
|
||||||
|
} else {
|
||||||
|
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
||||||
|
onFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> void analyzeListOfAnswers(Response<List<ServiceRESTResponse<T>>> responseList, String logTitle, RunnableArgs<List<T>> onComplete, RunnableArgs<Exception> onFailed) {
|
public static <T> void analyzeListOfAnswers(Response<List<ServiceRESTResponse<T>>> responseList, String logTitle, RunnableArgs<List<T>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
if (responseList.isSuccessful()) {
|
if (responseList.isSuccessful()) {
|
||||||
if (responseList.body() != null) {
|
if (responseList.body() != null) {
|
||||||
List<T> analyzedList = new ArrayList<>();
|
List<T> analyzedList = new ArrayList<>();
|
||||||
for (ServiceRESTResponse<T> response : responseList.body()){
|
for (ServiceRESTResponse<T> response : responseList.body()) {
|
||||||
if (response.getEsito() == EsitoType.OK) {
|
if (response.getEsito() == EsitoType.OK) {
|
||||||
if (!UtilityString.isNullOrEmpty(response.getErrorMessage())) {
|
if (!UtilityString.isNullOrEmpty(response.getErrorMessage())) {
|
||||||
onFailed.run(new Exception(response.getErrorMessage()));
|
onFailed.run(new Exception(response.getErrorMessage()));
|
||||||
@@ -111,7 +93,7 @@ public class _BaseRESTConsumer {
|
|||||||
T dataObj = response.getDto() != null ?
|
T dataObj = response.getDto() != null ?
|
||||||
response.getDto() :
|
response.getDto() :
|
||||||
response.getEntity();
|
response.getEntity();
|
||||||
if (dataObj !=null ) analyzedList.add(dataObj);
|
if (dataObj != null) analyzedList.add(dataObj);
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -126,8 +108,13 @@ public class _BaseRESTConsumer {
|
|||||||
onFailed.run(new Exception(responseList.message()));
|
onFailed.run(new Exception(responseList.message()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.e(logTitle, "Status " + responseList.code() + ": " + responseList.message());
|
if (responseList.code() == 404) {
|
||||||
onFailed.run(new Exception("Status " + responseList.code() + ": " + responseList.message()));
|
Log.e(logTitle, "Errore " + responseList.code() + ": risorsa non trovata");
|
||||||
|
onFailed.run(new Exception("Errore " + responseList.code() + ": risorsa non trovata (" + logTitle + ")"));
|
||||||
|
} else {
|
||||||
|
Log.e(logTitle, "Status " + responseList.code() + ": " + responseList.message());
|
||||||
|
onFailed.run(new Exception("Status " + responseList.code() + ": " + responseList.message()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import java.lang.reflect.Type;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
|
||||||
public class DateDeserializer implements JsonDeserializer<Date> {
|
public class DateDeserializer implements JsonDeserializer<Date> {
|
||||||
|
|
||||||
@@ -16,6 +17,8 @@ public class DateDeserializer implements JsonDeserializer<Date> {
|
|||||||
public Date deserialize(JsonElement element, Type arg1, JsonDeserializationContext arg2) throws JsonParseException {
|
public Date deserialize(JsonElement element, Type arg1, JsonDeserializationContext arg2) throws JsonParseException {
|
||||||
String date = element.getAsString();
|
String date = element.getAsString();
|
||||||
|
|
||||||
|
if (UtilityString.isNullOrEmpty(date)) return null;
|
||||||
|
|
||||||
return UtilityDate.recognizeDateWithExceptionHandler(date);
|
return UtilityDate.recognizeDateWithExceptionHandler(date);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.rest.model;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
@@ -43,9 +44,7 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
|||||||
private boolean flagEvaso;
|
private boolean flagEvaso;
|
||||||
private String nomeAgente;
|
private String nomeAgente;
|
||||||
private String codJfas;
|
private String codJfas;
|
||||||
|
private List<AvailableClassMerc> availableClassMerc;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Integer getIdViaggio() {
|
public Integer getIdViaggio() {
|
||||||
return idViaggio;
|
return idViaggio;
|
||||||
@@ -363,6 +362,16 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<AvailableClassMerc> getAvailableClassMerc() {
|
||||||
|
return availableClassMerc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrdineUscitaInevasoDTO setAvailableClassMerc(List<AvailableClassMerc> availableClassMerc) {
|
||||||
|
this.availableClassMerc = availableClassMerc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) return true;
|
||||||
@@ -382,4 +391,28 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
|||||||
result = 31 * result + getGestione().hashCode();
|
result = 31 * result + getGestione().hashCode();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class AvailableClassMerc {
|
||||||
|
|
||||||
|
private String codMgrp;
|
||||||
|
private List<String> codMsgr;
|
||||||
|
|
||||||
|
public String getCodMgrp() {
|
||||||
|
return codMgrp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AvailableClassMerc setCodMgrp(String codMgrp) {
|
||||||
|
this.codMgrp = codMgrp;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getCodMsgr() {
|
||||||
|
return codMsgr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AvailableClassMerc setCodMsgr(List<String> codMsgr) {
|
||||||
|
this.codMsgr = codMsgr;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
|
||||||
|
public class SpostaArtsTraULRequestDTO {
|
||||||
|
|
||||||
|
|
||||||
|
private MtbColt sourceMtbColt;
|
||||||
|
|
||||||
|
private MtbColt destinationMtbColt;
|
||||||
|
|
||||||
|
public MtbColt getSourceMtbColt() {
|
||||||
|
return sourceMtbColt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SpostaArtsTraULRequestDTO setSourceMtbColt(MtbColt sourceMtbColt) {
|
||||||
|
this.sourceMtbColt = sourceMtbColt;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt getDestinationMtbColt() {
|
||||||
|
return destinationMtbColt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SpostaArtsTraULRequestDTO setDestinationMtbColt(MtbColt destinationMtbColt) {
|
||||||
|
this.destinationMtbColt = destinationMtbColt;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.serializer;
|
||||||
|
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
import com.google.gson.JsonPrimitive;
|
||||||
|
import com.google.gson.JsonSerializationContext;
|
||||||
|
import com.google.gson.JsonSerializer;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
|
||||||
|
public class DateSerializer implements JsonSerializer<Date> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JsonElement serialize(Date src, Type typeOfSrc, JsonSerializationContext context) {
|
||||||
|
String dateString = UtilityDate.formatDate(src, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH);
|
||||||
|
|
||||||
|
return src == null ? null : new JsonPrimitive(dateString);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,6 +36,7 @@ public class DBSettingsModel {
|
|||||||
private boolean flagSpedizioneUseQtaOrd;
|
private boolean flagSpedizioneUseQtaOrd;
|
||||||
private String produzioneDefaultCodAnag;
|
private String produzioneDefaultCodAnag;
|
||||||
private String reportNameSpedizionChiudiOrdine;
|
private String reportNameSpedizionChiudiOrdine;
|
||||||
|
private int onNumCnfInputChanged = 1;
|
||||||
|
|
||||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||||
return flagSpedizioneEnableFakeGiacenza;
|
return flagSpedizioneEnableFakeGiacenza;
|
||||||
@@ -261,4 +262,13 @@ public class DBSettingsModel {
|
|||||||
this.reportNameSpedizionChiudiOrdine = reportNameSpedizionChiudiOrdine;
|
this.reportNameSpedizionChiudiOrdine = reportNameSpedizionChiudiOrdine;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getOnNumCnfInputChanged() {
|
||||||
|
return onNumCnfInputChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setOnNumCnfInputChanged(int onNumCnfInputChanged) {
|
||||||
|
this.onNumCnfInputChanged = onNumCnfInputChanged;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import it.integry.integrywmsnative.R;
|
|||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.StbGestSetup;
|
import it.integry.integrywmsnative.core.model.StbGestSetup;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ISimpleOperationCallback;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||||
@@ -30,12 +29,12 @@ public class SettingsManager {
|
|||||||
|
|
||||||
private static Context mContext;
|
private static Context mContext;
|
||||||
|
|
||||||
public static void init(Context context){
|
public static void init(Context context) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
|
|
||||||
settingsModelIstance = (SettingsModel) Stash.getObject(TAG, SettingsModel.class);
|
settingsModelIstance = (SettingsModel) Stash.getObject(TAG, SettingsModel.class);
|
||||||
|
|
||||||
if(settingsModelIstance == null) {
|
if (settingsModelIstance == null) {
|
||||||
settingsModelIstance = new SettingsModel();
|
settingsModelIstance = new SettingsModel();
|
||||||
|
|
||||||
settingsModelIstance.setServer(new SettingsModel.Server());
|
settingsModelIstance.setServer(new SettingsModel.Server());
|
||||||
@@ -49,31 +48,28 @@ public class SettingsManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SettingsModel i(){
|
public static SettingsModel i() {
|
||||||
return settingsModelIstance;
|
return settingsModelIstance;
|
||||||
}
|
}
|
||||||
public static DBSettingsModel iDB(){
|
|
||||||
|
public static DBSettingsModel iDB() {
|
||||||
return dbSettingsModelIstance;
|
return dbSettingsModelIstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isFirstStart(){
|
public static boolean isFirstStart() {
|
||||||
return firstStart;
|
return firstStart;
|
||||||
}
|
}
|
||||||
public static boolean isInstanceAvailable(){
|
|
||||||
|
public static boolean isInstanceAvailable() {
|
||||||
return i() != null;
|
return i() != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void update(){
|
public static void update() {
|
||||||
Stash.put(TAG, settingsModelIstance);
|
Stash.put(TAG, settingsModelIstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void loadDBVariables(RunnableArgs<String> onProgress, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void loadDBVariables(Runnable onComplete, RunnableArgs<Exception> onFailed){
|
|
||||||
dbSettingsModelIstance = new DBSettingsModel();
|
dbSettingsModelIstance = new DBSettingsModel();
|
||||||
|
|
||||||
Trace perfTrace = UtilityFirebase.getNewPerformanceTrace("db_load_vars");
|
Trace perfTrace = UtilityFirebase.getNewPerformanceTrace("db_load_vars");
|
||||||
@@ -86,90 +82,93 @@ public class SettingsManager {
|
|||||||
|
|
||||||
RunnableArgs<Exception> tmpOnFailed = ex -> {
|
RunnableArgs<Exception> tmpOnFailed = ex -> {
|
||||||
perfTrace.putAttribute("failed", "true");
|
perfTrace.putAttribute("failed", "true");
|
||||||
if(!(ex instanceof SocketTimeoutException)) onFailed.run(ex);
|
if (!(ex instanceof SocketTimeoutException)) onFailed.run(ex);
|
||||||
else onFailed.run(new Exception("Errore durante il caricamento dei dati. Riavviare l'applicazione!"));
|
else
|
||||||
|
onFailed.run(new Exception("Errore durante il caricamento dei dati. Riavviare l'applicazione!"));
|
||||||
};
|
};
|
||||||
|
|
||||||
loadDatiAzienda(() ->
|
onProgress.run("dati azienda");
|
||||||
loadAvailableProfiles(() ->
|
loadDatiAzienda(() -> {
|
||||||
loadAvailableCodMdeps(() ->
|
|
||||||
loadAvailablePosizioni(() ->
|
onProgress.run("profili");
|
||||||
loadGestSetupValues(tmpOnComplete, tmpOnFailed) ,tmpOnFailed), tmpOnFailed), tmpOnFailed), tmpOnFailed);
|
loadAvailableProfiles(() -> {
|
||||||
|
|
||||||
|
onProgress.run("depositi");
|
||||||
|
loadAvailableCodMdeps(() -> {
|
||||||
|
|
||||||
|
onProgress.run("posizioni");
|
||||||
|
loadAvailablePosizioni(() -> {
|
||||||
|
|
||||||
|
onProgress.run("impostazioni");
|
||||||
|
loadGestSetupValues(tmpOnComplete, tmpOnFailed);
|
||||||
|
}, tmpOnFailed);
|
||||||
|
}, tmpOnFailed);
|
||||||
|
}, tmpOnFailed);
|
||||||
|
}, tmpOnFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void loadDatiAzienda(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
private static void loadDatiAzienda(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
SystemRESTConsumer.getAzienda(datiAzienda -> {
|
SystemRESTConsumer.getAzienda(datiAzienda -> {
|
||||||
SettingsManager.iDB().setDatiAzienda(datiAzienda);
|
SettingsManager.iDB().setDatiAzienda(datiAzienda);
|
||||||
|
|
||||||
if(onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void loadAvailableProfiles(Runnable onComplete, RunnableArgs<Exception> onFailed){
|
private static void loadAvailableProfiles(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
SystemRESTConsumer.getAvailableProfiles(new ISimpleOperationCallback<List<String>>() {
|
SystemRESTConsumer.getAvailableProfiles(availableProfiles -> {
|
||||||
@Override
|
dbSettingsModelIstance.setAvailableProfiles(availableProfiles);
|
||||||
public void onSuccess(List<String> availableProfiles) {
|
|
||||||
dbSettingsModelIstance.setAvailableProfiles(availableProfiles);
|
|
||||||
|
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
|
|
||||||
}
|
}, ex -> {
|
||||||
|
//BOH
|
||||||
@Override
|
if (onFailed != null) onFailed.run(ex);
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
//BOH
|
|
||||||
if(onFailed != null) onFailed.run(ex);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void loadAvailableCodMdeps(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
private static void loadAvailableCodMdeps(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
SystemRESTConsumer.getAvailableCodMdeps(new ISimpleOperationCallback<List<AvailableCodMdepsDTO>>() {
|
SystemRESTConsumer.getAvailableCodMdeps(availableCodMdeps -> {
|
||||||
@Override
|
dbSettingsModelIstance.setAvailableCodMdep(availableCodMdeps);
|
||||||
public void onSuccess(List<AvailableCodMdepsDTO> availableCodMdeps) {
|
|
||||||
dbSettingsModelIstance.setAvailableCodMdep(availableCodMdeps);
|
|
||||||
|
|
||||||
if(availableCodMdeps == null || availableCodMdeps.size() == 0) {
|
if (availableCodMdeps == null || availableCodMdeps.size() == 0) {
|
||||||
onFailed.run(new Exception(mContext.getText(R.string.no_codmdep_available).toString()));
|
onFailed.run(new Exception(mContext.getText(R.string.no_codmdep_available).toString()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean codMdepExistsAnymore = false;
|
boolean codMdepExistsAnymore = false;
|
||||||
|
|
||||||
if(settingsModelIstance.getUserSession().getDepo() != null){
|
if (settingsModelIstance.getUserSession().getDepo() != null) {
|
||||||
for(AvailableCodMdepsDTO availableCodMdepDTO : availableCodMdeps){
|
for (AvailableCodMdepsDTO availableCodMdepDTO : availableCodMdeps) {
|
||||||
//Controllo se il codMdep salvato esiste ancora
|
//Controllo se il codMdep salvato esiste ancora
|
||||||
if(availableCodMdepDTO.getCodMdep().equalsIgnoreCase(settingsModelIstance.getUserSession().getDepo().getCodMdep())) {
|
if (availableCodMdepDTO.getCodMdep().equalsIgnoreCase(settingsModelIstance.getUserSession().getDepo().getCodMdep())) {
|
||||||
codMdepExistsAnymore = true;
|
codMdepExistsAnymore = true;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!codMdepExistsAnymore){
|
|
||||||
settingsModelIstance.getUserSession().setDepo(availableCodMdeps.get(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(onComplete != null) onComplete.run();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
if (!codMdepExistsAnymore) {
|
||||||
public void onFailed(Exception ex) {
|
settingsModelIstance.getUserSession().setDepo(availableCodMdeps.get(0));
|
||||||
//BOH
|
|
||||||
if(onFailed != null) onFailed.run(ex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (onComplete != null) onComplete.run();
|
||||||
|
}, ex -> {
|
||||||
|
//BOH
|
||||||
|
if (onFailed != null) onFailed.run(ex);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void loadAvailablePosizioni(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
private static void loadAvailablePosizioni(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
PosizioniRESTConsumer.getAvailablePosizioni(availablePosizioni -> {
|
PosizioniRESTConsumer.getAvailablePosizioni(availablePosizioni -> {
|
||||||
dbSettingsModelIstance.setAvailablePosizioni(availablePosizioni);
|
dbSettingsModelIstance.setAvailablePosizioni(availablePosizioni);
|
||||||
|
|
||||||
if(onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,20 +261,24 @@ public class SettingsManager {
|
|||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("SPEDIZIONE")
|
.setSection("SPEDIZIONE")
|
||||||
.setKeySection("FLAG_USE_QTA_ORD"));
|
.setKeySection("FLAG_USE_QTA_ORD"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PICKING")
|
||||||
|
.setSection("SETUP")
|
||||||
|
.setKeySection("ON_NUM_CNF_INPUT_CHANGED"));
|
||||||
|
|
||||||
|
|
||||||
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
|
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
|
||||||
dbSettingsModelIstance.setDefaultCausaleRettificaGiacenze(getValueFromList(list, "SETUP", "DEFAULT_CAUSALE_RETTIFICA_GIACENZE", String.class));
|
dbSettingsModelIstance.setDefaultCausaleRettificaGiacenze(getValueFromList(list, "SETUP", "DEFAULT_CAUSALE_RETTIFICA_GIACENZE", String.class));
|
||||||
dbSettingsModelIstance.setEnableCheckPartitaMagCheckPickingV(getValueFromList(list, "SETUP","ENABLE_CHECK_PARTITA_MAG_PICKING_V", Boolean.class));
|
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.setFlagMultiClienteOrdV(getValueFromList(list, "SETUP", "FLAG_MULTI_CLIENTE_ORD_VENDITA", Boolean.class));
|
||||||
dbSettingsModelIstance.setDefaultCodAnag(getValueFromList(list, "SETUP","COD_ANAG_DEFAULT", String.class));
|
dbSettingsModelIstance.setDefaultCodAnag(getValueFromList(list, "SETUP", "COD_ANAG_DEFAULT", String.class));
|
||||||
dbSettingsModelIstance.setDefaultCriterioDistribuzione(getValueFromList(list, "SETUP","DEFAULT_CRITERIO_DISTRIBUZIONE", String.class));
|
dbSettingsModelIstance.setDefaultCriterioDistribuzione(getValueFromList(list, "SETUP", "DEFAULT_CRITERIO_DISTRIBUZIONE", String.class));
|
||||||
dbSettingsModelIstance.setFlagAskClienteInPickingLibero(getValueFromList(list, "PICKING_LIBERO", "FLAG_ASK_CLIENTE", Boolean.class));
|
dbSettingsModelIstance.setFlagAskClienteInPickingLibero(getValueFromList(list, "PICKING_LIBERO", "FLAG_ASK_CLIENTE", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagAllowEmptyClienteInPickingLibero(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_CLIENTE", Boolean.class));
|
dbSettingsModelIstance.setFlagAllowEmptyClienteInPickingLibero(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_CLIENTE", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagCanAddExtraItemSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_ADD_EXTRA_ITEMS", Boolean.class));
|
dbSettingsModelIstance.setFlagCanAddExtraItemSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_ADD_EXTRA_ITEMS", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagCanAutoOpenNewULAccettazione(getValueFromList(list, "ACCETTAZIONE", "FLAG_AUTO_OPEN_NEW_UL", Boolean.class));
|
dbSettingsModelIstance.setFlagCanAutoOpenNewULAccettazione(getValueFromList(list, "ACCETTAZIONE", "FLAG_AUTO_OPEN_NEW_UL", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagCanAddExtraQuantitySpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_ADD_EXTRA_QUANTITY", Boolean.class));
|
dbSettingsModelIstance.setFlagCanAddExtraQuantitySpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_ADD_EXTRA_QUANTITY", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagEnableCheckDepositoSpedizione(getValueFromList(list,"SPEDIZIONE", "ENABLE_CHECK_DEPOSITO", Boolean.class));
|
dbSettingsModelIstance.setFlagEnableCheckDepositoSpedizione(getValueFromList(list, "SPEDIZIONE", "ENABLE_CHECK_DEPOSITO", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagForceAllToColli(getValueFromList(list, "SETUP", "FLAG_FORCE_ALL_TO_COLLI", 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.setFlagAskPesoColloSpedizione(getValueFromList(list, "SETUP", "FLAG_ASK_PESO_COLLO", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagUseNewPickingListSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_USE_NEW_PICKING_LIST", Boolean.class));
|
dbSettingsModelIstance.setFlagUseNewPickingListSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_USE_NEW_PICKING_LIST", Boolean.class));
|
||||||
@@ -287,22 +290,29 @@ public class SettingsManager {
|
|||||||
dbSettingsModelIstance.setReportNameSpedizionChiudiOrdine(getValueFromList(list, "SPEDIZIONE", "REPORT_PACKING_LIST", String.class));
|
dbSettingsModelIstance.setReportNameSpedizionChiudiOrdine(getValueFromList(list, "SPEDIZIONE", "REPORT_PACKING_LIST", String.class));
|
||||||
dbSettingsModelIstance.setFlagSpedizioneUseQtaOrd(getValueFromList(list, "SPEDIZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
dbSettingsModelIstance.setFlagSpedizioneUseQtaOrd(getValueFromList(list, "SPEDIZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
||||||
|
|
||||||
if(onComplete != null) onComplete.run();
|
Integer onNumCnfInputChanged = getValueFromList(list, "SETUP", "ON_NUM_CNF_INPUT_CHANGED", Integer.class);
|
||||||
|
if (onNumCnfInputChanged != null) {
|
||||||
|
dbSettingsModelIstance.setOnNumCnfInputChanged(onNumCnfInputChanged);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (onComplete != null) onComplete.run();
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static <T>T getValueFromList(List<StbGestSetup> stbGestSetupList, String section, String keySectionName, Class<T> clazz) {
|
public static <T> T getValueFromList(List<StbGestSetup> stbGestSetupList, String section, String keySectionName, Class<T> clazz) {
|
||||||
|
|
||||||
StbGestSetup value = Stream.of(stbGestSetupList)
|
StbGestSetup value = Stream.of(stbGestSetupList)
|
||||||
.filter(x -> x.getSection().equalsIgnoreCase(section) && x.getKeySection().equalsIgnoreCase(keySectionName))
|
.filter(x -> x.getSection().equalsIgnoreCase(section) && x.getKeySection().equalsIgnoreCase(keySectionName))
|
||||||
.findFirst().get();
|
.findFirst().get();
|
||||||
|
|
||||||
if(clazz == String.class) {
|
if (clazz == String.class) {
|
||||||
return clazz.cast(value.getValue());
|
return clazz.cast(value.getValue());
|
||||||
} else if(clazz == Boolean.class) {
|
} else if (clazz == Boolean.class) {
|
||||||
return clazz.cast("S".equalsIgnoreCase(value.getValue()));
|
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;
|
} else return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package it.integry.integrywmsnative.core.utility;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.CommonConst;
|
||||||
|
|
||||||
public class UtilityBigDecimal {
|
public class UtilityBigDecimal {
|
||||||
|
|
||||||
public static boolean greaterThan(BigDecimal input, BigDecimal toCompareWith) {
|
public static boolean greaterThan(BigDecimal input, BigDecimal toCompareWith) {
|
||||||
@@ -76,7 +78,13 @@ public class UtilityBigDecimal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static BigDecimal multiply(BigDecimal input1, BigDecimal multiplier) {
|
public static BigDecimal multiply(BigDecimal input1, BigDecimal multiplier) {
|
||||||
|
if (input1 == null || multiplier == null) return null;
|
||||||
return input1.multiply(multiplier);
|
return input1.multiply(multiplier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static BigDecimal round(BigDecimal input) {
|
||||||
|
if (input == null) return null;
|
||||||
|
return input.setScale(CommonConst.Config.NUMBER_OF_DECIMAL_DIGITS, RoundingMode.HALF_EVEN);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
|
public class UtilityBoolean {
|
||||||
|
|
||||||
|
public static int toInt(boolean bool) {
|
||||||
|
return bool ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,10 +2,8 @@ package it.integry.integrywmsnative.core.utility;
|
|||||||
|
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.ZoneId;
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.TimeZone;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.exception.DateNotRecognizedException;
|
import it.integry.integrywmsnative.core.exception.DateNotRecognizedException;
|
||||||
import it.integry.integrywmsnative.core.exception.TimeNotRecognizedException;
|
import it.integry.integrywmsnative.core.exception.TimeNotRecognizedException;
|
||||||
@@ -19,9 +17,15 @@ public class UtilityDate {
|
|||||||
public static class COMMONS_DATE_FORMATS {
|
public static class COMMONS_DATE_FORMATS {
|
||||||
public static final String DMY_SLASH = "dd/MM/yyyy";
|
public static final String DMY_SLASH = "dd/MM/yyyy";
|
||||||
public static final String YMD_SLASH = "yyyy/MM/dd";
|
public static final String YMD_SLASH = "yyyy/MM/dd";
|
||||||
|
public static final String DM_SLASH = "dd/MM";
|
||||||
|
public static final String MD_SLASH = "MM/dd";
|
||||||
public static final String YMD_DASH = "yyyy-MM-dd";
|
public static final String YMD_DASH = "yyyy-MM-dd";
|
||||||
public static final String DMY_TIME_SLASH = DMY_SLASH + " HH:mm:ss";
|
public static final String DMY_TIME_SLASH = DMY_SLASH + " HH:mm:ss";
|
||||||
public static final String YMD_TIME_SLASH = YMD_SLASH + " HH:mm:ss";
|
public static final String YMD_TIME_SLASH = YMD_SLASH + " HH:mm:ss";
|
||||||
|
public static final String DM_TIME_SLASH = DM_SLASH + " HH:mm";
|
||||||
|
public static final String MD_TIME_SLASH = MD_SLASH + " HH:mm";
|
||||||
|
public static final String TIME = "HH:mm";
|
||||||
|
public static final String TIME_W_SECS = "HH:mm:ss";
|
||||||
|
|
||||||
|
|
||||||
public static final String DM_HUMAN = "dd MMM";
|
public static final String DM_HUMAN = "dd MMM";
|
||||||
|
|||||||
@@ -8,6 +8,14 @@ import androidx.fragment.app.DialogFragment;
|
|||||||
|
|
||||||
public class UtilityDialog {
|
public class UtilityDialog {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void setTo60PercentWidth(Context context, DialogFragment dialog) {
|
||||||
|
int width = (int)(context.getResources().getDisplayMetrics().widthPixels*0.60);
|
||||||
|
|
||||||
|
dialog.getDialog().getWindow().setLayout(width, LinearLayout.LayoutParams.MATCH_PARENT);
|
||||||
|
}
|
||||||
|
|
||||||
public static void setTo90PercentWidth(Context context, Dialog dialog) {
|
public static void setTo90PercentWidth(Context context, Dialog dialog) {
|
||||||
int width = (int)(context.getResources().getDisplayMetrics().widthPixels*0.90);
|
int width = (int)(context.getResources().getDisplayMetrics().widthPixels*0.90);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.core.utility;
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
@@ -22,4 +23,14 @@ public class UtilityDimension {
|
|||||||
return Math.round(px);
|
return Math.round(px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static double getDisplayInchs(Activity activity) {
|
||||||
|
DisplayMetrics metrics = new DisplayMetrics();
|
||||||
|
activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||||
|
|
||||||
|
float yInches= metrics.heightPixels/metrics.ydpi;
|
||||||
|
float xInches= metrics.widthPixels/metrics.xdpi;
|
||||||
|
return Math.sqrt(xInches*xInches + yInches*yInches);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,12 @@ package it.integry.integrywmsnative.core.utility;
|
|||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.text.SpannableString;
|
import android.text.Html;
|
||||||
|
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||||
import com.orhanobut.logger.Logger;
|
import com.orhanobut.logger.Logger;
|
||||||
|
|
||||||
@@ -16,51 +17,53 @@ import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
|||||||
|
|
||||||
public class UtilityExceptions {
|
public class UtilityExceptions {
|
||||||
|
|
||||||
|
private static final Class<? extends Exception>[] FIREBASE_IGNORED_EXCEPTIONS = new Class[] {
|
||||||
|
|
||||||
public static void defaultException(Context context, Exception ex, Dialog progressDialog){
|
};
|
||||||
|
|
||||||
|
public static void defaultException(Context context, Exception ex, Dialog progressDialog) {
|
||||||
defaultException(context, ex);
|
defaultException(context, ex);
|
||||||
if(progressDialog != null) progressDialog.dismiss();
|
if (progressDialog != null) progressDialog.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void defaultException(Context context, Exception ex, Dialog progressDialog, boolean sendMail){
|
public static void defaultException(Context context, Exception ex) {
|
||||||
defaultException(context, ex, sendMail);
|
|
||||||
if(progressDialog != null) progressDialog.dismiss();
|
|
||||||
}
|
|
||||||
public static void defaultException(Context context, Exception ex){
|
|
||||||
defaultException(context, ex, false);
|
defaultException(context, ex, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void defaultException(Context context, Exception ex, boolean sendEmail){
|
public static void defaultException(Context context, Exception ex, boolean sendEmail) {
|
||||||
|
|
||||||
if(ex.getMessage() != null) {
|
if (ex.getMessage() != null) {
|
||||||
Logger.e(ex, ex.getMessage());
|
Logger.e(ex, Html.fromHtml(ex.getMessage()).toString());
|
||||||
} else {
|
} else {
|
||||||
Logger.e(ex, "Errore");
|
Logger.e(ex, "Errore");
|
||||||
}
|
}
|
||||||
|
|
||||||
String errorMessage = CommonRESTException.tryRecognizeThenGetMessage(ex);
|
String errorMessage = CommonRESTException.tryRecognizeThenGetMessage(ex);
|
||||||
|
|
||||||
if(errorMessage == null) {
|
if (errorMessage == null) {
|
||||||
errorMessage = ex.getMessage();
|
errorMessage = ex.getMessage();
|
||||||
|
|
||||||
if(ex.getCause() != null) errorMessage += "<br />" + ex.getCause().getMessage();
|
if (ex.getCause() != null) errorMessage += "<br />" + ex.getCause().getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
FragmentManager fm = null;
|
FragmentManager fm = null;
|
||||||
|
|
||||||
if(context != null && context instanceof FragmentActivity) {
|
if (context instanceof FragmentActivity) {
|
||||||
fm = ((FragmentActivity) context).getSupportFragmentManager();
|
fm = ((FragmentActivity) context).getSupportFragmentManager();
|
||||||
} else if(UtilityContext.getMainActivity() != null) {
|
} else if (UtilityContext.getMainActivity() != null) {
|
||||||
fm = UtilityContext.getMainActivity().getSupportFragmentManager();
|
fm = UtilityContext.getMainActivity().getSupportFragmentManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fm != null) {
|
if (fm != null) {
|
||||||
DialogSimpleMessageView.makeErrorDialog(new SpannableString(errorMessage), null, null)
|
DialogSimpleMessageView.makeErrorDialog(Html.fromHtml(errorMessage), null, null)
|
||||||
.show(fm, "tag");
|
.show(fm, "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!BuildConfig.DEBUG) {
|
boolean toIgnore = ex.getClass().getName().startsWith("it.integry.integrywmsnative") ||
|
||||||
// if(sendEmail) UtilityLogger.errorMe(ex);
|
Stream.of(FIREBASE_IGNORED_EXCEPTIONS).anyMatch(x -> x.isAssignableFrom(ex.getClass()));
|
||||||
|
|
||||||
|
if (!BuildConfig.DEBUG && !toIgnore) {
|
||||||
|
if (sendEmail) UtilityLogger.errorMe(ex);
|
||||||
FirebaseCrashlytics.getInstance().recordException(ex);
|
FirebaseCrashlytics.getInstance().recordException(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
package it.integry.integrywmsnative.core.utility;
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.ProgressDialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.widget.ProgressBar;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogProgress;
|
import it.integry.integrywmsnative.view.dialogs.DialogProgress;
|
||||||
|
|
||||||
public class UtilityProgress {
|
public class UtilityProgress {
|
||||||
@@ -26,27 +23,4 @@ public class UtilityProgress {
|
|||||||
return progress;
|
return progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Thread makeProgressBarIndeterminate(ProgressBar progressBar) {
|
|
||||||
progressBar.setMax(100);
|
|
||||||
|
|
||||||
Thread updateProgressThread = new Thread(() -> {
|
|
||||||
|
|
||||||
try {
|
|
||||||
while (true) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
progressBar.setProgress(i);
|
|
||||||
Thread.sleep(10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
// String message = ex.toString();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
updateProgressThread.start();
|
|
||||||
|
|
||||||
return updateProgressThread;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.core.utility;
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
|
||||||
|
|
||||||
public class UtilitySettings {
|
public class UtilitySettings {
|
||||||
|
|
||||||
|
|
||||||
private static AppDatabase mAppDatabase;
|
|
||||||
|
|
||||||
public static void init(AppDatabase appDatabase) {
|
|
||||||
mAppDatabase = appDatabase;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void logout(){
|
|
||||||
SettingsManager.i().setUser(null);
|
|
||||||
SettingsManager.i().setUserSession(null);
|
|
||||||
UtilityThread.executeParallel(mAppDatabase::clearAllTables);
|
|
||||||
SettingsManager.update();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class UtilityString {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String empty2null(String stringToCheck) {
|
public static String empty2null(String stringToCheck) {
|
||||||
return (stringToCheck != null && stringToCheck.trim().length() == 0 || stringToCheck == null) ? null : stringToCheck.trim();
|
return (stringToCheck == null || stringToCheck.trim().length() == 0) ? null : stringToCheck.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String capitalizeWords(String capString){
|
public static String capitalizeWords(String capString){
|
||||||
|
|||||||
@@ -2,8 +2,17 @@ package it.integry.integrywmsnative.core.utility;
|
|||||||
|
|
||||||
public class UtilityThread {
|
public class UtilityThread {
|
||||||
|
|
||||||
public static void executeParallel(Runnable runnable) {
|
public static void executeParallel(Runnable runnable, boolean waitEnd) {
|
||||||
new Thread(runnable).start();
|
Thread t = new Thread(runnable);
|
||||||
|
t.start();
|
||||||
|
|
||||||
|
if(waitEnd) {
|
||||||
|
try {
|
||||||
|
t.join();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface MainAccettazioneComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
|
||||||
|
MainAccettazioneComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(MainAccettazioneFragment mainAccettazioneFragment);
|
||||||
|
}
|
||||||
@@ -1,20 +1,17 @@
|
|||||||
package it.integry.integrywmsnative.gest.accettazione;
|
package it.integry.integrywmsnative.gest.accettazione;
|
||||||
|
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.text.SpannableString;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import androidx.appcompat.widget.AppCompatTextView;
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.databinding.ObservableArrayList;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
@@ -23,58 +20,55 @@ import java.math.BigDecimal;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.ISearcableFragment;
|
import it.integry.integrywmsnative.core.interfaces.ISearcableFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||||
import it.integry.integrywmsnative.core.rest.CommonRESTException;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
|
||||||
import it.integry.integrywmsnative.databinding.FragmentMainAccettazioneBinding;
|
import it.integry.integrywmsnative.databinding.FragmentMainAccettazioneBinding;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.core.AccettazioneHelper;
|
import it.integry.integrywmsnative.gest.accettazione.ui.MainListAccettazioneAdapter;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.core.MainListAccettazioneAdapter;
|
import it.integry.integrywmsnative.gest.accettazione.ui.MainListAccettazioneClienteListModel;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.ui.MainListAccettazioneListModel;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.rest.OrdiniAccettazioneRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingActivity;
|
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingActivity;
|
||||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
public class MainAccettazioneFragment extends Fragment implements ISearcableFragment, ITitledFragment, IScrollableFragment {
|
public class MainAccettazioneFragment extends BaseFragment implements ISearcableFragment, ITitledFragment, IScrollableFragment, MainAccettazioneViewModel.Listener {
|
||||||
|
|
||||||
|
public BindableBoolean fabVisible = new BindableBoolean(false);
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
MainAccettazioneViewModel mViewModel;
|
||||||
|
|
||||||
private final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
private final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||||
private ElevatedToolbar mToolbar;
|
private ElevatedToolbar mToolbar;
|
||||||
|
|
||||||
private FragmentMainAccettazioneBinding mBinding;
|
private FragmentMainAccettazioneBinding mBinding;
|
||||||
|
|
||||||
private AccettazioneHelper mHelper;
|
private final ObservableArrayList<MainListAccettazioneListModel> mOrdiniInevasiMutableData = new ObservableArrayList<>();
|
||||||
private MainListAccettazioneAdapter mAdapter;
|
|
||||||
|
|
||||||
private List<OrdineAccettazioneInevasoDTO> mOriginalOrderList;
|
|
||||||
private final List<OrdineAccettazioneInevasoDTO> mRenderedOrderList = new ArrayList<>();
|
|
||||||
|
|
||||||
private AppCompatTextView mAppBarTitle;
|
private AppCompatTextView mAppBarTitle;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public MainAccettazioneFragment() {
|
public MainAccettazioneFragment() {
|
||||||
// Required empty public constructor
|
// Required empty public constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MainAccettazioneFragment newInstance() {
|
public static MainAccettazioneFragment newInstance() {
|
||||||
MainAccettazioneFragment fragment = new MainAccettazioneFragment();
|
return new MainAccettazioneFragment();
|
||||||
Bundle args = new Bundle();
|
|
||||||
fragment.setArguments(args);
|
|
||||||
return fragment;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||||
mAppBarTitle = titleText;
|
mAppBarTitle = titleText;
|
||||||
@@ -87,21 +81,34 @@ public class MainAccettazioneFragment extends Fragment implements ISearcableFrag
|
|||||||
|
|
||||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_main_accettazione, container, false);
|
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_main_accettazione, container, false);
|
||||||
|
|
||||||
init();
|
MainApplication.appComponent
|
||||||
|
.mainAccettazioneComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
|
mViewModel.setListener(this);
|
||||||
|
|
||||||
|
mBinding.setLifecycleOwner(this);
|
||||||
mBinding.setView(this);
|
mBinding.setView(this);
|
||||||
mBinding.accettazioneMainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
|
||||||
mBinding.accettazioneMainFab.hide();
|
|
||||||
|
|
||||||
mBinding.accettazioneMainFab.setOnClickListener(v -> {
|
this.initRecyclerView();
|
||||||
this.onAccettazioneMainFabClick();
|
|
||||||
});
|
|
||||||
|
|
||||||
mToolbar.setRecyclerView(mBinding.accettazioneMainList);
|
mToolbar.setRecyclerView(mBinding.accettazioneMainList);
|
||||||
|
|
||||||
return mBinding.getRoot();
|
return mBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
|
||||||
|
this.fabVisible.set(false);
|
||||||
|
|
||||||
|
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||||
|
mViewModel.init(codMdep);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
for (Runnable onPreDestroy : mOnPreDestroyList) {
|
for (Runnable onPreDestroy : mOnPreDestroyList) {
|
||||||
@@ -111,111 +118,93 @@ public class MainAccettazioneFragment extends Fragment implements ISearcableFrag
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void init() {
|
|
||||||
|
|
||||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
|
||||||
|
|
||||||
mHelper = new AccettazioneHelper(getActivity());
|
|
||||||
|
|
||||||
mHelper.loadOrdini(ordini -> {
|
|
||||||
if(ordini != null) {
|
|
||||||
Toast.makeText(getActivity(), "Caricati " + ordini.size() + " ordini", Toast.LENGTH_LONG).show();
|
|
||||||
mOriginalOrderList = ordini;
|
|
||||||
}
|
|
||||||
|
|
||||||
mBinding.ordiniAccettazioneEmptyView.setVisibility(ordini != null && ordini.size() > 0 ? View.GONE : View.VISIBLE);
|
|
||||||
refreshRenderedOrdini(ordini);
|
|
||||||
initRecyclerView();
|
|
||||||
progress.dismiss();
|
|
||||||
|
|
||||||
}, ex -> {
|
|
||||||
UtilityExceptions.defaultException(getActivity(), ex, progress);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initRecyclerView() {
|
private void initRecyclerView() {
|
||||||
mAdapter = new MainListAccettazioneAdapter(getActivity(), mRenderedOrderList, onSingleSelectionChanged);
|
this.mViewModel.getOrderList().observe(getViewLifecycleOwner(), this::refreshList);
|
||||||
mBinding.accettazioneMainList.setAdapter(mAdapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void refreshRenderedOrdini(List<OrdineAccettazioneInevasoDTO> ordini) {
|
|
||||||
|
|
||||||
mRenderedOrderList.clear();
|
MainListAccettazioneAdapter adapter = new MainListAccettazioneAdapter(getActivity(), mOrdiniInevasiMutableData)
|
||||||
if(ordini != null) mRenderedOrderList.addAll(ordini);
|
.setOnGroupItemClicked(x -> {
|
||||||
|
Stream.of(mOrdiniInevasiMutableData)
|
||||||
|
.filter(y -> !y.getGroupTitle().equalsIgnoreCase(x) && y.getSelectedObservable().get())
|
||||||
|
.forEach(y -> y.getSelectedObservable().set(false));
|
||||||
|
|
||||||
|
boolean allSelected = Stream.of(mOrdiniInevasiMutableData)
|
||||||
|
.filter(y -> y.getGroupTitle().equalsIgnoreCase(x))
|
||||||
|
.allMatch(y -> y.getSelectedObservable().get());
|
||||||
|
|
||||||
|
Stream.of(mOrdiniInevasiMutableData)
|
||||||
|
.filter(y -> y.getGroupTitle().equalsIgnoreCase(x))
|
||||||
|
.forEach(y -> y.getSelectedObservable().set(!allSelected));
|
||||||
|
})
|
||||||
|
.setOnItemChecked(x -> {
|
||||||
|
Stream.of(mOrdiniInevasiMutableData)
|
||||||
|
.filter(y -> !y.getGroupTitle().equalsIgnoreCase(x.getGroupTitle()) && y.getSelectedObservable().get())
|
||||||
|
.forEach(y -> y.getSelectedObservable().set(false));
|
||||||
|
|
||||||
|
fabVisible.set(Stream.of(mOrdiniInevasiMutableData)
|
||||||
|
.anyMatch(y -> y.getSelectedObservable().get()));
|
||||||
|
});
|
||||||
|
|
||||||
|
adapter.setEmptyView(this.mBinding.ordiniAccettazioneEmptyView);
|
||||||
|
|
||||||
|
this.mBinding.accettazioneMainList.setAdapter(adapter);
|
||||||
|
this.mBinding.accettazioneMainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
|
|
||||||
|
if (mToolbar != null)
|
||||||
|
mToolbar.setRecyclerView(this.mBinding.accettazioneMainList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void refreshList(List<OrdineAccettazioneInevasoDTO> filteredList) {
|
||||||
|
|
||||||
private final RunnableArgs<OrdineAccettazioneInevasoDTO> onSingleSelectionChanged = dto -> {
|
List<OrdineAccettazioneInevasoDTO> tmpList = null;
|
||||||
List<OrdineAccettazioneInevasoDTO> selectedOrders = mHelper.getSelectedOrders(mOriginalOrderList);
|
|
||||||
|
|
||||||
if(dto.isSelected()) {
|
if (filteredList != null) {
|
||||||
Stream.of(selectedOrders)
|
tmpList = filteredList;
|
||||||
.filter(x -> !x.getCodAnagOrd().equalsIgnoreCase(dto.getCodAnagOrd()))
|
} else {
|
||||||
.forEach(x -> x.setSelected(false));
|
tmpList = mViewModel.getOrderList().getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(selectedOrders != null && selectedOrders.size() > 0) {
|
this.mOrdiniInevasiMutableData.clear();
|
||||||
mBinding.accettazioneMainFab.show();
|
this.mOrdiniInevasiMutableData.addAll(convertDataModelToListModel(tmpList));
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
mBinding.accettazioneMainFab.hide();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private void onAccettazioneMainFabClick() {
|
private List<MainListAccettazioneListModel> convertDataModelToListModel(List<OrdineAccettazioneInevasoDTO> dataList) {
|
||||||
|
|
||||||
List<OrdineAccettazioneInevasoDTO> selectedOrders = mHelper.getSelectedOrders(mOriginalOrderList);
|
return Stream.of(dataList)
|
||||||
|
.distinctBy(OrdineAccettazioneInevasoDTO::getBarcode)
|
||||||
|
.sortBy(x -> x.getRagSocOrd() + (x.getDataConsD() != null ? UtilityDate.formatDate(x.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH) : ""))
|
||||||
|
.map(x -> {
|
||||||
|
MainListAccettazioneListModel listModel = new MainListAccettazioneListModel();
|
||||||
|
|
||||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
listModel.setOriginalModel(x);
|
||||||
|
|
||||||
OrdiniAccettazioneRESTConsumer.retrievePickingListNewStatic(selectedOrders, sitArtOrds -> {
|
listModel.setGroupTitle(x.getRagSocOrd());
|
||||||
progress.dismiss();
|
|
||||||
|
listModel.setDescription(String.format(getString(R.string.ord_acq_testata), x.getNumero().toString(), UtilityDate.formatDate(x.getDataD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN)));
|
||||||
|
|
||||||
long artsCounter = Stream.of(sitArtOrds)
|
List<MainListAccettazioneClienteListModel> clienti = Stream.of(dataList)
|
||||||
.filter(x -> UtilityBigDecimal.greaterThan(x.getQtaDaEvadere(), BigDecimal.ZERO))
|
.filter(y -> y.getBarcode().equals(x.getBarcode()))
|
||||||
.map(SitArtOrdDTO::getCodMart)
|
.map(y -> new MainListAccettazioneClienteListModel()
|
||||||
.distinct()
|
.setPrimaryText(y.getRifOrd())
|
||||||
.count();
|
.setRightText(UtilityDate.formatDate(y.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH)))
|
||||||
|
.toList();
|
||||||
long ordsCounter = Stream.of(sitArtOrds)
|
|
||||||
.distinctBy(x -> x.getDataOrd() + " " + x.getNumOrd() + " " + x.getGestione())
|
listModel.setClientiListModel(clienti);
|
||||||
.count();
|
|
||||||
|
return listModel;
|
||||||
|
})
|
||||||
DialogSimpleMessageView.makeInfoDialog(getText(R.string.orders).toString(),
|
.toList();
|
||||||
Html.fromHtml(String.format(getActivity().getResources().getQuantityString(R.plurals.loaded_orders_message, (int) ordsCounter), ordsCounter)
|
}
|
||||||
+ "<br /><br />" +
|
|
||||||
"<b>" + artsCounter + "</b> " + getActivity().getResources().getQuantityString(R.plurals.available_articles, (int) artsCounter)),
|
public void dispatchOrders() {
|
||||||
null,
|
List<OrdineAccettazioneInevasoDTO> selectedOrders = Stream.of(this.mOrdiniInevasiMutableData)
|
||||||
() -> {
|
.filter(x -> x.getSelectedObservable().get())
|
||||||
|
.map(MainListAccettazioneListModel::getOriginalModel)
|
||||||
String cacheSitArtItemID = DataCache.addItem(sitArtOrds);
|
.toList();
|
||||||
String cacheOrdersItemID = DataCache.addItem(selectedOrders);
|
|
||||||
|
|
||||||
Intent myIntent = new Intent(getActivity(), AccettazionePickingActivity.class);
|
|
||||||
myIntent.putExtra("keyOrders", cacheOrdersItemID);
|
|
||||||
myIntent.putExtra("keySitArts", cacheSitArtItemID);
|
|
||||||
getActivity().startActivity(myIntent);
|
|
||||||
|
|
||||||
}).show(getActivity().getSupportFragmentManager(), "tag");
|
|
||||||
|
|
||||||
}, ex -> {
|
|
||||||
progress.dismiss();
|
|
||||||
|
|
||||||
String errorMessage = CommonRESTException.tryRecognizeThenGetMessage(ex);
|
|
||||||
if(errorMessage == null) errorMessage = ex.getMessage() + "\n" + ex.getCause().getCause().getMessage();
|
|
||||||
|
|
||||||
DialogSimpleMessageView
|
|
||||||
.makeErrorDialog(new SpannableString(errorMessage), null, null)
|
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
this.mViewModel.loadPicking(selectedOrders);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -236,11 +225,22 @@ public class MainAccettazioneFragment extends Fragment implements ISearcableFrag
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextChange(String newText) {
|
public boolean onQueryTextChange(String newText) {
|
||||||
final List<OrdineAccettazioneInevasoDTO> filtermodelist = mHelper.getFilteredOrdersByFornitore(mOriginalOrderList, newText);
|
List<OrdineAccettazioneInevasoDTO> filteredOrders = new ArrayList<>();
|
||||||
mAdapter.updateItems(filtermodelist);
|
List<OrdineAccettazioneInevasoDTO> originalList = this.mViewModel.getOrderList().getValue();
|
||||||
return true;
|
|
||||||
|
|
||||||
|
if(originalList == null || originalList.isEmpty()) return false;
|
||||||
|
|
||||||
|
for(int i = 0; i < originalList.size(); i++){
|
||||||
|
|
||||||
|
if(originalList.get(i).getRagSocOrd().toLowerCase().contains(newText.toLowerCase())){
|
||||||
|
filteredOrders.add(originalList.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
refreshList(filteredOrders);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
||||||
mToolbar = toolbar;
|
mToolbar = toolbar;
|
||||||
@@ -251,4 +251,35 @@ public class MainAccettazioneFragment extends Fragment implements ISearcableFrag
|
|||||||
public void addOnPreDestroy(Runnable onPreDestroy) {
|
public void addOnPreDestroy(Runnable onPreDestroy) {
|
||||||
this.mOnPreDestroyList.add(onPreDestroy);
|
this.mOnPreDestroyList.add(onPreDestroy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onOrdersDispatched(List<OrdineAccettazioneInevasoDTO> orders, List<SitArtOrdDTO> sitArts) {
|
||||||
|
long artsCounter = Stream.of(sitArts)
|
||||||
|
.filter(x -> UtilityBigDecimal.greaterThan(x.getQtaDaEvadere(), BigDecimal.ZERO))
|
||||||
|
.map(SitArtOrdDTO::getCodMart)
|
||||||
|
.distinct()
|
||||||
|
.count();
|
||||||
|
|
||||||
|
long ordsCounter = Stream.of(sitArts)
|
||||||
|
.distinctBy(x -> x.getDataOrd() + " " + x.getNumOrd() + " " + x.getGestione())
|
||||||
|
.count();
|
||||||
|
|
||||||
|
|
||||||
|
DialogSimpleMessageView.makeInfoDialog(getText(R.string.orders).toString(),
|
||||||
|
Html.fromHtml(String.format(getActivity().getResources().getQuantityString(R.plurals.loaded_orders_message, (int) ordsCounter), ordsCounter)
|
||||||
|
+ "<br /><br />" +
|
||||||
|
"<b>" + artsCounter + "</b> " + getActivity().getResources().getQuantityString(R.plurals.available_articles, (int) artsCounter)),
|
||||||
|
null,
|
||||||
|
() -> {
|
||||||
|
|
||||||
|
String cacheSitArtItemID = DataCache.addItem(sitArts);
|
||||||
|
String cacheOrdersItemID = DataCache.addItem(orders);
|
||||||
|
|
||||||
|
Intent myIntent = new Intent(getActivity(), AccettazionePickingActivity.class);
|
||||||
|
myIntent.putExtra("keyOrders", cacheOrdersItemID);
|
||||||
|
myIntent.putExtra("keySitArts", cacheSitArtItemID);
|
||||||
|
getActivity().startActivity(myIntent);
|
||||||
|
|
||||||
|
}).show(getActivity().getSupportFragmentManager(), "tag");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
import dagger.Provides;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.rest.OrdiniAccettazioneRESTConsumer;
|
||||||
|
|
||||||
|
@Module(subcomponents = {MainAccettazioneComponent.class})
|
||||||
|
public class MainAccettazioneModule {
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
OrdiniAccettazioneRESTConsumer providesOrdiniAccettazioneRESTConsumer() {
|
||||||
|
return new OrdiniAccettazioneRESTConsumer();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
MainAccettazioneViewModel providesMainAccettazioneViewModel(OrdiniAccettazioneRESTConsumer ordiniAccettazioneRESTConsumer) {
|
||||||
|
return new MainAccettazioneViewModel(ordiniAccettazioneRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione;
|
||||||
|
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.rest.OrdiniAccettazioneRESTConsumer;
|
||||||
|
|
||||||
|
public class MainAccettazioneViewModel {
|
||||||
|
|
||||||
|
private final OrdiniAccettazioneRESTConsumer mOrdiniAccettazioneRESTConsumer;
|
||||||
|
|
||||||
|
private final MutableLiveData<List<OrdineAccettazioneInevasoDTO>> mOrderList = new MutableLiveData<>();
|
||||||
|
|
||||||
|
private Listener mListener;
|
||||||
|
private String codMdep;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public MainAccettazioneViewModel(OrdiniAccettazioneRESTConsumer ordiniAccettazioneRESTConsumer) {
|
||||||
|
this.mOrdiniAccettazioneRESTConsumer = ordiniAccettazioneRESTConsumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(String currentCodMdep) {
|
||||||
|
this.codMdep = currentCodMdep;
|
||||||
|
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
new Thread(() -> {
|
||||||
|
|
||||||
|
mOrdiniAccettazioneRESTConsumer.getOrdiniInevasi(codMdep, orderList -> {
|
||||||
|
this.mOrderList.setValue(orderList);
|
||||||
|
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
}, this::sendError);
|
||||||
|
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void loadPicking(List<OrdineAccettazioneInevasoDTO> selectedOrders) {
|
||||||
|
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
|
new Thread(() -> {
|
||||||
|
|
||||||
|
this.mOrdiniAccettazioneRESTConsumer.retrievePickingListNew(selectedOrders, sitArtOrds -> {
|
||||||
|
|
||||||
|
this.sendOnOrdersDispatched(selectedOrders, sitArtOrds);
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
|
}, this::sendError);
|
||||||
|
|
||||||
|
}).start();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public MutableLiveData<List<OrdineAccettazioneInevasoDTO>> getOrderList() {
|
||||||
|
return mOrderList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MainAccettazioneViewModel setListener(Listener listener) {
|
||||||
|
this.mListener = listener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnLoadingStarted() {
|
||||||
|
if (this.mListener != null) mListener.onLoadingStarted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnLoadingEnded() {
|
||||||
|
if (this.mListener != null) mListener.onLoadingEnded();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendError(Exception ex) {
|
||||||
|
if (this.mListener != null) mListener.onError(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnOrdersDispatched(List<OrdineAccettazioneInevasoDTO> orders, List<SitArtOrdDTO> sitArts) {
|
||||||
|
if (this.mListener != null) mListener.onOrdersDispatched(orders, sitArts);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface Listener extends ILoadingListener {
|
||||||
|
|
||||||
|
void onError(Exception ex);
|
||||||
|
|
||||||
|
void onOrdersDispatched(List<OrdineAccettazioneInevasoDTO> orders, List<SitArtOrdDTO> sitArts);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.gest.accettazione.core;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.EsitoType;
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
|
||||||
import it.integry.integrywmsnative.gest.accettazione.rest.OrdiniAccettazioneRESTConsumerService;
|
|
||||||
import retrofit2.Call;
|
|
||||||
import retrofit2.Callback;
|
|
||||||
import retrofit2.Response;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by GiuseppeS on 06/03/2018.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class AccettazioneHelper {
|
|
||||||
|
|
||||||
private Context mContext;
|
|
||||||
|
|
||||||
public AccettazioneHelper(Context context){
|
|
||||||
mContext = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void loadOrdini(RunnableArgs<List<OrdineAccettazioneInevasoDTO>> onComplete, RunnableArgs<Exception> onFailed){
|
|
||||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
|
||||||
|
|
||||||
OrdiniAccettazioneRESTConsumerService service = RESTBuilder.getService(OrdiniAccettazioneRESTConsumerService.class);
|
|
||||||
service.listOrdiniInevasi(codMdep, "A").enqueue(new Callback<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> call, Response<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> response) {
|
|
||||||
|
|
||||||
if(response.isSuccessful()) {
|
|
||||||
|
|
||||||
if(response.body() != null) {
|
|
||||||
if(response.body().getEsito() == EsitoType.OK) {
|
|
||||||
onComplete.run(response.body().getDto());
|
|
||||||
} else {
|
|
||||||
onFailed.run(new Exception(response.body().getErrorMessage()));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
onFailed.run(new Exception(response.message()));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
onFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> call, Throwable t) {
|
|
||||||
onFailed.run(new Exception(t));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public List<OrdineAccettazioneInevasoDTO> getSelectedOrders(List<OrdineAccettazioneInevasoDTO> ordiniList){
|
|
||||||
return Stream.of(ordiniList)
|
|
||||||
.filter(OrdineAccettazioneInevasoDTO::isSelected)
|
|
||||||
.toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public List<OrdineAccettazioneInevasoDTO> getFilteredOrdersByFornitore(List<OrdineAccettazioneInevasoDTO> groupedOrdiniInevasi, String textFilter){
|
|
||||||
List<OrdineAccettazioneInevasoDTO> filteredOrders = new ArrayList<>();
|
|
||||||
|
|
||||||
for(int i = 0; i < groupedOrdiniInevasi.size(); i++){
|
|
||||||
|
|
||||||
if(groupedOrdiniInevasi.get(i).getRagSocOrd().toLowerCase().contains(textFilter.toLowerCase())){
|
|
||||||
filteredOrders.add(groupedOrdiniInevasi.get(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return filteredOrders;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,192 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.gest.accettazione.core;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.text.Html;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
|
||||||
import androidx.databinding.Observable;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
|
||||||
import com.zhukic.sectionedrecyclerview.SectionedRecyclerViewAdapter;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
|
||||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
|
||||||
import it.integry.integrywmsnative.databinding.AccettazioneMainListGroupClientiBinding;
|
|
||||||
import it.integry.integrywmsnative.databinding.AccettazioneMainListGroupModelBinding;
|
|
||||||
import it.integry.integrywmsnative.databinding.AccettazioneMainListModelBinding;
|
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
|
||||||
import it.integry.integrywmsnative.ui.fastscroll.SectionTitleProvider;
|
|
||||||
|
|
||||||
public class MainListAccettazioneAdapter extends SectionedRecyclerViewAdapter<MainListAccettazioneAdapter.SubheaderHolder, MainListAccettazioneAdapter.SingleItemViewHolder> implements SectionTitleProvider {
|
|
||||||
|
|
||||||
|
|
||||||
private Context mContext;
|
|
||||||
|
|
||||||
private List<OrdineAccettazioneInevasoDTO> mOriginalDataset;
|
|
||||||
private List<OrdineAccettazioneInevasoDTO> mDataset;
|
|
||||||
private RunnableArgs<OrdineAccettazioneInevasoDTO> mOnSingleSelectionChanged;
|
|
||||||
|
|
||||||
static class SubheaderHolder extends RecyclerView.ViewHolder {
|
|
||||||
|
|
||||||
AccettazioneMainListModelBinding binding;
|
|
||||||
|
|
||||||
SubheaderHolder(AccettazioneMainListModelBinding binding) {
|
|
||||||
super(binding.getRoot());
|
|
||||||
this.binding = binding;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static class SingleItemViewHolder extends RecyclerView.ViewHolder {
|
|
||||||
|
|
||||||
AccettazioneMainListGroupModelBinding binding;
|
|
||||||
|
|
||||||
SingleItemViewHolder(AccettazioneMainListGroupModelBinding binding) {
|
|
||||||
super(binding.getRoot());
|
|
||||||
this.binding = binding;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public MainListAccettazioneAdapter(Context context, List<OrdineAccettazioneInevasoDTO> myDataset, RunnableArgs<OrdineAccettazioneInevasoDTO> onSingleSelectionChanged) {
|
|
||||||
mContext = context;
|
|
||||||
mOriginalDataset = myDataset;
|
|
||||||
mDataset = orderItems(myDataset);
|
|
||||||
mOnSingleSelectionChanged = onSingleSelectionChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateItems(List<OrdineAccettazioneInevasoDTO> updatedDataset) {
|
|
||||||
mDataset.clear();
|
|
||||||
mDataset.addAll(orderItems(updatedDataset));
|
|
||||||
notifyDataSetChanged();
|
|
||||||
notifyDataChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private List<OrdineAccettazioneInevasoDTO> orderItems(List<OrdineAccettazioneInevasoDTO> dataset) {
|
|
||||||
return Stream.of(dataset)
|
|
||||||
.distinctBy(OrdineAccettazioneInevasoDTO::getBarcode)
|
|
||||||
.sortBy(x -> x.getRagSocOrd() + (x.getDataConsD() != null ? UtilityDate.formatDate(x.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH) : ""))
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SubheaderHolder onCreateSubheaderViewHolder(ViewGroup parent, int viewType) {
|
|
||||||
AccettazioneMainListModelBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.accettazione_main_list_model, parent, false);
|
|
||||||
return new SubheaderHolder(binding);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public SingleItemViewHolder onCreateItemViewHolder(ViewGroup parent, int viewType) {
|
|
||||||
AccettazioneMainListGroupModelBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.accettazione_main_list_group_model, parent, false);
|
|
||||||
return new SingleItemViewHolder(binding);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindSubheaderViewHolder(SubheaderHolder subheaderHolder, int nextItemPosition) {
|
|
||||||
subheaderHolder.binding.accettazioneMainListGroupHeader.setText(mDataset.get(nextItemPosition).getRagSocOrd());
|
|
||||||
|
|
||||||
subheaderHolder.binding.getRoot().setOnClickListener(v -> {
|
|
||||||
|
|
||||||
boolean anySelected = Stream.of(mDataset)
|
|
||||||
.filter(x -> x.getCodAnagOrd().equals(mDataset.get(nextItemPosition).getCodAnagOrd()))
|
|
||||||
.anyMatch(OrdineAccettazioneInevasoDTO::isSelected);
|
|
||||||
|
|
||||||
Stream.of(mDataset)
|
|
||||||
.filter(x -> x.getCodAnagOrd().equals(mDataset.get(nextItemPosition).getCodAnagOrd()))
|
|
||||||
.forEach(x -> x.setSelected(!anySelected));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindItemViewHolder(SingleItemViewHolder h, int itemPosition) {
|
|
||||||
final OrdineAccettazioneInevasoDTO ordine = mDataset.get(itemPosition);
|
|
||||||
final SingleItemViewHolder holder = h;
|
|
||||||
|
|
||||||
holder.binding.accettazioneMainListGroupItemContainerCheckBox.setTag(ordine.getNumero());
|
|
||||||
|
|
||||||
holder.binding.accettazioneMainListGroupItemContainerCheckBox.setOnCheckedChangeListener(null);
|
|
||||||
|
|
||||||
ordine.selected.resetOnPropertyChangedCallback();
|
|
||||||
|
|
||||||
|
|
||||||
String testataOrdString = String.format(mContext.getString(R.string.ord_acq_testata), String.valueOf(ordine.getNumero()), UtilityDate.formatDate(ordine.getDataD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
|
||||||
holder.binding.accettazioneMainListGroupItemContainerTestataOrd.setText(Html.fromHtml(testataOrdString));
|
|
||||||
|
|
||||||
holder.binding.accettazioneMainListGroupItemContainerClientiOrd.removeAllViews();
|
|
||||||
|
|
||||||
List<OrdineAccettazioneInevasoDTO> clienti = Stream.of(mOriginalDataset)
|
|
||||||
.filter(x -> x.getBarcode().equals(ordine.getBarcode()))
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
for (OrdineAccettazioneInevasoDTO cliente : clienti) {
|
|
||||||
AccettazioneMainListGroupClientiBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.accettazione_main_list_group_clienti, holder.binding.accettazioneMainListGroupItemContainerClientiOrd, false);
|
|
||||||
|
|
||||||
binding.accettazioneMainListGroupClientiComm.setText(cliente.getRifOrd());
|
|
||||||
|
|
||||||
if (!UtilityString.isNullOrEmpty(cliente.getDataConsS())) {
|
|
||||||
binding.accettazioneMainListGroupClientiDatacons.setText(UtilityDate.formatDate(cliente.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH));
|
|
||||||
} else {
|
|
||||||
binding.accettazioneMainListGroupClientiDatacons.setText("");
|
|
||||||
}
|
|
||||||
|
|
||||||
holder.binding.accettazioneMainListGroupItemContainerClientiOrd.addView(binding.getRoot());
|
|
||||||
}
|
|
||||||
|
|
||||||
holder.binding.setCheckboxValue(ordine.selected);
|
|
||||||
|
|
||||||
holder.binding.getRoot().setOnClickListener(v -> {
|
|
||||||
ordine.setSelected(!ordine.isSelected());
|
|
||||||
});
|
|
||||||
|
|
||||||
holder.binding.accettazioneMainListGroupItemContainerCheckBox.setChecked(ordine.isSelected());
|
|
||||||
|
|
||||||
//Bindable to View
|
|
||||||
ordine.selected.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
|
||||||
@Override
|
|
||||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
|
||||||
if(holder.binding.accettazioneMainListGroupItemContainerCheckBox.getTag().equals(ordine.getNumero())) {
|
|
||||||
holder.binding.accettazioneMainListGroupItemContainerCheckBox.setChecked(((BindableBoolean) sender).get());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
//View to Bindable
|
|
||||||
holder.binding.accettazioneMainListGroupItemContainerCheckBox.setOnCheckedChangeListener((buttonView, isChecked) -> {
|
|
||||||
ordine.setSelected(isChecked);
|
|
||||||
mOnSingleSelectionChanged.run(ordine);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onPlaceSubheaderBetweenItems(int position) {
|
|
||||||
return !this.mDataset.get(position).getRagSocOrd().equalsIgnoreCase(this.mDataset.get(position + 1).getRagSocOrd());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemSize() {
|
|
||||||
return mDataset.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getSectionTitle(int position) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,481 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.gest.accettazione.dto;
|
|
||||||
|
|
||||||
import android.os.Parcel;
|
|
||||||
import android.os.Parcelable;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by GiuseppeS on 06/03/2018.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class OrdineAccettazioneDTO implements Parcelable {
|
|
||||||
|
|
||||||
private String ragSoc;
|
|
||||||
private int numero;
|
|
||||||
private String data;
|
|
||||||
private String gestione;
|
|
||||||
private String codMdep;
|
|
||||||
private String codAnag;
|
|
||||||
private String codVdes;
|
|
||||||
private String termCons;
|
|
||||||
private ArrayList<Riga> ordini;
|
|
||||||
private String codAlis;
|
|
||||||
private String rifOrd;
|
|
||||||
|
|
||||||
|
|
||||||
public static class Riga implements Parcelable {
|
|
||||||
private Float qtaOrd; //QTA ORDINATA (tutta la qta ordiata)
|
|
||||||
public Float qtaRiservate; //QTA COLLI (tutta la qta già accantonata nei colli
|
|
||||||
private Float qtaEvasa; //QTA EVASA ORDINE (qta con documento)
|
|
||||||
//public Float qtaDaEvadere; //qta_ord - qta_evasa - qta_colli
|
|
||||||
public int rigaOrd;
|
|
||||||
public String codJcom;
|
|
||||||
public String ragSocCom;
|
|
||||||
public String descrizioneCommessa;
|
|
||||||
public MtbAart mtbAart;
|
|
||||||
private PickingObjectDTO[] colliAssociati;
|
|
||||||
private Boolean hidden = null;
|
|
||||||
private Boolean tempHidden = null;
|
|
||||||
private String partitaMag;
|
|
||||||
private String codArtFor;
|
|
||||||
public String descrizioneEstesa;
|
|
||||||
public String codAlis;
|
|
||||||
|
|
||||||
public int numOrd;
|
|
||||||
public String dataOrd;
|
|
||||||
public String gestioneOrd;
|
|
||||||
|
|
||||||
public String dataCons;
|
|
||||||
|
|
||||||
public BigDecimal getQtaDaEvadere() {
|
|
||||||
return this.getQtaOrd().subtract(this.getQtaEvasa()).subtract(this.getQtaRiservate());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public BigDecimal getQtaOrd() {
|
|
||||||
return qtaOrd != null ? new BigDecimal(qtaOrd) : BigDecimal.ZERO;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getQtaRiservate() {
|
|
||||||
return qtaRiservate != null ? new BigDecimal(qtaRiservate) : BigDecimal.ZERO;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getQtaEvasa() {
|
|
||||||
return qtaEvasa != null ? new BigDecimal(qtaEvasa) : BigDecimal.ZERO;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getRigaOrd() {
|
|
||||||
return rigaOrd;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCodJcom() {
|
|
||||||
return codJcom;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRagSocCom() {
|
|
||||||
return ragSocCom;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescrizioneCommessa() {
|
|
||||||
return descrizioneCommessa;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MtbAart getMtbAart() {
|
|
||||||
return mtbAart;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PickingObjectDTO[] getColliAssociati() {
|
|
||||||
return colliAssociati;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean isHidden() {
|
|
||||||
return hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean isTempHidden() {
|
|
||||||
return tempHidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPartitaMag() {
|
|
||||||
return partitaMag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCodArtFor() {
|
|
||||||
return codArtFor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescrizioneEstesa() {
|
|
||||||
return descrizioneEstesa;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCodAlis() {
|
|
||||||
return codAlis;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getNumOrd() {
|
|
||||||
return numOrd;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getGestioneOrd() {
|
|
||||||
return gestioneOrd;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GestioneEnum getGestioneOrdEnum() {
|
|
||||||
return GestioneEnum.fromString(gestioneOrd);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDataCons() {
|
|
||||||
return dataCons;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDataOrdS() {
|
|
||||||
return this.dataOrd;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getDataOrdD() {
|
|
||||||
return UtilityDate.recognizeDateWithExceptionHandler(getDataOrdS());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Riga setQtaOrd(Float qtaOrd) {
|
|
||||||
this.qtaOrd = qtaOrd;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Riga setQtaRiservate(BigDecimal qtaRiservate) {
|
|
||||||
this.qtaRiservate = qtaRiservate.floatValue();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Riga setQtaEvasa(Float qtaEvasa) {
|
|
||||||
this.qtaEvasa = qtaEvasa;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Riga setRigaOrd(int rigaOrd) {
|
|
||||||
this.rigaOrd = rigaOrd;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Riga setCodJcom(String codJcom) {
|
|
||||||
this.codJcom = codJcom;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Riga setRagSocCom(String ragSocCom) {
|
|
||||||
this.ragSocCom = ragSocCom;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Riga setDescrizioneCommessa(String descrizioneCommessa) {
|
|
||||||
this.descrizioneCommessa = descrizioneCommessa;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Riga setMtbAart(MtbAart mtbAart) {
|
|
||||||
this.mtbAart = mtbAart;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Riga setHidden(boolean hidden) {
|
|
||||||
this.hidden = hidden;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Riga setTempHidden(boolean hidden) {
|
|
||||||
this.tempHidden = hidden;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Riga setPartitaMag(String partitaMag) {
|
|
||||||
this.partitaMag = partitaMag;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Riga setCodArtFor(String codArtFor) {
|
|
||||||
this.codArtFor = codArtFor;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Riga setDescrizioneEstesa(String descrizioneEstesa) {
|
|
||||||
this.descrizioneEstesa = descrizioneEstesa;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Riga setCodAlis(String codAlis) {
|
|
||||||
this.codAlis = codAlis;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Riga setNumOrd(int numOrd) {
|
|
||||||
this.numOrd = numOrd;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Riga setDataOrd(String dataOrd) {
|
|
||||||
this.dataOrd = dataOrd;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Riga setGestioneOrd(String gestioneOrd) {
|
|
||||||
this.gestioneOrd = gestioneOrd;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Riga setDataCons(String dataCons) {
|
|
||||||
this.dataCons = dataCons;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Riga(){}
|
|
||||||
|
|
||||||
protected Riga(Parcel in) {
|
|
||||||
qtaOrd = in.readByte() == 0x00 ? null : in.readFloat();
|
|
||||||
qtaRiservate = in.readByte() == 0x00 ? null : in.readFloat();
|
|
||||||
rigaOrd = in.readInt();
|
|
||||||
codJcom = in.readString();
|
|
||||||
ragSocCom = in.readString();
|
|
||||||
descrizioneCommessa = in.readString();
|
|
||||||
mtbAart = (MtbAart) in.readValue(MtbAart.class.getClassLoader());
|
|
||||||
hidden = in.readByte() == 0x00 ? null : in.readByte() != 0x00;
|
|
||||||
partitaMag = in.readString();
|
|
||||||
codArtFor = in.readString();
|
|
||||||
descrizioneEstesa = in.readString();
|
|
||||||
codAlis = in.readString();
|
|
||||||
numOrd = in.readInt();
|
|
||||||
dataOrd = in.readString();
|
|
||||||
gestioneOrd = in.readString();
|
|
||||||
dataCons = in.readString();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int describeContents() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToParcel(Parcel dest, int flags) {
|
|
||||||
if (qtaOrd == null) {
|
|
||||||
dest.writeByte((byte) (0x00));
|
|
||||||
} else {
|
|
||||||
dest.writeByte((byte) (0x01));
|
|
||||||
dest.writeFloat(qtaOrd);
|
|
||||||
}
|
|
||||||
if (qtaRiservate == null) {
|
|
||||||
dest.writeByte((byte) (0x00));
|
|
||||||
} else {
|
|
||||||
dest.writeByte((byte) (0x01));
|
|
||||||
dest.writeFloat(qtaRiservate);
|
|
||||||
}
|
|
||||||
dest.writeInt(rigaOrd);
|
|
||||||
dest.writeString(codJcom);
|
|
||||||
dest.writeString(ragSocCom);
|
|
||||||
dest.writeString(descrizioneCommessa);
|
|
||||||
dest.writeValue(mtbAart);
|
|
||||||
if (hidden == null) {
|
|
||||||
dest.writeByte((byte) (0x00));
|
|
||||||
} else {
|
|
||||||
dest.writeByte((byte) (0x01));
|
|
||||||
dest.writeByte((byte) (hidden ? 0x01 : 0x00));
|
|
||||||
}
|
|
||||||
dest.writeString(partitaMag);
|
|
||||||
dest.writeString(codArtFor);
|
|
||||||
dest.writeString(descrizioneEstesa);
|
|
||||||
dest.writeString(codAlis);
|
|
||||||
dest.writeInt(numOrd);
|
|
||||||
dest.writeString(dataOrd);
|
|
||||||
dest.writeString(gestioneOrd);
|
|
||||||
dest.writeString(dataCons);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
public static final Parcelable.Creator<Riga> CREATOR = new Parcelable.Creator<Riga>() {
|
|
||||||
@Override
|
|
||||||
public Riga createFromParcel(Parcel in) {
|
|
||||||
return new Riga(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Riga[] newArray(int size) {
|
|
||||||
return new Riga[size];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class PickingObjectDTO extends MtbColt{
|
|
||||||
public boolean hidden = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrdineAccettazioneDTO() {}
|
|
||||||
|
|
||||||
protected OrdineAccettazioneDTO(Parcel in) {
|
|
||||||
ragSoc = in.readString();
|
|
||||||
numero = in.readInt();
|
|
||||||
data = in.readString();
|
|
||||||
gestione = in.readString();
|
|
||||||
codMdep = in.readString();
|
|
||||||
codAnag = in.readString();
|
|
||||||
codVdes = in.readString();
|
|
||||||
termCons = in.readString();
|
|
||||||
codAlis = in.readString();
|
|
||||||
rifOrd = in.readString();
|
|
||||||
if (in.readByte() == 0x01) {
|
|
||||||
ordini = new ArrayList<Riga>();
|
|
||||||
in.readList(ordini, Riga.class.getClassLoader());
|
|
||||||
} else {
|
|
||||||
ordini = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int describeContents() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToParcel(Parcel dest, int flags) {
|
|
||||||
dest.writeString(ragSoc);
|
|
||||||
dest.writeInt(numero);
|
|
||||||
dest.writeString(data);
|
|
||||||
dest.writeString(gestione);
|
|
||||||
dest.writeString(codMdep);
|
|
||||||
dest.writeString(codAnag);
|
|
||||||
dest.writeString(codVdes);
|
|
||||||
dest.writeString(termCons);
|
|
||||||
dest.writeString(codAlis);
|
|
||||||
dest.writeString(rifOrd);
|
|
||||||
if (ordini == null) {
|
|
||||||
dest.writeByte((byte) (0x00));
|
|
||||||
} else {
|
|
||||||
dest.writeByte((byte) (0x01));
|
|
||||||
dest.writeList(ordini);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
public static final Parcelable.Creator<OrdineAccettazioneDTO> CREATOR = new Parcelable.Creator<OrdineAccettazioneDTO>() {
|
|
||||||
@Override
|
|
||||||
public OrdineAccettazioneDTO createFromParcel(Parcel in) {
|
|
||||||
return new OrdineAccettazioneDTO(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public OrdineAccettazioneDTO[] newArray(int size) {
|
|
||||||
return new OrdineAccettazioneDTO[size];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
public String getRagSoc() {
|
|
||||||
return ragSoc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrdineAccettazioneDTO setRagSoc(String ragSoc) {
|
|
||||||
this.ragSoc = ragSoc;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getNumero() {
|
|
||||||
return numero;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrdineAccettazioneDTO setNumero(int numero) {
|
|
||||||
this.numero = numero;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getData() {
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrdineAccettazioneDTO setData(String data) {
|
|
||||||
this.data = data;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getGestione() {
|
|
||||||
return gestione;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrdineAccettazioneDTO setGestione(String gestione) {
|
|
||||||
this.gestione = gestione;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCodMdep() {
|
|
||||||
return codMdep;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrdineAccettazioneDTO setCodMdep(String codMdep) {
|
|
||||||
this.codMdep = codMdep;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCodAnag() {
|
|
||||||
return codAnag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrdineAccettazioneDTO setCodAnag(String codAnag) {
|
|
||||||
this.codAnag = codAnag;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCodVdes() {
|
|
||||||
return codVdes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrdineAccettazioneDTO setCodVdes(String codVdes) {
|
|
||||||
this.codVdes = codVdes;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTermCons() {
|
|
||||||
return termCons;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrdineAccettazioneDTO setTermCons(String termCons) {
|
|
||||||
this.termCons = termCons;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<Riga> getOrdini() {
|
|
||||||
return ordini;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrdineAccettazioneDTO setOrdini(ArrayList<Riga> ordini) {
|
|
||||||
this.ordini = ordini;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCodAlis() {
|
|
||||||
return codAlis;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrdineAccettazioneDTO setCodAlis(String codAlis) {
|
|
||||||
this.codAlis = codAlis;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRifOrd() {
|
|
||||||
return rifOrd;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrdineAccettazioneDTO setRifOrd(String rifOrd) {
|
|
||||||
this.rifOrd = rifOrd;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -22,11 +22,23 @@ import retrofit2.Response;
|
|||||||
public class OrdiniAccettazioneRESTConsumer extends _BaseRESTConsumer {
|
public class OrdiniAccettazioneRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
|
||||||
public void retrievePickingListNew(List<OrdineAccettazioneInevasoDTO> orders, RunnableArgs<List<SitArtOrdDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getOrdiniInevasi(String codMdep, RunnableArgs<List<OrdineAccettazioneInevasoDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
retrievePickingListNewStatic(orders, onComplete, onFailed);
|
OrdiniAccettazioneRESTConsumerService service = RESTBuilder.getService(OrdiniAccettazioneRESTConsumerService.class);
|
||||||
|
service.listOrdiniInevasi(codMdep, "A").enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> call, Response<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> response) {
|
||||||
|
analyzeAnswer(response, "getOrdiniInevasi", onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void retrievePickingListNewStatic(List<OrdineAccettazioneInevasoDTO> orders, RunnableArgs<List<SitArtOrdDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
|
public void retrievePickingListNew(List<OrdineAccettazioneInevasoDTO> orders, RunnableArgs<List<SitArtOrdDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
List<GetPickingListAccettazioneDTO> getPickingListDTOs = Stream.of(orders)
|
List<GetPickingListAccettazioneDTO> getPickingListDTOs = Stream.of(orders)
|
||||||
.map(x -> new GetPickingListAccettazioneDTO()
|
.map(x -> new GetPickingListAccettazioneDTO()
|
||||||
.setData(x.getData())
|
.setData(x.getData())
|
||||||
@@ -47,7 +59,6 @@ public class OrdiniAccettazioneRESTConsumer extends _BaseRESTConsumer {
|
|||||||
onFailed.run(new Exception(t));
|
onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,149 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione.ui;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.view.ExtendedSectionedRecyclerView;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.databinding.AccettazioneMainListGroupClientiBinding;
|
||||||
|
import it.integry.integrywmsnative.databinding.AccettazioneMainListGroupModelBinding;
|
||||||
|
import it.integry.integrywmsnative.databinding.AccettazioneMainListModelBinding;
|
||||||
|
|
||||||
|
public class MainListAccettazioneAdapter extends ExtendedSectionedRecyclerView<MainListAccettazioneListModel, MainListAccettazioneAdapter.SubheaderHolder, MainListAccettazioneAdapter.SingleItemViewHolder> {
|
||||||
|
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
private RunnableArgs<String> mOnGroupItemClicked;
|
||||||
|
private RunnableArgs<MainListAccettazioneListModel> mOnItemChecked;
|
||||||
|
|
||||||
|
static class SubheaderHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
AccettazioneMainListModelBinding binding;
|
||||||
|
|
||||||
|
SubheaderHolder(AccettazioneMainListModelBinding binding) {
|
||||||
|
super(binding.getRoot());
|
||||||
|
this.binding = binding;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static class SingleItemViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
AccettazioneMainListGroupModelBinding binding;
|
||||||
|
|
||||||
|
SingleItemViewHolder(AccettazioneMainListGroupModelBinding binding) {
|
||||||
|
super(binding.getRoot());
|
||||||
|
this.binding = binding;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public MainListAccettazioneAdapter(Context context, ObservableArrayList<MainListAccettazioneListModel> myDataset) {
|
||||||
|
super(myDataset);
|
||||||
|
mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MainListAccettazioneAdapter setOnGroupItemClicked(RunnableArgs<String> onGroupItemClicked) {
|
||||||
|
this.mOnGroupItemClicked = onGroupItemClicked;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MainListAccettazioneAdapter setOnItemChecked(RunnableArgs<MainListAccettazioneListModel> onItemChecked) {
|
||||||
|
this.mOnItemChecked = onItemChecked;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SubheaderHolder onCreateSubheaderViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
AccettazioneMainListModelBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.accettazione_main_list_model, parent, false);
|
||||||
|
return new SubheaderHolder(binding);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleItemViewHolder onCreateItemViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
AccettazioneMainListGroupModelBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.accettazione_main_list_group_model, parent, false);
|
||||||
|
return new SingleItemViewHolder(binding);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindSubheaderViewHolder(SubheaderHolder subheaderHolder, int nextItemPosition) {
|
||||||
|
subheaderHolder.binding.accettazioneMainListGroupHeader.setText(mDataset.get(nextItemPosition).getGroupTitle());
|
||||||
|
|
||||||
|
subheaderHolder.binding.getRoot().setOnClickListener(new OnSingleClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onSingleClick(View v) {
|
||||||
|
if(mOnGroupItemClicked != null) mOnGroupItemClicked.run(mDataset.get(nextItemPosition).getGroupTitle());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindItemViewHolder(SingleItemViewHolder holder, int itemPosition) {
|
||||||
|
final MainListAccettazioneListModel ordine = mDataset.get(itemPosition);
|
||||||
|
|
||||||
|
ordine.getSelectedObservable().resetOnPropertyChangedCallback();
|
||||||
|
|
||||||
|
holder.binding.accettazioneMainListGroupItemContainerClientiOrd.removeAllViews();
|
||||||
|
holder.binding.accettazioneMainListGroupItemContainerTestataOrd.setText(Html.fromHtml(ordine.getDescription()));
|
||||||
|
|
||||||
|
for (MainListAccettazioneClienteListModel cliente : ordine.getClientiListModel()) {
|
||||||
|
AccettazioneMainListGroupClientiBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.accettazione_main_list_group_clienti, holder.binding.accettazioneMainListGroupItemContainerClientiOrd, false);
|
||||||
|
|
||||||
|
binding.accettazioneMainListGroupClientiComm.setText(cliente.getPrimaryText());
|
||||||
|
|
||||||
|
if (!UtilityString.isNullOrEmpty(cliente.getRightText())) {
|
||||||
|
binding.accettazioneMainListGroupClientiDatacons.setText(cliente.getRightText());
|
||||||
|
} else {
|
||||||
|
binding.accettazioneMainListGroupClientiDatacons.setText("");
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.binding.accettazioneMainListGroupItemContainerClientiOrd.addView(binding.getRoot());
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.binding.setSelected(ordine.getSelectedObservable());
|
||||||
|
holder.binding.executePendingBindings();
|
||||||
|
holder.binding.accettazioneMainListGroupItemContainerCheckBox.jumpDrawablesToCurrentState();
|
||||||
|
|
||||||
|
ordine.getSelectedObservable().addOnPropertyChangedCallback(() -> {
|
||||||
|
if(this.mOnItemChecked != null) this.mOnItemChecked.run(ordine);
|
||||||
|
});
|
||||||
|
|
||||||
|
holder.binding.getRoot().setOnClickListener(v -> {
|
||||||
|
ordine.getSelectedObservable().set(!ordine.getSelectedObservable().get());
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onPlaceSubheaderBetweenItems(int position) {
|
||||||
|
if (getItemSize() == 1) return true;
|
||||||
|
else if (getItemSize() > 1) {
|
||||||
|
MainListAccettazioneListModel compare1 = this.mDataset.get(position);
|
||||||
|
MainListAccettazioneListModel compare2 = this.mDataset.get(position + 1);
|
||||||
|
|
||||||
|
if (UtilityString.equalsIgnoreCase(compare1.getGroupTitle(), compare2.getGroupTitle())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemSize() {
|
||||||
|
return mDataset.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione.ui;
|
||||||
|
|
||||||
|
public class MainListAccettazioneClienteListModel {
|
||||||
|
|
||||||
|
private String primaryText;
|
||||||
|
private String rightText;
|
||||||
|
|
||||||
|
|
||||||
|
public String getPrimaryText() {
|
||||||
|
return primaryText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MainListAccettazioneClienteListModel setPrimaryText(String primaryText) {
|
||||||
|
this.primaryText = primaryText;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRightText() {
|
||||||
|
return rightText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MainListAccettazioneClienteListModel setRightText(String rightText) {
|
||||||
|
this.rightText = rightText;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione.ui;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||||
|
|
||||||
|
public class MainListAccettazioneListModel {
|
||||||
|
|
||||||
|
private String groupTitle;
|
||||||
|
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
private boolean hidden;
|
||||||
|
private BindableBoolean selected = new BindableBoolean();
|
||||||
|
|
||||||
|
|
||||||
|
private OrdineAccettazioneInevasoDTO originalModel;
|
||||||
|
private List<MainListAccettazioneClienteListModel> clientiListModel;
|
||||||
|
|
||||||
|
|
||||||
|
public String getGroupTitle() {
|
||||||
|
return groupTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MainListAccettazioneListModel setGroupTitle(String groupTitle) {
|
||||||
|
this.groupTitle = groupTitle;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MainListAccettazioneListModel setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isHidden() {
|
||||||
|
return hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MainListAccettazioneListModel setHidden(boolean hidden) {
|
||||||
|
this.hidden = hidden;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBoolean getSelectedObservable() {
|
||||||
|
return selected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrdineAccettazioneInevasoDTO getOriginalModel() {
|
||||||
|
return originalModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MainListAccettazioneListModel setOriginalModel(OrdineAccettazioneInevasoDTO originalModel) {
|
||||||
|
this.originalModel = originalModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MainListAccettazioneClienteListModel> getClientiListModel() {
|
||||||
|
return clientiListModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MainListAccettazioneListModel setClientiListModel(List<MainListAccettazioneClienteListModel> clientiListModel) {
|
||||||
|
this.clientiListModel = clientiListModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user