Compare commits
271 Commits
v1.13.10(1
...
v1.16.33(2
| Author | SHA1 | Date | |
|---|---|---|---|
| e0c07ea06e | |||
| 3e79b52e23 | |||
| 7d7712e57a | |||
| 6d7a047e8e | |||
| 72e4f2a0b9 | |||
| ef6cdc6a86 | |||
| 23b86e68cc | |||
| 2e46f9f665 | |||
| 88b1c56360 | |||
| 1d71ac10bd | |||
| 8eb677ecdf | |||
| 74efbac452 | |||
| 9c6375083f | |||
| b24d5271a4 | |||
| b5626e5b08 | |||
| fd2e1fa4f4 | |||
| a3f5072646 | |||
| 1258e8c3e6 | |||
| ccef0fe528 | |||
| 9bb5d1adce | |||
| ac446d953c | |||
| 407ff0b264 | |||
| 10e748b9d4 | |||
| e30273fe42 | |||
| 44564245a7 | |||
| 920f306907 | |||
| 90aa52ab55 | |||
| 93f3eb65f0 | |||
| eb94944928 | |||
| 28698ba306 | |||
| c713bbebbc | |||
| 38e2a02766 | |||
| dd8bf264a4 | |||
| 9488c1994d | |||
| 16099cdaf6 | |||
| f061f2bfc9 | |||
| f7253fd44c | |||
| e12d371567 | |||
| 5596f71c03 | |||
| 8669b812f5 | |||
| 3243484dd0 | |||
| 37114dc4d1 | |||
| d5af79abba | |||
| b50aa7a9d2 | |||
| cc333c3147 | |||
| fc5044134c | |||
| 93a3e39332 | |||
| 3eaf187136 | |||
| 36f9fa1e36 | |||
| 0f89913609 | |||
| 4cda247ddc | |||
| e88ea0a45c | |||
| 726cf80dc0 | |||
| a779d8b94d | |||
| f41e1f3a02 | |||
| aa75a77913 | |||
| 639be21ab5 | |||
| dfc241e7f6 | |||
| 7948c7fa97 | |||
| 2ae311c28a | |||
| 56ba43183c | |||
| b93b309ea8 | |||
| f5a2d012e5 | |||
| bf07e3d0f0 | |||
| 91f075976d | |||
| ee70faefa9 | |||
| 13cca99b09 | |||
| e55b6f4934 | |||
| 62d4b6f724 | |||
| 19b0465569 | |||
| d4f44c1ab7 | |||
| 6bf183d73c | |||
| a939f0ba08 | |||
| 08b44cb45b | |||
| fef57622cf | |||
| cbf36ec962 | |||
| adc7343352 | |||
| 94b2959d29 | |||
| 11903d1a34 | |||
| ff448b36b9 | |||
| aa8a54547c | |||
| e1d1878131 | |||
| 81bc85f854 | |||
| 00c90021b5 | |||
| 89e046cc78 | |||
| 2b2cf3656c | |||
| 47a2c36e04 | |||
| bca0d0cc52 | |||
| 594a6fc9d2 | |||
| e633dcbc4d | |||
| 99de98db28 | |||
| cce8ea5ca0 | |||
| 2cb693cafc | |||
| cc54dfb452 | |||
| 68d97a167d | |||
| adde82c191 | |||
| 5b1f681a11 | |||
| 8035cf15a8 | |||
| d277bf3e8e | |||
| 5d4130f131 | |||
| d51c62143c | |||
| 26a887c5aa | |||
| 838b3b8bb8 | |||
| 0a0de9d938 | |||
| eea134ce82 | |||
| 1020a31b89 | |||
| 0133a9232f | |||
| 3ff98fcda1 | |||
| 58b4ebb420 | |||
| fc0cb423e3 | |||
| 451f45b1a1 | |||
| b672ca1d37 | |||
| c4c4013995 | |||
| e9230aba11 | |||
| d044c2ab26 | |||
| 843679620b | |||
| 7346357b8e | |||
| b29a64a75a | |||
| 163a8cb27a | |||
| 8311f56154 | |||
| 0a76cc856c | |||
| 0ed536b0d5 | |||
| c8f8ccd64f | |||
| ecd0678aab | |||
| 3d7fb9e14f | |||
| 489687d392 | |||
| 5aa360af7c | |||
| e43ba3341f | |||
| db21ce554a | |||
| 86c9f3464c | |||
| 6376668d15 | |||
| 669bc1a8f5 | |||
| d78d99094f | |||
| c2c23c37a4 | |||
| b30bdb3df1 | |||
| 8e7ad53ec9 | |||
| e36441db73 | |||
| 97c63fb01d | |||
| cddc7681b0 | |||
| 3663b2bf4e | |||
| 91f4658fe3 | |||
| 8fba80c764 | |||
| 6dbc0c5894 | |||
| 14035b4c92 | |||
| 278f13ca6d | |||
| 52eb9ee0b7 | |||
| e89c786233 | |||
| 96439282cf | |||
| 13577f3c43 | |||
| f6dcbace57 | |||
| 2d0115723c | |||
| 5f90810a0f | |||
| b4fd56d8e2 | |||
| ed2a36d66a | |||
| 702ce4b79e | |||
| 99aac144f5 | |||
| 766ae1ae01 | |||
| d16cec069c | |||
| 0729b8ce87 | |||
| 92a2cdaec6 | |||
| 497bc54ebd | |||
| b00cd1f097 | |||
| cfc3649807 | |||
| 5ddd2e6235 | |||
| 2174a19c0f | |||
| 44cdbf929f | |||
| 65c0e520c5 | |||
| 062abb4ea3 | |||
| 1d759cdcbf | |||
| 15e1793962 | |||
| 55fee02f36 | |||
| 575ac2577f | |||
| 3fc5cd3660 | |||
| d77fbff509 | |||
| 58865ca34b | |||
| 23aa7f5261 | |||
| 65532a3185 | |||
| 1440c52322 | |||
| 4e36053ba6 | |||
| c7777b261d | |||
| 7b0a86bb81 | |||
| ebf2bd578e | |||
| f90e2acc3e | |||
| 035f058bc3 | |||
| 73e57e9430 | |||
| 13cc9f6053 | |||
| d9844315a3 | |||
| ade37f07d6 | |||
| f02e9921cb | |||
| e8ce7a9eeb | |||
| 61b0049a87 | |||
| 5c4d72dae2 | |||
| 39f52bf3dd | |||
| e50aa1f014 | |||
| b1d06605cd | |||
| ed55eb4279 | |||
| 9ac96ac8fd | |||
| 5be3fd9c25 | |||
| bab558252a | |||
| c256b39119 | |||
| af76627c50 | |||
| f9544566e9 | |||
| 4f02c3a4bc | |||
| ea8d8835cd | |||
| 61e07e8f76 | |||
| 962e1f7fa4 | |||
| 07d889bcd5 | |||
| 170db3eb0a | |||
| 856a807e3e | |||
| c56aa812ff | |||
| 770f014a70 | |||
| f6ff7aa80d | |||
| 4cd3e7e102 | |||
| 69bf5e319e | |||
| 88fe4d82cd | |||
| c8cd794cfc | |||
| 5dcc567eab | |||
| 89eafaf6ca | |||
| 6fc7f80ed4 | |||
| 2464d44222 | |||
| 96d544f2ad | |||
| e85ddc6580 | |||
| 89f6b9ce71 | |||
| c7d0ed1747 | |||
| b84b3c28f3 | |||
| 3a3bf4c2dd | |||
| 4809a96e5b | |||
| 5f206feb12 | |||
| 575762da2f | |||
| a96078c9e6 | |||
| b1941d5c34 | |||
| 4dc688af14 | |||
| 6675757317 | |||
| 1310b34a8d | |||
| 4e8fe26c6b | |||
| 32ff7bfa39 | |||
| c8cfa486e1 | |||
| 0356c912e6 | |||
| 7f448bbbb3 | |||
| f940b6f239 | |||
| a3de73dc66 | |||
| 9fa1aa156e | |||
| 03e1a186b8 | |||
| 598372675f | |||
| ffccd2f3d3 | |||
| 4252e13323 | |||
| 7c55cce6ae | |||
| 45caece076 | |||
| 79dc75fc89 | |||
| f9483e14be | |||
| d3396cdb63 | |||
| 3c0d084c28 | |||
| ba220461db | |||
| 0d9d0ff8b0 | |||
| 74d0369cb5 | |||
| 6fbdce86c7 | |||
| 4bfd68b614 | |||
| b57c452648 | |||
| 0fd4dc668a | |||
| 726afed296 | |||
| 5b04e99c33 | |||
| 5632c6f7ab | |||
| 20a076e705 | |||
| fb85af8bbf | |||
| 6a7f3ee2ed | |||
| de4a87658e | |||
| e87f248a12 | |||
| 4f366a4f38 | |||
| 41b1a0571e | |||
| 641fb3964d | |||
| 6a39512e7b |
23
.idea/codeStyles/Project.xml
generated
23
.idea/codeStyles/Project.xml
generated
@@ -1,24 +1,12 @@
|
|||||||
<component name="ProjectCodeStyleConfiguration">
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
<code_scheme name="Project" version="173">
|
<code_scheme name="Project" version="173">
|
||||||
<JetCodeStyleSettings>
|
<JetCodeStyleSettings>
|
||||||
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
|
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||||
<value>
|
|
||||||
<package name="java.util" alias="false" withSubpackages="false" />
|
|
||||||
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
|
|
||||||
<package name="io.ktor" alias="false" withSubpackages="true" />
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
<option name="PACKAGES_IMPORT_LAYOUT">
|
|
||||||
<value>
|
|
||||||
<package name="" alias="false" withSubpackages="true" />
|
|
||||||
<package name="java" alias="false" withSubpackages="true" />
|
|
||||||
<package name="javax" alias="false" withSubpackages="true" />
|
|
||||||
<package name="kotlin" alias="false" withSubpackages="true" />
|
|
||||||
<package name="" alias="true" withSubpackages="true" />
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
</JetCodeStyleSettings>
|
</JetCodeStyleSettings>
|
||||||
<codeStyleSettings language="XML">
|
<codeStyleSettings language="XML">
|
||||||
|
<indentOptions>
|
||||||
|
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||||
|
</indentOptions>
|
||||||
<arrangement>
|
<arrangement>
|
||||||
<rules>
|
<rules>
|
||||||
<section>
|
<section>
|
||||||
@@ -127,5 +115,8 @@
|
|||||||
</rules>
|
</rules>
|
||||||
</arrangement>
|
</arrangement>
|
||||||
</codeStyleSettings>
|
</codeStyleSettings>
|
||||||
|
<codeStyleSettings language="kotlin">
|
||||||
|
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||||
|
</codeStyleSettings>
|
||||||
</code_scheme>
|
</code_scheme>
|
||||||
</component>
|
</component>
|
||||||
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||||
|
</state>
|
||||||
|
</component>
|
||||||
1
.idea/runConfigurations.xml
generated
1
.idea/runConfigurations.xml
generated
@@ -3,6 +3,7 @@
|
|||||||
<component name="RunConfigurationProducerService">
|
<component name="RunConfigurationProducerService">
|
||||||
<option name="ignoredProducers">
|
<option name="ignoredProducers">
|
||||||
<set>
|
<set>
|
||||||
|
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||||
|
|||||||
@@ -2,13 +2,12 @@ apply plugin: 'com.android.application'
|
|||||||
apply plugin: 'com.google.firebase.firebase-perf'
|
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: 'kotlin-android-extensions'
|
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 156
|
def appVersionCode = 215
|
||||||
def appVersionName = '1.13.10'
|
def appVersionName = '1.16.33'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
@@ -21,7 +20,7 @@ android {
|
|||||||
|
|
||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
variant.outputs.all { output ->
|
variant.outputs.all { output ->
|
||||||
output.outputFileName = "android-release_v2.apk"
|
output.outputFileName = "android-release.apk"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,8 +59,8 @@ android {
|
|||||||
|
|
||||||
build {
|
build {
|
||||||
doLast {
|
doLast {
|
||||||
delete "$projectDir/build/outputs/apk/release/version_v2.txt"
|
delete "$projectDir/build/outputs/apk/release/version.txt"
|
||||||
file("$projectDir/build/outputs/apk/release/version_v2.txt").text = appVersionCode + '\n' + appVersionName
|
file("$projectDir/build/outputs/apk/release/version.txt").text = appVersionCode + '\n' + appVersionName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,34 +90,33 @@ dependencies {
|
|||||||
//Firebase
|
//Firebase
|
||||||
|
|
||||||
// Import the Firebase BoM
|
// Import the Firebase BoM
|
||||||
implementation platform('com.google.firebase:firebase-bom:25.12.0')
|
implementation platform('com.google.firebase:firebase-bom:26.3.0')
|
||||||
|
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-crash'
|
||||||
implementation 'com.google.firebase:firebase-perf'
|
|
||||||
implementation 'com.google.firebase:firebase-crashlytics'
|
implementation 'com.google.firebase:firebase-crashlytics'
|
||||||
implementation 'com.google.firebase:firebase-analytics'
|
implementation 'com.google.firebase:firebase-perf'
|
||||||
|
implementation 'com.google.android.gms:play-services-basement:17.6.0'
|
||||||
|
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'com.google.android.material:material:1.3.0-alpha03'
|
implementation 'com.google.android.material:material:1.3.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
||||||
implementation 'androidx.preference:preference:1.1.1'
|
implementation 'androidx.preference:preference-ktx:1.1.1'
|
||||||
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
|
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
implementation 'com.annimon:stream:1.2.1'
|
implementation 'com.annimon:stream:1.2.1'
|
||||||
implementation 'androidx.lifecycle:lifecycle-runtime:2.2.0'
|
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0'
|
||||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||||
implementation 'androidx.lifecycle:lifecycle-common-java8:2.2.0'
|
implementation 'androidx.lifecycle:lifecycle-common-java8:2.3.0'
|
||||||
implementation 'org.apache.commons:commons-text:1.9'
|
implementation 'org.apache.commons:commons-text:1.9'
|
||||||
|
|
||||||
//MVVM
|
//MVVM
|
||||||
def dagger2_version = '2.29.1'
|
def dagger2_version = '2.29.1'
|
||||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
|
||||||
implementation "androidx.lifecycle:lifecycle-common-java8:2.2.0"
|
|
||||||
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"
|
||||||
@@ -138,7 +136,7 @@ dependencies {
|
|||||||
implementation 'com.github.pedromassango:doubleClick:3.0'
|
implementation 'com.github.pedromassango:doubleClick:3.0'
|
||||||
|
|
||||||
//SQLite ROOM
|
//SQLite ROOM
|
||||||
def room_version = "2.2.5"
|
def room_version = "2.2.6"
|
||||||
|
|
||||||
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"
|
||||||
|
|||||||
@@ -14,14 +14,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"oauth_client": [
|
"oauth_client": [
|
||||||
{
|
|
||||||
"client_id": "963231271247-b50hgcd89u9ksfc7189mri044kq8aq1p.apps.googleusercontent.com",
|
|
||||||
"client_type": 1,
|
|
||||||
"android_info": {
|
|
||||||
"package_name": "it.integry.integrywmsnative",
|
|
||||||
"certificate_hash": "864b69dcc40196befa65638a868cec1c61245fa6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"client_id": "963231271247-59qdc1vobbnjfp135ce4hv12c53s9hse.apps.googleusercontent.com",
|
"client_id": "963231271247-59qdc1vobbnjfp135ce4hv12c53s9hse.apps.googleusercontent.com",
|
||||||
"client_type": 1,
|
"client_type": 1,
|
||||||
@@ -30,6 +22,14 @@
|
|||||||
"certificate_hash": "3b6d97a981f446f5011049d781aeb9960f9352af"
|
"certificate_hash": "3b6d97a981f446f5011049d781aeb9960f9352af"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"client_id": "963231271247-b50hgcd89u9ksfc7189mri044kq8aq1p.apps.googleusercontent.com",
|
||||||
|
"client_type": 1,
|
||||||
|
"android_info": {
|
||||||
|
"package_name": "it.integry.integrywmsnative",
|
||||||
|
"certificate_hash": "864b69dcc40196befa65638a868cec1c61245fa6"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"client_id": "963231271247-6jof105pci1g0g7m2e7kjbtrtk2443g4.apps.googleusercontent.com",
|
"client_id": "963231271247-6jof105pci1g0g7m2e7kjbtrtk2443g4.apps.googleusercontent.com",
|
||||||
"client_type": 3
|
"client_type": 3
|
||||||
@@ -41,20 +41,13 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"services": {
|
"services": {
|
||||||
"analytics_service": {
|
|
||||||
"status": 1
|
|
||||||
},
|
|
||||||
"appinvite_service": {
|
"appinvite_service": {
|
||||||
"status": 2,
|
|
||||||
"other_platform_oauth_client": [
|
"other_platform_oauth_client": [
|
||||||
{
|
{
|
||||||
"client_id": "963231271247-6jof105pci1g0g7m2e7kjbtrtk2443g4.apps.googleusercontent.com",
|
"client_id": "963231271247-6jof105pci1g0g7m2e7kjbtrtk2443g4.apps.googleusercontent.com",
|
||||||
"client_type": 3
|
"client_type": 3
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"ads_service": {
|
|
||||||
"status": 2
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,8 @@
|
|||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
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">
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.spedizione.SpedizioneActivity"
|
android:name=".gest.spedizione.SpedizioneActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
@@ -26,7 +27,6 @@
|
|||||||
<activity android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity" />
|
<activity android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.picking_resi.PickingResiActivity"
|
android:name=".gest.picking_resi.PickingResiActivity"
|
||||||
android:label="@string/activity_ultime_consegne_title"
|
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/Light" />
|
android:theme="@style/Light" />
|
||||||
<activity
|
<activity
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
|||||||
import it.integry.integrywmsnative.core.class_router.configs.BaseMenuConfiguration;
|
import it.integry.integrywmsnative.core.class_router.configs.BaseMenuConfiguration;
|
||||||
import it.integry.integrywmsnative.core.class_router.configs.MenuConfiguration;
|
import it.integry.integrywmsnative.core.class_router.configs.MenuConfiguration;
|
||||||
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
||||||
|
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||||
import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;
|
import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;
|
||||||
@@ -42,6 +43,7 @@ import it.integry.integrywmsnative.core.interfaces.ISelectAllFragment;
|
|||||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||||
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
||||||
import it.integry.integrywmsnative.core.update.UpdatesManager;
|
import it.integry.integrywmsnative.core.update.UpdatesManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityContext;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilitySettings;
|
import it.integry.integrywmsnative.core.utility.UtilitySettings;
|
||||||
import it.integry.integrywmsnative.databinding.ActivityMainBinding;
|
import it.integry.integrywmsnative.databinding.ActivityMainBinding;
|
||||||
import it.integry.integrywmsnative.gest.login.LoginActivity;
|
import it.integry.integrywmsnative.gest.login.LoginActivity;
|
||||||
@@ -59,6 +61,9 @@ public class MainActivity extends BaseActivity
|
|||||||
@Inject
|
@Inject
|
||||||
AppDatabase mAppDatabase;
|
AppDatabase mAppDatabase;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
ColliDataRecoverService mColliDataRecoverService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -68,10 +73,13 @@ public class MainActivity extends BaseActivity
|
|||||||
.create()
|
.create()
|
||||||
.inject(this);
|
.inject(this);
|
||||||
|
|
||||||
|
mColliDataRecoverService.init(this);
|
||||||
|
|
||||||
mBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.activity_main, null, false);
|
mBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.activity_main, null, false);
|
||||||
setContentView(mBinding.getRoot());
|
setContentView(mBinding.getRoot());
|
||||||
|
|
||||||
UpdatesManager.init(this);
|
UpdatesManager.init(this);
|
||||||
|
UtilityContext.initMainActivity(this);
|
||||||
|
|
||||||
setSupportActionBar(mBinding.appBarMain.toolbar);
|
setSupportActionBar(mBinding.appBarMain.toolbar);
|
||||||
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||||
@@ -175,8 +183,8 @@ public class MainActivity extends BaseActivity
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.nav_logout:
|
case R.id.nav_logout:
|
||||||
UtilitySettings.logout(this.mAppDatabase);
|
|
||||||
ServerStatusChecker.dispose();
|
ServerStatusChecker.dispose();
|
||||||
|
UtilitySettings.logout();
|
||||||
|
|
||||||
startLoginActivity();
|
startLoginActivity();
|
||||||
break;
|
break;
|
||||||
@@ -277,6 +285,11 @@ public class MainActivity extends BaseActivity
|
|||||||
mBinding.appBarMain.toolbarTitleLeft.setVisibility(View.VISIBLE);
|
mBinding.appBarMain.toolbarTitleLeft.setVisibility(View.VISIBLE);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
((ISearcableFragment) fragment).addOnPreDestroy(() -> {
|
||||||
|
mBinding.appBarMain.mainSearch.setIconified(true);
|
||||||
|
mBinding.appBarMain.mainSearch.setVisibility(View.GONE);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
mBinding.appBarMain.mainSearch.setOnQueryTextListener(null);
|
mBinding.appBarMain.mainSearch.setOnQueryTextListener(null);
|
||||||
mBinding.appBarMain.mainSearch.setVisibility(View.GONE);
|
mBinding.appBarMain.mainSearch.setVisibility(View.GONE);
|
||||||
@@ -289,6 +302,10 @@ public class MainActivity extends BaseActivity
|
|||||||
mBinding.appBarMain.toolbarTitleCenteredLayout.setVisibility(View.GONE);
|
mBinding.appBarMain.toolbarTitleCenteredLayout.setVisibility(View.GONE);
|
||||||
mBinding.appBarMain.toolbarTitleLeft.setVisibility(View.VISIBLE);
|
mBinding.appBarMain.toolbarTitleLeft.setVisibility(View.VISIBLE);
|
||||||
((ITitledFragment) fragment).onCreateActionBar(mBinding.appBarMain.toolbarTitleLeft, this);
|
((ITitledFragment) fragment).onCreateActionBar(mBinding.appBarMain.toolbarTitleLeft, this);
|
||||||
|
((ITitledFragment) fragment).addOnPreDestroy(() -> {
|
||||||
|
mBinding.appBarMain.toolbarTitleCenteredLayout.setVisibility(View.VISIBLE);
|
||||||
|
mBinding.appBarMain.toolbarTitleLeft.setVisibility(View.GONE);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
mBinding.appBarMain.toolbarTitleCenteredLayout.setVisibility(View.VISIBLE);
|
mBinding.appBarMain.toolbarTitleCenteredLayout.setVisibility(View.VISIBLE);
|
||||||
mBinding.appBarMain.toolbarTitleLeft.setVisibility(View.GONE);
|
mBinding.appBarMain.toolbarTitleLeft.setVisibility(View.GONE);
|
||||||
@@ -296,12 +313,12 @@ public class MainActivity extends BaseActivity
|
|||||||
|
|
||||||
if(fragment instanceof IScrollableFragment) {
|
if(fragment instanceof IScrollableFragment) {
|
||||||
((IScrollableFragment) fragment).setScrollToolbar(mBinding.appBarMain.elevatedToolbar);
|
((IScrollableFragment) fragment).setScrollToolbar(mBinding.appBarMain.elevatedToolbar);
|
||||||
((IScrollableFragment) fragment).setOnPreDestroy(() -> {
|
((IScrollableFragment) fragment).addOnPreDestroy(() -> {
|
||||||
mBinding.appBarMain.elevatedToolbar.resetAll();
|
mBinding.appBarMain.elevatedToolbar.resetAll();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fragment instanceof ISelectAllFragment && ((ISelectAllFragment)fragment).isEnabled()) {
|
if(fragment instanceof ISelectAllFragment && ((ISelectAllFragment)fragment).isSelectAllButtonEnabled()) {
|
||||||
mBinding.appBarMain.mainSelectAll.setVisibility(View.VISIBLE);
|
mBinding.appBarMain.mainSelectAll.setVisibility(View.VISIBLE);
|
||||||
mBinding.appBarMain.mainSelectAll.setOnClickListener(new OnSingleClickListener() {
|
mBinding.appBarMain.mainSelectAll.setOnClickListener(new OnSingleClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -309,9 +326,10 @@ public class MainActivity extends BaseActivity
|
|||||||
((ISelectAllFragment)fragment).onSelectAll();
|
((ISelectAllFragment)fragment).onSelectAll();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
((ISelectAllFragment) fragment).addOnPreDestroy(() -> {
|
||||||
mBinding.appBarMain.mainSelectAll.setVisibility(View.GONE);
|
mBinding.appBarMain.mainSelectAll.setVisibility(View.GONE);
|
||||||
mBinding.appBarMain.mainSelectAll.setOnClickListener(null);
|
mBinding.appBarMain.mainSelectAll.setOnClickListener(null);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fragment instanceof IFilterableFragment) {
|
if(fragment instanceof IFilterableFragment) {
|
||||||
@@ -322,6 +340,11 @@ public class MainActivity extends BaseActivity
|
|||||||
((IFilterableFragment)fragment).onFilterClick();
|
((IFilterableFragment)fragment).onFilterClick();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
((IFilterableFragment)fragment).addOnPreDestroy(() -> {
|
||||||
|
mBinding.appBarMain.mainFilter.setVisibility(View.GONE);
|
||||||
|
mBinding.appBarMain.mainFilter.setOnClickListener(null);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
mBinding.appBarMain.mainFilter.setVisibility(View.GONE);
|
mBinding.appBarMain.mainFilter.setVisibility(View.GONE);
|
||||||
mBinding.appBarMain.mainFilter.setOnClickListener(null);
|
mBinding.appBarMain.mainFilter.setOnClickListener(null);
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ public class MainApplication extends Application {
|
|||||||
.roomModule(roomModule)
|
.roomModule(roomModule)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
appComponent.inject(appContext);
|
||||||
|
|
||||||
appContext.init();
|
appContext.init();
|
||||||
res = getResources();
|
res = getResources();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,20 @@ package it.integry.integrywmsnative;
|
|||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import dagger.Component;
|
import dagger.Component;
|
||||||
|
import it.integry.integrywmsnative.core.context.AppContext;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingComponent;
|
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingComponent;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingModule;
|
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingModule;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoModule;
|
||||||
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoComponent;
|
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoComponent;
|
||||||
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoModule;
|
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoModule;
|
||||||
|
import it.integry.integrywmsnative.gest.picking_resi.PickingResiComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.picking_resi.PickingResiModule;
|
||||||
|
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.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaModule;
|
||||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditComponent;
|
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditComponent;
|
||||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditModule;
|
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditModule;
|
||||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdineAcquistoGrigliaComponent;
|
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdineAcquistoGrigliaComponent;
|
||||||
@@ -16,6 +25,20 @@ import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeComp
|
|||||||
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.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.ultime_consegne_cliente.UltimeConsegneClienteComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneClienteModule;
|
||||||
|
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreModule;
|
||||||
|
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceModule;
|
||||||
|
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.scan_art.DialogScanArtComponent;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtModule;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUComponent;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUModule;
|
||||||
|
|
||||||
// Definition of the Application graph
|
// Definition of the Application graph
|
||||||
@Singleton
|
@Singleton
|
||||||
@@ -28,7 +51,18 @@ import it.integry.integrywmsnative.gest.spedizione.SpedizioneModule;
|
|||||||
PickingLiberoModule.class,
|
PickingLiberoModule.class,
|
||||||
RettificaGiacenzeModule.class,
|
RettificaGiacenzeModule.class,
|
||||||
SpedizioneModule.class,
|
SpedizioneModule.class,
|
||||||
AccettazionePickingModule.class})
|
AccettazionePickingModule.class,
|
||||||
|
UltimeConsegneClienteModule.class,
|
||||||
|
UltimiArriviFornitoreModule.class,
|
||||||
|
PickingResiModule.class,
|
||||||
|
OrdiniUscitaElencoModule.class,
|
||||||
|
DialogInputQuantityV2Module.class,
|
||||||
|
DialogScanArtModule.class,
|
||||||
|
DialogScanOrCreateLUModule.class,
|
||||||
|
ProdFabbisognoLineeProdModule.class,
|
||||||
|
VersamentoMerceModule.class,
|
||||||
|
DialogAskMagazzinoProssimitaModule.class,
|
||||||
|
DialogRowInfoProdFabbisognoLineeProdModule.class})
|
||||||
public interface MainApplicationComponent {
|
public interface MainApplicationComponent {
|
||||||
|
|
||||||
MainActivityComponent.Factory mainActivityComponent();
|
MainActivityComponent.Factory mainActivityComponent();
|
||||||
@@ -38,5 +72,19 @@ public interface MainApplicationComponent {
|
|||||||
RettificaGiacenzeComponent.Factory rettificaGiacenzeComponent();
|
RettificaGiacenzeComponent.Factory rettificaGiacenzeComponent();
|
||||||
SpedizioneComponent.Factory spedizioneComponent();
|
SpedizioneComponent.Factory spedizioneComponent();
|
||||||
AccettazionePickingComponent.Factory accettazionePickingComponent();
|
AccettazionePickingComponent.Factory accettazionePickingComponent();
|
||||||
|
UltimeConsegneClienteComponent.Factory ultimeConsegneClienteComponent();
|
||||||
|
UltimiArriviFornitoreComponent.Factory ultimiArriviFornitoreComponent();
|
||||||
|
PickingResiComponent.Factory pickingResiComponent();
|
||||||
|
OrdiniUscitaElencoComponent.Factory prodOrdineLavorazioneElencoComponent();
|
||||||
|
DialogInputQuantityV2Component.Factory dialogInputQuantityV2Component();
|
||||||
|
DialogScanArtComponent.Factory dialogScanArtComponent();
|
||||||
|
DialogScanOrCreateLUComponent.Factory dialogScanOrCreateLUComponent();
|
||||||
|
ProdFabbisognoLineeProdComponent.Factory prodFabbisognoLineeProdComponent();
|
||||||
|
VersamentoMerceComponent.Factory versamentoMerceComponent();
|
||||||
|
DialogAskMagazzinoProssimitaComponent.Factory dialogAskMagazzinoProssimitaComponent();
|
||||||
|
DialogRowInfoProdFabbisognoLineeProdComponent.Factory dialogRowInfoProdFabbisognoLineeProdComponent();
|
||||||
|
|
||||||
|
|
||||||
|
void inject(AppContext appContext);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,10 @@ 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.GestSetupRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||||
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.PrinterRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
public class MainApplicationModule {
|
public class MainApplicationModule {
|
||||||
@@ -36,13 +38,13 @@ public class MainApplicationModule {
|
|||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
ColliDataRecoverService provideColliDataRecoverService() {
|
ColliDataRecoverService provideColliDataRecoverService() {
|
||||||
return new ColliDataRecoverService(mContext);
|
return new ColliDataRecoverService();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
OrdiniRESTConsumer provideOrdiniRESTConsumer() {
|
OrdiniRESTConsumer provideOrdiniRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||||
return new OrdiniRESTConsumer();
|
return new OrdiniRESTConsumer(systemRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@@ -59,8 +61,8 @@ public class MainApplicationModule {
|
|||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
ColliMagazzinoRESTConsumer provideColliMagazzinoRESTConsumer() {
|
ColliMagazzinoRESTConsumer provideColliMagazzinoRESTConsumer(ArticoloRESTConsumer articoloRESTConsumer) {
|
||||||
return new ColliMagazzinoRESTConsumer();
|
return new ColliMagazzinoRESTConsumer(articoloRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@@ -81,5 +83,18 @@ public class MainApplicationModule {
|
|||||||
return new SystemRESTConsumer();
|
return new SystemRESTConsumer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
PosizioniRESTConsumer providesPosizioniRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||||
|
return new PosizioniRESTConsumer(systemRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
ProdFabbisognoLineeProdRESTConsumer providesProdFabbisognoLineeProdRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||||
|
return new ProdFabbisognoLineeProdRESTConsumer(systemRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,22 +6,21 @@ import android.content.pm.PackageManager;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.widget.TextView;
|
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.context.MainContext;
|
import it.integry.integrywmsnative.core.context.MainContext;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgsss;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgsss;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.PermissionsHelper;
|
import it.integry.integrywmsnative.core.utility.PermissionsHelper;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityContext;
|
||||||
import it.integry.integrywmsnative.databinding.ActivitySplashBinding;
|
import it.integry.integrywmsnative.databinding.ActivitySplashBinding;
|
||||||
import it.integry.integrywmsnative.gest.login.LoginActivity;
|
import it.integry.integrywmsnative.gest.login.LoginActivity;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
public class SplashActivity extends BaseActivity {
|
public class SplashActivity extends BaseActivity {
|
||||||
|
|
||||||
@@ -39,6 +38,8 @@ public class SplashActivity extends BaseActivity {
|
|||||||
mBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.activity_splash, null, false);
|
mBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.activity_splash, null, false);
|
||||||
setContentView(mBinding.getRoot());
|
setContentView(mBinding.getRoot());
|
||||||
|
|
||||||
|
UtilityContext.initMainActivity(this);
|
||||||
|
|
||||||
initAppVersion();
|
initAppVersion();
|
||||||
|
|
||||||
initPermissions(this::init);
|
initPermissions(this::init);
|
||||||
@@ -49,10 +50,10 @@ public class SplashActivity extends BaseActivity {
|
|||||||
onComplete.run();
|
onComplete.run();
|
||||||
}, permanentlyDenied -> {
|
}, permanentlyDenied -> {
|
||||||
if(permanentlyDenied) {
|
if(permanentlyDenied) {
|
||||||
DialogSimpleMessageHelper.makeErrorDialog(this,
|
DialogSimpleMessageView.makeErrorDialog(new SpannableString(getText(R.string.permissions_permanently_denied)), null, () -> {
|
||||||
new SpannableString(getText(R.string.permissions_permanently_denied)), null, () -> {
|
|
||||||
this.finish();
|
this.finish();
|
||||||
}).show();
|
})
|
||||||
|
.show(getSupportFragmentManager(), "tag");
|
||||||
} else {
|
} else {
|
||||||
initPermissions(onComplete);
|
initPermissions(onComplete);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,15 +3,15 @@ package it.integry.integrywmsnative.core.class_router.configs;
|
|||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneFragment;
|
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneFragment;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoFragment;
|
||||||
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_pick_ord_lavorazione.ProdOrdineLavorazioneElencoFragment;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdFragment;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
|
||||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment;
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment;
|
||||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeFragment;
|
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeFragment;
|
||||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreFragment;
|
|
||||||
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneClienteFragment;
|
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneClienteFragment;
|
||||||
import it.integry.integrywmsnative.gest.vendita.MainVenditaFragment;
|
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreFragment;
|
||||||
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceFragment;
|
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceFragment;
|
||||||
|
|
||||||
public class MenuConfiguration extends BaseMenuConfiguration {
|
public class MenuConfiguration extends BaseMenuConfiguration {
|
||||||
@@ -48,7 +48,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
.setTitleText(R.string.vendita_title_fragment)
|
.setTitleText(R.string.vendita_title_fragment)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_spedizione)
|
.setTitleIcon(R.drawable.ic_dashboard_spedizione)
|
||||||
.setDrawerIcon(R.drawable.ic_black_upload)
|
.setDrawerIcon(R.drawable.ic_black_upload)
|
||||||
.setFragmentFactory(MainVenditaFragment::newInstance))
|
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.VENDITA, null, -1, null)))
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_free_picking)
|
.setID(R.id.nav_free_picking)
|
||||||
@@ -79,7 +79,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
.setTitleText(R.string.prod_ordine_lavorazione_title_fragment)
|
.setTitleText(R.string.prod_ordine_lavorazione_title_fragment)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_lavorazione)
|
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_lavorazione)
|
||||||
.setDrawerIcon(R.drawable.ic_black_external)
|
.setDrawerIcon(R.drawable.ic_black_external)
|
||||||
.setFragmentFactory(ProdOrdineLavorazioneElencoFragment::newInstance))
|
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.PRODUZIONE, GestioneEnum.LAVORAZIONE, -1, null)))
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_free_lav_picking)
|
.setID(R.id.nav_free_lav_picking)
|
||||||
@@ -88,6 +88,13 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_barcode_scanner)
|
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_barcode_scanner)
|
||||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.LAVORAZIONE)))
|
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.LAVORAZIONE)))
|
||||||
|
|
||||||
|
.addItem(new MenuItem()
|
||||||
|
.setID(R.id.nav_prod_posizionamento_da_ord)
|
||||||
|
.setTitleText(R.string.prod_fabbisogno_linee_prod_title)
|
||||||
|
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_merce)
|
||||||
|
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_load_shelf)
|
||||||
|
.setFragmentFactory(ProdFabbisognoLineeProdFragment::newInstance))
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_prod_versamento_materiale)
|
.setID(R.id.nav_prod_versamento_materiale)
|
||||||
.setTitleText(R.string.prod_versamento_materiale_title_fragment)
|
.setTitleText(R.string.prod_versamento_materiale_title_fragment)
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
package it.integry.integrywmsnative.core.class_router.interfaces;
|
package it.integry.integrywmsnative.core.class_router.interfaces;
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.app.ProgressDialog;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.gest.vendita.dto.OrdineVenditaInevasoDTO;
|
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||||
|
|
||||||
public interface IOrdiniVendita {
|
public interface IOrdiniVendita {
|
||||||
|
|
||||||
void distribuisciCollo(MtbColt mtbColt, List<OrdineVenditaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed);
|
void distribuisciCollo(MtbColt mtbColt, List<OrdineUscitaInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,15 @@ import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
|||||||
import com.orhanobut.logger.AndroidLogAdapter;
|
import com.orhanobut.logger.AndroidLogAdapter;
|
||||||
import com.orhanobut.logger.Logger;
|
import com.orhanobut.logger.Logger;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.BuildConfig;
|
import it.integry.integrywmsnative.BuildConfig;
|
||||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecover;
|
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.settings.Stash;
|
import it.integry.integrywmsnative.core.settings.Stash;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityContext;
|
import it.integry.integrywmsnative.core.utility.UtilityContext;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilitySettings;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
||||||
|
|
||||||
@@ -20,6 +23,9 @@ public class AppContext {
|
|||||||
//Note: this is the Application Context NOT the Activity Context
|
//Note: this is the Application Context NOT the Activity Context
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
AppDatabase mAppDatabase;
|
||||||
|
|
||||||
public AppContext(Context context) {
|
public AppContext(Context context) {
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
}
|
}
|
||||||
@@ -34,8 +40,6 @@ public class AppContext {
|
|||||||
this.initCrashlytics();
|
this.initCrashlytics();
|
||||||
|
|
||||||
this.initLogger();
|
this.initLogger();
|
||||||
|
|
||||||
this.initRecoverColli();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -63,15 +67,12 @@ public class AppContext {
|
|||||||
UtilityContext.initApplicationContext(mContext);
|
UtilityContext.initApplicationContext(mContext);
|
||||||
UtilityResources.init(mContext);
|
UtilityResources.init(mContext);
|
||||||
UtilityToast.init(mContext);
|
UtilityToast.init(mContext);
|
||||||
|
UtilitySettings.init(mAppDatabase);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initLogger() {
|
private void initLogger() {
|
||||||
Logger.addLogAdapter(new AndroidLogAdapter());
|
Logger.addLogAdapter(new AndroidLogAdapter());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initRecoverColli() {
|
|
||||||
ColliDataRecover.init(mContext);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,25 @@
|
|||||||
package it.integry.integrywmsnative.core.context;
|
package it.integry.integrywmsnative.core.context;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.text.Html;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
import android.text.Spanned;
|
||||||
import java.lang.reflect.Method;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
import java.lang.reflect.Method;
|
||||||
|
import java.net.ConnectException;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||||
|
import it.integry.integrywmsnative.core.data_recover.ColliDataRecover;
|
||||||
|
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
import it.integry.integrywmsnative.core.utility.UtilitySettings;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
public class MainContext {
|
public class MainContext {
|
||||||
|
|
||||||
@@ -34,6 +41,8 @@ public class MainContext {
|
|||||||
this.initReflections();
|
this.initReflections();
|
||||||
|
|
||||||
this.initServerStatusChecker();
|
this.initServerStatusChecker();
|
||||||
|
|
||||||
|
ColliDataRecover.init(mContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -43,8 +52,23 @@ public class MainContext {
|
|||||||
|
|
||||||
private void initDBData(Runnable onComplete) {
|
private void initDBData(Runnable onComplete) {
|
||||||
SettingsManager.loadDBVariables(onComplete, ex -> {
|
SettingsManager.loadDBVariables(onComplete, ex -> {
|
||||||
DialogSimpleMessageHelper.makeErrorDialog(mContext,
|
|
||||||
new SpannableString(ex.getMessage()), null, mContext::finish).show();
|
Spanned message = null;
|
||||||
|
|
||||||
|
if (ex.getCause() != null && ex.getCause() instanceof ConnectException) {
|
||||||
|
message = Html.fromHtml("Impossibile collegarsi all'host <b>" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "</b>. Riprovare più tardi.");
|
||||||
|
} else if (ex.getMessage().startsWith("Status 404:")) {
|
||||||
|
message = Html.fromHtml("Errore 404. Non è stato possibile soddisfare la richiesta sull'host <b>" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "</b>. Riprovare più tardi.");
|
||||||
|
} else {
|
||||||
|
message = new SpannableString(ex.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
DialogSimpleMessageView.makeErrorDialog(
|
||||||
|
message, null, mContext::finish, R.string.logout, () -> {
|
||||||
|
UtilitySettings.logout();
|
||||||
|
MainApplication.exit();
|
||||||
|
})
|
||||||
|
.show(mContext.getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,18 +2,15 @@ package it.integry.integrywmsnative.core.data_recover;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.annimon.stream.Optional;
|
import com.annimon.stream.Optional;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.google.android.gms.common.util.IOUtils;
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.DataInputStream;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -22,8 +19,8 @@ import java.util.Random;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.core.CommonConst;
|
import it.integry.integrywmsnative.core.CommonConst;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.gest.vendita.dto.OrdineVenditaInevasoDTO;
|
|
||||||
|
|
||||||
public class ColliDataRecover {
|
public class ColliDataRecover {
|
||||||
|
|
||||||
@@ -35,7 +32,7 @@ public class ColliDataRecover {
|
|||||||
private String gestioneCollo;
|
private String gestioneCollo;
|
||||||
private String filtro;
|
private String filtro;
|
||||||
|
|
||||||
private List<OrdineVenditaInevasoDTO> testateOrdini;
|
private List<OrdineUscitaInevasoDTO> testateOrdini;
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
@@ -91,11 +88,11 @@ public class ColliDataRecover {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<OrdineVenditaInevasoDTO> getTestateOrdini() {
|
public List<OrdineUscitaInevasoDTO> getTestateOrdini() {
|
||||||
return testateOrdini;
|
return testateOrdini;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RecoverDTO setTestateOrdini(List<OrdineVenditaInevasoDTO> testateOrdini) {
|
public RecoverDTO setTestateOrdini(List<OrdineUscitaInevasoDTO> testateOrdini) {
|
||||||
this.testateOrdini = testateOrdini;
|
this.testateOrdini = testateOrdini;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -111,11 +108,11 @@ public class ColliDataRecover {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Context mContext;
|
private static AppCompatActivity mContext;
|
||||||
|
|
||||||
private static List<RecoverDTO> mtbColtsSessions = new ArrayList<>();
|
private static List<RecoverDTO> mtbColtsSessions = new ArrayList<>();
|
||||||
|
|
||||||
public static void init(Context context) {
|
public static void init(AppCompatActivity context) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
|
|
||||||
if(isFilePresent(CommonConst.Files.RECOVER_COLLO_FILE)) {
|
if(isFilePresent(CommonConst.Files.RECOVER_COLLO_FILE)) {
|
||||||
@@ -124,7 +121,7 @@ public class ColliDataRecover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean thereIsAnExistantSession() {
|
public static boolean thereIsAnExistantSession() {
|
||||||
return mtbColtsSessions.size() > 0;
|
return mtbColtsSessions != null && mtbColtsSessions.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Integer> getAllSessionIDs() {
|
public static List<Integer> getAllSessionIDs() {
|
||||||
@@ -153,7 +150,7 @@ public class ColliDataRecover {
|
|||||||
return recoverDTOOptional.isPresent() ? recoverDTOOptional.get() : null;
|
return recoverDTOOptional.isPresent() ? recoverDTOOptional.get() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int startNewSession(MtbColt mtbColtSession, List<OrdineVenditaInevasoDTO> testateOrdini) {
|
public static int startNewSession(MtbColt mtbColtSession, List<OrdineUscitaInevasoDTO> testateOrdini) {
|
||||||
Integer newId = null;
|
Integer newId = null;
|
||||||
|
|
||||||
while(newId == null) {
|
while(newId == null) {
|
||||||
@@ -195,13 +192,16 @@ public class ColliDataRecover {
|
|||||||
try {
|
try {
|
||||||
inputStream = mContext.openFileInput(CommonConst.Files.RECOVER_COLLO_FILE);
|
inputStream = mContext.openFileInput(CommonConst.Files.RECOVER_COLLO_FILE);
|
||||||
|
|
||||||
byte[] bytes = IOUtils.readInputStreamFully(inputStream);
|
byte[] bytes = new byte[inputStream.available()];
|
||||||
|
inputStream.read(bytes);
|
||||||
|
inputStream.close();
|
||||||
|
|
||||||
String jsonString = new String(bytes);
|
String jsonString = new String(bytes);
|
||||||
|
|
||||||
Type listType = new TypeToken<ArrayList<RecoverDTO>>(){}.getType();
|
Type listType = new TypeToken<ArrayList<RecoverDTO>>(){}.getType();
|
||||||
mtbColtsSessions = gson.fromJson(jsonString, listType);
|
mtbColtsSessions = gson.fromJson(jsonString, listType);
|
||||||
|
|
||||||
inputStream.close();
|
if(mtbColtsSessions == null) mtbColtsSessions = new ArrayList<>();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
UtilityExceptions.defaultException(mContext, e);
|
UtilityExceptions.defaultException(mContext, e);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package it.integry.integrywmsnative.core.data_recover;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.gest.vendita.dto.OrdineVenditaInevasoDTO;
|
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||||
|
|
||||||
public class ColliDataRecoverDTO {
|
public class ColliDataRecoverDTO {
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ public class ColliDataRecoverDTO {
|
|||||||
private String gestioneCollo;
|
private String gestioneCollo;
|
||||||
private String filtro;
|
private String filtro;
|
||||||
|
|
||||||
private List<OrdineVenditaInevasoDTO> testateOrdini;
|
private List<OrdineUscitaInevasoDTO> testateOrdini;
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
@@ -70,11 +70,11 @@ public class ColliDataRecoverDTO {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<OrdineVenditaInevasoDTO> getTestateOrdini() {
|
public List<OrdineUscitaInevasoDTO> getTestateOrdini() {
|
||||||
return testateOrdini;
|
return testateOrdini;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ColliDataRecoverDTO setTestateOrdini(List<OrdineVenditaInevasoDTO> testateOrdini) {
|
public ColliDataRecoverDTO setTestateOrdini(List<OrdineUscitaInevasoDTO> testateOrdini) {
|
||||||
this.testateOrdini = testateOrdini;
|
this.testateOrdini = testateOrdini;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package it.integry.integrywmsnative.core.data_recover;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.annimon.stream.Optional;
|
import com.annimon.stream.Optional;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.google.android.gms.common.util.IOUtils;
|
import com.google.android.gms.common.util.IOUtils;
|
||||||
@@ -21,27 +23,28 @@ import javax.inject.Singleton;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.core.CommonConst;
|
import it.integry.integrywmsnative.core.CommonConst;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.gest.vendita.dto.OrdineVenditaInevasoDTO;
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class ColliDataRecoverService {
|
public class ColliDataRecoverService {
|
||||||
|
|
||||||
|
|
||||||
private final Context mContext;
|
private AppCompatActivity mContext;
|
||||||
private List<ColliDataRecoverDTO> mtbColtsSessions = new ArrayList<>();
|
private List<ColliDataRecoverDTO> mtbColtsSessions = new ArrayList<>();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ColliDataRecoverService(Context context) {
|
public ColliDataRecoverService() {
|
||||||
this.mContext = context;
|
}
|
||||||
|
|
||||||
|
public void init(AppCompatActivity appCompatActivity) {
|
||||||
|
this.mContext = appCompatActivity;
|
||||||
|
|
||||||
if(isFilePresent(CommonConst.Files.RECOVER_COLLO_FILE)) {
|
if(isFilePresent(CommonConst.Files.RECOVER_COLLO_FILE)) {
|
||||||
loadLocalFile();
|
loadLocalFile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public boolean thereIsAnExistantSession() {
|
public boolean thereIsAnExistantSession() {
|
||||||
return mtbColtsSessions.size() > 0;
|
return mtbColtsSessions.size() > 0;
|
||||||
}
|
}
|
||||||
@@ -72,7 +75,7 @@ public class ColliDataRecoverService {
|
|||||||
return recoverDTOOptional.isPresent() ? recoverDTOOptional.get() : null;
|
return recoverDTOOptional.isPresent() ? recoverDTOOptional.get() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int startNewSession(MtbColt mtbColtSession, List<OrdineVenditaInevasoDTO> testateOrdini) {
|
public int startNewSession(MtbColt mtbColtSession, List<OrdineUscitaInevasoDTO> testateOrdini) {
|
||||||
Integer newId = null;
|
Integer newId = null;
|
||||||
|
|
||||||
while(newId == null) {
|
while(newId == null) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import androidx.room.ForeignKey;
|
|||||||
import androidx.room.Index;
|
import androidx.room.Index;
|
||||||
import androidx.room.PrimaryKey;
|
import androidx.room.PrimaryKey;
|
||||||
|
|
||||||
import java.util.Date;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
|
||||||
@Entity(
|
@Entity(
|
||||||
tableName = "articoli_griglia",
|
tableName = "articoli_griglia",
|
||||||
@@ -159,7 +159,7 @@ public class ArticoloGriglia {
|
|||||||
articolo.setQtaCnf(this.getQtaCnf());
|
articolo.setQtaCnf(this.getQtaCnf());
|
||||||
articolo.setUntMis(this.getUntMis());
|
articolo.setUntMis(this.getUntMis());
|
||||||
articolo.setDescrizione(this.getDescrizione());
|
articolo.setDescrizione(this.getDescrizione());
|
||||||
articolo.setDataIns(new Date());
|
articolo.setDataIns(UtilityDate.getDateInstance());
|
||||||
articolo.setQtaOrd(0);
|
articolo.setQtaOrd(0);
|
||||||
|
|
||||||
return articolo;
|
return articolo;
|
||||||
|
|||||||
@@ -1,23 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.core.di;
|
package it.integry.integrywmsnative.core.di;
|
||||||
|
|
||||||
import androidx.annotation.ColorRes;
|
|
||||||
import androidx.annotation.IdRes;
|
|
||||||
import androidx.appcompat.widget.AppCompatMultiAutoCompleteTextView;
|
|
||||||
import androidx.appcompat.widget.LinearLayoutCompat;
|
|
||||||
import androidx.core.content.res.ResourcesCompat;
|
|
||||||
import androidx.databinding.BindingAdapter;
|
|
||||||
import androidx.databinding.BindingConversion;
|
|
||||||
import androidx.constraintlayout.widget.Guideline;
|
|
||||||
|
|
||||||
import com.google.android.material.textfield.TextInputEditText;
|
|
||||||
import com.google.android.material.textfield.TextInputLayout;
|
|
||||||
|
|
||||||
import androidx.core.util.Pair;
|
|
||||||
import androidx.appcompat.widget.AppCompatCheckBox;
|
|
||||||
import androidx.appcompat.widget.AppCompatTextView;
|
|
||||||
|
|
||||||
import android.app.DatePickerDialog;
|
import android.app.DatePickerDialog;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -25,10 +8,25 @@ import android.widget.AutoCompleteTextView;
|
|||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.RadioButton;
|
import android.widget.RadioButton;
|
||||||
import android.widget.RadioGroup;
|
import android.widget.RadioGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.ColorRes;
|
||||||
|
import androidx.appcompat.widget.AppCompatCheckBox;
|
||||||
|
import androidx.appcompat.widget.AppCompatMultiAutoCompleteTextView;
|
||||||
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
|
import androidx.appcompat.widget.LinearLayoutCompat;
|
||||||
|
import androidx.constraintlayout.widget.Guideline;
|
||||||
|
import androidx.core.content.res.ResourcesCompat;
|
||||||
|
import androidx.core.util.Pair;
|
||||||
|
import androidx.databinding.BindingAdapter;
|
||||||
|
import androidx.databinding.BindingConversion;
|
||||||
|
import androidx.databinding.Observable;
|
||||||
|
import androidx.databinding.ObservableField;
|
||||||
|
|
||||||
|
import com.google.android.material.textfield.TextInputEditText;
|
||||||
|
import com.google.android.material.textfield.TextInputLayout;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.text.DecimalFormatSymbols;
|
import java.text.DecimalFormatSymbols;
|
||||||
@@ -37,15 +35,10 @@ import java.util.Date;
|
|||||||
import java.util.GregorianCalendar;
|
import java.util.GregorianCalendar;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import androidx.databinding.Observable;
|
|
||||||
import androidx.databinding.ObservableField;
|
|
||||||
import androidx.lifecycle.MutableLiveData;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.MainApplication;
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityContext;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
@@ -178,7 +171,7 @@ public class Converters {
|
|||||||
view.addTextChangedListener(watcher);
|
view.addTextChangedListener(watcher);
|
||||||
}
|
}
|
||||||
String newValue = observableString.get();
|
String newValue = observableString.get();
|
||||||
String viewValue = view.getText().toString().trim();
|
String viewValue = view.getText().toString();
|
||||||
|
|
||||||
if(!viewValue.equalsIgnoreCase(newValue)) {
|
if(!viewValue.equalsIgnoreCase(newValue)) {
|
||||||
view.setText(newValue);
|
view.setText(newValue);
|
||||||
@@ -386,7 +379,7 @@ public class Converters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@BindingAdapter({"app:visibility"})
|
@BindingAdapter({"visibility"})
|
||||||
public static void bindViewVisibility(View view, final BindableBoolean bindableBoolean) {
|
public static void bindViewVisibility(View view, final BindableBoolean bindableBoolean) {
|
||||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
|
||||||
|
public class AlreadyAttachedDocumentToLUException extends Exception {
|
||||||
|
|
||||||
|
public AlreadyAttachedDocumentToLUException() {
|
||||||
|
super(UtilityResources.getString(R.string.lu_already_attache_to_doc));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
|
||||||
|
public class InvalidLUMultiCodMdepException extends Exception {
|
||||||
|
|
||||||
|
public InvalidLUMultiCodMdepException() {
|
||||||
|
super(UtilityResources.getString(R.string.error_multiple_cod_mdep_ord));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.exception;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.io.StringWriter;
|
|
||||||
|
|
||||||
public class MyExceptionHandler implements
|
|
||||||
java.lang.Thread.UncaughtExceptionHandler {
|
|
||||||
private final Context myContext;
|
|
||||||
private final Class<?> myActivityClass;
|
|
||||||
|
|
||||||
public MyExceptionHandler(Context context, Class<?> c) {
|
|
||||||
|
|
||||||
myContext = context;
|
|
||||||
myActivityClass = c;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void uncaughtException(Thread thread, Throwable exception) {
|
|
||||||
|
|
||||||
StringWriter stackTrace = new StringWriter();
|
|
||||||
exception.printStackTrace(new PrintWriter(stackTrace));
|
|
||||||
System.err.println(stackTrace);// You can use LogCat too
|
|
||||||
// Intent intent = new Intent(myContext, myActivityClass);
|
|
||||||
// String s = stackTrace.toString();
|
|
||||||
// //you can use this String to know what caused the exception and in which Activity
|
|
||||||
// intent.putExtra("uncaughtException",
|
|
||||||
// "Exception is: " + stackTrace.toString());
|
|
||||||
// intent.putExtra("stacktrace", s);
|
|
||||||
// myContext.startActivity(intent);
|
|
||||||
//for restarting the Activity
|
|
||||||
// Process.killProcess(Process.myPid());
|
|
||||||
// System.exit(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
|
||||||
|
public class NoArtsInLUException extends Exception {
|
||||||
|
|
||||||
|
public NoArtsInLUException() {
|
||||||
|
super(UtilityResources.getString(R.string.no_items_found_message));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
|
||||||
|
public class NoOrderFoundException extends Exception {
|
||||||
|
|
||||||
|
public NoOrderFoundException() {
|
||||||
|
super(UtilityResources.getString(R.string.no_orders_found_message));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,6 +5,6 @@ import it.integry.integrywmsnative.core.utility.UtilityResources;
|
|||||||
|
|
||||||
public class NoPrintersFoundException extends Exception {
|
public class NoPrintersFoundException extends Exception {
|
||||||
public NoPrintersFoundException() {
|
public NoPrintersFoundException() {
|
||||||
super(UtilityResources.getString(R.string.exception_printer_not_found));
|
super(UtilityResources.getString(R.string.exception_no_printer_found));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
|
||||||
|
public class TooManyLUFoundInMonoLUPositionException extends Exception {
|
||||||
|
|
||||||
|
public TooManyLUFoundInMonoLUPositionException() {
|
||||||
|
super(UtilityResources.getString(R.string.too_much_lu_found_message_in_mono_lu));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,7 +6,6 @@ import android.view.KeyEvent;
|
|||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.exception.MyExceptionHandler;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
|
|
||||||
public class BaseActivity extends AppCompatActivity {
|
public class BaseActivity extends AppCompatActivity {
|
||||||
@@ -15,7 +14,7 @@ public class BaseActivity extends AppCompatActivity {
|
|||||||
protected Dialog mCurrentProgress;
|
protected Dialog mCurrentProgress;
|
||||||
|
|
||||||
public BaseActivity() {
|
public BaseActivity() {
|
||||||
Thread.setDefaultUncaughtExceptionHandler(new MyExceptionHandler(this, BaseActivity.class));
|
//Thread.setDefaultUncaughtExceptionHandler(new MyExceptionHandler(this, BaseActivity.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.KeyEvent;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.fragment.app.DialogFragment;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
|
|
||||||
|
public class BaseDialogFragment extends DialogFragment {
|
||||||
|
|
||||||
|
private boolean mBarcodeListener = false;
|
||||||
|
private Dialog mCurrentProgress;
|
||||||
|
|
||||||
|
public BaseDialogFragment() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
||||||
|
getDialog().setOnKeyListener((dialog, keyCode, event) -> {
|
||||||
|
if (mBarcodeListener && (event.getAction() == KeyEvent.ACTION_DOWN || event.getAction() == KeyEvent.ACTION_MULTIPLE) && !isControlKey(event)) {
|
||||||
|
return BarcodeManager.onKeyDown(event.getKeyCode(), event);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isControlKey(KeyEvent keyEvent) {
|
||||||
|
int keyCode = keyEvent.getKeyCode();
|
||||||
|
return (
|
||||||
|
keyCode == KeyEvent.KEYCODE_BACK ||
|
||||||
|
keyCode == KeyEvent.KEYCODE_SHIFT_LEFT ||
|
||||||
|
keyCode == KeyEvent.KEYCODE_DEL
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBarcodeListener(boolean listen) {
|
||||||
|
this.mBarcodeListener = listen;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void openProgress() {
|
||||||
|
if (this.mCurrentProgress == null) {
|
||||||
|
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void closeProgress() {
|
||||||
|
if (mCurrentProgress != null) {
|
||||||
|
mCurrentProgress.dismiss();
|
||||||
|
mCurrentProgress = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
|
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
|
|
||||||
|
public class BaseFragment extends Fragment {
|
||||||
|
|
||||||
|
protected Dialog mCurrentProgress;
|
||||||
|
|
||||||
|
|
||||||
|
protected void openProgress() {
|
||||||
|
|
||||||
|
new Thread(() -> {
|
||||||
|
getActivity().runOnUiThread(() -> {
|
||||||
|
if (this.mCurrentProgress == null) {
|
||||||
|
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void closeProgress() {
|
||||||
|
new Thread(() -> {
|
||||||
|
getActivity().runOnUiThread(() -> {
|
||||||
|
if (mCurrentProgress != null) {
|
||||||
|
mCurrentProgress.dismiss();
|
||||||
|
mCurrentProgress = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
public interface RunnableArgsWithReturn<T, R> {
|
||||||
|
|
||||||
|
R run(T data);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
public interface RunnableArgssss<S, T, U, V> {
|
||||||
|
|
||||||
|
void run(S data1, T data2, U data3, V data4);
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion.view;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
import androidx.databinding.ObservableList;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.zhukic.sectionedrecyclerview.SectionedRecyclerViewAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
||||||
|
|
||||||
|
public abstract class ExtendedSectionedRecyclerView<T, SH extends RecyclerView.ViewHolder, VH extends RecyclerView.ViewHolder>
|
||||||
|
extends SectionedRecyclerViewAdapter<SH, VH> {
|
||||||
|
|
||||||
|
protected ArrayList<T> mDataset = new ArrayList<>();
|
||||||
|
private View mEmptyView;
|
||||||
|
|
||||||
|
public ExtendedSectionedRecyclerView(ObservableArrayList<T> myDataset) {
|
||||||
|
mDataset.addAll(myDataset);
|
||||||
|
|
||||||
|
myDataset.addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void onChanged(ObservableList sender) {
|
||||||
|
mDataset.clear();
|
||||||
|
mDataset.addAll(sender);
|
||||||
|
notifyDataSetChanged();
|
||||||
|
notifyDataChanged();
|
||||||
|
checkIfEmpty();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
checkIfEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExtendedSectionedRecyclerView<T, SH, VH> setEmptyView(View emptyView) {
|
||||||
|
this.mEmptyView = emptyView;
|
||||||
|
this.checkIfEmpty();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemSize() {
|
||||||
|
return this.mDataset.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkIfEmpty() {
|
||||||
|
if (mEmptyView != null) {
|
||||||
|
final boolean emptyViewVisible = getItemSize() == 0;
|
||||||
|
mEmptyView.setVisibility(emptyViewVisible ? View.VISIBLE : View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.interfaces;
|
||||||
|
|
||||||
|
public interface IDestroyableFragment {
|
||||||
|
|
||||||
|
void addOnPreDestroy(Runnable onPreDestroy);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.core.interfaces;
|
package it.integry.integrywmsnative.core.interfaces;
|
||||||
|
|
||||||
public interface IFilterableFragment {
|
public interface IFilterableFragment extends IDestroyableFragment {
|
||||||
|
|
||||||
void onFilterClick();
|
void onFilterClick();
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,8 @@ package it.integry.integrywmsnative.core.interfaces;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||||
|
|
||||||
public interface IScrollableFragment {
|
public interface IScrollableFragment extends IDestroyableFragment {
|
||||||
|
|
||||||
void setScrollToolbar(ElevatedToolbar toolbar);
|
void setScrollToolbar(ElevatedToolbar toolbar);
|
||||||
|
|
||||||
void setOnPreDestroy(Runnable onPreDestroy);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package it.integry.integrywmsnative.core.interfaces;
|
|||||||
|
|
||||||
import androidx.appcompat.widget.SearchView;
|
import androidx.appcompat.widget.SearchView;
|
||||||
|
|
||||||
public interface ISearcableFragment extends SearchView.OnQueryTextListener {
|
public interface ISearcableFragment extends SearchView.OnQueryTextListener, IDestroyableFragment {
|
||||||
|
|
||||||
void onSearchEnabled();
|
void onSearchEnabled();
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package it.integry.integrywmsnative.core.interfaces;
|
package it.integry.integrywmsnative.core.interfaces;
|
||||||
|
|
||||||
public interface ISelectAllFragment {
|
public interface ISelectAllFragment extends IDestroyableFragment {
|
||||||
|
|
||||||
boolean isEnabled();
|
boolean isSelectAllButtonEnabled();
|
||||||
|
|
||||||
void onSelectAll();
|
void onSelectAll();
|
||||||
|
|
||||||
|
|||||||
@@ -2,14 +2,13 @@ package it.integry.integrywmsnative.core.interfaces;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import androidx.appcompat.app.ActionBar;
|
|
||||||
import androidx.appcompat.widget.AppCompatTextView;
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by GiuseppeS on 07/03/2018.
|
* Created by GiuseppeS on 07/03/2018.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface ITitledFragment {
|
public interface ITitledFragment extends IDestroyableFragment {
|
||||||
|
|
||||||
void onCreateActionBar(AppCompatTextView titleText, Context context);
|
void onCreateActionBar(AppCompatTextView titleText, Context context);
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,15 @@
|
|||||||
package it.integry.integrywmsnative.core.interfaces.viewmodel_listeners;
|
package it.integry.integrywmsnative.core.interfaces.viewmodel_listeners;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
|
||||||
public interface ILUBaseOperationsListener {
|
public interface ILUBaseOperationsListener {
|
||||||
|
|
||||||
|
void onMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete);
|
||||||
|
|
||||||
void onLUOpened(MtbColt mtbColt);
|
void onLUOpened(MtbColt mtbColt);
|
||||||
|
|
||||||
void onLUClosed();
|
void onLUClosed();
|
||||||
|
|
||||||
|
void onRowSaved();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package it.integry.integrywmsnative.core.interfaces.viewmodel_listeners;
|
package it.integry.integrywmsnative.core.interfaces.viewmodel_listeners;
|
||||||
|
|
||||||
public interface ILoadingListener {
|
public interface ILoadingListener {
|
||||||
|
|
||||||
void onLoadingStarted();
|
void onLoadingStarted();
|
||||||
|
|
||||||
void onLoadingEnded();
|
void onLoadingEnded();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,6 +141,8 @@ public class DtbDocr {
|
|||||||
|
|
||||||
private MtbAart mtbAart;
|
private MtbAart mtbAart;
|
||||||
|
|
||||||
|
private String dataScadPartitaMag;
|
||||||
|
|
||||||
public String getCodAnag() {
|
public String getCodAnag() {
|
||||||
return codAnag;
|
return codAnag;
|
||||||
}
|
}
|
||||||
@@ -739,6 +741,19 @@ public class DtbDocr {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDataScadPartitaMag() {
|
||||||
|
return dataScadPartitaMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataScadPartitaMagD() {
|
||||||
|
return UtilityDate.recognizeDateWithExceptionHandler(getDataScadPartitaMag());
|
||||||
|
}
|
||||||
|
|
||||||
|
public DtbDocr setDataScadPartitaMag(String dataScadPartitaMag) {
|
||||||
|
this.dataScadPartitaMag = dataScadPartitaMag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public MtbAart getMtbAart() {
|
public MtbAart getMtbAart() {
|
||||||
return mtbAart;
|
return mtbAart;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package it.integry.integrywmsnative.core.model;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
public class GtbAnag {
|
public class GtbAnag extends EntityBase {
|
||||||
|
|
||||||
private String codAnag;
|
private String codAnag;
|
||||||
private String ragSoc;
|
private String ragSoc;
|
||||||
@@ -45,6 +45,10 @@ public class GtbAnag {
|
|||||||
private String precode;
|
private String precode;
|
||||||
private Boolean insDestinatario;
|
private Boolean insDestinatario;
|
||||||
|
|
||||||
|
public GtbAnag() {
|
||||||
|
this.type = "gtb_anag";
|
||||||
|
}
|
||||||
|
|
||||||
public String getCodAnag() {
|
public String getCodAnag() {
|
||||||
return codAnag;
|
return codAnag;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,180 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class JtbFasi extends EntityBase {
|
||||||
|
|
||||||
|
private String codJfas;
|
||||||
|
private String codJfasParent;
|
||||||
|
private String descrizione;
|
||||||
|
private String descrizEstesa;
|
||||||
|
private String codMfas;
|
||||||
|
private String pathIcona;
|
||||||
|
private String umAllocazione;
|
||||||
|
private BigDecimal maxAllocazione;
|
||||||
|
private String codJCal;
|
||||||
|
private String idJfas;
|
||||||
|
private String flagAttivo;
|
||||||
|
private String flagCheck;
|
||||||
|
private String umProd;
|
||||||
|
private BigDecimal prodStd;
|
||||||
|
private String codMdepLav;
|
||||||
|
private String tipoProd;
|
||||||
|
|
||||||
|
public JtbFasi() {
|
||||||
|
this.type = "jtb_fasi";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodJfas() {
|
||||||
|
return codJfas;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbFasi setCodJfas(String codJfas) {
|
||||||
|
this.codJfas = codJfas;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodJfasParent() {
|
||||||
|
return codJfasParent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbFasi setCodJfasParent(String codJfasParent) {
|
||||||
|
this.codJfasParent = codJfasParent;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbFasi setDescrizione(String descrizione) {
|
||||||
|
this.descrizione = descrizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizEstesa() {
|
||||||
|
return descrizEstesa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbFasi setDescrizEstesa(String descrizEstesa) {
|
||||||
|
this.descrizEstesa = descrizEstesa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMfas() {
|
||||||
|
return codMfas;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbFasi setCodMfas(String codMfas) {
|
||||||
|
this.codMfas = codMfas;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPathIcona() {
|
||||||
|
return pathIcona;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbFasi setPathIcona(String pathIcona) {
|
||||||
|
this.pathIcona = pathIcona;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUmAllocazione() {
|
||||||
|
return umAllocazione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbFasi setUmAllocazione(String umAllocazione) {
|
||||||
|
this.umAllocazione = umAllocazione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getMaxAllocazione() {
|
||||||
|
return maxAllocazione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbFasi setMaxAllocazione(BigDecimal maxAllocazione) {
|
||||||
|
this.maxAllocazione = maxAllocazione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodJCal() {
|
||||||
|
return codJCal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbFasi setCodJCal(String codJCal) {
|
||||||
|
this.codJCal = codJCal;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIdJfas() {
|
||||||
|
return idJfas;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbFasi setIdJfas(String idJfas) {
|
||||||
|
this.idJfas = idJfas;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagAttivo() {
|
||||||
|
return flagAttivo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbFasi setFlagAttivo(String flagAttivo) {
|
||||||
|
this.flagAttivo = flagAttivo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagCheck() {
|
||||||
|
return flagCheck;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbFasi setFlagCheck(String flagCheck) {
|
||||||
|
this.flagCheck = flagCheck;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUmProd() {
|
||||||
|
return umProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbFasi setUmProd(String umProd) {
|
||||||
|
this.umProd = umProd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getProdStd() {
|
||||||
|
return prodStd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbFasi setProdStd(BigDecimal prodStd) {
|
||||||
|
this.prodStd = prodStd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMdepLav() {
|
||||||
|
return codMdepLav;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbFasi setCodMdepLav(String codMdepLav) {
|
||||||
|
this.codMdepLav = codMdepLav;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTipoProd() {
|
||||||
|
return tipoProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JtbFasi setTipoProd(String tipoProd) {
|
||||||
|
this.tipoProd = tipoProd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return String.format("%s - %s", getCodJfas(), getDescrizione());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,7 +9,7 @@ import it.integry.integrywmsnative.core.utility.UtilityString;
|
|||||||
* Created by GiuseppeS on 06/03/2018.
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class MtbAart extends EntityBase{
|
public class MtbAart extends EntityBase {
|
||||||
|
|
||||||
private String codMart;
|
private String codMart;
|
||||||
private String descrizione;
|
private String descrizione;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.math.BigDecimal;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
|
||||||
public class MtbColr extends EntityBase {
|
public class MtbColr extends EntityBase {
|
||||||
@@ -56,6 +57,10 @@ public class MtbColr extends EntityBase {
|
|||||||
|
|
||||||
public MtbColr() {
|
public MtbColr() {
|
||||||
type = "mtb_colr";
|
type = "mtb_colr";
|
||||||
|
|
||||||
|
if(SettingsManager.i().isUserLoggedIn()) {
|
||||||
|
setUtente(SettingsManager.i().getUser().getFullname());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public class MtbColt extends EntityBase {
|
|||||||
private BigDecimal lunghezzaCm;
|
private BigDecimal lunghezzaCm;
|
||||||
private BigDecimal larghezzaCm;
|
private BigDecimal larghezzaCm;
|
||||||
private BigDecimal altezzaCm;
|
private BigDecimal altezzaCm;
|
||||||
|
private String codJcom;
|
||||||
|
|
||||||
private List<MtbCols> mtbCols;
|
private List<MtbCols> mtbCols;
|
||||||
|
|
||||||
@@ -98,6 +99,10 @@ public class MtbColt extends EntityBase {
|
|||||||
type = "mtb_colt";
|
type = "mtb_colt";
|
||||||
setDataCollo(UtilityDate.getDateInstance());
|
setDataCollo(UtilityDate.getDateInstance());
|
||||||
setSerCollo("/");
|
setSerCollo("/");
|
||||||
|
|
||||||
|
if(SettingsManager.i().isUserLoggedIn()) {
|
||||||
|
setPreparatoDa(SettingsManager.i().getUser().getFullname());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MtbColt initDefaultFields() {
|
public MtbColt initDefaultFields() {
|
||||||
@@ -500,6 +505,15 @@ public class MtbColt extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCodJcom() {
|
||||||
|
return codJcom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodJcom(String codJcom) {
|
||||||
|
this.codJcom = codJcom;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public void generaFiltroOrdineFromDTO(List<FiltroOrdineDTO> filtroOrdineDtos) {
|
public void generaFiltroOrdineFromDTO(List<FiltroOrdineDTO> filtroOrdineDtos) {
|
||||||
|
|
||||||
String xmlPrefix = "{\"whereCond\": \"";
|
String xmlPrefix = "{\"whereCond\": \"";
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
|
||||||
|
public class OrdineInevasoDTO {
|
||||||
|
|
||||||
|
private String data;
|
||||||
|
private Integer numero;
|
||||||
|
private String gestione;
|
||||||
|
private String codMdep;
|
||||||
|
|
||||||
|
public String getDataOrdS() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataOrdD() {
|
||||||
|
return UtilityDate.recognizeDateWithExceptionHandler(getDataOrdS());
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrdineInevasoDTO setData(String data) {
|
||||||
|
this.data = data;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumOrd() {
|
||||||
|
return numero;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrdineInevasoDTO setNumero(Integer numero) {
|
||||||
|
this.numero = numero;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGestione() {
|
||||||
|
return gestione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GestioneEnum getGestioneEnum() {
|
||||||
|
return GestioneEnum.fromString(getGestione());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public OrdineInevasoDTO setGestione(String gestione) {
|
||||||
|
this.gestione = gestione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrdineInevasoDTO setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -10,9 +10,19 @@ import it.integry.integrywmsnative.core.utility.UtilityString;
|
|||||||
|
|
||||||
public class PickDataDTO {
|
public class PickDataDTO {
|
||||||
|
|
||||||
|
private MtbColt refMtbColt;
|
||||||
private MtbColt sourceMtbColt;
|
private MtbColt sourceMtbColt;
|
||||||
private ManualPickDTO manualPickDTO;
|
private ManualPickDTO manualPickDTO;
|
||||||
|
|
||||||
|
public MtbColt getRefMtbColt() {
|
||||||
|
return refMtbColt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PickDataDTO setRefMtbColt(MtbColt refMtbColt) {
|
||||||
|
this.refMtbColt = refMtbColt;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public MtbColt getSourceMtbColt() {
|
public MtbColt getSourceMtbColt() {
|
||||||
return sourceMtbColt;
|
return sourceMtbColt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,11 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void getByCodMart(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getByCodMart(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
getByCodMartStatic(codMartToFind, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getByCodMartStatic(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
String joinedCods = Stream.of(codMartToFind)
|
String joinedCods = Stream.of(codMartToFind)
|
||||||
.collect(Collectors.joining(","));
|
.collect(Collectors.joining(","));
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@@ -32,6 +31,7 @@ import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
@@ -45,6 +45,13 @@ import retrofit2.Response;
|
|||||||
@Singleton
|
@Singleton
|
||||||
public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
private ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||||
|
|
||||||
|
public ColliMagazzinoRESTConsumer(ArticoloRESTConsumer articoloRESTConsumer) {
|
||||||
|
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void saveColloStatic(MtbColt mtbColtToSave, final ISimpleOperationCallback<MtbColt> callback) {
|
public static void saveColloStatic(MtbColt mtbColtToSave, final ISimpleOperationCallback<MtbColt> callback) {
|
||||||
|
|
||||||
for (int i = 0; i < mtbColtToSave.getMtbColr().size(); i++) {
|
for (int i = 0; i < mtbColtToSave.getMtbColr().size(); i++) {
|
||||||
@@ -88,8 +95,11 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void saveColli(List<MtbColt> mtbColtsToSave, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
saveColliStatic(mtbColtsToSave, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
public static void saveColli(List<MtbColt> mtbColtsToSave, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void saveColliStatic(List<MtbColt> mtbColtsToSave, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
for (MtbColt mtbColt : mtbColtsToSave) {
|
for (MtbColt mtbColt : mtbColtsToSave) {
|
||||||
mtbColt.setMtbCols(null);
|
mtbColt.setMtbCols(null);
|
||||||
@@ -115,7 +125,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void createColloLavorazione(int segno, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createColloLavorazione(int segno, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MtbColt mtbColtToCreate = new MtbColt()
|
MtbColt mtbColtToCreate = new MtbColt()
|
||||||
.setSegno(segno)
|
.setSegno(segno)
|
||||||
.setGestione(GestioneEnum.LAVORAZIONE);
|
.setGestione(GestioneEnum.LAVORAZIONE);
|
||||||
@@ -126,16 +136,10 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
|
|
||||||
|
|
||||||
saveColloStatic(mtbColtToCreate, new ISimpleOperationCallback<MtbColt>() {
|
saveCollo(mtbColtToCreate, value -> {
|
||||||
@Override
|
if (onComplete != null) onComplete.run(value);
|
||||||
public void onSuccess(MtbColt value) {
|
}, ex -> {
|
||||||
if (onComplete != null) onComplete.run(value);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
if (onFailed != null) onFailed.run(ex);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,7 +206,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void createColliScaricoDaOrdineLavorazione(MtbColt sourceMtbColt,MtbColr sourceMtbColr, MtbDepoPosizione posizione, List<OrdineLavorazioneDTO> ordini, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public static 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()
|
||||||
@@ -252,7 +256,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.setPartitaMag(original.getPartitaMag())
|
.setPartitaMag(original.getPartitaMag())
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
for (OrdineLavorazioneDTO ordLav : ordini) {
|
for (OrdineLavorazioneDTO ordLav : ordini) {
|
||||||
if (ordLav.getQtaColVersamento().getBigDecimal().compareTo(BigDecimal.ZERO) > 0){
|
if (ordLav.getQtaColVersamento().getBigDecimal().compareTo(BigDecimal.ZERO) > 0) {
|
||||||
MtbColr ordColr = (MtbColr) mtbColrClone.clone();
|
MtbColr ordColr = (MtbColr) mtbColrClone.clone();
|
||||||
ordColr.setQtaCol(ordLav.getQtaColVersamento().getBigDecimal());
|
ordColr.setQtaCol(ordLav.getQtaColVersamento().getBigDecimal());
|
||||||
ordColr.setNumCnf(ordLav.getNumCnfVersamento().getBigDecimal());
|
ordColr.setNumCnf(ordLav.getNumCnfVersamento().getBigDecimal());
|
||||||
@@ -280,12 +284,11 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void createColloFromEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createColloFromEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
createColloFromEtichettaAnonima(barcodeScanDTO.getStringValue(), gestione, onComplete, onFailed);
|
createColloFromEtichettaAnonima(barcodeScanDTO.getStringValue(), gestione, onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void createColloFromEtichettaAnonima(String barcode, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
public static void createColloFromEtichettaAnonima(String barcode, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
|
|
||||||
MtbColt mtbColtToCreate = new MtbColt()
|
MtbColt mtbColtToCreate = new MtbColt()
|
||||||
.setGestione(gestione);
|
.setGestione(gestione);
|
||||||
@@ -311,39 +314,22 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
mtbColtToCreate
|
mtbColtToCreate
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
|
|
||||||
saveColloStatic(mtbColtToCreate, new ISimpleOperationCallback<MtbColt>() {
|
saveCollo(mtbColtToCreate, value -> {
|
||||||
@Override
|
if (onComplete != null) onComplete.run(value);
|
||||||
public void onSuccess(MtbColt value) {
|
}, ex -> {
|
||||||
if (onComplete != null) onComplete.run(value);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
if (onFailed != null) onFailed.run(ex);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteCollo(MtbColt mtbColtToDelete, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void deleteCollo(MtbColt mtbColtToDelete, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliMagazzinoRESTConsumer.deleteColloStatic(mtbColtToDelete, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void deleteColloStatic(MtbColt mtbColtToDelete, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
|
|
||||||
mtbColtToDelete.setOperation(CommonModelConsts.OPERATION.DELETE);
|
mtbColtToDelete.setOperation(CommonModelConsts.OPERATION.DELETE);
|
||||||
|
|
||||||
saveColloStatic(mtbColtToDelete, new ISimpleOperationCallback<MtbColt>() {
|
saveCollo(mtbColtToDelete, value -> {
|
||||||
@Override
|
if (onComplete != null) onComplete.run();
|
||||||
public void onSuccess(MtbColt value) {
|
}, ex -> {
|
||||||
if (onComplete != null) onComplete.run();
|
if (onFailed != null) onFailed.run(ex);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
if (onFailed != null) onFailed.run(ex);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void distribuisciCollo(MtbColt mtbColtToDistribute, DistribuzioneColloDTO.CriterioDistribuzione criterioDistribuzione, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void distribuisciCollo(MtbColt mtbColtToDistribute, DistribuzioneColloDTO.CriterioDistribuzione criterioDistribuzione, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
@@ -375,7 +361,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onComplete.run(newList);
|
onComplete.run(newList);
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
@@ -402,7 +387,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||||
List<MtbColt> mtbColtList = new ArrayList<>();
|
List<MtbColt> mtbColtList = new ArrayList<>();
|
||||||
mtbColtList.add(mtbColt);
|
mtbColtList.add(mtbColt);
|
||||||
fillMtbAartsOfMtbColts(mtbColtList, mtbColts -> onComplete.run(mtbColts.get(0)), onFailed);
|
fillMtbAartsOfMtbColtsStatic(mtbColtList, mtbColts -> onComplete.run(mtbColts.get(0)), onFailed);
|
||||||
} else {
|
} else {
|
||||||
onComplete.run(mtbColt);
|
onComplete.run(mtbColt);
|
||||||
}
|
}
|
||||||
@@ -417,8 +402,11 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void fillMtbAartsOfMtbColts(List<MtbColt> mtbColts, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
fillMtbAartsOfMtbColtsStatic(mtbColts, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
public static void fillMtbAartsOfMtbColts(List<MtbColt> mtbColts, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void fillMtbAartsOfMtbColtsStatic(List<MtbColt> mtbColts, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
List<String> codMarts = new ArrayList<>();
|
List<String> codMarts = new ArrayList<>();
|
||||||
|
|
||||||
for (MtbColt mtbColt : mtbColts) {
|
for (MtbColt mtbColt : mtbColts) {
|
||||||
@@ -430,7 +418,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ArticoloRESTConsumer.getByCodMart(codMarts, arts -> {
|
ArticoloRESTConsumer.getByCodMartStatic(codMarts, arts -> {
|
||||||
|
|
||||||
if (arts != null && arts.size() > 0) {
|
if (arts != null && arts.size() > 0) {
|
||||||
for (MtbColt mtbColt : mtbColts) {
|
for (MtbColt mtbColt : mtbColts) {
|
||||||
@@ -496,81 +484,65 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void getByTestataStatic(MtbColt testata, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void getByTestataStatic(MtbColt testata, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
String ssccString = null;
|
testata.setMtbColr(new ObservableArrayList<>());
|
||||||
|
|
||||||
if (testata.getSerCollo().equalsIgnoreCase(CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE)) {
|
|
||||||
ssccString = "U";
|
|
||||||
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yy");
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
ssccString += sdf.format(testata.getDataColloD());
|
colliMagazzinoRESTConsumerService.getColloInGiac(onlyResiduo, throwExcIfNull, testata).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||||
|
analyzeAnswer(response, "getColloInGiac", mtbColt -> {
|
||||||
|
|
||||||
ssccString += String.format("%07d", testata.getNumCollo());
|
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||||
} else {
|
List<MtbColt> mtbColtList = new ArrayList<>();
|
||||||
ssccString = "";
|
mtbColtList.add(mtbColt);
|
||||||
|
fillMtbAartsOfMtbColtsStatic(mtbColtList, mtbColts -> onComplete.run(mtbColts.get(0)), onFailed);
|
||||||
|
} else {
|
||||||
|
onComplete.run(mtbColt);
|
||||||
|
}
|
||||||
|
|
||||||
switch (testata.getGestioneEnum()) {
|
}, onFailed);
|
||||||
case ACQUISTO:
|
|
||||||
ssccString += "1";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case LAVORAZIONE:
|
|
||||||
ssccString += "2";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case VENDITA:
|
|
||||||
ssccString += "3";
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yy");
|
@Override
|
||||||
ssccString += sdf.format(testata.getDataColloD());
|
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
ssccString += String.format("%05d", testata.getNumCollo());
|
|
||||||
ssccString += "0";
|
public void changePosizione(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
String codMdep = posizione.getCodMdep();
|
||||||
|
String posizioneString = posizione.getPosizione();
|
||||||
|
|
||||||
|
MtbColt mtbColtToMoveClone = (MtbColt) mtbColtToMove.clone();
|
||||||
|
|
||||||
|
for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) {
|
||||||
|
mtbColtToMoveClone.getMtbColr().get(i)
|
||||||
|
.setMtbAart(null)
|
||||||
|
.setMtbPartitaMag(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
getBySSCCStatic(ssccString, onlyResiduo, throwExcIfNull, onComplete, onFailed);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
}
|
colliMagazzinoRESTConsumerService
|
||||||
|
.spostaULInPosizione(codMdep,
|
||||||
|
posizioneString,
|
||||||
public static void changePosizione(MtbColt mtbColtToSave, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
mtbColtToMoveClone)
|
||||||
MtbColt mtbColtToSaveClone = (MtbColt) mtbColtToSave.clone();
|
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
||||||
|
@Override
|
||||||
mtbColtToSaveClone.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
mtbColtToSaveClone.setMtbColr(new ObservableArrayList<>());
|
analyzeAnswer(response, "changePosizione", mtbColts -> {
|
||||||
|
onComplete.run();
|
||||||
if (posizione == null) mtbColtToSaveClone.setPosizione(null);
|
}, onFailed);
|
||||||
else mtbColtToSaveClone.setPosizione(posizione.getPosizione());
|
}
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumer.saveColloStatic(mtbColtToSaveClone, mtbColt -> {
|
|
||||||
if (onComplete != null) onComplete.run();
|
|
||||||
}, ex -> {
|
|
||||||
if (onFailed != null) onFailed.run(ex);
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void updateRiga(MtbColr mtbColrToUpdate, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
updateRigaStatic(mtbColrToUpdate, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void updateRigaStatic(MtbColr mtbColrToUpdate, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
MtbColt mtbColt = new MtbColt()
|
|
||||||
.setGestione(mtbColrToUpdate.getGestioneEnum())
|
|
||||||
.setNumCollo(mtbColrToUpdate.getNumCollo())
|
|
||||||
.setSerCollo(mtbColrToUpdate.getSerCollo())
|
|
||||||
.setDataCollo(mtbColrToUpdate.getDataColloS());
|
|
||||||
|
|
||||||
mtbColt.getMtbColr().add(mtbColrToUpdate);
|
|
||||||
|
|
||||||
mtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
|
||||||
mtbColrToUpdate.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
|
||||||
|
|
||||||
EntityRESTConsumer.processEntity(mtbColt, value -> {
|
|
||||||
if(onComplete != null) onComplete.run();
|
|
||||||
}, onFailed, MtbColt.class);
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||||
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateDataFine(MtbColt mtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void updateDataFine(MtbColt mtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
@@ -650,7 +622,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<MtbColt>>> call, Response<ServiceRESTResponse<List<MtbColt>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<MtbColt>>> call, Response<ServiceRESTResponse<List<MtbColt>>> response) {
|
||||||
analyzeAnswer(response, "getColliInBasket", mtbColts -> {
|
analyzeAnswer(response, "getColliInBasket", mtbColts -> {
|
||||||
fillMtbAartsOfMtbColts(mtbColts, onComplete, onFailed);
|
fillMtbAartsOfMtbColtsStatic(mtbColts, onComplete, onFailed);
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -661,12 +633,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void creaRettificaCollo(MtbColr sourceMtbColrOriginal, BigDecimal newNumCnf, BigDecimal newQtaTot, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void creaRettificaColloStatic(MtbColr sourceMtbColrOriginal, BigDecimal newNumCnf, BigDecimal newQtaTot, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
MtbColr sourceMtbColr = (MtbColr) sourceMtbColrOriginal.clone();
|
MtbColr sourceMtbColr = (MtbColr) sourceMtbColrOriginal.clone();
|
||||||
sourceMtbColr.setMtbPartitaMag(null);
|
sourceMtbColr.setMtbPartitaMag(null);
|
||||||
sourceMtbColr.setMtbAart(null);
|
sourceMtbColr.setMtbAart(null);
|
||||||
@@ -683,22 +650,48 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
).enqueue(new Callback<ServiceRESTResponse<MtbColr>>() {
|
).enqueue(new Callback<ServiceRESTResponse<MtbColr>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<MtbColr>> call, Response<ServiceRESTResponse<MtbColr>> response) {
|
public void onResponse(Call<ServiceRESTResponse<MtbColr>> call, Response<ServiceRESTResponse<MtbColr>> response) {
|
||||||
analyzeAnswer(response, "creaRettificaCollo", data -> {
|
analyzeAnswer(response, "creaRettificaCollo", onComplete, onFailed);
|
||||||
onComplete.run(data);
|
|
||||||
}, onFailed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<MtbColr>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<MtbColr>> call, Throwable t) {
|
||||||
if(onFailed != null) onFailed.run(new Exception(t));
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
MtbColt mtbColtToMoveClone = (MtbColt) sourceMtbColt.clone();
|
||||||
|
MtbColt mtbColtDestClone = (MtbColt) destMtbColt.clone();
|
||||||
|
|
||||||
|
for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) {
|
||||||
|
mtbColtToMoveClone.getMtbColr().get(i)
|
||||||
|
.setMtbAart(null)
|
||||||
|
.setMtbPartitaMag(null);
|
||||||
|
}
|
||||||
|
|
||||||
public void creaRettificaCollo(MtbColr sourceMtbColrOriginal, BigDecimal newNumCnf, BigDecimal newQtaTot, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
mtbColtDestClone.setMtbColr(null);
|
||||||
creaRettificaColloStatic(sourceMtbColrOriginal, newNumCnf, newQtaTot, onComplete, onFailed);
|
|
||||||
|
SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO = new SpostaArtsTraULRequestDTO()
|
||||||
|
.setSourceMtbColt(mtbColtToMoveClone)
|
||||||
|
.setDestinationMtbColt(mtbColtDestClone);
|
||||||
|
|
||||||
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
|
colliMagazzinoRESTConsumerService.spostaArtsTraUL(
|
||||||
|
spostaArtsTraULRequestDTO
|
||||||
|
).enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
|
analyzeAnswer(response, "spostaArtsTraUL", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||||
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import it.integry.integrywmsnative.core.model.MtbColt;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.http.Body;
|
import retrofit2.http.Body;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
@@ -23,10 +24,19 @@ public interface ColliMagazzinoRESTConsumerService {
|
|||||||
@POST("getColloByBarcode")
|
@POST("getColloByBarcode")
|
||||||
Call<ServiceRESTResponse<MtbColt>> getColloByBarcode(@Query("codBarreCollo") String sscc, @Query("onlyResiduo") boolean onlyResiduo, @Query("throwExcIfNull") boolean throwExcIfNull);
|
Call<ServiceRESTResponse<MtbColt>> getColloByBarcode(@Query("codBarreCollo") String sscc, @Query("onlyResiduo") boolean onlyResiduo, @Query("throwExcIfNull") boolean throwExcIfNull);
|
||||||
|
|
||||||
|
@POST("getColloInGiac")
|
||||||
|
Call<ServiceRESTResponse<MtbColt>> getColloInGiac(@Query("onlyResiduo") boolean onlyResiduo, @Query("throwExcIfNull") boolean throwExcIfNull, @Body MtbColt mtbColt);
|
||||||
|
|
||||||
@GET("getColliInBasket")
|
@GET("getColliInBasket")
|
||||||
Call<ServiceRESTResponse<List<MtbColt>>> getColliInBasket(@Query("codMdep") String codMdep);
|
Call<ServiceRESTResponse<List<MtbColt>>> getColliInBasket(@Query("codMdep") String codMdep);
|
||||||
|
|
||||||
@POST("creaRettificaCollo")
|
@POST("creaRettificaCollo")
|
||||||
Call<ServiceRESTResponse<MtbColr>> creaRettificaCollo(@Query("codMdep") String codMdep, @Body RettificaULDTO rettificaULDTO);
|
Call<ServiceRESTResponse<MtbColr>> creaRettificaCollo(@Query("codMdep") String codMdep, @Body RettificaULDTO rettificaULDTO);
|
||||||
|
|
||||||
|
@POST("wms/spostaULInPosizione")
|
||||||
|
Call<ServiceRESTResponse<Object>> spostaULInPosizione(@Query("codMdep") String codMdep, @Query("posizione") String posizione, @Body MtbColt mtbColtToMove);
|
||||||
|
|
||||||
|
@POST("wms/spostaArtsTraUL")
|
||||||
|
Call<ServiceRESTResponse<Object>> spostaArtsTraUL(@Body SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import retrofit2.http.Query;
|
|||||||
public interface MesRESTConsumerService {
|
public interface MesRESTConsumerService {
|
||||||
|
|
||||||
|
|
||||||
@GET("mes/getOrdiniLavorazioneMateriale")
|
@GET("mes_v2/getOrdiniLavorazioneMateriale")
|
||||||
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazioneMateriale(@Query("codJfas") String codJfas, @Query("idMateriale") String idMateriale);
|
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazioneMateriale(@Query("codJfas") String codJfas, @Query("idMateriale") String idMateriale);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,28 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.orhanobut.logger.Logger;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
||||||
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.GetPickingListDTO;
|
import it.integry.integrywmsnative.core.rest.model.GetPickingListDTO;
|
||||||
import it.integry.integrywmsnative.gest.vendita.dto.OrdineVenditaInevasoDTO;
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
@@ -21,31 +31,10 @@ import retrofit2.Response;
|
|||||||
@Singleton
|
@Singleton
|
||||||
public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
public static void retrieveListaArticoliFromOrdiniUscita(List<OrdineVenditaInevasoDTO> orders, RunnableArgs<List<SitArtOrdDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||||
|
|
||||||
List<GetPickingListDTO> getPickingListDTOs = Stream.of(orders)
|
public OrdiniRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||||
.map(x -> new GetPickingListDTO()
|
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||||
.setData(x.getDataOrdS())
|
|
||||||
.setGestione(x.getGestione())
|
|
||||||
.setNumero(x.getNumOrd())
|
|
||||||
.setDataConsegna(x.getDataConsS())
|
|
||||||
.setIdViaggio(x.getIdViaggio()))
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class, 90);
|
|
||||||
|
|
||||||
service.getArticoliFromOrdini(getPickingListDTOs).enqueue(new Callback<ServiceRESTResponse<List<SitArtOrdDTO>>>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Response<ServiceRESTResponse<List<SitArtOrdDTO>>> response) {
|
|
||||||
analyzeAnswer(response, "retrieveListaArticoliFromOrdiniVendita", onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Throwable t) {
|
|
||||||
UtilityLogger.errorMe(new Exception(t));
|
|
||||||
onFailed.run(new Exception(t));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getSuggestedPickingList(String codMdep, List<SitArtOrdDTO> sitArtOrdList, RunnableArgs<List<PickingObjectDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getSuggestedPickingList(String codMdep, List<SitArtOrdDTO> sitArtOrdList, RunnableArgs<List<PickingObjectDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
@@ -69,4 +58,96 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void getOrdiniInevasi(String codMdep, GestioneEnum gestione, RunnableArgs<List<OrdineUscitaInevasoDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class);
|
||||||
|
|
||||||
|
service.getOrdiniInevasi(codMdep, gestione.getText())
|
||||||
|
.enqueue(new Callback<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> call, Response<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> response) {
|
||||||
|
analyzeAnswer(response, "getOrdiniInevasi", responseDtoList -> {
|
||||||
|
if(responseDtoList == null) responseDtoList = new ArrayList<>();
|
||||||
|
onComplete.run(responseDtoList);
|
||||||
|
}, ex -> {
|
||||||
|
Logger.e(ex, "Errore durante il caricamento degli ordini di lavorazione");
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> call, Throwable t) {
|
||||||
|
Logger.e(t, "Errore durante il caricamento degli ordini di lavorazione");
|
||||||
|
if(onFailed != null) onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void retrieveListaArticoliFromOrdiniUscita(List<OrdineUscitaInevasoDTO> orders, RunnableArgs<List<SitArtOrdDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
List<GetPickingListDTO> getPickingListDTOs = Stream.of(orders)
|
||||||
|
.map(x -> new GetPickingListDTO()
|
||||||
|
.setData(x.getDataOrdS())
|
||||||
|
.setGestione(x.getGestione())
|
||||||
|
.setNumero(x.getNumOrd())
|
||||||
|
.setDataConsegna(x.getDataConsS())
|
||||||
|
.setIdViaggio(x.getIdViaggio()))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class, 90);
|
||||||
|
|
||||||
|
service.getArticoliFromOrdini(getPickingListDTOs).enqueue(new Callback<ServiceRESTResponse<List<SitArtOrdDTO>>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Response<ServiceRESTResponse<List<SitArtOrdDTO>>> response) {
|
||||||
|
analyzeAnswer(response, "retrieveListaArticoliFromOrdiniUscita", onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Throwable t) {
|
||||||
|
UtilityLogger.errorMe(new Exception(t));
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void getBancaliGiaRegistrati(List<OrdineInevasoDTO> orders, GestioneEnum gestione, int segno, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
String whereCondGestione = "";
|
||||||
|
|
||||||
|
if(gestione != null) {
|
||||||
|
whereCondGestione = "mtb_colt.gestione = " + UtilityDB.valueToString(gestione.getText()) + " ";
|
||||||
|
} else {
|
||||||
|
whereCondGestione = "(mtb_colt.gestione = 'V' OR mtb_colt.gestione = 'L') ";
|
||||||
|
}
|
||||||
|
|
||||||
|
String baseSql = "SELECT DISTINCT mtb_colt.* " +
|
||||||
|
"FROM mtb_colt, " +
|
||||||
|
" mtb_colr " +
|
||||||
|
"WHERE mtb_colt.gestione = mtb_colr.gestione " +
|
||||||
|
" AND mtb_colt.ser_collo = mtb_colr.ser_collo " +
|
||||||
|
" AND mtb_colt.data_collo = mtb_colr.data_collo " +
|
||||||
|
" AND mtb_colt.num_collo = mtb_colr.num_collo " +
|
||||||
|
" AND " + whereCondGestione +
|
||||||
|
" AND mtb_colt.segno = " + UtilityDB.valueToString(segno) + " " +
|
||||||
|
" AND mtb_colt.data_doc IS NULL AND ";
|
||||||
|
|
||||||
|
List<HashMap<String, Object>> whereCondMapList = new ArrayList<>();
|
||||||
|
for (OrdineInevasoDTO ordineInevaso : orders) {
|
||||||
|
HashMap<String, Object> whereCondMap = new HashMap<>();
|
||||||
|
whereCondMap.put("mtb_colr.data_ord", ordineInevaso.getDataOrdD());
|
||||||
|
whereCondMap.put("mtb_colr.num_ord", ordineInevaso.getNumOrd());
|
||||||
|
whereCondMap.put("mtb_colr.gestione", ordineInevaso.getGestione());
|
||||||
|
|
||||||
|
whereCondMapList.add(whereCondMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
baseSql += "(" + UtilityQuery.concatFieldListInWhereCond(whereCondMapList) + ")";
|
||||||
|
|
||||||
|
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {}.getType();
|
||||||
|
this.mSystemRESTConsumer.<List<MtbColt>>processSql(baseSql, typeOfObjectsList, value -> {
|
||||||
|
if(onComplete != null) onComplete.run(value);
|
||||||
|
}, ex -> {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,12 @@ import java.util.List;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.GetPickingListDTO;
|
import it.integry.integrywmsnative.core.rest.model.GetPickingListDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.http.Body;
|
import retrofit2.http.Body;
|
||||||
|
import retrofit2.http.GET;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
import retrofit2.http.Query;
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
@@ -18,4 +20,7 @@ public interface OrdiniRESTConsumerService {
|
|||||||
|
|
||||||
@POST("wms/getSuggestedPickingList")
|
@POST("wms/getSuggestedPickingList")
|
||||||
Call<ServiceRESTResponse<List<PickingObjectDTO>>> getSuggestedPickingList(@Query("codMdep") String codMdep, @Body List<SitArtOrdDTO> sitArtOrdDTOList);
|
Call<ServiceRESTResponse<List<PickingObjectDTO>>> getSuggestedPickingList(@Query("codMdep") String codMdep, @Body List<SitArtOrdDTO> sitArtOrdDTOList);
|
||||||
|
|
||||||
|
@GET("SM2GetOrdiniVenditaInevasi")
|
||||||
|
Call<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> getOrdiniInevasi(@Query("codMdep") String codMdep, @Query("gestione") String gestione);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import com.annimon.stream.Stream;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||||
@@ -18,6 +17,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|||||||
import it.integry.integrywmsnative.core.model.DtbOrdt;
|
import it.integry.integrywmsnative.core.model.DtbOrdt;
|
||||||
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.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityThread;
|
import it.integry.integrywmsnative.core.utility.UtilityThread;
|
||||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dto.ArtDTO;
|
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dto.ArtDTO;
|
||||||
@@ -84,7 +84,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ordineDTO.setChiaveGriglia(griglia.getCodAlis());
|
ordineDTO.setChiaveGriglia(griglia.getCodAlis());
|
||||||
ordineDTO.setDataConsD(new Date());
|
ordineDTO.setDataConsD(UtilityDate.getDateInstance());
|
||||||
ordineDTO.setArtRows(artRows);
|
ordineDTO.setArtRows(artRows);
|
||||||
saveDTO.setGestione("O");
|
saveDTO.setGestione("O");
|
||||||
saveDTO.setOrdineDTO(ordineDTO);
|
saveDTO.setOrdineDTO(ordineDTO);
|
||||||
@@ -101,7 +101,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
if (dtoList.size() > 0){
|
if (dtoList.size() > 0){
|
||||||
DtbOrdt dto = dtoList.get(0);
|
DtbOrdt dto = dtoList.get(0);
|
||||||
ordine.setTransmitted(true);
|
ordine.setTransmitted(true);
|
||||||
ordine.setTransmissionDate(new Date());
|
ordine.setTransmissionDate(UtilityDate.getDateInstance());
|
||||||
ordine.setGestione(dto.getGestione());
|
ordine.setGestione(dto.getGestione());
|
||||||
ordine.setDataOrdS(dto.getDataOrd());
|
ordine.setDataOrdS(dto.getDataOrd());
|
||||||
ordine.setCodMdep(dto.getCodMdep());
|
ordine.setCodMdep(dto.getCodMdep());
|
||||||
|
|||||||
@@ -6,22 +6,51 @@ import java.lang.reflect.Type;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import javax.inject.Singleton;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class PosizioniRESTConsumer extends _BaseRESTConsumer{
|
public class PosizioniRESTConsumer extends _BaseRESTConsumer{
|
||||||
|
|
||||||
|
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||||
|
|
||||||
|
public PosizioniRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||||
|
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getPosizioneFromString(String posizione, RunnableArgs<MtbDepoPosizione> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
String sql = "SELECT TOP 1 mtb_depo_posizioni.*," +
|
||||||
|
" CASE WHEN jtb_fasi.cod_jfas IS NULL THEN 'N' ELSE 'S' END AS flag_linea_produzione " +
|
||||||
|
" FROM mtb_depo_posizioni " +
|
||||||
|
" LEFT OUTER JOIN jtb_fasi " +
|
||||||
|
" ON mtb_depo_posizioni.posizione = jtb_fasi.cod_jfas " +
|
||||||
|
" WHERE posizione = " + UtilityDB.valueToString(posizione);
|
||||||
|
|
||||||
|
SystemRESTConsumer.processSqlStatic(sql, MtbDepoPosizione.class, new ISimpleOperationCallback<MtbDepoPosizione>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(MtbDepoPosizione value) {
|
||||||
|
if(onComplete != null) onComplete.run(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public static void getAvailablePosizioni(RunnableArgs<List<MtbDepoPosizione>> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void getAvailablePosizioni(RunnableArgs<List<MtbDepoPosizione>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
// String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||||
|
String codMdep = null;
|
||||||
|
|
||||||
PosizioniRESTConsumerService posizioniRESTConsumerService = RESTBuilder.getService(PosizioniRESTConsumerService.class);
|
PosizioniRESTConsumerService posizioniRESTConsumerService = RESTBuilder.getService(PosizioniRESTConsumerService.class);
|
||||||
posizioniRESTConsumerService.getAvailablePosizioni(codMdep).enqueue(new Callback<ServiceRESTResponse<List<MtbDepoPosizione>>>() {
|
posizioniRESTConsumerService.getAvailablePosizioni(codMdep).enqueue(new Callback<ServiceRESTResponse<List<MtbDepoPosizione>>>() {
|
||||||
@@ -40,11 +69,8 @@ public class PosizioniRESTConsumer extends _BaseRESTConsumer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void getBancaliInPosizione(MtbDepoPosizione mtbDepoPosizione, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
public static void getBancaliInPosizione(MtbDepoPosizione mtbDepoPosizione, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
String sql = "SELECT * FROM mtb_colt WHERE segno > 0 AND cod_mdep = " + UtilityDB.valueToString(mtbDepoPosizione.getCodMdep()) + " AND posizione = " + UtilityDB.valueToString(mtbDepoPosizione.getPosizione());
|
||||||
|
|
||||||
|
|
||||||
String sql = "SELECT * FROM mtb_colt WHERE cod_mdep = " + UtilityDB.valueToString(mtbDepoPosizione.getCodMdep()) + " AND posizione = " + UtilityDB.valueToString(mtbDepoPosizione.getPosizione());
|
|
||||||
|
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {}.getType();
|
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {}.getType();
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
@@ -11,6 +12,8 @@ import javax.inject.Singleton;
|
|||||||
import it.integry.integrywmsnative.BuildConfig;
|
import it.integry.integrywmsnative.BuildConfig;
|
||||||
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.JasperPairDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
@@ -89,7 +92,10 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
printerService.getAvailablePrinters(codMdep, printerTypeStr).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
printerService.getAvailablePrinters(codMdep, printerTypeStr).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
||||||
analyzeAnswer(response, "GetAvailablePrinters", onComplete, onFailed);
|
analyzeAnswer(response, "GetAvailablePrinters", printerList -> {
|
||||||
|
printerList = Stream.of(printerList).filter(x -> !UtilityString.isNullOrEmpty(x)).toList();
|
||||||
|
onComplete.run(printerList);
|
||||||
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -130,7 +136,7 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
analyzeAnswer(response, "PrintCollo", data -> {
|
analyzeAnswer(response, "printCollo", data -> {
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
@@ -142,7 +148,38 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
} else onFailed.run(new Exception(t));
|
} else onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printReport(String printerName, String reportName, HashMap<String, Object> params, int quantity, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
// if(BuildConfig.DEBUG) {
|
||||||
|
// onComplete.run();
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
JasperDTO jasperDTO = new JasperDTO();
|
||||||
|
jasperDTO.setReportName(reportName);
|
||||||
|
|
||||||
|
Stream.of(params)
|
||||||
|
.forEach(x -> jasperDTO.getParams().add(new JasperPairDTO(x.getKey(), x.getValue())));
|
||||||
|
|
||||||
|
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
|
printerService
|
||||||
|
.processPrintReport(printerName, quantity, jasperDTO)
|
||||||
|
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
|
analyzeAnswer(response, "printReport", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||||
|
if(t.getMessage().contains("Printer not found")) {
|
||||||
|
onFailed.run(new NoPrintersFoundException());
|
||||||
|
} else onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,10 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.Body;
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
import retrofit2.http.FormUrlEncoded;
|
import retrofit2.http.FormUrlEncoded;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
@@ -34,4 +36,11 @@ public interface PrinterRESTConsumerService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@POST("processPrintReport")
|
||||||
|
Call<ServiceRESTResponse<Object>> processPrintReport(
|
||||||
|
@Query("printerName") String printerName,
|
||||||
|
@Query("numberOfCopies") int printQuantity,
|
||||||
|
@Body JasperDTO jasperDTO
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.orhanobut.logger.Logger;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@@ -59,14 +60,14 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(Exception ex) {
|
public void onFailed(Exception ex) {
|
||||||
onFailed.run(ex);
|
if(onFailed != null) onFailed.run(ex);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||||
Log.e("ProcessSql", t.toString());
|
Logger.e(t, "ProcessSQL");
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -80,12 +81,8 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> void processSql(String nativeSql, final Type clazz, final ISimpleOperationCallback<T> callback) {
|
public <T> void processSql(String nativeSql, final Type clazz, final RunnableArgs<T> onComplete, final RunnableArgs<Exception> onFailed) {
|
||||||
|
processSqlStatic(nativeSql, clazz, onComplete, onFailed);
|
||||||
processSqlStatic(nativeSql, clazz, data -> {
|
|
||||||
callback.onSuccess((T) data);
|
|
||||||
}, callback::onFailed);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.rest.model;
|
|||||||
public class Ean13PesoModel {
|
public class Ean13PesoModel {
|
||||||
|
|
||||||
private String precode;
|
private String precode;
|
||||||
|
//TODO: Change to bigdecimal
|
||||||
private Float peso;
|
private Float peso;
|
||||||
|
|
||||||
public String getPrecode() {
|
public String getPrecode() {
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class JasperDTO {
|
||||||
|
|
||||||
|
private String reportName;
|
||||||
|
private List<JasperPairDTO> params = new ArrayList<>();
|
||||||
|
|
||||||
|
public String getReportName() {
|
||||||
|
return reportName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JasperDTO setReportName(String reportName) {
|
||||||
|
this.reportName = reportName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<JasperPairDTO> getParams() {
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JasperDTO setParams(List<JasperPairDTO> params) {
|
||||||
|
this.params = params;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model;
|
||||||
|
|
||||||
|
public class JasperPairDTO {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private Object value;
|
||||||
|
|
||||||
|
public JasperPairDTO(String name, Object value) {
|
||||||
|
this.name = name;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JasperPairDTO setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JasperPairDTO setValue(Object value) {
|
||||||
|
this.value = value;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,23 +1,18 @@
|
|||||||
package it.integry.integrywmsnative.gest.vendita.dto;
|
package it.integry.integrywmsnative.core.rest.model;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
|
||||||
public class OrdineVenditaInevasoDTO {
|
public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
||||||
|
|
||||||
private String data;
|
|
||||||
private Integer numero;
|
|
||||||
private Integer idViaggio;
|
private Integer idViaggio;
|
||||||
private String gestione;
|
|
||||||
private String listino;
|
private String listino;
|
||||||
private String termCons;
|
private String termCons;
|
||||||
private String codAuto;
|
private String codAuto;
|
||||||
private String codMdep;
|
|
||||||
private String descrizioneAuto;
|
private String descrizioneAuto;
|
||||||
private String codVvet;
|
private String codVvet;
|
||||||
private String descrizioneVettore;
|
private String descrizioneVettore;
|
||||||
@@ -49,64 +44,25 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
private String nomeAgente;
|
private String nomeAgente;
|
||||||
private String codJfas;
|
private String codJfas;
|
||||||
|
|
||||||
public BindableBoolean selected;
|
|
||||||
|
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO() {
|
|
||||||
this.selected = new BindableBoolean(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public String getDataOrdS() {
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getDataOrdD() {
|
|
||||||
return UtilityDate.recognizeDateWithExceptionHandler(getDataOrdS());
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setData(String data) {
|
|
||||||
this.data = data;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getNumOrd() {
|
|
||||||
return numero;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setNumero(Integer numero) {
|
|
||||||
this.numero = numero;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getIdViaggio() {
|
public Integer getIdViaggio() {
|
||||||
return idViaggio;
|
return idViaggio;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setIdViaggio(Integer idViaggio) {
|
public OrdineUscitaInevasoDTO setIdViaggio(Integer idViaggio) {
|
||||||
this.idViaggio = idViaggio;
|
this.idViaggio = idViaggio;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getGestione() {
|
|
||||||
return gestione;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GestioneEnum getGestioneEnum() {
|
|
||||||
return GestioneEnum.fromString(getGestione());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setGestione(String gestione) {
|
|
||||||
this.gestione = gestione;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getListino() {
|
public String getListino() {
|
||||||
return listino;
|
return listino;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setListino(String listino) {
|
public OrdineUscitaInevasoDTO setListino(String listino) {
|
||||||
this.listino = listino;
|
this.listino = listino;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -115,7 +71,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return termCons;
|
return termCons;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setTermCons(String termCons) {
|
public OrdineUscitaInevasoDTO setTermCons(String termCons) {
|
||||||
this.termCons = termCons;
|
this.termCons = termCons;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -124,25 +80,16 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return codAuto;
|
return codAuto;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setCodAuto(String codAuto) {
|
public OrdineUscitaInevasoDTO setCodAuto(String codAuto) {
|
||||||
this.codAuto = codAuto;
|
this.codAuto = codAuto;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCodMdep() {
|
|
||||||
return codMdep;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setCodMdep(String codMdep) {
|
|
||||||
this.codMdep = codMdep;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescrizioneAuto() {
|
public String getDescrizioneAuto() {
|
||||||
return descrizioneAuto;
|
return descrizioneAuto;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setDescrizioneAuto(String descrizioneAuto) {
|
public OrdineUscitaInevasoDTO setDescrizioneAuto(String descrizioneAuto) {
|
||||||
this.descrizioneAuto = descrizioneAuto;
|
this.descrizioneAuto = descrizioneAuto;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -151,7 +98,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return codVvet;
|
return codVvet;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setCodVvet(String codVvet) {
|
public OrdineUscitaInevasoDTO setCodVvet(String codVvet) {
|
||||||
this.codVvet = codVvet;
|
this.codVvet = codVvet;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -160,7 +107,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return descrizioneVettore;
|
return descrizioneVettore;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setDescrizioneVettore(String descrizioneVettore) {
|
public OrdineUscitaInevasoDTO setDescrizioneVettore(String descrizioneVettore) {
|
||||||
this.descrizioneVettore = descrizioneVettore;
|
this.descrizioneVettore = descrizioneVettore;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -173,7 +120,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return UtilityDate.recognizeDateWithExceptionHandler(getDataInizTraspS());
|
return UtilityDate.recognizeDateWithExceptionHandler(getDataInizTraspS());
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setDataInizTrasp(String dataInizTrasp) {
|
public OrdineUscitaInevasoDTO setDataInizTrasp(String dataInizTrasp) {
|
||||||
this.dataInizTrasp = dataInizTrasp;
|
this.dataInizTrasp = dataInizTrasp;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -182,7 +129,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return descrizionePaga;
|
return descrizionePaga;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setDescrizionePaga(String descrizionePaga) {
|
public OrdineUscitaInevasoDTO setDescrizionePaga(String descrizionePaga) {
|
||||||
this.descrizionePaga = descrizionePaga;
|
this.descrizionePaga = descrizionePaga;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -191,7 +138,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return rifOrd;
|
return rifOrd;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setRifOrd(String rifOrd) {
|
public OrdineUscitaInevasoDTO setRifOrd(String rifOrd) {
|
||||||
this.rifOrd = rifOrd;
|
this.rifOrd = rifOrd;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -200,7 +147,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return codAnagOrd;
|
return codAnagOrd;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setCodAnagOrd(String codAnagOrd) {
|
public OrdineUscitaInevasoDTO setCodAnagOrd(String codAnagOrd) {
|
||||||
this.codAnagOrd = codAnagOrd;
|
this.codAnagOrd = codAnagOrd;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -209,7 +156,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return codJcom;
|
return codJcom;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setCodJcom(String codJcom) {
|
public OrdineUscitaInevasoDTO setCodJcom(String codJcom) {
|
||||||
this.codJcom = codJcom;
|
this.codJcom = codJcom;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -218,7 +165,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return descrizioneCom;
|
return descrizioneCom;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setDescrizioneCom(String descrizioneCom) {
|
public OrdineUscitaInevasoDTO setDescrizioneCom(String descrizioneCom) {
|
||||||
this.descrizioneCom = descrizioneCom;
|
this.descrizioneCom = descrizioneCom;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -227,7 +174,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return ragSocCom;
|
return ragSocCom;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setRagSocCom(String ragSocCom) {
|
public OrdineUscitaInevasoDTO setRagSocCom(String ragSocCom) {
|
||||||
this.ragSocCom = ragSocCom;
|
this.ragSocCom = ragSocCom;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -236,7 +183,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return ragSocOrd;
|
return ragSocOrd;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setRagSocOrd(String ragSocOrd) {
|
public OrdineUscitaInevasoDTO setRagSocOrd(String ragSocOrd) {
|
||||||
this.ragSocOrd = ragSocOrd;
|
this.ragSocOrd = ragSocOrd;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -245,7 +192,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return destinatario;
|
return destinatario;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setDestinatario(String destinatario) {
|
public OrdineUscitaInevasoDTO setDestinatario(String destinatario) {
|
||||||
this.destinatario = destinatario;
|
this.destinatario = destinatario;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -254,7 +201,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return citta;
|
return citta;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setCitta(String citta) {
|
public OrdineUscitaInevasoDTO setCitta(String citta) {
|
||||||
this.citta = citta;
|
this.citta = citta;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -263,7 +210,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return provincia;
|
return provincia;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setProvincia(String provincia) {
|
public OrdineUscitaInevasoDTO setProvincia(String provincia) {
|
||||||
this.provincia = provincia;
|
this.provincia = provincia;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -272,7 +219,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return indirizzo;
|
return indirizzo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setIndirizzo(String indirizzo) {
|
public OrdineUscitaInevasoDTO setIndirizzo(String indirizzo) {
|
||||||
this.indirizzo = indirizzo;
|
this.indirizzo = indirizzo;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -281,7 +228,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return pesoTotale;
|
return pesoTotale;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setPesoTotale(BigDecimal pesoTotale) {
|
public OrdineUscitaInevasoDTO setPesoTotale(BigDecimal pesoTotale) {
|
||||||
this.pesoTotale = pesoTotale;
|
this.pesoTotale = pesoTotale;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -290,7 +237,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return numCnfdaEvadere;
|
return numCnfdaEvadere;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setNumCnfdaEvadere(BigDecimal numCnfdaEvadere) {
|
public OrdineUscitaInevasoDTO setNumCnfdaEvadere(BigDecimal numCnfdaEvadere) {
|
||||||
this.numCnfdaEvadere = numCnfdaEvadere;
|
this.numCnfdaEvadere = numCnfdaEvadere;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -299,7 +246,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return numCnfDisp;
|
return numCnfDisp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setNumCnfDisp(BigDecimal numCnfDisp) {
|
public OrdineUscitaInevasoDTO setNumCnfDisp(BigDecimal numCnfDisp) {
|
||||||
this.numCnfDisp = numCnfDisp;
|
this.numCnfDisp = numCnfDisp;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -312,7 +259,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return UtilityDate.recognizeDateWithExceptionHandler(getDataConsS());
|
return UtilityDate.recognizeDateWithExceptionHandler(getDataConsS());
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setDataCons(String dataCons) {
|
public OrdineUscitaInevasoDTO setDataCons(String dataCons) {
|
||||||
this.dataCons = dataCons;
|
this.dataCons = dataCons;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -321,7 +268,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return barcode;
|
return barcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setBarcode(String barcode) {
|
public OrdineUscitaInevasoDTO setBarcode(String barcode) {
|
||||||
this.barcode = barcode;
|
this.barcode = barcode;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -330,7 +277,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return numRighe;
|
return numRighe;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setNumRighe(Integer numRighe) {
|
public OrdineUscitaInevasoDTO setNumRighe(Integer numRighe) {
|
||||||
this.numRighe = numRighe;
|
this.numRighe = numRighe;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -339,7 +286,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return righeInPartenza;
|
return righeInPartenza;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setRigheInPartenza(Integer righeInPartenza) {
|
public OrdineUscitaInevasoDTO setRigheInPartenza(Integer righeInPartenza) {
|
||||||
this.righeInPartenza = righeInPartenza;
|
this.righeInPartenza = righeInPartenza;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -348,7 +295,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return saldoContabile;
|
return saldoContabile;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setSaldoContabile(BigDecimal saldoContabile) {
|
public OrdineUscitaInevasoDTO setSaldoContabile(BigDecimal saldoContabile) {
|
||||||
this.saldoContabile = saldoContabile;
|
this.saldoContabile = saldoContabile;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -357,7 +304,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return codVzon;
|
return codVzon;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setCodVzon(String codVzon) {
|
public OrdineUscitaInevasoDTO setCodVzon(String codVzon) {
|
||||||
this.codVzon = codVzon;
|
this.codVzon = codVzon;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -366,7 +313,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return ragSocOrdV;
|
return ragSocOrdV;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setRagSocOrdV(String ragSocOrdV) {
|
public OrdineUscitaInevasoDTO setRagSocOrdV(String ragSocOrdV) {
|
||||||
this.ragSocOrdV = ragSocOrdV;
|
this.ragSocOrdV = ragSocOrdV;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -375,7 +322,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return colliRiservati;
|
return colliRiservati;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setColliRiservati(int colliRiservati) {
|
public OrdineUscitaInevasoDTO setColliRiservati(int colliRiservati) {
|
||||||
this.colliRiservati = colliRiservati;
|
this.colliRiservati = colliRiservati;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -384,7 +331,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return existColloBoolean;
|
return existColloBoolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setExistColloBoolean(boolean existColloBoolean) {
|
public OrdineUscitaInevasoDTO setExistColloBoolean(boolean existColloBoolean) {
|
||||||
this.existColloBoolean = existColloBoolean;
|
this.existColloBoolean = existColloBoolean;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -393,7 +340,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return flagEvaso;
|
return flagEvaso;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setFlagEvaso(boolean flagEvaso) {
|
public OrdineUscitaInevasoDTO setFlagEvaso(boolean flagEvaso) {
|
||||||
this.flagEvaso = flagEvaso;
|
this.flagEvaso = flagEvaso;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -402,7 +349,7 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return nomeAgente;
|
return nomeAgente;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setNomeAgente(String nomeAgente) {
|
public OrdineUscitaInevasoDTO setNomeAgente(String nomeAgente) {
|
||||||
this.nomeAgente = nomeAgente;
|
this.nomeAgente = nomeAgente;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -411,36 +358,27 @@ public class OrdineVenditaInevasoDTO {
|
|||||||
return codJfas;
|
return codJfas;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setCodJfas(String codJfas) {
|
public OrdineUscitaInevasoDTO setCodJfas(String codJfas) {
|
||||||
this.codJfas = codJfas;
|
this.codJfas = codJfas;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSelected() {
|
|
||||||
return selected.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrdineVenditaInevasoDTO setSelected(boolean selected) {
|
|
||||||
this.selected.set(selected);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) return true;
|
||||||
if (o == null || getClass() != o.getClass()) return false;
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
|
||||||
OrdineVenditaInevasoDTO that = (OrdineVenditaInevasoDTO) o;
|
OrdineUscitaInevasoDTO that = (OrdineUscitaInevasoDTO) o;
|
||||||
|
|
||||||
if (!data.equals(that.data)) return false;
|
if (!getDataOrdS().equals(that.getDataOrdS())) return false;
|
||||||
if (!numero.equals(that.numero)) return false;
|
if (!getNumOrd().equals(that.getNumOrd())) return false;
|
||||||
return getGestione().equals(that.getGestione());
|
return getGestione().equals(that.getGestione());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int result = data.hashCode();
|
int result = getDataOrdS().hashCode();
|
||||||
result = 31 * result + numero.hashCode();
|
result = 31 * result + getNumOrd().hashCode();
|
||||||
result = 31 * result + getGestione().hashCode();
|
result = 31 * result + getGestione().hashCode();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.model;
|
package it.integry.integrywmsnative.core.rest.model;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class SitArtOrdDTO {
|
public class SitArtOrdDTO {
|
||||||
|
|
||||||
@@ -25,6 +26,8 @@ public class SitArtOrdDTO {
|
|||||||
private String codMsfa;
|
private String codMsfa;
|
||||||
private String descrizioneMsfa;
|
private String descrizioneMsfa;
|
||||||
|
|
||||||
|
private final HashMap<String, Object> extraInfo = new HashMap<>();
|
||||||
|
|
||||||
public String getCodJcom() {
|
public String getCodJcom() {
|
||||||
return codJcom;
|
return codJcom;
|
||||||
}
|
}
|
||||||
@@ -196,4 +199,8 @@ public class SitArtOrdDTO {
|
|||||||
this.descrizioneMsfa = descrizioneMsfa;
|
this.descrizioneMsfa = descrizioneMsfa;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HashMap<String, Object> getExtraInfo() {
|
||||||
|
return extraInfo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
|
||||||
|
public class SpostaArtsTraULRequestDTO {
|
||||||
|
|
||||||
|
|
||||||
|
private MtbColt sourceMtbColt;
|
||||||
|
|
||||||
|
private MtbColt destinationMtbColt;
|
||||||
|
|
||||||
|
public MtbColt getSourceMtbColt() {
|
||||||
|
return sourceMtbColt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SpostaArtsTraULRequestDTO setSourceMtbColt(MtbColt sourceMtbColt) {
|
||||||
|
this.sourceMtbColt = sourceMtbColt;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt getDestinationMtbColt() {
|
||||||
|
return destinationMtbColt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SpostaArtsTraULRequestDTO setDestinationMtbColt(MtbColt destinationMtbColt) {
|
||||||
|
this.destinationMtbColt = destinationMtbColt;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -21,6 +21,7 @@ public class DBSettingsModel {
|
|||||||
private String defaultCausaleRettificaGiacenze;
|
private String defaultCausaleRettificaGiacenze;
|
||||||
private DistribuzioneColloDTO.CriterioDistribuzione defaultCriterioDistribuzione;
|
private DistribuzioneColloDTO.CriterioDistribuzione defaultCriterioDistribuzione;
|
||||||
private boolean flagAskClienteInPickingLibero;
|
private boolean flagAskClienteInPickingLibero;
|
||||||
|
private boolean flagAllowEmptyClienteInPickingLibero;
|
||||||
|
|
||||||
private boolean flagCanAddExtraItemSpedizione;
|
private boolean flagCanAddExtraItemSpedizione;
|
||||||
private boolean flagCanAutoOpenNewULAccettazione;
|
private boolean flagCanAutoOpenNewULAccettazione;
|
||||||
@@ -32,7 +33,10 @@ public class DBSettingsModel {
|
|||||||
private boolean flagForceAllToColli;
|
private boolean flagForceAllToColli;
|
||||||
private boolean flagSpedizioneEnableManualPick;
|
private boolean flagSpedizioneEnableManualPick;
|
||||||
private boolean flagSpedizioneCanSelectMultipleOrders;
|
private boolean flagSpedizioneCanSelectMultipleOrders;
|
||||||
|
private boolean flagSpedizioneUseQtaOrd;
|
||||||
private String produzioneDefaultCodAnag;
|
private String produzioneDefaultCodAnag;
|
||||||
|
private String reportNameSpedizionChiudiOrdine;
|
||||||
|
private int onNumCnfInputChanged = 1;
|
||||||
|
|
||||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||||
return flagSpedizioneEnableFakeGiacenza;
|
return flagSpedizioneEnableFakeGiacenza;
|
||||||
@@ -132,6 +136,15 @@ public class DBSettingsModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFlagAllowEmptyClienteInPickingLibero() {
|
||||||
|
return flagAllowEmptyClienteInPickingLibero;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setFlagAllowEmptyClienteInPickingLibero(boolean flagAllowEmptyClienteInPickingLibero) {
|
||||||
|
this.flagAllowEmptyClienteInPickingLibero = flagAllowEmptyClienteInPickingLibero;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isFlagCanAddExtraItemSpedizione() {
|
public boolean isFlagCanAddExtraItemSpedizione() {
|
||||||
return flagCanAddExtraItemSpedizione;
|
return flagCanAddExtraItemSpedizione;
|
||||||
}
|
}
|
||||||
@@ -223,6 +236,15 @@ public class DBSettingsModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFlagSpedizioneUseQtaOrd() {
|
||||||
|
return flagSpedizioneUseQtaOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setFlagSpedizioneUseQtaOrd(boolean flagSpedizioneUseQtaOrd) {
|
||||||
|
this.flagSpedizioneUseQtaOrd = flagSpedizioneUseQtaOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public String getProduzioneDefaultCodAnag() {
|
public String getProduzioneDefaultCodAnag() {
|
||||||
return produzioneDefaultCodAnag;
|
return produzioneDefaultCodAnag;
|
||||||
}
|
}
|
||||||
@@ -231,4 +253,22 @@ public class DBSettingsModel {
|
|||||||
this.produzioneDefaultCodAnag = produzioneDefaultCodAnag;
|
this.produzioneDefaultCodAnag = produzioneDefaultCodAnag;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getReportNameSpedizionChiudiOrdine() {
|
||||||
|
return reportNameSpedizionChiudiOrdine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setReportNameSpedizionChiudiOrdine(String reportNameSpedizionChiudiOrdine) {
|
||||||
|
this.reportNameSpedizionChiudiOrdine = reportNameSpedizionChiudiOrdine;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getOnNumCnfInputChanged() {
|
||||||
|
return onNumCnfInputChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setOnNumCnfInputChanged(int onNumCnfInputChanged) {
|
||||||
|
this.onNumCnfInputChanged = onNumCnfInputChanged;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,6 +202,10 @@ public class SettingsManager {
|
|||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("PICKING_LIBERO")
|
.setSection("PICKING_LIBERO")
|
||||||
.setKeySection("FLAG_ASK_CLIENTE"));
|
.setKeySection("FLAG_ASK_CLIENTE"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PICKING")
|
||||||
|
.setSection("PICKING_LIBERO")
|
||||||
|
.setKeySection("FLAG_ALLOW_EMPTY_CLIENTE"));
|
||||||
stbGestSetupList.add(new StbGestSetup()
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("SPEDIZIONE")
|
.setSection("SPEDIZIONE")
|
||||||
@@ -250,6 +254,18 @@ public class SettingsManager {
|
|||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("SPEDIZIONE")
|
.setSection("SPEDIZIONE")
|
||||||
.setKeySection("FLAG_CAN_SELECT_MULTIPLE_ORDERS"));
|
.setKeySection("FLAG_CAN_SELECT_MULTIPLE_ORDERS"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PICKING")
|
||||||
|
.setSection("SPEDIZIONE")
|
||||||
|
.setKeySection("REPORT_PACKING_LIST"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PICKING")
|
||||||
|
.setSection("SPEDIZIONE")
|
||||||
|
.setKeySection("FLAG_USE_QTA_ORD"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PICKING")
|
||||||
|
.setSection("SETUP")
|
||||||
|
.setKeySection("ON_NUM_CNF_INPUT_CHANGED"));
|
||||||
|
|
||||||
|
|
||||||
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
|
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
|
||||||
@@ -259,6 +275,7 @@ public class SettingsManager {
|
|||||||
dbSettingsModelIstance.setDefaultCodAnag(getValueFromList(list, "SETUP","COD_ANAG_DEFAULT", String.class));
|
dbSettingsModelIstance.setDefaultCodAnag(getValueFromList(list, "SETUP","COD_ANAG_DEFAULT", String.class));
|
||||||
dbSettingsModelIstance.setDefaultCriterioDistribuzione(getValueFromList(list, "SETUP","DEFAULT_CRITERIO_DISTRIBUZIONE", String.class));
|
dbSettingsModelIstance.setDefaultCriterioDistribuzione(getValueFromList(list, "SETUP","DEFAULT_CRITERIO_DISTRIBUZIONE", String.class));
|
||||||
dbSettingsModelIstance.setFlagAskClienteInPickingLibero(getValueFromList(list, "PICKING_LIBERO", "FLAG_ASK_CLIENTE", Boolean.class));
|
dbSettingsModelIstance.setFlagAskClienteInPickingLibero(getValueFromList(list, "PICKING_LIBERO", "FLAG_ASK_CLIENTE", Boolean.class));
|
||||||
|
dbSettingsModelIstance.setFlagAllowEmptyClienteInPickingLibero(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_CLIENTE", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagCanAddExtraItemSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_ADD_EXTRA_ITEMS", Boolean.class));
|
dbSettingsModelIstance.setFlagCanAddExtraItemSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_ADD_EXTRA_ITEMS", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagCanAutoOpenNewULAccettazione(getValueFromList(list, "ACCETTAZIONE", "FLAG_AUTO_OPEN_NEW_UL", Boolean.class));
|
dbSettingsModelIstance.setFlagCanAutoOpenNewULAccettazione(getValueFromList(list, "ACCETTAZIONE", "FLAG_AUTO_OPEN_NEW_UL", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagCanAddExtraQuantitySpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_ADD_EXTRA_QUANTITY", Boolean.class));
|
dbSettingsModelIstance.setFlagCanAddExtraQuantitySpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_ADD_EXTRA_QUANTITY", Boolean.class));
|
||||||
@@ -271,6 +288,13 @@ public class SettingsManager {
|
|||||||
dbSettingsModelIstance.setFlagSpedizioneEnableManualPick(getValueFromList(list, "SPEDIZIONE", "ENABLE_MANUAL_PICK", Boolean.class));
|
dbSettingsModelIstance.setFlagSpedizioneEnableManualPick(getValueFromList(list, "SPEDIZIONE", "ENABLE_MANUAL_PICK", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagSpedizioneEnableFakeGiacenza(getValueFromList(list, "SPEDIZIONE", "ENABLE_FAKE_GIACENZA", Boolean.class));
|
dbSettingsModelIstance.setFlagSpedizioneEnableFakeGiacenza(getValueFromList(list, "SPEDIZIONE", "ENABLE_FAKE_GIACENZA", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagSpedizioneCanSelectMultipleOrders(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_SELECT_MULTIPLE_ORDERS", Boolean.class));
|
dbSettingsModelIstance.setFlagSpedizioneCanSelectMultipleOrders(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_SELECT_MULTIPLE_ORDERS", Boolean.class));
|
||||||
|
dbSettingsModelIstance.setReportNameSpedizionChiudiOrdine(getValueFromList(list, "SPEDIZIONE", "REPORT_PACKING_LIST", String.class));
|
||||||
|
dbSettingsModelIstance.setFlagSpedizioneUseQtaOrd(getValueFromList(list, "SPEDIZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
||||||
|
|
||||||
|
Integer onNumCnfInputChanged = getValueFromList(list, "SETUP", "ON_NUM_CNF_INPUT_CHANGED", Integer.class);
|
||||||
|
if(onNumCnfInputChanged != null) {
|
||||||
|
dbSettingsModelIstance.setOnNumCnfInputChanged(onNumCnfInputChanged);
|
||||||
|
}
|
||||||
|
|
||||||
if(onComplete != null) onComplete.run();
|
if(onComplete != null) onComplete.run();
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
@@ -288,6 +312,8 @@ public class SettingsManager {
|
|||||||
return clazz.cast(value.getValue());
|
return clazz.cast(value.getValue());
|
||||||
} else if(clazz == Boolean.class) {
|
} else if(clazz == Boolean.class) {
|
||||||
return clazz.cast("S".equalsIgnoreCase(value.getValue()));
|
return clazz.cast("S".equalsIgnoreCase(value.getValue()));
|
||||||
|
} else if(clazz == Integer.class && value.getValue() != null) {
|
||||||
|
return clazz.cast(Integer.parseInt(value.getValue()));
|
||||||
} else return null;
|
} else return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,17 +27,17 @@ public class UpdatesManager {
|
|||||||
public static void init(Activity context) {
|
public static void init(Activity context) {
|
||||||
String suffix;
|
String suffix;
|
||||||
ICustomConfiguration customConfiguration = ClassRouter.getInstance(ClassRouter.PATH.CUSTOM_CONFIGURATION);
|
ICustomConfiguration customConfiguration = ClassRouter.getInstance(ClassRouter.PATH.CUSTOM_CONFIGURATION);
|
||||||
try{
|
try {
|
||||||
suffix = customConfiguration.getConfig(BaseCustomConfiguration.Keys.CUSTOM_DYNAMIC_VERSION_PATH);
|
suffix = customConfiguration.getConfig(BaseCustomConfiguration.Keys.CUSTOM_DYNAMIC_VERSION_PATH);
|
||||||
if (suffix == null){
|
if (suffix == null) {
|
||||||
suffix = "";
|
suffix = "";
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
suffix = "";
|
suffix = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
String currentVersionUrl = "http://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/currentVersion";
|
String currentVersionUrl = "http://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/currentVersion";
|
||||||
String currentDownloadUrl = "http://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/android-release"+suffix+"_v2.apk";
|
String currentDownloadUrl = "http://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/android-release" + suffix + ".apk";
|
||||||
|
|
||||||
|
|
||||||
AppUpdater appUpdater = new AppUpdater(context)
|
AppUpdater appUpdater = new AppUpdater(context)
|
||||||
|
|||||||
@@ -33,19 +33,24 @@ public class UtilityBarcode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isEtichettaPosizione(BarcodeScanDTO barcodeScanDTO) {
|
public static boolean isEtichettaPosizione(BarcodeScanDTO barcodeScanDTO) {
|
||||||
|
return isEtichettaPosizione(barcodeScanDTO, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isEtichettaPosizione(BarcodeScanDTO barcodeScanDTO, boolean enableCheckCodMdep) {
|
||||||
|
String currentCodMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||||
|
|
||||||
String barcode = barcodeScanDTO.getStringValue();
|
String barcode = barcodeScanDTO.getStringValue();
|
||||||
boolean isPosizione = false;
|
boolean isPosizione = false;
|
||||||
|
|
||||||
if(SettingsManager.iDB().getAvailablePosizioni() != null) {
|
if(SettingsManager.iDB().getAvailablePosizioni() != null) {
|
||||||
Stream<MtbDepoPosizione> tmpStream = Stream.of(SettingsManager.iDB().getAvailablePosizioni())
|
Stream<MtbDepoPosizione> tmpStream = Stream.of(SettingsManager.iDB().getAvailablePosizioni())
|
||||||
.filter(x -> x.getPosizione().equalsIgnoreCase(barcode));
|
.filter(x -> x.getPosizione().equalsIgnoreCase(barcode) && (!enableCheckCodMdep || currentCodMdep.equalsIgnoreCase(x.getCodMdep())));
|
||||||
|
|
||||||
if(tmpStream.count() > 0){
|
if(tmpStream.count() > 0){
|
||||||
isPosizione = true;
|
isPosizione = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return isPosizione;
|
return isPosizione;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.utility;
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
|
||||||
public class UtilityBigDecimal {
|
public class UtilityBigDecimal {
|
||||||
|
|
||||||
@@ -26,6 +27,14 @@ public class UtilityBigDecimal {
|
|||||||
return input.compareTo(toCompareWith) < 0;
|
return input.compareTo(toCompareWith) < 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean equalsOrLowerThan(BigDecimal input, BigDecimal toCompareWith) {
|
||||||
|
return equalsTo(input, toCompareWith) || lowerThan(input, toCompareWith);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean equalsOrGreaterThan(BigDecimal input, BigDecimal toCompareWith) {
|
||||||
|
return equalsTo(input, toCompareWith) || greaterThan(input, toCompareWith);
|
||||||
|
}
|
||||||
|
|
||||||
public static BigDecimal getLowerBetween(BigDecimal input1, BigDecimal input2) {
|
public static BigDecimal getLowerBetween(BigDecimal input1, BigDecimal input2) {
|
||||||
if(input1 == null) return input2;
|
if(input1 == null) return input2;
|
||||||
if(input2 == null) return input1;
|
if(input2 == null) return input1;
|
||||||
@@ -42,23 +51,28 @@ public class UtilityBigDecimal {
|
|||||||
|
|
||||||
|
|
||||||
public static BigDecimal divide(BigDecimal input1, BigDecimal divisor) {
|
public static BigDecimal divide(BigDecimal input1, BigDecimal divisor) {
|
||||||
if(divisor == null || equalsTo(divisor, BigDecimal.ZERO)) return null;
|
return divide(input1, divisor, RoundingMode.HALF_EVEN);
|
||||||
|
}
|
||||||
|
|
||||||
return input1.divide(divisor, 3, BigDecimal.ROUND_HALF_EVEN);
|
public static BigDecimal divide(BigDecimal input1, BigDecimal divisor, RoundingMode roundingMode) {
|
||||||
|
if(divisor == null || equalsTo(divisor, BigDecimal.ZERO)) return null;
|
||||||
|
return input1.divide(divisor, 3, roundingMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static BigDecimal divideToInteger(BigDecimal input1, BigDecimal divisor) {
|
public static BigDecimal divideToInteger(BigDecimal input1, BigDecimal divisor) {
|
||||||
if(divisor == null || equalsTo(divisor, BigDecimal.ZERO)) return null;
|
if(divisor == null || equalsTo(divisor, BigDecimal.ZERO)) return null;
|
||||||
|
|
||||||
return new BigDecimal(input1.divide(divisor,3, BigDecimal.ROUND_HALF_EVEN).intValue());
|
return new BigDecimal(input1.divide(divisor,3, BigDecimal.ROUND_HALF_EVEN).intValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static BigDecimal divideAndRoundToInteger(BigDecimal input1, BigDecimal divisor) {
|
public static BigDecimal divideAndRoundToInteger(BigDecimal input1, BigDecimal divisor) {
|
||||||
if(divisor == null || equalsTo(divisor, BigDecimal.ZERO)) return null;
|
return divideAndRoundToInteger(input1, divisor, RoundingMode.HALF_EVEN);
|
||||||
|
}
|
||||||
|
|
||||||
return new BigDecimal(input1.divide(divisor,0, BigDecimal.ROUND_HALF_EVEN).intValue());
|
public static BigDecimal divideAndRoundToInteger(BigDecimal input1, BigDecimal divisor, RoundingMode roundingMode) {
|
||||||
|
if(divisor == null || equalsTo(divisor, BigDecimal.ZERO)) return null;
|
||||||
|
return new BigDecimal(input1.divide(divisor,0, roundingMode).intValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BigDecimal multiply(BigDecimal input1, BigDecimal multiplier) {
|
public static BigDecimal multiply(BigDecimal input1, BigDecimal multiplier) {
|
||||||
|
|||||||
@@ -2,17 +2,28 @@ package it.integry.integrywmsnative.core.utility;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
public class UtilityContext {
|
public class UtilityContext {
|
||||||
|
|
||||||
private static Context mApplicationContext;
|
private static Context mApplicationContext;
|
||||||
|
private static AppCompatActivity mMainActivity;
|
||||||
|
|
||||||
public static void initApplicationContext(Context context) {
|
public static void initApplicationContext(Context context) {
|
||||||
mApplicationContext = context;
|
mApplicationContext = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void initMainActivity(AppCompatActivity mainActivity) {
|
||||||
|
mMainActivity = mainActivity;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Context getApplicationContext() {
|
public static Context getApplicationContext() {
|
||||||
return mApplicationContext;
|
return mApplicationContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static AppCompatActivity getMainActivity() {
|
||||||
|
return mMainActivity;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,15 @@ import android.app.Dialog;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
|
||||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||||
import com.orhanobut.logger.Logger;
|
import com.orhanobut.logger.Logger;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.BuildConfig;
|
import it.integry.integrywmsnative.BuildConfig;
|
||||||
import it.integry.integrywmsnative.core.rest.CommonRESTException;
|
import it.integry.integrywmsnative.core.rest.CommonRESTException;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
public class UtilityExceptions {
|
public class UtilityExceptions {
|
||||||
|
|
||||||
@@ -43,8 +46,17 @@ public class UtilityExceptions {
|
|||||||
if(ex.getCause() != null) errorMessage += "<br />" + ex.getCause().getMessage();
|
if(ex.getCause() != null) errorMessage += "<br />" + ex.getCause().getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(context != null) {
|
FragmentManager fm = null;
|
||||||
DialogSimpleMessageHelper.makeErrorDialog(context, new SpannableString(errorMessage), null, null).show();
|
|
||||||
|
if(context != null && context instanceof FragmentActivity) {
|
||||||
|
fm = ((FragmentActivity) context).getSupportFragmentManager();
|
||||||
|
} else if(UtilityContext.getMainActivity() != null) {
|
||||||
|
fm = UtilityContext.getMainActivity().getSupportFragmentManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(fm != null) {
|
||||||
|
DialogSimpleMessageView.makeErrorDialog(new SpannableString(errorMessage), null, null)
|
||||||
|
.show(fm, "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!BuildConfig.DEBUG) {
|
if(!BuildConfig.DEBUG) {
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
package it.integry.integrywmsnative.core.utility;
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.ProgressDialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.widget.ProgressBar;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogProgress;
|
import it.integry.integrywmsnative.view.dialogs.DialogProgress;
|
||||||
|
|
||||||
public class UtilityProgress {
|
public class UtilityProgress {
|
||||||
@@ -26,27 +23,4 @@ public class UtilityProgress {
|
|||||||
return progress;
|
return progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Thread makeProgressBarIndeterminate(ProgressBar progressBar) {
|
|
||||||
progressBar.setMax(100);
|
|
||||||
|
|
||||||
Thread updateProgressThread = new Thread(() -> {
|
|
||||||
|
|
||||||
try {
|
|
||||||
while (true) {
|
|
||||||
for (int i = 0; i < 100; i++) {
|
|
||||||
progressBar.setProgress(i);
|
|
||||||
Thread.sleep(10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
// String message = ex.toString();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
updateProgressThread.start();
|
|
||||||
|
|
||||||
return updateProgressThread;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.lang.reflect.Modifier;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class UtilityReflections {
|
||||||
|
|
||||||
|
|
||||||
|
public static void copy(Object from, Object to) throws Exception {
|
||||||
|
UtilityReflections.copy(from, to, Object.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void copy(Object from, Object to, Class depth) throws Exception {
|
||||||
|
Class fromClass = from.getClass();
|
||||||
|
Class toClass = to.getClass();
|
||||||
|
List<Field> fromFields = collectFields(fromClass, depth);
|
||||||
|
List<Field> toFields = collectFields(toClass, depth);
|
||||||
|
Field target;
|
||||||
|
for (Field source : fromFields) {
|
||||||
|
if ((target = findAndRemove(source, toFields)) != null) {
|
||||||
|
source.setAccessible(true);
|
||||||
|
target.setAccessible(true);
|
||||||
|
target.set(to, source.get(from));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<Field> collectFields(Class c, Class depth) {
|
||||||
|
List<Field> accessibleFields = new ArrayList<>();
|
||||||
|
do {
|
||||||
|
int modifiers;
|
||||||
|
for (Field field : c.getDeclaredFields()) {
|
||||||
|
modifiers = field.getModifiers();
|
||||||
|
if (!Modifier.isStatic(modifiers)/* && Modifier.isPublic(modifiers)*/) {
|
||||||
|
accessibleFields.add(field);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
c = c.getSuperclass();
|
||||||
|
} while (c != null && c != depth);
|
||||||
|
return accessibleFields;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Field findAndRemove(Field field, List<Field> fields) {
|
||||||
|
Field actual;
|
||||||
|
for (Iterator<Field> i = fields.iterator(); i.hasNext();) {
|
||||||
|
actual = i.next();
|
||||||
|
if (field.getName().equals(actual.getName())
|
||||||
|
&& field.getType().equals(actual.getType())) {
|
||||||
|
i.remove();
|
||||||
|
return actual;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,10 +6,16 @@ import it.integry.integrywmsnative.core.settings.SettingsManager;
|
|||||||
public class UtilitySettings {
|
public class UtilitySettings {
|
||||||
|
|
||||||
|
|
||||||
public static void logout(AppDatabase appDatabase){
|
private static AppDatabase mAppDatabase;
|
||||||
|
|
||||||
|
public static void init(AppDatabase appDatabase) {
|
||||||
|
mAppDatabase = appDatabase;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void logout(){
|
||||||
SettingsManager.i().setUser(null);
|
SettingsManager.i().setUser(null);
|
||||||
SettingsManager.i().setUserSession(null);
|
SettingsManager.i().setUserSession(null);
|
||||||
UtilityThread.executeParallel(appDatabase::clearAllTables);
|
UtilityThread.executeParallel(mAppDatabase::clearAllTables);
|
||||||
SettingsManager.update();
|
SettingsManager.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,11 +68,11 @@ public class UtilityString {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Spanned formatHtmlString(String format, String... params){
|
public static Spanned formatHtmlString(String format, String... params){
|
||||||
return Html.fromHtml(String.format(format,params));
|
return Html.fromHtml(String.format(format, (Object[]) params));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Spanned formatHtmlStringFromResId(@StringRes int stringId, String... params){
|
public static Spanned formatHtmlStringFromResId(@StringRes int stringId, String... params){
|
||||||
return Html.fromHtml(String.format(UtilityResources.getString(stringId),params));
|
return Html.fromHtml(String.format(UtilityResources.getString(stringId), (Object[]) params));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class WiFiStatusChecker {
|
|||||||
};
|
};
|
||||||
|
|
||||||
public WiFiStatusChecker(Context context){
|
public WiFiStatusChecker(Context context){
|
||||||
mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
|
mWifiManager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startMonitoring(RunnableArgs<SIGNAL> callback){
|
public void startMonitoring(RunnableArgs<SIGNAL> callback){
|
||||||
|
|||||||
@@ -41,11 +41,11 @@ import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
|||||||
import it.integry.integrywmsnative.gest.accettazione.rest.OrdiniAccettazioneRESTConsumer;
|
import it.integry.integrywmsnative.gest.accettazione.rest.OrdiniAccettazioneRESTConsumer;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingActivity;
|
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingActivity;
|
||||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
public class MainAccettazioneFragment extends Fragment implements ISearcableFragment, ITitledFragment, IScrollableFragment {
|
public class MainAccettazioneFragment extends Fragment implements ISearcableFragment, ITitledFragment, IScrollableFragment {
|
||||||
|
|
||||||
private Runnable mOnPreDestroy;
|
private final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||||
private ElevatedToolbar mToolbar;
|
private ElevatedToolbar mToolbar;
|
||||||
|
|
||||||
private FragmentMainAccettazioneBinding mBinding;
|
private FragmentMainAccettazioneBinding mBinding;
|
||||||
@@ -54,7 +54,7 @@ public class MainAccettazioneFragment extends Fragment implements ISearcableFrag
|
|||||||
private MainListAccettazioneAdapter mAdapter;
|
private MainListAccettazioneAdapter mAdapter;
|
||||||
|
|
||||||
private List<OrdineAccettazioneInevasoDTO> mOriginalOrderList;
|
private List<OrdineAccettazioneInevasoDTO> mOriginalOrderList;
|
||||||
private List<OrdineAccettazioneInevasoDTO> mRenderedOrderList = new ArrayList<>();
|
private final List<OrdineAccettazioneInevasoDTO> mRenderedOrderList = new ArrayList<>();
|
||||||
|
|
||||||
private AppCompatTextView mAppBarTitle;
|
private AppCompatTextView mAppBarTitle;
|
||||||
|
|
||||||
@@ -81,20 +81,14 @@ public class MainAccettazioneFragment extends Fragment implements ISearcableFrag
|
|||||||
mAppBarTitle.setText(context.getText(R.string.accettazione_title_fragment).toString());
|
mAppBarTitle.setText(context.getText(R.string.accettazione_title_fragment).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
|
|
||||||
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
|
|
||||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_main_accettazione, container, false);
|
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_main_accettazione, container, false);
|
||||||
|
|
||||||
|
init();
|
||||||
|
|
||||||
mBinding.setView(this);
|
mBinding.setView(this);
|
||||||
mBinding.accettazioneMainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
mBinding.accettazioneMainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
mBinding.accettazioneMainFab.hide();
|
mBinding.accettazioneMainFab.hide();
|
||||||
@@ -110,7 +104,9 @@ public class MainAccettazioneFragment extends Fragment implements ISearcableFrag
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
if(mOnPreDestroy != null) mOnPreDestroy.run();
|
for (Runnable onPreDestroy : mOnPreDestroyList) {
|
||||||
|
onPreDestroy.run();
|
||||||
|
}
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,7 +149,7 @@ public class MainAccettazioneFragment extends Fragment implements ISearcableFrag
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
private RunnableArgs<OrdineAccettazioneInevasoDTO> onSingleSelectionChanged = dto -> {
|
private final RunnableArgs<OrdineAccettazioneInevasoDTO> onSingleSelectionChanged = dto -> {
|
||||||
List<OrdineAccettazioneInevasoDTO> selectedOrders = mHelper.getSelectedOrders(mOriginalOrderList);
|
List<OrdineAccettazioneInevasoDTO> selectedOrders = mHelper.getSelectedOrders(mOriginalOrderList);
|
||||||
|
|
||||||
if(dto.isSelected()) {
|
if(dto.isSelected()) {
|
||||||
@@ -191,8 +187,7 @@ public class MainAccettazioneFragment extends Fragment implements ISearcableFrag
|
|||||||
.count();
|
.count();
|
||||||
|
|
||||||
|
|
||||||
DialogSimpleMessageHelper.makeInfoDialog(getActivity(),
|
DialogSimpleMessageView.makeInfoDialog(getText(R.string.orders).toString(),
|
||||||
getText(R.string.orders).toString(),
|
|
||||||
Html.fromHtml(String.format(getActivity().getResources().getQuantityString(R.plurals.loaded_orders_message, (int) ordsCounter), ordsCounter)
|
Html.fromHtml(String.format(getActivity().getResources().getQuantityString(R.plurals.loaded_orders_message, (int) ordsCounter), ordsCounter)
|
||||||
+ "<br /><br />" +
|
+ "<br /><br />" +
|
||||||
"<b>" + artsCounter + "</b> " + getActivity().getResources().getQuantityString(R.plurals.available_articles, (int) artsCounter)),
|
"<b>" + artsCounter + "</b> " + getActivity().getResources().getQuantityString(R.plurals.available_articles, (int) artsCounter)),
|
||||||
@@ -207,14 +202,17 @@ public class MainAccettazioneFragment extends Fragment implements ISearcableFrag
|
|||||||
myIntent.putExtra("keySitArts", cacheSitArtItemID);
|
myIntent.putExtra("keySitArts", cacheSitArtItemID);
|
||||||
getActivity().startActivity(myIntent);
|
getActivity().startActivity(myIntent);
|
||||||
|
|
||||||
}).show();
|
}).show(getActivity().getSupportFragmentManager(), "tag");
|
||||||
|
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
|
|
||||||
String errorMessage = CommonRESTException.tryRecognizeThenGetMessage(ex);
|
String errorMessage = CommonRESTException.tryRecognizeThenGetMessage(ex);
|
||||||
if(errorMessage == null) errorMessage = ex.getMessage() + "\n" + ex.getCause().getCause().getMessage();
|
if(errorMessage == null) errorMessage = ex.getMessage() + "\n" + ex.getCause().getCause().getMessage();
|
||||||
DialogSimpleMessageHelper.makeErrorDialog(getActivity(), new SpannableString(errorMessage), null, null).show();
|
|
||||||
|
DialogSimpleMessageView
|
||||||
|
.makeErrorDialog(new SpannableString(errorMessage), null, null)
|
||||||
|
.show(getActivity().getSupportFragmentManager(), "tag");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -248,8 +246,9 @@ public class MainAccettazioneFragment extends Fragment implements ISearcableFrag
|
|||||||
mToolbar = toolbar;
|
mToolbar = toolbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOnPreDestroy(Runnable onPreDestroy) {
|
public void addOnPreDestroy(Runnable onPreDestroy) {
|
||||||
mOnPreDestroy = onPreDestroy;
|
this.mOnPreDestroyList.add(onPreDestroy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.gest.accettazione_picking;
|
package it.integry.integrywmsnative.gest.accettazione_picking;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
@@ -10,6 +11,7 @@ import android.view.MenuItem;
|
|||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
import androidx.preference.PreferenceManager;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
@@ -42,6 +44,7 @@ import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
|||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
||||||
import it.integry.integrywmsnative.databinding.ActivityAccettazioneOrdineInevasoBinding;
|
import it.integry.integrywmsnative.databinding.ActivityAccettazioneOrdineInevasoBinding;
|
||||||
@@ -51,13 +54,14 @@ import it.integry.integrywmsnative.gest.accettazione_picking.core.AccettazioneLi
|
|||||||
import it.integry.integrywmsnative.gest.accettazione_picking.core.AccettazioneListModel;
|
import it.integry.integrywmsnative.gest.accettazione_picking.core.AccettazioneListModel;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.AccettazioneOrdineInevasoOrderBy;
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.AccettazioneOrdineInevasoOrderBy;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.rest.RecoverMtbColt;
|
||||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliActivity;
|
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliActivity;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView;
|
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView;
|
||||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||||
import it.integry.integrywmsnative.view.dialogs.note_aggiuntive_lu.NoteAggiuntiveLUDialog;
|
import it.integry.integrywmsnative.view.dialogs.note_aggiuntive_lu.NoteAggiuntiveLUDialog;
|
||||||
|
|
||||||
@@ -70,7 +74,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
||||||
|
|
||||||
private ObservableArrayList<AccettazioneListModel> mAccettazioneMutableData = new ObservableArrayList<>();
|
private final ObservableArrayList<AccettazioneListModel> mAccettazioneMutableData = new ObservableArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
public BindableBoolean noItemsToPick = new BindableBoolean(false);
|
public BindableBoolean noItemsToPick = new BindableBoolean(false);
|
||||||
@@ -87,6 +91,8 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
private final int PICK_UL_REQUEST = 1;
|
private final int PICK_UL_REQUEST = 1;
|
||||||
|
|
||||||
|
private boolean mShowSecondaryUntMis = true;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -113,11 +119,13 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
setSupportActionBar(this.mBindings.toolbar);
|
setSupportActionBar(this.mBindings.toolbar);
|
||||||
|
|
||||||
|
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
mShowSecondaryUntMis = sharedPreferences.getBoolean("picking_ingresso_enable_sec_unt_mis", true);
|
||||||
|
|
||||||
this.initVars();
|
this.initVars();
|
||||||
this.initBarcodeReader();
|
this.initBarcodeReader();
|
||||||
this.initRecyclerView();
|
this.initRecyclerView();
|
||||||
|
|
||||||
|
|
||||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||||
|
|
||||||
mViewModel.setListeners(this);
|
mViewModel.setListeners(this);
|
||||||
@@ -178,14 +186,14 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initRecyclerView() {
|
private void initRecyclerView() {
|
||||||
|
AccettazioneListAdapter accettazioneListAdapter = new AccettazioneListAdapter(this, mAccettazioneMutableData, mShowSecondaryUntMis);
|
||||||
|
this.mBindings.accettazionePickingList.setAdapter(accettazioneListAdapter);
|
||||||
|
this.mBindings.accettazionePickingList.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
|
||||||
this.mViewModel.getPickingList().observe(this, updatedData -> {
|
this.mViewModel.getPickingList().observe(this, updatedData -> {
|
||||||
refreshList();
|
refreshList();
|
||||||
});
|
});
|
||||||
|
|
||||||
AccettazioneListAdapter accettazioneListAdapter = new AccettazioneListAdapter(this, mAccettazioneMutableData);
|
|
||||||
this.mBindings.accettazionePickingList.setAdapter(accettazioneListAdapter);
|
|
||||||
this.mBindings.accettazionePickingList.setLayoutManager(new LinearLayoutManager(this));
|
|
||||||
|
|
||||||
accettazioneListAdapter.setOnItemClicked(clickedItem -> {
|
accettazioneListAdapter.setOnItemClicked(clickedItem -> {
|
||||||
this.mViewModel.dispatchOrdineRow(clickedItem);
|
this.mViewModel.dispatchOrdineRow(clickedItem);
|
||||||
});
|
});
|
||||||
@@ -234,19 +242,44 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
accettazioneListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
accettazioneListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
||||||
|
|
||||||
|
//Calc Num CNF
|
||||||
|
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||||
|
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||||
|
.map(MtbColr::getNumCnf)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Calc qta col
|
||||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
if(x.getWithdrawMtbColrs().size() > 0) {
|
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||||
qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||||
.map(MtbColr::getQtaCol)
|
.map(MtbColr::getQtaCol)
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
}
|
}
|
||||||
|
|
||||||
accettazioneListModel.setQtaEvasa(qtaEvasa);
|
|
||||||
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
|
||||||
|
|
||||||
if (x.getMtbAart() != null)
|
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||||
accettazioneListModel.setUntMis(x.getMtbAart().getUntMis());
|
accettazioneListModel.setQtaEvasa(numCnfEvasa);
|
||||||
|
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||||
|
accettazioneListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||||
|
|
||||||
|
accettazioneListModel.setSecQtaEvasa(qtaEvasa);
|
||||||
|
accettazioneListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||||
|
if (x.getMtbAart() != null)
|
||||||
|
accettazioneListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||||
|
} else {
|
||||||
|
accettazioneListModel.setQtaEvasa(qtaEvasa);
|
||||||
|
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||||
|
if (x.getMtbAart() != null)
|
||||||
|
accettazioneListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||||
|
|
||||||
|
accettazioneListModel.setSecQtaEvasa(numCnfEvasa);
|
||||||
|
accettazioneListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||||
|
accettazioneListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||||
|
}
|
||||||
|
|
||||||
accettazioneListModel.setOriginalModel(x);
|
accettazioneListModel.setOriginalModel(x);
|
||||||
|
|
||||||
@@ -271,19 +304,44 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
accettazioneListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
accettazioneListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
||||||
|
|
||||||
|
//Calc Num CNF
|
||||||
|
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||||
|
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||||
|
.map(MtbColr::getNumCnf)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Calc qta col
|
||||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
if(x.getWithdrawMtbColrs().size() > 0) {
|
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||||
qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||||
.map(MtbColr::getQtaCol)
|
.map(MtbColr::getQtaCol)
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
}
|
}
|
||||||
|
|
||||||
accettazioneListModel.setQtaEvasa(qtaEvasa);
|
|
||||||
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
|
||||||
|
|
||||||
if (x.getMtbAart() != null)
|
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||||
accettazioneListModel.setUntMis(x.getMtbAart().getUntMis());
|
accettazioneListModel.setQtaEvasa(numCnfEvasa);
|
||||||
|
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||||
|
accettazioneListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||||
|
|
||||||
|
accettazioneListModel.setSecQtaEvasa(qtaEvasa);
|
||||||
|
accettazioneListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||||
|
if (x.getMtbAart() != null)
|
||||||
|
accettazioneListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||||
|
} else {
|
||||||
|
accettazioneListModel.setQtaEvasa(qtaEvasa);
|
||||||
|
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||||
|
if (x.getMtbAart() != null)
|
||||||
|
accettazioneListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||||
|
|
||||||
|
accettazioneListModel.setSecQtaEvasa(numCnfEvasa);
|
||||||
|
accettazioneListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||||
|
accettazioneListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||||
|
}
|
||||||
|
|
||||||
accettazioneListModel.setOriginalModel(x);
|
accettazioneListModel.setOriginalModel(x);
|
||||||
|
|
||||||
@@ -308,21 +366,47 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
accettazioneListModel.setBadge1(x.getSitArtOrdDTO().getCodArtFor());
|
accettazioneListModel.setBadge1(x.getSitArtOrdDTO().getCodArtFor());
|
||||||
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||||
|
|
||||||
|
//Calc Num CNF
|
||||||
|
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||||
|
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||||
|
.map(MtbColr::getNumCnf)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Calc qta col
|
||||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
if(x.getWithdrawMtbColrs().size() > 0) {
|
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||||
qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||||
.map(MtbColr::getQtaCol)
|
.map(MtbColr::getQtaCol)
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
}
|
}
|
||||||
|
|
||||||
accettazioneListModel.setQtaEvasa(qtaEvasa);
|
|
||||||
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||||
|
accettazioneListModel.setQtaEvasa(numCnfEvasa);
|
||||||
|
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||||
|
accettazioneListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||||
|
|
||||||
|
accettazioneListModel.setSecQtaEvasa(qtaEvasa);
|
||||||
|
accettazioneListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||||
|
if (x.getMtbAart() != null)
|
||||||
|
accettazioneListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||||
|
} else {
|
||||||
|
accettazioneListModel.setQtaEvasa(qtaEvasa);
|
||||||
|
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||||
|
if (x.getMtbAart() != null)
|
||||||
|
accettazioneListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||||
|
|
||||||
|
accettazioneListModel.setSecQtaEvasa(numCnfEvasa);
|
||||||
|
accettazioneListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||||
|
accettazioneListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||||
|
}
|
||||||
|
|
||||||
if (x.getMtbAart() != null) {
|
if (x.getMtbAart() != null) {
|
||||||
accettazioneListModel.setDescrizione(x.getMtbAart().getDescrizioneEstesa());
|
accettazioneListModel.setDescrizione(x.getMtbAart().getDescrizioneEstesa());
|
||||||
accettazioneListModel.setUntMis(x.getMtbAart().getUntMis());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
accettazioneListModel.setOriginalModel(x);
|
accettazioneListModel.setOriginalModel(x);
|
||||||
@@ -342,8 +426,45 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||||
|
|
||||||
|
|
||||||
accettazioneListModel.setQtaEvasa(BigDecimal.ZERO);
|
//Calc Num CNF
|
||||||
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getQtaOrd());
|
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||||
|
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||||
|
.map(MtbColr::getNumCnf)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Calc qta col
|
||||||
|
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||||
|
qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||||
|
.map(MtbColr::getQtaCol)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||||
|
accettazioneListModel.setQtaEvasa(numCnfEvasa);
|
||||||
|
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||||
|
accettazioneListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||||
|
|
||||||
|
accettazioneListModel.setSecQtaEvasa(qtaEvasa);
|
||||||
|
accettazioneListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||||
|
if (x.getMtbAart() != null)
|
||||||
|
accettazioneListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||||
|
} else {
|
||||||
|
accettazioneListModel.setQtaEvasa(qtaEvasa);
|
||||||
|
accettazioneListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||||
|
if (x.getMtbAart() != null)
|
||||||
|
accettazioneListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||||
|
|
||||||
|
accettazioneListModel.setSecQtaEvasa(numCnfEvasa);
|
||||||
|
accettazioneListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||||
|
accettazioneListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (x.getMtbAart() != null) {
|
if (x.getMtbAart() != null) {
|
||||||
accettazioneListModel.setDescrizione(x.getMtbAart().getDescrizioneEstesa());
|
accettazioneListModel.setDescrizione(x.getMtbAart().getDescrizioneEstesa());
|
||||||
@@ -363,7 +484,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
.anyMatch(x -> !x.isHidden());
|
.anyMatch(x -> !x.isHidden());
|
||||||
}
|
}
|
||||||
|
|
||||||
private RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
|
|
||||||
this.openProgress();
|
this.openProgress();
|
||||||
@@ -409,8 +530,13 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void startListaBancaliRegistratiActivity(ArrayList<MtbColt> mtbColts){
|
public void startListaBancaliRegistratiActivity(ArrayList<RecoverMtbColt> mtbColts) {
|
||||||
Intent myIntent = ListaBancaliActivity.createIntent(this, mtbColts, false, PrinterRESTConsumer.Type.SECONDARIA, ReportManager.getReportNameLUFromGestione(GestioneEnum.ACQUISTO));
|
|
||||||
|
Intent myIntent = ListaBancaliActivity.createIntent(this,
|
||||||
|
Stream.of(mtbColts).map(x -> (MtbColt) x).toList(),
|
||||||
|
input -> ((RecoverMtbColt) input).isFlagCanBeRecovered(),
|
||||||
|
PrinterRESTConsumer.Type.SECONDARIA,
|
||||||
|
ReportManager.getReportNameLUFromGestione(GestioneEnum.ACQUISTO));
|
||||||
this.startActivityForResult(myIntent, PICK_UL_REQUEST);
|
this.startActivityForResult(myIntent, PICK_UL_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,7 +544,9 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
public void onLUSuccessullyPrinted() {
|
public void onLUSuccessullyPrinted() {
|
||||||
Resources res = getResources();
|
Resources res = getResources();
|
||||||
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
||||||
DialogSimpleMessageHelper.makeSuccessDialog(this, res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null).show();
|
DialogSimpleMessageView
|
||||||
|
.makeSuccessDialog(res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null)
|
||||||
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -428,13 +556,13 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
@Override
|
@Override
|
||||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||||
this.closeProgress();
|
this.closeProgress();
|
||||||
DialogSimpleMessageHelper.makeErrorDialog(
|
DialogSimpleMessageView.makeErrorDialog(
|
||||||
this,
|
|
||||||
new SpannableString(ex.getMessage()),
|
new SpannableString(ex.getMessage()),
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
R.string.button_ignore_print,
|
R.string.button_ignore_print,
|
||||||
onComplete).show();
|
onComplete)
|
||||||
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -471,7 +599,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
this.closeProgress();
|
this.closeProgress();
|
||||||
|
|
||||||
if(ex instanceof InvalidPesoKGException) {
|
if (ex instanceof InvalidPesoKGException) {
|
||||||
UtilityToast.showToast(ex.getMessage());
|
UtilityToast.showToast(ex.getMessage());
|
||||||
} else {
|
} else {
|
||||||
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
||||||
@@ -481,7 +609,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemDispatched(PickingObjectDTO pickingObjectDTO, MtbAart mtbAart, BigDecimal initialNumCnf, BigDecimal initialQtaCnf, BigDecimal initialQtaTot, BigDecimal totalQtaOrd, BigDecimal totalNumCnfOrd, BigDecimal qtaCnfOrd, BigDecimal totalQtaToBeTaken, BigDecimal totalNumCnfToBeTaken, BigDecimal qtaCnfToBeTaken, BigDecimal totalQtaAvailable, BigDecimal totalNumCnfAvailable, BigDecimal qtaCnfAvailable, String partitaMag, Date dataScad, boolean canPartitaMagBeChanged, RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
|
public void onItemDispatched(PickingObjectDTO pickingObjectDTO, MtbAart mtbAart, BigDecimal initialNumCnf, BigDecimal initialQtaCnf, BigDecimal initialQtaTot, BigDecimal totalQtaOrd, BigDecimal totalNumCnfOrd, BigDecimal qtaCnfOrd, BigDecimal totalQtaToBeTaken, BigDecimal totalNumCnfToBeTaken, BigDecimal qtaCnfToBeTaken, BigDecimal totalQtaAvailable, BigDecimal totalNumCnfAvailable, BigDecimal qtaCnfAvailable, String partitaMag, Date dataScad, boolean canPartitaMagBeChanged, boolean canOverflowQuantity, RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
|
||||||
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
||||||
.setMtbAart(mtbAart)
|
.setMtbAart(mtbAart)
|
||||||
.setInitialNumCnf(initialNumCnf)
|
.setInitialNumCnf(initialNumCnf)
|
||||||
@@ -498,9 +626,11 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
.setQtaCnfAvailable(qtaCnfAvailable)
|
.setQtaCnfAvailable(qtaCnfAvailable)
|
||||||
.setPartitaMag(partitaMag)
|
.setPartitaMag(partitaMag)
|
||||||
.setDataScad(dataScad)
|
.setDataScad(dataScad)
|
||||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged);
|
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||||
|
.setCanLUBeClosed(true)
|
||||||
|
.setCanOverflowOrderQuantity(canOverflowQuantity);
|
||||||
|
|
||||||
DialogInputQuantityV2
|
DialogInputQuantityV2View
|
||||||
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
.newInstance(dialogInputQuantityV2DTO, (resultDTO, shouldCloseLU) -> {
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
@@ -534,12 +664,11 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
@Override
|
@Override
|
||||||
public void onMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete) {
|
public void onMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete) {
|
||||||
String text = getResources().getString(R.string.alert_delete_mtb_colr);
|
String text = getResources().getString(R.string.alert_delete_mtb_colr);
|
||||||
DialogSimpleMessageHelper.makeWarningDialog(this,
|
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text),
|
||||||
new SpannableString(text),
|
|
||||||
null,
|
null,
|
||||||
() -> onComplete.run(true),
|
() -> onComplete.run(true),
|
||||||
() -> onComplete.run(false)
|
() -> onComplete.run(false)
|
||||||
).show();
|
).show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.gest.accettazione_picking;
|
package it.integry.integrywmsnative.gest.accettazione_picking;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
@@ -8,7 +9,9 @@ import com.annimon.stream.Stream;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@@ -48,8 +51,10 @@ import it.integry.integrywmsnative.core.utility.UtilityDate;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.HistoryMtbAartDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.rest.AccettazionePickingRESTConsumer;
|
import it.integry.integrywmsnative.gest.accettazione_picking.rest.AccettazionePickingRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.rest.RecoverMtbColt;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.NotCurrentYearLUException;
|
import it.integry.integrywmsnative.gest.spedizione.exceptions.NotCurrentYearLUException;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
@@ -67,12 +72,14 @@ public class AccettazionePickingViewModel {
|
|||||||
|
|
||||||
private List<OrdineAccettazioneInevasoDTO> mOrders;
|
private List<OrdineAccettazioneInevasoDTO> mOrders;
|
||||||
private List<SitArtOrdDTO> mSitArts;
|
private List<SitArtOrdDTO> mSitArts;
|
||||||
private MutableLiveData<List<PickingObjectDTO>> mPickingList = new MutableLiveData<>();
|
private final MutableLiveData<List<PickingObjectDTO>> mPickingList = new MutableLiveData<>();
|
||||||
|
|
||||||
private MtbColt mCurrentMtbColt = null;
|
private MtbColt mCurrentMtbColt = null;
|
||||||
private GestioneEnum defaultGestioneOfUL = null;
|
private GestioneEnum defaultGestioneOfUL = null;
|
||||||
private String mDefaultCodMdep = null;
|
private String mDefaultCodMdep = null;
|
||||||
|
|
||||||
|
private final List<HistoryMtbAartDTO> mHistoryUsedAarts = new ArrayList<>();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public AccettazionePickingViewModel(ArticoloRESTConsumer articoloRESTConsumer,
|
public AccettazionePickingViewModel(ArticoloRESTConsumer articoloRESTConsumer,
|
||||||
BarcodeRESTConsumer barcodeRESTConsumer,
|
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||||
@@ -91,10 +98,13 @@ public class AccettazionePickingViewModel {
|
|||||||
|
|
||||||
public void init(List<OrdineAccettazioneInevasoDTO> orders, List<SitArtOrdDTO> sitArts, String codMdep) {
|
public void init(List<OrdineAccettazioneInevasoDTO> orders, List<SitArtOrdDTO> sitArts, String codMdep) {
|
||||||
this.mOrders = orders;
|
this.mOrders = orders;
|
||||||
this.mSitArts = sitArts;
|
|
||||||
this.mDefaultCodMdep = codMdep;
|
this.mDefaultCodMdep = codMdep;
|
||||||
|
|
||||||
getEmptyPickingList(sitArts, pickingObjectList -> {
|
this.mSitArts = Stream.of(sitArts)
|
||||||
|
.filter(x -> UtilityBigDecimal.greaterThan(x.getNumCnfDaEvadere(), BigDecimal.ZERO) && UtilityBigDecimal.greaterThan(x.getQtaDaEvadere(), BigDecimal.ZERO))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
getEmptyPickingList(this.mSitArts, pickingObjectList -> {
|
||||||
this.mPickingList.postValue(pickingObjectList);
|
this.mPickingList.postValue(pickingObjectList);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -129,11 +139,12 @@ public class AccettazionePickingViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void getEmptyPickingList(List<SitArtOrdDTO> sitArtOrdList, RunnableArgs<List<PickingObjectDTO>> onComplete) {
|
private void getEmptyPickingList(List<SitArtOrdDTO> sitArtOrdList, RunnableArgs<List<PickingObjectDTO>> onComplete) {
|
||||||
|
|
||||||
List<String> codMarts = Stream.of(sitArtOrdList)
|
List<String> codMarts = Stream.of(sitArtOrdList)
|
||||||
.map(SitArtOrdDTO::getCodMart)
|
.map(SitArtOrdDTO::getCodMart)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
ArticoloRESTConsumer.getByCodMart(codMarts, listMtbAarts -> {
|
this.mArticoloRESTConsumer.getByCodMart(codMarts, listMtbAarts -> {
|
||||||
List<PickingObjectDTO> pickingList = Stream.of(sitArtOrdList)
|
List<PickingObjectDTO> pickingList = Stream.of(sitArtOrdList)
|
||||||
.map(sitArtOrdDTO -> {
|
.map(sitArtOrdDTO -> {
|
||||||
MtbAart mtbAart = null;
|
MtbAart mtbAart = null;
|
||||||
@@ -159,10 +170,10 @@ public class AccettazionePickingViewModel {
|
|||||||
return mPickingList;
|
return mPickingList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void retrieveExistentLU(RunnableArgs<ArrayList<MtbColt>> onComplete) {
|
public void retrieveExistentLU(RunnableArgs<ArrayList<RecoverMtbColt>> onComplete) {
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
this.mAccettazionePickingRESTConsumer.getBancaliGiaRegistrati(this.mSitArts, mtbColtList -> {
|
this.mAccettazionePickingRESTConsumer.getBancaliGiaRegistrati(this.mOrders, mtbColtList -> {
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
onComplete.run(mtbColtList);
|
onComplete.run(mtbColtList);
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
@@ -419,7 +430,7 @@ public class AccettazionePickingViewModel {
|
|||||||
|
|
||||||
|
|
||||||
public void dispatchOrdineRow(final PickingObjectDTO pickingObjectDTO) {
|
public void dispatchOrdineRow(final PickingObjectDTO pickingObjectDTO) {
|
||||||
if(this.mCurrentMtbColt == null) return;
|
if (this.mCurrentMtbColt == null) return;
|
||||||
|
|
||||||
BigDecimal totalQtaOrd = pickingObjectDTO.getSitArtOrdDTO().getQtaOrd();
|
BigDecimal totalQtaOrd = pickingObjectDTO.getSitArtOrdDTO().getQtaOrd();
|
||||||
BigDecimal totalNumCnfOrd = pickingObjectDTO.getSitArtOrdDTO().getNumCnfOrd();
|
BigDecimal totalNumCnfOrd = pickingObjectDTO.getSitArtOrdDTO().getNumCnfOrd();
|
||||||
@@ -434,8 +445,8 @@ public class AccettazionePickingViewModel {
|
|||||||
qtaColWithdrawRows.addAndGet(row.getQtaCol());
|
qtaColWithdrawRows.addAndGet(row.getQtaCol());
|
||||||
});
|
});
|
||||||
|
|
||||||
BigDecimal numCnfDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getNumCnfOrd().subtract(numCnfWithdrawRows.getBigDecimalValue());
|
BigDecimal numCnfDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getNumCnfDaEvadere().subtract(numCnfWithdrawRows.getBigDecimalValue());
|
||||||
BigDecimal qtaDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getQtaOrd().subtract(qtaColWithdrawRows.getBigDecimalValue());
|
BigDecimal qtaDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getQtaDaEvadere().subtract(qtaColWithdrawRows.getBigDecimalValue());
|
||||||
BigDecimal qtaCnfDaEvadere = qtaCnfOrd;
|
BigDecimal qtaCnfDaEvadere = qtaCnfOrd;
|
||||||
|
|
||||||
numCnfDaEvadere = UtilityBigDecimal.getGreaterBetween(numCnfDaEvadere, BigDecimal.ZERO);
|
numCnfDaEvadere = UtilityBigDecimal.getGreaterBetween(numCnfDaEvadere, BigDecimal.ZERO);
|
||||||
@@ -475,7 +486,7 @@ public class AccettazionePickingViewModel {
|
|||||||
|
|
||||||
|
|
||||||
if (qtaColDaPrelevare != null && numCnfDaPrelevare == null) {
|
if (qtaColDaPrelevare != null && numCnfDaPrelevare == null) {
|
||||||
numCnfDaPrelevare = UtilityBigDecimal.divideToInteger(qtaColDaPrelevare, mtbAart.getQtaCnf());
|
numCnfDaPrelevare = UtilityBigDecimal.divideAndRoundToInteger(qtaColDaPrelevare, mtbAart.getQtaCnf());
|
||||||
|
|
||||||
if (!mtbAart.isFlagQtaCnfFissaBoolean()) {
|
if (!mtbAart.isFlagQtaCnfFissaBoolean()) {
|
||||||
if (UtilityBigDecimal.equalsTo(numCnfDaPrelevare, BigDecimal.ZERO))
|
if (UtilityBigDecimal.equalsTo(numCnfDaPrelevare, BigDecimal.ZERO))
|
||||||
@@ -493,10 +504,47 @@ public class AccettazionePickingViewModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BigDecimal initialNumCnf;
|
||||||
|
BigDecimal initialQtaCnf;
|
||||||
|
BigDecimal initialQtaTot;
|
||||||
|
|
||||||
|
if (qtaColDaPrelevare != null) {
|
||||||
|
initialNumCnf = numCnfDaPrelevare;
|
||||||
|
initialQtaCnf = qtaCnfDaPrelevare;
|
||||||
|
initialQtaTot = qtaColDaPrelevare;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
initialNumCnf = totalNumCnfOrd;
|
||||||
|
initialQtaCnf = qtaCnfOrd;
|
||||||
|
initialQtaTot = totalQtaOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (UtilityBigDecimal.greaterThan(pickingObjectDTO.getMtbAart().getColliPedana(), BigDecimal.ZERO) && UtilityBigDecimal.greaterThan(initialNumCnf, pickingObjectDTO.getMtbAart().getColliPedana())) {
|
||||||
|
initialNumCnf = pickingObjectDTO.getMtbAart().getColliPedana();
|
||||||
|
initialQtaTot = initialNumCnf.multiply(initialQtaCnf);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dataScad == null && pickingObjectDTO.getMtbAart().getGgScadPartita() != null && pickingObjectDTO.getMtbAart().getGgScadPartita() > 0) {
|
||||||
|
dataScad = UtilityDate.getDateInstance();
|
||||||
|
Calendar c = new GregorianCalendar();
|
||||||
|
c.setTime(dataScad);
|
||||||
|
c.add(Calendar.DATE, pickingObjectDTO.getMtbAart().getGgScadPartita());
|
||||||
|
dataScad = c.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(partitaMag == null && dataScad == null) {
|
||||||
|
HistoryMtbAartDTO historyMtbAartDTO = this.getHistoryItemIfExists(pickingObjectDTO.getMtbAart().getCodMart());
|
||||||
|
|
||||||
|
if(historyMtbAartDTO != null) {
|
||||||
|
partitaMag = historyMtbAartDTO.getPartitaMag();
|
||||||
|
dataScad = historyMtbAartDTO.getDataScad();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.sendOnItemDispatched(
|
this.sendOnItemDispatched(
|
||||||
pickingObjectDTO,
|
pickingObjectDTO,
|
||||||
pickingObjectDTO.getMtbAart(),
|
pickingObjectDTO.getMtbAart(),
|
||||||
null, null, null,
|
initialNumCnf, initialQtaCnf, initialQtaTot,
|
||||||
qtaDaEvadere,
|
qtaDaEvadere,
|
||||||
numCnfDaEvadere,
|
numCnfDaEvadere,
|
||||||
qtaCnfDaEvadere,
|
qtaCnfDaEvadere,
|
||||||
@@ -543,6 +591,8 @@ public class AccettazionePickingViewModel {
|
|||||||
.setRigaOrd(pickingObjectDTO.getSitArtOrdDTO().getRigaOrd());
|
.setRigaOrd(pickingObjectDTO.getSitArtOrdDTO().getRigaOrd());
|
||||||
|
|
||||||
|
|
||||||
|
this.addHistoryItem(mtbColr);
|
||||||
|
|
||||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||||
@@ -566,7 +616,7 @@ public class AccettazionePickingViewModel {
|
|||||||
.setNumCollo(value.getNumCollo())
|
.setNumCollo(value.getNumCollo())
|
||||||
.setGestione(value.getGestione())
|
.setGestione(value.getGestione())
|
||||||
.setSerCollo(value.getSerCollo())
|
.setSerCollo(value.getSerCollo())
|
||||||
.setRiga(value.getMtbColr().get(0).getRiga())
|
.setRiga(value.getMtbColr().get(value.getMtbColr().size() - 1).getRiga())
|
||||||
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||||
|
|
||||||
@@ -638,6 +688,8 @@ public class AccettazionePickingViewModel {
|
|||||||
|
|
||||||
mtbColt.getMtbColr().add(mtbColr);
|
mtbColt.getMtbColr().add(mtbColr);
|
||||||
|
|
||||||
|
this.addHistoryItem(mtbColr);
|
||||||
|
|
||||||
this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
||||||
|
|
||||||
mtbColr.setNumCnf(numCnf)
|
mtbColr.setNumCnf(numCnf)
|
||||||
@@ -648,7 +700,7 @@ public class AccettazionePickingViewModel {
|
|||||||
.filter(x -> Stream.of(x.getWithdrawMtbColrs()).anyMatch(y -> y == mtbColrToUpdate))
|
.filter(x -> Stream.of(x.getWithdrawMtbColrs()).anyMatch(y -> y == mtbColrToUpdate))
|
||||||
.findSingle();
|
.findSingle();
|
||||||
|
|
||||||
if(pickingObjectDTO.isPresent()) {
|
if (pickingObjectDTO.isPresent()) {
|
||||||
pickingObjectDTO.get().getWithdrawMtbColrs().remove(mtbColrToUpdate);
|
pickingObjectDTO.get().getWithdrawMtbColrs().remove(mtbColrToUpdate);
|
||||||
pickingObjectDTO.get().getWithdrawMtbColrs().add(mtbColr);
|
pickingObjectDTO.get().getWithdrawMtbColrs().add(mtbColr);
|
||||||
}
|
}
|
||||||
@@ -744,7 +796,7 @@ public class AccettazionePickingViewModel {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String reportName = ReportManager.getReportNameLUFromGestione(mCurrentMtbColt.getGestioneEnum());
|
String reportName = ReportManager.getReportNameLUFromGestione(GestioneEnum.ACQUISTO);
|
||||||
|
|
||||||
this.mPrinterRESTConsumer.printCollo(
|
this.mPrinterRESTConsumer.printCollo(
|
||||||
printerList.get(0),
|
printerList.get(0),
|
||||||
@@ -783,6 +835,30 @@ public class AccettazionePickingViewModel {
|
|||||||
this.sendFilterRemoved();
|
this.sendFilterRemoved();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void addHistoryItem(@NonNull MtbColr mtbColr) {
|
||||||
|
Optional<HistoryMtbAartDTO> optional = Stream.of(this.mHistoryUsedAarts)
|
||||||
|
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart()))
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
if (optional.isPresent()) {
|
||||||
|
optional.get()
|
||||||
|
.setPartitaMag(mtbColr.getPartitaMag())
|
||||||
|
.setDataScad(mtbColr.getDataScadPartitaD());
|
||||||
|
} else {
|
||||||
|
this.mHistoryUsedAarts.add(new HistoryMtbAartDTO()
|
||||||
|
.setCodMart(mtbColr.getCodMart())
|
||||||
|
.setPartitaMag(mtbColr.getPartitaMag())
|
||||||
|
.setDataScad(mtbColr.getDataScadPartitaD()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private HistoryMtbAartDTO getHistoryItemIfExists(@NonNull String codMart) {
|
||||||
|
Optional<HistoryMtbAartDTO> optional = Stream.of(this.mHistoryUsedAarts)
|
||||||
|
.filter(x -> x.getCodMart().equalsIgnoreCase(codMart))
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
return optional.isPresent() ? optional.get() : null;
|
||||||
|
}
|
||||||
|
|
||||||
private void sendOnLoadingStarted() {
|
private void sendOnLoadingStarted() {
|
||||||
if (this.mListener != null) mListener.onLoadingStarted();
|
if (this.mListener != null) mListener.onLoadingStarted();
|
||||||
@@ -851,6 +927,7 @@ public class AccettazionePickingViewModel {
|
|||||||
partitaMag,
|
partitaMag,
|
||||||
dataScad,
|
dataScad,
|
||||||
canPartitaMagBeChanged,
|
canPartitaMagBeChanged,
|
||||||
|
true,
|
||||||
onComplete);
|
onComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -899,17 +976,14 @@ public class AccettazionePickingViewModel {
|
|||||||
BigDecimal qtaCnfAvailable,
|
BigDecimal qtaCnfAvailable,
|
||||||
String partitaMag,
|
String partitaMag,
|
||||||
Date dataScad,
|
Date dataScad,
|
||||||
boolean canOverflowOrderQuantity,
|
boolean canPartitaMagBeChanged,
|
||||||
|
boolean canOverflowQuantity,
|
||||||
RunnableArgss<PickedQuantityDTO, Boolean> onComplete);
|
RunnableArgss<PickedQuantityDTO, Boolean> onComplete);
|
||||||
|
|
||||||
void onRowSaved();
|
|
||||||
|
|
||||||
void onFilterApplied(String newValue);
|
void onFilterApplied(String newValue);
|
||||||
|
|
||||||
void onFilterRemoved();
|
void onFilterRemoved();
|
||||||
|
|
||||||
void onMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.core.content.res.ResourcesCompat;
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
import androidx.databinding.ObservableList;
|
import androidx.databinding.ObservableList;
|
||||||
@@ -28,8 +29,9 @@ import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDT
|
|||||||
|
|
||||||
public class AccettazioneListAdapter extends SectionedRecyclerViewAdapter<AccettazioneListAdapter.SubheaderHolder, AccettazioneListAdapter.SingleItemViewHolder> {
|
public class AccettazioneListAdapter extends SectionedRecyclerViewAdapter<AccettazioneListAdapter.SubheaderHolder, AccettazioneListAdapter.SingleItemViewHolder> {
|
||||||
|
|
||||||
private Context mContext;
|
private final Context mContext;
|
||||||
private List<AccettazioneListModel> mDataset = new ArrayList<>();
|
private final boolean mShowSecondaryUntMis;
|
||||||
|
private final List<AccettazioneListModel> mDataset = new ArrayList<>();
|
||||||
|
|
||||||
private RunnableArgs<PickingObjectDTO> mOnItemClicked;
|
private RunnableArgs<PickingObjectDTO> mOnItemClicked;
|
||||||
|
|
||||||
@@ -55,8 +57,9 @@ public class AccettazioneListAdapter extends SectionedRecyclerViewAdapter<Accett
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public AccettazioneListAdapter(AppCompatActivity context, ObservableArrayList<AccettazioneListModel> mutableDataSet) {
|
public AccettazioneListAdapter(AppCompatActivity context, ObservableArrayList<AccettazioneListModel> mutableDataSet, boolean showSecondaryUntMis) {
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
|
this.mShowSecondaryUntMis = showSecondaryUntMis;
|
||||||
|
|
||||||
mutableDataSet.addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
mutableDataSet.addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
||||||
@Override
|
@Override
|
||||||
@@ -111,8 +114,8 @@ public class AccettazioneListAdapter extends SectionedRecyclerViewAdapter<Accett
|
|||||||
|
|
||||||
holder.mBinding.deactivatedOverBg.setVisibility(!pickingObjectDTO.isActive() ? View.VISIBLE : View.GONE);
|
holder.mBinding.deactivatedOverBg.setVisibility(!pickingObjectDTO.isActive() ? View.VISIBLE : View.GONE);
|
||||||
holder.mBinding.getRoot().setAlpha(!pickingObjectDTO.isActive() ? 0.8f : 1);
|
holder.mBinding.getRoot().setAlpha(!pickingObjectDTO.isActive() ? 0.8f : 1);
|
||||||
holder.mBinding.badge1.setBackground(mContext.getResources().getDrawable(!pickingObjectDTO.isActive() ? R.drawable.badge_gray_round_corner : R.drawable.badge1_round_corner));
|
holder.mBinding.badge1.setBackground(ResourcesCompat.getDrawable(mContext.getResources(), !pickingObjectDTO.isActive() ? R.drawable.badge_gray_round_corner : R.drawable.badge1_round_corner, null));
|
||||||
holder.mBinding.qtaEvasa.setTextColor(mContext.getResources().getColor(!pickingObjectDTO.isActive() ? R.color.gray_600 : R.color.green_700));
|
holder.mBinding.qtaEvasa.setTextColor(ResourcesCompat.getColor(mContext.getResources(), !pickingObjectDTO.isActive() ? R.color.gray_600 : R.color.green_700, null));
|
||||||
|
|
||||||
holder.mBinding.descrizione.setText(pickingObjectDTO.getDescrizione());
|
holder.mBinding.descrizione.setText(pickingObjectDTO.getDescrizione());
|
||||||
holder.mBinding.descrizione.setTextColor(pickingObjectDTO.isDescrizionePresente() ? Color.BLACK : Color.GRAY);
|
holder.mBinding.descrizione.setTextColor(pickingObjectDTO.isDescrizionePresente() ? Color.BLACK : Color.GRAY);
|
||||||
@@ -129,6 +132,17 @@ public class AccettazioneListAdapter extends SectionedRecyclerViewAdapter<Accett
|
|||||||
holder.mBinding.untMis.setText(pickingObjectDTO.getUntMis());
|
holder.mBinding.untMis.setText(pickingObjectDTO.getUntMis());
|
||||||
holder.mBinding.untMis.setVisibility(UtilityString.isNullOrEmpty(pickingObjectDTO.getUntMis()) ? View.GONE : View.VISIBLE);
|
holder.mBinding.untMis.setVisibility(UtilityString.isNullOrEmpty(pickingObjectDTO.getUntMis()) ? View.GONE : View.VISIBLE);
|
||||||
|
|
||||||
|
//Secondary Unt Mis
|
||||||
|
holder.mBinding.secondaryUntMis.setVisibility(mShowSecondaryUntMis ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
|
if(mShowSecondaryUntMis) {
|
||||||
|
holder.mBinding.secQtaEvasa.setText(UtilityNumber.decimalToString(pickingObjectDTO.getSecQtaEvasa()));
|
||||||
|
holder.mBinding.secQtaTot.setText(UtilityNumber.decimalToString(pickingObjectDTO.getSecQtaTot()));
|
||||||
|
|
||||||
|
holder.mBinding.secUntMis.setText(pickingObjectDTO.getSecUntMis());
|
||||||
|
holder.mBinding.secUntMis.setVisibility(UtilityString.isNullOrEmpty(pickingObjectDTO.getSecUntMis()) ? View.GONE : View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
holder.mBinding.getRoot().setOnClickListener(v -> {
|
holder.mBinding.getRoot().setOnClickListener(v -> {
|
||||||
if (this.mOnItemClicked != null)
|
if (this.mOnItemClicked != null)
|
||||||
this.mOnItemClicked.run(pickingObjectDTO.getOriginalModel());
|
this.mOnItemClicked.run(pickingObjectDTO.getOriginalModel());
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ public class AccettazioneListModel implements Cloneable {
|
|||||||
private BigDecimal qtaEvasa;
|
private BigDecimal qtaEvasa;
|
||||||
private BigDecimal qtaTot;
|
private BigDecimal qtaTot;
|
||||||
private String untMis;
|
private String untMis;
|
||||||
|
private BigDecimal secQtaEvasa;
|
||||||
|
private BigDecimal secQtaTot;
|
||||||
|
private String secUntMis;
|
||||||
|
|
||||||
private boolean active;
|
private boolean active;
|
||||||
|
|
||||||
@@ -124,6 +127,33 @@ public class AccettazioneListModel implements Cloneable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BigDecimal getSecQtaEvasa() {
|
||||||
|
return secQtaEvasa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AccettazioneListModel setSecQtaEvasa(BigDecimal secQtaEvasa) {
|
||||||
|
this.secQtaEvasa = secQtaEvasa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getSecQtaTot() {
|
||||||
|
return secQtaTot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AccettazioneListModel setSecQtaTot(BigDecimal secQtaTot) {
|
||||||
|
this.secQtaTot = secQtaTot;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSecUntMis() {
|
||||||
|
return secUntMis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AccettazioneListModel setSecUntMis(String secUntMis) {
|
||||||
|
this.secUntMis = secUntMis;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isActive() {
|
public boolean isActive() {
|
||||||
return active;
|
return active;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking.dto;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class HistoryMtbAartDTO {
|
||||||
|
|
||||||
|
private String codMart;
|
||||||
|
private String partitaMag;
|
||||||
|
private Date dataScad;
|
||||||
|
|
||||||
|
public String getCodMart() {
|
||||||
|
return codMart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HistoryMtbAartDTO setCodMart(String codMart) {
|
||||||
|
this.codMart = codMart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPartitaMag() {
|
||||||
|
return partitaMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HistoryMtbAartDTO setPartitaMag(String partitaMag) {
|
||||||
|
this.partitaMag = partitaMag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataScad() {
|
||||||
|
return dataScad;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HistoryMtbAartDTO setDataScad(Date dataScad) {
|
||||||
|
this.dataScad = dataScad;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,19 +5,18 @@ import com.google.gson.reflect.TypeToken;
|
|||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ISimpleOperationCallback;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class AccettazionePickingRESTConsumer {
|
public class AccettazionePickingRESTConsumer {
|
||||||
@@ -29,58 +28,114 @@ public class AccettazionePickingRESTConsumer {
|
|||||||
this.mSystemRestConsumer = systemRESTConsumer;
|
this.mSystemRestConsumer = systemRESTConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getBancaliGiaRegistrati(List<SitArtOrdDTO> ordiniToShow, RunnableArgs<ArrayList<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getBancaliGiaRegistrati(List<OrdineAccettazioneInevasoDTO> ordiniToShow, RunnableArgs<ArrayList<RecoverMtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
List<HashMap<String, Object>> whereCondListMap = new ArrayList<>();
|
||||||
|
|
||||||
List<String> colliWhereCond = new ArrayList<>();
|
Stream
|
||||||
|
.of(ordiniToShow)
|
||||||
|
.distinctBy(x -> x.getData() + " " + x.getGestione() + " " + x.getNumero())
|
||||||
|
.forEach(x -> {
|
||||||
|
try {
|
||||||
|
HashMap<String, Object> whereCondMap = new HashMap<>();
|
||||||
|
whereCondMap.put("mtb_colr.data_ord", UtilityDate.recognizeDate(x.getData()));
|
||||||
|
whereCondMap.put("mtb_colr.gestione", x.getGestione().equalsIgnoreCase("P") ? "L" : x.getGestione());
|
||||||
|
whereCondMap.put("mtb_colr.num_ord", x.getNumero());
|
||||||
|
|
||||||
|
whereCondListMap.add(whereCondMap);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
UtilityLogger.errorMe(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
Stream.of(ordiniToShow).forEach(x -> {
|
String sql = "SELECT DISTINCT CAST(CASE WHEN MAX(ISNULL(mtb_colr_scar.num_collo, 0)) = 0 THEN 1 ELSE 0 END AS BIT) AS flagCanBeRecovered, " +
|
||||||
try {
|
" mtb_colt.gestione," +
|
||||||
Date date = UtilityDate.recognizeDate(x.getDataOrd());
|
" mtb_colt.data_collo," +
|
||||||
String dateString = UtilityDate.formatDate(date, "yyyy/MM/dd");
|
" mtb_colt.num_collo," +
|
||||||
|
" segno," +
|
||||||
if (!colliWhereCond.contains(x.getGestione() + " " + dateString + " " + x.getNumOrd())) {
|
" peso_kg," +
|
||||||
String gestione = x.getGestione().equalsIgnoreCase("P") ? "L" : x.getGestione();
|
" lunghezza_cm," +
|
||||||
colliWhereCond.add(gestione + " " + dateString + " " + x.getNumOrd());
|
" larghezza_cm," +
|
||||||
}
|
" altezza_cm," +
|
||||||
} catch (Exception ex){
|
" cod_anag," +
|
||||||
UtilityLogger.errorMe(ex);
|
" cod_dtip," +
|
||||||
}
|
" mtb_colt.data_doc," +
|
||||||
});
|
" mtb_colt.ser_doc," +
|
||||||
|
" mtb_colt.num_doc," +
|
||||||
|
" rif_ord," +
|
||||||
|
" mtb_colt.ser_collo," +
|
||||||
|
" cod_tcol," +
|
||||||
|
" mtb_colt.data_ord," +
|
||||||
|
" mtb_colt.num_ord," +
|
||||||
|
" cod_vdes," +
|
||||||
|
" cod_mdep," +
|
||||||
|
" cod_vlis," +
|
||||||
|
" preparato_da," +
|
||||||
|
" ora_iniz_prep," +
|
||||||
|
" ora_fine_prep," +
|
||||||
|
" filtro_ordini," +
|
||||||
|
" annotazioni," +
|
||||||
|
" posizione," +
|
||||||
|
" cod_dtip_provv," +
|
||||||
|
" data_doc_provv," +
|
||||||
|
" ser_doc_provv," +
|
||||||
|
" num_doc_provv," +
|
||||||
|
" cod_jfas," +
|
||||||
|
" data_vers," +
|
||||||
|
" mtb_colt.peso_netto_kg " +
|
||||||
|
"FROM mtb_colt" +
|
||||||
|
" INNER JOIN mtb_colr ON " +
|
||||||
|
" mtb_colt.gestione = mtb_colr.gestione AND " +
|
||||||
|
" mtb_colt.ser_collo = mtb_colr.ser_collo AND " +
|
||||||
|
" mtb_colt.data_collo = mtb_colr.data_collo AND " +
|
||||||
|
" mtb_colt.num_collo = mtb_colr.num_collo " +
|
||||||
|
" LEFT OUTER JOIN mtb_colr mtb_colr_scar ON mtb_colr_scar.num_collo_rif = mtb_colr.num_collo AND " +
|
||||||
|
" mtb_colr_scar.gestione_rif = mtb_colr.gestione AND " +
|
||||||
|
" mtb_colr_scar.ser_collo_rif = mtb_colr.ser_collo AND " +
|
||||||
|
" mtb_colr_scar.data_collo_rif = mtb_colr.data_collo " +
|
||||||
|
" WHERE (" + UtilityQuery.concatFieldListInWhereCond(whereCondListMap) + ") " +
|
||||||
|
" AND mtb_colt.data_doc IS NULL " +
|
||||||
|
" GROUP BY mtb_colt.gestione," +
|
||||||
|
" mtb_colt.data_collo," +
|
||||||
|
" mtb_colt.num_collo," +
|
||||||
|
" segno," +
|
||||||
|
" peso_kg," +
|
||||||
|
" lunghezza_cm," +
|
||||||
|
" larghezza_cm," +
|
||||||
|
" altezza_cm," +
|
||||||
|
" cod_anag," +
|
||||||
|
" cod_dtip," +
|
||||||
|
" mtb_colt.data_doc," +
|
||||||
|
" mtb_colt.ser_doc," +
|
||||||
|
" mtb_colt.num_doc," +
|
||||||
|
" rif_ord," +
|
||||||
|
" mtb_colt.ser_collo," +
|
||||||
|
" cod_tcol," +
|
||||||
|
" mtb_colt.data_ord," +
|
||||||
|
" mtb_colt.num_ord," +
|
||||||
|
" cod_vdes," +
|
||||||
|
" cod_mdep," +
|
||||||
|
" cod_vlis," +
|
||||||
|
" preparato_da," +
|
||||||
|
" ora_iniz_prep," +
|
||||||
|
" ora_fine_prep," +
|
||||||
|
" filtro_ordini," +
|
||||||
|
" annotazioni," +
|
||||||
|
" posizione," +
|
||||||
|
" cod_dtip_provv," +
|
||||||
|
" data_doc_provv," +
|
||||||
|
" ser_doc_provv," +
|
||||||
|
" num_doc_provv," +
|
||||||
|
" cod_jfas," +
|
||||||
|
" data_vers," +
|
||||||
|
" mtb_colt.peso_netto_kg";
|
||||||
|
|
||||||
|
|
||||||
StringBuilder colliINCondition = new StringBuilder();
|
Type typeOfObjectsList = new TypeToken<ArrayList<RecoverMtbColt>>() {
|
||||||
|
}.getType();
|
||||||
for(int i = 0; i < colliWhereCond.size(); i ++){
|
mSystemRestConsumer.<ArrayList<RecoverMtbColt>>processSql(sql, typeOfObjectsList, value -> {
|
||||||
colliINCondition.append("'").append(colliWhereCond.get(i)).append("'");
|
if (onComplete != null) onComplete.run(value);
|
||||||
|
}, onFailed);
|
||||||
if(i < (colliWhereCond.size()-1)) colliINCondition.append(",");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String sql = "SELECT DISTINCT mtb_colt.* " +
|
|
||||||
"FROM mtb_colt, mtb_colr " +
|
|
||||||
"WHERE mtb_colt.gestione = mtb_colr.gestione AND " +
|
|
||||||
"mtb_colt.ser_collo = mtb_colr.ser_collo AND " +
|
|
||||||
"mtb_colt.data_collo = mtb_colr.data_collo AND " +
|
|
||||||
"mtb_colt.num_collo = mtb_colr.num_collo AND " +
|
|
||||||
"mtb_colt.gestione + ' ' + CONVERT(VARCHAR(15), mtb_colr.data_ord, 111) + ' ' + CONVERT(VARCHAR, mtb_colr.num_ord) IN (" + colliINCondition +
|
|
||||||
") AND mtb_colt.data_doc IS NULL ";
|
|
||||||
|
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {}.getType();
|
|
||||||
mSystemRestConsumer.processSql(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<MtbColt>>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(ArrayList<MtbColt> value) {
|
|
||||||
if(onComplete != null) onComplete.run(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailed(Exception ex) {
|
|
||||||
if(onFailed != null) onFailed.run(ex);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking.rest;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
|
||||||
|
public class RecoverMtbColt extends MtbColt {
|
||||||
|
|
||||||
|
private boolean flagCanBeRecovered;
|
||||||
|
|
||||||
|
public boolean isFlagCanBeRecovered() {
|
||||||
|
return flagCanBeRecovered;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecoverMtbColt setFlagCanBeRecovered(boolean flagCanBeRecovered) {
|
||||||
|
this.flagCanBeRecovered = flagCanBeRecovered;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,27 +3,28 @@ package it.integry.integrywmsnative.gest.contenuto_bancale.viewmodel;
|
|||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import androidx.databinding.ObservableField;
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.databinding.ObservableField;
|
||||||
|
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||||
import it.integry.integrywmsnative.core.di.BindableString;
|
import it.integry.integrywmsnative.core.di.BindableString;
|
||||||
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleActivity;
|
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleActivity;
|
||||||
import it.integry.integrywmsnative.gest.contenuto_bancale.core.ContenutoBancaleListAdapter;
|
import it.integry.integrywmsnative.gest.contenuto_bancale.core.ContenutoBancaleListAdapter;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
import static android.app.Activity.RESULT_OK;
|
import static android.app.Activity.RESULT_OK;
|
||||||
|
|
||||||
@@ -42,7 +43,7 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
private PrinterRESTConsumer.Type mPrinterType;
|
private PrinterRESTConsumer.Type mPrinterType;
|
||||||
private String mReportName;
|
private String mReportName;
|
||||||
|
|
||||||
public ContenutoBancaleViewModel(ContenutoBancaleActivity context, MtbColt mtbColt, boolean canRecoverUL, PrinterRESTConsumer.Type printerType, String defaultReportName){
|
public ContenutoBancaleViewModel(ContenutoBancaleActivity context, MtbColt mtbColt, boolean canRecoverUL, PrinterRESTConsumer.Type printerType, String defaultReportName) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
this.mtbColt = new ObservableField<>(mtbColt);
|
this.mtbColt = new ObservableField<>(mtbColt);
|
||||||
this.isFabVisible.set(true);
|
this.isFabVisible.set(true);
|
||||||
@@ -85,8 +86,7 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void recoverUL() {
|
||||||
public void recoverUL(){
|
|
||||||
Intent data = new Intent();
|
Intent data = new Intent();
|
||||||
String key = DataCache.addItem(mtbColt.get());
|
String key = DataCache.addItem(mtbColt.get());
|
||||||
data.putExtra("key", key);
|
data.putExtra("key", key);
|
||||||
@@ -102,39 +102,41 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
|||||||
|
|
||||||
PrinterRESTConsumer.getAvailablePrintersStatic(SettingsManager.i().getUserSession().getDepo().getCodMdep(), mPrinterType, value -> {
|
PrinterRESTConsumer.getAvailablePrintersStatic(SettingsManager.i().getUserSession().getDepo().getCodMdep(), mPrinterType, value -> {
|
||||||
|
|
||||||
if(value.size() > 0) {
|
if (value.size() > 0) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ReportManager.getReportNameLUFromGestione(mtbColt.get().getGestioneEnum(), reportName -> {
|
String reportName = ReportManager.getReportNameLUFromGestione(mtbColt.get().getGestioneEnum());
|
||||||
|
|
||||||
reportName = mReportName != null ? mReportName : reportName;
|
reportName = mReportName != null ? mReportName : reportName;
|
||||||
|
|
||||||
PrinterRESTConsumer.printColloStatic(value.get(0),
|
PrinterRESTConsumer.printColloStatic(value.get(0),
|
||||||
mtbColt.get(),
|
mtbColt.get(),
|
||||||
1,
|
1,
|
||||||
reportName,
|
reportName,
|
||||||
() -> {
|
() -> {
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
|
|
||||||
Resources res = mContext.getResources();
|
Resources res = mContext.getResources();
|
||||||
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
||||||
DialogSimpleMessageHelper.makeSuccessDialog(mContext, res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null).show();
|
DialogSimpleMessageView
|
||||||
}, ex -> UtilityExceptions.defaultException(mContext,ex, progress));
|
.makeSuccessDialog(res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null)
|
||||||
|
.show(mContext.getSupportFragmentManager(), "tag");
|
||||||
|
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
||||||
|
|
||||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress)
|
} catch (Exception ex) {
|
||||||
);
|
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||||
} catch (Exception ex){
|
|
||||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
progress.dismiss();
|
|
||||||
String errorMessage = "Nessuna stampante configurata";
|
|
||||||
DialogSimpleMessageHelper.makeWarningDialog(mContext, new SpannableString(errorMessage), null, null).show();
|
|
||||||
}
|
}
|
||||||
}, ex -> {
|
|
||||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
} else {
|
||||||
});
|
progress.dismiss();
|
||||||
|
String errorMessage = "Nessuna stampante configurata";
|
||||||
|
DialogSimpleMessageView
|
||||||
|
.makeWarningDialog(new SpannableString(errorMessage), null, null)
|
||||||
|
.show(mContext.getSupportFragmentManager(), "tag");;
|
||||||
|
}
|
||||||
|
}, ex -> {
|
||||||
|
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,18 +2,18 @@ package it.integry.integrywmsnative.gest.lista_bancali;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import androidx.databinding.DataBindingUtil;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgsWithReturn;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
import it.integry.integrywmsnative.databinding.ActivityListaBancaliBinding;
|
import it.integry.integrywmsnative.databinding.ActivityListaBancaliBinding;
|
||||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleActivity;
|
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleActivity;
|
||||||
import it.integry.integrywmsnative.gest.lista_bancali.viewmodel.ListaBancaliViewModel;
|
import it.integry.integrywmsnative.gest.lista_bancali.viewmodel.ListaBancaliViewModel;
|
||||||
@@ -25,52 +25,55 @@ public class ListaBancaliActivity extends BaseActivity {
|
|||||||
private static final String CanRecoverUL = "canRecoverUL";
|
private static final String CanRecoverUL = "canRecoverUL";
|
||||||
private static final String PrinterType = "printerType";
|
private static final String PrinterType = "printerType";
|
||||||
private static final String ReportName = "reportName";
|
private static final String ReportName = "reportName";
|
||||||
|
private static final String FlagOnlyResiduo = "flagOnlyResiduo";
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActivityListaBancaliBinding bindings;
|
public ActivityListaBancaliBinding bindings;
|
||||||
|
|
||||||
private ListaBancaliViewModel mViewModel;
|
private ListaBancaliViewModel mViewModel;
|
||||||
|
|
||||||
private boolean mCanRecoverUl;
|
private RunnableArgsWithReturn<MtbColt, Boolean> mCanRecoverUl;
|
||||||
private PrinterRESTConsumer.Type mPrinterType;
|
private PrinterRESTConsumer.Type mPrinterType;
|
||||||
private String mReportName;
|
private String mReportName;
|
||||||
|
private boolean mFlagOnlyResiduo;
|
||||||
|
|
||||||
private static final int PICK_UL_REQUEST = 1; // The request code
|
private static final int PICK_UL_REQUEST = 1; // The request code
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static Intent createIntent(Context context, ArrayList<MtbColt> items, boolean canRecoverUl, PrinterRESTConsumer.Type printerType, String reportName) {
|
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, PrinterRESTConsumer.Type printerType, String reportName) {
|
||||||
|
return createIntent(context, items, canRecoverUlAction, printerType, true, reportName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Intent createIntent(Context context, List<MtbColt> items, boolean canRecoverUl, PrinterRESTConsumer.Type printerType, boolean onlyResiduo) {
|
||||||
|
return createIntent(context, items, input -> canRecoverUl, printerType, onlyResiduo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, PrinterRESTConsumer.Type printerType, boolean onlyResiduo) {
|
||||||
|
return createIntent(context, items, canRecoverUlAction, printerType, onlyResiduo, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, PrinterRESTConsumer.Type printerType, boolean onlyResiduo, String reportName) {
|
||||||
Intent myIntent = new Intent(context, ListaBancaliActivity.class);
|
Intent myIntent = new Intent(context, ListaBancaliActivity.class);
|
||||||
|
|
||||||
String mtbColtsKey = DataCache.addItem(items);
|
String mtbColtsKey = DataCache.addItem(items);
|
||||||
myIntent.putExtra(Key.MtbColtsKey, mtbColtsKey);
|
myIntent.putExtra(Key.MtbColtsKey, mtbColtsKey);
|
||||||
|
|
||||||
String canRecoverULKey = DataCache.addItem(canRecoverUl);
|
String canRecoverULKey = DataCache.addItem(canRecoverUlAction);
|
||||||
myIntent.putExtra(Key.CanRecoverUL, canRecoverULKey);
|
myIntent.putExtra(Key.CanRecoverUL, canRecoverULKey);
|
||||||
|
|
||||||
String printerTypeKey = DataCache.addItem(printerType);
|
String printerTypeKey = DataCache.addItem(printerType);
|
||||||
myIntent.putExtra(Key.PrinterType, printerTypeKey);
|
myIntent.putExtra(Key.PrinterType, printerTypeKey);
|
||||||
|
|
||||||
|
String flagOnlyResiduoKey = DataCache.addItem(onlyResiduo);
|
||||||
|
myIntent.putExtra(Key.FlagOnlyResiduo, flagOnlyResiduoKey);
|
||||||
|
|
||||||
String reportNameKey = DataCache.addItem(reportName);
|
String reportNameKey = DataCache.addItem(reportName);
|
||||||
myIntent.putExtra(Key.ReportName, reportNameKey);
|
myIntent.putExtra(Key.ReportName, reportNameKey);
|
||||||
|
|
||||||
return myIntent;
|
return myIntent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Intent createIntent(Context context, ArrayList<MtbColt> items, boolean canRecoverUl, PrinterRESTConsumer.Type printerType) {
|
|
||||||
Intent myIntent = new Intent(context, ListaBancaliActivity.class);
|
|
||||||
|
|
||||||
String mtbColtsKey = DataCache.addItem(items);
|
|
||||||
myIntent.putExtra(Key.MtbColtsKey, mtbColtsKey);
|
|
||||||
|
|
||||||
String canRecoverULKey = DataCache.addItem(canRecoverUl);
|
|
||||||
myIntent.putExtra(Key.CanRecoverUL, canRecoverULKey);
|
|
||||||
|
|
||||||
String printerTypeKey = DataCache.addItem(printerType);
|
|
||||||
myIntent.putExtra(Key.PrinterType, printerTypeKey);
|
|
||||||
|
|
||||||
return myIntent;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -81,9 +84,10 @@ public class ListaBancaliActivity extends BaseActivity {
|
|||||||
mCanRecoverUl = DataCache.retrieveItem(getIntent().getStringExtra(Key.CanRecoverUL));
|
mCanRecoverUl = DataCache.retrieveItem(getIntent().getStringExtra(Key.CanRecoverUL));
|
||||||
mPrinterType = DataCache.retrieveItem(getIntent().getStringExtra(Key.PrinterType));
|
mPrinterType = DataCache.retrieveItem(getIntent().getStringExtra(Key.PrinterType));
|
||||||
mReportName = DataCache.retrieveItem(getIntent().getStringExtra(Key.ReportName));
|
mReportName = DataCache.retrieveItem(getIntent().getStringExtra(Key.ReportName));
|
||||||
|
mFlagOnlyResiduo = DataCache.retrieveItem(getIntent().getStringExtra(Key.FlagOnlyResiduo));
|
||||||
|
|
||||||
List<MtbColt> mtbColts = DataCache.retrieveItem(getIntent().getStringExtra(Key.MtbColtsKey));
|
List<MtbColt> mtbColts = DataCache.retrieveItem(getIntent().getStringExtra(Key.MtbColtsKey));
|
||||||
mViewModel = new ListaBancaliViewModel(this, mtbColts);
|
mViewModel = new ListaBancaliViewModel(this, mtbColts, mFlagOnlyResiduo);
|
||||||
|
|
||||||
|
|
||||||
setSupportActionBar(this.bindings.toolbar);
|
setSupportActionBar(this.bindings.toolbar);
|
||||||
@@ -99,7 +103,7 @@ public class ListaBancaliActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void startContenutoBancaleActivity(MtbColt item){
|
public void startContenutoBancaleActivity(MtbColt item){
|
||||||
Intent myIntent = ContenutoBancaleActivity.createIntent(this, item, mCanRecoverUl, mPrinterType, mReportName);
|
Intent myIntent = ContenutoBancaleActivity.createIntent(this, item, mCanRecoverUl.run(item), mPrinterType, mReportName);
|
||||||
startActivityForResult(myIntent, PICK_UL_REQUEST);
|
startActivityForResult(myIntent, PICK_UL_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,11 +26,15 @@ public class ListaBancaliViewModel implements IRecyclerItemClicked<MtbColt> {
|
|||||||
|
|
||||||
private MainListListaColliAdapter mAdapter;
|
private MainListListaColliAdapter mAdapter;
|
||||||
|
|
||||||
public ListaBancaliViewModel(ListaBancaliActivity context, List<MtbColt> mtbColts){
|
private boolean mLoadOnlyResiduo;
|
||||||
|
|
||||||
|
public ListaBancaliViewModel(ListaBancaliActivity context, List<MtbColt> mtbColts, boolean loadOnlyResiduo){
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mMtbColts = new ObservableArrayList<>();
|
mMtbColts = new ObservableArrayList<>();
|
||||||
mMtbColts.addAll(mtbColts);
|
mMtbColts.addAll(mtbColts);
|
||||||
|
|
||||||
|
this.mLoadOnlyResiduo = loadOnlyResiduo;
|
||||||
|
|
||||||
initRecyclerView();
|
initRecyclerView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,10 +60,10 @@ public class ListaBancaliViewModel implements IRecyclerItemClicked<MtbColt> {
|
|||||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ColliMagazzinoRESTConsumer.getByTestataStatic(item, true, false, mtbColt -> {
|
ColliMagazzinoRESTConsumer.getByTestataStatic(item, mLoadOnlyResiduo, false, mtbColt -> {
|
||||||
|
|
||||||
ObservableArrayList<MtbColr> mtbColrObservableArrayList = new ObservableArrayList<>();
|
ObservableArrayList<MtbColr> mtbColrObservableArrayList = new ObservableArrayList<>();
|
||||||
mtbColrObservableArrayList.addAll(mtbColt.getMtbColr());
|
if(mtbColt != null && mtbColt.getMtbColr() != null) mtbColrObservableArrayList.addAll(mtbColt.getMtbColr());
|
||||||
item.setMtbColr(mtbColrObservableArrayList);
|
item.setMtbColr(mtbColrObservableArrayList);
|
||||||
|
|
||||||
progress.dismiss();
|
progress.dismiss();
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import it.integry.integrywmsnative.gest.login.LoginActivity;
|
|||||||
import it.integry.integrywmsnative.gest.login.core.LoginHelper;
|
import it.integry.integrywmsnative.gest.login.core.LoginHelper;
|
||||||
import it.integry.integrywmsnative.gest.login.dto.LoginAziendaDTO;
|
import it.integry.integrywmsnative.gest.login.dto.LoginAziendaDTO;
|
||||||
import it.integry.integrywmsnative.gest.login.dto.LoginDTO;
|
import it.integry.integrywmsnative.gest.login.dto.LoginDTO;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
public class LoginViewModel {
|
public class LoginViewModel {
|
||||||
|
|
||||||
@@ -192,22 +192,22 @@ public class LoginViewModel {
|
|||||||
private void onLoginFailed(final Spanned message){
|
private void onLoginFailed(final Spanned message){
|
||||||
mProgress.dismiss();
|
mProgress.dismiss();
|
||||||
loginButtonEnabled.set(true);
|
loginButtonEnabled.set(true);
|
||||||
mActivity.runOnUiThread(() -> DialogSimpleMessageHelper.makeErrorDialog(
|
mActivity.runOnUiThread(() -> DialogSimpleMessageView.makeErrorDialog(
|
||||||
mActivity,
|
|
||||||
message,
|
message,
|
||||||
null,
|
null,
|
||||||
null).show());
|
null)
|
||||||
|
.show(mActivity.getSupportFragmentManager(), "tag"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void onLoginSuccess(final String title, final Spanned message, final String host, final int port, final List<String> availableProfiles){
|
private void onLoginSuccess(final String title, final Spanned message, final String host, final int port, final List<String> availableProfiles){
|
||||||
mProgress.dismiss();
|
mProgress.dismiss();
|
||||||
mActivity.runOnUiThread(() -> DialogSimpleMessageHelper.makeSuccessDialog(
|
mActivity.runOnUiThread(() -> DialogSimpleMessageView.makeSuccessDialog(
|
||||||
mActivity,
|
|
||||||
title,
|
title,
|
||||||
message,
|
message,
|
||||||
null,
|
null,
|
||||||
() -> showProfileDBSelectionDialog(host, port, availableProfiles)).show());
|
() -> showProfileDBSelectionDialog(host, port, availableProfiles))
|
||||||
|
.show(mActivity.getSupportFragmentManager(), "tag"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showProfileDBSelectionDialog(final String host, final int port, final List<String> availableProfiles){
|
private void showProfileDBSelectionDialog(final String host, final int port, final List<String> availableProfiles){
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
|||||||
|
|
||||||
private FragmentMainBinding mBindings;
|
private FragmentMainBinding mBindings;
|
||||||
|
|
||||||
private Runnable mOnPreDestroy;
|
private final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||||
private ElevatedToolbar mToolbar;
|
private ElevatedToolbar mToolbar;
|
||||||
|
|
||||||
private LayoutInflater mLayoutInflater;
|
private LayoutInflater mLayoutInflater;
|
||||||
@@ -89,7 +89,9 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
if (mOnPreDestroy != null) mOnPreDestroy.run();
|
for (Runnable onPreDestroy : mOnPreDestroyList) {
|
||||||
|
onPreDestroy.run();
|
||||||
|
}
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,11 +215,6 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
|||||||
mToolbar = toolbar;
|
mToolbar = toolbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setOnPreDestroy(Runnable onPreDestroy) {
|
|
||||||
mOnPreDestroy = onPreDestroy;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void initGestMenu() {
|
private void initGestMenu() {
|
||||||
ICustomConfiguration customConfiguration = ClassRouter.getInstance(ClassRouter.PATH.CUSTOM_CONFIGURATION);
|
ICustomConfiguration customConfiguration = ClassRouter.getInstance(ClassRouter.PATH.CUSTOM_CONFIGURATION);
|
||||||
@@ -257,4 +254,9 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
|||||||
String appVersion = UtilityResources.getAppVersion();
|
String appVersion = UtilityResources.getAppVersion();
|
||||||
mBindings.currentAppVersionName.setText("v" + appVersion);
|
mBindings.currentAppVersionName.setText("v" + appVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addOnPreDestroy(Runnable onPreDestroy) {
|
||||||
|
this.mOnPreDestroyList.add(onPreDestroy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ package it.integry.integrywmsnative.gest.main;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.core.content.res.ResourcesCompat;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -42,7 +42,7 @@ public class MenuListAdapter extends RecyclerView.Adapter<MenuListAdapter.ViewHo
|
|||||||
// binds the data to the TextView in each cell
|
// binds the data to the TextView in each cell
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||||
holder.mIcon.setImageDrawable(mContext.getResources().getDrawable(mDataset.get(position).getTitleIcon(), null));
|
holder.mIcon.setImageDrawable(ResourcesCompat.getDrawable(mContext.getResources(), mDataset.get(position).getTitleIcon(), null));
|
||||||
holder.mTitle.setText(mContext.getResources().getString(mDataset.get(position).getTitleText()));
|
holder.mTitle.setText(mContext.getResources().getString(mDataset.get(position).getTitleText()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface OrdiniUscitaElencoComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
OrdiniUscitaElencoComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(OrdiniUscitaElencoFragment ordiniUscitaElencoFragment);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityReflections;
|
||||||
|
|
||||||
|
public class OrdiniUscitaElencoDTO extends OrdineUscitaInevasoDTO {
|
||||||
|
|
||||||
|
private boolean hidden = false;
|
||||||
|
|
||||||
|
public static OrdiniUscitaElencoDTO fromParent(OrdineUscitaInevasoDTO parent) throws Exception {
|
||||||
|
OrdiniUscitaElencoDTO child = new OrdiniUscitaElencoDTO();
|
||||||
|
UtilityReflections.copy(parent, child);
|
||||||
|
return child;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isHidden() {
|
||||||
|
return hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrdiniUscitaElencoDTO setHidden(boolean hidden) {
|
||||||
|
this.hidden = hidden;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,370 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
|
import androidx.core.content.res.ResourcesCompat;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
|
import com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.IFilterableFragment;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.ISelectAllFragment;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
|
import it.integry.integrywmsnative.databinding.FragmentMainOrdiniUscitaBinding;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.dialogs.DialogVenditaFiltroAvanzato;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.dialogs.DialogVenditaFiltroAvanzatoViewModel;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.list.OrdiniUscitaElencoAdapter;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.list.OrdiniUscitaElencoListModel;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione.SpedizioneActivity;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.BaseDialogRowInfoView;
|
||||||
|
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
|
public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledFragment, IScrollableFragment, ISelectAllFragment, IFilterableFragment, OrdiniUscitaElencoViewModel.Listener {
|
||||||
|
|
||||||
|
public BindableBoolean fabVisible = new BindableBoolean(false);
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
OrdiniUscitaElencoViewModel mViewModel;
|
||||||
|
|
||||||
|
private FragmentMainOrdiniUscitaBinding mBindings = null;
|
||||||
|
|
||||||
|
private final ObservableArrayList<OrdiniUscitaElencoListModel> mOrdiniInevasiMutableData = new ObservableArrayList<>();
|
||||||
|
|
||||||
|
private GestioneEnum mCurrentGestioneOrd = null;
|
||||||
|
private GestioneEnum mCurrentGestioneCol = null;
|
||||||
|
private int mCurrentSegnoCol = 0;
|
||||||
|
private Class<? extends BaseDialogRowInfoView> mDialogRowInfo;
|
||||||
|
|
||||||
|
private ElevatedToolbar mToolbar;
|
||||||
|
private final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||||
|
|
||||||
|
private int barcodeScannerIstanceID = -1;
|
||||||
|
|
||||||
|
|
||||||
|
public OrdiniUscitaElencoFragment() {
|
||||||
|
// Required empty public constructor
|
||||||
|
}
|
||||||
|
|
||||||
|
public static OrdiniUscitaElencoFragment newInstance(GestioneEnum gestioneOrd, GestioneEnum gestioneCol, int segnoCol, Class<? extends BaseDialogRowInfoView> dialogRowInfo) {
|
||||||
|
OrdiniUscitaElencoFragment fragment = new OrdiniUscitaElencoFragment();
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
|
||||||
|
args.putString("gestioneOrd", gestioneOrd.getText());
|
||||||
|
args.putString("gestioneCol", gestioneCol != null ? gestioneCol.getText() : null);
|
||||||
|
args.putInt("segnoCol", segnoCol);
|
||||||
|
|
||||||
|
String keyDialogRowInfo = DataCache.addItem(dialogRowInfo);
|
||||||
|
args.putString("keyDialogRowInfo", keyDialogRowInfo);
|
||||||
|
|
||||||
|
fragment.setArguments(args);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
mCurrentGestioneOrd = GestioneEnum.fromString(getArguments().getString("gestioneOrd"));
|
||||||
|
String gestioneCol = getArguments().getString("gestioneCol");
|
||||||
|
mCurrentGestioneCol = gestioneCol != null ? GestioneEnum.fromString(gestioneCol) : null;
|
||||||
|
mCurrentSegnoCol = getArguments().getInt("segnoCol");
|
||||||
|
|
||||||
|
String keyDialogRowInfo = getArguments().getString("keyDialogRowInfo");
|
||||||
|
mDialogRowInfo = DataCache.retrieveItem(keyDialogRowInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.fragment_main_ordini_uscita, container, false);
|
||||||
|
|
||||||
|
MainApplication.appComponent
|
||||||
|
.prodOrdineLavorazioneElencoComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
|
mViewModel.setListener(this);
|
||||||
|
|
||||||
|
mBindings.setLifecycleOwner(this);
|
||||||
|
mBindings.setView(this);
|
||||||
|
mBindings.setViewmodel(mViewModel);
|
||||||
|
|
||||||
|
this.initRecyclerView();
|
||||||
|
this.initBarcodeReader();
|
||||||
|
|
||||||
|
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||||
|
mViewModel.init(codMdep, mCurrentGestioneOrd, mCurrentGestioneCol, mCurrentSegnoCol);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
|
||||||
|
if(mAppliedFilterViewModel != null) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||||
|
|
||||||
|
for (Runnable onPreDestroy : mOnPreDestroyList) {
|
||||||
|
onPreDestroy.run();
|
||||||
|
}
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initRecyclerView() {
|
||||||
|
|
||||||
|
boolean canSelectMultipleOrdini = SettingsManager.iDB().isFlagSpedizioneCanSelectMultipleOrders();
|
||||||
|
boolean canSelectMultipleClienti = SettingsManager.iDB().isFlagMultiClienteOrdV();
|
||||||
|
|
||||||
|
this.mViewModel.getOrderList().observe(getViewLifecycleOwner(), this::refreshList);
|
||||||
|
|
||||||
|
OrdiniUscitaElencoAdapter ordiniUscitaElencoAdapter =
|
||||||
|
new OrdiniUscitaElencoAdapter(getActivity(), mOrdiniInevasiMutableData)
|
||||||
|
.setEmptyView(this.mBindings.ordiniVenditaEmptyView)
|
||||||
|
.setOnGroupItemClicked(x -> {
|
||||||
|
if(!canSelectMultipleClienti) {
|
||||||
|
Stream.of(mOrdiniInevasiMutableData)
|
||||||
|
.filter(y -> !y.getGroupTitle().equalsIgnoreCase(x) && y.getSelectedObservable().get())
|
||||||
|
.forEach(y -> y.getSelectedObservable().set(false));
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean allSelected = Stream.of(mOrdiniInevasiMutableData)
|
||||||
|
.filter(y -> y.getGroupTitle().equalsIgnoreCase(x))
|
||||||
|
.allMatch(y -> y.getSelectedObservable().get());
|
||||||
|
|
||||||
|
Stream.of(mOrdiniInevasiMutableData)
|
||||||
|
.filter(y -> y.getGroupTitle().equalsIgnoreCase(x))
|
||||||
|
.forEach(y -> y.getSelectedObservable().set(!allSelected));
|
||||||
|
})
|
||||||
|
.setOnItemChecked(x -> {
|
||||||
|
if(!canSelectMultipleClienti && x.getSelectedObservable().get()) {
|
||||||
|
Stream.of(mOrdiniInevasiMutableData)
|
||||||
|
.filter(y -> !y.getGroupTitle().equalsIgnoreCase(x.getGroupTitle()) && y.getSelectedObservable().get())
|
||||||
|
.forEach(y -> y.getSelectedObservable().set(false));
|
||||||
|
}
|
||||||
|
|
||||||
|
fabVisible.set(Stream.of(mOrdiniInevasiMutableData)
|
||||||
|
.anyMatch(y -> y.getSelectedObservable().get()));
|
||||||
|
});
|
||||||
|
|
||||||
|
this.mBindings.venditaMainList.setAdapter(ordiniUscitaElencoAdapter);
|
||||||
|
this.mBindings.venditaMainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
|
|
||||||
|
if(mToolbar != null)
|
||||||
|
mToolbar.setRecyclerView(this.mBindings.venditaMainList);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initBarcodeReader() {
|
||||||
|
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||||
|
.setOnScanSuccessfull(onScanSuccessful)
|
||||||
|
.setOnScanFailed(ex -> UtilityExceptions.defaultException(getActivity(), ex, false)));
|
||||||
|
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
this.openProgress();
|
||||||
|
|
||||||
|
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||||
|
BarcodeManager.enable();
|
||||||
|
this.closeProgress();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
private void refreshList(List<OrdiniUscitaElencoDTO> orderList) {
|
||||||
|
this.mOrdiniInevasiMutableData.clear();
|
||||||
|
this.mOrdiniInevasiMutableData.addAll(convertDataModelToListModel(orderList));
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<OrdiniUscitaElencoListModel> convertDataModelToListModel(List<OrdiniUscitaElencoDTO> dataList) {
|
||||||
|
|
||||||
|
ComparatorCompat<OrdiniUscitaElencoDTO> comparator = ComparatorCompat
|
||||||
|
.comparing(OrdiniUscitaElencoDTO::getRagSocOrd)
|
||||||
|
.thenComparing(ComparatorCompat.comparing(x -> x.getDestinatario() != null ? x.getDestinatario() : "zzzzzzzzz"))
|
||||||
|
.thenComparing(ComparatorCompat.comparing(OrdiniUscitaElencoDTO::getNumOrd));
|
||||||
|
|
||||||
|
List<OrdiniUscitaElencoListModel> notHiddenElements = Stream.of(dataList)
|
||||||
|
.filter(x -> !x.isHidden())
|
||||||
|
.sorted(comparator)
|
||||||
|
.map(x -> {
|
||||||
|
OrdiniUscitaElencoListModel listModel = new OrdiniUscitaElencoListModel();
|
||||||
|
|
||||||
|
if (x.isFlagEvaso()) {
|
||||||
|
listModel.setEtichettaColor(ResourcesCompat.getColor(getResources(), R.color.mainGreen, null));
|
||||||
|
} else if (x.isExistColloBoolean()) {
|
||||||
|
listModel.setEtichettaColor(ResourcesCompat.getColor(getResources(), R.color.colorPrimary, null));
|
||||||
|
} else {
|
||||||
|
listModel.setEtichettaColor(ResourcesCompat.getColor(getResources(), android.R.color.transparent, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
listModel.setGroupTitle(x.getRagSocOrd());
|
||||||
|
|
||||||
|
String testataOrdString = String.format(getString(R.string.ord_ven_testata), String.valueOf(x.getNumOrd()), UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||||
|
listModel.setDescription(testataOrdString);
|
||||||
|
|
||||||
|
listModel.setSubDescription(x.getRifOrd());
|
||||||
|
|
||||||
|
String testataDataConsString = String.format(getString(R.string.ord_ven_testata_data_cons), UtilityDate.formatDate(x.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||||
|
listModel.setRightDescription(testataDataConsString);
|
||||||
|
|
||||||
|
listModel.setOriginalModel(x);
|
||||||
|
|
||||||
|
return listModel;
|
||||||
|
})
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
return notHiddenElements;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
Stream.of(this.mOrdiniInevasiMutableData)
|
||||||
|
.forEach(x -> x.getSelectedObservable().set(false));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||||
|
titleText.setText(context.getText(R.string.prod_ordine_lavorazione_title_fragment).toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void dispatchOrders() {
|
||||||
|
List<OrdiniUscitaElencoDTO> selectedOrders = Stream.of(this.mOrdiniInevasiMutableData)
|
||||||
|
.filter(x -> x.getSelectedObservable().get())
|
||||||
|
.map(OrdiniUscitaElencoListModel::getOriginalModel)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
this.mViewModel.loadPicking(selectedOrders);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoadingStarted() {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
this.openProgress();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoadingEnded() {
|
||||||
|
this.closeProgress();
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Exception ex) {
|
||||||
|
this.closeProgress();
|
||||||
|
UtilityExceptions.defaultException(getActivity(), ex, mCurrentProgress);
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onOrderFiltered(List<OrdiniUscitaElencoDTO> filteredOrders) {
|
||||||
|
refreshList(filteredOrders);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onOrdersDispatched(List<OrdineUscitaInevasoDTO> orders, List<SitArtOrdDTO> sitArts, List<MtbColt> alreadyRegisteredMtbColts) {
|
||||||
|
List<String> codMarts = Stream.of(sitArts)
|
||||||
|
.distinctBy(SitArtOrdDTO::getCodMart)
|
||||||
|
.map(SitArtOrdDTO::getCodMart)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
int alreadyRegisteredUL = alreadyRegisteredMtbColts.size();
|
||||||
|
|
||||||
|
DialogSimpleMessageView.makeInfoDialog(getText(R.string.orders).toString(),
|
||||||
|
Html.fromHtml(String.format(getActivity().getResources().getQuantityString(R.plurals.loaded_orders_message, orders.size()), orders.size())
|
||||||
|
+ "<br />" +
|
||||||
|
"<b>" + codMarts.size() + "</b> " + getActivity().getResources().getQuantityString(R.plurals.available_articles, codMarts.size())
|
||||||
|
+ "<br />" +
|
||||||
|
"<b>" + alreadyRegisteredUL + "</b> " + getActivity().getResources().getQuantityString(R.plurals.already_registered_lu, alreadyRegisteredUL)),
|
||||||
|
null,
|
||||||
|
() -> SpedizioneActivity.startActivity(getActivity(), sitArts, orders, alreadyRegisteredMtbColts, mCurrentGestioneCol, mCurrentSegnoCol, MtbColr.Causale.DEFAULT, mDialogRowInfo)
|
||||||
|
).show(getActivity().getSupportFragmentManager(), "tag");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
||||||
|
mToolbar = toolbar;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSelectAllButtonEnabled() {
|
||||||
|
return SettingsManager.iDB().isFlagMultiClienteOrdV();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSelectAll() {
|
||||||
|
boolean allSelected = Stream.of(mOrdiniInevasiMutableData)
|
||||||
|
.allMatch(x -> x.getSelectedObservable().get());
|
||||||
|
|
||||||
|
Stream.of(mOrdiniInevasiMutableData)
|
||||||
|
.filter(x -> !x.getOriginalModel().isHidden())
|
||||||
|
.forEach(x -> x.getSelectedObservable().set(!allSelected));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private DialogVenditaFiltroAvanzatoViewModel mAppliedFilterViewModel;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFilterClick() {
|
||||||
|
DialogVenditaFiltroAvanzato.make(
|
||||||
|
getActivity(),
|
||||||
|
this.mViewModel.getOrderList().getValue(),
|
||||||
|
mAppliedFilterViewModel,
|
||||||
|
|
||||||
|
(filteredOrderList, filter) -> {
|
||||||
|
mAppliedFilterViewModel = filter;
|
||||||
|
|
||||||
|
if(filteredOrderList != null){
|
||||||
|
refreshList(filteredOrderList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addOnPreDestroy(Runnable onPreDestroy) {
|
||||||
|
this.mOnPreDestroyList.add(onPreDestroy);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
import dagger.Provides;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.rest.OrdiniUscitaElencoRESTConsumer;
|
||||||
|
|
||||||
|
@Module(subcomponents = OrdiniUscitaElencoComponent.class)
|
||||||
|
public class OrdiniUscitaElencoModule {
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
@Provides
|
||||||
|
OrdiniUscitaElencoRESTConsumer providesOrdiniUscitaElencoRESTConsumer() {
|
||||||
|
return new OrdiniUscitaElencoRESTConsumer();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
OrdiniUscitaElencoViewModel providesProdOrdineLavorazioneElencoViewModel(OrdiniRESTConsumer ordiniRESTConsumer, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, OrdiniUscitaElencoRESTConsumer ordiniUscitaElencoRESTConsumer) {
|
||||||
|
return new OrdiniUscitaElencoViewModel(ordiniRESTConsumer, colliMagazzinoRESTConsumer, barcodeRESTConsumer, ordiniUscitaElencoRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,295 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco;
|
||||||
|
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.integrywmsnative.core.exception.InvalidLUGestioneException;
|
||||||
|
import it.integry.integrywmsnative.core.exception.InvalidLUMultiCodMdepException;
|
||||||
|
import it.integry.integrywmsnative.core.exception.InvalidLUMultiGestioneException;
|
||||||
|
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||||
|
import it.integry.integrywmsnative.core.exception.NoOrderFoundException;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
|
import it.integry.integrywmsnative.core.model.DtbOrdt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
||||||
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.rest.OrdiniUscitaElencoRESTConsumer;
|
||||||
|
|
||||||
|
public class OrdiniUscitaElencoViewModel {
|
||||||
|
|
||||||
|
private final MutableLiveData<List<OrdiniUscitaElencoDTO>> mOrderList = new MutableLiveData<>();
|
||||||
|
|
||||||
|
private final OrdiniRESTConsumer mOrdiniRESTConsumer;
|
||||||
|
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||||
|
private final BarcodeRESTConsumer mBarcodeRESTConsumer;
|
||||||
|
private final OrdiniUscitaElencoRESTConsumer mOrdiniUscitaElencoRESTConsumer;
|
||||||
|
|
||||||
|
private Listener mListener;
|
||||||
|
private String mCurrentCodMdep;
|
||||||
|
private GestioneEnum mCurrentGestioneOrd;
|
||||||
|
private GestioneEnum mCurrentGestioneCol;
|
||||||
|
private int mCurrentSegnoCol;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public OrdiniUscitaElencoViewModel(OrdiniRESTConsumer ordiniRESTConsumer, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, OrdiniUscitaElencoRESTConsumer ordiniUscitaElencoRESTConsumer) {
|
||||||
|
this.mOrdiniRESTConsumer = ordiniRESTConsumer;
|
||||||
|
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||||
|
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||||
|
this.mOrdiniUscitaElencoRESTConsumer = ordiniUscitaElencoRESTConsumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void init(String currentCodMdep, GestioneEnum gestioneOrd, GestioneEnum gestioneCol, int segnoCol) {
|
||||||
|
this.mCurrentCodMdep = currentCodMdep;
|
||||||
|
this.mCurrentGestioneOrd = gestioneOrd;
|
||||||
|
this.mCurrentGestioneCol = gestioneCol;
|
||||||
|
this.mCurrentSegnoCol = segnoCol;
|
||||||
|
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
|
new Thread(() -> {
|
||||||
|
Date loadingStartDate = new Date();
|
||||||
|
|
||||||
|
this.mOrdiniRESTConsumer.getOrdiniInevasi(this.mCurrentCodMdep, mCurrentGestioneOrd,
|
||||||
|
ordiniLavorazione -> {
|
||||||
|
this.mOrderList.postValue(Stream.of(ordiniLavorazione)
|
||||||
|
.map(x -> {
|
||||||
|
try {
|
||||||
|
return OrdiniUscitaElencoDTO.fromParent(x);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
long forcedDelaySecs = (new Date().getTime() - loadingStartDate.getTime()) / 1000;
|
||||||
|
|
||||||
|
if(2 - forcedDelaySecs > 0) {
|
||||||
|
try {
|
||||||
|
Thread.sleep((2 - forcedDelaySecs) * 1000);
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
}, this::sendError);
|
||||||
|
}).start();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void loadPicking(List<OrdiniUscitaElencoDTO> selectedOrders) {
|
||||||
|
List<GestioneEnum> foundGestioni = Stream.of(selectedOrders)
|
||||||
|
.map(OrdineUscitaInevasoDTO::getGestioneEnum)
|
||||||
|
.withoutNulls()
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
if(foundGestioni != null && foundGestioni.size() > 1) {
|
||||||
|
this.sendError(new InvalidLUMultiGestioneException());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
List<String> foundCodMdep = Stream.of(selectedOrders)
|
||||||
|
.map(OrdineUscitaInevasoDTO::getCodMdep)
|
||||||
|
.withoutNulls()
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
if(foundCodMdep != null && foundCodMdep.size() > 1) {
|
||||||
|
this.sendError(new InvalidLUMultiCodMdepException());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
|
List<OrdineUscitaInevasoDTO> selectedOrdersBase = Stream.of(selectedOrders)
|
||||||
|
.map(x -> (OrdineUscitaInevasoDTO) x)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
this.mOrdiniRESTConsumer.retrieveListaArticoliFromOrdiniUscita(selectedOrdersBase, sitArts -> {
|
||||||
|
|
||||||
|
this.mOrdiniRESTConsumer.getBancaliGiaRegistrati(
|
||||||
|
Stream.of(selectedOrdersBase).map(x -> (OrdineInevasoDTO) x).toList(),
|
||||||
|
mCurrentGestioneCol,
|
||||||
|
mCurrentSegnoCol,
|
||||||
|
mtbColtList -> {
|
||||||
|
this.sendOnOrdersDispatched(selectedOrdersBase, sitArts, mtbColtList);
|
||||||
|
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
}, this::sendError);
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||||
|
|
||||||
|
RunnableArgs<List<OrdiniUscitaElencoDTO>> onBarcodeScanComplete = orderList -> {
|
||||||
|
onComplete.run();
|
||||||
|
this.sendOnOrderFiltered(orderList);
|
||||||
|
};
|
||||||
|
|
||||||
|
if(UtilityBarcode.isBarcodeOrdineV(barcodeScanDTO)) {
|
||||||
|
this.executeEtichettaOrdineV(barcodeScanDTO.getStringValue(), onBarcodeScanComplete);
|
||||||
|
} else if(UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
||||||
|
this.executeEtichettaLU(barcodeScanDTO.getStringValue(), onBarcodeScanComplete);
|
||||||
|
} else if(UtilityBarcode.isEtichetta128(barcodeScanDTO)){
|
||||||
|
this.executeEtichettaEan128(barcodeScanDTO, onBarcodeScanComplete);
|
||||||
|
} else {
|
||||||
|
onComplete.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void executeEtichettaOrdineV(String barcode, RunnableArgs<List<OrdiniUscitaElencoDTO>> onComplete) {
|
||||||
|
String gestione = "";
|
||||||
|
|
||||||
|
char c = barcode.charAt(0);
|
||||||
|
if (c == '1')
|
||||||
|
gestione = "A";
|
||||||
|
else if (c == '2')
|
||||||
|
gestione = "L";
|
||||||
|
else if (c == '3')
|
||||||
|
gestione = "V";
|
||||||
|
|
||||||
|
int numOrd = Integer.parseInt(UtilityString.mid(barcode, 10));
|
||||||
|
|
||||||
|
Date date = null;
|
||||||
|
try {
|
||||||
|
date = new SimpleDateFormat("ddMMyyyy")
|
||||||
|
.parse(UtilityString.mid(barcode, 2, 8));
|
||||||
|
} catch (ParseException ex) {
|
||||||
|
this.sendError(ex);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
final String finalGestione = gestione;
|
||||||
|
final Date finalDate = date;
|
||||||
|
|
||||||
|
List<OrdiniUscitaElencoDTO> filteredOrders = Stream.of(mOrderList.getValue())
|
||||||
|
.filter(x -> x.getNumOrd() == numOrd && x.getGestione().equalsIgnoreCase(finalGestione) && x.getDataOrdD().equals(finalDate)).toList();
|
||||||
|
|
||||||
|
onComplete.run(filteredOrders);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void executeEtichettaLU(String SSCC, RunnableArgs<List<OrdiniUscitaElencoDTO>> onComplete) {
|
||||||
|
this.mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
||||||
|
|
||||||
|
if(mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||||
|
|
||||||
|
if(mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) {
|
||||||
|
//GET BY COMMESSA COLLO
|
||||||
|
this.mOrdiniUscitaElencoRESTConsumer.getOrdiniFromCommessaCollo(mCurrentCodMdep, mtbColt, orderList -> {
|
||||||
|
|
||||||
|
if(orderList != null && orderList.size() > 0) {
|
||||||
|
List<Integer> numOrds = Stream.of(orderList)
|
||||||
|
.map(DtbOrdt::getNumOrd)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
List<OrdiniUscitaElencoDTO> filteredOrders = Stream.of(mOrderList.getValue())
|
||||||
|
.filter(x -> numOrds.contains(x.getNumOrd())).toList();
|
||||||
|
|
||||||
|
onComplete.run(filteredOrders);
|
||||||
|
} else {
|
||||||
|
this.sendError(new NoOrderFoundException());
|
||||||
|
}
|
||||||
|
|
||||||
|
}, this::sendError);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.sendError(new InvalidLUGestioneException(GestioneEnum.VENDITA));
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.sendError(new NoLUFoundException());
|
||||||
|
}
|
||||||
|
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO, RunnableArgs<List<OrdiniUscitaElencoDTO>> onComplete) {
|
||||||
|
this.mBarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
||||||
|
String barcodeProd = null;
|
||||||
|
|
||||||
|
if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
|
||||||
|
if(!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
|
||||||
|
if(!UtilityString.isNullOrEmpty(ean128Model.Content)) barcodeProd = ean128Model.Content;
|
||||||
|
|
||||||
|
|
||||||
|
if(!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||||
|
|
||||||
|
if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)){
|
||||||
|
this.executeEtichettaLU(ean128Model.Sscc, onComplete);
|
||||||
|
} else {
|
||||||
|
this.sendError(new NoLUFoundException());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
|
||||||
|
this.sendError(new NoLUFoundException());
|
||||||
|
}
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MutableLiveData<List<OrdiniUscitaElencoDTO>> getOrderList() {
|
||||||
|
return mOrderList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrdiniUscitaElencoViewModel setListener(Listener listener) {
|
||||||
|
this.mListener = listener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnLoadingStarted() {
|
||||||
|
if (this.mListener != null) mListener.onLoadingStarted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnLoadingEnded() {
|
||||||
|
if (this.mListener != null) mListener.onLoadingEnded();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendError(Exception ex) {
|
||||||
|
if (this.mListener != null) mListener.onError(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnOrderFiltered(List<OrdiniUscitaElencoDTO> filteredOrders) {
|
||||||
|
if (this.mListener != null) mListener.onOrderFiltered(filteredOrders);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnOrdersDispatched(List<OrdineUscitaInevasoDTO> orders, List<SitArtOrdDTO> sitArts, List<MtbColt> alreadyRegisteredMtbColts) {
|
||||||
|
if (this.mListener != null) mListener.onOrdersDispatched(orders, sitArts, alreadyRegisteredMtbColts);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface Listener extends ILoadingListener {
|
||||||
|
|
||||||
|
void onError(Exception ex);
|
||||||
|
|
||||||
|
void onOrderFiltered(List<OrdiniUscitaElencoDTO> filteredOrders);
|
||||||
|
|
||||||
|
void onOrdersDispatched(List<OrdineUscitaInevasoDTO> orders, List<SitArtOrdDTO> sitArts, List<MtbColt> alreadyRegisteredMtbColts);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package it.integry.integrywmsnative.gest.vendita.dialogs;
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.dialogs;
|
||||||
|
|
||||||
import android.app.DatePickerDialog;
|
import android.app.DatePickerDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -28,19 +28,19 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.databinding.DialogVenditaFiltroAvanzatoBinding;
|
import it.integry.integrywmsnative.databinding.DialogVenditaFiltroAvanzatoBinding;
|
||||||
import it.integry.integrywmsnative.gest.vendita.dto.OrdineVenditaInevasoDTO;
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoDTO;
|
||||||
|
|
||||||
|
|
||||||
public class DialogVenditaFiltroAvanzato {
|
public class DialogVenditaFiltroAvanzato {
|
||||||
|
|
||||||
|
|
||||||
private AlertDialog currentAlert;
|
private final AlertDialog currentAlert;
|
||||||
private Context currentContext;
|
private final Context currentContext;
|
||||||
|
|
||||||
private RunnableArgss<List<OrdineVenditaInevasoDTO>, DialogVenditaFiltroAvanzatoViewModel> currentOnFilterDone;
|
private final RunnableArgss<List<OrdiniUscitaElencoDTO>, DialogVenditaFiltroAvanzatoViewModel> currentOnFilterDone;
|
||||||
|
|
||||||
private List<OrdineVenditaInevasoDTO> currentOrderList;
|
private final List<OrdiniUscitaElencoDTO> currentOrderList;
|
||||||
private List<OrdineVenditaInevasoDTO> currentFilteredOrderList;
|
private List<OrdiniUscitaElencoDTO> currentFilteredOrderList;
|
||||||
|
|
||||||
private ArrayAdapter<String> arrayAdapterCodMdep;
|
private ArrayAdapter<String> arrayAdapterCodMdep;
|
||||||
private ArrayAdapter<String> arrayAdapterIdViaggio;
|
private ArrayAdapter<String> arrayAdapterIdViaggio;
|
||||||
@@ -50,31 +50,33 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
private ArrayAdapter<String> arrayAdapterVettore;
|
private ArrayAdapter<String> arrayAdapterVettore;
|
||||||
private ArrayAdapter<String> arrayAdapterAgente;
|
private ArrayAdapter<String> arrayAdapterAgente;
|
||||||
private ArrayAdapter<String> arrayAdapterAutomezzo;
|
private ArrayAdapter<String> arrayAdapterAutomezzo;
|
||||||
|
private ArrayAdapter<String> arrayAdapterPaese;
|
||||||
|
|
||||||
private Predicate<OrdineVenditaInevasoDTO> currentDepositoPredicate = null;
|
private Predicate<OrdiniUscitaElencoDTO> currentDepositoPredicate = null;
|
||||||
private Predicate<OrdineVenditaInevasoDTO> currentIdViaggioPredicate = null;
|
private Predicate<OrdiniUscitaElencoDTO> currentIdViaggioPredicate = null;
|
||||||
private Predicate<OrdineVenditaInevasoDTO> currentNumOrdsPredicate = null;
|
private Predicate<OrdiniUscitaElencoDTO> currentNumOrdsPredicate = null;
|
||||||
private Predicate<OrdineVenditaInevasoDTO> currentClientePredicate = null;
|
private Predicate<OrdiniUscitaElencoDTO> currentClientePredicate = null;
|
||||||
private Predicate<OrdineVenditaInevasoDTO> currentDataConsPredicate = null;
|
private Predicate<OrdiniUscitaElencoDTO> currentDataConsPredicate = null;
|
||||||
private Predicate<OrdineVenditaInevasoDTO> currentTermConsPredicate = null;
|
private Predicate<OrdiniUscitaElencoDTO> currentTermConsPredicate = null;
|
||||||
private Predicate<OrdineVenditaInevasoDTO> currentVettorePredicate = null;
|
private Predicate<OrdiniUscitaElencoDTO> currentVettorePredicate = null;
|
||||||
private Predicate<OrdineVenditaInevasoDTO> currentAgentePredicate = null;
|
private Predicate<OrdiniUscitaElencoDTO> currentAgentePredicate = null;
|
||||||
private Predicate<OrdineVenditaInevasoDTO> currentAutomezzoPredicate = null;
|
private Predicate<OrdiniUscitaElencoDTO> currentAutomezzoPredicate = null;
|
||||||
|
private Predicate<OrdiniUscitaElencoDTO> currentPaesePredicate = null;
|
||||||
|
|
||||||
private boolean firstInit = true;
|
private boolean firstInit = true;
|
||||||
|
|
||||||
public static AlertDialog make(final Context context, final List<OrdineVenditaInevasoDTO> ordersList, RunnableArgss<List<OrdineVenditaInevasoDTO>, DialogVenditaFiltroAvanzatoViewModel> onDismiss) {
|
public static AlertDialog make(final Context context, final List<OrdiniUscitaElencoDTO> ordersList, RunnableArgss<List<OrdiniUscitaElencoDTO>, DialogVenditaFiltroAvanzatoViewModel> onDismiss) {
|
||||||
return new DialogVenditaFiltroAvanzato(context, ordersList, null, onDismiss).currentAlert;
|
return new DialogVenditaFiltroAvanzato(context, ordersList, null, onDismiss).currentAlert;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AlertDialog make(final Context context,
|
public static AlertDialog make(final Context context,
|
||||||
final List<OrdineVenditaInevasoDTO> ordersList,
|
final List<OrdiniUscitaElencoDTO> ordersList,
|
||||||
DialogVenditaFiltroAvanzatoViewModel baseViewModel,
|
DialogVenditaFiltroAvanzatoViewModel baseViewModel,
|
||||||
RunnableArgss<List<OrdineVenditaInevasoDTO>, DialogVenditaFiltroAvanzatoViewModel> onDismiss) {
|
RunnableArgss<List<OrdiniUscitaElencoDTO>, DialogVenditaFiltroAvanzatoViewModel> onDismiss) {
|
||||||
return new DialogVenditaFiltroAvanzato(context, ordersList, baseViewModel, onDismiss).currentAlert;
|
return new DialogVenditaFiltroAvanzato(context, ordersList, baseViewModel, onDismiss).currentAlert;
|
||||||
}
|
}
|
||||||
|
|
||||||
private DialogVenditaFiltroAvanzato(final Context context, final List<OrdineVenditaInevasoDTO> ordersList, DialogVenditaFiltroAvanzatoViewModel baseViewModel, RunnableArgss<List<OrdineVenditaInevasoDTO>, DialogVenditaFiltroAvanzatoViewModel> onDismiss) {
|
private DialogVenditaFiltroAvanzato(final Context context, final List<OrdiniUscitaElencoDTO> ordersList, DialogVenditaFiltroAvanzatoViewModel baseViewModel, RunnableArgss<List<OrdiniUscitaElencoDTO>, DialogVenditaFiltroAvanzatoViewModel> onDismiss) {
|
||||||
currentContext = context;
|
currentContext = context;
|
||||||
currentOrderList = ordersList;
|
currentOrderList = ordersList;
|
||||||
currentOnFilterDone = onDismiss;
|
currentOnFilterDone = onDismiss;
|
||||||
@@ -126,6 +128,7 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
viewModel.vettore.set(null);
|
viewModel.vettore.set(null);
|
||||||
viewModel.automezzo.set(null);
|
viewModel.automezzo.set(null);
|
||||||
viewModel.agente.set(null);
|
viewModel.agente.set(null);
|
||||||
|
viewModel.paese.set(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initView(DialogVenditaFiltroAvanzatoBinding bindings, DialogVenditaFiltroAvanzatoViewModel viewModel) {
|
private void initView(DialogVenditaFiltroAvanzatoBinding bindings, DialogVenditaFiltroAvanzatoViewModel viewModel) {
|
||||||
@@ -193,6 +196,10 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(false));
|
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(false));
|
||||||
bindings.filledExposedDropdownAutomezzo.setAdapter(arrayAdapterAutomezzo);
|
bindings.filledExposedDropdownAutomezzo.setAdapter(arrayAdapterAutomezzo);
|
||||||
|
|
||||||
|
arrayAdapterPaese = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
|
||||||
|
arrayAdapterPaese.addAll(getAvailablePaesi(false));
|
||||||
|
bindings.filledExposedDropdownPaese.setAdapter(arrayAdapterPaese);
|
||||||
|
|
||||||
|
|
||||||
viewModel.deposito.refresh();
|
viewModel.deposito.refresh();
|
||||||
viewModel.idViaggio.refresh();
|
viewModel.idViaggio.refresh();
|
||||||
@@ -203,6 +210,7 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
viewModel.automezzo.refresh();
|
viewModel.automezzo.refresh();
|
||||||
viewModel.dataConsegna.refresh();
|
viewModel.dataConsegna.refresh();
|
||||||
viewModel.agente.refresh();
|
viewModel.agente.refresh();
|
||||||
|
viewModel.paese.refresh();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -240,6 +248,8 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
|
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
|
||||||
arrayAdapterAgente.clear();
|
arrayAdapterAgente.clear();
|
||||||
arrayAdapterAgente.addAll(getAvailableAgente(true));
|
arrayAdapterAgente.addAll(getAvailableAgente(true));
|
||||||
|
arrayAdapterPaese.clear();
|
||||||
|
arrayAdapterPaese.addAll(getAvailablePaesi(true));
|
||||||
});
|
});
|
||||||
|
|
||||||
BindableString.registerListener(viewModel.deposito, value -> {
|
BindableString.registerListener(viewModel.deposito, value -> {
|
||||||
@@ -264,6 +274,8 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
|
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
|
||||||
arrayAdapterAgente.clear();
|
arrayAdapterAgente.clear();
|
||||||
arrayAdapterAgente.addAll(getAvailableAgente(true));
|
arrayAdapterAgente.addAll(getAvailableAgente(true));
|
||||||
|
arrayAdapterPaese.clear();
|
||||||
|
arrayAdapterPaese.addAll(getAvailablePaesi(true));
|
||||||
});
|
});
|
||||||
|
|
||||||
BindableString.registerListener(viewModel.numOrds, value -> {
|
BindableString.registerListener(viewModel.numOrds, value -> {
|
||||||
@@ -298,6 +310,8 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
|
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
|
||||||
arrayAdapterAgente.clear();
|
arrayAdapterAgente.clear();
|
||||||
arrayAdapterAgente.addAll(getAvailableAgente(true));
|
arrayAdapterAgente.addAll(getAvailableAgente(true));
|
||||||
|
arrayAdapterPaese.clear();
|
||||||
|
arrayAdapterPaese.addAll(getAvailablePaesi(true));
|
||||||
});
|
});
|
||||||
|
|
||||||
BindableString.registerListener(viewModel.cliente, value -> {
|
BindableString.registerListener(viewModel.cliente, value -> {
|
||||||
@@ -322,6 +336,8 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
|
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
|
||||||
arrayAdapterAgente.clear();
|
arrayAdapterAgente.clear();
|
||||||
arrayAdapterAgente.addAll(getAvailableAgente(true));
|
arrayAdapterAgente.addAll(getAvailableAgente(true));
|
||||||
|
arrayAdapterPaese.clear();
|
||||||
|
arrayAdapterPaese.addAll(getAvailablePaesi(true));
|
||||||
});
|
});
|
||||||
|
|
||||||
BindableString.registerListener(viewModel.terminiConsegna, value -> {
|
BindableString.registerListener(viewModel.terminiConsegna, value -> {
|
||||||
@@ -346,6 +362,8 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
|
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
|
||||||
arrayAdapterAgente.clear();
|
arrayAdapterAgente.clear();
|
||||||
arrayAdapterAgente.addAll(getAvailableAgente(true));
|
arrayAdapterAgente.addAll(getAvailableAgente(true));
|
||||||
|
arrayAdapterPaese.clear();
|
||||||
|
arrayAdapterPaese.addAll(getAvailablePaesi(true));
|
||||||
});
|
});
|
||||||
|
|
||||||
BindableString.registerListener(viewModel.vettore, value -> {
|
BindableString.registerListener(viewModel.vettore, value -> {
|
||||||
@@ -370,6 +388,8 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
|
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
|
||||||
arrayAdapterAgente.clear();
|
arrayAdapterAgente.clear();
|
||||||
arrayAdapterAgente.addAll(getAvailableAgente(true));
|
arrayAdapterAgente.addAll(getAvailableAgente(true));
|
||||||
|
arrayAdapterPaese.clear();
|
||||||
|
arrayAdapterPaese.addAll(getAvailablePaesi(true));
|
||||||
});
|
});
|
||||||
|
|
||||||
BindableString.registerListener(viewModel.automezzo, value -> {
|
BindableString.registerListener(viewModel.automezzo, value -> {
|
||||||
@@ -394,6 +414,8 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
arrayAdapterVettore.addAll(getAvailableVettori(true));
|
arrayAdapterVettore.addAll(getAvailableVettori(true));
|
||||||
arrayAdapterAgente.clear();
|
arrayAdapterAgente.clear();
|
||||||
arrayAdapterAgente.addAll(getAvailableAgente(true));
|
arrayAdapterAgente.addAll(getAvailableAgente(true));
|
||||||
|
arrayAdapterPaese.clear();
|
||||||
|
arrayAdapterPaese.addAll(getAvailablePaesi(true));
|
||||||
});
|
});
|
||||||
|
|
||||||
BindableString.resetListeners(viewModel.dataConsegna);
|
BindableString.resetListeners(viewModel.dataConsegna);
|
||||||
@@ -421,6 +443,8 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
|
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
|
||||||
arrayAdapterAgente.clear();
|
arrayAdapterAgente.clear();
|
||||||
arrayAdapterAgente.addAll(getAvailableAgente(true));
|
arrayAdapterAgente.addAll(getAvailableAgente(true));
|
||||||
|
arrayAdapterPaese.clear();
|
||||||
|
arrayAdapterPaese.addAll(getAvailablePaesi(true));
|
||||||
});
|
});
|
||||||
|
|
||||||
BindableString.resetListeners(viewModel.agente);
|
BindableString.resetListeners(viewModel.agente);
|
||||||
@@ -446,6 +470,35 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
arrayAdapterVettore.addAll(getAvailableVettori(true));
|
arrayAdapterVettore.addAll(getAvailableVettori(true));
|
||||||
arrayAdapterAutomezzo.clear();
|
arrayAdapterAutomezzo.clear();
|
||||||
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
|
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
|
||||||
|
arrayAdapterPaese.clear();
|
||||||
|
arrayAdapterPaese.addAll(getAvailablePaesi(true));
|
||||||
|
});
|
||||||
|
|
||||||
|
BindableString.resetListeners(viewModel.paese);
|
||||||
|
BindableString.registerListener(viewModel.paese, value -> {
|
||||||
|
if(UtilityString.isNullOrEmpty(value)) currentPaesePredicate = null;
|
||||||
|
else {
|
||||||
|
currentPaesePredicate = o -> !UtilityString.isNullOrEmpty(o.getCitta()) && (o.getCitta().toLowerCase().contains(value) || o.getCitta().equalsIgnoreCase(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
|
||||||
|
arrayAdapterCodMdep.clear();
|
||||||
|
arrayAdapterCodMdep.addAll(getAvailableCodMdeps(true));
|
||||||
|
arrayAdapterIdViaggio.clear();
|
||||||
|
arrayAdapterIdViaggio.addAll(getAvailableIdViaggio(true));
|
||||||
|
arrayAdapterNumOrds.clear();
|
||||||
|
arrayAdapterNumOrds.addAll(getAvailableNumOrds(true));
|
||||||
|
arrayAdapterCliente.clear();
|
||||||
|
arrayAdapterCliente.addAll(getAvailableCliente(true));
|
||||||
|
arrayAdapterTermCons.clear();
|
||||||
|
arrayAdapterTermCons.addAll(getAvailableTermCons(true));
|
||||||
|
arrayAdapterVettore.clear();
|
||||||
|
arrayAdapterVettore.addAll(getAvailableVettori(true));
|
||||||
|
arrayAdapterAutomezzo.clear();
|
||||||
|
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(true));
|
||||||
|
arrayAdapterAgente.clear();
|
||||||
|
arrayAdapterAgente.addAll(getAvailableAgente(true));
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -453,10 +506,19 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
|
|
||||||
|
|
||||||
private List<String> getAvailableIdViaggio(boolean skipRecalc) {
|
private List<String> getAvailableIdViaggio(boolean skipRecalc) {
|
||||||
if(currentAgentePredicate == null && currentNumOrdsPredicate == null && currentClientePredicate == null && currentDataConsPredicate == null && currentAutomezzoPredicate == null && currentVettorePredicate == null && currentTermConsPredicate == null && currentDepositoPredicate == null){
|
if(currentAgentePredicate == null &&
|
||||||
|
currentNumOrdsPredicate == null &&
|
||||||
|
currentClientePredicate == null &&
|
||||||
|
currentDataConsPredicate == null &&
|
||||||
|
currentAutomezzoPredicate == null &&
|
||||||
|
currentVettorePredicate == null &&
|
||||||
|
currentTermConsPredicate == null &&
|
||||||
|
currentDepositoPredicate == null &&
|
||||||
|
currentPaesePredicate == null
|
||||||
|
){
|
||||||
currentFilteredOrderList = currentOrderList;
|
currentFilteredOrderList = currentOrderList;
|
||||||
} else if(!skipRecalc){
|
} else if(!skipRecalc){
|
||||||
Stream<OrdineVenditaInevasoDTO> tmpStream = Stream.of(currentOrderList)
|
Stream<OrdiniUscitaElencoDTO> tmpStream = Stream.of(currentOrderList)
|
||||||
.filter(x ->
|
.filter(x ->
|
||||||
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
||||||
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
||||||
@@ -465,7 +527,8 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate.test(x))) &&
|
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate.test(x))) &&
|
||||||
(currentTermConsPredicate == null || (currentTermConsPredicate.test(x))) &&
|
(currentTermConsPredicate == null || (currentTermConsPredicate.test(x))) &&
|
||||||
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
||||||
(currentAgentePredicate == null || (currentAgentePredicate.test(x)))
|
(currentAgentePredicate == null || (currentAgentePredicate.test(x))) &&
|
||||||
|
(currentPaesePredicate == null || (currentPaesePredicate.test(x)))
|
||||||
);
|
);
|
||||||
|
|
||||||
currentFilteredOrderList = tmpStream.toList();
|
currentFilteredOrderList = tmpStream.toList();
|
||||||
@@ -473,18 +536,27 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
|
|
||||||
return Stream
|
return Stream
|
||||||
.of(currentFilteredOrderList)
|
.of(currentFilteredOrderList)
|
||||||
|
.filter(x -> x.getIdViaggio() != null)
|
||||||
|
.sortBy(x -> -x.getIdViaggio())
|
||||||
.map(x -> x.getIdViaggio() != null ? x.getIdViaggio().toString() : null)
|
.map(x -> x.getIdViaggio() != null ? x.getIdViaggio().toString() : null)
|
||||||
.withoutNulls()
|
|
||||||
.distinct()
|
.distinct()
|
||||||
.sorted()
|
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String> getAvailableAgente(boolean skipRecalc) {
|
private List<String> getAvailableAgente(boolean skipRecalc) {
|
||||||
if(currentDepositoPredicate == null && currentIdViaggioPredicate == null && currentNumOrdsPredicate == null && currentClientePredicate == null && currentDataConsPredicate == null && currentAutomezzoPredicate == null && currentVettorePredicate == null && currentTermConsPredicate == null){
|
if(currentDepositoPredicate == null &&
|
||||||
|
currentIdViaggioPredicate == null &&
|
||||||
|
currentNumOrdsPredicate == null &&
|
||||||
|
currentClientePredicate == null &&
|
||||||
|
currentDataConsPredicate == null &&
|
||||||
|
currentAutomezzoPredicate == null &&
|
||||||
|
currentVettorePredicate == null &&
|
||||||
|
currentTermConsPredicate == null &&
|
||||||
|
currentPaesePredicate == null
|
||||||
|
){
|
||||||
currentFilteredOrderList = currentOrderList;
|
currentFilteredOrderList = currentOrderList;
|
||||||
} else if(!skipRecalc){
|
} else if(!skipRecalc){
|
||||||
Stream<OrdineVenditaInevasoDTO> tmpStream = Stream.of(currentOrderList)
|
Stream<OrdiniUscitaElencoDTO> tmpStream = Stream.of(currentOrderList)
|
||||||
.filter(x ->
|
.filter(x ->
|
||||||
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
||||||
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
||||||
@@ -494,20 +566,30 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
(currentTermConsPredicate == null || (currentTermConsPredicate.test(x))) &&
|
(currentTermConsPredicate == null || (currentTermConsPredicate.test(x))) &&
|
||||||
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
||||||
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
||||||
(currentAgentePredicate == null || (currentAgentePredicate.test(x)))
|
(currentAgentePredicate == null || (currentAgentePredicate.test(x))) &&
|
||||||
|
(currentPaesePredicate == null || (currentPaesePredicate.test(x)))
|
||||||
);
|
);
|
||||||
|
|
||||||
currentFilteredOrderList = tmpStream.toList();
|
currentFilteredOrderList = tmpStream.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Stream.of(currentFilteredOrderList).map(OrdineVenditaInevasoDTO::getNomeAgente).distinct().withoutNulls().sorted().toList();
|
return Stream.of(currentFilteredOrderList).map(OrdiniUscitaElencoDTO::getNomeAgente).distinct().withoutNulls().sorted().toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String> getAvailableCodMdeps(boolean skipRecalc) {
|
private List<String> getAvailableCodMdeps(boolean skipRecalc) {
|
||||||
if(currentAgentePredicate == null && currentIdViaggioPredicate == null && currentNumOrdsPredicate == null && currentClientePredicate == null && currentDataConsPredicate == null && currentAutomezzoPredicate == null && currentVettorePredicate == null && currentTermConsPredicate == null){
|
if(currentAgentePredicate == null &&
|
||||||
|
currentIdViaggioPredicate == null &&
|
||||||
|
currentNumOrdsPredicate == null &&
|
||||||
|
currentClientePredicate == null &&
|
||||||
|
currentDataConsPredicate == null &&
|
||||||
|
currentAutomezzoPredicate == null &&
|
||||||
|
currentVettorePredicate == null &&
|
||||||
|
currentTermConsPredicate == null &&
|
||||||
|
currentPaesePredicate == null
|
||||||
|
){
|
||||||
currentFilteredOrderList = currentOrderList;
|
currentFilteredOrderList = currentOrderList;
|
||||||
} else if(!skipRecalc){
|
} else if(!skipRecalc){
|
||||||
Stream<OrdineVenditaInevasoDTO> tmpStream = Stream.of(currentOrderList)
|
Stream<OrdiniUscitaElencoDTO> tmpStream = Stream.of(currentOrderList)
|
||||||
.filter(x ->
|
.filter(x ->
|
||||||
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
||||||
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
||||||
@@ -516,20 +598,30 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate.test(x))) &&
|
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate.test(x))) &&
|
||||||
(currentTermConsPredicate == null || (currentTermConsPredicate.test(x))) &&
|
(currentTermConsPredicate == null || (currentTermConsPredicate.test(x))) &&
|
||||||
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
||||||
(currentAgentePredicate == null || (currentAgentePredicate.test(x)))
|
(currentAgentePredicate == null || (currentAgentePredicate.test(x))) &&
|
||||||
|
(currentPaesePredicate == null || (currentPaesePredicate.test(x)))
|
||||||
);
|
);
|
||||||
|
|
||||||
currentFilteredOrderList = tmpStream.toList();
|
currentFilteredOrderList = tmpStream.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Stream.of(currentFilteredOrderList).map(OrdineVenditaInevasoDTO::getCodMdep).distinct().withoutNulls().sorted().toList();
|
return Stream.of(currentFilteredOrderList).map(OrdiniUscitaElencoDTO::getCodMdep).distinct().withoutNulls().sorted().toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String> getAvailableCliente(boolean skipRecalc) {
|
private List<String> getAvailableCliente(boolean skipRecalc) {
|
||||||
if(currentAgentePredicate == null && currentIdViaggioPredicate == null && currentNumOrdsPredicate == null && currentDepositoPredicate == null && currentDataConsPredicate == null && currentAutomezzoPredicate == null && currentVettorePredicate == null && currentTermConsPredicate == null){
|
if(currentAgentePredicate == null &&
|
||||||
|
currentIdViaggioPredicate == null &&
|
||||||
|
currentNumOrdsPredicate == null &&
|
||||||
|
currentDepositoPredicate == null &&
|
||||||
|
currentDataConsPredicate == null &&
|
||||||
|
currentAutomezzoPredicate == null &&
|
||||||
|
currentVettorePredicate == null &&
|
||||||
|
currentTermConsPredicate == null &&
|
||||||
|
currentPaesePredicate == null
|
||||||
|
){
|
||||||
currentFilteredOrderList = currentOrderList;
|
currentFilteredOrderList = currentOrderList;
|
||||||
} else if(!skipRecalc){
|
} else if(!skipRecalc){
|
||||||
Stream<OrdineVenditaInevasoDTO> tmpStream = Stream.of(currentOrderList)
|
Stream<OrdiniUscitaElencoDTO> tmpStream = Stream.of(currentOrderList)
|
||||||
.filter(x ->
|
.filter(x ->
|
||||||
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
||||||
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
||||||
@@ -538,20 +630,30 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate.test(x))) &&
|
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate.test(x))) &&
|
||||||
(currentTermConsPredicate == null || (currentTermConsPredicate.test(x))) &&
|
(currentTermConsPredicate == null || (currentTermConsPredicate.test(x))) &&
|
||||||
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
||||||
(currentAgentePredicate == null || (currentAgentePredicate.test(x)))
|
(currentAgentePredicate == null || (currentAgentePredicate.test(x))) &&
|
||||||
|
(currentPaesePredicate == null || (currentPaesePredicate.test(x)))
|
||||||
);
|
);
|
||||||
|
|
||||||
currentFilteredOrderList = tmpStream.toList();
|
currentFilteredOrderList = tmpStream.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Stream.of(currentFilteredOrderList).map(OrdineVenditaInevasoDTO::getRagSocOrd).distinct().withoutNulls().sorted().toList();
|
return Stream.of(currentFilteredOrderList).map(OrdiniUscitaElencoDTO::getRagSocOrd).distinct().withoutNulls().sorted().toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String> getAvailableNumOrds(boolean skipRecalc) {
|
private List<String> getAvailableNumOrds(boolean skipRecalc) {
|
||||||
if(currentAgentePredicate == null && currentIdViaggioPredicate == null && currentDepositoPredicate == null && currentClientePredicate == null && currentDataConsPredicate == null && currentAutomezzoPredicate == null && currentVettorePredicate == null && currentTermConsPredicate == null){
|
if(currentAgentePredicate == null &&
|
||||||
|
currentIdViaggioPredicate == null &&
|
||||||
|
currentDepositoPredicate == null &&
|
||||||
|
currentClientePredicate == null &&
|
||||||
|
currentDataConsPredicate == null &&
|
||||||
|
currentAutomezzoPredicate == null &&
|
||||||
|
currentVettorePredicate == null &&
|
||||||
|
currentTermConsPredicate == null &&
|
||||||
|
currentPaesePredicate == null
|
||||||
|
){
|
||||||
currentFilteredOrderList = currentOrderList;
|
currentFilteredOrderList = currentOrderList;
|
||||||
} else if(!skipRecalc){
|
} else if(!skipRecalc){
|
||||||
Stream<OrdineVenditaInevasoDTO> tmpStream = Stream.of(currentOrderList)
|
Stream<OrdiniUscitaElencoDTO> tmpStream = Stream.of(currentOrderList)
|
||||||
.filter(x ->
|
.filter(x ->
|
||||||
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
||||||
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
||||||
@@ -560,7 +662,8 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate.test(x))) &&
|
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate.test(x))) &&
|
||||||
(currentTermConsPredicate == null || (currentTermConsPredicate.test(x))) &&
|
(currentTermConsPredicate == null || (currentTermConsPredicate.test(x))) &&
|
||||||
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
||||||
(currentAgentePredicate == null || (currentAgentePredicate.test(x)))
|
(currentAgentePredicate == null || (currentAgentePredicate.test(x))) &&
|
||||||
|
(currentPaesePredicate == null || (currentPaesePredicate.test(x)))
|
||||||
);
|
);
|
||||||
|
|
||||||
currentFilteredOrderList = tmpStream.toList();
|
currentFilteredOrderList = tmpStream.toList();
|
||||||
@@ -570,10 +673,19 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private List<String> getAvailableTermCons(boolean skipRecalc) {
|
private List<String> getAvailableTermCons(boolean skipRecalc) {
|
||||||
if(currentAgentePredicate == null && currentIdViaggioPredicate == null && currentNumOrdsPredicate == null && currentClientePredicate == null && currentDataConsPredicate == null && currentAutomezzoPredicate == null && currentVettorePredicate == null && currentDepositoPredicate == null){
|
if(currentAgentePredicate == null &&
|
||||||
|
currentIdViaggioPredicate == null &&
|
||||||
|
currentNumOrdsPredicate == null &&
|
||||||
|
currentClientePredicate == null &&
|
||||||
|
currentDataConsPredicate == null &&
|
||||||
|
currentAutomezzoPredicate == null &&
|
||||||
|
currentVettorePredicate == null &&
|
||||||
|
currentDepositoPredicate == null &&
|
||||||
|
currentPaesePredicate == null
|
||||||
|
){
|
||||||
currentFilteredOrderList = currentOrderList;
|
currentFilteredOrderList = currentOrderList;
|
||||||
} else if(!skipRecalc){
|
} else if(!skipRecalc){
|
||||||
Stream<OrdineVenditaInevasoDTO> tmpStream = Stream.of(currentOrderList)
|
Stream<OrdiniUscitaElencoDTO> tmpStream = Stream.of(currentOrderList)
|
||||||
.filter(x ->
|
.filter(x ->
|
||||||
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
||||||
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
||||||
@@ -582,20 +694,30 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate.test(x))) &&
|
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate.test(x))) &&
|
||||||
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
||||||
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
||||||
(currentAgentePredicate == null || (currentAgentePredicate.test(x)))
|
(currentAgentePredicate == null || (currentAgentePredicate.test(x))) &&
|
||||||
|
(currentPaesePredicate == null || (currentPaesePredicate.test(x)))
|
||||||
);
|
);
|
||||||
|
|
||||||
currentFilteredOrderList = tmpStream.toList();
|
currentFilteredOrderList = tmpStream.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Stream.of(currentFilteredOrderList).map(OrdineVenditaInevasoDTO::getTermCons).distinct().withoutNulls().sorted().toList();
|
return Stream.of(currentFilteredOrderList).map(OrdiniUscitaElencoDTO::getTermCons).distinct().withoutNulls().sorted().toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String> getAvailableVettori(boolean skipRecalc) {
|
private List<String> getAvailableVettori(boolean skipRecalc) {
|
||||||
if(currentAgentePredicate == null && currentIdViaggioPredicate == null && currentNumOrdsPredicate == null && currentClientePredicate == null && currentDataConsPredicate == null && currentTermConsPredicate == null && currentAutomezzoPredicate == null && currentDepositoPredicate == null){
|
if(currentAgentePredicate == null &&
|
||||||
|
currentIdViaggioPredicate == null &&
|
||||||
|
currentNumOrdsPredicate == null &&
|
||||||
|
currentClientePredicate == null &&
|
||||||
|
currentDataConsPredicate == null &&
|
||||||
|
currentTermConsPredicate == null &&
|
||||||
|
currentAutomezzoPredicate == null &&
|
||||||
|
currentDepositoPredicate == null &&
|
||||||
|
currentPaesePredicate == null
|
||||||
|
){
|
||||||
currentFilteredOrderList = currentOrderList;
|
currentFilteredOrderList = currentOrderList;
|
||||||
} else if(!skipRecalc){
|
} else if(!skipRecalc){
|
||||||
Stream<OrdineVenditaInevasoDTO> tmpStream = Stream.of(currentOrderList)
|
Stream<OrdiniUscitaElencoDTO> tmpStream = Stream.of(currentOrderList)
|
||||||
.filter(x ->
|
.filter(x ->
|
||||||
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
||||||
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
||||||
@@ -604,7 +726,8 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate .test(x))) &&
|
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate .test(x))) &&
|
||||||
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
||||||
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
||||||
(currentAgentePredicate == null || (currentAgentePredicate.test(x)))
|
(currentAgentePredicate == null || (currentAgentePredicate.test(x))) &&
|
||||||
|
(currentPaesePredicate == null || (currentPaesePredicate.test(x)))
|
||||||
);
|
);
|
||||||
|
|
||||||
currentFilteredOrderList = tmpStream.toList();
|
currentFilteredOrderList = tmpStream.toList();
|
||||||
@@ -614,10 +737,19 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private List<String> getAvailableAutomezzi(boolean skipRecalc) {
|
private List<String> getAvailableAutomezzi(boolean skipRecalc) {
|
||||||
if(currentAgentePredicate == null && currentIdViaggioPredicate == null && currentNumOrdsPredicate == null && currentClientePredicate == null && currentDataConsPredicate == null && currentTermConsPredicate == null && currentVettorePredicate == null && currentDepositoPredicate == null){
|
if(currentAgentePredicate == null &&
|
||||||
|
currentIdViaggioPredicate == null &&
|
||||||
|
currentNumOrdsPredicate == null &&
|
||||||
|
currentClientePredicate == null &&
|
||||||
|
currentDataConsPredicate == null &&
|
||||||
|
currentTermConsPredicate == null &&
|
||||||
|
currentVettorePredicate == null &&
|
||||||
|
currentDepositoPredicate == null &&
|
||||||
|
currentPaesePredicate == null
|
||||||
|
){
|
||||||
currentFilteredOrderList = currentOrderList;
|
currentFilteredOrderList = currentOrderList;
|
||||||
} else if(!skipRecalc){
|
} else if(!skipRecalc){
|
||||||
Stream<OrdineVenditaInevasoDTO> tmpStream = Stream.of(currentOrderList)
|
Stream<OrdiniUscitaElencoDTO> tmpStream = Stream.of(currentOrderList)
|
||||||
.filter(x ->
|
.filter(x ->
|
||||||
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
||||||
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
||||||
@@ -626,21 +758,64 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
(currentVettorePredicate == null || (currentVettorePredicate.test(x))) &&
|
(currentVettorePredicate == null || (currentVettorePredicate.test(x))) &&
|
||||||
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
||||||
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
||||||
(currentAgentePredicate == null || (currentAgentePredicate.test(x)))
|
(currentAgentePredicate == null || (currentAgentePredicate.test(x))) &&
|
||||||
|
(currentPaesePredicate == null || (currentPaesePredicate.test(x)))
|
||||||
);
|
);
|
||||||
|
|
||||||
currentFilteredOrderList = tmpStream.toList();
|
currentFilteredOrderList = tmpStream.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Stream.of(currentFilteredOrderList).map(OrdineVenditaInevasoDTO::getDescrizioneAuto).distinct().withoutNulls().sorted().toList();
|
return Stream.of(currentFilteredOrderList).map(OrdiniUscitaElencoDTO::getDescrizioneAuto).distinct().withoutNulls().sorted().toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<String> getAvailablePaesi(boolean skipRecalc) {
|
||||||
|
if(currentAgentePredicate == null &&
|
||||||
|
currentIdViaggioPredicate == null &&
|
||||||
|
currentNumOrdsPredicate == null &&
|
||||||
|
currentClientePredicate == null &&
|
||||||
|
currentDataConsPredicate == null &&
|
||||||
|
currentTermConsPredicate == null &&
|
||||||
|
currentVettorePredicate == null &&
|
||||||
|
currentDepositoPredicate == null &&
|
||||||
|
currentAutomezzoPredicate == null
|
||||||
|
){
|
||||||
|
currentFilteredOrderList = currentOrderList;
|
||||||
|
} else if(!skipRecalc){
|
||||||
|
Stream<OrdiniUscitaElencoDTO> tmpStream = Stream.of(currentOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
||||||
|
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
||||||
|
(currentDataConsPredicate == null || (currentDataConsPredicate.test(x))) &&
|
||||||
|
(currentTermConsPredicate == null || (currentTermConsPredicate.test(x))) &&
|
||||||
|
(currentVettorePredicate == null || (currentVettorePredicate.test(x))) &&
|
||||||
|
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
||||||
|
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
||||||
|
(currentAgentePredicate == null || (currentAgentePredicate.test(x))) &&
|
||||||
|
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate.test(x)))
|
||||||
|
);
|
||||||
|
|
||||||
|
currentFilteredOrderList = tmpStream.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Stream.of(currentFilteredOrderList).map(OrdiniUscitaElencoDTO::getCitta).withoutNulls().distinct().sorted().toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshList() {
|
private void refreshList() {
|
||||||
|
|
||||||
if(currentAgentePredicate == null && currentIdViaggioPredicate == null && currentNumOrdsPredicate == null && currentClientePredicate == null && currentDataConsPredicate == null && currentTermConsPredicate == null && currentVettorePredicate == null && currentAutomezzoPredicate == null && currentDepositoPredicate == null){
|
if(currentAgentePredicate == null &&
|
||||||
|
currentIdViaggioPredicate == null &&
|
||||||
|
currentNumOrdsPredicate == null &&
|
||||||
|
currentClientePredicate == null &&
|
||||||
|
currentDataConsPredicate == null &&
|
||||||
|
currentTermConsPredicate == null &&
|
||||||
|
currentVettorePredicate == null &&
|
||||||
|
currentAutomezzoPredicate == null &&
|
||||||
|
currentDepositoPredicate == null &&
|
||||||
|
currentPaesePredicate == null
|
||||||
|
){
|
||||||
currentFilteredOrderList = currentOrderList;
|
currentFilteredOrderList = currentOrderList;
|
||||||
} else {
|
} else {
|
||||||
Stream<OrdineVenditaInevasoDTO> tmpStream = Stream.of(currentOrderList)
|
Stream<OrdiniUscitaElencoDTO> tmpStream = Stream.of(currentOrderList)
|
||||||
.filter(x ->
|
.filter(x ->
|
||||||
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
||||||
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
||||||
@@ -650,7 +825,8 @@ public class DialogVenditaFiltroAvanzato {
|
|||||||
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate.test(x))) &&
|
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate.test(x))) &&
|
||||||
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
||||||
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
||||||
(currentAgentePredicate == null || (currentAgentePredicate.test(x)))
|
(currentAgentePredicate == null || (currentAgentePredicate.test(x))) &&
|
||||||
|
(currentPaesePredicate == null || (currentPaesePredicate.test(x)))
|
||||||
);
|
);
|
||||||
|
|
||||||
currentFilteredOrderList = tmpStream.toList();
|
currentFilteredOrderList = tmpStream.toList();
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package it.integry.integrywmsnative.gest.vendita.dialogs;
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.dialogs;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@@ -15,6 +15,7 @@ public class DialogVenditaFiltroAvanzatoViewModel {
|
|||||||
public BindableString agente = new BindableString();
|
public BindableString agente = new BindableString();
|
||||||
public BindableString vettore = new BindableString();
|
public BindableString vettore = new BindableString();
|
||||||
public BindableString automezzo = new BindableString();
|
public BindableString automezzo = new BindableString();
|
||||||
|
public BindableString paese = new BindableString();
|
||||||
|
|
||||||
public Date dataConsegnaDate;
|
public Date dataConsegnaDate;
|
||||||
|
|
||||||
@@ -0,0 +1,189 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.list;
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.core.content.res.ResourcesCompat;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
import androidx.databinding.ObservableList;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.zhukic.sectionedrecyclerview.SectionedRecyclerViewAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.databinding.FragmentMainOrdiniUscitaListGroupModelBinding;
|
||||||
|
import it.integry.integrywmsnative.databinding.FragmentMainOrdiniUscitaListModelBinding;
|
||||||
|
|
||||||
|
public class OrdiniUscitaElencoAdapter extends SectionedRecyclerViewAdapter<OrdiniUscitaElencoAdapter.SubheaderHolder, OrdiniUscitaElencoAdapter.SingleItemViewHolder> {
|
||||||
|
|
||||||
|
private final Context mContext;
|
||||||
|
private final List<OrdiniUscitaElencoListModel> mDataset = new ArrayList<>();
|
||||||
|
private View mEmptyView;
|
||||||
|
|
||||||
|
private RunnableArgs<String> mOnGroupItemClicked;
|
||||||
|
private RunnableArgs<OrdiniUscitaElencoListModel> mOnItemChecked;
|
||||||
|
|
||||||
|
static class SubheaderHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
FragmentMainOrdiniUscitaListModelBinding mBinding;
|
||||||
|
|
||||||
|
SubheaderHolder(FragmentMainOrdiniUscitaListModelBinding binding) {
|
||||||
|
super(binding.getRoot());
|
||||||
|
this.mBinding = binding;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static class SingleItemViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
FragmentMainOrdiniUscitaListGroupModelBinding mBinding;
|
||||||
|
|
||||||
|
SingleItemViewHolder(FragmentMainOrdiniUscitaListGroupModelBinding binding) {
|
||||||
|
super(binding.getRoot());
|
||||||
|
this.mBinding = binding;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrdiniUscitaElencoAdapter(Context context, ObservableArrayList<OrdiniUscitaElencoListModel> mutableDataSet) {
|
||||||
|
this.mContext = context;
|
||||||
|
|
||||||
|
mutableDataSet.addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void onChanged(ObservableList sender) {
|
||||||
|
mDataset.clear();
|
||||||
|
mDataset.addAll(sender);
|
||||||
|
notifyDataSetChanged();
|
||||||
|
notifyDataChanged();
|
||||||
|
checkIfEmpty();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrdiniUscitaElencoAdapter setOnGroupItemClicked(RunnableArgs<String> onGroupItemClicked) {
|
||||||
|
this.mOnGroupItemClicked = onGroupItemClicked;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrdiniUscitaElencoAdapter setOnItemChecked(RunnableArgs<OrdiniUscitaElencoListModel> onItemChecked) {
|
||||||
|
this.mOnItemChecked = onItemChecked;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrdiniUscitaElencoAdapter setEmptyView(View emptyView) {
|
||||||
|
this.mEmptyView = emptyView;
|
||||||
|
this.checkIfEmpty();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkIfEmpty() {
|
||||||
|
if (mEmptyView != null) {
|
||||||
|
final boolean emptyViewVisible = getItemCount() == 0;
|
||||||
|
mEmptyView.setVisibility(emptyViewVisible ? View.VISIBLE : View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OrdiniUscitaElencoAdapter.SubheaderHolder onCreateSubheaderViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
FragmentMainOrdiniUscitaListModelBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.fragment_main_ordini_uscita__list_model, parent, false);
|
||||||
|
return new OrdiniUscitaElencoAdapter.SubheaderHolder(binding);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OrdiniUscitaElencoAdapter.SingleItemViewHolder onCreateItemViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
FragmentMainOrdiniUscitaListGroupModelBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.fragment_main_ordini_uscita__list_group_model, parent, false);
|
||||||
|
return new OrdiniUscitaElencoAdapter.SingleItemViewHolder(binding);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindSubheaderViewHolder(OrdiniUscitaElencoAdapter.SubheaderHolder subheaderHolder, int nextItemPosition) {
|
||||||
|
OrdiniUscitaElencoListModel pickingObjectDTO = this.mDataset.get(nextItemPosition);
|
||||||
|
|
||||||
|
subheaderHolder.mBinding.groupTitle.setVisibility(UtilityString.isNullOrEmpty(pickingObjectDTO.getGroupTitle()) ? View.GONE : View.VISIBLE);
|
||||||
|
subheaderHolder.mBinding.groupTitle.setText(Html.fromHtml(pickingObjectDTO.getGroupTitle()));
|
||||||
|
|
||||||
|
subheaderHolder.mBinding.getRoot().setOnClickListener(new OnSingleClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onSingleClick(View v) {
|
||||||
|
if(mOnGroupItemClicked != null) mOnGroupItemClicked.run(pickingObjectDTO.getGroupTitle());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindItemViewHolder(final OrdiniUscitaElencoAdapter.SingleItemViewHolder holder, final int position) {
|
||||||
|
OrdiniUscitaElencoListModel listModel = this.mDataset.get(position);
|
||||||
|
|
||||||
|
listModel.getSelectedObservable().resetOnPropertyChangedCallback();
|
||||||
|
|
||||||
|
if(listModel.getEtichettaColor() != null)
|
||||||
|
holder.mBinding.emptyView.setBackgroundColor(listModel.getEtichettaColor());
|
||||||
|
else holder.mBinding.emptyView.setBackgroundColor(ResourcesCompat.getColor(mContext.getResources(), android.R.color.transparent, null));
|
||||||
|
|
||||||
|
if(!UtilityString.isNullOrEmpty(listModel.getDescription())) {
|
||||||
|
holder.mBinding.descrizione.setText(Html.fromHtml(listModel.getDescription()));
|
||||||
|
holder.mBinding.descrizione.setVisibility(View.VISIBLE);
|
||||||
|
} else holder.mBinding.descrizione.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
if(!UtilityString.isNullOrEmpty(listModel.getSubDescription())) {
|
||||||
|
holder.mBinding.subDescrizione.setText(Html.fromHtml(listModel.getSubDescription()));
|
||||||
|
holder.mBinding.subDescrizione.setVisibility(View.VISIBLE);
|
||||||
|
} else holder.mBinding.subDescrizione.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
if(!UtilityString.isNullOrEmpty(listModel.getRightDescription())) {
|
||||||
|
holder.mBinding.rightDescrizione.setText(Html.fromHtml(listModel.getRightDescription()));
|
||||||
|
holder.mBinding.rightDescrizione.setVisibility(View.VISIBLE);
|
||||||
|
} else holder.mBinding.rightDescrizione.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
if(!UtilityString.isNullOrEmpty(listModel.getRightSubDescription())) {
|
||||||
|
holder.mBinding.rightSubDescrizione.setText(Html.fromHtml(listModel.getRightSubDescription()));
|
||||||
|
holder.mBinding.rightSubDescrizione.setVisibility(View.VISIBLE);
|
||||||
|
} else holder.mBinding.rightSubDescrizione.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
holder.mBinding.setSelected(listModel.getSelectedObservable());
|
||||||
|
holder.mBinding.executePendingBindings();
|
||||||
|
holder.mBinding.checkbox.jumpDrawablesToCurrentState();
|
||||||
|
|
||||||
|
listModel.getSelectedObservable().addOnPropertyChangedCallback(() -> {
|
||||||
|
if(this.mOnItemChecked != null) this.mOnItemChecked.run(listModel);
|
||||||
|
});
|
||||||
|
|
||||||
|
holder.mBinding.getRoot().setOnClickListener(v -> {
|
||||||
|
listModel.getSelectedObservable().set(!listModel.getSelectedObservable().get());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onPlaceSubheaderBetweenItems(int position) {
|
||||||
|
|
||||||
|
if (getItemSize() == 1) return true;
|
||||||
|
else if (getItemSize() > 1) {
|
||||||
|
OrdiniUscitaElencoListModel compare1 = this.mDataset.get(position);
|
||||||
|
OrdiniUscitaElencoListModel compare2 = this.mDataset.get(position + 1);
|
||||||
|
|
||||||
|
if (UtilityString.equalsIgnoreCase(compare1.getGroupTitle(), compare2.getGroupTitle())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemSize() {
|
||||||
|
return mDataset.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user