Compare commits
336 Commits
v1.21.0(25
...
v1.29.11(3
| Author | SHA1 | Date | |
|---|---|---|---|
| b0de2dda40 | |||
| f6fdc45e1a | |||
| 5e88833039 | |||
| 2c521c5f96 | |||
| 8530309244 | |||
| 57dd0cef76 | |||
| 8df31407ac | |||
| 8134a64a43 | |||
| 0c2fd117d5 | |||
| d2b5fe917d | |||
| 3de49545b7 | |||
| 7163d91c53 | |||
| b8b3d2f2bb | |||
| 7555e3d90f | |||
| 46e438e0e9 | |||
| 439eada61b | |||
| 48548b7c92 | |||
| 79afe0155b | |||
| 730dabc2bb | |||
| 44255f08b4 | |||
| fb23009fcc | |||
| c0310e492f | |||
| bf1fc455e1 | |||
| c7c2700dbe | |||
| c89e4869ef | |||
| 5e147c9d96 | |||
| 95fc680823 | |||
| 3cd1b8eb9f | |||
| ca04b87a8e | |||
| 10ab47a1b7 | |||
| fdaa2b7f21 | |||
| e9b179ca7f | |||
| 04d811af93 | |||
| cb2421f263 | |||
| 16a565fc51 | |||
| f68691df6b | |||
| f4f7f4a6f0 | |||
| b129bb51c6 | |||
| 8c80918521 | |||
| e8dea4cef0 | |||
| b51bf1d9cb | |||
| 3c25e223ab | |||
| 16d9f2f6ff | |||
| fd3dfb9afe | |||
| 2916d2b5d0 | |||
| dac12905ef | |||
| bf56c8e4c7 | |||
| 7272e3e541 | |||
| 020c99e700 | |||
| 12a9610e7a | |||
| 0e6f4a7892 | |||
| f8c0852cb7 | |||
| ee48e7e2a4 | |||
| 821099c037 | |||
| 9a6211fc46 | |||
| ee8abe3ea8 | |||
| 654a9e0161 | |||
| 076c84c119 | |||
| 6fa80a5485 | |||
| e0ea6b17a1 | |||
| 60978167c2 | |||
| 6a848e081a | |||
| 2960d0d4b4 | |||
| 6b01861a26 | |||
| 5889942ff9 | |||
| 0359ddcc90 | |||
| 8409507dab | |||
| 208653223c | |||
| 62f6e12a86 | |||
| b662929c19 | |||
| 40895eac2f | |||
| dc7e90b2fe | |||
| 5d1f275ebc | |||
| 79192ce337 | |||
| 7f0f6c969a | |||
| e23beddf65 | |||
| 1fd51a4097 | |||
| 5ea124bcf6 | |||
| fa6ab9f58f | |||
| f7806103fb | |||
| 87acc5a4e3 | |||
| 7c49af085d | |||
| 0c3d5bd0f1 | |||
| 37d956bb5c | |||
| fef564b090 | |||
| d1c491ee80 | |||
| 0cd8a3b41f | |||
| f7e4a3d005 | |||
| a22ecb9620 | |||
| 57c22b617e | |||
| 84876bf7c1 | |||
| 2718f0ff2b | |||
| fca325855e | |||
| c6fc287a3f | |||
| 29fd0292e7 | |||
| 90cf83e3cd | |||
| f4c1f1fe34 | |||
| 9e85b9f828 | |||
| a9fd55c01f | |||
| 506a56a1a2 | |||
| c93e29606c | |||
| 4adc40aa90 | |||
| 4842a6091b | |||
| 9faf4123ef | |||
| cdf5b413a2 | |||
| 4dd2ccdb13 | |||
| 56c54d3cde | |||
| 19e2d5b869 | |||
| 0acf023556 | |||
| 71f6dc83fb | |||
| 3479ee2b87 | |||
| 609b9f1852 | |||
| 23c98d9218 | |||
| 57900a9617 | |||
| c3274a4311 | |||
| 356e2562da | |||
| 46c0078331 | |||
| bbc81f3d99 | |||
| 0dd662518e | |||
| 08d332e2c6 | |||
| b9001790be | |||
| d43bd8e659 | |||
| ef2886c963 | |||
| 7a6097fa69 | |||
| 9c45cebf51 | |||
| 344fc42d03 | |||
| 33a01b2c15 | |||
| d165174345 | |||
| 05314803bc | |||
| 9db8337f9b | |||
| abfd92ce07 | |||
| c11858aea2 | |||
| a67b28f0ad | |||
| b9f5baae5f | |||
| cb5e36ffb7 | |||
| 82ff37f4ee | |||
| 350c4bc4ed | |||
| 33f0866ea2 | |||
| df13a6e29d | |||
| ee8fa96c40 | |||
| c264cd38e3 | |||
| 64f669753f | |||
| aabc4310fd | |||
| 9dc3996aef | |||
| e0e9e657c9 | |||
| 84cbab334f | |||
| f9751e770a | |||
| 6539c9179e | |||
| f43a7acf35 | |||
| ca96bacde6 | |||
| d4c94b7ab9 | |||
| 0c9e607c33 | |||
| b5c6ce2aa5 | |||
| 66f58ea20d | |||
| d6979289e2 | |||
| 496387b5c6 | |||
| 6b0d75fc60 | |||
| 7d263699da | |||
| 63e4e4e791 | |||
| 98c260f621 | |||
| 1b57dc74cf | |||
| 4f140d0d58 | |||
| 0d021e6bad | |||
| 1a0af47613 | |||
| ead509bb32 | |||
| ddfde73f1e | |||
| 3de5a2320d | |||
| 5cb32a9a77 | |||
| ecbb4ac55c | |||
| 84e0561fff | |||
| 71bfbb2afc | |||
| 2cb563320b | |||
| f3837f35b0 | |||
| fa52b8e040 | |||
| c80b5a9160 | |||
| 65ac5590c7 | |||
| 3cee7f2a95 | |||
| 3034b49586 | |||
| 718ffb3124 | |||
| 7173c49561 | |||
| 4407f37f8c | |||
| 37a16f6292 | |||
| 83d9e0c5f7 | |||
| d2249e031a | |||
| 2522e67705 | |||
| 371514157c | |||
| de889045e6 | |||
| 6225ba8207 | |||
| 36c9319bce | |||
| d4d494218b | |||
| a3d6b11c69 | |||
| 852edf1b13 | |||
| 6806290d98 | |||
| 66f7a51462 | |||
| 0e1e69dc9a | |||
| 2ef24fe6e9 | |||
| 54c2d90334 | |||
| 577f2041a1 | |||
| 2f3e74fbfe | |||
| b0fa911322 | |||
| 473b9f22fb | |||
| cc1e1bf221 | |||
| a0c85b3fcb | |||
| 0f41bd99aa | |||
| 7a3a207462 | |||
| 7206b3c37e | |||
| 4cf8b6167f | |||
| b19b438489 | |||
| d3ee6d9ea3 | |||
| dd9789c4f3 | |||
| 67571e3d7a | |||
| a0e17f557d | |||
| 684946bb14 | |||
| 4aab6b1688 | |||
| 310a79f41d | |||
| f8164ca1eb | |||
| 790a9eae6c | |||
| b41edd314f | |||
| 34d8a93c01 | |||
| 3b45d8fe35 | |||
| aba1fcdc7b | |||
| 012d7caa52 | |||
| e7e20da206 | |||
| ef6535897b | |||
| 8c75ecbd0a | |||
| fad3c4243d | |||
| a6e75114cb | |||
| 48a83bc0d5 | |||
| b58475b426 | |||
| 207daab105 | |||
| c32da27b7f | |||
| 1f94c14634 | |||
| 4880ea8301 | |||
| a2d165d475 | |||
| d142f0c868 | |||
| 746838010a | |||
| a74d865c57 | |||
| 0a37323cef | |||
| b36b80eae0 | |||
| acb7727f3c | |||
| c16f5d2ddd | |||
| 4ca449d557 | |||
| da70d7c064 | |||
| 0be1eac5fe | |||
| e0eabbcbda | |||
| bd7b561b28 | |||
| 37c3a1ec76 | |||
| 62e69ad5bf | |||
| 3a6ba51a69 | |||
| 767088f1d0 | |||
| d0f6999dd8 | |||
| f88d7892bd | |||
| 3df5e406ef | |||
| 8e0728c2b4 | |||
| 0a2d47110d | |||
| 4ed8c825dd | |||
| 0a6d01628f | |||
| 453c8e0cad | |||
| ee43d1e985 | |||
| 86d472fb88 | |||
| 61c3458088 | |||
| 85c4768e51 | |||
| f1b4ce469e | |||
| 6071b3eb44 | |||
| 1d2bd20584 | |||
| 756389e6c6 | |||
| 4b19129a2f | |||
| f6aadf1115 | |||
| 3a5de50353 | |||
| cf3b8749dc | |||
| 34ff300515 | |||
| 0738993d4c | |||
| 9765fe1807 | |||
| 968e904715 | |||
| 90985b899b | |||
| d81e0dd72c | |||
| ee8751163c | |||
| 5476e9633e | |||
| 84d800a698 | |||
| eb39e1b7c5 | |||
| 57fa738c59 | |||
| bfc02a7d48 | |||
| e963e03c81 | |||
| f1c25a3673 | |||
| 90d5a8d43b | |||
| e1b4af2402 | |||
| 86c7be4e7d | |||
| 8686df3d8a | |||
| 6b04246f42 | |||
| 8e40092130 | |||
| b8dbde5ee1 | |||
| ae6d37e80d | |||
| 6dcc711006 | |||
| a616cb6022 | |||
| 837781389c | |||
| f23ff88878 | |||
| ddc038add4 | |||
| f037617dd9 | |||
| 84cff70567 | |||
| 8a1b3a1b00 | |||
| f11a81ef05 | |||
| eb8595e247 | |||
| 85520b937f | |||
| ec5bee558c | |||
| 857295d92b | |||
| 4da2c43251 | |||
| fc1681d111 | |||
| 692a350128 | |||
| 47f29899a2 | |||
| a0dfd20110 | |||
| 92aadad5cb | |||
| 52092e7e9c | |||
| ecfb8faf01 | |||
| e5dd4b15f4 | |||
| 6e070285e3 | |||
| d13cdf63c2 | |||
| c3884774e1 | |||
| 983b70821a | |||
| 8e60aa0249 | |||
| 69962781aa | |||
| a921b83c1f | |||
| ea8be0559a | |||
| 66f117186c | |||
| 4ff39009d2 | |||
| 981a42cd7e | |||
| 062938d0e4 | |||
| cc7044c7de | |||
| 7d771bf39b | |||
| 3261aa7c41 | |||
| d79c13b370 | |||
| 55c1cb40a2 | |||
| d570ab7e3d | |||
| e3ebfcb27d | |||
| 2230dade45 | |||
| 637e46b868 | |||
| 473d5d1a5a |
1
.idea/.gitignore
generated
vendored
Normal file
1
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/saveactions_settings.xml
|
||||||
558
.idea/dbnavigator.xml
generated
Normal file
558
.idea/dbnavigator.xml
generated
Normal file
File diff suppressed because one or more lines are too long
16
.idea/deploymentTargetDropDown.xml
generated
16
.idea/deploymentTargetDropDown.xml
generated
@@ -1,16 +0,0 @@
|
|||||||
<?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>
|
|
||||||
3
.idea/runConfigurations/app_base.xml
generated
3
.idea/runConfigurations/app_base.xml
generated
@@ -15,6 +15,7 @@
|
|||||||
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
|
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
|
||||||
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
|
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
|
||||||
<option name="FORCE_STOP_RUNNING_APP" value="true" />
|
<option name="FORCE_STOP_RUNNING_APP" value="true" />
|
||||||
|
<option name="INSPECTION_WITHOUT_ACTIVITY_RESTART" value="false" />
|
||||||
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
|
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
|
||||||
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
|
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
|
||||||
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
|
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
|
||||||
@@ -45,7 +46,7 @@
|
|||||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||||
<option name="STARTUP_PROFILING_ENABLED" value="false" />
|
<option name="STARTUP_PROFILING_ENABLED" value="false" />
|
||||||
<option name="STARTUP_CPU_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_CPU_PROFILING_CONFIGURATION_NAME" value="Callstack Sample" />
|
||||||
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
|
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
|
||||||
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
|
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
|
||||||
</Profilers>
|
</Profilers>
|
||||||
|
|||||||
3
.idea/runConfigurations/app_vglimenti.xml
generated
3
.idea/runConfigurations/app_vglimenti.xml
generated
@@ -15,6 +15,7 @@
|
|||||||
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
|
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
|
||||||
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
|
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
|
||||||
<option name="FORCE_STOP_RUNNING_APP" value="true" />
|
<option name="FORCE_STOP_RUNNING_APP" value="true" />
|
||||||
|
<option name="INSPECTION_WITHOUT_ACTIVITY_RESTART" value="false" />
|
||||||
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
|
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
|
||||||
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
|
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
|
||||||
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
|
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
|
||||||
@@ -45,7 +46,7 @@
|
|||||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||||
<option name="STARTUP_PROFILING_ENABLED" value="false" />
|
<option name="STARTUP_PROFILING_ENABLED" value="false" />
|
||||||
<option name="STARTUP_CPU_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_CPU_PROFILING_CONFIGURATION_NAME" value="Callstack Sample" />
|
||||||
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
|
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
|
||||||
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
|
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
|
||||||
</Profilers>
|
</Profilers>
|
||||||
|
|||||||
@@ -1,13 +1,17 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
apply plugin: 'com.google.firebase.firebase-perf'
|
|
||||||
|
if (!project.hasProperty("disable-performance-plugin")) {
|
||||||
|
apply plugin: 'com.google.firebase.firebase-perf'
|
||||||
|
}
|
||||||
|
|
||||||
apply plugin: 'com.google.firebase.crashlytics'
|
apply plugin: 'com.google.firebase.crashlytics'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 252
|
def appVersionCode = 315
|
||||||
def appVersionName = '1.21.0'
|
def appVersionName = '1.29.11'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
@@ -27,12 +31,12 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compileSdkVersion 30
|
compileSdkVersion 32
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "it.integry.integrywmsnative"
|
applicationId "it.integry.integrywmsnative"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 30
|
targetSdkVersion 32
|
||||||
versionCode appVersionCode
|
versionCode appVersionCode
|
||||||
versionName appVersionName
|
versionName appVersionName
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
@@ -74,11 +78,12 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lintOptions {
|
|
||||||
abortOnError false
|
|
||||||
}
|
|
||||||
|
|
||||||
dynamicFeatures = [":dynamic__base", ":dynamic_vgalimenti"]
|
dynamicFeatures = [":dynamic__base", ":dynamic_vgalimenti"]
|
||||||
|
lint {
|
||||||
|
abortOnError false
|
||||||
|
}
|
||||||
|
namespace 'it.integry.integrywmsnative'
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -89,42 +94,47 @@ dependencies {
|
|||||||
exclude group: 'com.android.support', module: 'support-annotations'
|
exclude group: 'com.android.support', module: 'support-annotations'
|
||||||
})
|
})
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
implementation 'com.orhanobut:logger:2.2.0'
|
implementation 'com.github.lupaulus:logger:2.3.2'
|
||||||
|
|
||||||
//Firebase
|
//Firebase
|
||||||
|
|
||||||
// Import the Firebase BoM
|
// Import the Firebase BoM
|
||||||
implementation platform('com.google.firebase:firebase-bom:26.3.0')
|
implementation platform('com.google.firebase:firebase-bom:29.1.0')
|
||||||
implementation 'com.google.firebase:firebase-analytics'
|
implementation 'com.google.firebase:firebase-analytics'
|
||||||
implementation 'com.google.firebase:firebase-core'
|
implementation 'com.google.firebase:firebase-core'
|
||||||
implementation 'com.google.firebase:firebase-crash'
|
|
||||||
implementation 'com.google.firebase:firebase-crashlytics'
|
implementation 'com.google.firebase:firebase-crashlytics'
|
||||||
implementation 'com.google.firebase:firebase-perf'
|
implementation 'com.google.firebase:firebase-perf'
|
||||||
implementation 'com.google.android.gms:play-services-basement:17.6.0'
|
implementation 'com.google.android.gms:play-services-basement:18.1.0'
|
||||||
|
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.3.1'
|
implementation 'androidx.appcompat:appcompat:1.5.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.4.0'
|
implementation 'com.google.android.material:material:1.6.1'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
implementation 'androidx.preference:preference-ktx:1.1.1'
|
|
||||||
|
implementation('androidx.preference:preference-ktx:1.2.0') {
|
||||||
|
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel'
|
||||||
|
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
|
||||||
|
}
|
||||||
|
|
||||||
|
implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0"
|
||||||
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
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.2'
|
implementation 'com.annimon:stream:1.2.2'
|
||||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
|
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.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.1'
|
|
||||||
implementation 'org.apache.commons:commons-text:1.9'
|
implementation 'org.apache.commons:commons-text:1.9'
|
||||||
|
|
||||||
//MVVM
|
//MVVM
|
||||||
def dagger2_version = '2.35.1'
|
def dagger2_version = '2.40.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"
|
||||||
api "com.google.dagger:dagger-android-support:$dagger2_version" // if you use the support libraries
|
api "com.google.dagger:dagger-android-support:$dagger2_version"
|
||||||
|
// if you use the support libraries
|
||||||
annotationProcessor "com.google.dagger:dagger-android-processor:$dagger2_version"
|
annotationProcessor "com.google.dagger:dagger-android-processor:$dagger2_version"
|
||||||
|
|
||||||
//FAB
|
//FAB
|
||||||
@@ -134,13 +144,11 @@ dependencies {
|
|||||||
implementation 'com.github.cachapa:ExpandableLayout:2.9.2'
|
implementation 'com.github.cachapa:ExpandableLayout:2.9.2'
|
||||||
implementation 'com.github.frankiesardo:linearlistview:1.0.1@aar'
|
implementation 'com.github.frankiesardo:linearlistview:1.0.1@aar'
|
||||||
implementation 'com.github.fede87:StatusBarAlert:1.0.1'
|
implementation 'com.github.fede87:StatusBarAlert:1.0.1'
|
||||||
implementation 'com.github.akshay2211:Stash:master'
|
|
||||||
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.3.0"
|
def room_version = "2.4.3"
|
||||||
|
|
||||||
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"
|
||||||
@@ -154,12 +162,22 @@ 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')
|
||||||
androidTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1'
|
|
||||||
androidTestImplementation 'org.testng:testng:7.4.0'
|
|
||||||
|
|
||||||
|
|
||||||
implementation 'com.github.RaviKoradiya:LiveAdapter:1.3.4'
|
implementation 'com.github.RaviKoradiya:LiveAdapter:1.3.4'
|
||||||
implementation 'org.reflections:reflections:0.10.2'
|
|
||||||
|
// Required -- JUnit 4 framework
|
||||||
|
// testImplementation "org.junit.jupiter:junit-jupiter-api:5.8.1"
|
||||||
|
// androidTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
|
||||||
|
// androidTestImplementation 'org.testng:testng:7.4.0'
|
||||||
|
|
||||||
|
|
||||||
|
//Bluetooth device manager
|
||||||
|
implementation 'com.github.harry1453:android-bluetooth-serial:v1.1'
|
||||||
|
|
||||||
|
// RxJava is also required.
|
||||||
|
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
|
||||||
|
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
package it.integry.integrywmsnative;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import androidx.test.InstrumentationRegistry;
|
|
||||||
import androidx.test.runner.AndroidJUnit4;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instrumentation test, which will execute on an Android device.
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
|
||||||
public class ExampleInstrumentedTest {
|
|
||||||
@Test
|
|
||||||
public void useAppContext() throws Exception {
|
|
||||||
// Context of the app under test.
|
|
||||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
|
||||||
|
|
||||||
assertEquals("it.integry.integrywmsnative", appContext.getPackageName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.gest.spedizione;
|
|
||||||
|
|
||||||
class SpedizioneViewModelTest {
|
|
||||||
|
|
||||||
@org.junit.jupiter.api.Test
|
|
||||||
void createNewLU() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
package="it.integry.integrywmsnative">
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||||
@@ -8,6 +7,7 @@
|
|||||||
<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" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".MainApplication"
|
android:name=".MainApplication"
|
||||||
@@ -19,17 +19,25 @@
|
|||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme"
|
android:theme="@style/AppTheme"
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
android:fullBackupContent="@xml/backup_descriptor">
|
android:fullBackupContent="@xml/backup_descriptor"
|
||||||
|
android:requestLegacyExternalStorage="true">
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.spedizione.SpedizioneActivity"
|
android:name=".gest.spedizione.SpedizioneActivity"
|
||||||
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:screenOrientation="portrait"
|
||||||
android:theme="@style/Light"
|
android:theme="@style/Light"
|
||||||
android:windowSoftInputMode="adjustNothing" />
|
android:windowSoftInputMode="adjustNothing" />
|
||||||
<activity android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
<activity
|
||||||
|
android:name=".gest.prod_dettaglio_linea.ProdDettaglioLineaActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/Light"
|
||||||
|
android:windowSoftInputMode="adjustNothing" />
|
||||||
|
<activity
|
||||||
|
android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/Light"
|
android:theme="@style/Light"
|
||||||
android:windowSoftInputMode="adjustNothing" />
|
android:windowSoftInputMode="adjustNothing" />
|
||||||
@@ -40,7 +48,8 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".gest.main.MainActivity"
|
android:name=".gest.main.MainActivity"
|
||||||
android:theme="@style/Light"
|
android:theme="@style/Light"
|
||||||
android:windowSoftInputMode="adjustNothing">
|
android:windowSoftInputMode="adjustNothing"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.CLIENTBARCODEACTIVITY" />
|
<action android:name="android.intent.action.CLIENTBARCODEACTIVITY" />
|
||||||
|
|
||||||
@@ -73,7 +82,8 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".SplashActivity"
|
android:name=".SplashActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/SplashTheme">
|
android:theme="@style/SplashTheme"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,12 @@ 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.core.expansion.BaseActivityComponent;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseActivityModule;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragmentComponent;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragmentModule;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseFragmentComponent;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseFragmentModule;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneComponent;
|
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneComponent;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneModule;
|
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneModule;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingComponent;
|
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingComponent;
|
||||||
@@ -15,10 +21,14 @@ import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDo
|
|||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoModule;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoModule;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormComponent;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormComponent;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormModule;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormModule;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsModule;
|
||||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleComponent;
|
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleComponent;
|
||||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
||||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliComponent;
|
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliComponent;
|
||||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliModule;
|
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliModule;
|
||||||
|
import it.integry.integrywmsnative.gest.login.LoginComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.login.LoginModule;
|
||||||
import it.integry.integrywmsnative.gest.main.MainActivityComponent;
|
import it.integry.integrywmsnative.gest.main.MainActivityComponent;
|
||||||
import it.integry.integrywmsnative.gest.main.MainActivityModule;
|
import it.integry.integrywmsnative.gest.main.MainActivityModule;
|
||||||
import it.integry.integrywmsnative.gest.main.MainFragmentComponent;
|
import it.integry.integrywmsnative.gest.main.MainFragmentComponent;
|
||||||
@@ -31,10 +41,14 @@ 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.ProdOrdineProduzioneElencoComponent;
|
||||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoModule;
|
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoModule;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_dettaglio_linea.ProdDettaglioLineaComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_dettaglio_linea.ProdDettaglioLineaModule;
|
||||||
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_linee_produzione.ProdLineeProduzioneComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.ProdLineeProduzioneModule;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeComponent;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeComponent;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeModule;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeModule;
|
||||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceComponent;
|
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceComponent;
|
||||||
@@ -43,12 +57,16 @@ import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamento
|
|||||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeModule;
|
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_ordine_acquisto_edit.dialog.DialogEditArticoloComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.DialogEditArticoloModule;
|
||||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaComponent;
|
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaComponent;
|
||||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaModule;
|
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;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.SpedizioneModule;
|
import it.integry.integrywmsnative.gest.spedizione.SpedizioneModule;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione.dialogs.print_sscc_list.DialogPrintOrderSSCCListComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione.dialogs.print_sscc_list.DialogPrintOrderSSCCListModule;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.prod_fabbisogno_linee_prod.DialogRowInfoProdFabbisognoLineeProdComponent;
|
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.prod_fabbisogno_linee_prod.DialogRowInfoProdFabbisognoLineeProdComponent;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.prod_fabbisogno_linee_prod.DialogRowInfoProdFabbisognoLineeProdModule;
|
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.prod_fabbisogno_linee_prod.DialogRowInfoProdFabbisognoLineeProdModule;
|
||||||
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneClienteComponent;
|
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneClienteComponent;
|
||||||
@@ -57,14 +75,19 @@ import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviForn
|
|||||||
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.VersamentoMerceComponent;
|
||||||
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceModule;
|
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceModule;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteComponent;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteModule;
|
||||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsComponent;
|
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsComponent;
|
||||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsModule;
|
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.DialogChooseBatchLotComponent;
|
||||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotModule;
|
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotModule;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialogComponent;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdComponent;
|
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_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.printSsccUl.DialogPrintUlSSCCComponent;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.printSsccUl.DialogPrintUlSSCCModule;
|
||||||
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.DialogScanOrCreateLUComponent;
|
||||||
@@ -76,6 +99,10 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
|||||||
RoomModule.class,
|
RoomModule.class,
|
||||||
SplashActivityModule.class,
|
SplashActivityModule.class,
|
||||||
MainApplicationModule.class,
|
MainApplicationModule.class,
|
||||||
|
BaseActivityModule.class,
|
||||||
|
BaseFragmentModule.class,
|
||||||
|
BaseDialogFragmentModule.class,
|
||||||
|
LoginModule.class,
|
||||||
MainActivityModule.class,
|
MainActivityModule.class,
|
||||||
MainFragmentModule.class,
|
MainFragmentModule.class,
|
||||||
MainAccettazioneModule.class,
|
MainAccettazioneModule.class,
|
||||||
@@ -106,46 +133,111 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
|||||||
DialogChooseArtsFromListaArtsModule.class,
|
DialogChooseArtsFromListaArtsModule.class,
|
||||||
DocInterniModule.class,
|
DocInterniModule.class,
|
||||||
DialogSelectDocInfoModule.class,
|
DialogSelectDocInfoModule.class,
|
||||||
DocInterniEditFormModule.class
|
DocInterniEditFormModule.class,
|
||||||
|
DialogSelectDocRowsModule.class,
|
||||||
|
DialogAskClienteModule.class,
|
||||||
|
DialogEditArticoloModule.class,
|
||||||
|
DialogPrintOrderSSCCListModule.class,
|
||||||
|
ProdLineeProduzioneModule.class,
|
||||||
|
ProdDettaglioLineaModule.class,
|
||||||
|
DialogPrintUlSSCCModule.class
|
||||||
})
|
})
|
||||||
public interface MainApplicationComponent {
|
public interface MainApplicationComponent {
|
||||||
|
|
||||||
|
BaseActivityComponent.Factory baseActivityComponent();
|
||||||
|
|
||||||
|
BaseFragmentComponent.Factory baseFragmentComponent();
|
||||||
|
|
||||||
|
BaseDialogFragmentComponent.Factory baseDialogFragmentComponent();
|
||||||
|
|
||||||
SplashActivityComponent.Factory splashActivityComponent();
|
SplashActivityComponent.Factory splashActivityComponent();
|
||||||
|
|
||||||
|
LoginComponent.Factory loginActivityComponent();
|
||||||
|
|
||||||
MainActivityComponent.Factory mainActivityComponent();
|
MainActivityComponent.Factory mainActivityComponent();
|
||||||
|
|
||||||
MainFragmentComponent.Factory mainFragmentComponent();
|
MainFragmentComponent.Factory mainFragmentComponent();
|
||||||
|
|
||||||
MainAccettazioneComponent.Factory mainAccettazioneComponent();
|
MainAccettazioneComponent.Factory mainAccettazioneComponent();
|
||||||
|
|
||||||
ListaBancaliComponent.Factory listaBancaliComponent();
|
ListaBancaliComponent.Factory listaBancaliComponent();
|
||||||
|
|
||||||
ContenutoBancaleComponent.Factory contenutoBancaleComponent();
|
ContenutoBancaleComponent.Factory contenutoBancaleComponent();
|
||||||
|
|
||||||
PVOrdiniAcquistoGrigliaComponent.Factory pvOrdineAcquistoGrigliaComponent();
|
PVOrdiniAcquistoGrigliaComponent.Factory pvOrdineAcquistoGrigliaComponent();
|
||||||
|
|
||||||
PVOrdineAcquistoEditComponent.Factory pvOrdineAcquistoEditComponent();
|
PVOrdineAcquistoEditComponent.Factory pvOrdineAcquistoEditComponent();
|
||||||
|
|
||||||
PickingLiberoComponent.Factory pickingLiberoComponent();
|
PickingLiberoComponent.Factory pickingLiberoComponent();
|
||||||
|
|
||||||
RettificaGiacenzeComponent.Factory rettificaGiacenzeComponent();
|
RettificaGiacenzeComponent.Factory rettificaGiacenzeComponent();
|
||||||
|
|
||||||
SpedizioneComponent.Factory spedizioneComponent();
|
SpedizioneComponent.Factory spedizioneComponent();
|
||||||
|
|
||||||
AccettazionePickingComponent.Factory accettazionePickingComponent();
|
AccettazionePickingComponent.Factory accettazionePickingComponent();
|
||||||
|
|
||||||
UltimeConsegneClienteComponent.Factory ultimeConsegneClienteComponent();
|
UltimeConsegneClienteComponent.Factory ultimeConsegneClienteComponent();
|
||||||
|
|
||||||
UltimiArriviFornitoreComponent.Factory ultimiArriviFornitoreComponent();
|
UltimiArriviFornitoreComponent.Factory ultimiArriviFornitoreComponent();
|
||||||
|
|
||||||
PickingResiComponent.Factory pickingResiComponent();
|
PickingResiComponent.Factory pickingResiComponent();
|
||||||
|
|
||||||
OrdiniUscitaElencoComponent.Factory prodOrdineLavorazioneElencoComponent();
|
OrdiniUscitaElencoComponent.Factory prodOrdineLavorazioneElencoComponent();
|
||||||
|
|
||||||
|
DialogAskClienteComponent.Factory dialogAskClienteComponent();
|
||||||
|
|
||||||
DialogInputQuantityV2Component.Factory dialogInputQuantityV2Component();
|
DialogInputQuantityV2Component.Factory dialogInputQuantityV2Component();
|
||||||
|
|
||||||
DialogInputLUProdComponent.Factory dialogInputLUProdComponent();
|
DialogInputLUProdComponent.Factory dialogInputLUProdComponent();
|
||||||
|
|
||||||
DialogScanArtComponent.Factory dialogScanArtComponent();
|
DialogScanArtComponent.Factory dialogScanArtComponent();
|
||||||
|
|
||||||
DialogScanOrCreateLUComponent.Factory dialogScanOrCreateLUComponent();
|
DialogScanOrCreateLUComponent.Factory dialogScanOrCreateLUComponent();
|
||||||
|
|
||||||
ProdFabbisognoLineeProdComponent.Factory prodFabbisognoLineeProdComponent();
|
ProdFabbisognoLineeProdComponent.Factory prodFabbisognoLineeProdComponent();
|
||||||
|
|
||||||
VersamentoMerceComponent.Factory versamentoMerceComponent();
|
VersamentoMerceComponent.Factory versamentoMerceComponent();
|
||||||
|
|
||||||
DialogAskMagazzinoProssimitaComponent.Factory dialogAskMagazzinoProssimitaComponent();
|
DialogAskMagazzinoProssimitaComponent.Factory dialogAskMagazzinoProssimitaComponent();
|
||||||
|
|
||||||
DialogChooseBatchLotComponent.Factory dialogChooseBatchLotComponent();
|
DialogChooseBatchLotComponent.Factory dialogChooseBatchLotComponent();
|
||||||
|
|
||||||
DialogRowInfoProdFabbisognoLineeProdComponent.Factory dialogRowInfoProdFabbisognoLineeProdComponent();
|
DialogRowInfoProdFabbisognoLineeProdComponent.Factory dialogRowInfoProdFabbisognoLineeProdComponent();
|
||||||
|
|
||||||
ProdRientroMerceComponent.Factory prodRientroMerceComponent();
|
ProdRientroMerceComponent.Factory prodRientroMerceComponent();
|
||||||
|
|
||||||
ProdRientroMerceOrderDetailComponent.Factory prodRientroMerceOrderDetailComponent();
|
ProdRientroMerceOrderDetailComponent.Factory prodRientroMerceOrderDetailComponent();
|
||||||
|
|
||||||
ProdOrdineProduzioneElencoComponent.Factory prodOrdineProduzioneElencoComponent();
|
ProdOrdineProduzioneElencoComponent.Factory prodOrdineProduzioneElencoComponent();
|
||||||
|
|
||||||
ProdRecuperoMaterialeComponent.Factory prodRecuperoMaterialeComponent();
|
ProdRecuperoMaterialeComponent.Factory prodRecuperoMaterialeComponent();
|
||||||
|
|
||||||
ProdVersamentoMaterialeComponent.Factory prodVersamentoMaterialeComponent();
|
ProdVersamentoMaterialeComponent.Factory prodVersamentoMaterialeComponent();
|
||||||
|
|
||||||
DialogChooseArtsFromListaArtsComponent.Factory dialogChooseArtsFromListaArtsComponent();
|
DialogChooseArtsFromListaArtsComponent.Factory dialogChooseArtsFromListaArtsComponent();
|
||||||
|
|
||||||
DocInterniComponent.Factory docInterniComponent();
|
DocInterniComponent.Factory docInterniComponent();
|
||||||
|
|
||||||
DialogSelectDocInfoComponent.Factory dialogSelectMgrpDtipPairComponent();
|
DialogSelectDocInfoComponent.Factory dialogSelectMgrpDtipPairComponent();
|
||||||
|
|
||||||
|
DialogSelectDocRowsComponent.Factory dialogSelectDocRowsComponent();
|
||||||
|
|
||||||
DocInterniEditFormComponent.Factory docInterniEditFormComponent();
|
DocInterniEditFormComponent.Factory docInterniEditFormComponent();
|
||||||
|
|
||||||
|
InfoAggiuntiveLUDialogComponent.Factory infoAggiuntiveLUDialogComponent();
|
||||||
|
|
||||||
|
DialogEditArticoloComponent.Factory dialogEditArticoloComponent();
|
||||||
|
|
||||||
|
DialogPrintOrderSSCCListComponent.Factory dialogPrintOrderSSCCListComponent();
|
||||||
|
|
||||||
|
ProdLineeProduzioneComponent.Factory prodLineeProduzioneComponent();
|
||||||
|
|
||||||
|
ProdDettaglioLineaComponent.Factory prodDettaglioLineaComponent();
|
||||||
|
|
||||||
|
DialogPrintUlSSCCComponent.Factory dialogPrintUlSSCCComponent();
|
||||||
|
|
||||||
void inject(MainApplication mainApplication);
|
void inject(MainApplication mainApplication);
|
||||||
|
|
||||||
void inject(AppContext mainApplication);
|
void inject(AppContext mainApplication);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,16 +17,23 @@ 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.CommessaRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.CommessaRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.DocumentiRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.EntityRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.EntityRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
||||||
|
import it.integry.integrywmsnative.core.update.UpdatesManager;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
public class MainApplicationModule {
|
public class MainApplicationModule {
|
||||||
@@ -69,6 +76,24 @@ public class MainApplicationModule {
|
|||||||
return new MenuService(menuRESTConsumer);
|
return new MenuService(menuRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
UpdatesManager provideUpdatesManager() {
|
||||||
|
return new UpdatesManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
DialogProgressView providesDialogProgressView() {
|
||||||
|
return DialogProgressView.newInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
DialogInputQuantityV2View providesDialogInputQuantityV2View() {
|
||||||
|
return new DialogInputQuantityV2View();
|
||||||
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
OrdiniRESTConsumer provideOrdiniRESTConsumer(SystemRESTConsumer systemRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
OrdiniRESTConsumer provideOrdiniRESTConsumer(SystemRESTConsumer systemRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
||||||
@@ -165,5 +190,28 @@ public class MainApplicationModule {
|
|||||||
return new DocInterniRESTConsumer();
|
return new DocInterniRESTConsumer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
GiacenzaRESTConsumer provideGiacenzaRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||||
|
return new GiacenzaRESTConsumer(systemRESTConsumer, articoloRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
InventarioService provideInventarioService(GiacenzaRESTConsumer giacenzaRESTConsumer) {
|
||||||
|
return new InventarioService(giacenzaRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
ProductionLinesRESTConsumer provideProductionLinesRESTConsumer() {
|
||||||
|
return new ProductionLinesRESTConsumer();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
DocumentiRESTConsumer provideDocumentiRESTConsumer() {
|
||||||
|
return new DocumentiRESTConsumer();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package it.integry.integrywmsnative;
|
package it.integry.integrywmsnative;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
@@ -38,6 +39,12 @@ public class SplashActivity extends BaseActivity implements MainContext.Listener
|
|||||||
|
|
||||||
private RunnableArgsss<Integer, String[], List<Integer>> onRequestPermissionResult;
|
private RunnableArgsss<Integer, String[], List<Integer>> onRequestPermissionResult;
|
||||||
|
|
||||||
|
public static void startActivity(Context context) {
|
||||||
|
Intent intent = new Intent(context, SplashActivity.class);
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public class CommonConst {
|
|||||||
|
|
||||||
public static String DEFAULT_ANONYMOUS_UL_SERIE = "UL";
|
public static String DEFAULT_ANONYMOUS_UL_SERIE = "UL";
|
||||||
|
|
||||||
public static int NUMBER_OF_DECIMAL_DIGITS = 3;
|
public static int NUMBER_OF_DECIMAL_DIGITS = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Files {
|
public static class Files {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class BarcodeCallbackDTO {
|
|||||||
return onScanSuccessfull;
|
return onScanSuccessfull;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BarcodeCallbackDTO setOnScanSuccessfull(RunnableArgs<BarcodeScanDTO> onScanSuccessfull) {
|
public BarcodeCallbackDTO setOnScanSuccessful(RunnableArgs<BarcodeScanDTO> onScanSuccessfull) {
|
||||||
this.onScanSuccessfull = onScanSuccessfull;
|
this.onScanSuccessfull = onScanSuccessfull;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,21 @@
|
|||||||
package it.integry.integrywmsnative.core.barcode_reader;
|
package it.integry.integrywmsnative.core.barcode_reader;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.util.Pair;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
|
||||||
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
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.interfaces.BarcodeReaderInterface;
|
import it.integry.barcode_base_android_library.interfaces.BarcodeReaderInterface;
|
||||||
|
import it.integry.barcode_base_android_library.model.BarcodeSetting;
|
||||||
import it.integry.honeywellscannerlibrary.HoneyWellBarcodeReader;
|
import it.integry.honeywellscannerlibrary.HoneyWellBarcodeReader;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
|
import it.integry.integrywmsnative.gest.settings.MainSettingsFragment;
|
||||||
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;
|
||||||
@@ -21,12 +28,7 @@ public class BarcodeManager {
|
|||||||
private static boolean mEnabled = true;
|
private static boolean mEnabled = true;
|
||||||
|
|
||||||
|
|
||||||
private static final Class<? extends BarcodeReaderInterface>[] registeredBarcodeReaderInterfaces = new Class[]{
|
private static final Class<? extends BarcodeReaderInterface>[] registeredBarcodeReaderInterfaces = new Class[]{PointMobileBarcodeReader.class, ZebraBarcodeReader.class, HoneyWellBarcodeReader.class, KeyboardEmulatorBarcodeReader.class};
|
||||||
PointMobileBarcodeReader.class,
|
|
||||||
ZebraBarcodeReader.class,
|
|
||||||
HoneyWellBarcodeReader.class,
|
|
||||||
KeyboardEmulatorBarcodeReader.class
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
public static void init(Context applicationContext) throws Exception {
|
public static void init(Context applicationContext) throws Exception {
|
||||||
@@ -65,6 +67,18 @@ public class BarcodeManager {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(applicationContext);
|
||||||
|
var additionalSettings = new ArrayList<Pair<String, Object>>();
|
||||||
|
var scanDelay = sharedPreferences.getString(MainSettingsFragment.KEY_TRIGGER_SCAN_DELAY, null);
|
||||||
|
var scanDelaySetting = new Pair<String, Object>(BarcodeSetting.P_TRIGGER_SCAN_DELAY, scanDelay);
|
||||||
|
additionalSettings.add(scanDelaySetting);
|
||||||
|
|
||||||
|
var scanMode = sharedPreferences.getString(MainSettingsFragment.KEY_TRIGGER_SCAN_MODE, null);
|
||||||
|
var scanModeSetting = new Pair<String, Object>(BarcodeSetting.P_TRIGGER_SCAN_MODE, scanMode);
|
||||||
|
additionalSettings.add(scanModeSetting);
|
||||||
|
|
||||||
|
BarcodeManager.changeSettings(additionalSettings);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -81,8 +95,7 @@ public class BarcodeManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,16 +136,21 @@ public class BarcodeManager {
|
|||||||
|
|
||||||
public static void disable() {
|
public static void disable() {
|
||||||
mEnabled = false;
|
mEnabled = false;
|
||||||
|
UtilityLogger.trace("Barcode reader disabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void enable() {
|
public static void enable() {
|
||||||
mEnabled = true;
|
mEnabled = true;
|
||||||
|
UtilityLogger.trace("Barcode reader enabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isEnabled() {
|
public static boolean isEnabled() {
|
||||||
return mEnabled;
|
return mEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void changeSettings(List<Pair<String, Object>> settings) {
|
||||||
|
mCurrentBarcodeInterface.changeSettings(settings);
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isKeyboardEmulator() {
|
public static boolean isKeyboardEmulator() {
|
||||||
return mCurrentBarcodeInterface instanceof KeyboardEmulatorBarcodeReader;
|
return mCurrentBarcodeInterface instanceof KeyboardEmulatorBarcodeReader;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoF
|
|||||||
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoFragment;
|
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoFragment;
|
||||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoFragment;
|
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoFragment;
|
||||||
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_linee_produzione.ProdLineeProduzioneFragment;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
|
||||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceFragment;
|
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceFragment;
|
||||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment;
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment;
|
||||||
@@ -133,6 +134,14 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_prod_accettazione_produzione)
|
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_prod_accettazione_produzione)
|
||||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_external)
|
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_external)
|
||||||
.setFragmentFactory(ProdRientroMerceFragment::newInstance))
|
.setFragmentFactory(ProdRientroMerceFragment::newInstance))
|
||||||
|
|
||||||
|
.addItem(new MenuItem()
|
||||||
|
.setID(it.integry.integrywmsnative.R.id.nav_prod_linee)
|
||||||
|
.setCodMenu("MG061")
|
||||||
|
.setTitleText(it.integry.integrywmsnative.R.string.nav_prod_linee_title)
|
||||||
|
.setTitleIcon(R.drawable.ic_production_line)
|
||||||
|
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_production_line)
|
||||||
|
.setFragmentFactory(ProdLineeProduzioneFragment::newInstance))
|
||||||
).addGroup(
|
).addGroup(
|
||||||
new MenuGroup()
|
new MenuGroup()
|
||||||
.setGroupText(R.string.internal_handling)
|
.setGroupText(R.string.internal_handling)
|
||||||
|
|||||||
@@ -4,8 +4,11 @@ import android.content.Context;
|
|||||||
|
|
||||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||||
import com.orhanobut.logger.AndroidLogAdapter;
|
import com.orhanobut.logger.AndroidLogAdapter;
|
||||||
|
import com.orhanobut.logger.DiskLogAdapter;
|
||||||
import com.orhanobut.logger.Logger;
|
import com.orhanobut.logger.Logger;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
@@ -36,8 +39,6 @@ public class AppContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public void init() {
|
public void init() {
|
||||||
this.initUtilities();
|
this.initUtilities();
|
||||||
@@ -56,10 +57,10 @@ public class AppContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initCrashlytics() {
|
private void initCrashlytics() {
|
||||||
if(!BuildConfig.DEBUG) {
|
if (!BuildConfig.DEBUG) {
|
||||||
FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
|
FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
|
||||||
|
|
||||||
if( SettingsManager.isInstanceAvailable() &&
|
if (SettingsManager.isInstanceAvailable() &&
|
||||||
(SettingsManager.i().getUserSession() != null && !UtilityString.isNullOrEmpty(SettingsManager.i().getUserSession().getProfileDB())) &&
|
(SettingsManager.i().getUserSession() != null && !UtilityString.isNullOrEmpty(SettingsManager.i().getUserSession().getProfileDB())) &&
|
||||||
(SettingsManager.i().getUser() != null && !UtilityString.isNullOrEmpty(SettingsManager.i().getUser().getFullname()))) {
|
(SettingsManager.i().getUser() != null && !UtilityString.isNullOrEmpty(SettingsManager.i().getUser().getFullname()))) {
|
||||||
|
|
||||||
@@ -77,6 +78,11 @@ public class AppContext {
|
|||||||
|
|
||||||
private void initLogger() {
|
private void initLogger() {
|
||||||
Logger.addLogAdapter(new AndroidLogAdapter());
|
Logger.addLogAdapter(new AndroidLogAdapter());
|
||||||
|
|
||||||
|
File logsFolder = new File(mApplicationContext.getExternalFilesDir(null).getAbsolutePath());
|
||||||
|
int maxBytesSize = 5000;
|
||||||
|
Logger.addLogAdapter(new DiskLogAdapter(logsFolder, maxBytesSize));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class MainContext {
|
|||||||
try {
|
try {
|
||||||
BarcodeManager.init(applicationContext);
|
BarcodeManager.init(applicationContext);
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
|
exception.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.initDBData(() -> {
|
this.initDBData(() -> {
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.matcher.custom.Contains;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.matcher.custom.Equals;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.matcher.custom.EqualsIgnoreCase;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.matcher.custom.GreaterThan;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.matcher.custom.IsNull;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.matcher.custom.LessThan;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.matcher.custom.Not;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.query.Query;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
public class Coollection {
|
|
||||||
|
|
||||||
public static <T> Query<T> from(Collection<T> collection) {
|
|
||||||
return new Query<T>(collection);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Matcher eq(Object value) {
|
|
||||||
return new Equals(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Matcher contains(String value) {
|
|
||||||
return new Contains(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Matcher eqIgnoreCase(String value) {
|
|
||||||
return new EqualsIgnoreCase(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Matcher not(Matcher matcher) {
|
|
||||||
return new Not(matcher);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Matcher greaterThan(Number value) {
|
|
||||||
return new GreaterThan(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Matcher lessThan(Number value) {
|
|
||||||
return new LessThan(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Matcher isNull() {
|
|
||||||
return new IsNull();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.matcher;
|
|
||||||
|
|
||||||
public interface Matcher {
|
|
||||||
|
|
||||||
boolean match(Object value);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
|
||||||
|
|
||||||
public class Contains implements Matcher {
|
|
||||||
|
|
||||||
private final String matcherValue;
|
|
||||||
|
|
||||||
public Contains(String matcherValue) {
|
|
||||||
this.matcherValue = matcherValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean match(Object value) {
|
|
||||||
return String.valueOf(value).contains(matcherValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
|
||||||
|
|
||||||
public class Equals implements Matcher {
|
|
||||||
|
|
||||||
private final Object value;
|
|
||||||
|
|
||||||
public Equals(Object value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean match(Object anotherValue) {
|
|
||||||
return value.equals(anotherValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
|
||||||
|
|
||||||
public class EqualsIgnoreCase implements Matcher {
|
|
||||||
|
|
||||||
private final String value;
|
|
||||||
|
|
||||||
public EqualsIgnoreCase(String value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean match(Object anotherValue) {
|
|
||||||
return (value).equalsIgnoreCase((String) anotherValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
|
||||||
|
|
||||||
public class GreaterThan implements Matcher {
|
|
||||||
|
|
||||||
private final Number value;
|
|
||||||
|
|
||||||
public GreaterThan(Number value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean match(Object matchValue) {
|
|
||||||
if (matchValue == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return ((Number) matchValue).doubleValue() > value.doubleValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
|
||||||
|
|
||||||
public class IsNull implements Matcher {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean match(Object value) {
|
|
||||||
return value == null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
|
||||||
|
|
||||||
public class LessThan implements Matcher {
|
|
||||||
|
|
||||||
private final Number value;
|
|
||||||
|
|
||||||
public LessThan(Number value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean match(Object matchValue) {
|
|
||||||
if (matchValue == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return ((Number) matchValue).doubleValue() < value.doubleValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
|
||||||
|
|
||||||
public class Not implements Matcher {
|
|
||||||
|
|
||||||
private final Matcher matcher;
|
|
||||||
|
|
||||||
public Not(Matcher matcher) {
|
|
||||||
this.matcher = matcher;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean match(Object value) {
|
|
||||||
return !matcher.match(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.query;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.query.criteria.Criteria;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.query.criteria.CriteriaList;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.query.order.Order;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.query.order.OrderCriteria;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.query.specification.custom.AndSpecification;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.query.specification.custom.OrSpecification;
|
|
||||||
|
|
||||||
public class Query<T> {
|
|
||||||
|
|
||||||
private final Collection<T> collection;
|
|
||||||
private CriteriaList<T> criterias;
|
|
||||||
private OrderCriteria<T> orderCriteria;
|
|
||||||
|
|
||||||
public Query(Collection<T> collection) {
|
|
||||||
this.collection = collection;
|
|
||||||
criterias = new CriteriaList<T>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Query<T> where(String method, Matcher matcher) {
|
|
||||||
Criteria<T> criteria = new Criteria<T>(method, matcher);
|
|
||||||
criterias.add(criteria);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Query<T> and(String method, Matcher matcher) {
|
|
||||||
Criteria<T> criteria = new Criteria<T>(method, matcher);
|
|
||||||
criteria.setSpecification(new AndSpecification<T>());
|
|
||||||
criterias.add(criteria);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Query<T> or(String method, Matcher matcher) {
|
|
||||||
Criteria<T> criteria = new Criteria<T>(method, matcher);
|
|
||||||
criteria.setSpecification(new OrSpecification<T>());
|
|
||||||
criterias.add(criteria);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Query<T> orderBy(String method, Order order) {
|
|
||||||
orderCriteria = new OrderCriteria<T>(method, order);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Query<T> orderBy(String method) {
|
|
||||||
return orderBy(method, Order.ASC);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<T> all() {
|
|
||||||
List<T> all = new ArrayList<T>();
|
|
||||||
for (T item : collection) {
|
|
||||||
if (criterias.match(item)) {
|
|
||||||
all.add(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (orderCriteria != null) {
|
|
||||||
all = orderCriteria.sort(all);
|
|
||||||
}
|
|
||||||
return all;
|
|
||||||
}
|
|
||||||
|
|
||||||
public T first() {
|
|
||||||
List<T> all = cloneCollection(collection);
|
|
||||||
if (orderCriteria != null) {
|
|
||||||
all = orderCriteria.sort(all);
|
|
||||||
}
|
|
||||||
for (T item : all) {
|
|
||||||
if (criterias.match(item)) {
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<T> cloneCollection(Collection<T> collection) {
|
|
||||||
List<T> list = new ArrayList<T>();
|
|
||||||
for (T item : collection) {
|
|
||||||
list.add(item);
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.query.criteria;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.query.specification.Specification;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.reflection.Phanton;
|
|
||||||
|
|
||||||
public class Criteria<T> {
|
|
||||||
|
|
||||||
private final String method;
|
|
||||||
private final Matcher matcher;
|
|
||||||
private Specification<T> specification;
|
|
||||||
|
|
||||||
public Criteria(String method, Matcher matcher) {
|
|
||||||
this.method = method;
|
|
||||||
this.matcher = matcher;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSpecification(Specification<T> specification) {
|
|
||||||
this.specification = specification;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Specification<T> specification() {
|
|
||||||
return specification;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean match(T item) {
|
|
||||||
try {
|
|
||||||
Object value = Phanton.from(item).call(method);
|
|
||||||
return matcher.match(value);
|
|
||||||
} catch (Exception err) {
|
|
||||||
throw new RuntimeException(err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.query.criteria;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class CriteriaList<T> {
|
|
||||||
|
|
||||||
private List<Criteria<T>> criterias;
|
|
||||||
|
|
||||||
public CriteriaList() {
|
|
||||||
criterias = new ArrayList<Criteria<T>>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void add(Criteria<T> criteria) {
|
|
||||||
criterias.add(criteria);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean match(T item) {
|
|
||||||
if (criterias.size() == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (criterias.size() == 1) {
|
|
||||||
return criterias.get(0).match(item);
|
|
||||||
}
|
|
||||||
boolean matched = true;
|
|
||||||
for (int i = criterias.size() - 1; i > 0; i--) {
|
|
||||||
Criteria<T> one = criterias.get(i);
|
|
||||||
Criteria<T> other = criterias.get(i - 1);
|
|
||||||
matched = matched && one.specification().match(item, one, other);
|
|
||||||
}
|
|
||||||
return matched;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.query.order;
|
|
||||||
|
|
||||||
public enum Order {
|
|
||||||
ASC, DESC
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.query.order;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.coollection.reflection.Phanton;
|
|
||||||
|
|
||||||
import java.util.Comparator;
|
|
||||||
|
|
||||||
public class OrderComparator<T> implements Comparator<T> {
|
|
||||||
|
|
||||||
private final String method;
|
|
||||||
|
|
||||||
public OrderComparator(String method) {
|
|
||||||
this.method = method;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public int compare(T one, T other) {
|
|
||||||
Object oneValue = Phanton.from(one).call(method);
|
|
||||||
Object otherValue = Phanton.from(other).call(method);
|
|
||||||
if (oneValue == null || otherValue == null) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (oneValue instanceof Comparable) {
|
|
||||||
return ((Comparable<Object>) oneValue).compareTo(otherValue);
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.query.order;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class OrderCriteria<T> {
|
|
||||||
|
|
||||||
private final String method;
|
|
||||||
private final Order order;
|
|
||||||
|
|
||||||
public OrderCriteria(String method, Order order) {
|
|
||||||
this.method = method;
|
|
||||||
this.order = order;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<T> sort(List<T> list) {
|
|
||||||
Collections.sort(list, new OrderComparator<T>(method));
|
|
||||||
if (order == Order.DESC) {
|
|
||||||
Collections.reverse(list);
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.query.specification;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.coollection.query.criteria.Criteria;
|
|
||||||
|
|
||||||
public interface Specification<T> {
|
|
||||||
|
|
||||||
boolean match(T item, Criteria<T> one, Criteria<T> other);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.query.specification.custom;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.coollection.query.criteria.Criteria;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.query.specification.Specification;
|
|
||||||
|
|
||||||
public class AndSpecification<T> implements Specification<T> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean match(T item, Criteria<T> one, Criteria<T> other) {
|
|
||||||
return one.match(item) && other.match(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.query.specification.custom;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.coollection.query.criteria.Criteria;
|
|
||||||
import it.integry.integrywmsnative.core.coollection.query.specification.Specification;
|
|
||||||
|
|
||||||
public class OrSpecification<T> implements Specification<T> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean match(T item, Criteria<T> one, Criteria<T> other) {
|
|
||||||
return one.match(item) || other.match(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.coollection.reflection;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
|
|
||||||
public class Phanton<T> {
|
|
||||||
|
|
||||||
private final T target;
|
|
||||||
private Class<?> clazz;
|
|
||||||
|
|
||||||
private Phanton(T target) {
|
|
||||||
this.target = target;
|
|
||||||
clazz = target.getClass();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <T> Phanton<T> from(T target) {
|
|
||||||
return new Phanton<T>(target);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object call(String name) {
|
|
||||||
return invoke(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Object invoke(String name) {
|
|
||||||
for (final Field field : clazz.getDeclaredFields()) {
|
|
||||||
try {
|
|
||||||
if (name.equals(field.getName())) {
|
|
||||||
field.setAccessible(Boolean.TRUE);
|
|
||||||
return field.get(target);
|
|
||||||
}
|
|
||||||
} catch (final IllegalAccessException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw new RuntimeException("No such property with name " + name);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -8,7 +8,7 @@ import java.util.UUID;
|
|||||||
|
|
||||||
public class DataCache {
|
public class DataCache {
|
||||||
|
|
||||||
private static List<DataCacheDTO> dataCacheList = new ArrayList<>();
|
private static final List<DataCacheDTO> dataCacheList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
public static String addItem(Object item) {
|
public static String addItem(Object item) {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class ColliDataRecoverService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean thereIsAnExistantSession() {
|
public boolean thereIsAnExistantSession() {
|
||||||
return mtbColtsSessions.size() > 0;
|
return mtbColtsSessions != null && mtbColtsSessions.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Integer> getAllSessionIDs() {
|
public List<Integer> getAllSessionIDs() {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import androidx.room.Database;
|
|||||||
import androidx.room.RoomDatabase;
|
import androidx.room.RoomDatabase;
|
||||||
import androidx.room.TypeConverters;
|
import androidx.room.TypeConverters;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.converter.BigDecimalConverter;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.converter.DateConverter;
|
import it.integry.integrywmsnative.core.data_store.db.converter.DateConverter;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloGrigliaDao;
|
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloGrigliaDao;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloOrdineDao;
|
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloOrdineDao;
|
||||||
@@ -18,14 +19,13 @@ import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
|||||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||||
|
|
||||||
@Database(entities = {ArticoloGriglia.class, Griglia.class, Ordine.class, ArticoloOrdine.class, SqlMtbColt.class, SqlMtbColr.class}, version = 5, exportSchema = false)
|
@Database(entities = {ArticoloGriglia.class, Griglia.class, Ordine.class, ArticoloOrdine.class, SqlMtbColt.class, SqlMtbColr.class}, version = 10, exportSchema = false)
|
||||||
@TypeConverters({
|
@TypeConverters({
|
||||||
DateConverter.class
|
DateConverter.class,
|
||||||
|
BigDecimalConverter.class
|
||||||
})
|
})
|
||||||
public abstract class AppDatabase extends RoomDatabase {
|
public abstract class AppDatabase extends RoomDatabase {
|
||||||
|
|
||||||
// private AppDatabase mRoomInstance;
|
|
||||||
|
|
||||||
public abstract ArticoloGrigliaDao articoloGrigliaDao();
|
public abstract ArticoloGrigliaDao articoloGrigliaDao();
|
||||||
|
|
||||||
public abstract GrigliaDao grigliaDao();
|
public abstract GrigliaDao grigliaDao();
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package it.integry.integrywmsnative.core.data_store.db.converter;
|
||||||
|
|
||||||
|
import androidx.room.TypeConverter;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class BigDecimalConverter {
|
||||||
|
@TypeConverter
|
||||||
|
public static BigDecimal fromFloat(Float value) {
|
||||||
|
return value == null ? null : BigDecimal.valueOf(value.doubleValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeConverter
|
||||||
|
public static Float dateToTimestamp(BigDecimal value) {
|
||||||
|
return value == null ? null : value.floatValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,9 +4,10 @@ import androidx.room.Dao;
|
|||||||
import androidx.room.Delete;
|
import androidx.room.Delete;
|
||||||
import androidx.room.Insert;
|
import androidx.room.Insert;
|
||||||
import androidx.room.Query;
|
import androidx.room.Query;
|
||||||
|
import androidx.room.RawQuery;
|
||||||
import androidx.room.Update;
|
import androidx.room.Update;
|
||||||
|
import androidx.sqlite.db.SupportSQLiteQuery;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
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.ArticoloGriglia;
|
||||||
@@ -21,10 +22,13 @@ public interface ArticoloGrigliaDao {
|
|||||||
|
|
||||||
@Insert
|
@Insert
|
||||||
void insertAll(List<ArticoloGriglia> articoli);
|
void insertAll(List<ArticoloGriglia> articoli);
|
||||||
|
|
||||||
@Insert
|
@Insert
|
||||||
Long insert(ArticoloGriglia articolo);
|
Long insert(ArticoloGriglia articolo);
|
||||||
|
|
||||||
@Update
|
@Update
|
||||||
void updateAll(List<ArticoloGriglia> articoli);
|
void updateAll(List<ArticoloGriglia> articoli);
|
||||||
|
|
||||||
@Update
|
@Update
|
||||||
void update(ArticoloGriglia articolo);
|
void update(ArticoloGriglia articolo);
|
||||||
|
|
||||||
@@ -37,12 +41,18 @@ public interface ArticoloGrigliaDao {
|
|||||||
@Query("SELECT * FROM articoli_griglia WHERE cod_mart = :codMart AND id_griglia = :idGriglia LIMIT 1")
|
@Query("SELECT * FROM articoli_griglia WHERE cod_mart = :codMart AND id_griglia = :idGriglia LIMIT 1")
|
||||||
ArticoloGriglia findArticoloByCodMartAndGriglia(String codMart, int idGriglia);
|
ArticoloGriglia findArticoloByCodMartAndGriglia(String codMart, int idGriglia);
|
||||||
|
|
||||||
@Query("SELECT * FROM articoli_griglia WHERE (cod_mart = :scan OR bar_code =:scan )AND id_griglia = :idGriglia LIMIT 1")
|
@Query("SELECT * FROM articoli_griglia WHERE (cod_mart = :scan OR bar_code =:scan) AND id_griglia = :idGriglia LIMIT 1")
|
||||||
ArticoloGriglia findArticoloByScanAndGriglia(String scan, int idGriglia);
|
ArticoloGriglia findArticoloByScanAndGriglia(String scan, int idGriglia);
|
||||||
|
|
||||||
@Query("SELECT articolo_griglia_id FROM articoli_griglia WHERE (cod_mart = :codMart AND bar_code =:barCode )AND id_griglia = :idGriglia LIMIT 1")
|
@Query("SELECT articolo_griglia_id FROM articoli_griglia WHERE (cod_mart = :codMart AND bar_code =:barCode) AND id_griglia = :idGriglia LIMIT 1")
|
||||||
Integer getIdArticoloByGrigliaAndBarcodeAndCodMart(int idGriglia, String barCode, String codMart);
|
Integer getIdArticoloByGrigliaAndBarcodeAndCodMart(int idGriglia, String barCode, String codMart);
|
||||||
|
|
||||||
|
@RawQuery(observedEntities = ArticoloGriglia.class)
|
||||||
|
List<ArticoloGriglia> getArticoli(SupportSQLiteQuery query);
|
||||||
|
|
||||||
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId")
|
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId")
|
||||||
List<ArticoloGriglia> getArticoliFromGriglia(int grigliaId);
|
List<ArticoloGriglia> getArticoliFromGriglia(int grigliaId);
|
||||||
|
|
||||||
|
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId AND qta_ord >= 1")
|
||||||
|
List<ArticoloGriglia> getNewArticoliInGriglia(int grigliaId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ 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.ArticoloOrdine;
|
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
import it.integry.integrywmsnative.core.data_store.db.wrappers.ArticoloOrdineWrapper;
|
||||||
|
|
||||||
@Dao
|
@Dao
|
||||||
public interface ArticoloOrdineDao {
|
public interface ArticoloOrdineDao {
|
||||||
@@ -34,8 +33,17 @@ public interface ArticoloOrdineDao {
|
|||||||
@Update
|
@Update
|
||||||
void update(ArticoloOrdine articolo);
|
void update(ArticoloOrdine articolo);
|
||||||
|
|
||||||
@Query("SELECT * FROM articoli_ordine where id_ordine = :ordineId")
|
@Query("SELECT articoli_ordine.*," +
|
||||||
List<ArticoloOrdine> findArticoliByOrdine(int ordineId);
|
"articoli_griglia.gg_scadenza," +
|
||||||
|
"articoli_griglia.giacenza," +
|
||||||
|
"articoli_griglia.qta_prevista_vendita," +
|
||||||
|
"articoli_griglia.qta_proposta " +
|
||||||
|
"FROM articoli_ordine " +
|
||||||
|
"INNER JOIN ordini on articoli_ordine.id_ordine = ordini.ordine_id " +
|
||||||
|
"LEFT OUTER JOIN articoli_griglia " +
|
||||||
|
"on articoli_ordine.cod_mart = articoli_griglia.cod_mart and ordini.id_griglia = articoli_griglia.id_griglia and articoli_ordine.bar_code = articoli_griglia.bar_code " +
|
||||||
|
"where id_ordine = :ordineId")
|
||||||
|
List<ArticoloOrdineWrapper> findArticoliByOrdine(int ordineId);
|
||||||
|
|
||||||
@Query("SELECt * from articoli_ordine where cod_mart = :codMart and id_ordine = :ordineId LIMIT 1")
|
@Query("SELECt * from articoli_ordine where cod_mart = :codMart and id_ordine = :ordineId LIMIT 1")
|
||||||
ArticoloOrdine findArticoloByCodMartAndOrdine(int ordineId, String codMart);
|
ArticoloOrdine findArticoloByCodMartAndOrdine(int ordineId, String codMart);
|
||||||
|
|||||||
@@ -6,7 +6,10 @@ import androidx.room.ForeignKey;
|
|||||||
import androidx.room.Index;
|
import androidx.room.Index;
|
||||||
import androidx.room.PrimaryKey;
|
import androidx.room.PrimaryKey;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
|
||||||
@@ -27,7 +30,7 @@ import it.integry.integrywmsnative.core.utility.UtilityDate;
|
|||||||
public class ArticoloGriglia {
|
public class ArticoloGriglia {
|
||||||
@PrimaryKey(autoGenerate = true)
|
@PrimaryKey(autoGenerate = true)
|
||||||
@ColumnInfo(name = "articolo_griglia_id")
|
@ColumnInfo(name = "articolo_griglia_id")
|
||||||
private int articoloGrigliaId;
|
private Integer articoloGrigliaId;
|
||||||
|
|
||||||
@ColumnInfo(name = "cod_mart")
|
@ColumnInfo(name = "cod_mart")
|
||||||
private String codMart;
|
private String codMart;
|
||||||
@@ -68,14 +71,20 @@ public class ArticoloGriglia {
|
|||||||
@ColumnInfo(name = "qta_proposta")
|
@ColumnInfo(name = "qta_proposta")
|
||||||
private float qtaProposta;
|
private float qtaProposta;
|
||||||
|
|
||||||
|
@ColumnInfo(name = "qta_ord")
|
||||||
|
private float qtaOrd;
|
||||||
|
|
||||||
@ColumnInfo(name = "id_griglia")
|
@ColumnInfo(name = "id_griglia")
|
||||||
private int idGriglia;
|
private int idGriglia;
|
||||||
|
|
||||||
public int getArticoloGrigliaId() {
|
@ColumnInfo(name = "new_no_promo")
|
||||||
|
private boolean newNoPromo = false;
|
||||||
|
|
||||||
|
public Integer getArticoloGrigliaId() {
|
||||||
return articoloGrigliaId;
|
return articoloGrigliaId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setArticoloGrigliaId(int articoloGrigliaId) {
|
public void setArticoloGrigliaId(Integer articoloGrigliaId) {
|
||||||
this.articoloGrigliaId = articoloGrigliaId;
|
this.articoloGrigliaId = articoloGrigliaId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,6 +200,30 @@ public class ArticoloGriglia {
|
|||||||
this.qtaProposta = qtaProposta;
|
this.qtaProposta = qtaProposta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isNewNoPromo() {
|
||||||
|
return newNoPromo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNewNoPromo(boolean newNoPromo) {
|
||||||
|
this.newNoPromo = newNoPromo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getQtaOrd() {
|
||||||
|
return qtaOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQtaOrd(float qtaOrd) {
|
||||||
|
this.qtaOrd = qtaOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String generateSystemNote() {
|
||||||
|
HashMap<String, String> pairs = new HashMap<>();
|
||||||
|
pairs.put("qta_proposta", String.valueOf(qtaProposta));
|
||||||
|
pairs.put("giacenza", String.valueOf(giacenza));
|
||||||
|
|
||||||
|
return new JSONObject(pairs).toString();
|
||||||
|
}
|
||||||
|
|
||||||
public ArticoloOrdine convertToArticoloOrdine(Ordine ordine) {
|
public ArticoloOrdine convertToArticoloOrdine(Ordine ordine) {
|
||||||
ArticoloOrdine articolo = new ArticoloOrdine();
|
ArticoloOrdine articolo = new ArticoloOrdine();
|
||||||
|
|
||||||
@@ -210,8 +243,9 @@ public class ArticoloGriglia {
|
|||||||
articolo.setGiacenza(BigDecimal.valueOf(this.getGiacenza()));
|
articolo.setGiacenza(BigDecimal.valueOf(this.getGiacenza()));
|
||||||
articolo.setQtaPrevistaVendita(BigDecimal.valueOf(this.getQtaPrevistaVendita()));
|
articolo.setQtaPrevistaVendita(BigDecimal.valueOf(this.getQtaPrevistaVendita()));
|
||||||
articolo.setQtaProposta(BigDecimal.valueOf(this.getQtaProposta()));
|
articolo.setQtaProposta(BigDecimal.valueOf(this.getQtaProposta()));
|
||||||
|
articolo.setNewNoPromo(this.isNewNoPromo());
|
||||||
articolo.setQtaOrd(0);
|
articolo.setSystemNote(generateSystemNote());
|
||||||
|
articolo.setQtaOrd(this.getQtaOrd());
|
||||||
|
|
||||||
return articolo;
|
return articolo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import java.util.Date;
|
|||||||
public class ArticoloOrdine {
|
public class ArticoloOrdine {
|
||||||
@PrimaryKey(autoGenerate = true)
|
@PrimaryKey(autoGenerate = true)
|
||||||
@ColumnInfo(name = "articolo_ordine_id")
|
@ColumnInfo(name = "articolo_ordine_id")
|
||||||
private int articoloOrdineId;
|
private Integer articoloOrdineId;
|
||||||
|
|
||||||
@ColumnInfo(name = "cod_mart")
|
@ColumnInfo(name = "cod_mart")
|
||||||
private String codMart;
|
private String codMart;
|
||||||
@@ -67,6 +67,11 @@ public class ArticoloOrdine {
|
|||||||
@ColumnInfo(name = "data_ins")
|
@ColumnInfo(name = "data_ins")
|
||||||
private Date dataIns;
|
private Date dataIns;
|
||||||
|
|
||||||
|
@ColumnInfo(name = "new_no_promo")
|
||||||
|
private boolean newNoPromo;
|
||||||
|
|
||||||
|
@ColumnInfo(name = "system_note")
|
||||||
|
private String systemNote;
|
||||||
|
|
||||||
@Ignore
|
@Ignore
|
||||||
private int ggScadenza = 0;
|
private int ggScadenza = 0;
|
||||||
@@ -80,12 +85,15 @@ public class ArticoloOrdine {
|
|||||||
@Ignore
|
@Ignore
|
||||||
private BigDecimal qtaProposta = BigDecimal.ZERO;
|
private BigDecimal qtaProposta = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
@Ignore
|
||||||
|
private int bgTint;
|
||||||
|
|
||||||
public int getArticoloOrdineId() {
|
|
||||||
|
public Integer getArticoloOrdineId() {
|
||||||
return articoloOrdineId;
|
return articoloOrdineId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setArticoloOrdineId(int articoloOrdineId) {
|
public void setArticoloOrdineId(Integer articoloOrdineId) {
|
||||||
this.articoloOrdineId = articoloOrdineId;
|
this.articoloOrdineId = articoloOrdineId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,14 +229,52 @@ public class ArticoloOrdine {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getQtaCnfPrevistaVendita(){
|
public BigDecimal getQtaCnfPrevistaVendita() {
|
||||||
return qtaPrevistaVendita.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaPrevistaVendita.divide(BigDecimal.valueOf(qtaCnf),0, RoundingMode.CEILING);
|
return qtaPrevistaVendita.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaPrevistaVendita.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getQtaCnfProposta(){
|
public BigDecimal getQtaCnfProposta() {
|
||||||
return qtaProposta.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaProposta.divide(BigDecimal.valueOf(qtaCnf),0, RoundingMode.CEILING);
|
return qtaProposta.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaProposta.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||||
}
|
}
|
||||||
public BigDecimal getQtaCnfGiacenza(){
|
|
||||||
return giacenza.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : giacenza.divide(BigDecimal.valueOf(qtaCnf),0, RoundingMode.CEILING);
|
public BigDecimal getQtaCnfGiacenza() {
|
||||||
|
return giacenza.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : giacenza.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isNewNoPromo() {
|
||||||
|
return newNoPromo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNewNoPromo(boolean newNoPromo) {
|
||||||
|
this.newNoPromo = newNoPromo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getCnfDaRic() {
|
||||||
|
return qtaCnf > 0.f ? merceDaRic * qtaCnf : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int checkQtaProposta() {
|
||||||
|
int check = 0;
|
||||||
|
if (!qtaProposta.equals(BigDecimal.ZERO)) {
|
||||||
|
check = BigDecimal.valueOf(qtaOrd).compareTo(qtaProposta);
|
||||||
|
}
|
||||||
|
return check;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBgTint() {
|
||||||
|
return bgTint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArticoloOrdine setBgTint(int bgTint) {
|
||||||
|
this.bgTint = bgTint;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSystemNote() {
|
||||||
|
return systemNote;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSystemNote(String systemNote) {
|
||||||
|
this.systemNote = systemNote;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ public class Ordine {
|
|||||||
@Ignore
|
@Ignore
|
||||||
private int countArticoli = 0;
|
private int countArticoli = 0;
|
||||||
|
|
||||||
|
@Ignore
|
||||||
|
private boolean orderNewProducts = false;
|
||||||
|
|
||||||
@ColumnInfo(name = "id_griglia")
|
@ColumnInfo(name = "id_griglia")
|
||||||
private int idGriglia;
|
private int idGriglia;
|
||||||
|
|
||||||
@@ -149,4 +152,13 @@ public class Ordine {
|
|||||||
public void setDataOrdS(String dataOrd) {
|
public void setDataOrdS(String dataOrd) {
|
||||||
setDataOrd(UtilityDate.recognizeDateWithExceptionHandler(dataOrd));
|
setDataOrd(UtilityDate.recognizeDateWithExceptionHandler(dataOrd));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isOrderNewProducts() {
|
||||||
|
return orderNewProducts;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ordine setOrderNewProducts(boolean orderNewProducts) {
|
||||||
|
this.orderNewProducts = orderNewProducts;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,4 +16,6 @@ public interface ArticoloGrigliaRepository {
|
|||||||
|
|
||||||
void findArticoloByScanAndGriglia(String scan, int idGriglia, RunnableArgs<ArticoloGriglia> onSuccess, RunnableArgs<Exception> onFail);
|
void findArticoloByScanAndGriglia(String scan, int idGriglia, RunnableArgs<ArticoloGriglia> onSuccess, RunnableArgs<Exception> onFail);
|
||||||
|
|
||||||
|
void findNewArticoliInGrigla(int idGriglia, RunnableArgs<List<ArticoloGriglia>> onSuccess, RunnableArgs<Exception> onFail);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,14 @@ import com.annimon.stream.Stream;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.Callable;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.Future;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@@ -24,27 +31,21 @@ public class ArticoliGrigliaDataSource extends Repository implements ArticoloGri
|
|||||||
this.mArticoloGrigliaDao = articoloGrigliaDao;
|
this.mArticoloGrigliaDao = articoloGrigliaDao;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveArticoliToGriglia(List<ArticoloGriglia> articoli, Griglia griglia, Runnable onSuccess, RunnableArgs<Exception> onFail) {
|
public void saveArticoliToGriglia(List<ArticoloGriglia> updatedArts, Griglia griglia, Runnable onSuccess, RunnableArgs<Exception> onFail) {
|
||||||
execute(() -> {
|
execute(() -> {
|
||||||
try {
|
try {
|
||||||
List<ArticoloGriglia> toUpdate = new ArrayList<>();
|
var tmp = calcItemsToInsertAndUpdate(updatedArts);
|
||||||
List<ArticoloGriglia> toInsert = new ArrayList<>();
|
var toInsert = (List<ArticoloGriglia>) tmp.get("toInsert");
|
||||||
List<String> codMarts = new ArrayList<>();
|
var toUpdate = (List<ArticoloGriglia>) tmp.get("toUpdate");
|
||||||
for (ArticoloGriglia art : articoli) {
|
var codMarts = (List<String>) tmp.get("codMarts");
|
||||||
Integer id = mArticoloGrigliaDao.getIdArticoloByGrigliaAndBarcodeAndCodMart(griglia.getGrigliaId(), art.getBarCode(), art.getCodMart());
|
|
||||||
codMarts.add(art.getCodMart());
|
|
||||||
if (id != null) {
|
|
||||||
art.setArticoloGrigliaId(id);
|
|
||||||
toUpdate.add(art);
|
|
||||||
} else {
|
|
||||||
toInsert.add(art);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mArticoloGrigliaDao.insertAll(toInsert);
|
mArticoloGrigliaDao.insertAll(toInsert);
|
||||||
mArticoloGrigliaDao.updateAll(toUpdate);
|
mArticoloGrigliaDao.updateAll(toUpdate);
|
||||||
|
|
||||||
List<ArticoloGriglia> articoliGriglia = mArticoloGrigliaDao.getArticoliFromGriglia(griglia.getGrigliaId());
|
List<ArticoloGriglia> articoliGriglia = mArticoloGrigliaDao.getArticoliFromGriglia(griglia.getGrigliaId());
|
||||||
List<ArticoloGriglia> toDelete = Stream.of(articoliGriglia).filter(articolo -> !codMarts.contains(articolo.getCodMart())).toList();
|
List<ArticoloGriglia> toDelete = Stream.of(articoliGriglia).filter(articolo -> !codMarts.contains(articolo.getCodMart())).toList();
|
||||||
mArticoloGrigliaDao.deleteList(toDelete);
|
mArticoloGrigliaDao.deleteList(toDelete);
|
||||||
|
|
||||||
onSuccess.run();
|
onSuccess.run();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
onFail.run(e);
|
onFail.run(e);
|
||||||
@@ -52,6 +53,52 @@ public class ArticoliGrigliaDataSource extends Repository implements ArticoloGri
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private HashMap<String, Object> calcItemsToInsertAndUpdate(List<ArticoloGriglia> updatedArts) throws InterruptedException, ExecutionException {
|
||||||
|
var toInsert = new ArrayList<ArticoloGriglia>();
|
||||||
|
var toUpdate = new ArrayList<ArticoloGriglia>();
|
||||||
|
var codMarts = new ArrayList<String>();
|
||||||
|
|
||||||
|
int cores = Runtime.getRuntime().availableProcessors();
|
||||||
|
ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(cores);
|
||||||
|
List<Callable<ArticoloGriglia>> calls = new ArrayList<>();
|
||||||
|
|
||||||
|
for (int i = 0; i < updatedArts.size(); i++) {
|
||||||
|
int finalI = i;
|
||||||
|
Callable<ArticoloGriglia> callableTask = () -> {
|
||||||
|
var updatedArt = updatedArts.get(finalI);
|
||||||
|
Integer id = mArticoloGrigliaDao.getIdArticoloByGrigliaAndBarcodeAndCodMart(updatedArt.getIdGriglia(), updatedArt.getBarCode(), updatedArt.getCodMart());
|
||||||
|
|
||||||
|
if (id != null) {
|
||||||
|
updatedArt.setArticoloGrigliaId(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return updatedArt;
|
||||||
|
};
|
||||||
|
|
||||||
|
calls.add(callableTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Future<ArticoloGriglia>> futures = executor.invokeAll(calls, Long.MAX_VALUE, TimeUnit.MILLISECONDS);
|
||||||
|
|
||||||
|
for (Future<ArticoloGriglia> future : futures) {
|
||||||
|
if (future.isDone()) {
|
||||||
|
codMarts.add(future.get().getCodMart());
|
||||||
|
if (future.get().getArticoloGrigliaId() == null) toInsert.add(future.get());
|
||||||
|
else toUpdate.add(future.get());
|
||||||
|
} else {
|
||||||
|
future.cancel(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var tmp = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
tmp.put("toInsert", toInsert);
|
||||||
|
tmp.put("toUpdate", toUpdate);
|
||||||
|
tmp.put("codMarts", codMarts);
|
||||||
|
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
public void findArticoloByBarcodeAndGriglia(String barcode, int idGriglia, RunnableArgs<ArticoloGriglia> onSuccess, RunnableArgs<Exception> onFail) {
|
public void findArticoloByBarcodeAndGriglia(String barcode, int idGriglia, RunnableArgs<ArticoloGriglia> onSuccess, RunnableArgs<Exception> onFail) {
|
||||||
execute(() -> {
|
execute(() -> {
|
||||||
try {
|
try {
|
||||||
@@ -89,4 +136,14 @@ public class ArticoliGrigliaDataSource extends Repository implements ArticoloGri
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void findNewArticoliInGrigla(int idGriglia, RunnableArgs<List<ArticoloGriglia>> onSuccess, RunnableArgs<Exception> onFail) {
|
||||||
|
execute(() -> {
|
||||||
|
try {
|
||||||
|
onSuccess.run(mArticoloGrigliaDao.getNewArticoliInGriglia(idGriglia));
|
||||||
|
} catch (Exception e) {
|
||||||
|
onFail.run(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.data_store.db.repository.implementations;
|
package it.integry.integrywmsnative.core.data_store.db.repository.implementations;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -11,6 +13,7 @@ import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloOrdineDao;
|
|||||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoliOrdineRepository;
|
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoliOrdineRepository;
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.wrappers.ArticoloOrdineWrapper;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
|
||||||
public class ArticoliOrdineDataSource extends Repository implements ArticoliOrdineRepository {
|
public class ArticoliOrdineDataSource extends Repository implements ArticoliOrdineRepository {
|
||||||
@@ -28,13 +31,15 @@ public class ArticoliOrdineDataSource extends Repository implements ArticoliOrdi
|
|||||||
List<ArticoloOrdine> toUpdate = new ArrayList<>();
|
List<ArticoloOrdine> toUpdate = new ArrayList<>();
|
||||||
List<ArticoloOrdine> toInsert = new ArrayList<>();
|
List<ArticoloOrdine> toInsert = new ArrayList<>();
|
||||||
for (ArticoloOrdine art : articoli) {
|
for (ArticoloOrdine art : articoli) {
|
||||||
if (art.getArticoloOrdineId() > 0) {
|
if (art.getArticoloOrdineId() != null && art.getArticoloOrdineId() > 0) {
|
||||||
toUpdate.add(art);
|
toUpdate.add(art);
|
||||||
} else {
|
} else {
|
||||||
toInsert.add(art);
|
toInsert.add(art);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mArticoloOrdineDao.insertAll(toInsert);
|
for (ArticoloOrdine newArt : toInsert) {
|
||||||
|
mArticoloOrdineDao.insert(newArt);
|
||||||
|
}
|
||||||
mArticoloOrdineDao.updateAll(toUpdate);
|
mArticoloOrdineDao.updateAll(toUpdate);
|
||||||
onSuccess.run();
|
onSuccess.run();
|
||||||
|
|
||||||
@@ -48,7 +53,7 @@ public class ArticoliOrdineDataSource extends Repository implements ArticoliOrdi
|
|||||||
public void saveArticoloToOrdine(ArticoloOrdine articolo, Runnable onSuccess, RunnableArgs<Exception> onFail) {
|
public void saveArticoloToOrdine(ArticoloOrdine articolo, Runnable onSuccess, RunnableArgs<Exception> onFail) {
|
||||||
execute(() -> {
|
execute(() -> {
|
||||||
try {
|
try {
|
||||||
if (articolo.getArticoloOrdineId() > 0) {
|
if (articolo.getArticoloOrdineId() != null && articolo.getArticoloOrdineId() > 0) {
|
||||||
mArticoloOrdineDao.update(articolo);
|
mArticoloOrdineDao.update(articolo);
|
||||||
} else {
|
} else {
|
||||||
mArticoloOrdineDao.insert(articolo);
|
mArticoloOrdineDao.insert(articolo);
|
||||||
@@ -93,7 +98,15 @@ public class ArticoliOrdineDataSource extends Repository implements ArticoliOrdi
|
|||||||
public void findArticoliByOrdine(Ordine ordine, RunnableArgs<List<ArticoloOrdine>> onLoad, RunnableArgs<Exception> onError) {
|
public void findArticoliByOrdine(Ordine ordine, RunnableArgs<List<ArticoloOrdine>> onLoad, RunnableArgs<Exception> onError) {
|
||||||
execute(() -> {
|
execute(() -> {
|
||||||
try {
|
try {
|
||||||
onLoad.run(mArticoloOrdineDao.findArticoliByOrdine(ordine.getOrdineId()));
|
List<ArticoloOrdineWrapper> list = mArticoloOrdineDao.findArticoliByOrdine(ordine.getOrdineId());
|
||||||
|
onLoad.run(Stream.of(list).map(x -> {
|
||||||
|
ArticoloOrdine art = x.getArticoloOrdine();
|
||||||
|
art.setGgScadenza(x.getGgScadenza());
|
||||||
|
art.setGiacenza(x.getGiacenza());
|
||||||
|
art.setQtaProposta(x.getQtaProposta());
|
||||||
|
art.setQtaPrevistaVendita(x.getQtaPrevistaVendita());
|
||||||
|
return art;
|
||||||
|
}).toList());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
onError.run(e);
|
onError.run(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,36 +1,25 @@
|
|||||||
package it.integry.integrywmsnative.core.data_store.db.view_model;
|
package it.integry.integrywmsnative.core.data_store.db.view_model;
|
||||||
|
|
||||||
import androidx.room.ColumnInfo;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
||||||
|
|
||||||
public class ArticoloDTO {
|
public class ArticoloDTO {
|
||||||
|
|
||||||
private String codMart;
|
public String codMart;
|
||||||
|
public String descrizione;
|
||||||
private String descrizione;
|
public String untMis;
|
||||||
|
public float qtaCnf;
|
||||||
private String untMis;
|
public String barcode;
|
||||||
|
public float merceDaRic;
|
||||||
private String barcode;
|
public float mediaSett;
|
||||||
|
public String flagQtaMultipla;
|
||||||
private String flagQtaMultipla;
|
public String flagTracciabilita;
|
||||||
|
public float qtaMinOrdinabile;
|
||||||
private float qtaCnf;
|
public boolean newNoPromo;
|
||||||
|
|
||||||
private float merceDaRic;
|
|
||||||
|
|
||||||
private float mediaSett;
|
|
||||||
|
|
||||||
private float qtaMinOrdinabile;
|
|
||||||
|
|
||||||
private int ggScadenza;
|
private int ggScadenza;
|
||||||
|
|
||||||
private float giacenza;
|
private float giacenza;
|
||||||
|
|
||||||
private float qtaPrevistaVendita;
|
private float qtaPrevistaVendita;
|
||||||
|
|
||||||
private float qtaProposta;
|
private float qtaProposta;
|
||||||
|
private float qtaOrd;
|
||||||
|
|
||||||
|
|
||||||
public String getCodMart() {
|
public String getCodMart() {
|
||||||
@@ -145,6 +134,33 @@ public class ArticoloDTO {
|
|||||||
this.qtaProposta = qtaProposta;
|
this.qtaProposta = qtaProposta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getFlagTracciabilita() {
|
||||||
|
return flagTracciabilita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArticoloDTO setFlagTracciabilita(String flagTracciabilita) {
|
||||||
|
this.flagTracciabilita = flagTracciabilita;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isNewNoPromo() {
|
||||||
|
return newNoPromo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArticoloDTO setNewNoPromo(boolean newNoPromo) {
|
||||||
|
this.newNoPromo = newNoPromo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getQtaOrd() {
|
||||||
|
return qtaOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArticoloDTO setQtaOrd(float qtaOrd) {
|
||||||
|
this.qtaOrd = qtaOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public ArticoloGriglia toArticoloGriglia() {
|
public ArticoloGriglia toArticoloGriglia() {
|
||||||
ArticoloGriglia result = new ArticoloGriglia();
|
ArticoloGriglia result = new ArticoloGriglia();
|
||||||
result.setBarCode(this.getBarCode());
|
result.setBarCode(this.getBarCode());
|
||||||
@@ -157,6 +173,8 @@ public class ArticoloDTO {
|
|||||||
result.setFlagQtaMultipla(this.getFlagQtaMultipla());
|
result.setFlagQtaMultipla(this.getFlagQtaMultipla());
|
||||||
result.setQtaMinOrdinabile(this.getQtaMinOrdinabile());
|
result.setQtaMinOrdinabile(this.getQtaMinOrdinabile());
|
||||||
result.setGgScadenza(this.ggScadenza);
|
result.setGgScadenza(this.ggScadenza);
|
||||||
|
result.setNewNoPromo(this.newNoPromo);
|
||||||
|
result.setQtaOrd(this.getQtaOrd());
|
||||||
result.setGiacenza(this.giacenza);
|
result.setGiacenza(this.giacenza);
|
||||||
result.setQtaPrevistaVendita(this.qtaPrevistaVendita);
|
result.setQtaPrevistaVendita(this.qtaPrevistaVendita);
|
||||||
result.setQtaProposta(this.qtaProposta);
|
result.setQtaProposta(this.qtaProposta);
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package it.integry.integrywmsnative.core.data_store.db.wrappers;
|
||||||
|
|
||||||
|
import androidx.room.ColumnInfo;
|
||||||
|
import androidx.room.Embedded;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||||
|
|
||||||
|
public class ArticoloOrdineWrapper {
|
||||||
|
@Embedded
|
||||||
|
private ArticoloOrdine articoloOrdine;
|
||||||
|
|
||||||
|
@ColumnInfo(name = "gg_scadenza")
|
||||||
|
private int ggScadenza = 0;
|
||||||
|
|
||||||
|
@ColumnInfo(name = "giacenza")
|
||||||
|
private BigDecimal giacenza = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
@ColumnInfo(name = "qta_prevista_vendita")
|
||||||
|
private BigDecimal qtaPrevistaVendita = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
@ColumnInfo(name = "qta_proposta")
|
||||||
|
private BigDecimal qtaProposta = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
public ArticoloOrdine getArticoloOrdine() {
|
||||||
|
return articoloOrdine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArticoloOrdine(ArticoloOrdine articoloOrdine) {
|
||||||
|
this.articoloOrdine = articoloOrdine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getGgScadenza() {
|
||||||
|
return ggScadenza;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGgScadenza(int ggScadenza) {
|
||||||
|
this.ggScadenza = ggScadenza;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getGiacenza() {
|
||||||
|
return giacenza;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGiacenza(BigDecimal giacenza) {
|
||||||
|
this.giacenza = giacenza;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaPrevistaVendita() {
|
||||||
|
return qtaPrevistaVendita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQtaPrevistaVendita(BigDecimal qtaPrevistaVendita) {
|
||||||
|
this.qtaPrevistaVendita = qtaPrevistaVendita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaProposta() {
|
||||||
|
return qtaProposta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQtaProposta(BigDecimal qtaProposta) {
|
||||||
|
this.qtaProposta = qtaProposta;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -551,6 +551,12 @@ public class Converters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@BindingAdapter("visibility")
|
||||||
|
public static void bindViewVisibility(View view, boolean bool) {
|
||||||
|
view.setVisibility(bool ? View.VISIBLE : View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@BindingAdapter({"reverse_visibility"})
|
@BindingAdapter({"reverse_visibility"})
|
||||||
public static void bindViewReverseVisibility(View view, final BindableBoolean bindableBoolean) {
|
public static void bindViewReverseVisibility(View view, final BindableBoolean bindableBoolean) {
|
||||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di.binders;
|
||||||
|
|
||||||
|
import androidx.appcompat.widget.AppCompatImageView;
|
||||||
|
import androidx.databinding.BindingAdapter;
|
||||||
|
|
||||||
|
public class ImageViewBinders {
|
||||||
|
@BindingAdapter("tint")
|
||||||
|
public static void bindImageViewTint(final AppCompatImageView view, final int color) {
|
||||||
|
view.setColorFilter(color, android.graphics.PorterDuff.Mode.MULTIPLY);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
public class BluetoothConnectionException extends Exception {
|
||||||
|
|
||||||
|
public BluetoothConnectionException(String btDeviceName, String btDeviceMac, Throwable th) {
|
||||||
|
super("Impossibile collegarsi al dispositivo bluetooth: " + btDeviceName + " [" + btDeviceMac + "]. Riprovare.");
|
||||||
|
initCause(th);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
|
||||||
|
public final class EmptyLUException extends Exception {
|
||||||
|
public EmptyLUException() {
|
||||||
|
super(UtilityResources.getString(R.string.empty_lu));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,7 +38,7 @@ public class ExceptionsHandler implements Thread.UncaughtExceptionHandler {
|
|||||||
@Override
|
@Override
|
||||||
public void uncaughtException(final Thread thread, final Throwable ex) {
|
public void uncaughtException(final Thread thread, final Throwable ex) {
|
||||||
try {
|
try {
|
||||||
UtilityLogger.errorMe(new Exception(ex));
|
UtilityLogger.error(new Exception(ex));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(TAG, "Exception Logger failed!", e);
|
Log.e(TAG, "Exception Logger failed!", e);
|
||||||
MainApplication.exit();
|
MainApplication.exit();
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
public class InvalidConnectionException extends Exception {
|
||||||
|
|
||||||
|
|
||||||
|
public InvalidConnectionException(String host, int port, Throwable cause) {
|
||||||
|
super(String.format(Locale.ITALY, "Impossibile stabilire la connessione con il server (%s:%d)", host, port), cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,6 +5,6 @@ import it.integry.integrywmsnative.core.utility.UtilityResources;
|
|||||||
|
|
||||||
public final class NoArtsFoundException extends Exception {
|
public final class NoArtsFoundException extends Exception {
|
||||||
public NoArtsFoundException() {
|
public NoArtsFoundException() {
|
||||||
super(UtilityResources.getString(R.string.no_result_from_barcode));
|
super(UtilityResources.getString(R.string.no_arts_found));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,12 @@ import it.integry.integrywmsnative.R;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
|
||||||
public final class NoResultFromBarcodeException extends Exception {
|
public final class NoResultFromBarcodeException extends Exception {
|
||||||
|
|
||||||
public NoResultFromBarcodeException() {
|
public NoResultFromBarcodeException() {
|
||||||
super(UtilityResources.getString(R.string.no_result_from_barcode));
|
super(UtilityResources.getString(R.string.no_result_from_barcode));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NoResultFromBarcodeException(String barcode) {
|
||||||
|
super(UtilityResources.getString(R.string.no_result_from_barcode) + " (" + barcode + ")");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
public class NotValidLicenseException extends Exception {
|
||||||
|
|
||||||
|
public NotValidLicenseException() {
|
||||||
|
super("Licenza non valida");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,21 +1,78 @@
|
|||||||
package it.integry.integrywmsnative.core.expansion;
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
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.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
|
||||||
public class BaseActivity extends AppCompatActivity {
|
public class BaseActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public DialogProgressView mCurrentProgress;
|
||||||
|
|
||||||
protected Dialog mCurrentProgress;
|
private boolean progressOpened;
|
||||||
|
|
||||||
public BaseActivity() {
|
@Nullable
|
||||||
//Thread.setDefaultUncaughtExceptionHandler(new MyExceptionHandler(this, BaseActivity.class));
|
@Override
|
||||||
|
public View onCreateView(@Nullable View parent, @NonNull String name, @NonNull Context context, @NonNull AttributeSet attrs) {
|
||||||
|
var v = super.onCreateView(parent, name, context, attrs);
|
||||||
|
|
||||||
|
MainApplication.appComponent
|
||||||
|
.baseActivityComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onLoadingStarted() {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
this.openProgress();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onLoadingEnded() {
|
||||||
|
this.closeProgress();
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onError(Exception ex) {
|
||||||
|
this.runOnUiThread(() -> {
|
||||||
|
this.closeProgress();
|
||||||
|
UtilityExceptions.defaultException(this, ex);
|
||||||
|
BarcodeManager.enable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void openProgress() {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||||
|
this.progressOpened = true;
|
||||||
|
runOnUiThread(() -> {
|
||||||
|
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void closeProgress() {
|
||||||
|
BarcodeManager.enable();
|
||||||
|
if (progressOpened) {
|
||||||
|
this.progressOpened = false;
|
||||||
|
runOnUiThread(() -> {
|
||||||
|
mCurrentProgress.dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -38,46 +95,4 @@ public class BaseActivity extends AppCompatActivity {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void openProgress() {
|
|
||||||
runOnUiThread(() -> {
|
|
||||||
BarcodeManager.disable();
|
|
||||||
if (this.mCurrentProgress == null) {
|
|
||||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(this);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void closeProgress() {
|
|
||||||
runOnUiThread(() -> {
|
|
||||||
BarcodeManager.enable();
|
|
||||||
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();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface BaseActivityComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
BaseActivityComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(BaseActivity baseActivity);
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
|
||||||
|
@Module(subcomponents = BaseActivityComponent.class)
|
||||||
|
public class BaseActivityModule {
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.core.expansion;
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
@@ -12,18 +11,20 @@ import androidx.fragment.app.DialogFragment;
|
|||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
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.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
|
||||||
public class BaseDialogFragment extends DialogFragment {
|
public class BaseDialogFragment extends DialogFragment {
|
||||||
|
|
||||||
private boolean mBarcodeListener = false;
|
@Inject
|
||||||
private Dialog mCurrentProgress;
|
public DialogProgressView mCurrentProgress;
|
||||||
|
private boolean progressOpened;
|
||||||
|
|
||||||
public BaseDialogFragment() {
|
private boolean mBarcodeListener = false;
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -41,6 +42,11 @@ public class BaseDialogFragment extends DialogFragment {
|
|||||||
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);
|
||||||
|
|
||||||
|
MainApplication.appComponent
|
||||||
|
.baseDialogFragmentComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
||||||
getDialog().setOnKeyListener((dialog, keyCode, event) -> {
|
getDialog().setOnKeyListener((dialog, keyCode, event) -> {
|
||||||
if (mBarcodeListener && (event.getAction() == KeyEvent.ACTION_DOWN || event.getAction() == KeyEvent.ACTION_MULTIPLE) && !isControlKey(event)) {
|
if (mBarcodeListener && (event.getAction() == KeyEvent.ACTION_DOWN || event.getAction() == KeyEvent.ACTION_MULTIPLE) && !isControlKey(event)) {
|
||||||
@@ -51,6 +57,42 @@ public class BaseDialogFragment extends DialogFragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onLoadingStarted() {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
this.openProgress();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onLoadingEnded() {
|
||||||
|
this.closeProgress();
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openProgress() {
|
||||||
|
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||||
|
this.progressOpened = true;
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void closeProgress() {
|
||||||
|
if (progressOpened) {
|
||||||
|
this.progressOpened = false;
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
mCurrentProgress.dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onError(Exception ex) {
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
UtilityExceptions.defaultException(requireActivity(), ex);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isControlKey(KeyEvent keyEvent) {
|
private boolean isControlKey(KeyEvent keyEvent) {
|
||||||
int keyCode = keyEvent.getKeyCode();
|
int keyCode = keyEvent.getKeyCode();
|
||||||
return (
|
return (
|
||||||
@@ -65,45 +107,4 @@ public class BaseDialogFragment extends DialogFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
BarcodeManager.disable();
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void openProgress() {
|
|
||||||
|
|
||||||
// new Thread(() -> {
|
|
||||||
requireActivity().runOnUiThread(() -> {
|
|
||||||
if (this.mCurrentProgress == null) {
|
|
||||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// }).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void closeProgress() {
|
|
||||||
// new Thread(() -> {
|
|
||||||
requireActivity().runOnUiThread(() -> {
|
|
||||||
if (mCurrentProgress != null) {
|
|
||||||
mCurrentProgress.dismiss();
|
|
||||||
mCurrentProgress = null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// }).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void onError(Exception ex) {
|
|
||||||
requireActivity().runOnUiThread(() -> {
|
|
||||||
this.closeProgress();
|
|
||||||
UtilityExceptions.defaultException(requireActivity(), ex);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface BaseDialogFragmentComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
BaseDialogFragmentComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(BaseDialogFragment baseDialogFragment);
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
|
||||||
|
@Module(subcomponents = BaseDialogFragmentComponent.class)
|
||||||
|
public class BaseDialogFragmentModule {
|
||||||
|
}
|
||||||
@@ -1,55 +1,90 @@
|
|||||||
package it.integry.integrywmsnative.core.expansion;
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
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.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.interfaces.IPoppableActivity;
|
import it.integry.integrywmsnative.core.interfaces.IPoppableActivity;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
|
||||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
|
||||||
public abstract class BaseFragment extends Fragment {
|
public abstract class BaseFragment extends Fragment {
|
||||||
|
|
||||||
protected Dialog mCurrentProgress;
|
@Inject
|
||||||
|
public DialogProgressView mCurrentProgress;
|
||||||
|
|
||||||
protected ElevatedToolbar mToolbar;
|
protected ElevatedToolbar mToolbar;
|
||||||
|
|
||||||
protected final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
protected final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||||
|
private boolean progressOpened;
|
||||||
|
|
||||||
|
|
||||||
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
||||||
mToolbar = toolbar;
|
mToolbar = toolbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void addOnPreDestroy(Runnable onPreDestroy) {
|
public void addOnPreDestroy(Runnable onPreDestroy) {
|
||||||
this.mOnPreDestroyList.add(onPreDestroy);
|
this.mOnPreDestroyList.add(onPreDestroy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
View view = super.onCreateView(inflater, container, savedInstanceState);
|
||||||
|
|
||||||
|
MainApplication.appComponent
|
||||||
|
.baseFragmentComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
public void onLoadingStarted() {
|
public void onLoadingStarted() {
|
||||||
new Thread(() -> {
|
|
||||||
BarcodeManager.disable();
|
|
||||||
this.openProgress();
|
this.openProgress();
|
||||||
}).start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onLoadingEnded() {
|
public void onLoadingEnded() {
|
||||||
new Thread(() -> {
|
|
||||||
this.closeProgress();
|
this.closeProgress();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openProgress() {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||||
|
this.progressOpened = true;
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void closeProgress() {
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
}).start();
|
if (progressOpened) {
|
||||||
|
this.progressOpened = false;
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
mCurrentProgress.dismissAllowingStateLoss();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
this.getActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
this.closeProgress();
|
this.closeProgress();
|
||||||
UtilityExceptions.defaultException(getActivity(), ex, mCurrentProgress);
|
UtilityExceptions.defaultException(getActivity(), ex);
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -64,26 +99,17 @@ public abstract class BaseFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void openProgress() {
|
public boolean onBackPressed() {
|
||||||
getActivity().runOnUiThread(() -> {
|
return false;
|
||||||
if (this.mCurrentProgress == null) {
|
|
||||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void closeProgress() {
|
|
||||||
getActivity().runOnUiThread(() -> {
|
|
||||||
if (mCurrentProgress != null) {
|
|
||||||
mCurrentProgress.dismiss();
|
|
||||||
mCurrentProgress = null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void popMe() {
|
protected void popMe() {
|
||||||
getActivity().runOnUiThread(() -> {
|
if (requireActivity() instanceof IPoppableActivity) {
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
((IPoppableActivity) requireActivity()).pop();
|
((IPoppableActivity) requireActivity()).pop();
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
requireActivity().getSupportFragmentManager().popBackStack();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface BaseFragmentComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
BaseFragmentComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(BaseFragment baseFragment);
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
|
||||||
|
@Module(subcomponents = BaseFragmentComponent.class)
|
||||||
|
public class BaseFragmentModule {
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@ package it.integry.integrywmsnative.core.expansion;
|
|||||||
|
|
||||||
import androidx.databinding.Observable;
|
import androidx.databinding.Observable;
|
||||||
|
|
||||||
public abstract class OnGeneralChangedCallback extends Observable.OnPropertyChangedCallback implements Runnable{
|
public abstract class OnGeneralChangedCallback extends Observable.OnPropertyChangedCallback implements Runnable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
package it.integry.integrywmsnative.core.expansion;
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
|
||||||
import androidx.databinding.ObservableList;
|
import androidx.databinding.ObservableList;
|
||||||
|
import androidx.databinding.ObservableList.OnListChangedCallback;
|
||||||
|
|
||||||
public abstract class OnListGeneralChangedCallback extends ObservableList.OnListChangedCallback {
|
public abstract class OnListGeneralChangedCallback<T> extends OnListChangedCallback<ObservableList<T>> {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemRangeChanged(ObservableList sender, int positionStart, int itemCount) {
|
public void onItemRangeChanged(ObservableList<T> sender, int positionStart, int itemCount) {
|
||||||
onChanged(sender);
|
onChanged(sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemRangeInserted(ObservableList sender, int positionStart, int itemCount) {
|
public void onItemRangeInserted(ObservableList<T> sender, int positionStart, int itemCount) {
|
||||||
onChanged(sender);
|
onChanged(sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemRangeMoved(ObservableList sender, int fromPosition, int toPosition, int itemCount) {
|
public void onItemRangeMoved(ObservableList<T> sender, int fromPosition, int toPosition, int itemCount) {
|
||||||
onChanged(sender);
|
onChanged(sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemRangeRemoved(ObservableList sender, int positionStart, int itemCount) {
|
public void onItemRangeRemoved(ObservableList<T> sender, int positionStart, int itemCount) {
|
||||||
onChanged(sender);
|
onChanged(sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,13 +21,13 @@ public abstract class ExtendedSectionedRecyclerView<T, SH extends RecyclerView.V
|
|||||||
public ExtendedSectionedRecyclerView(ObservableArrayList<T> myDataset) {
|
public ExtendedSectionedRecyclerView(ObservableArrayList<T> myDataset) {
|
||||||
mDataset.addAll(myDataset);
|
mDataset.addAll(myDataset);
|
||||||
|
|
||||||
myDataset.addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
myDataset.addOnListChangedCallback(new OnListGeneralChangedCallback<T>() {
|
||||||
@Override
|
@Override
|
||||||
public void onChanged(ObservableList sender) {
|
public void onChanged(ObservableList<T> sender) {
|
||||||
mDataset.clear();
|
mDataset.clear();
|
||||||
mDataset.addAll(sender);
|
mDataset.addAll(sender);
|
||||||
notifyDataSetChanged();
|
|
||||||
notifyDataChanged();
|
notifyDataChanged();
|
||||||
|
notifyDataSetChanged();
|
||||||
checkIfEmpty();
|
checkIfEmpty();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package it.integry.integrywmsnative.core.interfaces.viewmodel_listeners;
|
||||||
|
|
||||||
|
public interface IOrdersLoadingListener {
|
||||||
|
|
||||||
|
void onOrderLoadingStarted();
|
||||||
|
|
||||||
|
void onOrderLoadingEnded();
|
||||||
|
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -89,6 +89,11 @@ public class MtbAart extends EntityBase {
|
|||||||
private Integer sezione;
|
private Integer sezione;
|
||||||
private UntMisRifPesoEnum untMisRifPeso;
|
private UntMisRifPesoEnum untMisRifPeso;
|
||||||
|
|
||||||
|
private BigDecimal qtaEsistente;
|
||||||
|
private BigDecimal qtaImpegnata;
|
||||||
|
private BigDecimal numCnfEsistente;
|
||||||
|
private BigDecimal numCnfImpegnata;
|
||||||
|
|
||||||
private List<MtbUntMis> mtbUntMis;
|
private List<MtbUntMis> mtbUntMis;
|
||||||
|
|
||||||
|
|
||||||
@@ -819,4 +824,40 @@ public class MtbAart extends EntityBase {
|
|||||||
this.untMisRifPeso = untMisRifPeso;
|
this.untMisRifPeso = untMisRifPeso;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaEsistente() {
|
||||||
|
return qtaEsistente;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setQtaEsistente(BigDecimal qtaEsistente) {
|
||||||
|
this.qtaEsistente = qtaEsistente;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaImpegnata() {
|
||||||
|
return qtaImpegnata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setQtaImpegnata(BigDecimal qtaImpegnata) {
|
||||||
|
this.qtaImpegnata = qtaImpegnata;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getNumCnfEsistente() {
|
||||||
|
return numCnfEsistente;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setNumCnfEsistente(BigDecimal numCnfEsistente) {
|
||||||
|
this.numCnfEsistente = numCnfEsistente;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getNumCnfImpegnata() {
|
||||||
|
return numCnfImpegnata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setNumCnfImpegnata(BigDecimal numCnfImpegnata) {
|
||||||
|
this.numCnfImpegnata = numCnfImpegnata;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class MtbColr extends EntityBase {
|
|||||||
public MtbColr() {
|
public MtbColr() {
|
||||||
type = "mtb_colr";
|
type = "mtb_colr";
|
||||||
|
|
||||||
if(SettingsManager.i().isUserLoggedIn()) {
|
if (SettingsManager.i().isUserLoggedIn()) {
|
||||||
setUtente(SettingsManager.i().getUser().getFullname());
|
setUtente(SettingsManager.i().getUser().getFullname());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,6 @@ public class MtbColr extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public MtbColr setGestione(GestioneEnum gestione) {
|
public MtbColr setGestione(GestioneEnum gestione) {
|
||||||
this.gestione = gestione.getText();
|
this.gestione = gestione.getText();
|
||||||
return this;
|
return this;
|
||||||
@@ -124,6 +123,11 @@ public class MtbColr extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MtbColr setDataCollo(Date dataCollo) {
|
||||||
|
setDataCollo(UtilityDate.formatDate(dataCollo, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Integer getRiga() {
|
public Integer getRiga() {
|
||||||
return riga;
|
return riga;
|
||||||
@@ -301,8 +305,6 @@ public class MtbColr extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getDatetimeRowS() {
|
public String getDatetimeRowS() {
|
||||||
return datetimeRow;
|
return datetimeRow;
|
||||||
}
|
}
|
||||||
@@ -322,11 +324,6 @@ public class MtbColr extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getCodJcom() {
|
public String getCodJcom() {
|
||||||
return codJcom;
|
return codJcom;
|
||||||
}
|
}
|
||||||
@@ -364,11 +361,6 @@ public class MtbColr extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getDataScadPartitaS() {
|
public String getDataScadPartitaS() {
|
||||||
return dataScadPartita;
|
return dataScadPartita;
|
||||||
}
|
}
|
||||||
@@ -398,7 +390,6 @@ public class MtbColr extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getUntMis() {
|
public String getUntMis() {
|
||||||
return untMis;
|
return untMis;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class MtbCols extends EntityBase {
|
|||||||
type = "mtb_cols";
|
type = "mtb_cols";
|
||||||
setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep());
|
setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep());
|
||||||
setModificatoDa(SettingsManager.i().getUser().getFullname());
|
setModificatoDa(SettingsManager.i().getUser().getFullname());
|
||||||
setDataMove(UtilityDate.getDateInstance());
|
//setDataMove(UtilityDate.getDateInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDataCollo() {
|
public String getDataCollo() {
|
||||||
|
|||||||
@@ -1,13 +1,20 @@
|
|||||||
package it.integry.integrywmsnative.core.model;
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
|
||||||
|
import com.annimon.stream.Optional;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.dto.InternalCodAnagsDTO;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||||
@@ -57,6 +64,7 @@ public class MtbColt extends EntityBase {
|
|||||||
private String codJcom;
|
private String codJcom;
|
||||||
|
|
||||||
private List<MtbCols> mtbCols;
|
private List<MtbCols> mtbCols;
|
||||||
|
private MtbTCol mtbTCol;
|
||||||
|
|
||||||
private Boolean disablePrint;
|
private Boolean disablePrint;
|
||||||
private String ragSocCliente;
|
private String ragSocCliente;
|
||||||
@@ -83,7 +91,6 @@ public class MtbColt extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private ObservableArrayList<MtbColr> mtbColr = new ObservableArrayList<>();
|
private ObservableArrayList<MtbColr> mtbColr = new ObservableArrayList<>();
|
||||||
|
|
||||||
public ObservableArrayList<MtbColr> getMtbColr() {
|
public ObservableArrayList<MtbColr> getMtbColr() {
|
||||||
@@ -95,21 +102,51 @@ public class MtbColt extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MtbColt(){
|
public MtbColt() {
|
||||||
type = "mtb_colt";
|
type = "mtb_colt";
|
||||||
setDataCollo(UtilityDate.getDateInstance());
|
setDataCollo(UtilityDate.getDateInstance());
|
||||||
setSerCollo("/");
|
setSerCollo("/");
|
||||||
|
|
||||||
if(SettingsManager.i().isUserLoggedIn()) {
|
if (SettingsManager.i().isUserLoggedIn()) {
|
||||||
setPreparatoDa(SettingsManager.i().getUser().getFullname());
|
setPreparatoDa(SettingsManager.i().getUser().getFullname());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MtbColt initDefaultFields() {
|
public MtbColt initDefaultFields(GestioneEnum gestioneEnum) {
|
||||||
|
setGestione(gestioneEnum);
|
||||||
setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep());
|
setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep());
|
||||||
setPreparatoDa(SettingsManager.i().getUser().getFullname());
|
setPreparatoDa(SettingsManager.i().getUser().getFullname());
|
||||||
setOraInizPrep(UtilityDate.getDateInstance());
|
setOraInizPrep(UtilityDate.getDateInstance());
|
||||||
setCodAnag(SettingsManager.iDB().getDefaultCodAnag());
|
|
||||||
|
String codAnagToUse = null;
|
||||||
|
switch (gestioneEnum) {
|
||||||
|
case ACQUISTO:
|
||||||
|
case LAVORAZIONE:
|
||||||
|
case PRODUZIONE:
|
||||||
|
if (SettingsManager.iDB().getInternalCodAnags() == null) break;
|
||||||
|
|
||||||
|
Optional<InternalCodAnagsDTO> optCodAnagForn = Stream.of(SettingsManager.iDB().getInternalCodAnags())
|
||||||
|
.filter(InternalCodAnagsDTO::isFornitore)
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
if (optCodAnagForn.isEmpty()) break;
|
||||||
|
|
||||||
|
codAnagToUse = optCodAnagForn.get().getCodAnag();
|
||||||
|
break;
|
||||||
|
case VENDITA:
|
||||||
|
if (SettingsManager.iDB().getInternalCodAnags() == null) break;
|
||||||
|
|
||||||
|
Optional<InternalCodAnagsDTO> optCodAnagClie = Stream.of(SettingsManager.iDB().getInternalCodAnags())
|
||||||
|
.filter(InternalCodAnagsDTO::isCliente)
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
if (optCodAnagClie.isEmpty()) break;
|
||||||
|
|
||||||
|
codAnagToUse = optCodAnagClie.get().getCodAnag();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
setCodAnag(codAnagToUse);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -137,11 +174,11 @@ public class MtbColt extends EntityBase {
|
|||||||
Date dataColloD = null;
|
Date dataColloD = null;
|
||||||
try {
|
try {
|
||||||
dataColloD = getDataColloD();
|
dataColloD = getDataColloD();
|
||||||
} catch (Exception ex){
|
} catch (Exception ex) {
|
||||||
UtilityLogger.errorMe(ex);
|
UtilityLogger.error(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dataColloD != null){
|
if (dataColloD != null) {
|
||||||
return UtilityDate.formatDate(dataColloD, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN_LONG);
|
return UtilityDate.formatDate(dataColloD, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN_LONG);
|
||||||
} else return null;
|
} else return null;
|
||||||
}
|
}
|
||||||
@@ -392,7 +429,7 @@ public class MtbColt extends EntityBase {
|
|||||||
public String getTimeVers() {
|
public String getTimeVers() {
|
||||||
Date dataColloD = getDataVersD();
|
Date dataColloD = getDataVersD();
|
||||||
|
|
||||||
if(dataColloD != null){
|
if (dataColloD != null) {
|
||||||
return UtilityDate.formatDate(dataColloD, UtilityDate.COMMONS_DATE_FORMATS.TIME);
|
return UtilityDate.formatDate(dataColloD, UtilityDate.COMMONS_DATE_FORMATS.TIME);
|
||||||
} else return null;
|
} else return null;
|
||||||
}
|
}
|
||||||
@@ -526,16 +563,57 @@ public class MtbColt extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MtbTCol getMtbTCol() {
|
||||||
|
return mtbTCol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setMtbTCol(MtbTCol mtbTCol) {
|
||||||
|
this.mtbTCol = mtbTCol;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public void generaFiltroOrdineFromDTO(List<FiltroOrdineDTO> filtroOrdineDtos) {
|
public void generaFiltroOrdineFromDTO(List<FiltroOrdineDTO> filtroOrdineDtos) {
|
||||||
|
|
||||||
String xmlPrefix = "{\"whereCond\": \"";
|
String xmlPrefix = "{\"whereCond\": \"";
|
||||||
String xmlSuffix = "\"}";
|
String xmlSuffix = "\"}";
|
||||||
|
|
||||||
StringBuilder whereCond = new StringBuilder();
|
// StringBuilder whereCond = new StringBuilder();
|
||||||
|
String whereCond;
|
||||||
|
List<String> conditions = new ArrayList<>();
|
||||||
|
String existingFilter;
|
||||||
|
if (this.filtroOrdini != null) {
|
||||||
|
existingFilter = this.filtroOrdini;
|
||||||
|
existingFilter = existingFilter.replace(xmlPrefix, "").replace(xmlSuffix, "");
|
||||||
|
conditions.add(existingFilter);
|
||||||
|
} else {
|
||||||
|
existingFilter = "";
|
||||||
|
}
|
||||||
|
|
||||||
if(filtroOrdineDtos != null && filtroOrdineDtos.size() > 0) {
|
|
||||||
|
|
||||||
for(int i = 0; i < filtroOrdineDtos.size(); i++){
|
for (FiltroOrdineDTO filtroOrdineDTO : filtroOrdineDtos) {
|
||||||
|
try {
|
||||||
|
String condition = (String.format("(d.g = %s AND d.d = %s and d.n = %s",
|
||||||
|
UtilityDB.valueToString(filtroOrdineDTO.getGestioneOrd()),
|
||||||
|
UtilityDB.valueToString(UtilityDate.formatDate(filtroOrdineDTO.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH)),
|
||||||
|
UtilityDB.valueToString(filtroOrdineDTO.getNumOrd())));
|
||||||
|
|
||||||
|
if (!UtilityString.isNullOrEmpty(filtroOrdineDTO.getDataConsS())) {
|
||||||
|
condition += (String.format(" AND dr.dc = %s",
|
||||||
|
UtilityDB.valueToString(UtilityDate.formatDate(filtroOrdineDTO.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH))));
|
||||||
|
}
|
||||||
|
|
||||||
|
condition += ")";
|
||||||
|
if (!existingFilter.contains(condition)) {
|
||||||
|
conditions.add(condition);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*if (filtroOrdineDtos != null && filtroOrdineDtos.size() > 0) {
|
||||||
|
|
||||||
|
for (int i = 0; i < filtroOrdineDtos.size(); i++) {
|
||||||
FiltroOrdineDTO x = filtroOrdineDtos.get(i);
|
FiltroOrdineDTO x = filtroOrdineDtos.get(i);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -545,13 +623,13 @@ public class MtbColt extends EntityBase {
|
|||||||
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 dr.dc = %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))));
|
||||||
}
|
}
|
||||||
|
|
||||||
whereCond.append(")");
|
whereCond.append(")");
|
||||||
if(i < filtroOrdineDtos.size()-1) {
|
if (i < filtroOrdineDtos.size() - 1) {
|
||||||
whereCond.append(" OR ");
|
whereCond.append(" OR ");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -559,7 +637,8 @@ public class MtbColt extends EntityBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
whereCond = TextUtils.join(" OR ", conditions);
|
||||||
|
|
||||||
this.filtroOrdini = xmlPrefix + whereCond + xmlSuffix;
|
this.filtroOrdini = xmlPrefix + whereCond + xmlSuffix;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.core.model;
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
|
|
||||||
public class MtbDepoPosizione {
|
public class MtbDepoPosizione {
|
||||||
@@ -19,7 +18,7 @@ public class MtbDepoPosizione {
|
|||||||
return (MtbDepoPosizione) super.clone();
|
return (MtbDepoPosizione) super.clone();
|
||||||
} catch (CloneNotSupportedException e) {
|
} catch (CloneNotSupportedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
UtilityLogger.errorMe(e);
|
UtilityLogger.error(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -0,0 +1,273 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by ValerioC on 06/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class MvwSitArtUdcDetInventario {
|
||||||
|
|
||||||
|
private String gestione;
|
||||||
|
private Date dataCollo;
|
||||||
|
private String serCollo;
|
||||||
|
private Integer numCollo;
|
||||||
|
private Integer segno;
|
||||||
|
private String codMdep;
|
||||||
|
private String posizione;
|
||||||
|
private Integer priorita;
|
||||||
|
private String codGruppo;
|
||||||
|
private String gruppo;
|
||||||
|
private String codSgruppo;
|
||||||
|
private String sottogruppo;
|
||||||
|
private String codMart;
|
||||||
|
private String diacod;
|
||||||
|
private String descrizioneEstesa;
|
||||||
|
private String partitaMag;
|
||||||
|
private String codJcom;
|
||||||
|
private String commessa;
|
||||||
|
private String untMis;
|
||||||
|
private BigDecimal qtaCol;
|
||||||
|
private BigDecimal numCnf;
|
||||||
|
private BigDecimal qtaCnf;
|
||||||
|
private BigDecimal pesoNettoKg;
|
||||||
|
private BigDecimal pesoLordoKg;
|
||||||
|
private String codJfas;
|
||||||
|
private MtbAart mtbAart;
|
||||||
|
|
||||||
|
|
||||||
|
public String getGestione() {
|
||||||
|
return gestione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setGestione(String gestione) {
|
||||||
|
this.gestione = gestione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataCollo() {
|
||||||
|
return dataCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setDataCollo(Date dataCollo) {
|
||||||
|
this.dataCollo = dataCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSerCollo() {
|
||||||
|
return serCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setSerCollo(String serCollo) {
|
||||||
|
this.serCollo = serCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumCollo() {
|
||||||
|
return numCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setNumCollo(Integer numCollo) {
|
||||||
|
this.numCollo = numCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSegno() {
|
||||||
|
return segno;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setSegno(Integer segno) {
|
||||||
|
this.segno = segno;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPosizione() {
|
||||||
|
return posizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setPosizione(String posizione) {
|
||||||
|
this.posizione = posizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPriorita() {
|
||||||
|
return priorita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setPriorita(Integer priorita) {
|
||||||
|
this.priorita = priorita;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodGruppo() {
|
||||||
|
return codGruppo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setCodGruppo(String codGruppo) {
|
||||||
|
this.codGruppo = codGruppo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGruppo() {
|
||||||
|
return gruppo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setGruppo(String gruppo) {
|
||||||
|
this.gruppo = gruppo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodSgruppo() {
|
||||||
|
return codSgruppo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setCodSgruppo(String codSgruppo) {
|
||||||
|
this.codSgruppo = codSgruppo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSottogruppo() {
|
||||||
|
return sottogruppo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setSottogruppo(String sottogruppo) {
|
||||||
|
this.sottogruppo = sottogruppo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMart() {
|
||||||
|
return codMart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setCodMart(String codMart) {
|
||||||
|
this.codMart = codMart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDiacod() {
|
||||||
|
return diacod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setDiacod(String diacod) {
|
||||||
|
this.diacod = diacod;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizioneEstesa() {
|
||||||
|
return descrizioneEstesa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setDescrizioneEstesa(String descrizioneEstesa) {
|
||||||
|
this.descrizioneEstesa = descrizioneEstesa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPartitaMag() {
|
||||||
|
return partitaMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setPartitaMag(String partitaMag) {
|
||||||
|
this.partitaMag = partitaMag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodJcom() {
|
||||||
|
return codJcom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setCodJcom(String codJcom) {
|
||||||
|
this.codJcom = codJcom;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCommessa() {
|
||||||
|
return commessa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setCommessa(String commessa) {
|
||||||
|
this.commessa = commessa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUntMis() {
|
||||||
|
return untMis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setUntMis(String untMis) {
|
||||||
|
this.untMis = untMis;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaCol() {
|
||||||
|
return qtaCol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setQtaCol(BigDecimal qtaCol) {
|
||||||
|
this.qtaCol = qtaCol;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getNumCnf() {
|
||||||
|
return numCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setNumCnf(BigDecimal numCnf) {
|
||||||
|
this.numCnf = numCnf;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaCnf() {
|
||||||
|
return qtaCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setQtaCnf(BigDecimal qtaCnf) {
|
||||||
|
this.qtaCnf = qtaCnf;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPesoNettoKg() {
|
||||||
|
return pesoNettoKg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setPesoNettoKg(BigDecimal pesoNettoKg) {
|
||||||
|
this.pesoNettoKg = pesoNettoKg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPesoLordoKg() {
|
||||||
|
return pesoLordoKg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setPesoLordoKg(BigDecimal pesoLordoKg) {
|
||||||
|
this.pesoLordoKg = pesoLordoKg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodJfas() {
|
||||||
|
return codJfas;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setCodJfas(String codJfas) {
|
||||||
|
this.codJfas = codJfas;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart getMtbAart() {
|
||||||
|
return mtbAart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MvwSitArtUdcDetInventario setMtbAart(MtbAart mtbAart) {
|
||||||
|
this.mtbAart = mtbAart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model.dto;
|
||||||
|
|
||||||
|
public class InternalCodAnagsDTO {
|
||||||
|
|
||||||
|
private String codAnag;
|
||||||
|
private boolean isCliente;
|
||||||
|
private boolean isFornitore;
|
||||||
|
|
||||||
|
public String getCodAnag() {
|
||||||
|
return codAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public InternalCodAnagsDTO setCodAnag(String codAnag) {
|
||||||
|
this.codAnag = codAnag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCliente() {
|
||||||
|
return isCliente;
|
||||||
|
}
|
||||||
|
|
||||||
|
public InternalCodAnagsDTO setCliente(boolean cliente) {
|
||||||
|
isCliente = cliente;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFornitore() {
|
||||||
|
return isFornitore;
|
||||||
|
}
|
||||||
|
|
||||||
|
public InternalCodAnagsDTO setFornitore(boolean fornitore) {
|
||||||
|
isFornitore = fornitore;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model.dto;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class StatoArticoloDTO {
|
||||||
|
private String codMart;
|
||||||
|
|
||||||
|
private String partitaMag;
|
||||||
|
|
||||||
|
private Date dataScad;
|
||||||
|
|
||||||
|
private Integer ggScadPartita;
|
||||||
|
|
||||||
|
private Integer ggMax;
|
||||||
|
|
||||||
|
private Integer ggScadEffettivi;
|
||||||
|
|
||||||
|
private Integer ggUtili;
|
||||||
|
|
||||||
|
private Integer statoArt;
|
||||||
|
|
||||||
|
public String getCodMart() {
|
||||||
|
return codMart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StatoArticoloDTO setCodMart(String codMart) {
|
||||||
|
this.codMart = codMart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPartitaMag() {
|
||||||
|
return partitaMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StatoArticoloDTO setPartitaMag(String partitaMag) {
|
||||||
|
this.partitaMag = partitaMag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataScad() {
|
||||||
|
return dataScad;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StatoArticoloDTO setDataScad(Date dataScad) {
|
||||||
|
this.dataScad = dataScad;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getGgScadPartita() {
|
||||||
|
return ggScadPartita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StatoArticoloDTO setGgScadPartita(Integer ggScadPartita) {
|
||||||
|
this.ggScadPartita = ggScadPartita;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getGgMax() {
|
||||||
|
return ggMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StatoArticoloDTO setGgMax(Integer ggMax) {
|
||||||
|
this.ggMax = ggMax;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getGgScadEffettivi() {
|
||||||
|
return ggScadEffettivi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StatoArticoloDTO setGgScadEffettivi(Integer ggScadEffettivi) {
|
||||||
|
this.ggScadEffettivi = ggScadEffettivi;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getGgUtili() {
|
||||||
|
return ggUtili;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StatoArticoloDTO setGgUtili(Integer ggUtili) {
|
||||||
|
this.ggUtili = ggUtili;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getStatoArt() {
|
||||||
|
return statoArt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StatoArticoloDTO setStatoArt(Integer statoArt) {
|
||||||
|
this.statoArt = statoArt;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model.secondary;
|
||||||
|
|
||||||
|
public enum StatoPartitaMag {
|
||||||
|
|
||||||
|
IN_SCADENZA(1),
|
||||||
|
SCADUTO(2),
|
||||||
|
NON_IN_SCADENZA(3);
|
||||||
|
|
||||||
|
private final int text;
|
||||||
|
|
||||||
|
StatoPartitaMag(int text) {
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getText() {
|
||||||
|
return this.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static StatoPartitaMag from(int text) {
|
||||||
|
for (StatoPartitaMag b : StatoPartitaMag.values()) {
|
||||||
|
if (b.text == text) return b;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package it.integry.integrywmsnative.core.report;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public enum ReportType {
|
||||||
|
|
||||||
|
@SerializedName("0")
|
||||||
|
ETICHETTA_SSCC_ACCETTAZIONE(0),
|
||||||
|
@SerializedName("1")
|
||||||
|
ETICHETTA_SSCC_LAVORAZIONE(1),
|
||||||
|
@SerializedName("2")
|
||||||
|
ETICHETTA_SSCC_SPEDIZIONE(2),
|
||||||
|
@SerializedName("3")
|
||||||
|
WMS_SPEDIZIONE_ETICHETTE_SSCC_ORD(3),
|
||||||
|
@SerializedName("4")
|
||||||
|
WMS_SPEDIZIONE_PACKING_LIST_ORD(4),
|
||||||
|
@SerializedName("5")
|
||||||
|
STAMPA_LISTINI_VENDITA(5);
|
||||||
|
|
||||||
|
private final int value;
|
||||||
|
|
||||||
|
ReportType(int value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ReportType from(Object value) {
|
||||||
|
int castValue = (int) value;
|
||||||
|
for (ReportType b : ReportType.values()) {
|
||||||
|
if (b.value == castValue)
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import java.net.SocketTimeoutException;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
||||||
|
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by GiuseppeS on 22/03/2018.
|
* Created by GiuseppeS on 22/03/2018.
|
||||||
@@ -15,13 +16,16 @@ public class CommonRESTException {
|
|||||||
private static String MESSAGE_KEY = "message";
|
private static String MESSAGE_KEY = "message";
|
||||||
private static String EXCEPTION_KEY = "exception";
|
private static String EXCEPTION_KEY = "exception";
|
||||||
|
|
||||||
private static HashMap<String, HashMap<String, Object>> bindingExceptions = new HashMap() {{
|
private static final HashMap<String, HashMap<String, Object>> bindingExceptions = new HashMap<>() {{
|
||||||
put("Printer not found", new HashMap<String, Object>(){{
|
put("Printer not found", new HashMap<>() {{
|
||||||
put(MESSAGE_KEY, "Stampante non trovata");
|
put(MESSAGE_KEY, "Stampante non trovata");
|
||||||
put(EXCEPTION_KEY, NoPrintersFoundException.class);
|
put(EXCEPTION_KEY, NoPrintersFoundException.class);
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
put("barcode non letto correttamente", new HashMap<>() {{
|
||||||
|
put(MESSAGE_KEY, "Barcode non letto correttamente");
|
||||||
|
put(EXCEPTION_KEY, NoResultFromBarcodeException.class);
|
||||||
|
}});
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|
||||||
@@ -42,13 +46,11 @@ public class CommonRESTException {
|
|||||||
|
|
||||||
for(String key : bindingExceptions.keySet()) {
|
for(String key : bindingExceptions.keySet()) {
|
||||||
if(message.contains(key)) {
|
if(message.contains(key)) {
|
||||||
Class classType = (Class) bindingExceptions.get(key).get(EXCEPTION_KEY);
|
Class<?> classType = (Class<?>) bindingExceptions.get(key).get(EXCEPTION_KEY);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return (Exception) classType.newInstance();
|
return (Exception) classType.newInstance();
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException | InstantiationException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (InstantiationException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,20 +21,21 @@ public class RESTBuilder {
|
|||||||
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, 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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors) {
|
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors) {
|
||||||
return getService(service, host, port, addInterceptors, true, 30);
|
return getService(service, host, port, addInterceptors, true, 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors, boolean addEmsApi) {
|
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors, boolean addEmsApi) {
|
||||||
return getService(service, host, port, addInterceptors, addEmsApi, 30);
|
return getService(service, host, port, addInterceptors, addEmsApi, 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors, boolean addEmsApi, int timeout){
|
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors, boolean addEmsApi, int timeout) {
|
||||||
OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder();
|
OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder();
|
||||||
|
|
||||||
clientBuilder.connectTimeout(timeout, TimeUnit.SECONDS);
|
clientBuilder.connectTimeout(timeout, TimeUnit.SECONDS);
|
||||||
@@ -43,7 +44,7 @@ public class RESTBuilder {
|
|||||||
|
|
||||||
clientBuilder.retryOnConnectionFailure(true);
|
clientBuilder.retryOnConnectionFailure(true);
|
||||||
|
|
||||||
if(addInterceptors) clientBuilder.addInterceptor(new HttpInterceptor());
|
if (addInterceptors) clientBuilder.addInterceptor(new HttpInterceptor());
|
||||||
|
|
||||||
OkHttpClient client = clientBuilder.build();
|
OkHttpClient client = clientBuilder.build();
|
||||||
|
|
||||||
@@ -62,4 +63,13 @@ public class RESTBuilder {
|
|||||||
|
|
||||||
return retrofit.create(service);
|
return retrofit.create(service);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String getDefaultHost() {
|
||||||
|
return SettingsManager.i().getServer().getHost();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getDefaultPort() {
|
||||||
|
return SettingsManager.i().getServer().getPort();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import javax.inject.Singleton;
|
|||||||
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.model.MtbGrup;
|
||||||
|
import it.integry.integrywmsnative.core.model.dto.StatoArticoloDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||||
@@ -32,11 +33,13 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
public void getByBarcodeProd(String barcodeProd, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
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<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||||
analyzeAnswer(response, "getByBarcodeProd", (m) -> {
|
analyzeAnswer(response, "getByBarcodeProd", (m) -> {
|
||||||
onComplete.run(response.body().getEntityList());
|
List<MtbAart> aartList = response.body().getEntityList();
|
||||||
|
aartList = aartList != null ? Stream.of(aartList).filter(x -> x.getFlagStato().equalsIgnoreCase("A")).toList() : null;
|
||||||
|
onComplete.run(aartList);
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +62,7 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
|
|
||||||
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||||
articoloRESTConsumer.getByCodMart(joinedCods).enqueue(new Callback<ServiceRESTResponse<MtbAart>>() {
|
articoloRESTConsumer.getByCodMart(joinedCods).enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||||
analyzeAnswer(response, "getByCodMart", (m) -> {
|
analyzeAnswer(response, "getByCodMart", (m) -> {
|
||||||
@@ -75,15 +78,32 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void getStatoPartita(String codMart, String partitaMag, RunnableArgs<List<StatoArticoloDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||||
|
articoloRESTConsumer.getStatoPartita(codMart, partitaMag).enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<StatoArticoloDTO>>> call, Response<ServiceRESTResponse<List<StatoArticoloDTO>>> response) {
|
||||||
|
analyzeAnswer(response, "getStatoPartita", onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<StatoArticoloDTO>>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void getByCodMart(String codMartToFind, RunnableArgs<MtbAart> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getByCodMart(String codMartToFind, RunnableArgs<MtbAart> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||||
articoloRESTConsumer.getByCodMart(codMartToFind).enqueue(new Callback<ServiceRESTResponse<MtbAart>>() {
|
articoloRESTConsumer.getByCodMart(codMartToFind).enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||||
analyzeAnswer(response, "getByCodMart", (m) -> {
|
analyzeAnswer(response, "getByCodMart", (m) -> {
|
||||||
if(response.body().getEntityList() != null && !response.body().getEntityList().isEmpty()) {
|
if (response.body().getEntityList() != null && !response.body().getEntityList().isEmpty()) {
|
||||||
onComplete.run(response.body().getEntityList().get(0));
|
onComplete.run(response.body().getEntityList().get(0));
|
||||||
} else onComplete.run(null);
|
} else onComplete.run(null);
|
||||||
|
|
||||||
@@ -107,9 +127,10 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
})
|
})
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
var whereCond = " WHERE " + UtilityQuery.concatFieldListInWhereCond(whereCondMap);
|
var whereCond = whereCondMap.isEmpty() ? "" : " WHERE " + UtilityQuery.concatFieldListInWhereCond(whereCondMap);
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbGrup>>() {}.getType();
|
Type typeOfObjectsList = new TypeToken<ArrayList<MtbGrup>>() {
|
||||||
|
}.getType();
|
||||||
this.systemRESTConsumer.processSql("SELECT * FROM mtb_grup " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
this.systemRESTConsumer.processSql("SELECT * FROM mtb_grup " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
|
import it.integry.integrywmsnative.core.model.dto.StatoArticoloDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
@@ -16,4 +19,7 @@ public interface ArticoloRESTConsumerService {
|
|||||||
@GET("SM2getArticoloByCodMart")
|
@GET("SM2getArticoloByCodMart")
|
||||||
Call<ServiceRESTResponse<MtbAart>> getByCodMart(@Query("codMart") String barcodeProd);
|
Call<ServiceRESTResponse<MtbAart>> getByCodMart(@Query("codMart") String barcodeProd);
|
||||||
|
|
||||||
|
@GET("getProductLotStatus")
|
||||||
|
Call<ServiceRESTResponse<List<StatoArticoloDTO>>> getStatoPartita(@Query("codMart") String codMart, @Query("partitaMag") String partitaMag);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class BarcodeRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
IBarcodeCustomization barcodeCustomization = ClassRouter.getInstance(ClassRouter.PATH.BARCODE_CUSTOMIZATION);
|
IBarcodeCustomization barcodeCustomization = ClassRouter.getInstance(ClassRouter.PATH.BARCODE_CUSTOMIZATION);
|
||||||
|
|
||||||
if(barcodeCustomization != null && barcodeCustomization.shouldForceToEan13(barcodeObj.getStringValue())){
|
if (barcodeCustomization != null && barcodeCustomization.shouldForceToEan13(barcodeObj.getStringValue())) {
|
||||||
Ean128Model ean128Model = new Ean128Model();
|
Ean128Model ean128Model = new Ean128Model();
|
||||||
ean128Model.Gtin = barcodeObj.getStringValue();
|
ean128Model.Gtin = barcodeObj.getStringValue();
|
||||||
onComplete.run(ean128Model);
|
onComplete.run(ean128Model);
|
||||||
@@ -30,7 +30,7 @@ public class BarcodeRESTConsumer extends _BaseRESTConsumer {
|
|||||||
String ean128 = barcodeObj.getStringValue().replaceAll("" + ((char) 29), "|");
|
String ean128 = barcodeObj.getStringValue().replaceAll("" + ((char) 29), "|");
|
||||||
|
|
||||||
BarcodeRESTConsumerService barcodeRESTConsumerService = RESTBuilder.getService(BarcodeRESTConsumerService.class);
|
BarcodeRESTConsumerService barcodeRESTConsumerService = RESTBuilder.getService(BarcodeRESTConsumerService.class);
|
||||||
barcodeRESTConsumerService.decodeEan128(ean128).enqueue(new Callback<ServiceRESTResponse<Ean128Model>>() {
|
barcodeRESTConsumerService.decodeEan128(ean128).enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Ean128Model>> call, Response<ServiceRESTResponse<Ean128Model>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Ean128Model>> call, Response<ServiceRESTResponse<Ean128Model>> response) {
|
||||||
analyzeAnswer(response, "DecodeEan128", onComplete, onFailed);
|
analyzeAnswer(response, "DecodeEan128", onComplete, onFailed);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
|
||||||
|
import com.annimon.stream.Optional;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
@@ -32,6 +33,7 @@ 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.rest.model.SpostaArtsTraULRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||||
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;
|
||||||
@@ -102,10 +104,9 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
public 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);
|
|
||||||
|
|
||||||
mtbColtToCreate.initDefaultFields();
|
mtbColtToCreate.initDefaultFields(GestioneEnum.LAVORAZIONE);
|
||||||
|
|
||||||
mtbColtToCreate
|
mtbColtToCreate
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
@@ -121,9 +122,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
public 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(GestioneEnum.LAVORAZIONE)
|
||||||
.setCodAnag(null)
|
.setCodAnag(null)
|
||||||
.setGestione(GestioneEnum.LAVORAZIONE)
|
|
||||||
.setSegno(-1)
|
.setSegno(-1)
|
||||||
.setCodTcol(sourceMtbColt.getCodTcol())
|
.setCodTcol(sourceMtbColt.getCodTcol())
|
||||||
.setPesoKg(sourceMtbColt.getPesoKg())
|
.setPesoKg(sourceMtbColt.getPesoKg())
|
||||||
@@ -153,7 +153,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
mtbColrClone
|
mtbColrClone
|
||||||
.setNumCollo(null)
|
.setNumCollo(null)
|
||||||
.setDataCollo(null)
|
.setDataCollo((String) null)
|
||||||
.setRiga(null)
|
.setRiga(null)
|
||||||
.setGestione(GestioneEnum.LAVORAZIONE)
|
.setGestione(GestioneEnum.LAVORAZIONE)
|
||||||
|
|
||||||
@@ -174,9 +174,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
public 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(GestioneEnum.LAVORAZIONE)
|
||||||
.setCodAnag(null)
|
.setCodAnag(null)
|
||||||
.setGestione(GestioneEnum.LAVORAZIONE)
|
|
||||||
.setSegno(-1)
|
.setSegno(-1)
|
||||||
.setCodTcol(sourceMtbColt.getCodTcol())
|
.setCodTcol(sourceMtbColt.getCodTcol())
|
||||||
// .setPesoKg(sourceMtbColt.getPesoKg())
|
// .setPesoKg(sourceMtbColt.getPesoKg())
|
||||||
@@ -207,7 +206,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
MtbColr mtbColrClone = new MtbColr();
|
MtbColr mtbColrClone = new MtbColr();
|
||||||
mtbColrClone
|
mtbColrClone
|
||||||
.setNumCollo(null)
|
.setNumCollo(null)
|
||||||
.setDataCollo(null)
|
.setDataCollo((String) null)
|
||||||
.setRiga(null)
|
.setRiga(null)
|
||||||
.setGestione(GestioneEnum.LAVORAZIONE)
|
.setGestione(GestioneEnum.LAVORAZIONE)
|
||||||
.setDataColloRif(sourceMtbColt.getDataColloD())
|
.setDataColloRif(sourceMtbColt.getDataColloD())
|
||||||
@@ -237,7 +236,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
saveCollo(newMtbColt, onComplete, onFailed);
|
saveCollo(newMtbColt, onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public 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);
|
||||||
}
|
}
|
||||||
@@ -245,11 +243,16 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
public void createColloFromEtichettaAnonima(String barcode, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createColloFromEtichettaAnonima(String barcode, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
MtbColt mtbColtToCreate = new MtbColt()
|
MtbColt mtbColtToCreate = new MtbColt()
|
||||||
.setGestione(gestione);
|
.initDefaultFields(gestione);
|
||||||
|
|
||||||
mtbColtToCreate.initDefaultFields();
|
Integer customNumCollo = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
customNumCollo = UtilityBarcode.getNumColloFromULAnonima(barcode);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
onFailed.run(ex);
|
||||||
|
}
|
||||||
|
|
||||||
Integer customNumCollo = UtilityBarcode.getNumColloFromULAnonima(barcode);
|
|
||||||
String customSerCollo = CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE;
|
String customSerCollo = CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE;
|
||||||
|
|
||||||
if (customNumCollo != null) {
|
if (customNumCollo != null) {
|
||||||
@@ -323,7 +326,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
public void getBySSCC(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getBySSCC(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
|
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||||
analyzeAnswer(response, "GetBySSCC", mtbColt -> {
|
analyzeAnswer(response, "GetBySSCC", mtbColt -> {
|
||||||
@@ -397,7 +400,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private 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()) {
|
||||||
getByTestata(sourceMtbColts.next(), onlyResiduo, false, mtbColt -> {
|
getByTestata(sourceMtbColts.next(), onlyResiduo, false, mtbColt -> {
|
||||||
@@ -447,7 +449,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void changePosizione(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void changePosizione(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
String codMdep = posizione.getCodMdep();
|
String codMdep = posizione.getCodMdep();
|
||||||
@@ -543,7 +544,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void retrieveBasketColli(RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void retrieveBasketColli(RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
colliMagazzinoRESTConsumerService.getColliInBasket(SettingsManager.i().getUserSession().getDepo().getCodMdep()).enqueue(new Callback<ServiceRESTResponse<List<MtbColt>>>() {
|
colliMagazzinoRESTConsumerService.getColliInBasket(SettingsManager.i().getUserSession().getDepo().getCodMdep()).enqueue(new Callback<ServiceRESTResponse<List<MtbColt>>>() {
|
||||||
@@ -589,6 +589,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
new Thread(() -> {
|
||||||
MtbColt mtbColtToMoveClone = (MtbColt) sourceMtbColt.clone();
|
MtbColt mtbColtToMoveClone = (MtbColt) sourceMtbColt.clone();
|
||||||
MtbColt mtbColtDestClone = (MtbColt) destMtbColt.clone();
|
MtbColt mtbColtDestClone = (MtbColt) destMtbColt.clone();
|
||||||
|
|
||||||
@@ -618,9 +619,9 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
if (onFailed != null) onFailed.run(new Exception(t));
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void assegnaLottoSuColloScarico(MtbColt sourceMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void assegnaLottoSuColloScarico(MtbColt sourceMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MtbColt sourceMtbColtClone = (MtbColt) sourceMtbColt.clone();
|
MtbColt sourceMtbColtClone = (MtbColt) sourceMtbColt.clone();
|
||||||
|
|
||||||
@@ -646,4 +647,82 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void versamentoAutomaticoUL(MtbColt sourceMtbColt, RunnableArgs<VersamentoAutomaticoULResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
MtbColt sourceMtbColtClone = (MtbColt) sourceMtbColt.clone();
|
||||||
|
|
||||||
|
for (int i = 0; i < sourceMtbColtClone.getMtbColr().size(); i++) {
|
||||||
|
sourceMtbColtClone.getMtbColr().get(i)
|
||||||
|
.setMtbAart(null)
|
||||||
|
.setMtbPartitaMag(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
|
colliMagazzinoRESTConsumerService.versamentoAutomaticoUL(sourceMtbColtClone).enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> call, Response<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> response) {
|
||||||
|
analyzeAnswer(response, "versamentoAutomaticoUL", data -> {
|
||||||
|
var result = response.body().getDto();
|
||||||
|
|
||||||
|
List<MtbColr> allMtbColr = new ArrayList<>();
|
||||||
|
allMtbColr.addAll(result.getSuccess());
|
||||||
|
allMtbColr.addAll(result.getFailed());
|
||||||
|
|
||||||
|
List<String> codMarts = Stream.of(allMtbColr)
|
||||||
|
.map(x -> x.getCodMart().trim())
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
mArticoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
|
||||||
|
for (var mtbColr : allMtbColr) {
|
||||||
|
|
||||||
|
MtbAart foundMtbAart = null;
|
||||||
|
|
||||||
|
Optional<MtbAart> mtbAartOpt = Stream.of(mtbAarts)
|
||||||
|
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart()))
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
if (mtbAartOpt.isPresent()) {
|
||||||
|
foundMtbAart = mtbAartOpt.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
mtbColr.setMtbAart(foundMtbAart);
|
||||||
|
}
|
||||||
|
|
||||||
|
onComplete.run(result);
|
||||||
|
}, onFailed);
|
||||||
|
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> call, Throwable t) {
|
||||||
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadShipmentUlFromProductionUL(MtbColt mtbColt, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
HashMap<String, Object> params = new HashMap<>();
|
||||||
|
params.put("mtb_colr.gestione_rif", mtbColt.getGestione());
|
||||||
|
params.put("mtb_colr.ser_collo_rif", mtbColt.getSerCollo());
|
||||||
|
params.put("mtb_colr.num_collo_rif", mtbColt.getNumCollo());
|
||||||
|
params.put("mtb_colr.data_collo_rif", mtbColt.getDataColloD());
|
||||||
|
|
||||||
|
String whereCond = UtilityQuery.concatFieldsInWhereCond(params);
|
||||||
|
|
||||||
|
|
||||||
|
String query = "select distinct mtb_colt.*\n" +
|
||||||
|
"from mtb_colt\n" +
|
||||||
|
" left join mtb_colr on mtb_colt.gestione = mtb_colr.gestione and mtb_colt.data_collo = mtb_colr.data_collo and\n" +
|
||||||
|
" mtb_colt.ser_collo = mtb_colr.ser_collo and mtb_colt.num_collo = mtb_colr.num_collo\n" +
|
||||||
|
"where mtb_colt.gestione = 'V'" +
|
||||||
|
" AND " + whereCond;
|
||||||
|
|
||||||
|
|
||||||
|
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {
|
||||||
|
}.getType();
|
||||||
|
this.mSystemRESTConsumer.<ArrayList<MtbColt>>processSql(query, typeOfObjectsList, data -> {
|
||||||
|
onComplete.run(data.get(0));
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ 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.rest.model.SpostaArtsTraULRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.http.Body;
|
import retrofit2.http.Body;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
@@ -42,4 +43,7 @@ public interface ColliMagazzinoRESTConsumerService {
|
|||||||
@POST("wms/assegnaLottoSuColloScarico")
|
@POST("wms/assegnaLottoSuColloScarico")
|
||||||
Call<ServiceRESTResponse<MtbColt>> assegnaLottoSuColloScarico(@Body MtbColt mtbColt);
|
Call<ServiceRESTResponse<MtbColt>> assegnaLottoSuColloScarico(@Body MtbColt mtbColt);
|
||||||
|
|
||||||
|
@POST("wms/versamentoAutomaticoUL")
|
||||||
|
Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> versamentoAutomaticoUL(@Body MtbColt mtbColt);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.DtbDoct;
|
||||||
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.LoadColliDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
public class DocumentiRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
|
||||||
|
public void createDocsFromColli(List<LoadColliDTO> listColli, RunnableArgs<List<DtbDoct>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
DocumentiRESTConsumerService documentiRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
||||||
|
documentiRESTConsumerService.createDocsFromColli(listColli).enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<DtbDoct>>> call, Response<ServiceRESTResponse<List<DtbDoct>>> response) {
|
||||||
|
analyzeAnswer(response, "createDocsFromColli", onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<DtbDoct>>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void createDocFromColli(LoadColliDTO loadColliDTO, RunnableArgs<DtbDoct> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
DocumentiRESTConsumerService documentiRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
||||||
|
documentiRESTConsumerService.createDocFromColli(loadColliDTO).enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<DtbDoct>> call, Response<ServiceRESTResponse<DtbDoct>> response) {
|
||||||
|
analyzeAnswer(response, "createDocFromColli", onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<DtbDoct>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.DtbDoct;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.LoadColliDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.Body;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
|
public interface DocumentiRESTConsumerService {
|
||||||
|
|
||||||
|
@POST("getDatiColliForDocs")
|
||||||
|
Call<ServiceRESTResponse<List<DtbDoct>>> createDocsFromColli(@Body List<LoadColliDTO> listColli);
|
||||||
|
|
||||||
|
@POST("createDocFromColli")
|
||||||
|
Call<ServiceRESTResponse<DtbDoct>> createDocFromColli(@Body LoadColliDTO listColli);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,11 +6,11 @@ import java.util.List;
|
|||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.StbGestSetup;
|
import it.integry.integrywmsnative.core.model.StbGestSetup;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.model.GestSetupDTO;
|
import it.integry.integrywmsnative.core.rest.model.GestSetupDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
@@ -35,18 +35,18 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
|||||||
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
|
||||||
Log.e("GestSetup", t.toString());
|
Log.e("GestSetup", t.toString());
|
||||||
// UtilityLogger.errorMe(new Exception(t));
|
// UtilityLogger.errorMe(new Exception(t));
|
||||||
if(onFailed != null) onFailed.run(new Exception(t));
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void getBooleanValue(String gestName, String sectionName, String keySection, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void getBooleanValue(String gestName, String sectionName, String keySection, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
getValueStatic(gestName, sectionName, keySection, value -> {
|
getValueStatic(gestName, sectionName, keySection, value -> {
|
||||||
if(value != null){
|
if (value != null) {
|
||||||
onComplete.run("S".equalsIgnoreCase(value.value));
|
onComplete.run("S".equalsIgnoreCase(value.value));
|
||||||
} else onComplete.run(false);
|
} else onComplete.run(false);
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,26 +61,26 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
|||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
|
||||||
Log.e("PrintCollo", t.toString());
|
Log.e("PrintCollo", t.toString());
|
||||||
UtilityLogger.errorMe(new Exception(t));
|
UtilityLogger.error(new Exception(t));
|
||||||
if(onFailed != null) onFailed.run(new Exception(t));
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void getBooleanValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void getBooleanValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
getValueStatic(gestName, sectionName, keySection, codMdep, value -> {
|
getValueStatic(gestName, sectionName, keySection, codMdep, value -> {
|
||||||
if(value != null){
|
if (value != null) {
|
||||||
onComplete.run("S".equalsIgnoreCase(value.value));
|
onComplete.run("S".equalsIgnoreCase(value.value));
|
||||||
} else onComplete.run(false);
|
} else onComplete.run(false);
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void getValues(List<StbGestSetup> stbGestSetupList, RunnableArgs<List<StbGestSetup>> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void getValues(String codMdep, List<StbGestSetup> stbGestSetupList, RunnableArgs<List<StbGestSetup>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
|
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
|
||||||
service.getGestSetupValues(stbGestSetupList).enqueue(new Callback<ServiceRESTResponse<List<StbGestSetup>>>() {
|
service.getGestSetupValues(codMdep, stbGestSetupList).enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Response<ServiceRESTResponse<List<StbGestSetup>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Response<ServiceRESTResponse<List<StbGestSetup>>> response) {
|
||||||
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
|
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
|
||||||
@@ -88,8 +88,8 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Throwable t) {
|
||||||
UtilityLogger.errorMe(new Exception(t));
|
UtilityLogger.error(new Exception(t));
|
||||||
if(onFailed != null) onFailed.run(new Exception(t));
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public interface GestSetupRESTConsumerService {
|
|||||||
|
|
||||||
@POST("gestSetupList")
|
@POST("gestSetupList")
|
||||||
Call<ServiceRESTResponse<List<StbGestSetup>>> getGestSetupValues(
|
Call<ServiceRESTResponse<List<StbGestSetup>>> getGestSetupValues(
|
||||||
|
@Query("codMdep") String codMdep,
|
||||||
@Body List<StbGestSetup> stbGestSetupList);
|
@Body List<StbGestSetup> stbGestSetupList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import com.annimon.stream.Optional;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
|
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||||
|
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||||
|
|
||||||
|
public GiacenzaRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||||
|
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||||
|
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getGiacenzeInPosizione(MtbDepoPosizione posizione, RunnableArgs<List<MvwSitArtUdcDetInventario>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
HashMap<String, Object> params = new HashMap<>();
|
||||||
|
params.put("posizione", posizione.getPosizione());
|
||||||
|
String whereCond = UtilityQuery.concatFieldsInWhereCond(params);
|
||||||
|
String query = "SELECT * from mvw_sitart_udc_det_inventario" +
|
||||||
|
" WHERE " + whereCond;
|
||||||
|
|
||||||
|
|
||||||
|
Type typeOfObjectsList = new TypeToken<ArrayList<MvwSitArtUdcDetInventario>>() {
|
||||||
|
}.getType();
|
||||||
|
this.mSystemRESTConsumer.<ArrayList<MvwSitArtUdcDetInventario>>processSql(query, typeOfObjectsList, inventarioList -> {
|
||||||
|
List<String> codMarts = Stream.of(inventarioList)
|
||||||
|
.map(x -> x.getCodMart().trim())
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
mArticoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
|
||||||
|
for (var row : inventarioList) {
|
||||||
|
|
||||||
|
MtbAart foundMtbAart = null;
|
||||||
|
Optional<MtbAart> mtbAartOpt = Stream.of(mtbAarts)
|
||||||
|
.filter(x -> x.getCodMart().equalsIgnoreCase(row.getCodMart()))
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
if (mtbAartOpt.isPresent()) {
|
||||||
|
foundMtbAart = mtbAartOpt.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
row.setMtbAart(foundMtbAart);
|
||||||
|
}
|
||||||
|
|
||||||
|
onComplete.run(inventarioList);
|
||||||
|
}, onFailed);
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
public interface GiacenzaRESTConsumerService {
|
||||||
|
}
|
||||||
@@ -46,11 +46,11 @@ public class MesRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getOrdiniLavorazione(String flagEvaso, String codJfas, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getOrdiniLavorazione(String flagEvaso, String codJfas, String codAnag, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
||||||
|
|
||||||
mesRESTConsumerService.getOrdiniLavorazione(flagEvaso, codJfas)
|
mesRESTConsumerService.getOrdiniLavorazione(null, flagEvaso, codJfas, codAnag)
|
||||||
.enqueue(new Callback<ServiceRESTResponse<List<OrdineLavorazioneDTO>>>() {
|
.enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
||||||
analyzeAnswer(response, "getOrdiniLavorazione", (m) -> onComplete.run(response.body().getDto()), onFailed);
|
analyzeAnswer(response, "getOrdiniLavorazione", (m) -> onComplete.run(response.body().getDto()), onFailed);
|
||||||
@@ -63,6 +63,7 @@ public class MesRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void getOrdiniLavorazione(Date dateStart, String flagEvaso, String codJfas, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getOrdiniLavorazione(Date dateStart, String flagEvaso, String codJfas, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
||||||
|
|
||||||
@@ -82,7 +83,8 @@ public class MesRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
public void getLineeProduzione(String codJfasParent, RunnableArgs<List<JtbFasi>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getLineeProduzione(String codJfasParent, RunnableArgs<List<JtbFasi>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<JtbFasi>>() {}.getType();
|
Type typeOfObjectsList = new TypeToken<ArrayList<JtbFasi>>() {
|
||||||
|
}.getType();
|
||||||
this.mSystemRESTConsumer.processSql(
|
this.mSystemRESTConsumer.processSql(
|
||||||
"SELECT * FROM jtb_fasi WHERE cod_jfas_parent = " + UtilityDB.valueToString(codJfasParent),
|
"SELECT * FROM jtb_fasi WHERE cod_jfas_parent = " + UtilityDB.valueToString(codJfasParent),
|
||||||
typeOfObjectsList,
|
typeOfObjectsList,
|
||||||
|
|||||||
@@ -22,4 +22,7 @@ public interface MesRESTConsumerService {
|
|||||||
@GET("mes_v2/getOrdiniLavorazione")
|
@GET("mes_v2/getOrdiniLavorazione")
|
||||||
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazione(@Query("startDate") String startDate, @Query("flagEvaso") String flagEvaso, @Query("codJfas") String codJfas);
|
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazione(@Query("startDate") String startDate, @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, @Query("codAnag") String codAnag);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,8 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
&& (!UtilityString.isNullOrEmpty(x.getPartitaMag()) && x.getPartitaMag().equalsIgnoreCase(mtbColr.getPartitaMag())))
|
&& (!UtilityString.isNullOrEmpty(x.getPartitaMag()) && x.getPartitaMag().equalsIgnoreCase(mtbColr.getPartitaMag())))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
if (optionalMtbPartitaMag.isPresent()) mtbColr.setMtbPartitaMag(optionalMtbPartitaMag.get());
|
if (optionalMtbPartitaMag.isPresent())
|
||||||
|
mtbColr.setMtbPartitaMag(optionalMtbPartitaMag.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -108,7 +109,7 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<PickingObjectDTO>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<PickingObjectDTO>>> call, Throwable t) {
|
||||||
UtilityLogger.errorMe(new Exception(t));
|
UtilityLogger.error(new Exception(t));
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -125,7 +126,7 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class);
|
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class);
|
||||||
|
|
||||||
service.getOrdiniInevasi(codMdep, gestione.getText())
|
service.getOrdiniInevasi(codMdep, gestione.getText())
|
||||||
.enqueue(new Callback<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>>() {
|
.enqueue(new Callback<>() {
|
||||||
@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 -> {
|
||||||
@@ -145,7 +146,7 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void retrieveListaArticoliFromOrdiniUscita(List<OrdineUscitaInevasoDTO> orders, RunnableArgs<List<SitArtOrdDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void retrieveListaArticoliFromOrdiniUscita(String codMdep, List<OrdineUscitaInevasoDTO> orders, RunnableArgs<List<SitArtOrdDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
List<GetPickingListDTO> getPickingListDTOs = Stream.of(orders)
|
List<GetPickingListDTO> getPickingListDTOs = Stream.of(orders)
|
||||||
.map(x -> new GetPickingListDTO()
|
.map(x -> new GetPickingListDTO()
|
||||||
.setData(x.getDataOrdS())
|
.setData(x.getDataOrdS())
|
||||||
@@ -157,15 +158,23 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class, 90);
|
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class, 90);
|
||||||
|
|
||||||
service.getArticoliFromOrdini(getPickingListDTOs).enqueue(new Callback<ServiceRESTResponse<List<SitArtOrdDTO>>>() {
|
service.getArticoliFromOrdini(codMdep, getPickingListDTOs).enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Response<ServiceRESTResponse<List<SitArtOrdDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Response<ServiceRESTResponse<List<SitArtOrdDTO>>> response) {
|
||||||
analyzeAnswer(response, "retrieveListaArticoliFromOrdiniUscita", onComplete, onFailed);
|
analyzeAnswer(response, "retrieveListaArticoliFromOrdiniUscita", sitArtOrds -> {
|
||||||
|
if (sitArtOrds != null) {
|
||||||
|
for (SitArtOrdDTO sitArtOrd : sitArtOrds) {
|
||||||
|
sitArtOrd.setCodMart(sitArtOrd.getCodMart().trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onComplete.run(sitArtOrds);
|
||||||
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Throwable t) {
|
||||||
UtilityLogger.errorMe(new Exception(t));
|
UtilityLogger.error(new Exception(t));
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -182,13 +191,13 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String baseSql = "SELECT DISTINCT mtb_colt.* " +
|
String baseSql = "SELECT DISTINCT mtb_colt.* " +
|
||||||
"FROM mtb_colt, " +
|
"FROM mtb_colt " +
|
||||||
" mtb_colr " +
|
" INNER JOIN mtb_colr ON " +
|
||||||
"WHERE mtb_colt.gestione = mtb_colr.gestione " +
|
" mtb_colt.gestione = mtb_colr.gestione " +
|
||||||
" AND mtb_colt.ser_collo = mtb_colr.ser_collo " +
|
" AND mtb_colt.ser_collo = mtb_colr.ser_collo " +
|
||||||
" AND mtb_colt.data_collo = mtb_colr.data_collo " +
|
" AND mtb_colt.data_collo = mtb_colr.data_collo " +
|
||||||
" AND mtb_colt.num_collo = mtb_colr.num_collo " +
|
" AND mtb_colt.num_collo = mtb_colr.num_collo " +
|
||||||
" AND " + whereCondGestione +
|
" WHERE " + whereCondGestione +
|
||||||
" AND mtb_colt.segno = " + UtilityDB.valueToString(segno) + " " +
|
" AND mtb_colt.segno = " + UtilityDB.valueToString(segno) + " " +
|
||||||
" AND mtb_colt.data_doc IS NULL AND ";
|
" AND mtb_colt.data_doc IS NULL AND ";
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user