Compare commits
228 Commits
v1.40.03(4
...
v1.42.04(4
| Author | SHA1 | Date | |
|---|---|---|---|
| 49933c8493 | |||
| b1bc72a1a5 | |||
| c498a373f5 | |||
| bd04d6263e | |||
| 6e52a3c0c7 | |||
| 9f92274720 | |||
| 6d431bb251 | |||
| 5265b949af | |||
| db875491d0 | |||
| 778fdff69a | |||
| 4b54aa3c02 | |||
| 019688a5cc | |||
| 00fc3a59eb | |||
| e5244e75a3 | |||
| cb77c21656 | |||
| b3641534c9 | |||
| e23446654d | |||
| a3a5f65e53 | |||
| ac6f64d494 | |||
| 9d001f8896 | |||
| 24e9cffeea | |||
| b0f2763a85 | |||
| cc343c296f | |||
| bc9b60b0ac | |||
| 856592e1fe | |||
| cd28d01354 | |||
| 653cd3fd75 | |||
| 73b1a77a12 | |||
| 777d6a3c5b | |||
| 98f520427e | |||
| 403f2ec57c | |||
| e69d99fdf1 | |||
| b48b2fbac9 | |||
| 00515aaf9b | |||
| e70d5697c3 | |||
| fb6d206203 | |||
| d3a9c87d14 | |||
| 39841f6b0d | |||
| 7ed3b421a1 | |||
| 3b5eb32190 | |||
| be31b87eac | |||
| 3d341ac99d | |||
| 9df1c37ee9 | |||
| 385a28c29b | |||
| e26568cdf1 | |||
| 191953a003 | |||
| 47143fe97d | |||
| 387ce6a555 | |||
| 47ff01805c | |||
| 0e24f7188c | |||
| 8b3d1f2a2e | |||
| dcdc823b5f | |||
| 7201e5c8f8 | |||
| 929c52b94c | |||
| 2adfda5f30 | |||
| 421accaf15 | |||
| 574ad6176b | |||
| 290d737ff7 | |||
| 4b0fbd0b6b | |||
| 6327089a55 | |||
| 807c3a8cde | |||
| 665c261b9a | |||
| bdd6f21522 | |||
| 2a0465dc0f | |||
| 3ebe311728 | |||
| 95a51ecc7a | |||
| 342753aeac | |||
| 845a4c8faa | |||
| 0328ebad85 | |||
| 77c5252bf6 | |||
| c42a597bb4 | |||
| b40781db84 | |||
| f5a0bf67c8 | |||
| 044d60fb66 | |||
| 7999e98bd9 | |||
| 7c14688ef3 | |||
| 8039d1942d | |||
| 03e2f4390b | |||
| 08656ae276 | |||
| 9f2ba56c59 | |||
| 34e1ba8f95 | |||
| 4e95f4f9c9 | |||
| 1463510b08 | |||
| a771335ff1 | |||
| 7b1f58412a | |||
| d897c83165 | |||
| 44b9bc3fc1 | |||
| fa95ed1391 | |||
| 26ca580ba4 | |||
| f65e69b745 | |||
| 5a147fb0de | |||
| 64e38ce05a | |||
| 6c79a1781d | |||
| 6177d84131 | |||
| c6975badce | |||
| c548c6484f | |||
| 9aae16521f | |||
| 559ff4e94c | |||
| 7b11f503d8 | |||
| bc788c3a34 | |||
| f936c71188 | |||
| 25a7982a87 | |||
| 74a3749e44 | |||
| 074fb10b44 | |||
| 4f490eb737 | |||
| 2b981b6c40 | |||
| bec80d980f | |||
| 8a5c8f5c94 | |||
| da301ec6b2 | |||
| a5a9cb1c50 | |||
| cef74ab71f | |||
| 3f647952c0 | |||
| 9bf55aae85 | |||
| f9a31faa78 | |||
| 9a643837d4 | |||
| f458a52b18 | |||
| 132437d134 | |||
| 022841c195 | |||
| bdbecfb037 | |||
| 1a501af172 | |||
| fe558a8be8 | |||
| 05d930d8f7 | |||
| 267aa85e01 | |||
| 89a98cac8b | |||
| efc052d622 | |||
| 6f61f3af9b | |||
| e7d06c9752 | |||
| 81e3c70960 | |||
| 76a0fe9b6f | |||
| a9bab6db56 | |||
| 85197c1f9b | |||
| ece434806f | |||
| 0962192144 | |||
| 38139a1ec9 | |||
| 56e5603256 | |||
| b5c2efa9e2 | |||
| 26f9f0e16c | |||
| 9abba0ce82 | |||
| c616a9d31a | |||
| e45a980ce3 | |||
| 46c9fa184d | |||
| 3a31fba1b4 | |||
| 6cded1d2d1 | |||
| 027d0e891b | |||
| 93abea0823 | |||
| 5c5216e207 | |||
| 7a20ff6ddc | |||
| 048b7d7f56 | |||
| f009726cf0 | |||
| fb213cbdbb | |||
| 971dcaed87 | |||
| 7b132def2a | |||
| 998dc54292 | |||
| 157eaf8760 | |||
| 10ffcf7806 | |||
| 392dd18338 | |||
| d4c7cdf400 | |||
| cde96ae694 | |||
| e49d35fdbc | |||
| 55db6d362d | |||
| 925cb6ae07 | |||
| c4f1d53199 | |||
| e18ac7a390 | |||
| cc454aea1a | |||
| 5cf275e43c | |||
| 53fe1db488 | |||
| 64082fc5ee | |||
| f9c642ad13 | |||
| bd7edf2357 | |||
| b7605bd28c | |||
| ad01283511 | |||
| adeab93b17 | |||
| 51480c2b06 | |||
| d04b3797ce | |||
| 518a00becf | |||
| c808cf7ce3 | |||
| 8cb488d81f | |||
| ed3f84d0ea | |||
| d9b02c4402 | |||
| 23522c9370 | |||
| f79b40c574 | |||
| 835915b46a | |||
| e643f25aa3 | |||
| 230a32139d | |||
| b0272cd9e0 | |||
| fa9947f22b | |||
| 5d3bb333e1 | |||
| 9f7085dfed | |||
| 95f765756c | |||
| a846ec00d7 | |||
| 6edc1917e1 | |||
| 1b864253b5 | |||
| f212987547 | |||
| 76f9c7030b | |||
| 05bc6e3fbe | |||
| 38dc5e134c | |||
| 76cf6c7d66 | |||
| 21100d517c | |||
| 37f83cd642 | |||
| f29f832387 | |||
| dd523ed6d8 | |||
| 879cfc5f7e | |||
| 83a6dd29f2 | |||
| cc85d83267 | |||
| 5d427a258e | |||
| 75e0a13f10 | |||
| 0862727176 | |||
| 6c02fcc9d5 | |||
| cd38c1b301 | |||
| c822f14a10 | |||
| 76683cb80c | |||
| 3041498ff1 | |||
| 66e0ce15cb | |||
| e12da84fa3 | |||
| bd4f28eb6d | |||
| c25b2e6cb5 | |||
| b86a1eb1bd | |||
| a9b5483005 | |||
| 29c181cff1 | |||
| 614da5ec5a | |||
| 5342f96076 | |||
| 479950df14 | |||
| 51fa32d48d | |||
| e491c56f3f | |||
| 5c505e2fe1 | |||
| 67e88d01e7 | |||
| 9454614af6 | |||
| 535a095b0a |
14
.idea/appInsightsSettings.xml
generated
14
.idea/appInsightsSettings.xml
generated
@@ -4,6 +4,20 @@
|
||||
<option name="selectedTabId" value="Android Vitals" />
|
||||
<option name="tabSettings">
|
||||
<map>
|
||||
<entry key="Android Vitals">
|
||||
<value>
|
||||
<InsightsFilterSettings>
|
||||
<option name="connection">
|
||||
<ConnectionSetting>
|
||||
<option name="appId" value="it.integry.ordify.dulciar" />
|
||||
</ConnectionSetting>
|
||||
</option>
|
||||
<option name="signal" value="SIGNAL_UNSPECIFIED" />
|
||||
<option name="timeIntervalDays" value="SEVEN_DAYS" />
|
||||
<option name="visibilityType" value="ALL" />
|
||||
</InsightsFilterSettings>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="Firebase Crashlytics">
|
||||
<value>
|
||||
<InsightsFilterSettings>
|
||||
|
||||
18
.idea/deploymentTargetSelector.xml
generated
Normal file
18
.idea/deploymentTargetSelector.xml
generated
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetSelector">
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2025-01-17T09:18:08.345092200Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=21088B8EFD" />
|
||||
</handle>
|
||||
</Target>
|
||||
</DropdownSelection>
|
||||
<DialogSelection />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</component>
|
||||
</project>
|
||||
9
.idea/fileTemplates/Android Dialog.java
generated
9
.idea/fileTemplates/Android Dialog.java
generated
@@ -84,6 +84,11 @@ Create the following layout resource file [dialog_${dashName}.xml]
|
||||
|
||||
private Dialog${NAME}View() {
|
||||
super();
|
||||
|
||||
MainApplication.appComponent
|
||||
.dialog${NAME}Component()
|
||||
.create()
|
||||
.inject(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -105,10 +110,6 @@ Create the following layout resource file [dialog_${dashName}.xml]
|
||||
[b] into interface body
|
||||
Dialog${NAME}Component.Factory dialog${NAME}Component();
|
||||
*/
|
||||
MainApplication.appComponent
|
||||
.dialog${NAME}Component()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
setCancelable(false);
|
||||
|
||||
|
||||
2
.idea/kotlinc.xml
generated
2
.idea/kotlinc.xml
generated
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="1.9.0" />
|
||||
<option name="version" value="1.9.25" />
|
||||
</component>
|
||||
</project>
|
||||
17
.idea/runConfigurations.xml
generated
Normal file
17
.idea/runConfigurations.xml
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
2
.idea/runConfigurations/app.xml
generated
2
.idea/runConfigurations/app.xml
generated
@@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="app" type="AndroidRunConfigurationType" factoryName="Android App">
|
||||
<module name="WMS_Native.app.main" />
|
||||
<module name="WMS.app.main" />
|
||||
<option name="DEPLOY" value="true" />
|
||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||
|
||||
@@ -5,13 +5,13 @@ if (!project.hasProperty("disable-performance-plugin")) {
|
||||
}
|
||||
|
||||
apply plugin: 'com.google.firebase.crashlytics'
|
||||
apply plugin: 'kotlin-android'
|
||||
//apply plugin: 'kotlin-android'
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 420
|
||||
def appVersionName = '1.40.03'
|
||||
def appVersionCode = 464
|
||||
def appVersionName = '1.42.04'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -34,10 +34,10 @@ android {
|
||||
defaultConfig {
|
||||
applicationId "it.integry.integrywmsnative"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 34
|
||||
targetSdkVersion 35
|
||||
versionCode appVersionCode
|
||||
versionName appVersionName
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
signingConfig signingConfigs.release
|
||||
|
||||
javaCompileOptions {
|
||||
@@ -75,48 +75,54 @@ android {
|
||||
build {
|
||||
doLast {
|
||||
delete "$projectDir/build/outputs/apk/release/version.txt"
|
||||
file("$projectDir/build/outputs/apk/release/version.txt").text = appVersionCode + '\n' + appVersionName
|
||||
file("$projectDir/build/outputs/apk/release/version.txt").text = appVersionCode + '\n' + appVersionName + '\n' + 'forced=true'
|
||||
}
|
||||
}
|
||||
|
||||
gradle.projectsEvaluated {
|
||||
tasks.withType(JavaCompile.class) {
|
||||
options.compilerArgs << "-Xmaxerrs" << "10000"
|
||||
tasks.withType(JavaCompile.class).tap {
|
||||
configureEach {
|
||||
options.compilerArgs << "-Xmaxerrs" << "10000"
|
||||
}
|
||||
}
|
||||
}
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
namespace 'it.integry.integrywmsnative'
|
||||
compileSdk 34
|
||||
compileSdk 35
|
||||
}
|
||||
|
||||
configurations {
|
||||
all*.exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
|
||||
all*.exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4'
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
})
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
// androidTestImplementation('androidx.test.espresso:espresso-core:3.6.1', {
|
||||
// exclude group: 'com.android.support', module: 'support-annotations'
|
||||
// })
|
||||
// implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
implementation 'com.github.lupaulus:logger:2.3.2'
|
||||
|
||||
//Firebase
|
||||
|
||||
// Import the Firebase BoM
|
||||
implementation platform('com.google.firebase:firebase-bom:29.1.0')
|
||||
implementation platform('com.google.firebase:firebase-bom:33.8.0')
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
implementation 'com.google.firebase:firebase-core'
|
||||
implementation 'com.google.firebase:firebase-crashlytics'
|
||||
implementation 'com.google.firebase:firebase-perf'
|
||||
implementation 'com.google.android.gms:play-services-basement:18.2.0'
|
||||
implementation 'com.google.android.gms:play-services-basement:18.5.0'
|
||||
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.android.material:material:1.10.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'com.google.android.material:material:1.12.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.3.2'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.4.0'
|
||||
|
||||
implementation('androidx.preference:preference-ktx:1.2.1') {
|
||||
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel'
|
||||
@@ -128,12 +134,12 @@ dependencies {
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||
implementation 'com.annimon:stream:1.2.2'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.7'
|
||||
// implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||
implementation 'org.apache.commons:commons-text:1.9'
|
||||
|
||||
//MVVM
|
||||
def dagger2_version = '2.46.1'
|
||||
def dagger2_version = '2.55'
|
||||
api "com.google.dagger:dagger:$dagger2_version"
|
||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
||||
api "com.google.dagger:dagger-android:$dagger2_version"
|
||||
@@ -183,6 +189,9 @@ dependencies {
|
||||
// RxJava is also required.
|
||||
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
|
||||
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
|
||||
//Barcode generator
|
||||
implementation group: 'com.google.zxing', name: 'core', version: '3.5.3'
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
android:allowBackup="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
@@ -33,31 +33,25 @@
|
||||
android:requestLegacyExternalStorage="true">
|
||||
<activity
|
||||
android:name=".gest.spedizione.SpedizioneActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.prod_dettaglio_linea.ProdDettaglioLineaActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.picking_resi.PickingResiActivity"
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.main.MainActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
@@ -68,28 +62,23 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".gest.login.LoginActivity"
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.accettazione_ordini_picking.AccettazioneOrdiniPickingActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.lista_bancali.ListaBancaliActivity"
|
||||
android:label="@string/activity_lista_bancali_title"
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.contenuto_bancale.ContenutoBancaleActivity"
|
||||
android:label="@string/activity_contenuto_bancale_title"
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.inventario.picking.PickingInventarioActivity"
|
||||
android:label="@string/activity_picking_inventario_title"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden"/>
|
||||
|
||||
<meta-data
|
||||
@@ -110,8 +99,7 @@
|
||||
|
||||
<activity
|
||||
android:name=".gest.accettazione_bolla_picking.AccettazioneBollaPickingActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light" />
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<provider
|
||||
android:name=".core.update.GenericFileProvider"
|
||||
|
||||
BIN
app/src/main/ic_launcher-playstore.png
Normal file
BIN
app/src/main/ic_launcher-playstore.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
@@ -19,6 +19,8 @@ import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.MainAccettazi
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.MainAccettazioneOrdiniElencoModule;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.AccettazioneOrdiniPickingComponent;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.AccettazioneOrdiniPickingModule;
|
||||
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaComponent;
|
||||
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniComponent;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoComponent;
|
||||
@@ -27,10 +29,10 @@ import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniE
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsComponent;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectLotti.DialogSelectLottiComponent;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectLotti.DialogSelectLottiModule;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleComponent;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
||||
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaComponent;
|
||||
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaModule;
|
||||
import it.integry.integrywmsnative.gest.inventario.ElencoInventariComponent;
|
||||
import it.integry.integrywmsnative.gest.inventario.ElencoInventariModule;
|
||||
import it.integry.integrywmsnative.gest.inventario.bottom_sheet__inventario_actions.BottomSheetInventarioActionsComponent;
|
||||
@@ -114,6 +116,8 @@ import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.DialogAskLineaPro
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.DialogAskLineaProdModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_unknown_barcode_notes.DialogAskUnknownBarcodeNotesComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_unknown_barcode_notes.DialogAskUnknownBarcodeNotesModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_vettore.DialogAskVettoreComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_vettore.DialogAskVettoreModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromMtbAartListComponent;
|
||||
@@ -122,6 +126,8 @@ import it.integry.integrywmsnative.view.dialogs.choose_arts_from_mtbcolr_list.Di
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_mtbcolr_list.DialogChooseArtsFromMtbColrListModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.create_new_art.DialogCreateNewArtComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.create_new_art.DialogCreateNewArtModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdComponent;
|
||||
@@ -138,6 +144,10 @@ 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;
|
||||
import it.integry.integrywmsnative.view.dialogs.switch_user_depo.DialogSwitchUserDepoComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.switch_user_depo.DialogSwitchUserDepoModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.tracciamento_imballi.DialogTracciamentoImballiComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.tracciamento_imballi.DialogTracciamentoImballiModule;
|
||||
|
||||
// Definition of the Application graph
|
||||
@Singleton
|
||||
@@ -182,6 +192,7 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
DialogSelectDocInfoModule.class,
|
||||
DocInterniEditFormModule.class,
|
||||
DialogSelectDocRowsModule.class,
|
||||
DialogSelectLottiModule.class,
|
||||
DialogAskClienteModule.class,
|
||||
DialogEditArticoloModule.class,
|
||||
DialogPrintOrderSSCCListModule.class,
|
||||
@@ -209,7 +220,11 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
DialogAskLineaProdModule.class,
|
||||
ProdRiposizionamentoDaProdModule.class,
|
||||
DialogInfoGiacenzaModule.class,
|
||||
ArticoliInGiacenzaModule.class
|
||||
ArticoliInGiacenzaModule.class,
|
||||
DialogTracciamentoImballiModule.class,
|
||||
DialogAskVettoreModule.class,
|
||||
DialogCreateNewArtModule.class,
|
||||
DialogSwitchUserDepoModule.class
|
||||
})
|
||||
public interface MainApplicationComponent {
|
||||
|
||||
@@ -326,6 +341,7 @@ public interface MainApplicationComponent {
|
||||
DialogInfoSituazioneArticoloComponent.Factory dialogInfoSituazioneArticoloComponent();
|
||||
|
||||
DialogSelectDocRowsComponent.Factory dialogSelectDocRowsNewComponent();
|
||||
DialogSelectLottiComponent.Factory dialogSelectLottiComponent();
|
||||
|
||||
DialogSelectArtToOrderComponent.Factory dialogSelectArtToOrderNewComponent();
|
||||
|
||||
@@ -351,6 +367,14 @@ public interface MainApplicationComponent {
|
||||
|
||||
ArticoliInGiacenzaComponent.Factory controlloGiacenzeComponent();
|
||||
|
||||
DialogTracciamentoImballiComponent.Factory dialogTracciamentoImballiComponent();
|
||||
|
||||
DialogAskVettoreComponent.Factory dialogAskVettoreComponent();
|
||||
|
||||
DialogCreateNewArtComponent.Factory dialogCreateNewArtComponent();
|
||||
|
||||
DialogSwitchUserDepoComponent.Factory dialogSwitchUserDepoComponent();
|
||||
|
||||
void inject(MainApplication mainApplication);
|
||||
|
||||
void inject(AppContext mainApplication);
|
||||
|
||||
@@ -32,6 +32,7 @@ import it.integry.integrywmsnative.core.rest.consumers.DocumentRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.EntityRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ImballiRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoAutomaticoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoBufferRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
||||
@@ -42,6 +43,7 @@ import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.VettoriRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.sound.SoundAlertService;
|
||||
@@ -172,8 +174,8 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MagazzinoRESTConsumer provideMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
return new MagazzinoRESTConsumer(systemRESTConsumer);
|
||||
MagazzinoRESTConsumer provideMagazzinoRESTConsumer(ExecutorService executorService, SystemRESTConsumer systemRESTConsumer) {
|
||||
return new MagazzinoRESTConsumer(executorService, systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -247,8 +249,20 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
GiacenzaRESTConsumer provideGiacenzaRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
return new GiacenzaRESTConsumer(systemRESTConsumer, articoloRESTConsumer);
|
||||
GiacenzaRESTConsumer provideGiacenzaRESTConsumer(ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
return new GiacenzaRESTConsumer(articoloRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ImballiRESTConsumer provideImballiRESTConsumer(ExecutorService executorService) {
|
||||
return new ImballiRESTConsumer(executorService);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
VettoriRESTConsumer provideVettoriRESTConsumer(ExecutorService executorService) {
|
||||
return new VettoriRESTConsumer(executorService);
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
||||
@@ -116,7 +116,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setTitleText(R.string.prod_ordine_lavorazione_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_lavorazione)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.PRODUZIONE, GestioneEnum.LAVORAZIONE, -1, SettingsManager.iDB().isFlagShowInfo() ? DialogInfoSituazioneArticoloView.class : null)))
|
||||
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.PRODUZIONE, GestioneEnum.LAVORAZIONE, -1, SettingsManager.iDB().isFlagProduzioneShowInfo() ? DialogInfoSituazioneArticoloView.class : null)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_free_lav_picking)
|
||||
|
||||
@@ -111,6 +111,28 @@ public class Converters {
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindEditText(AppCompatTextView view, final ValidatableObservableField<String> observableField) {
|
||||
Pair<ValidatableObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != observableField) {
|
||||
if (pair != null) {
|
||||
view.removeTextChangedListener(pair.second);
|
||||
}
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
if (observableField != null) observableField.set(s.toString());
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableField, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
String newValue = observableField.get();
|
||||
if (!view.getText().toString().equals(newValue)) {
|
||||
view.setText(newValue);
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindEditText(EditText view, final BindableString bindableString) {
|
||||
Pair<BindableString, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
@@ -156,6 +178,28 @@ public class Converters {
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindEditText(EditText view, final ValidatableObservableField<String> observableString) {
|
||||
Pair<ValidatableObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != observableString) {
|
||||
if (pair != null) {
|
||||
view.removeTextChangedListener(pair.second);
|
||||
}
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
observableString.set(s.toString());
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableString, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
String newValue = observableString.get();
|
||||
if (!view.getText().toString().equals(newValue)) {
|
||||
view.setText(newValue);
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindEditText(AutoCompleteTextView view, final ObservableField<String> observableString) {
|
||||
Pair<ObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
@@ -211,16 +255,19 @@ public class Converters {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
BigDecimal value = null;
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||
value = new BigDecimal(s.toString());
|
||||
|
||||
observableBigDecimal.set(value);
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableBigDecimal, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
|
||||
BigDecimal newValue = observableBigDecimal.get();
|
||||
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
|
||||
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
|
||||
|
||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||
view.setText(UtilityNumber.decimalToString(newValue));
|
||||
@@ -238,8 +285,11 @@ public class Converters {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
BigDecimal value = null;
|
||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||
value = new BigDecimal(s.toString());
|
||||
String newValueString = s.toString().trim();
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(newValueString))
|
||||
value = new BigDecimal(newValueString);
|
||||
|
||||
observableBigDecimal.set(value);
|
||||
}
|
||||
};
|
||||
@@ -247,7 +297,37 @@ public class Converters {
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
BigDecimal newValue = observableBigDecimal.get();
|
||||
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
|
||||
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
|
||||
|
||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||
view.setText(UtilityNumber.decimalToString(newValue));
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindTextInputEditTextBigDecimal(EditText view, final ValidatableObservableField<BigDecimal> observableBigDecimal) {
|
||||
Pair<ValidatableObservableField<BigDecimal>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != observableBigDecimal) {
|
||||
if (pair != null) {
|
||||
view.removeTextChangedListener(pair.second);
|
||||
}
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
BigDecimal value = null;
|
||||
String newValueString = s.toString().trim();
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(newValueString))
|
||||
value = new BigDecimal(newValueString);
|
||||
|
||||
observableBigDecimal.set(value);
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableBigDecimal, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
BigDecimal newValue = observableBigDecimal.get();
|
||||
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
|
||||
|
||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||
view.setText(UtilityNumber.decimalToString(newValue));
|
||||
@@ -651,6 +731,30 @@ public class Converters {
|
||||
view.setChecked(newValue);
|
||||
}
|
||||
|
||||
@BindingAdapter("checked")
|
||||
public static void bindCheckbox(AppCompatCheckBox view, final ObservableField<Boolean> bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
view.setOnCheckedChangeListener((compoundButton, b) -> {
|
||||
bindableBoolean.set(b);
|
||||
});
|
||||
}
|
||||
Boolean newValue = bindableBoolean.get();
|
||||
view.setChecked(newValue);
|
||||
}
|
||||
|
||||
@BindingAdapter("checked")
|
||||
public static void bindCheckbox(AppCompatCheckBox view, final ValidatableObservableField<Boolean> bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
view.setOnCheckedChangeListener((compoundButton, b) -> {
|
||||
bindableBoolean.set(b);
|
||||
});
|
||||
}
|
||||
Boolean newValue = bindableBoolean.get();
|
||||
view.setChecked(newValue);
|
||||
}
|
||||
|
||||
@BindingAdapter("checked")
|
||||
public static void bindCheckbox(CheckBox view, final BindableBoolean bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
@@ -717,8 +821,8 @@ public class Converters {
|
||||
|
||||
@BindingAdapter({"reverse_visibility"})
|
||||
public static void bindViewReverseVisibility(View view, final BindableBoolean bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
if (view.getTag(R.id.bound_reverse_visibility) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_reverse_visibility, bindableBoolean);
|
||||
}
|
||||
bindableBoolean.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package it.integry.integrywmsnative.core.di;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.BaseObservable;
|
||||
import androidx.databinding.Bindable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.core.di.validators.Validator;
|
||||
|
||||
public class ValidatableObservableField<T> extends BaseObservable {
|
||||
private T mValue;
|
||||
private final List<Validator<T>> validators = new ArrayList<>();
|
||||
public String errorMessage;
|
||||
|
||||
public ValidatableObservableField() {
|
||||
}
|
||||
|
||||
public ValidatableObservableField(T value) {
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the stored value.
|
||||
*/
|
||||
@Nullable
|
||||
public T get() {
|
||||
return mValue;
|
||||
}
|
||||
|
||||
public void set(T value) {
|
||||
if (value != mValue) {
|
||||
mValue = value;
|
||||
notifyChange();
|
||||
validate();
|
||||
}
|
||||
}
|
||||
|
||||
public void addValidator(Validator<T> validator) {
|
||||
validators.add(validator);
|
||||
}
|
||||
|
||||
public boolean validate() {
|
||||
for (Validator<T> validator : validators) {
|
||||
if (!validator.isValid(mValue)) {
|
||||
setErrorMessage(validator.getErrorMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
setErrorMessage(null);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
private void setErrorMessage(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
notifyPropertyChanged(BR.errorMessage); // Notifica il cambiamento di errorMessage
|
||||
}
|
||||
}
|
||||
@@ -2,5 +2,25 @@ package it.integry.integrywmsnative.core.di.binders;
|
||||
|
||||
public class AutoCompleteTextViewBinders {
|
||||
|
||||
|
||||
// @BindingAdapter("binding")
|
||||
// public static void bindUntMisText(AppCompatAutoCompleteTextView view, ObservableField<MtbUntMis> untMisField) {
|
||||
// Pair<ObservableField<MtbUntMis>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
// if (pair == null || pair.first != untMisField) {
|
||||
// if (pair != null) {
|
||||
// view.removeTextChangedListener(pair.second);
|
||||
// }
|
||||
// TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
// @Override
|
||||
// public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
// if (untMisField != null) untMisField.set(s.toString());
|
||||
// }
|
||||
// };
|
||||
// view.setTag(R.id.bound_observable, new Pair<>(untMisField, watcher));
|
||||
// view.addTextChangedListener(watcher);
|
||||
// }
|
||||
// String newValue = untMisField != null && untMisField.get() != null ? Objects.requireNonNull(untMisField.get()).getUntMis() : "";
|
||||
// if (!view.getText().toString().equals(newValue)) {
|
||||
// view.setText(newValue);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.di.binders;
|
||||
|
||||
import androidx.databinding.BindingAdapter;
|
||||
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
|
||||
public class TextInputLayoutBinders {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package it.integry.integrywmsnative.core.di.validators;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class GreaterThenValidator implements Validator<BigDecimal> {
|
||||
private final String errorMessage;
|
||||
private final BigDecimal greaterThanValue;
|
||||
|
||||
public GreaterThenValidator(BigDecimal greaterThanValue, String errorMessage) {
|
||||
this.greaterThanValue = greaterThanValue;
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(BigDecimal value) {
|
||||
return value != null && value.compareTo(greaterThanValue) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package it.integry.integrywmsnative.core.di.validators;
|
||||
|
||||
public class MinLengthValidator implements Validator<String> {
|
||||
private final int minLength;
|
||||
private final String errorMessage;
|
||||
|
||||
public MinLengthValidator(int minLength, String errorMessage) {
|
||||
this.minLength = minLength;
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(String value) {
|
||||
return value != null && value.length() >= minLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package it.integry.integrywmsnative.core.di.validators;
|
||||
|
||||
public class NotEmptyValidator implements Validator<String> {
|
||||
private final String errorMessage;
|
||||
|
||||
public NotEmptyValidator(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(String value) {
|
||||
return value != null && !value.trim().isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package it.integry.integrywmsnative.core.di.validators;
|
||||
|
||||
public class NotNullValidator<T> implements Validator<T>{
|
||||
private final String errorMessage;
|
||||
|
||||
public NotNullValidator(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(T value) {
|
||||
return value != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.di.validators;
|
||||
|
||||
public interface Validator<T> {
|
||||
boolean isValid(T value);
|
||||
|
||||
String getErrorMessage();
|
||||
}
|
||||
@@ -6,6 +6,8 @@ import android.view.KeyEvent;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
@@ -18,7 +20,8 @@ public class BaseActivity extends AppCompatActivity {
|
||||
@Inject
|
||||
public DialogProgressView mCurrentProgress;
|
||||
|
||||
private boolean progressOpened;
|
||||
@Inject
|
||||
public ExecutorService executorService;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
@@ -47,28 +50,19 @@ public class BaseActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void openProgress() {
|
||||
BarcodeManager.disable();
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
||||
this.progressOpened = true;
|
||||
runOnUiThread(() -> {
|
||||
try {
|
||||
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
|
||||
} catch (IllegalStateException ise) {
|
||||
//ignored
|
||||
}
|
||||
});
|
||||
}
|
||||
// executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(getSupportFragmentManager());
|
||||
// });
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
BarcodeManager.enable();
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
runOnUiThread(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
});
|
||||
}
|
||||
// executorService.execute(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -12,6 +13,8 @@ import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
@@ -19,11 +22,13 @@ import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||
|
||||
public class BaseDialogFragment extends DialogFragment implements DialogInterface.OnShowListener {
|
||||
public abstract class BaseDialogFragment extends DialogFragment implements DialogInterface.OnShowListener {
|
||||
|
||||
@Inject
|
||||
public DialogProgressView mCurrentProgress;
|
||||
private boolean progressOpened;
|
||||
|
||||
@Inject
|
||||
public ExecutorService executorService;
|
||||
|
||||
private boolean mBarcodeListener = false;
|
||||
|
||||
@@ -69,28 +74,26 @@ public class BaseDialogFragment extends DialogFragment implements DialogInterfac
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
|
||||
private void openProgress() {
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
||||
this.progressOpened = true;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
BarcodeManager.disable();
|
||||
// executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager());
|
||||
// });
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
});
|
||||
}
|
||||
BarcodeManager.enable();
|
||||
// executorService.execute(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
public void onError(Exception ex) {
|
||||
this.onLoadingEnded();
|
||||
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.onLoadingEnded();
|
||||
UtilityExceptions.defaultException(requireActivity(), ex);
|
||||
});
|
||||
}
|
||||
@@ -111,7 +114,14 @@ public class BaseDialogFragment extends DialogFragment implements DialogInterfac
|
||||
|
||||
@Override
|
||||
public void onShow(DialogInterface dialogInterface) {
|
||||
getDialog().getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
|
||||
|
||||
this.initialize();
|
||||
this.onInit(dialogInterface);
|
||||
}
|
||||
|
||||
public void onInit(DialogInterface dialogInterface) {
|
||||
|
||||
}
|
||||
|
||||
private void initialize() {
|
||||
|
||||
@@ -33,7 +33,6 @@ public abstract class BaseFragment extends Fragment {
|
||||
protected ElevatedToolbar mToolbar;
|
||||
|
||||
protected final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||
private boolean progressOpened;
|
||||
|
||||
|
||||
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
||||
@@ -67,22 +66,16 @@ public abstract class BaseFragment extends Fragment {
|
||||
|
||||
private void openProgress() {
|
||||
BarcodeManager.disable();
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
||||
this.progressOpened = true;
|
||||
executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
// executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager());
|
||||
// });
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
BarcodeManager.enable();
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
executorService.execute(() -> {
|
||||
mCurrentProgress.dismissAllowingStateLoss();
|
||||
});
|
||||
}
|
||||
// executorService.execute(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
// });
|
||||
}
|
||||
|
||||
public void onError(Exception ex) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.mapper;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRowRoomDTO;
|
||||
import it.integry.integrywmsnative.core.model.MtbInvenr;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
|
||||
public class InventarioRowMapper extends BaseMapper<MtbInvenr, InventarioRowRoomDTO> {
|
||||
|
||||
@@ -32,6 +33,7 @@ public class InventarioRowMapper extends BaseMapper<MtbInvenr, InventarioRowRoom
|
||||
data.setDataOraInv(inputData.getDataOraInv());
|
||||
data.setScanCodBarre(inputData.getScanCodBarre());
|
||||
data.setZona(inputData.getZona());
|
||||
data.setIdDisp(SettingsManager.i().getUserSession().getDeviceId());
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,6 +261,11 @@ public class MtbColr extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbColr setDataColloRif(LocalDate dataColloRif) {
|
||||
this.dataColloRif = UtilityDate.formatDate(dataColloRif, UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnf() {
|
||||
return qtaCnf;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.annimon.stream.Stream;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -160,6 +161,10 @@ public class MtbColt extends EntityBase {
|
||||
return UtilityDate.recognizeDateWithExceptionHandler(getDataColloS());
|
||||
}
|
||||
|
||||
public LocalDate getDataColloLD() {
|
||||
return UtilityDate.recognizeLocalDateWithExceptionHandler(getDataColloS());
|
||||
}
|
||||
|
||||
public MtbColt setDataCollo(String dataCollo) {
|
||||
this.dataCollo = dataCollo;
|
||||
return this;
|
||||
@@ -170,6 +175,11 @@ public class MtbColt extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbColt setDataCollo(LocalDate dataCollo) {
|
||||
this.dataCollo = UtilityDate.formatDate(dataCollo, UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSerCollo() {
|
||||
return serCollo;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MtbGrup extends EntityBase {
|
||||
|
||||
private String codMgrp;
|
||||
@@ -8,6 +11,7 @@ public class MtbGrup extends EntityBase {
|
||||
private String logoWeb;
|
||||
private String criterioVal;
|
||||
private String tipoMgrp;
|
||||
private List<MtbSgrp> mtbSgrp = new ArrayList<>();
|
||||
|
||||
public MtbGrup() {
|
||||
this.type = "mtb_grup";
|
||||
@@ -66,4 +70,13 @@ public class MtbGrup extends EntityBase {
|
||||
this.tipoMgrp = tipoMgrp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbSgrp> getMtbSgrp() {
|
||||
return mtbSgrp;
|
||||
}
|
||||
|
||||
public MtbGrup setMtbSgrp(List<MtbSgrp> mtbSgrp) {
|
||||
this.mtbSgrp = mtbSgrp;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
public class MtbSfam extends EntityBase {
|
||||
|
||||
private String codMgrp;
|
||||
private String codMsgr;
|
||||
private String codMsfa;
|
||||
private String descrizione;
|
||||
|
||||
public MtbSfam() {
|
||||
this.type = "mtb_sfam";
|
||||
}
|
||||
|
||||
public String getCodMgrp() {
|
||||
return codMgrp;
|
||||
}
|
||||
|
||||
public MtbSfam setCodMgrp(String codMgrp) {
|
||||
this.codMgrp = codMgrp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMsgr() {
|
||||
return codMsgr;
|
||||
}
|
||||
|
||||
public MtbSfam setCodMsgr(String codMsgr) {
|
||||
this.codMsgr = codMsgr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMsfa() {
|
||||
return codMsfa;
|
||||
}
|
||||
|
||||
public MtbSfam setCodMsfa(String codMsfa) {
|
||||
this.codMsfa = codMsfa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public MtbSfam setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MtbSgrp extends EntityBase {
|
||||
|
||||
private String codMgrp;
|
||||
private String codMsgr;
|
||||
private String descrizione;
|
||||
private String inclInStat;
|
||||
private String contoRimFin;
|
||||
private Integer ordinamento;
|
||||
private Boolean chkGiacenzaNeg;
|
||||
private Boolean flagReso;
|
||||
private String codCconWip;
|
||||
private List<MtbSfam> mtbSfam = new ArrayList<>();
|
||||
|
||||
public MtbSgrp() {
|
||||
this.type = "mtb_sgrp";
|
||||
}
|
||||
|
||||
public String getCodMgrp() {
|
||||
return codMgrp;
|
||||
}
|
||||
|
||||
public MtbSgrp setCodMgrp(String codMgrp) {
|
||||
this.codMgrp = codMgrp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMsgr() {
|
||||
return codMsgr;
|
||||
}
|
||||
|
||||
public MtbSgrp setCodMsgr(String codMsgr) {
|
||||
this.codMsgr = codMsgr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public MtbSgrp setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getInclInStat() {
|
||||
return inclInStat;
|
||||
}
|
||||
|
||||
public MtbSgrp setInclInStat(String inclInStat) {
|
||||
this.inclInStat = inclInStat;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getContoRimFin() {
|
||||
return contoRimFin;
|
||||
}
|
||||
|
||||
public MtbSgrp setContoRimFin(String contoRimFin) {
|
||||
this.contoRimFin = contoRimFin;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getOrdinamento() {
|
||||
return ordinamento;
|
||||
}
|
||||
|
||||
public MtbSgrp setOrdinamento(Integer ordinamento) {
|
||||
this.ordinamento = ordinamento;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getChkGiacenzaNeg() {
|
||||
return chkGiacenzaNeg;
|
||||
}
|
||||
|
||||
public MtbSgrp setChkGiacenzaNeg(Boolean chkGiacenzaNeg) {
|
||||
this.chkGiacenzaNeg = chkGiacenzaNeg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getFlagReso() {
|
||||
return flagReso;
|
||||
}
|
||||
|
||||
public MtbSgrp setFlagReso(Boolean flagReso) {
|
||||
this.flagReso = flagReso;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodCconWip() {
|
||||
return codCconWip;
|
||||
}
|
||||
|
||||
public MtbSgrp setCodCconWip(String codCconWip) {
|
||||
this.codCconWip = codCconWip;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbSfam> getMtbSfam() {
|
||||
return mtbSfam;
|
||||
}
|
||||
|
||||
public MtbSgrp setMtbSfam(List<MtbSfam> mtbSfam) {
|
||||
this.mtbSfam = mtbSfam;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class MtbTCol {
|
||||
@@ -13,7 +15,7 @@ public class MtbTCol {
|
||||
private BigDecimal taraKg;
|
||||
private String descrizione;
|
||||
private String codMart;
|
||||
private String flagUIUL;
|
||||
private FlagUiUlEnum flagUIUL;
|
||||
private String circuito;
|
||||
|
||||
public String getCodTcol() {
|
||||
@@ -88,13 +90,12 @@ public class MtbTCol {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagUIUL() {
|
||||
public FlagUiUlEnum getFlagUIUL() {
|
||||
return flagUIUL;
|
||||
}
|
||||
|
||||
public MtbTCol setFlagUIUL(String flagUIUL) {
|
||||
public void setFlagUIUL(FlagUiUlEnum flagUIUL) {
|
||||
this.flagUIUL = flagUIUL;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCircuito() {
|
||||
@@ -107,4 +108,29 @@ public class MtbTCol {
|
||||
}
|
||||
|
||||
|
||||
public enum FlagUiUlEnum {
|
||||
@SerializedName("UI")
|
||||
UI("UI"),
|
||||
|
||||
@SerializedName("UL")
|
||||
UL("UL");
|
||||
|
||||
private final String text;
|
||||
FlagUiUlEnum(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
|
||||
public String getText() {
|
||||
return this.text;
|
||||
}
|
||||
|
||||
public static FlagUiUlEnum fromString(String text) {
|
||||
for (FlagUiUlEnum b : FlagUiUlEnum.values()) {
|
||||
if (b.text.equalsIgnoreCase(text)) return b;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||
@@ -41,6 +42,7 @@ public class MvwSitArtUdcDetInventario {
|
||||
private String codJfas;
|
||||
private MtbAart mtbAart;
|
||||
private Integer numOrd;
|
||||
private Date dataOrd;
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
@@ -317,4 +319,13 @@ public class MvwSitArtUdcDetInventario {
|
||||
.setPesoLordoKg(getPesoLordoKg())
|
||||
.setUntMis(getUntMis());
|
||||
}
|
||||
|
||||
public Date getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setDataOrd(Date dataOrd) {
|
||||
this.dataOrd = dataOrd;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class VtbVetr extends EntityBase {
|
||||
|
||||
public VtbVetr() {
|
||||
type = "vtb_vetr";
|
||||
}
|
||||
|
||||
private String codVvet;
|
||||
private String codSpes;
|
||||
private String idRiga;
|
||||
private BigDecimal daQta;
|
||||
private BigDecimal aQta;
|
||||
private BigDecimal impUnt;
|
||||
private BigDecimal impFisso;
|
||||
private String codDivi;
|
||||
|
||||
public String getCodVvet() {
|
||||
return codVvet;
|
||||
}
|
||||
|
||||
public VtbVetr setCodVvet(String codVvet) {
|
||||
this.codVvet = codVvet;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodSpes() {
|
||||
return codSpes;
|
||||
}
|
||||
|
||||
public VtbVetr setCodSpes(String codSpes) {
|
||||
this.codSpes = codSpes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIdRiga() {
|
||||
return idRiga;
|
||||
}
|
||||
|
||||
public VtbVetr setIdRiga(String idRiga) {
|
||||
this.idRiga = idRiga;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getDaQta() {
|
||||
return daQta;
|
||||
}
|
||||
|
||||
public VtbVetr setDaQta(BigDecimal daQta) {
|
||||
this.daQta = daQta;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getaQta() {
|
||||
return aQta;
|
||||
}
|
||||
|
||||
public VtbVetr setaQta(BigDecimal aQta) {
|
||||
this.aQta = aQta;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getImpUnt() {
|
||||
return impUnt;
|
||||
}
|
||||
|
||||
public VtbVetr setImpUnt(BigDecimal impUnt) {
|
||||
this.impUnt = impUnt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getImpFisso() {
|
||||
return impFisso;
|
||||
}
|
||||
|
||||
public VtbVetr setImpFisso(BigDecimal impFisso) {
|
||||
this.impFisso = impFisso;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodDivi() {
|
||||
return codDivi;
|
||||
}
|
||||
|
||||
public VtbVetr setCodDivi(String codDivi) {
|
||||
this.codDivi = codDivi;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,273 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
public class VtbVett extends EntityBase {
|
||||
|
||||
public VtbVett() {
|
||||
type = "vtb_vett";
|
||||
}
|
||||
|
||||
private String codVvet;
|
||||
private String codLettVett;
|
||||
private String codAnag;
|
||||
private String ragSoc;
|
||||
private String indirizzo;
|
||||
private String cap;
|
||||
private String citta;
|
||||
private String prov;
|
||||
private String nazione;
|
||||
private String telefono;
|
||||
private String fax;
|
||||
private String partIva;
|
||||
private String note;
|
||||
private String eMail;
|
||||
private String modStamp;
|
||||
private BigDecimal coefVol;
|
||||
private String flagAttivo;
|
||||
private String numAutoriz;
|
||||
private List<VtbVetr> vtbVetr;
|
||||
|
||||
|
||||
public String getCodVvet() {
|
||||
return codVvet;
|
||||
}
|
||||
|
||||
public VtbVett setCodVvet(String codVvet) {
|
||||
this.codVvet = codVvet;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodLettVett() {
|
||||
return codLettVett;
|
||||
}
|
||||
|
||||
public VtbVett setCodLettVett(String codLettVett) {
|
||||
this.codLettVett = codLettVett;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public VtbVett setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRagSoc() {
|
||||
return ragSoc;
|
||||
}
|
||||
|
||||
public VtbVett setRagSoc(String ragSoc) {
|
||||
this.ragSoc = ragSoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIndirizzo() {
|
||||
return indirizzo;
|
||||
}
|
||||
|
||||
public VtbVett setIndirizzo(String indirizzo) {
|
||||
this.indirizzo = indirizzo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCap() {
|
||||
return cap;
|
||||
}
|
||||
|
||||
public VtbVett setCap(String cap) {
|
||||
this.cap = cap;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCitta() {
|
||||
return citta;
|
||||
}
|
||||
|
||||
public VtbVett setCitta(String citta) {
|
||||
this.citta = citta;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getProv() {
|
||||
return prov;
|
||||
}
|
||||
|
||||
public VtbVett setProv(String prov) {
|
||||
this.prov = prov;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNazione() {
|
||||
return nazione;
|
||||
}
|
||||
|
||||
public VtbVett setNazione(String nazione) {
|
||||
this.nazione = nazione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTelefono() {
|
||||
return telefono;
|
||||
}
|
||||
|
||||
public VtbVett setTelefono(String telefono) {
|
||||
this.telefono = telefono;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFax() {
|
||||
return fax;
|
||||
}
|
||||
|
||||
public VtbVett setFax(String fax) {
|
||||
this.fax = fax;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPartIva() {
|
||||
return partIva;
|
||||
}
|
||||
|
||||
public VtbVett setPartIva(String partIva) {
|
||||
this.partIva = partIva;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public VtbVett setNote(String note) {
|
||||
this.note = note;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String geteMail() {
|
||||
return eMail;
|
||||
}
|
||||
|
||||
public VtbVett seteMail(String eMail) {
|
||||
this.eMail = eMail;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getModStamp() {
|
||||
return modStamp;
|
||||
}
|
||||
|
||||
public VtbVett setModStamp(String modStamp) {
|
||||
this.modStamp = modStamp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getCoefVol() {
|
||||
return coefVol;
|
||||
}
|
||||
|
||||
public VtbVett setCoefVol(BigDecimal coefVol) {
|
||||
this.coefVol = coefVol;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagAttivo() {
|
||||
return flagAttivo;
|
||||
}
|
||||
|
||||
public VtbVett setFlagAttivo(String flagAttivo) {
|
||||
this.flagAttivo = flagAttivo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNumAutoriz() {
|
||||
return numAutoriz;
|
||||
}
|
||||
|
||||
public VtbVett setNumAutoriz(String numAutoriz) {
|
||||
this.numAutoriz = numAutoriz;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<VtbVetr> getVtbVetr() {
|
||||
return vtbVetr;
|
||||
}
|
||||
|
||||
public VtbVett setVtbVetr(List<VtbVetr> vtbVetr) {
|
||||
this.vtbVetr = vtbVetr;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
VtbVett vtbVett = (VtbVett) o;
|
||||
|
||||
if (!getCodVvet().equals(vtbVett.getCodVvet())) return false;
|
||||
if (getCodLettVett() != null ? !getCodLettVett().equals(vtbVett.getCodLettVett()) : vtbVett.getCodLettVett() != null)
|
||||
return false;
|
||||
if (getCodAnag() != null ? !getCodAnag().equals(vtbVett.getCodAnag()) : vtbVett.getCodAnag() != null)
|
||||
return false;
|
||||
if (getRagSoc() != null ? !getRagSoc().equals(vtbVett.getRagSoc()) : vtbVett.getRagSoc() != null)
|
||||
return false;
|
||||
if (getIndirizzo() != null ? !getIndirizzo().equals(vtbVett.getIndirizzo()) : vtbVett.getIndirizzo() != null)
|
||||
return false;
|
||||
if (getCap() != null ? !getCap().equals(vtbVett.getCap()) : vtbVett.getCap() != null)
|
||||
return false;
|
||||
if (getCitta() != null ? !getCitta().equals(vtbVett.getCitta()) : vtbVett.getCitta() != null)
|
||||
return false;
|
||||
if (getProv() != null ? !getProv().equals(vtbVett.getProv()) : vtbVett.getProv() != null)
|
||||
return false;
|
||||
if (getNazione() != null ? !getNazione().equals(vtbVett.getNazione()) : vtbVett.getNazione() != null)
|
||||
return false;
|
||||
if (getTelefono() != null ? !getTelefono().equals(vtbVett.getTelefono()) : vtbVett.getTelefono() != null)
|
||||
return false;
|
||||
if (getFax() != null ? !getFax().equals(vtbVett.getFax()) : vtbVett.getFax() != null)
|
||||
return false;
|
||||
if (getPartIva() != null ? !getPartIva().equals(vtbVett.getPartIva()) : vtbVett.getPartIva() != null)
|
||||
return false;
|
||||
if (getNote() != null ? !getNote().equals(vtbVett.getNote()) : vtbVett.getNote() != null)
|
||||
return false;
|
||||
if (geteMail() != null ? !geteMail().equals(vtbVett.geteMail()) : vtbVett.geteMail() != null)
|
||||
return false;
|
||||
if (getModStamp() != null ? !getModStamp().equals(vtbVett.getModStamp()) : vtbVett.getModStamp() != null)
|
||||
return false;
|
||||
if (getCoefVol() != null ? !getCoefVol().equals(vtbVett.getCoefVol()) : vtbVett.getCoefVol() != null)
|
||||
return false;
|
||||
if (getFlagAttivo() != null ? !getFlagAttivo().equals(vtbVett.getFlagAttivo()) : vtbVett.getFlagAttivo() != null)
|
||||
return false;
|
||||
if (getNumAutoriz() != null ? !getNumAutoriz().equals(vtbVett.getNumAutoriz()) : vtbVett.getNumAutoriz() != null)
|
||||
return false;
|
||||
return getVtbVetr() != null ? getVtbVetr().equals(vtbVett.getVtbVetr()) : vtbVett.getVtbVetr() == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = getCodVvet().hashCode();
|
||||
result = 31 * result + (getCodLettVett() != null ? getCodLettVett().hashCode() : 0);
|
||||
result = 31 * result + (getCodAnag() != null ? getCodAnag().hashCode() : 0);
|
||||
result = 31 * result + (getRagSoc() != null ? getRagSoc().hashCode() : 0);
|
||||
result = 31 * result + (getIndirizzo() != null ? getIndirizzo().hashCode() : 0);
|
||||
result = 31 * result + (getCap() != null ? getCap().hashCode() : 0);
|
||||
result = 31 * result + (getCitta() != null ? getCitta().hashCode() : 0);
|
||||
result = 31 * result + (getProv() != null ? getProv().hashCode() : 0);
|
||||
result = 31 * result + (getNazione() != null ? getNazione().hashCode() : 0);
|
||||
result = 31 * result + (getTelefono() != null ? getTelefono().hashCode() : 0);
|
||||
result = 31 * result + (getFax() != null ? getFax().hashCode() : 0);
|
||||
result = 31 * result + (getPartIva() != null ? getPartIva().hashCode() : 0);
|
||||
result = 31 * result + (getNote() != null ? getNote().hashCode() : 0);
|
||||
result = 31 * result + (geteMail() != null ? geteMail().hashCode() : 0);
|
||||
result = 31 * result + (getModStamp() != null ? getModStamp().hashCode() : 0);
|
||||
result = 31 * result + (getCoefVol() != null ? getCoefVol().hashCode() : 0);
|
||||
result = 31 * result + (getFlagAttivo() != null ? getFlagAttivo().hashCode() : 0);
|
||||
result = 31 * result + (getNumAutoriz() != null ? getNumAutoriz().hashCode() : 0);
|
||||
result = 31 * result + (getVtbVetr() != null ? getVtbVetr().hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,6 @@ public enum ReportType {
|
||||
ETICHETTA_SSCC_LAVORAZIONE(1),
|
||||
@SerializedName("2")
|
||||
ETICHETTA_SSCC_SPEDIZIONE(2),
|
||||
@SerializedName("3")
|
||||
WMS_SPEDIZIONE_ETICHETTE_SSCC_ORD(3),
|
||||
@SerializedName("4")
|
||||
WMS_SPEDIZIONE_PACKING_LIST_ORD(4),
|
||||
@SerializedName("5")
|
||||
|
||||
@@ -61,7 +61,11 @@ public class RESTBuilder {
|
||||
|
||||
Gson gson = UtilityGson.createObject();
|
||||
|
||||
Retrofit retrofit = new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create(gson)).baseUrl(endpoint).client(client).build();
|
||||
Retrofit retrofit = new Retrofit.Builder()
|
||||
.addConverterFactory(GsonConverterFactory.create(gson))
|
||||
.baseUrl(endpoint)
|
||||
.client(client)
|
||||
.build();
|
||||
|
||||
return retrofit.create(service);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,10 @@ import it.integry.integrywmsnative.core.model.MtbUntMis;
|
||||
import it.integry.integrywmsnative.core.model.dto.StatoArticoloDTO;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.ArticoloDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.RetrieveArticoloByCodMartRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.SaveArticoloRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.SaveArticoloResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.SearchArticoloByBarcodeRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.SearchArticoloByBarcodeResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.UpdateBarcodeImballoRequestDTO;
|
||||
@@ -36,6 +39,41 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
this.systemRESTConsumer = systemRESTConsumer;
|
||||
}
|
||||
|
||||
|
||||
public void retrieveAvailableUntMis(RunnableArgs<List<MtbUntMis>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
articoloRESTConsumerService
|
||||
.retrieveAvailableUntMis()
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbUntMis>> call, Response<ServiceRESTResponse<MtbUntMis>> response) {
|
||||
analyzeAnswerList(response, "retrieveAvailableUntMis", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<MtbUntMis>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void retrieveAvailableGruppiMerceologici(RunnableArgs<List<MtbGrup>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
articoloRESTConsumerService
|
||||
.retrieveAvailableGruppiMerceologici()
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbGrup>> call, Response<ServiceRESTResponse<MtbGrup>> response) {
|
||||
analyzeAnswerList(response, "retrieveAvailableGruppiMerceologici", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<MtbGrup>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void searchByBarcode(String barcodeProd, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
|
||||
@@ -205,4 +243,28 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void saveArticolo(ArticoloDTO articoloToSave, RunnableArgs<String> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
|
||||
var request = new SaveArticoloRequestDTO()
|
||||
.setArtToSave(articoloToSave);
|
||||
|
||||
articoloRESTConsumerService
|
||||
.saveArticolo(request)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<SaveArticoloResponseDTO>> call, Response<ServiceRESTResponse<SaveArticoloResponseDTO>> response) {
|
||||
analyzeAnswer(response, "saveArticolo", data -> {
|
||||
onComplete.run(data.getCodMart());
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<SaveArticoloResponseDTO>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,13 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||
import it.integry.integrywmsnative.core.model.MtbUntMis;
|
||||
import it.integry.integrywmsnative.core.model.dto.StatoArticoloDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.RetrieveArticoloByCodMartRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.SaveArticoloRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.SaveArticoloResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.SearchArticoloByBarcodeRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.SearchArticoloByBarcodeResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.UpdateBarcodeImballoRequestDTO;
|
||||
@@ -17,6 +21,13 @@ import retrofit2.http.Query;
|
||||
|
||||
public interface ArticoloRESTConsumerService {
|
||||
|
||||
|
||||
@GET("wms/articolo/availableUntMis")
|
||||
Call<ServiceRESTResponse<MtbUntMis>> retrieveAvailableUntMis();
|
||||
|
||||
@GET("wms/articolo/availableGruppiMerceologici")
|
||||
Call<ServiceRESTResponse<MtbGrup>> retrieveAvailableGruppiMerceologici();
|
||||
|
||||
@POST("wms/articolo/searchByBarcode")
|
||||
Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> searchByBarcode(@Body() SearchArticoloByBarcodeRequestDTO searchArticoloByBarcodeRequest);
|
||||
|
||||
@@ -29,4 +40,7 @@ public interface ArticoloRESTConsumerService {
|
||||
@GET("getProductLotStatus")
|
||||
Call<ServiceRESTResponse<List<StatoArticoloDTO>>> getStatoPartita(@Query("codMart") String codMart, @Query("partitaMag") String partitaMag);
|
||||
|
||||
@POST("wms/articolo/saveArticolo")
|
||||
Call<ServiceRESTResponse<SaveArticoloResponseDTO>> saveArticolo(@Body SaveArticoloRequestDTO saveArticoloRequest);
|
||||
|
||||
}
|
||||
|
||||
@@ -114,4 +114,21 @@ public class ColliAccettazioneRESTConsumer extends _BaseRESTConsumer implements
|
||||
});
|
||||
}
|
||||
|
||||
public void checkBarcodeUl(String barcodeUl, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed){
|
||||
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
||||
|
||||
colliAccettazioneRESTConsumerService.checkIfBarcodeUlAlreadyRegistered(barcodeUl)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Boolean>> call, Response<ServiceRESTResponse<Boolean>> response) {
|
||||
analyzeAnswer(response, "accettazione/checkIfBarcodeUlAlreadyRegistered", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,9 @@ import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowResponseDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface ColliAccettazioneRESTConsumerService {
|
||||
|
||||
@@ -31,4 +33,7 @@ public interface ColliAccettazioneRESTConsumerService {
|
||||
@POST("wms/accettazione/deleteUDCRow")
|
||||
Call<ServiceRESTResponse<Void>> deleteUDCRow(@Body DeleteUDCRowRequestDTO deleteUDCRowRequestDTO);
|
||||
|
||||
@GET("wms/accettazione/checkIfBarcodeUlAlreadyRegistered")
|
||||
Call<ServiceRESTResponse<Boolean>> checkIfBarcodeUlAlreadyRegistered(@Query("barcodeUl") String barcodeUl);
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.lang.reflect.Type;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -31,6 +32,8 @@ import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.SpostaULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.UpdateTipoULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CanULBeDeletedRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
|
||||
@@ -286,7 +289,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||
analyzeAnswer(response, "GetBySSCC", mtbColt -> {
|
||||
|
||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||
if (mtbColt != null && mtbColt.getMtbColr() != null && !mtbColt.getMtbColr().isEmpty()) {
|
||||
List<MtbColt> mtbColtList = new ArrayList<>();
|
||||
mtbColtList.add(mtbColt);
|
||||
fillMtbAartsOfMtbColts(mtbColtList, mtbColts -> onComplete.run(mtbColts.get(0)), onFailed);
|
||||
@@ -404,11 +407,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
public void changePosizione(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
String codMdep = posizione.getCodMdep();
|
||||
String posizioneString = posizione.getPosizione();
|
||||
|
||||
public void spostaUL(MtbColt mtbColtToMove, String codMdep, String posizione, boolean createDocAutomatically, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
MtbColt mtbColtToMoveClone = (MtbColt) mtbColtToMove.clone();
|
||||
|
||||
for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) {
|
||||
@@ -417,26 +416,66 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
.setMtbPartitaMag(null);
|
||||
}
|
||||
|
||||
SpostaULRequestDTO spostaUlRequestDTO = new SpostaULRequestDTO()
|
||||
.setCodMdep(codMdep)
|
||||
.setPosizione(posizione)
|
||||
.setMtbColtsToMove(Collections.singletonList(mtbColtToMoveClone))
|
||||
.setCreateDocAutomatically(createDocAutomatically);
|
||||
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService
|
||||
.spostaULInPosizione(codMdep,
|
||||
posizioneString,
|
||||
mtbColtToMoveClone)
|
||||
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
||||
.spostaUL(spostaUlRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
analyzeAnswer(response, "changePosizione", mtbColts -> {
|
||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||
analyzeAnswer(response, "spostaUL", mtbColts -> {
|
||||
onComplete.run();
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
||||
if (onFailed != null) onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void spostaUL(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
String codMdep = posizione.getCodMdep();
|
||||
String posizioneString = posizione.getPosizione();
|
||||
|
||||
spostaUL(mtbColtToMove, codMdep, posizioneString, true, onComplete, onFailed);
|
||||
}
|
||||
|
||||
public void updateTipoUL(MtbColt mtbColt, String codTcol, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
MtbColt mtbColtClone = (MtbColt) mtbColt.clone();
|
||||
mtbColtClone.setMtbColr(new ObservableArrayList<>());
|
||||
|
||||
UpdateTipoULRequestDTO updateTipoULRequest = new UpdateTipoULRequestDTO()
|
||||
.setMtbColt(mtbColtClone)
|
||||
.setCodTcol(codTcol);
|
||||
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService
|
||||
.updateTipoUL(updateTipoULRequest)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||
analyzeAnswer(response, "updateTipoUL", mtbColts -> {
|
||||
onComplete.run();
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
||||
if (onFailed != null) onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void updateDataFine(MtbColt mtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
MtbColt cloneMtbColt = (MtbColt) mtbColt.clone();
|
||||
@@ -517,14 +556,14 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService.spostaArtsTraUL(spostaArtsTraULRequestDTO).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||
analyzeAnswer(response, "spostaArtsTraUL", data -> {
|
||||
onComplete.run();
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
||||
if (onFailed != null) onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -7,6 +7,8 @@ import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.SpostaULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.UpdateTipoULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CanULBeDeletedRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
|
||||
@@ -31,11 +33,14 @@ public interface ColliMagazzinoRESTConsumerService {
|
||||
@POST("creaRettificaCollo")
|
||||
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/updateTipoUL")
|
||||
Call<ServiceRESTResponse<Void>> updateTipoUL(@Body UpdateTipoULRequestDTO requestDto);
|
||||
|
||||
@POST("wms/spostaUL")
|
||||
Call<ServiceRESTResponse<Void>> spostaUL(@Body SpostaULRequestDTO requestDto);
|
||||
|
||||
@POST("wms/spostaArtsTraUL")
|
||||
Call<ServiceRESTResponse<Object>> spostaArtsTraUL(@Body SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO);
|
||||
Call<ServiceRESTResponse<Void>> spostaArtsTraUL(@Body SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO);
|
||||
|
||||
@POST("wms/assegnaLottoSuColloScarico")
|
||||
Call<ServiceRESTResponse<MtbColt>> assegnaLottoSuColloScarico(@Body MtbColt mtbColt);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
@@ -13,6 +15,8 @@ import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DuplicateUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DuplicateUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
|
||||
@@ -113,4 +117,21 @@ public class ColliSpedizioneRESTConsumer extends _BaseRESTConsumer implements Co
|
||||
|
||||
}
|
||||
|
||||
public void duplicateUDS(DuplicateUDSRequestDTO duplicateUDSRequestDTO, RunnableArgs<DuplicateUDSResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
|
||||
|
||||
colliSpedizioneRESTConsumerService.duplicateUDS(duplicateUDSRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<ServiceRESTResponse<DuplicateUDSResponseDTO>> call, @NonNull Response<ServiceRESTResponse<DuplicateUDSResponseDTO>> response) {
|
||||
analyzeAnswer(response, "spedizione/duplicateUDS", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<ServiceRESTResponse<DuplicateUDSResponseDTO>> call, @NonNull Throwable t) {
|
||||
onFailed.run(new Exception());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DuplicateUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DuplicateUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
|
||||
@@ -35,4 +37,7 @@ public interface ColliSpedizioneRESTConsumerService {
|
||||
@POST("wms/spedizione/deleteUDSRow")
|
||||
Call<ServiceRESTResponse<Void>> deleteUDSRow(@Body DeleteUDSRowRequestDTO deleteUDSRowRequestDTO);
|
||||
|
||||
@POST("wms/spedizione/duplicateUDS")
|
||||
Call<ServiceRESTResponse<DuplicateUDSResponseDTO>> duplicateUDS(@Body DuplicateUDSRequestDTO duplicateUDSRequestDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
@@ -18,7 +19,7 @@ import retrofit2.Response;
|
||||
|
||||
@Singleton
|
||||
public class DocumentRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
|
||||
public void createDocsFromColli(List<LoadColliDTO> listColli, RunnableArgs<List<DtbDoct>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
DocumentiRESTConsumerService documentiRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
||||
@@ -50,8 +51,21 @@ public class DocumentRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
public void checkDocument(String fornitore, String numDoc, String dataDoc, String tipoDoc, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
var inventarioRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
||||
inventarioRESTConsumerService.checkDocument(fornitore, numDoc,tipoDoc, dataDoc)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<ServiceRESTResponse<Boolean>> call, @NonNull Response<ServiceRESTResponse<Boolean>> response) {
|
||||
analyzeAnswer(response, "checkDocument", onComplete, onFailed);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<ServiceRESTResponse<Boolean>> call, @NonNull Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void loadDocumentAvailableArts(String codDtip, String codMgrp, String codAnagForn, RunnableArgs<RetrieveDocumentoArtsResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
var inventarioRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.DtbDoct;
|
||||
@@ -20,8 +21,12 @@ public interface DocumentiRESTConsumerService {
|
||||
@POST("createDocFromColli")
|
||||
Call<ServiceRESTResponse<DtbDoct>> createDocFromColli(@Body LoadColliDTO listColli);
|
||||
|
||||
|
||||
|
||||
@GET("wms/documento/checkDoc")
|
||||
Call<ServiceRESTResponse<Boolean>> checkDocument(
|
||||
@Query("fornitore") String fornitore,
|
||||
@Query("numDoc") String numDoc,
|
||||
@Query("tipoDoc") String tipoDoc,
|
||||
@Query("dataDoc") String dataDoc);
|
||||
|
||||
@GET("wms/documento/arts")
|
||||
Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> retrieveArts(
|
||||
|
||||
@@ -25,11 +25,9 @@ import retrofit2.Response;
|
||||
@Singleton
|
||||
public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||
|
||||
public GiacenzaRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||
public GiacenzaRESTConsumer(ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.imballi.ImballoQuantityDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.imballi.RegistraCaricoImballiRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.imballi.RegistraScaricoImballiRequestDTO;
|
||||
import retrofit2.Response;
|
||||
|
||||
@Singleton
|
||||
public class ImballiRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final ExecutorService executorService;
|
||||
|
||||
public ImballiRESTConsumer(ExecutorService executorService) {
|
||||
this.executorService = executorService;
|
||||
}
|
||||
|
||||
|
||||
public List<MtbTCol> retrieveTipiColloSyncronized(MtbTCol.FlagUiUlEnum tipoImballo) throws Exception {
|
||||
ImballiRESTConsumerService service = RESTBuilder.getService(ImballiRESTConsumerService.class);
|
||||
Response<ServiceRESTResponse<List<MtbTCol>>> response = service.retrieveTipiCollo(tipoImballo)
|
||||
.execute();
|
||||
|
||||
return analyzeAnswer(response, "retrieveTipiCollo");
|
||||
}
|
||||
|
||||
public void retrieveTipiCollo(MtbTCol.FlagUiUlEnum tipoImballo, RunnableArgs<List<MtbTCol>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
var response = retrieveTipiColloSyncronized(tipoImballo);
|
||||
if (onComplete != null) onComplete.run(response);
|
||||
} catch (Exception ex) {
|
||||
if (onFailed != null) onFailed.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void registraCaricoSyncronized(String codAnag, List<ImballoQuantityDTO> imballi) throws Exception {
|
||||
ImballiRESTConsumerService service = RESTBuilder.getService(ImballiRESTConsumerService.class);
|
||||
Response<ServiceRESTResponse<Void>> response = service.registraCarico(
|
||||
new RegistraCaricoImballiRequestDTO()
|
||||
.setCodAnag(codAnag)
|
||||
.setUsedImballi(imballi))
|
||||
.execute();
|
||||
|
||||
analyzeAnswer(response, "registraCarico");
|
||||
}
|
||||
|
||||
public void registraCarico(String codAnag, List<ImballoQuantityDTO> imballi, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
registraCaricoSyncronized(codAnag, imballi);
|
||||
if (onComplete != null) onComplete.run();
|
||||
} catch (Exception ex) {
|
||||
if (onFailed != null) onFailed.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void registraScaricoSyncronized(String codVettore, List<ImballoQuantityDTO> imballi) throws Exception {
|
||||
ImballiRESTConsumerService service = RESTBuilder.getService(ImballiRESTConsumerService.class);
|
||||
Response<ServiceRESTResponse<Void>> response = service.registraScarico(
|
||||
new RegistraScaricoImballiRequestDTO()
|
||||
.setCodVettore(codVettore)
|
||||
.setUsedImballi(imballi))
|
||||
.execute();
|
||||
|
||||
analyzeAnswer(response, "registraScarico");
|
||||
}
|
||||
|
||||
public void registraScarico(String idVettore, List<ImballoQuantityDTO> imballi, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
registraScaricoSyncronized(idVettore, imballi);
|
||||
if (onComplete != null) onComplete.run();
|
||||
} catch (Exception ex) {
|
||||
if (onFailed != null) onFailed.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.imballi.RegistraCaricoImballiRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.imballi.RegistraScaricoImballiRequestDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Path;
|
||||
|
||||
public interface ImballiRESTConsumerService {
|
||||
|
||||
|
||||
@GET("wms/imballi/retrieve/{tipo}")
|
||||
Call<ServiceRESTResponse<List<MtbTCol>>> retrieveTipiCollo(@Path("tipo") MtbTCol.FlagUiUlEnum tipo);
|
||||
|
||||
@POST("wms/imballi/registraCarico")
|
||||
Call<ServiceRESTResponse<Void>> registraCarico(@Body RegistraCaricoImballiRequestDTO registraCaricoImballiRequest);
|
||||
|
||||
@POST("wms/imballi/registraScarico")
|
||||
Call<ServiceRESTResponse<Void>> registraScarico(@Body RegistraScaricoImballiRequestDTO registraScaricoImballiRequest);
|
||||
|
||||
}
|
||||
@@ -1,18 +1,19 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.DtbOrdt;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
@@ -21,56 +22,14 @@ import retrofit2.Response;
|
||||
@Singleton
|
||||
public class MagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final ExecutorService executorService;
|
||||
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||
|
||||
public MagazzinoRESTConsumer(SystemRESTConsumer mSystemRESTConsumer) {
|
||||
public MagazzinoRESTConsumer(ExecutorService executorService, SystemRESTConsumer mSystemRESTConsumer) {
|
||||
this.executorService = executorService;
|
||||
this.mSystemRESTConsumer = mSystemRESTConsumer;
|
||||
}
|
||||
|
||||
|
||||
public void getTipiCollo(RunnableArgs<List<MtbTCol>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
String baseSql = "SELECT * " +
|
||||
"FROM mtb_tcol ";
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbTCol>>() {
|
||||
}.getType();
|
||||
|
||||
mSystemRESTConsumer.<ArrayList<MtbTCol>>processSql(baseSql, typeOfObjectsList, values -> {
|
||||
if (onComplete != null) {
|
||||
onComplete.run(values);
|
||||
}
|
||||
}, ex -> {
|
||||
if (onFailed != null) onFailed.run(ex);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void saveOrdine(SaveDTO saveDTO, RunnableArgs<DtbOrdt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
MagazzinoRESTConsumerService service = RESTBuilder.getService(MagazzinoRESTConsumerService.class, 240);
|
||||
service.saveOrdine(saveDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<List<ServiceRESTResponse<DtbOrdt>>> call, Response<List<ServiceRESTResponse<DtbOrdt>>> response) {
|
||||
if (response.body() != null && response.body().size() > 0) {
|
||||
analyzeListOfAnswers(response, "saveOrdine", dtoList -> {
|
||||
if (dtoList.size() > 0) {
|
||||
onComplete.run(dtoList.get(0));
|
||||
} else {
|
||||
onFailed.run(new Exception("Nessun ordine generato"));
|
||||
}
|
||||
}, onFailed);
|
||||
} else {
|
||||
onFailed.run(new Exception("Nessun ordine generato"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<List<ServiceRESTResponse<DtbOrdt>>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void saveTerminalinoWMS(SaveDTO saveDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
MagazzinoRESTConsumerService service = RESTBuilder.getService(MagazzinoRESTConsumerService.class);
|
||||
service.saveTerminalinoWMS(saveDTO)
|
||||
@@ -86,4 +45,40 @@ public class MagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public MtbPartitaMag retrievePartitaMagSyncronized(String partitaMag, String codMart) throws Exception {
|
||||
MagazzinoRESTConsumerService service = RESTBuilder.getService(MagazzinoRESTConsumerService.class);
|
||||
Response<ServiceRESTResponse<MtbPartitaMag>> response = service.retrievePartitaMag(codMart, partitaMag)
|
||||
.execute();
|
||||
|
||||
return analyzeAnswer(response, "retrievePartitaMag");
|
||||
}
|
||||
|
||||
public void retrievePartitaMag(String partitaMag, String codMart, RunnableArgs<MtbPartitaMag> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
var response = retrievePartitaMagSyncronized(partitaMag, codMart);
|
||||
if (onComplete != null) onComplete.run(response);
|
||||
} catch (Exception ex) {
|
||||
if (onFailed != null) onFailed.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void retrieveAllPartitaMag(List<String> codMarts, Date dataScad, RunnableArgs<List<MtbPartitaMag>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
MagazzinoRESTConsumerService service = RESTBuilder.getService(MagazzinoRESTConsumerService.class);
|
||||
service.retrieveAllPartitaMag(codMarts, UtilityDate.formatDate(dataScad, UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH))
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<ServiceRESTResponse<List<MtbPartitaMag>>> call, @NonNull Response<ServiceRESTResponse<List<MtbPartitaMag>>> response) {
|
||||
analyzeAnswer(response, "retrieveAllPartitaMag", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<ServiceRESTResponse<List<MtbPartitaMag>>> call, @NonNull Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,19 +2,25 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.DtbOrdt;
|
||||
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface MagazzinoRESTConsumerService {
|
||||
|
||||
@POST("SM2SaveTerminalinoWMS")
|
||||
Call<ServiceRESTResponse<Void>> saveTerminalinoWMS(@Body SaveDTO saveDTO);
|
||||
|
||||
@POST("SM2SaveTerminalino")
|
||||
Call<List<ServiceRESTResponse<DtbOrdt>>> saveOrdine(@Body SaveDTO saveDTO);
|
||||
@GET("wms/partita-magazzino/retrievePartitaMag")
|
||||
Call<ServiceRESTResponse<MtbPartitaMag>> retrievePartitaMag(@Query("codMart") String codMart,
|
||||
@Query("partitaMag") String partitaMag);
|
||||
|
||||
@POST("wms/partita-magazzino/retrieveAllPartitaMag")
|
||||
Call<ServiceRESTResponse<List<MtbPartitaMag>>> retrieveAllPartitaMag(@Body List<String> codMarts,
|
||||
@Query("dataScad") String dataScad);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
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.UtilityThread;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.ArtDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.OrdineDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
||||
@@ -42,17 +41,13 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
||||
public void onResponse(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, Response<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> response) {
|
||||
var startTime = new Date().getTime();
|
||||
analyzeAnswer(response, "retrieveArticoliOrdine", articoliOrdineWrapper -> {
|
||||
UtilityThread.executeParallel(() -> {
|
||||
Log.d("LOADING TIME 1", "MS: " + (new Date().getTime() - startTime));
|
||||
onSuccess.run(articoliOrdineWrapper);
|
||||
}, false);
|
||||
Log.d("LOADING TIME 1", "MS: " + (new Date().getTime() - startTime));
|
||||
onSuccess.run(articoliOrdineWrapper);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, Throwable t) {
|
||||
Log.e("getArticoliListino_pv", t.toString());
|
||||
UtilityLogger.error(new Exception(t));
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
@@ -66,17 +61,13 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
||||
public void onResponse(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, Response<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> response) {
|
||||
var startTime = new Date().getTime();
|
||||
analyzeAnswer(response, "retrieveArticoliOrdine", articoliOrdineWrapper -> {
|
||||
UtilityThread.executeParallel(() -> {
|
||||
Log.d("LOADING TIME 1", "MS: " + (new Date().getTime() - startTime));
|
||||
onSuccess.run(articoliOrdineWrapper);
|
||||
}, false);
|
||||
Log.d("LOADING TIME 1", "MS: " + (new Date().getTime() - startTime));
|
||||
onSuccess.run(articoliOrdineWrapper);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<OrdiniAcquistoGrigliaDTO>> call, Throwable t) {
|
||||
Log.e("getArticoliListino_pv", t.toString());
|
||||
UtilityLogger.error(new Exception(t));
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
@@ -105,7 +96,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
var startTime = new Date().getTime();
|
||||
analyzeAnswer(response, "retrieveArticoliOrdine", articoliOrdineWrapper -> {
|
||||
UtilityThread.executeParallel(() -> {
|
||||
// UtilityThread.executeParallel(() -> {
|
||||
// if (data == null) {
|
||||
// onFailed.run(new Exception("Nessun ordine generato"));
|
||||
// return;
|
||||
@@ -117,7 +108,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
||||
// ordine.setCodMdep(data.getCodMdep());
|
||||
// ordine.setNumOrd(data.getNumOrd());
|
||||
onSuccess.run(ordine);
|
||||
}, false);
|
||||
// }, false);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,6 @@ import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
@@ -15,7 +12,6 @@ import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.lang.reflect.Type;
|
||||
import java.net.ConnectException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
@@ -29,9 +25,9 @@ import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.MailRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.system.LatestAppVersionInfoDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.system.RegisterDeviceRequestDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityGson;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import retrofit2.Call;
|
||||
@@ -42,6 +38,23 @@ import retrofit2.Response;
|
||||
public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
public void retrieveUpdatesInfo(final RunnableArgs<LatestAppVersionInfoDTO> onSuccess, final RunnableArgs<Exception> onFailed) {
|
||||
SystemRESTConsumerService systemRESTConsumerService = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||
systemRESTConsumerService.retrieveUpdatesInfo()
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<LatestAppVersionInfoDTO> call, Response<LatestAppVersionInfoDTO> response) {
|
||||
analyzeAnswerGeneric(response, "updates", onSuccess, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<LatestAppVersionInfoDTO> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void registerDevice(final Runnable onSuccess, final RunnableArgs<Exception> onFailed) {
|
||||
RegisterDeviceRequestDTO registerDeviceRequestDTO = new RegisterDeviceRequestDTO()
|
||||
.setApp("WMS");
|
||||
|
||||
@@ -6,6 +6,7 @@ import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.MailRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.system.LatestAppVersionInfoDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.system.RegisterDeviceRequestDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
@@ -15,6 +16,9 @@ import retrofit2.http.Query;
|
||||
|
||||
public interface SystemRESTConsumerService {
|
||||
|
||||
@GET("wms/currentVersion")
|
||||
Call<LatestAppVersionInfoDTO> retrieveUpdatesInfo();
|
||||
|
||||
@POST("device/register")
|
||||
Call<ServiceRESTResponse<Void>> registerDevice(@Body RegisterDeviceRequestDTO registerDeviceRequestDTO);
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.VtbVett;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import retrofit2.Response;
|
||||
|
||||
@Singleton
|
||||
public class VettoriRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final ExecutorService executorService;
|
||||
|
||||
public VettoriRESTConsumer(ExecutorService executorService) {
|
||||
this.executorService = executorService;
|
||||
}
|
||||
|
||||
|
||||
public List<VtbVett> retrieveRecentlyUsedInOrdersSyncronized(GestioneEnum gestione) throws Exception {
|
||||
var service = RESTBuilder.getService(VettoriRESTConsumerService.class);
|
||||
Response<ServiceRESTResponse<List<VtbVett>>> response = service.retrieveRecentlyUsedInOrders(gestione)
|
||||
.execute();
|
||||
|
||||
return analyzeAnswer(response, "retrieveRecentlyUsedInOrders");
|
||||
}
|
||||
|
||||
public void retrieveRecentlyUsedInOrders(GestioneEnum gestione, RunnableArgs<List<VtbVett>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
var response = retrieveRecentlyUsedInOrdersSyncronized(gestione);
|
||||
if (onComplete != null) onComplete.run(response);
|
||||
} catch (Exception ex) {
|
||||
if (onFailed != null) onFailed.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.VtbVett;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface VettoriRESTConsumerService {
|
||||
|
||||
@GET("wms/vettore/recentlyUsedInOrders")
|
||||
Call<ServiceRESTResponse<List<VtbVett>>> retrieveRecentlyUsedInOrders(@Query("gestione") GestioneEnum gestioneEnum);
|
||||
|
||||
}
|
||||
@@ -15,6 +15,32 @@ import retrofit2.Response;
|
||||
|
||||
public abstract class _BaseRESTConsumer {
|
||||
|
||||
|
||||
public static <T> void analyzeAnswerGeneric(Response<T> response, String logTitle, RunnableArgs<T> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
try {
|
||||
var data = analyzeAnswerGeneric(response, logTitle);
|
||||
onComplete.run(data);
|
||||
} catch (Exception e) {
|
||||
onFailed.run(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> T analyzeAnswerGeneric(Response<T> response, String logTitle) throws Exception {
|
||||
if (response.isSuccessful()) {
|
||||
return response.body();
|
||||
} else {
|
||||
if (response.code() == 404) {
|
||||
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url() + ")");
|
||||
throw new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")");
|
||||
} else if (response.code() == 550)
|
||||
throw new InvalidLicenseException();
|
||||
else {
|
||||
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
||||
throw new Exception("Status " + response.code() + ": " + response.message());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> T analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle) throws Exception {
|
||||
if (response.isSuccessful()) {
|
||||
if (response.body() != null) {
|
||||
|
||||
@@ -13,15 +13,13 @@ import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
|
||||
public class LocalDateDeserializer implements JsonDeserializer<LocalDate> {
|
||||
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH);
|
||||
|
||||
|
||||
@Override
|
||||
public LocalDate deserialize(JsonElement element, Type arg1, JsonDeserializationContext arg2) throws JsonParseException {
|
||||
String date = element.getAsString();
|
||||
if (UtilityString.isNullOrEmpty(date)) return null;
|
||||
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(UtilityString.determineDateFormat(date));
|
||||
|
||||
return LocalDate.parse(date, formatter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package it.integry.integrywmsnative.core.rest.deserializer;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
|
||||
public class MtbTcolFlagUiUlDeserializer implements JsonDeserializer<MtbTCol.FlagUiUlEnum> {
|
||||
@Override
|
||||
public MtbTCol.FlagUiUlEnum deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
||||
if (json.isJsonNull()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String text = json.getAsString();
|
||||
return MtbTCol.FlagUiUlEnum.fromString(text);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -328,13 +328,13 @@ public class Ean128Model {
|
||||
public String InternalPart;
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal1;
|
||||
public String Internal1; //Cod-Mart
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal2;
|
||||
public String Internal2; //IDLotto
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal3;
|
||||
public String Internal3; //Cod-Jfas
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal4;
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package it.integry.integrywmsnative.core.rest.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
|
||||
public class SpostaULRequestDTO {
|
||||
|
||||
private String codMdep;
|
||||
private String posizione;
|
||||
private String annotazioni;
|
||||
private boolean createDocAutomatically = true;
|
||||
private List<MtbColt> mtbColtsToMove = new ArrayList<>();
|
||||
|
||||
|
||||
public String getCodMdep() {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public SpostaULRequestDTO setCodMdep(String codMdep) {
|
||||
this.codMdep = codMdep;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPosizione() {
|
||||
return posizione;
|
||||
}
|
||||
|
||||
public SpostaULRequestDTO setPosizione(String posizione) {
|
||||
this.posizione = posizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAnnotazioni() {
|
||||
return annotazioni;
|
||||
}
|
||||
|
||||
public SpostaULRequestDTO setAnnotazioni(String annotazioni) {
|
||||
this.annotazioni = annotazioni;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isCreateDocAutomatically() {
|
||||
return createDocAutomatically;
|
||||
}
|
||||
|
||||
public SpostaULRequestDTO setCreateDocAutomatically(boolean createDocAutomatically) {
|
||||
this.createDocAutomatically = createDocAutomatically;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbColt> getMtbColtsToMove() {
|
||||
return mtbColtsToMove;
|
||||
}
|
||||
|
||||
public SpostaULRequestDTO setMtbColtsToMove(List<MtbColt> mtbColtsToMove) {
|
||||
this.mtbColtsToMove = mtbColtsToMove;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package it.integry.integrywmsnative.core.rest.model;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
|
||||
public class UpdateTipoULRequestDTO {
|
||||
|
||||
private MtbColt mtbColt;
|
||||
private String codTcol;
|
||||
|
||||
public MtbColt getMtbColt() {
|
||||
return mtbColt;
|
||||
}
|
||||
|
||||
public UpdateTipoULRequestDTO setMtbColt(MtbColt mtbColt) {
|
||||
this.mtbColt = mtbColt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodTcol() {
|
||||
return codTcol;
|
||||
}
|
||||
|
||||
public UpdateTipoULRequestDTO setCodTcol(String codTcol) {
|
||||
this.codTcol = codTcol;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.articolo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class ArticoloDTO {
|
||||
|
||||
private String codMart;
|
||||
private String descrizione;
|
||||
private String untMis;
|
||||
private String barcode;
|
||||
private BigDecimal qtaCnf;
|
||||
private String codAliq;
|
||||
private String articoloComposto;
|
||||
private String descrizioneEstesa;
|
||||
private String note;
|
||||
private String posizione;
|
||||
private String codMgrp;
|
||||
private String codMsfa;
|
||||
private String codMsgr;
|
||||
private String codMstp;
|
||||
private String codMtip;
|
||||
private boolean flagStato;
|
||||
private String barcodeImballo;
|
||||
private String diacod;
|
||||
private boolean flagQtaCnfFissa;
|
||||
private String idArtEqui;
|
||||
private boolean flagKit;
|
||||
private String precode;
|
||||
private String gruppo;
|
||||
private String sottoGruppo;
|
||||
private String sottoFamiglia;
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public ArticoloDTO setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public ArticoloDTO setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
public ArticoloDTO setUntMis(String untMis) {
|
||||
this.untMis = untMis;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarcode() {
|
||||
return barcode;
|
||||
}
|
||||
|
||||
public ArticoloDTO setBarcode(String barcode) {
|
||||
this.barcode = barcode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnf() {
|
||||
return qtaCnf;
|
||||
}
|
||||
|
||||
public ArticoloDTO setQtaCnf(BigDecimal qtaCnf) {
|
||||
this.qtaCnf = qtaCnf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodAliq() {
|
||||
return codAliq;
|
||||
}
|
||||
|
||||
public ArticoloDTO setCodAliq(String codAliq) {
|
||||
this.codAliq = codAliq;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getArticoloComposto() {
|
||||
return articoloComposto;
|
||||
}
|
||||
|
||||
public ArticoloDTO setArticoloComposto(String articoloComposto) {
|
||||
this.articoloComposto = articoloComposto;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizioneEstesa() {
|
||||
return descrizioneEstesa;
|
||||
}
|
||||
|
||||
public ArticoloDTO setDescrizioneEstesa(String descrizioneEstesa) {
|
||||
this.descrizioneEstesa = descrizioneEstesa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public ArticoloDTO setNote(String note) {
|
||||
this.note = note;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPosizione() {
|
||||
return posizione;
|
||||
}
|
||||
|
||||
public ArticoloDTO setPosizione(String posizione) {
|
||||
this.posizione = posizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMgrp() {
|
||||
return codMgrp;
|
||||
}
|
||||
|
||||
public ArticoloDTO setCodMgrp(String codMgrp) {
|
||||
this.codMgrp = codMgrp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMsfa() {
|
||||
return codMsfa;
|
||||
}
|
||||
|
||||
public ArticoloDTO setCodMsfa(String codMsfa) {
|
||||
this.codMsfa = codMsfa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMsgr() {
|
||||
return codMsgr;
|
||||
}
|
||||
|
||||
public ArticoloDTO setCodMsgr(String codMsgr) {
|
||||
this.codMsgr = codMsgr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMstp() {
|
||||
return codMstp;
|
||||
}
|
||||
|
||||
public ArticoloDTO setCodMstp(String codMstp) {
|
||||
this.codMstp = codMstp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMtip() {
|
||||
return codMtip;
|
||||
}
|
||||
|
||||
public ArticoloDTO setCodMtip(String codMtip) {
|
||||
this.codMtip = codMtip;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagStato() {
|
||||
return flagStato;
|
||||
}
|
||||
|
||||
public ArticoloDTO setFlagStato(boolean flagStato) {
|
||||
this.flagStato = flagStato;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarcodeImballo() {
|
||||
return barcodeImballo;
|
||||
}
|
||||
|
||||
public ArticoloDTO setBarcodeImballo(String barcodeImballo) {
|
||||
this.barcodeImballo = barcodeImballo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDiacod() {
|
||||
return diacod;
|
||||
}
|
||||
|
||||
public ArticoloDTO setDiacod(String diacod) {
|
||||
this.diacod = diacod;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagQtaCnfFissa() {
|
||||
return flagQtaCnfFissa;
|
||||
}
|
||||
|
||||
public ArticoloDTO setFlagQtaCnfFissa(boolean flagQtaCnfFissa) {
|
||||
this.flagQtaCnfFissa = flagQtaCnfFissa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIdArtEqui() {
|
||||
return idArtEqui;
|
||||
}
|
||||
|
||||
public ArticoloDTO setIdArtEqui(String idArtEqui) {
|
||||
this.idArtEqui = idArtEqui;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagKit() {
|
||||
return flagKit;
|
||||
}
|
||||
|
||||
public ArticoloDTO setFlagKit(boolean flagKit) {
|
||||
this.flagKit = flagKit;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPrecode() {
|
||||
return precode;
|
||||
}
|
||||
|
||||
public ArticoloDTO setPrecode(String precode) {
|
||||
this.precode = precode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGruppo() {
|
||||
return gruppo;
|
||||
}
|
||||
|
||||
public ArticoloDTO setGruppo(String gruppo) {
|
||||
this.gruppo = gruppo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSottoGruppo() {
|
||||
return sottoGruppo;
|
||||
}
|
||||
|
||||
public ArticoloDTO setSottoGruppo(String sottoGruppo) {
|
||||
this.sottoGruppo = sottoGruppo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSottoFamiglia() {
|
||||
return sottoFamiglia;
|
||||
}
|
||||
|
||||
public ArticoloDTO setSottoFamiglia(String sottoFamiglia) {
|
||||
this.sottoFamiglia = sottoFamiglia;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.articolo;
|
||||
|
||||
public class SaveArticoloRequestDTO {
|
||||
private ArticoloDTO artToSave;
|
||||
|
||||
public ArticoloDTO getArtToSave() {
|
||||
return artToSave;
|
||||
}
|
||||
|
||||
public SaveArticoloRequestDTO setArtToSave(ArticoloDTO artToSave) {
|
||||
this.artToSave = artToSave;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.articolo;
|
||||
|
||||
public class SaveArticoloResponseDTO {
|
||||
private String codMart;
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.imballi;
|
||||
|
||||
public class ImballoQuantityDTO {
|
||||
|
||||
private String codMart;
|
||||
private Integer qta;
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public ImballoQuantityDTO setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getQta() {
|
||||
return qta;
|
||||
}
|
||||
|
||||
public ImballoQuantityDTO setQta(Integer qta) {
|
||||
this.qta = qta;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.imballi;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RegistraCaricoImballiRequestDTO {
|
||||
|
||||
private String codAnag;
|
||||
private List<ImballoQuantityDTO> usedImballi;
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public RegistraCaricoImballiRequestDTO setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<ImballoQuantityDTO> getUsedImballi() {
|
||||
return usedImballi;
|
||||
}
|
||||
|
||||
public RegistraCaricoImballiRequestDTO setUsedImballi(List<ImballoQuantityDTO> usedImballi) {
|
||||
this.usedImballi = usedImballi;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.imballi;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RegistraScaricoImballiRequestDTO {
|
||||
|
||||
private String codVettore;
|
||||
private List<ImballoQuantityDTO> usedImballi;
|
||||
|
||||
public String getCodVettore() {
|
||||
return codVettore;
|
||||
}
|
||||
|
||||
public RegistraScaricoImballiRequestDTO setCodVettore(String codVettore) {
|
||||
this.codVettore = codVettore;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<ImballoQuantityDTO> getUsedImballi() {
|
||||
return usedImballi;
|
||||
}
|
||||
|
||||
public RegistraScaricoImballiRequestDTO setUsedImballi(List<ImballoQuantityDTO> usedImballi) {
|
||||
this.usedImballi = usedImballi;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.system;
|
||||
|
||||
public class LatestAppVersionInfoDTO {
|
||||
private String latestVersion;
|
||||
private int latestVersionCode;
|
||||
private String url;
|
||||
private boolean forced;
|
||||
|
||||
public String getLatestVersion() {
|
||||
return latestVersion;
|
||||
}
|
||||
|
||||
public LatestAppVersionInfoDTO setLatestVersion(String latestVersion) {
|
||||
this.latestVersion = latestVersion;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getLatestVersionCode() {
|
||||
return latestVersionCode;
|
||||
}
|
||||
|
||||
public LatestAppVersionInfoDTO setLatestVersionCode(int latestVersionCode) {
|
||||
this.latestVersionCode = latestVersionCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public LatestAppVersionInfoDTO setUrl(String url) {
|
||||
this.url = url;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isForced() {
|
||||
return forced;
|
||||
}
|
||||
|
||||
public LatestAppVersionInfoDTO setForced(boolean forced) {
|
||||
this.forced = forced;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ public class CreateUDSRequestDTO {
|
||||
private String codAnag;
|
||||
private String codVdes;
|
||||
private String rifOrd;
|
||||
private Integer idLotto;
|
||||
private boolean orderRequired;
|
||||
private List<CreateUDSRequestOrderDTO> orders;
|
||||
|
||||
@@ -125,6 +126,14 @@ public class CreateUDSRequestDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getIdLotto() {
|
||||
return idLotto;
|
||||
}
|
||||
|
||||
public CreateUDSRequestDTO setIdLotto(Integer idLotto) {
|
||||
this.idLotto = idLotto;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public static class Causale {
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.uds;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
|
||||
public class DuplicateUDSRequestDTO {
|
||||
|
||||
private MtbColt mtbColt;
|
||||
|
||||
private int numOfDuplicates;
|
||||
|
||||
public MtbColt getMtbColt() {
|
||||
return mtbColt;
|
||||
}
|
||||
|
||||
public DuplicateUDSRequestDTO setMtbColt(MtbColt mtbColt) {
|
||||
this.mtbColt = mtbColt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getNumOfDuplicates() {
|
||||
return numOfDuplicates;
|
||||
}
|
||||
|
||||
public DuplicateUDSRequestDTO setNumOfDuplicates(int numOfDuplicates) {
|
||||
this.numOfDuplicates = numOfDuplicates;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.uds;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
|
||||
public class DuplicateUDSResponseDTO {
|
||||
|
||||
private List<MtbColt> mtbColtList;
|
||||
|
||||
public List<MtbColt> getMtbColtList() {
|
||||
return mtbColtList;
|
||||
}
|
||||
|
||||
public DuplicateUDSResponseDTO setMtbColtList(List<MtbColt> mtbColtList) {
|
||||
this.mtbColtList = mtbColtList;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package it.integry.integrywmsnative.core.rest.serializer;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
import com.google.gson.JsonSerializationContext;
|
||||
import com.google.gson.JsonSerializer;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
|
||||
public class MtbTcolFlagUiUlSerializer implements JsonSerializer<MtbTCol.FlagUiUlEnum> {
|
||||
@Override
|
||||
public JsonElement serialize(MtbTCol.FlagUiUlEnum src, Type typeOfSrc, JsonSerializationContext context) {
|
||||
return new JsonPrimitive(src.getText());
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,6 @@ public class DBSettingsModel {
|
||||
private boolean enableCheckPartitaMagCheckPickingV;
|
||||
private boolean flagMultiClienteOrdV;
|
||||
private boolean flagUseCodAnagAziendale;
|
||||
private String defaultCausaleRettificaGiacenze;
|
||||
private boolean flagAskClienteInPickingLibero;
|
||||
private boolean flagPickLiberoAllowEmptyCliente;
|
||||
|
||||
@@ -28,7 +27,6 @@ public class DBSettingsModel {
|
||||
private boolean flagCanAutoOpenNewULAccettazione;
|
||||
private boolean flagCanAddExtraQuantitySpedizione;
|
||||
private boolean flagEnableCheckDepositoSpedizione;
|
||||
private boolean flagUseNewPickingListSpedizione;
|
||||
private boolean flagVersamentoDirettoProduzione;
|
||||
private boolean flagAskPesoColloSpedizione;
|
||||
private boolean flagForceAllToColli;
|
||||
@@ -36,6 +34,7 @@ public class DBSettingsModel {
|
||||
private boolean flagSpedizioneCanSelectMultipleOrders;
|
||||
private List<String> notePerditaDocInterni = new ArrayList<>();
|
||||
private boolean flagSpedizioneUseQtaOrd;
|
||||
private boolean flagSpedizioneUseColliPedana;
|
||||
private boolean flagOrdinaNuoviArticoliInGriglia;
|
||||
private boolean flagOrdinaArticoliOnScan;
|
||||
private boolean flagConsentiFuoriPianoLogistico;
|
||||
@@ -62,19 +61,31 @@ public class DBSettingsModel {
|
||||
private String commessaMagazzino;
|
||||
private boolean flagGeneraDocumentoSpedizione = false;
|
||||
private boolean flagIsInventarioCacheEnabled = false;
|
||||
private boolean flagAskPrintUlAccettazioneBolla = false;
|
||||
private boolean flagAskTipoColloAccettazioneBolla = false;
|
||||
private boolean flagAskVersamentoAutomaticoAccettazioneBolla = false;
|
||||
private boolean flagCanAddUnknownItemsAccettazioneBolla = false;
|
||||
private boolean flagCanAddUnknownBarcodesAccettazioneBolla = false;
|
||||
private boolean flagEnableFastPickAccettazioneBolla = false;
|
||||
private boolean flagDisableMandatoryTracciabilitaAccettazioneBolla = false;
|
||||
private boolean flagAllowULRecoverAccettazioneBolla = true;
|
||||
private boolean flagOverflowQuantityWarning = false;
|
||||
private boolean flagAccettazioneBollaAskPrintUl = false;
|
||||
private boolean flagAccettazioneBollaAskTipoCollo = false;
|
||||
private boolean flagAccettazioneBollaAskVersamentoAutomatico = false;
|
||||
private boolean flagAccettazioneBollaCanAddUnknownItems = false;
|
||||
private boolean flagAccettazioneBollaCanAddUnknownBarcodes = false;
|
||||
private boolean flagAccettazioneBollaEnableFastPick = false;
|
||||
private boolean flagAccettazioneBollaDisableMandatoryTracciabilita = false;
|
||||
private boolean flagAccettazioneBollaAllowULRecover = true;
|
||||
private boolean flagSpedizioneOverflowQuantityWarning = false;
|
||||
private String viewPosizioni;
|
||||
private boolean flagDeleteRowOnClose = false;
|
||||
private boolean flagAllowBarcodeFornitore = false;
|
||||
private boolean flagShowInfo = false;
|
||||
private boolean flagAccettazioneDeleteRowOnClose = false;
|
||||
private boolean flagAccettazioneAllowBarcodeFornitore = false;
|
||||
private boolean flagProduzioneShowInfo = false;
|
||||
private boolean flagAccettazioneBollaUseQtaOrd = true;
|
||||
private boolean flagWarningNewPartitaMag = false;
|
||||
private boolean flagTracciamentoImballiCaricoEnabled = false;
|
||||
private boolean flagTracciamentoImballiScaricoEnabled = false;
|
||||
private boolean flagPickingLiberoEnableScanArt = false;
|
||||
private boolean flagAskDuplicateUDSSpedizione = false;
|
||||
private boolean suggestDataScad = false;
|
||||
private boolean flagPositionChangeRequest = false;
|
||||
private String docInterniRequestNumDoc;
|
||||
private boolean flagEnableArtCreation;
|
||||
private List<String> allowedCodMgrpForArtCreation;
|
||||
private boolean flagAccettazioneGroupListForn = false;
|
||||
|
||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||
return flagSpedizioneEnableFakeGiacenza;
|
||||
@@ -265,6 +276,15 @@ public class DBSettingsModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagSpedizioneUseColliPedana() {
|
||||
return flagSpedizioneUseColliPedana;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagSpedizioneUseColliPedana(boolean flagSpedizioneUseColliPedana) {
|
||||
this.flagSpedizioneUseColliPedana = flagSpedizioneUseColliPedana;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagOrdinaNuoviArticoliInGriglia(boolean flagOrdinaNuoviArticoliInGriglia) {
|
||||
this.flagOrdinaNuoviArticoliInGriglia = flagOrdinaNuoviArticoliInGriglia;
|
||||
return this;
|
||||
@@ -491,84 +511,84 @@ public class DBSettingsModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAskPrintUlAccettazioneBolla() {
|
||||
return flagAskPrintUlAccettazioneBolla;
|
||||
public boolean isFlagAccettazioneBollaAskPrintUl() {
|
||||
return flagAccettazioneBollaAskPrintUl;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAskPrintUlAccettazioneBolla(boolean flagAskPrintUlAccettazioneBolla) {
|
||||
this.flagAskPrintUlAccettazioneBolla = flagAskPrintUlAccettazioneBolla;
|
||||
public DBSettingsModel setFlagAccettazioneBollaAskPrintUl(boolean flagAccettazioneBollaAskPrintUl) {
|
||||
this.flagAccettazioneBollaAskPrintUl = flagAccettazioneBollaAskPrintUl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAskTipoColloAccettazioneBolla() {
|
||||
return flagAskTipoColloAccettazioneBolla;
|
||||
public boolean isFlagAccettazioneBollaAskTipoCollo() {
|
||||
return flagAccettazioneBollaAskTipoCollo;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAskTipoColloAccettazioneBolla(boolean flagAskTipoColloAccettazioneBolla) {
|
||||
this.flagAskTipoColloAccettazioneBolla = flagAskTipoColloAccettazioneBolla;
|
||||
public DBSettingsModel setFlagAccettazioneBollaAskTipoCollo(boolean flagAccettazioneBollaAskTipoCollo) {
|
||||
this.flagAccettazioneBollaAskTipoCollo = flagAccettazioneBollaAskTipoCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAskVersamentoAutomaticoAccettazioneBolla() {
|
||||
return flagAskVersamentoAutomaticoAccettazioneBolla;
|
||||
public boolean isFlagAccettazioneBollaAskVersamentoAutomatico() {
|
||||
return flagAccettazioneBollaAskVersamentoAutomatico;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAskVersamentoAutomaticoAccettazioneBolla(boolean flagAskVersamentoAutomaticoAccettazioneBolla) {
|
||||
this.flagAskVersamentoAutomaticoAccettazioneBolla = flagAskVersamentoAutomaticoAccettazioneBolla;
|
||||
public DBSettingsModel setFlagAccettazioneBollaAskVersamentoAutomatico(boolean flagAccettazioneBollaAskVersamentoAutomatico) {
|
||||
this.flagAccettazioneBollaAskVersamentoAutomatico = flagAccettazioneBollaAskVersamentoAutomatico;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagCanAddUnknownItemsAccettazioneBolla() {
|
||||
return flagCanAddUnknownItemsAccettazioneBolla;
|
||||
public boolean isFlagAccettazioneBollaCanAddUnknownItems() {
|
||||
return flagAccettazioneBollaCanAddUnknownItems;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagCanAddUnknownItemsAccettazioneBolla(boolean flagCanAddUnknownItemsAccettazioneBolla) {
|
||||
this.flagCanAddUnknownItemsAccettazioneBolla = flagCanAddUnknownItemsAccettazioneBolla;
|
||||
public DBSettingsModel setFlagAccettazioneBollaCanAddUnknownItems(boolean flagAccettazioneBollaCanAddUnknownItems) {
|
||||
this.flagAccettazioneBollaCanAddUnknownItems = flagAccettazioneBollaCanAddUnknownItems;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagCanAddUnknownBarcodesAccettazioneBolla() {
|
||||
return flagCanAddUnknownBarcodesAccettazioneBolla;
|
||||
public boolean isFlagAccettazioneBollaCanAddUnknownBarcodes() {
|
||||
return flagAccettazioneBollaCanAddUnknownBarcodes;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagCanAddUnknownBarcodesAccettazioneBolla(boolean flagCanAddUnknownBarcodesAccettazioneBolla) {
|
||||
this.flagCanAddUnknownBarcodesAccettazioneBolla = flagCanAddUnknownBarcodesAccettazioneBolla;
|
||||
public DBSettingsModel setFlagAccettazioneBollaCanAddUnknownBarcodes(boolean flagAccettazioneBollaCanAddUnknownBarcodes) {
|
||||
this.flagAccettazioneBollaCanAddUnknownBarcodes = flagAccettazioneBollaCanAddUnknownBarcodes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagEnableFastPickAccettazioneBolla() {
|
||||
return flagEnableFastPickAccettazioneBolla;
|
||||
public boolean isFlagAccettazioneBollaEnableFastPick() {
|
||||
return flagAccettazioneBollaEnableFastPick;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagEnableFastPickAccettazioneBolla(boolean flagEnableFastPickAccettazioneBolla) {
|
||||
this.flagEnableFastPickAccettazioneBolla = flagEnableFastPickAccettazioneBolla;
|
||||
public DBSettingsModel setFlagAccettazioneBollaEnableFastPick(boolean flagAccettazioneBollaEnableFastPick) {
|
||||
this.flagAccettazioneBollaEnableFastPick = flagAccettazioneBollaEnableFastPick;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagDisableMandatoryTracciabilitaAccettazioneBolla() {
|
||||
return flagDisableMandatoryTracciabilitaAccettazioneBolla;
|
||||
public boolean isFlagAccettazioneBollaDisableMandatoryTracciabilita() {
|
||||
return flagAccettazioneBollaDisableMandatoryTracciabilita;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagDisableMandatoryTracciabilitaAccettazioneBolla(boolean flagDisableMandatoryTracciabilitaAccettazioneBolla) {
|
||||
this.flagDisableMandatoryTracciabilitaAccettazioneBolla = flagDisableMandatoryTracciabilitaAccettazioneBolla;
|
||||
public DBSettingsModel setFlagAccettazioneBollaDisableMandatoryTracciabilita(boolean flagAccettazioneBollaDisableMandatoryTracciabilita) {
|
||||
this.flagAccettazioneBollaDisableMandatoryTracciabilita = flagAccettazioneBollaDisableMandatoryTracciabilita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAllowULRecoverAccettazioneBolla() {
|
||||
return flagAllowULRecoverAccettazioneBolla;
|
||||
public boolean isFlagAccettazioneBollaAllowULRecover() {
|
||||
return flagAccettazioneBollaAllowULRecover;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAllowULRecoverAccettazioneBolla(boolean flagAllowULRecoverAccettazioneBolla) {
|
||||
this.flagAllowULRecoverAccettazioneBolla = flagAllowULRecoverAccettazioneBolla;
|
||||
public DBSettingsModel setFlagAccettazioneBollaAllowULRecover(boolean flagAccettazioneBollaAllowULRecover) {
|
||||
this.flagAccettazioneBollaAllowULRecover = flagAccettazioneBollaAllowULRecover;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagOverflowQuantityWarning() {
|
||||
return flagOverflowQuantityWarning;
|
||||
public boolean isFlagSpedizioneOverflowQuantityWarning() {
|
||||
return flagSpedizioneOverflowQuantityWarning;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagOverflowQuantityWarning(boolean flagOverflowQuantityWarning) {
|
||||
this.flagOverflowQuantityWarning = flagOverflowQuantityWarning;
|
||||
public DBSettingsModel setFlagSpedizioneOverflowQuantityWarning(boolean flagSpedizioneOverflowQuantityWarning) {
|
||||
this.flagSpedizioneOverflowQuantityWarning = flagSpedizioneOverflowQuantityWarning;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -590,30 +610,136 @@ public class DBSettingsModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagDeleteRowOnClose() {
|
||||
return flagDeleteRowOnClose;
|
||||
public boolean isFlagAccettazioneDeleteRowOnClose() {
|
||||
return flagAccettazioneDeleteRowOnClose;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagDeleteRowOnClose(boolean flagDeleteRowOnClose) {
|
||||
this.flagDeleteRowOnClose = flagDeleteRowOnClose;
|
||||
public DBSettingsModel setFlagAccettazioneDeleteRowOnClose(boolean flagAccettazioneDeleteRowOnClose) {
|
||||
this.flagAccettazioneDeleteRowOnClose = flagAccettazioneDeleteRowOnClose;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAllowBarcodeFornitore() {
|
||||
return flagAllowBarcodeFornitore;
|
||||
public boolean isFlagAccettazioneAllowBarcodeFornitore() {
|
||||
return flagAccettazioneAllowBarcodeFornitore;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAllowBarcodeFornitore(boolean flagAllowBarcodeFornitore) {
|
||||
this.flagAllowBarcodeFornitore = flagAllowBarcodeFornitore;
|
||||
public DBSettingsModel setFlagAccettazioneAllowBarcodeFornitore(boolean flagAccettazioneAllowBarcodeFornitore) {
|
||||
this.flagAccettazioneAllowBarcodeFornitore = flagAccettazioneAllowBarcodeFornitore;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagShowInfo() {
|
||||
return flagShowInfo;
|
||||
public boolean isFlagProduzioneShowInfo() {
|
||||
return flagProduzioneShowInfo;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagShowInfo(boolean flagShowInfo) {
|
||||
this.flagShowInfo = flagShowInfo;
|
||||
public DBSettingsModel setFlagProduzioneShowInfo(boolean flagProduzioneShowInfo) {
|
||||
this.flagProduzioneShowInfo = flagProduzioneShowInfo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAccettazioneBollaUseQtaOrd() {
|
||||
return flagAccettazioneBollaUseQtaOrd;
|
||||
}
|
||||
|
||||
public void setFlagAccettazioneBollaUseQtaOrd(boolean flagAccettazioneBollaUseQtaOrd) {
|
||||
this.flagAccettazioneBollaUseQtaOrd = flagAccettazioneBollaUseQtaOrd;
|
||||
}
|
||||
|
||||
public boolean isFlagWarningNewPartitaMag() {
|
||||
return flagWarningNewPartitaMag;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagWarningNewPartitaMag(boolean flagWarningNewPartitaMag) {
|
||||
this.flagWarningNewPartitaMag = flagWarningNewPartitaMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagTracciamentoImballiCaricoEnabled() {
|
||||
return flagTracciamentoImballiCaricoEnabled;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagTracciamentoImballiCaricoEnabled(boolean flagTracciamentoImballiCaricoEnabled) {
|
||||
this.flagTracciamentoImballiCaricoEnabled = flagTracciamentoImballiCaricoEnabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagTracciamentoImballiScaricoEnabled() {
|
||||
return flagTracciamentoImballiScaricoEnabled;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagTracciamentoImballiScaricoEnabled(boolean flagTracciamentoImballiScaricoEnabled) {
|
||||
this.flagTracciamentoImballiScaricoEnabled = flagTracciamentoImballiScaricoEnabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagPickingLiberoEnableScanArt() {
|
||||
return flagPickingLiberoEnableScanArt;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagPickingLiberoEnableScanArt(boolean flagPickingLiberoEnableScanArt) {
|
||||
this.flagPickingLiberoEnableScanArt = flagPickingLiberoEnableScanArt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAskDuplicateUDSSpedizione() {
|
||||
return flagAskDuplicateUDSSpedizione;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAskDuplicateUDSSpedizione(boolean flagAskDuplicateUDSSpedizione) {
|
||||
this.flagAskDuplicateUDSSpedizione = flagAskDuplicateUDSSpedizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isSuggestDataScad() {
|
||||
return suggestDataScad;
|
||||
}
|
||||
|
||||
public DBSettingsModel setSuggestDataScad(boolean suggestDataScad) {
|
||||
this.suggestDataScad = suggestDataScad;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDocInterniRequestNumDoc() {
|
||||
return docInterniRequestNumDoc;
|
||||
}
|
||||
|
||||
public DBSettingsModel setDocInterniRequestNumDoc(String docInterniRequestNumDoc) {
|
||||
this.docInterniRequestNumDoc = docInterniRequestNumDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getAllowedCodMgrpForArtCreation() {
|
||||
return allowedCodMgrpForArtCreation;
|
||||
}
|
||||
|
||||
public DBSettingsModel setAllowedCodMgrpForArtCreation(List<String> allowedCodMgrpForArtCreation) {
|
||||
this.allowedCodMgrpForArtCreation = allowedCodMgrpForArtCreation;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagEnableArtCreation() {
|
||||
return flagEnableArtCreation;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagEnableArtCreation(boolean flagEnableArtCreation) {
|
||||
this.flagEnableArtCreation = flagEnableArtCreation;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagPositionChangeRequest() {
|
||||
return flagPositionChangeRequest;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagPositionChangeRequest(boolean flagPositionChangeRequest) {
|
||||
this.flagPositionChangeRequest = flagPositionChangeRequest;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAccettazioneGroupListForn() {
|
||||
return flagAccettazioneGroupListForn;
|
||||
}
|
||||
|
||||
public void setFlagAccettazioneGroupListForn(boolean flagAccettazioneGroupListForn) {
|
||||
this.flagAccettazioneGroupListForn = flagAccettazioneGroupListForn;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityFirebase;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
|
||||
@Singleton
|
||||
public class SettingsManager {
|
||||
@@ -242,11 +243,16 @@ public class SettingsManager {
|
||||
.setSection("ACCETTAZIONE")
|
||||
.setKeySection("FLAG_AUTO_OPEN_NEW_UL")
|
||||
.setSetter(dbSettingsModelIstance::setFlagCanAutoOpenNewULAccettazione));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE")
|
||||
.setKeySection("FLAG_GROUP_LIST_FORN")
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneGroupListForn));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE")
|
||||
.setKeySection("FLAG_DELETE_ROW_ON_CLOSE")
|
||||
.setSetter(dbSettingsModelIstance::setFlagDeleteRowOnClose));
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneDeleteRowOnClose));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
@@ -287,7 +293,7 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("PRODUZIONE")
|
||||
.setKeySection("FLAG_SHOW_INFO")
|
||||
.setSetter(dbSettingsModelIstance::setFlagShowInfo)
|
||||
.setSetter(dbSettingsModelIstance::setFlagProduzioneShowInfo)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
|
||||
.setGestName("PICKING")
|
||||
@@ -314,6 +320,11 @@ public class SettingsManager {
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_USE_QTA_ORD")
|
||||
.setSetter(dbSettingsModelIstance::setFlagSpedizioneUseQtaOrd));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_USE_COLLI_PEDANA")
|
||||
.setSetter(dbSettingsModelIstance::setFlagSpedizioneUseColliPedana));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Integer.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("SETUP")
|
||||
@@ -387,6 +398,11 @@ public class SettingsManager {
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_ASK_INFO_AGGIUNTIVE")
|
||||
.setSetter(dbSettingsModelIstance::setFlagAskInfoAggiuntiveSpedizione));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_ASK_DUPLICATE_UDS")
|
||||
.setSetter(dbSettingsModelIstance::setFlagAskDuplicateUDSSpedizione));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
@@ -445,66 +461,133 @@ public class SettingsManager {
|
||||
.setKeySection("GENERA_DOC")
|
||||
.setSetter(dbSettingsModelIstance::setFlagGeneraDocumentoSpedizione)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("SUGGEST_DATA_SCAD")
|
||||
.setSetter(dbSettingsModelIstance::setSuggestDataScad)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_ASK_PRINT_UL")
|
||||
.setSetter(dbSettingsModelIstance::setFlagAskPrintUlAccettazioneBolla)
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaAskPrintUl)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_ASK_TIPO_COLLO")
|
||||
.setSetter(dbSettingsModelIstance::setFlagAskTipoColloAccettazioneBolla)
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaAskTipoCollo)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_ASK_VERSAMENTO_AUTOMATICO")
|
||||
.setSetter(dbSettingsModelIstance::setFlagAskVersamentoAutomaticoAccettazioneBolla)
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaAskVersamentoAutomatico)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_CAN_ADD_UNKNOWN_ITEMS")
|
||||
.setSetter(dbSettingsModelIstance::setFlagCanAddUnknownItemsAccettazioneBolla)
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaCanAddUnknownItems)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_CAN_ADD_UNKNOWN_BARCODES")
|
||||
.setSetter(dbSettingsModelIstance::setFlagCanAddUnknownBarcodesAccettazioneBolla)
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaCanAddUnknownBarcodes)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_ENABLE_FAST_PICK")
|
||||
.setSetter(dbSettingsModelIstance::setFlagEnableFastPickAccettazioneBolla)
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaEnableFastPick)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_DISABLE_MANDATORY_TRACCIABILITA")
|
||||
.setSetter(dbSettingsModelIstance::setFlagDisableMandatoryTracciabilitaAccettazioneBolla)
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaDisableMandatoryTracciabilita)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_ALLOW_UL_RECOVER")
|
||||
.setSetter(dbSettingsModelIstance::setFlagAllowULRecoverAccettazioneBolla)
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaAllowULRecover)
|
||||
.setDefaultValue(true));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_OVERFLOW_QUANTITY_WARNING")
|
||||
.setSetter(dbSettingsModelIstance::setFlagOverflowQuantityWarning)
|
||||
.setSetter(dbSettingsModelIstance::setFlagSpedizioneOverflowQuantityWarning)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE")
|
||||
.setKeySection("FLAG_ALLOW_BARCODE_FORNITORE")
|
||||
.setSetter(dbSettingsModelIstance::setFlagAllowBarcodeFornitore)
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneAllowBarcodeFornitore)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_USE_QTA_ORD")
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaUseQtaOrd)
|
||||
.setDefaultValue(true));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("SETUP")
|
||||
.setKeySection("FLAG_WARNING_NEW_PARTITA_MAG")
|
||||
.setSetter(dbSettingsModelIstance::setFlagWarningNewPartitaMag)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("PICKING_LIBERO")
|
||||
.setKeySection("ENABLE_SCAN_ART")
|
||||
.setSetter(dbSettingsModelIstance::setFlagPickingLiberoEnableScanArt)
|
||||
.setDefaultValue(true));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("SETUP")
|
||||
.setKeySection("ENABLE_POSITION_CHANGE_REQUEST")
|
||||
.setSetter(dbSettingsModelIstance::setFlagPositionChangeRequest)
|
||||
.setDefaultValue(true));
|
||||
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("IMBALLI")
|
||||
.setKeySection("COD_DTIP_CARICO")
|
||||
.setSetter(data -> {
|
||||
dbSettingsModelIstance.setFlagTracciamentoImballiCaricoEnabled(!UtilityString.isNullOrEmpty(data));
|
||||
}));
|
||||
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("IMBALLI")
|
||||
.setKeySection("COD_DTIP_SCARICO")
|
||||
.setSetter(data -> {
|
||||
dbSettingsModelIstance.setFlagTracciamentoImballiScaricoEnabled(!UtilityString.isNullOrEmpty(data));
|
||||
}));
|
||||
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
|
||||
.setGestName("PVM")
|
||||
.setSection("DOC_INTERNI")
|
||||
.setKeySection("REQUEST_NUM_DOC")
|
||||
.setSetter(dbSettingsModelIstance::setDocInterniRequestNumDoc));
|
||||
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("SETUP")
|
||||
.setKeySection("ENABLE_ART_CREATION")
|
||||
.setSetter(dbSettingsModelIstance::setFlagEnableArtCreation));
|
||||
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("SETUP")
|
||||
.setKeySection("ENABLE_ART_CREATION_GRP_MERC")
|
||||
.setSetter(data -> {
|
||||
if (data != null)
|
||||
dbSettingsModelIstance.setAllowedCodMgrpForArtCreation(Arrays.asList(data.split("\\|")));
|
||||
}));
|
||||
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
|
||||
|
||||
@@ -15,16 +15,19 @@ import java.io.File;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.FileDownloader;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||
|
||||
@Singleton
|
||||
public class UpdatesManager {
|
||||
|
||||
|
||||
private AppCompatActivity mContext;
|
||||
|
||||
public void init(AppCompatActivity activityContext) {
|
||||
public void init(AppCompatActivity activityContext, SystemRESTConsumer systemRESTConsumer) {
|
||||
this.mContext = activityContext;
|
||||
|
||||
final String baseEndpoint = SettingsManager.i().getServer().getProtocol() + "://" + SettingsManager.i().getServer().getHost() +
|
||||
@@ -34,15 +37,22 @@ public class UpdatesManager {
|
||||
final String currentDownloadUrl = baseEndpoint + "/ems-api/wms/android-release.apk";
|
||||
|
||||
|
||||
AppUpdater appUpdater = new AppUpdater(mContext)
|
||||
.setDisplay(Display.DIALOG)
|
||||
.setUpdateFrom(UpdateFrom.JSON)
|
||||
.setUpdateJSON(currentVersionUrl)
|
||||
.setButtonDoNotShowAgain(null)
|
||||
.setButtonUpdateClickListener((dialog, which) -> {
|
||||
installAPK(currentDownloadUrl);
|
||||
});
|
||||
appUpdater.start();
|
||||
systemRESTConsumer.retrieveUpdatesInfo(latestData -> {
|
||||
|
||||
AppUpdater appUpdater = new AppUpdater(mContext)
|
||||
.setDisplay(Display.DIALOG)
|
||||
.setUpdateFrom(UpdateFrom.JSON)
|
||||
.setUpdateJSON(currentVersionUrl)
|
||||
.setButtonDoNotShowAgain(null)
|
||||
.setButtonUpdateClickListener((dialog, which) -> {
|
||||
installAPK(currentDownloadUrl);
|
||||
});
|
||||
|
||||
if(latestData.isForced())
|
||||
appUpdater.setButtonDismiss(null);
|
||||
|
||||
appUpdater.start();
|
||||
}, ex -> UtilityExceptions.defaultException(mContext, ex));
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +77,11 @@ public class UpdatesManager {
|
||||
mContext.runOnUiThread(() -> {
|
||||
progressDialogBuilder.dismiss();
|
||||
|
||||
if (!destination.exists()) {
|
||||
UtilityExceptions.defaultException(mContext, new Exception("Errore durante il download dell'aggiornamento"));
|
||||
return;
|
||||
}
|
||||
|
||||
Uri fileLoc;
|
||||
Intent intent;
|
||||
|
||||
@@ -93,7 +108,8 @@ public class UpdatesManager {
|
||||
try {
|
||||
fileDownloader.download();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
progressDialogBuilder.dismissAllowingStateLoss();
|
||||
UtilityExceptions.defaultException(mContext, e);
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
@@ -61,6 +61,8 @@ public class FileDownloader {
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
if(downloadFile != null && downloadFile.exists())
|
||||
downloadFile.delete();
|
||||
throw e;
|
||||
|
||||
} finally {
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import com.google.zxing.MultiFormatWriter;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
@@ -109,12 +115,12 @@ public class UtilityBarcode {
|
||||
}
|
||||
|
||||
|
||||
public static String convertITF14toEAN13(String barcodeITF14) {
|
||||
public static String convertITF14toEAN13(String barcodeITF14) throws Exception {
|
||||
String barcodeEAN13 = null;
|
||||
|
||||
if (barcodeITF14.length() == 14) {
|
||||
barcodeEAN13 = barcodeITF14.substring(1, barcodeITF14.length() - 1).trim();
|
||||
barcodeEAN13 += getEAN13CheckDigit(barcodeEAN13);
|
||||
barcodeEAN13 += calculateEAN13CheckDigit(barcodeEAN13);
|
||||
}
|
||||
|
||||
return barcodeEAN13;
|
||||
@@ -131,18 +137,69 @@ public class UtilityBarcode {
|
||||
}
|
||||
|
||||
|
||||
private static String getEAN13CheckDigit(String ean) {
|
||||
|
||||
if (ean.length() != 12) {
|
||||
UtilityLogger.error(new Exception("Please provide an input string of 12 chars. Current lenght: " + ean.length()));
|
||||
return null;
|
||||
public static boolean isValidEan13(String ean13) {
|
||||
// Verifica che il codice sia lungo esattamente 13 cifre
|
||||
if (ean13.length() != 13 || !ean13.matches("\\d+")) {
|
||||
return false;
|
||||
}
|
||||
long tot = 0;
|
||||
|
||||
for (int i = 0; i < 12; i++) {
|
||||
tot = tot + (Long.parseLong(String.valueOf(ean.charAt(i))) * (i % 2 == 0 ? 1 : 3));
|
||||
}
|
||||
return tot % 10 == 0 ? "0" : "" + (10 - (tot % 10));
|
||||
// Calcola il check digit dalle prime 12 cifre
|
||||
int calculatedCheckDigit = calculateEAN13CheckDigit(ean13.substring(0, 12));
|
||||
int providedCheckDigit = Character.getNumericValue(ean13.charAt(12));
|
||||
|
||||
// Confronta il check digit calcolato con quello fornito
|
||||
return calculatedCheckDigit == providedCheckDigit;
|
||||
}
|
||||
|
||||
private static int calculateEAN13CheckDigit(String ean12) {
|
||||
int sum = 0;
|
||||
for (int i = 0; i < ean12.length(); i++) {
|
||||
int digit = Character.getNumericValue(ean12.charAt(i));
|
||||
sum += (i % 2 == 0) ? digit : digit * 3;
|
||||
}
|
||||
return (10 - (sum % 10)) % 10;
|
||||
}
|
||||
|
||||
public static Bitmap generateBarcodeImage(String barcode, int width, int height) throws Exception {
|
||||
if(barcode == null) return null;
|
||||
|
||||
BarcodeType barcodeType;
|
||||
|
||||
if(barcode.length() == 8)
|
||||
barcodeType = BarcodeType.EAN8;
|
||||
else if(barcode.length() == 13)
|
||||
barcodeType = BarcodeType.EAN13;
|
||||
else if(barcode.length() == 14)
|
||||
barcodeType = BarcodeType.INTERLEAVED_2OF5;
|
||||
else throw new Exception("Barcode " + barcode + " non valido");
|
||||
|
||||
return generateBarcodeImage(barcode, barcodeType, width, height);
|
||||
}
|
||||
|
||||
public static Bitmap generateBarcodeImage(String barcode, BarcodeType type, int width, int height) throws Exception {
|
||||
// Genera la matrice del codice a barre
|
||||
MultiFormatWriter writer = new MultiFormatWriter();
|
||||
|
||||
BarcodeFormat barcodeFormat = switch (type) {
|
||||
case EAN8 -> BarcodeFormat.EAN_8;
|
||||
case EAN13 -> BarcodeFormat.EAN_13;
|
||||
case INTERLEAVED_2OF5 -> BarcodeFormat.ITF;
|
||||
case CODE128 -> BarcodeFormat.CODE_128;
|
||||
default -> throw new Exception("Barcode " + barcode + " non valido (tipo: " + type + ")");
|
||||
};
|
||||
|
||||
BitMatrix bitMatrix = writer.encode(barcode, barcodeFormat, width, height);
|
||||
|
||||
// Crea un bitmap a partire dalla matrice
|
||||
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
|
||||
for (int x = 0; x < width; x++) {
|
||||
for (int y = 0; y < height; y++) {
|
||||
bitmap.setPixel(x, y, bitMatrix.get(x, y) ? Color.BLACK : Color.WHITE);
|
||||
}
|
||||
}
|
||||
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -63,6 +63,8 @@ public class UtilityExceptions {
|
||||
if (!BuildConfig.DEBUG && !toIgnore) {
|
||||
if (sendEmail) UtilityLogger.error(ex);
|
||||
FirebaseCrashlytics.getInstance().recordException(ex);
|
||||
} else {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,12 +7,15 @@ import java.lang.reflect.Modifier;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.model.secondary.StatoPartitaMag;
|
||||
import it.integry.integrywmsnative.core.rest.deserializer.LocalDateDeserializer;
|
||||
import it.integry.integrywmsnative.core.rest.deserializer.LocalDateTimeDeserializer;
|
||||
import it.integry.integrywmsnative.core.rest.deserializer.MtbTcolFlagUiUlDeserializer;
|
||||
import it.integry.integrywmsnative.core.rest.deserializer.StatoPartitaMagDeserializer;
|
||||
import it.integry.integrywmsnative.core.rest.serializer.LocalDateSerializer;
|
||||
import it.integry.integrywmsnative.core.rest.serializer.LocalDateTimeSerializer;
|
||||
import it.integry.integrywmsnative.core.rest.serializer.MtbTcolFlagUiUlSerializer;
|
||||
import it.integry.integrywmsnative.core.rest.serializer.StatoPartitaMagSerializer;
|
||||
|
||||
public class UtilityGson {
|
||||
@@ -27,6 +30,8 @@ public class UtilityGson {
|
||||
.registerTypeAdapter(LocalDateTime.class, new LocalDateTimeSerializer())
|
||||
.registerTypeAdapter(StatoPartitaMag.class, new StatoPartitaMagDeserializer())
|
||||
.registerTypeAdapter(StatoPartitaMag.class, new StatoPartitaMagSerializer())
|
||||
.registerTypeAdapter(MtbTCol.FlagUiUlEnum.class, new MtbTcolFlagUiUlDeserializer())
|
||||
.registerTypeAdapter(MtbTCol.FlagUiUlEnum.class, new MtbTcolFlagUiUlSerializer())
|
||||
.create();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import androidx.databinding.Observable;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.databinding.ObservableList;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.OnGeneralChangedCallback;
|
||||
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgsWithReturn;
|
||||
|
||||
public class UtilityObservable {
|
||||
|
||||
@@ -16,4 +23,36 @@ public class UtilityObservable {
|
||||
});
|
||||
}
|
||||
|
||||
public static <T, R> ObservableField<R> convertObservable(ObservableField<T> observableField, RunnableArgsWithReturn<T, R> dataConverter) {
|
||||
ObservableField<R> returnObservable = new ObservableField<>();
|
||||
|
||||
observableField.addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
returnObservable.set(dataConverter.run(observableField.get()));
|
||||
}
|
||||
});
|
||||
|
||||
returnObservable.set(dataConverter.run(observableField.get()));
|
||||
|
||||
return returnObservable;
|
||||
}
|
||||
|
||||
public static <T, R> ObservableArrayList<R> convertObservableArrayList(ObservableArrayList<T> observableField, RunnableArgsWithReturn<T, R> dataConverter) {
|
||||
ObservableArrayList<R> returnObservable = new ObservableArrayList<>();
|
||||
|
||||
observableField.addOnListChangedCallback(new OnListGeneralChangedCallback<T>() {
|
||||
@Override
|
||||
public void onChanged(ObservableList<T> sender) {
|
||||
|
||||
returnObservable.clear();
|
||||
returnObservable.addAll(sender.stream().map(dataConverter::run).collect(Collectors.toUnmodifiableList()));
|
||||
}
|
||||
});
|
||||
|
||||
returnObservable.addAll(observableField.stream().map(dataConverter::run).collect(Collectors.toUnmodifiableList()));
|
||||
|
||||
return returnObservable;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import android.text.Spanned;
|
||||
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -13,9 +15,101 @@ import java.util.regex.Pattern;
|
||||
*/
|
||||
|
||||
public class UtilityString {
|
||||
private static final Map<String, String> DATE_FORMAT_REGEXPS = new HashMap<String, String>() {{
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//giorno-mese-giorno
|
||||
put("^\\d{1,2}/\\d{1,2}/\\d{4}$", "dd/MM/yyyy");
|
||||
put("^\\d{1,2}\\.\\d{1,2}\\.\\d{4}$", "dd.MM.yyyy");
|
||||
put("^\\d{1,2}-\\d{1,2}-\\d{4}$", "dd-MM-yyyy");
|
||||
|
||||
//anno-mese-giorno
|
||||
put("^\\d{4}/\\d{1,2}/\\d{1,2}$", "yyyy/MM/dd");
|
||||
put("^\\d{4}\\.\\d{1,2}\\.\\d{1,2}$", "yyyy.MM.dd");
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}$", "yyyy-MM-dd");
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//senza spazi
|
||||
put("^\\d{8}$", "yyyyMMdd");
|
||||
put("^\\d{1,2}\\s[a-z]{3}\\s\\d{4}$", "dd MMM yyyy");
|
||||
put("^\\d{1,2}\\s[a-z]{4,}\\s\\d{4}$", "dd MMMM yyyy");
|
||||
|
||||
put("^\\d{12}$", "yyyyMMddHHmm");
|
||||
put("^\\d{8}\\s\\d{4}$", "yyyyMMdd HHmm");
|
||||
|
||||
put("^\\d{14}$", "yyyyMMddHHmmss");
|
||||
put("^\\d{8}\\s\\d{6}$", "yyyyMMdd HHmmss");
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//giorno-mese-anno hhmm
|
||||
put("^\\d{1,2}/\\d{1,2}/\\d{4}\\s\\d{1,2}\\.\\d{2}$", "dd/MM/yyyy HH.mm");
|
||||
put("^\\d{1,2}/\\d{1,2}/\\d{4}\\s\\d{1,2}:\\d{2}$", "dd/MM/yyyy HH:mm");
|
||||
|
||||
put("^\\d{1,2}\\.\\d{1,2}\\.\\d{4}\\s\\d{1,2}\\.\\d{2}$", "dd.MM.yyyy HH.mm");
|
||||
put("^\\d{1,2}\\.\\d{1,2}\\.\\d{4}\\s\\d{1,2}:\\d{2}$", "dd.MM.yyyy HH:mm");
|
||||
|
||||
put("^\\d{1,2}-\\d{1,2}-\\d{4}\\s\\d{1,2}\\.\\d{2}$", "dd-MM-yyyy HH.mm");
|
||||
put("^\\d{1,2}-\\d{1,2}-\\d{4}\\s\\d{1,2}:\\d{2}$", "dd-MM-yyyy HH:mm");
|
||||
|
||||
//anno-mese-giorno hhmm
|
||||
put("^\\d{4}/\\d{1,2}/\\d{1,2}\\s\\d{1,2}\\.\\d{2}$", "yyyy/MM/dd HH.mm");
|
||||
put("^\\d{4}/\\d{1,2}/\\d{1,2}\\s\\d{1,2}:\\d{2}$", "yyyy/MM/dd HH:mm");
|
||||
|
||||
put("^\\d{4}\\.\\d{1,2}\\.\\d{1,2}\\s\\d{1,2}\\.\\d{2}$", "yyyy.MM.dd HH.mm");
|
||||
put("^\\d{4}\\.\\d{1,2}\\.\\d{1,2}\\s\\d{1,2}:\\d{2}$", "yyyy.MM.dd HH:mm");
|
||||
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{1,2}\\.\\d{2}$", "yyyy-MM-dd HH.mm");
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{1,2}:\\d{2}$", "yyyy-MM-dd HH:mm");
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//giorno-mese-anno hhmmss
|
||||
put("^\\d{1,2}/\\d{1,2}/\\d{4}\\s\\d{1,2}\\.\\d{2}\\.\\d{2}$", "dd/MM/yyyy HH.mm.ss");
|
||||
put("^\\d{1,2}/\\d{1,2}/\\d{4}\\s\\d{1,2}:\\d{2}:\\d{2}$", "dd/MM/yyyy HH:mm:ss");
|
||||
|
||||
put("^\\d{1,2}\\.\\d{1,2}\\.\\d{4}\\s\\d{1,2}\\.\\d{2}\\.\\d{2}$", "dd.MM.yyyy HH.mm.ss");
|
||||
put("^\\d{1,2}\\.\\d{1,2}\\.\\d{4}\\s\\d{1,2}:\\d{2}:\\d{2}$", "dd.MM.yyyy HH:mm:ss");
|
||||
|
||||
put("^\\d{1,2}-\\d{1,2}-\\d{4}\\s\\d{1,2}\\.\\d{2}\\.\\d{2}$", "dd-MM-yyyy HH.mm.ss");
|
||||
put("^\\d{1,2}-\\d{1,2}-\\d{4}\\s\\d{1,2}:\\d{2}:\\d{2}$", "dd-MM-yyyy HH:mm:ss");
|
||||
|
||||
//anno-mese-giorno hhmmss
|
||||
put("^\\d{4}/\\d{1,2}/\\d{1,2}\\s\\d{1,2}\\.\\d{2}\\.\\d{2}$", "yyyy/MM/dd HH.mm.ss");
|
||||
put("^\\d{4}/\\d{1,2}/\\d{1,2}\\s\\d{1,2}:\\d{2}:\\d{2}$", "yyyy/MM/dd HH:mm:ss");
|
||||
|
||||
put("^\\d{4}\\.\\d{1,2}\\.\\d{1,2}\\s\\d{1,2}\\.\\d{2}\\.\\d{2}$", "yyyy.MM.dd HH.mm.ss");
|
||||
put("^\\d{4}\\.\\d{1,2}\\.\\d{1,2}\\s\\d{1,2}:\\d{2}:\\d{2}$", "yyyy.MM.dd HH:mm:ss");
|
||||
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{1,2}\\.\\d{2}\\.\\d{2}$", "yyyy-MM-dd HH.mm.ss");
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{1,2}:\\d{2}:\\d{2}$", "yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
//anno-mese-giorno hhmmssS
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{1,2}:\\d{2}:\\d{2}.\\d{1,3}$", "yyyy-MM-dd HH:mm:ss.SSS");
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//altri formati
|
||||
put("^\\d{1,2}\\s[a-z]{3}\\s\\d{4}\\s\\d{1,2}:\\d{2}:\\d{2}$", "dd MMM yyyy HH:mm:ss");
|
||||
put("^\\d{1,2}\\s[a-z]{4,}\\s\\d{4}\\s\\d{1,2}:\\d{2}:\\d{2}$", "dd MMMM yyyy HH:mm:ss");
|
||||
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}[T]\\d{1,2}:\\d{2}:\\d{2}$", "yyyy-MM-ddTHH:mm:ss");
|
||||
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}t\\d{1,2}:\\d{2}:\\d{2}.\\d{1,3}z$", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
|
||||
put("^(\\d{4})-(\\d{2})-(\\d{2})t(\\d{2}):(\\d{2}):(\\d{2})((\\+|-)(\\d{2}):(\\d{2}))$", "yyyy-MM-dd'T'HH:mm:ss");
|
||||
}};
|
||||
|
||||
public static String determineDateFormat(String dateString) {
|
||||
for (String regexp : DATE_FORMAT_REGEXPS.keySet()) {
|
||||
if (dateString.toLowerCase().matches(regexp)) {
|
||||
return DATE_FORMAT_REGEXPS.get(regexp);
|
||||
}
|
||||
}
|
||||
return null; // Unknown format.
|
||||
}
|
||||
|
||||
public static boolean isNullOrEmpty(String stringToCheck){
|
||||
return stringToCheck == null || stringToCheck.trim().length() == 0;
|
||||
return stringToCheck == null || stringToCheck.trim().isEmpty();
|
||||
}
|
||||
|
||||
public static String isNull(String stringToCheck, String alternativeString){
|
||||
@@ -23,7 +117,7 @@ public class UtilityString {
|
||||
}
|
||||
|
||||
public static String empty2null(String stringToCheck) {
|
||||
return (stringToCheck == null || stringToCheck.trim().length() == 0) ? null : stringToCheck.trim();
|
||||
return (stringToCheck == null || stringToCheck.trim().isEmpty()) ? null : stringToCheck.trim();
|
||||
}
|
||||
|
||||
public static String capitalizeWords(String capString){
|
||||
|
||||
@@ -25,6 +25,7 @@ import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.databinding.FragmentMainAccettazioneBollaBinding;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_elenco.rest.dto.SitBollaAccettazioneDTO;
|
||||
@@ -166,7 +167,7 @@ public class MainAccettazioneBollaElencoFragment extends BaseFragment implements
|
||||
|
||||
this.mBolleInevaseMutableData.clear();
|
||||
|
||||
if(tmpList != null)
|
||||
if (tmpList != null)
|
||||
this.mBolleInevaseMutableData.addAll(convertDataModelToListModel(tmpList));
|
||||
}
|
||||
|
||||
@@ -182,33 +183,44 @@ public class MainAccettazioneBollaElencoFragment extends BaseFragment implements
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private List<MainAccettazioneBolleElencoListModel> convertDataModelToListModel(List<TestataBollaAccettazioneDTO> dataList) {
|
||||
if(dataList == null)
|
||||
return null;
|
||||
boolean group = !SettingsManager.iDB().isFlagAccettazioneGroupListForn();
|
||||
if (dataList == null) return null;
|
||||
|
||||
final Comparator<TestataBollaAccettazioneDTO> comparer = Comparator.comparing(TestataBollaAccettazioneDTO::getListino)
|
||||
.thenComparing(TestataBollaAccettazioneDTO::getRagSoc)
|
||||
.thenComparing(TestataBollaAccettazioneDTO::getNumDoc);
|
||||
Stream<TestataBollaAccettazioneDTO> stream = Stream.of(dataList);
|
||||
|
||||
return Stream.of(dataList)
|
||||
.sorted(comparer)
|
||||
.map(x -> {
|
||||
MainAccettazioneBolleElencoListModel listModel = new MainAccettazioneBolleElencoListModel();
|
||||
if (group) {
|
||||
final Comparator<TestataBollaAccettazioneDTO> comparer = Comparator.comparing(TestataBollaAccettazioneDTO::getListino)
|
||||
.thenComparing(TestataBollaAccettazioneDTO::getRagSoc)
|
||||
.thenComparing(TestataBollaAccettazioneDTO::getNumDoc);
|
||||
stream = stream.sorted(comparer);
|
||||
} else {
|
||||
stream = stream.sortBy(x -> x.getRagSoc() + UtilityDate.formatDate(x.getDataDoc(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH));
|
||||
}
|
||||
|
||||
listModel.setOriginalModel(x);
|
||||
listModel.setGroupTitle(x.getListino() + " - " + x.getRagSoc());
|
||||
listModel.setDescription(String.format(getString(R.string.ord_acq_testata), x.getNumDoc(), UtilityDate.formatDate(x.getDataDoc(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN)));
|
||||
return stream.map(x -> {
|
||||
MainAccettazioneBolleElencoListModel listModel = new MainAccettazioneBolleElencoListModel();
|
||||
listModel.setOriginalModel(x);
|
||||
|
||||
listModel.setSubDescription(x.getDescrizioneListino());
|
||||
listModel.setRightDescription(x.getCodAnag());
|
||||
listModel.setRightSubDescription(x.getCodJcom());
|
||||
if (group)
|
||||
listModel.setGroupTitle(x.getListino() + " - " + x.getRagSoc());
|
||||
else
|
||||
listModel.setGroupTitle(x.getRagSoc());
|
||||
|
||||
return listModel;
|
||||
})
|
||||
.toList();
|
||||
listModel.setDescription(String.format(getString(R.string.ord_acq_testata),
|
||||
x.getNumDoc(),
|
||||
UtilityDate.formatDate(x.getDataDoc(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN)));
|
||||
|
||||
if (group)
|
||||
listModel.setSubDescription(x.getDescrizioneListino());
|
||||
else
|
||||
listModel.setSubDescription(x.getListino() + " - " + x.getDescrizioneListino());
|
||||
|
||||
listModel.setRightDescription(x.getCodAnag());
|
||||
listModel.setRightSubDescription(x.getCodJcom());
|
||||
|
||||
return listModel;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -33,6 +35,7 @@ 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.BaseActivity;
|
||||
import it.integry.integrywmsnative.core.expansion.OnGeneralChangedCallback;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
@@ -54,11 +57,15 @@ import it.integry.integrywmsnative.gest.accettazione_bolla_elenco.rest.dto.SitBo
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_elenco.rest.dto.TestataBollaAccettazioneDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_picking.dto.AccettazioneBollaPickingOrderBy;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_picking.dto.PickingObjectDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_picking.filters.AccettazioneBollaPickingFilterViewModel;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_picking.ui.AccettazioneBollaPickingListAdapter;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_picking.ui.AccettazioneBollaPickingListModel;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.filters.FilterDescrLayoutView;
|
||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliActivity;
|
||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterChipView;
|
||||
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.dialogs.ask_should_versamento_automatico_ul.DialogAskShouldVersamentoAutomaticoULView;
|
||||
@@ -82,8 +89,9 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
private ActivityAccettazioneBollaPickingBinding mBindings;
|
||||
|
||||
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
||||
|
||||
|
||||
|
||||
private final AccettazioneBollaPickingFilterViewModel mAppliedFilterViewModel = new AccettazioneBollaPickingFilterViewModel();
|
||||
|
||||
private final ObservableArrayList<AccettazioneBollaPickingListModel> mAccettazioneMutableData = new ObservableArrayList<>();
|
||||
|
||||
public BindableBoolean noItemsToPick = new BindableBoolean(false);
|
||||
@@ -150,10 +158,10 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
this.initVars();
|
||||
this.initBarcodeReader();
|
||||
this.initRecyclerView();
|
||||
// this.initFilters();
|
||||
this.initFilters();
|
||||
this.initFab();
|
||||
|
||||
boolean useQtaBolla = SettingsManager.iDB().isFlagAccettazioneUseQtaOrd();
|
||||
boolean useQtaBolla = SettingsManager.iDB().isFlagAccettazioneBollaUseQtaOrd();
|
||||
|
||||
mViewModel.setListeners(this);
|
||||
mViewModel.init(
|
||||
@@ -201,16 +209,85 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
this.mBindings.accettazionePickingList.setAdapter(adapter);
|
||||
|
||||
this.mViewModel.getPickingList().observe(this, updatedData -> {
|
||||
// mAppliedFilterViewModel.init(updatedData);
|
||||
mAppliedFilterViewModel.init(updatedData);
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
adapter.setOnLongClickListener(clickedItem -> {
|
||||
this.mViewModel.dispatchBollaRow(clickedItem, true);
|
||||
});
|
||||
|
||||
adapter.setOnItemClicked(clickedItem -> {
|
||||
this.mViewModel.dispatchBollaRow(clickedItem);
|
||||
});
|
||||
}
|
||||
|
||||
private void initFilters() {
|
||||
|
||||
var onPredicateChanged = new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
refreshList();
|
||||
}
|
||||
};
|
||||
|
||||
mAppliedFilterViewModel.getCurrentDescrPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
|
||||
List<FilterChipDTO> filterList = Stream.of(AccettazioneBollaPickingBindings.AVAILABLE_FILTERS.entrySet()).map(Map.Entry::getValue).sortBy(FilterChipDTO::getPosizione).toList();
|
||||
|
||||
for (FilterChipDTO filterChipDTO : filterList) {
|
||||
|
||||
FilterChipView filterChipView = new FilterChipView(this, filterChipDTO.getFilterChipText(), v -> initBottomSheetDialogFilter(filterChipDTO));
|
||||
|
||||
if (filterChipDTO.getID() == AccettazioneBollaPickingBindings.DESCR_FILTER_ID) {
|
||||
mAppliedFilterViewModel.getCurrentDescrPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mAppliedFilterViewModel.getCurrentDescrPredicate().get() == null) {
|
||||
mViewModel.resetMatchedRows();
|
||||
filterChipView.disableCloseIcon();
|
||||
|
||||
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||
mBindings.filterChipsGroup.addView(filterChipView);
|
||||
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||
} else {
|
||||
filterChipView.enableCloseIcon();
|
||||
|
||||
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||
mBindings.filterChipsGroup.addView(filterChipView, 0);
|
||||
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
filterChipView.setOnResetClicked(() -> mAppliedFilterViewModel.getCurrentDescrPredicate().set(null));
|
||||
}
|
||||
|
||||
this.mBindings.filterChipsGroup.addView(filterChipView);
|
||||
}
|
||||
}
|
||||
|
||||
private void initBottomSheetDialogFilter(FilterChipDTO filterChipDTO) {
|
||||
|
||||
filterChipDTO.getFilterLayoutView().setFilterName(filterChipDTO.getFilterChipText()).setContext(this);
|
||||
|
||||
var filterLayoutView = filterChipDTO.getFilterLayoutView();
|
||||
|
||||
if (filterChipDTO.getID() == AccettazioneBollaPickingBindings.DESCR_FILTER_ID) {
|
||||
((FilterDescrLayoutView) filterLayoutView)
|
||||
.setAll(mAppliedFilterViewModel.getAllDescrs())
|
||||
.setAvailable(mAppliedFilterViewModel.getAvailableDescrs())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setDescrFilter)
|
||||
.setPreselected(
|
||||
Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentDescrPredicate().get() == null ? x -> false : Objects.requireNonNull(mAppliedFilterViewModel.getCurrentDescrPredicate().get()))
|
||||
.map(x -> x.getMtbAart().getDescrizioneEstesa()).toList()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if (!filterLayoutView.isAdded()) filterLayoutView.show(getSupportFragmentManager(), "TAG");
|
||||
}
|
||||
|
||||
private void initFab() {
|
||||
fabPopupMenu = new PopupMenu(this, this.mBindings.accettazioneOrdineInevasoFab,
|
||||
@@ -221,7 +298,7 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
fabPopupMenu.setForceShowIcon(true);
|
||||
fabPopupMenu.getMenuInflater().inflate(R.menu.accettazione_ordine_inevaso_fab_menu, fabPopupMenu.getMenu());
|
||||
|
||||
fabPopupMenu.getMenu().findItem(R.id.show_created_ul).setVisible(SettingsManager.iDB().isFlagAllowULRecoverAccettazioneBolla());
|
||||
fabPopupMenu.getMenu().findItem(R.id.show_created_ul).setVisible(SettingsManager.iDB().isFlagAccettazioneBollaAllowULRecover());
|
||||
|
||||
fabPopupMenu.setOnMenuItemClickListener(item -> {
|
||||
int itemId = item.getItemId();
|
||||
@@ -246,13 +323,13 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
runOnUiThread(() -> {
|
||||
List<PickingObjectDTO> tmpList;
|
||||
|
||||
// if (mAppliedFilterViewModel != null) {
|
||||
// mAppliedFilterViewModel.applyAllTests();
|
||||
// tmpList = mAppliedFilterViewModel.getMutableFilteredOrderList().getValue();
|
||||
// } else {
|
||||
if (mAppliedFilterViewModel != null) {
|
||||
mAppliedFilterViewModel.applyAllTests();
|
||||
tmpList = mAppliedFilterViewModel.getMutableFilteredOrderList().getValue();
|
||||
} else {
|
||||
tmpList = mViewModel.getPickingList().getValue();
|
||||
// }
|
||||
//
|
||||
}
|
||||
|
||||
var list = convertDataModelToListModel(tmpList);
|
||||
|
||||
this.mAccettazioneMutableData.clear();
|
||||
@@ -387,6 +464,8 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
.findFirstOrElse(null)
|
||||
.isCanBeRecovered(),
|
||||
|
||||
false,
|
||||
|
||||
ReportManager.getReportNameLUFromGestione(GestioneEnum.ACQUISTO));
|
||||
|
||||
this.startActivityForResult(myIntent, PICK_UL_REQUEST);
|
||||
@@ -526,7 +605,7 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||
.setCanLUBeClosed(true)
|
||||
.setCanOverflowOrderQuantity(canOverflowQuantity)
|
||||
.setDisableTracciabilitaCheck(SettingsManager.iDB().isFlagDisableMandatoryTracciabilitaAccettazioneBolla());
|
||||
.setDisableTracciabilitaCheck(SettingsManager.iDB().isFlagAccettazioneBollaDisableMandatoryTracciabilita());
|
||||
|
||||
if (!mDialogInputQuantityV2View.isVisible())
|
||||
mDialogInputQuantityV2View
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package it.integry.integrywmsnative.gest.accettazione_bolla_picking;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.filters.FilterDescrLayoutView;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||
|
||||
public class AccettazioneBollaPickingBindings {
|
||||
|
||||
public static final int DESCR_FILTER_ID = 0;
|
||||
|
||||
public static final HashMap<Integer, FilterChipDTO> AVAILABLE_FILTERS = new HashMap<>() {
|
||||
{
|
||||
|
||||
put(DESCR_FILTER_ID, new FilterChipDTO()
|
||||
.setID(DESCR_FILTER_ID)
|
||||
.setPosizione(1)
|
||||
.setFilterChipText("Descrizione articolo")
|
||||
.setFilterLayoutView(new FilterDescrLayoutView()));
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -356,7 +356,7 @@ public class AccettazioneBollaPickingViewModel {
|
||||
|
||||
|
||||
private void manageUnknownBarcode(String barcode, Runnable onComplete) {
|
||||
if (SettingsManager.iDB().isFlagCanAddUnknownBarcodesAccettazioneBolla()) {
|
||||
if (SettingsManager.iDB().isFlagAccettazioneBollaCanAddUnknownBarcodes()) {
|
||||
//TODO: Implementare popup che richiede delle note aggiuntive sul barcode scansionato
|
||||
this.sendOnUnknownBarcodeScanned(barcode, notes -> {
|
||||
this.manageDispatchBollaRow(new PickingObjectDTO()
|
||||
@@ -376,7 +376,7 @@ public class AccettazioneBollaPickingViewModel {
|
||||
|
||||
|
||||
private void manageNoArtFound(MtbAart mtbAart, PickDataDTO pickDataDTO) {
|
||||
if (SettingsManager.iDB().isFlagCanAddUnknownItemsAccettazioneBolla()) {
|
||||
if (SettingsManager.iDB().isFlagAccettazioneBollaCanAddUnknownItems()) {
|
||||
|
||||
this.manageDispatchBollaRow(new PickingObjectDTO()
|
||||
.setMtbAart(mtbAart)
|
||||
@@ -410,7 +410,7 @@ public class AccettazioneBollaPickingViewModel {
|
||||
}
|
||||
|
||||
private void manageInfoAggiuntiveRequest(RunnableArgss<String, MtbTCol> onComplete) {
|
||||
if (!SettingsManager.iDB().isFlagAskTipoColloAccettazioneBolla()) {
|
||||
if (!SettingsManager.iDB().isFlagAccettazioneBollaAskTipoCollo()) {
|
||||
onComplete.run(null, null);
|
||||
return;
|
||||
}
|
||||
@@ -420,15 +420,15 @@ public class AccettazioneBollaPickingViewModel {
|
||||
|
||||
public void manageDispatchBollaRow(final PickingObjectDTO pickingObjectDTO) {
|
||||
String partitaMag = null;
|
||||
if(pickingObjectDTO.getTempPickData() != null){
|
||||
if(pickingObjectDTO.getTempPickData().getManualPickDTO() != null){
|
||||
if(pickingObjectDTO.getTempPickData().getManualPickDTO().getMtbPartitaMag() != null){
|
||||
if (pickingObjectDTO.getTempPickData() != null) {
|
||||
if (pickingObjectDTO.getTempPickData().getManualPickDTO() != null) {
|
||||
if (pickingObjectDTO.getTempPickData().getManualPickDTO().getMtbPartitaMag() != null) {
|
||||
partitaMag = pickingObjectDTO.getTempPickData().getManualPickDTO().getMtbPartitaMag().getPartitaMag();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (SettingsManager.iDB().isFlagEnableFastPickAccettazioneBolla()) {
|
||||
if (SettingsManager.iDB().isFlagAccettazioneBollaEnableFastPick()) {
|
||||
this.saveNewRow(pickingObjectDTO,
|
||||
BigDecimal.ONE,
|
||||
pickingObjectDTO.getMtbAart().getQtaCnf(),
|
||||
@@ -443,7 +443,11 @@ public class AccettazioneBollaPickingViewModel {
|
||||
dispatchBollaRow(pickingObjectDTO);
|
||||
}
|
||||
|
||||
public void dispatchBollaRow(final PickingObjectDTO pickingObjectDTO) {
|
||||
public void dispatchBollaRow(final PickingObjectDTO pickingObjectDTO){
|
||||
dispatchBollaRow(pickingObjectDTO, false);
|
||||
}
|
||||
|
||||
public void dispatchBollaRow(final PickingObjectDTO pickingObjectDTO, boolean longClick) {
|
||||
if (this.mCurrentMtbColt == null) return;
|
||||
|
||||
AtomicBigDecimal numCnfWithdrawRows = new AtomicBigDecimal();
|
||||
@@ -540,21 +544,21 @@ public class AccettazioneBollaPickingViewModel {
|
||||
initialQtaCnf = qtaCnfDaPrelevare;
|
||||
initialQtaTot = qtaColDaPrelevare;
|
||||
|
||||
} else if (totalQtaDoc != null) {
|
||||
initialNumCnf = totalNumCnfDoc;
|
||||
initialQtaCnf = qtaCnfDoc;
|
||||
initialQtaTot = totalQtaDoc;
|
||||
} else {
|
||||
initialNumCnf = BigDecimal.ONE;
|
||||
initialQtaCnf = mtbAart.getQtaCnf();
|
||||
initialQtaTot = mtbAart.getQtaCnf();
|
||||
}
|
||||
|
||||
if (!this.mUseQtaBolla &&
|
||||
UtilityBigDecimal.greaterThan(pickingObjectDTO.getMtbAart().getColliPedana(), BigDecimal.ZERO) &&
|
||||
UtilityBigDecimal.greaterThan(initialNumCnf, pickingObjectDTO.getMtbAart().getColliPedana())) {
|
||||
initialNumCnf = pickingObjectDTO.getMtbAart().getColliPedana();
|
||||
initialQtaTot = initialNumCnf.multiply(initialQtaCnf);
|
||||
if (!this.mUseQtaBolla) {
|
||||
if (UtilityBigDecimal.greaterThan(pickingObjectDTO.getMtbAart().getColliPedana(), BigDecimal.ZERO) &&
|
||||
UtilityBigDecimal.greaterThan(initialNumCnf, pickingObjectDTO.getMtbAart().getColliPedana())) {
|
||||
initialNumCnf = pickingObjectDTO.getMtbAart().getColliPedana();
|
||||
initialQtaTot = initialNumCnf.multiply(initialQtaCnf);
|
||||
} else if(UtilityBigDecimal.greaterThan(initialNumCnf, BigDecimal.ONE) && pickingObjectDTO.getMtbAart().isFlagQtaCnfFissaBoolean()) {
|
||||
initialNumCnf = BigDecimal.ONE;
|
||||
initialQtaTot = initialNumCnf.multiply(initialQtaCnf);
|
||||
}
|
||||
}
|
||||
|
||||
if (dataScad == null && pickingObjectDTO.getMtbAart().getGgScadPartita() != null && pickingObjectDTO.getMtbAart().getGgScadPartita() > 0) {
|
||||
@@ -574,36 +578,48 @@ public class AccettazioneBollaPickingViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
this.sendOnItemDispatched(
|
||||
pickingObjectDTO,
|
||||
pickingObjectDTO.getMtbAart(),
|
||||
initialNumCnf, initialQtaCnf, initialQtaTot,
|
||||
qtaDaEvadere,
|
||||
numCnfDaEvadere,
|
||||
qtaCnfDaEvadere,
|
||||
qtaColDaPrelevare,
|
||||
numCnfDaPrelevare,
|
||||
qtaCnfDaPrelevare,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
partitaMag,
|
||||
dataScad,
|
||||
true,
|
||||
(pickedQuantityDTO, shouldCloseLU) -> {
|
||||
this.saveNewRow(pickingObjectDTO,
|
||||
pickedQuantityDTO.getNumCnf(),
|
||||
pickedQuantityDTO.getQtaCnf(),
|
||||
pickedQuantityDTO.getQtaTot(),
|
||||
pickedQuantityDTO.getPartitaMag(),
|
||||
pickedQuantityDTO.getDataScad(),
|
||||
shouldCloseLU);
|
||||
});
|
||||
if (!longClick){
|
||||
this.sendOnItemDispatched(
|
||||
pickingObjectDTO,
|
||||
pickingObjectDTO.getMtbAart(),
|
||||
initialNumCnf, initialQtaCnf, initialQtaTot,
|
||||
qtaDaEvadere,
|
||||
numCnfDaEvadere,
|
||||
qtaCnfDaEvadere,
|
||||
qtaColDaPrelevare,
|
||||
numCnfDaPrelevare,
|
||||
qtaCnfDaPrelevare,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
partitaMag,
|
||||
dataScad,
|
||||
true,
|
||||
(pickedQuantityDTO, shouldCloseLU) -> {
|
||||
this.saveNewRow(pickingObjectDTO,
|
||||
pickedQuantityDTO.getNumCnf(),
|
||||
pickedQuantityDTO.getQtaCnf(),
|
||||
pickedQuantityDTO.getQtaTot(),
|
||||
pickedQuantityDTO.getPartitaMag(),
|
||||
pickedQuantityDTO.getDataScad(),
|
||||
shouldCloseLU);
|
||||
});
|
||||
} else {
|
||||
this.saveNewRow(
|
||||
pickingObjectDTO,
|
||||
initialNumCnf,
|
||||
initialQtaCnf,
|
||||
initialQtaTot,
|
||||
partitaMag,
|
||||
dataScad,
|
||||
false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, LocalDate dataScad, boolean shouldCloseLU) {
|
||||
public void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal
|
||||
qtaCnf, BigDecimal qtaTot, String partitaMag, LocalDate dataScad, boolean shouldCloseLU) {
|
||||
if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) {
|
||||
resetMatchedRows();
|
||||
|
||||
@@ -691,7 +707,8 @@ public class AccettazioneBollaPickingViewModel {
|
||||
});
|
||||
}
|
||||
|
||||
private void saveEditedRow(MtbColr mtbColrToUpdate, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, LocalDate dataScad, boolean shouldCloseLU) {
|
||||
private void saveEditedRow(MtbColr mtbColrToUpdate, BigDecimal numCnf, BigDecimal
|
||||
qtaCnf, BigDecimal qtaTot, String partitaMag, LocalDate dataScad, boolean shouldCloseLU) {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
MtbColr mtbColrClone = (MtbColr) mtbColrToUpdate.clone();
|
||||
@@ -802,7 +819,7 @@ public class AccettazioneBollaPickingViewModel {
|
||||
|
||||
private void manageVersamentoAutomatico(Runnable onComplete) {
|
||||
|
||||
if (!SettingsManager.iDB().isFlagAskVersamentoAutomaticoAccettazioneBolla()) {
|
||||
if (!SettingsManager.iDB().isFlagAccettazioneBollaAskVersamentoAutomatico()) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
@@ -825,7 +842,7 @@ public class AccettazioneBollaPickingViewModel {
|
||||
}
|
||||
|
||||
private void managePrintCollo(Runnable onComplete) {
|
||||
if (!mCurrentMtbColt.getDisablePrint() || !SettingsManager.iDB().isFlagAskPrintUlAccettazioneBolla()) {
|
||||
if (!mCurrentMtbColt.getDisablePrint() || !SettingsManager.iDB().isFlagAccettazioneBollaAskPrintUl()) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
@@ -998,12 +1015,14 @@ public class AccettazioneBollaPickingViewModel {
|
||||
if (this.mListener != null) mListener.onMtbColrDeleteRequest(onComplete);
|
||||
}
|
||||
|
||||
private void notifyVersamentoAutomaticoResult(VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, Runnable onComplete) {
|
||||
private void notifyVersamentoAutomaticoResult(VersamentoAutomaticoULResponseDTO
|
||||
versamentoAutomaticoULResponseDTO, Runnable onComplete) {
|
||||
if (this.mListener != null)
|
||||
mListener.onULVersata(versamentoAutomaticoULResponseDTO, onComplete);
|
||||
}
|
||||
|
||||
private void sendOnUnknownBarcodeScanned(String barocde, RunnableArgs<String> onComplete, Runnable onAbort) {
|
||||
private void sendOnUnknownBarcodeScanned(String
|
||||
barocde, RunnableArgs<String> onComplete, Runnable onAbort) {
|
||||
if (this.mListener != null)
|
||||
mListener.onUnknownBarcodeScanned(barocde, onComplete, onAbort);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package it.integry.integrywmsnative.gest.accettazione_bolla_picking.filters;
|
||||
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.annimon.stream.function.Predicate;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_picking.dto.PickingObjectDTO;
|
||||
|
||||
public class AccettazioneBollaPickingFilterViewModel {
|
||||
private final ObservableField<Predicate<PickingObjectDTO>> currentDescrPredicate = new ObservableField<>();
|
||||
|
||||
private List<PickingObjectDTO> initialOrderList;
|
||||
private final MutableLiveData<List<PickingObjectDTO>> currentFilteredOrderList = new MutableLiveData<>();
|
||||
|
||||
public void init(List<PickingObjectDTO> initialList) {
|
||||
this.initialOrderList = initialList;
|
||||
this.currentFilteredOrderList.setValue(this.initialOrderList);
|
||||
}
|
||||
|
||||
public MutableLiveData<List<PickingObjectDTO>> getMutableFilteredOrderList() {
|
||||
return this.currentFilteredOrderList;
|
||||
}
|
||||
|
||||
|
||||
public void setDescrFilter(List<String> descrs) {
|
||||
if (descrs == null || descrs.isEmpty()) currentDescrPredicate.set(null);
|
||||
else {
|
||||
currentDescrPredicate.set(o -> descrs.contains(o.getMtbAart().getDescrizione()));
|
||||
}
|
||||
}
|
||||
|
||||
public void applyAllTests() {
|
||||
|
||||
List<PickingObjectDTO> returnList;
|
||||
|
||||
if (currentDescrPredicate.get() == null) {
|
||||
returnList = this.initialOrderList;
|
||||
} else {
|
||||
Stream<PickingObjectDTO> tmpStream = Stream.of(this.initialOrderList)
|
||||
.filter(x ->(currentDescrPredicate.get() == null || (currentDescrPredicate.get().test(x)))
|
||||
);
|
||||
|
||||
returnList = tmpStream.toList();
|
||||
}
|
||||
|
||||
this.currentFilteredOrderList.setValue(returnList);
|
||||
}
|
||||
|
||||
public ObservableField<Predicate<PickingObjectDTO>> getCurrentDescrPredicate() {
|
||||
return currentDescrPredicate;
|
||||
}
|
||||
|
||||
public List<String> getAllDescrs() {
|
||||
return Stream
|
||||
.of(Objects.requireNonNull(initialOrderList))
|
||||
.filter(x -> x.getMtbAart().getDescrizioneEstesa() != null)
|
||||
.sortBy(x -> x.getMtbAart().getDescrizioneEstesa())
|
||||
.map(x -> x.getMtbAart().getDescrizioneEstesa() != null ? x.getMtbAart().getDescrizioneEstesa() : null)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<String> getAvailableDescrs() {
|
||||
return Stream.of(this.initialOrderList)
|
||||
.map(x -> x.getMtbAart().getDescrizioneEstesa())
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,12 @@ package it.integry.integrywmsnative.gest.accettazione_bolla_picking.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
@@ -15,7 +17,11 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.zhukic.sectionedrecyclerview.SectionedRecyclerViewAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.OnListGeneralChangedCallback;
|
||||
@@ -33,6 +39,7 @@ public class AccettazioneBollaPickingListAdapter extends SectionedRecyclerViewAd
|
||||
private final List<AccettazioneBollaPickingListModel> mDataset = new ArrayList<>();
|
||||
|
||||
private RunnableArgs<PickingObjectDTO> mOnItemClicked;
|
||||
private RunnableArgs<PickingObjectDTO> mOnItemLongClicked;
|
||||
|
||||
static class SubheaderHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
@@ -61,10 +68,29 @@ public class AccettazioneBollaPickingListAdapter extends SectionedRecyclerViewAd
|
||||
this.mShowSecondaryUntMis = showSecondaryUntMis;
|
||||
|
||||
mutableDataSet.addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
||||
@RequiresApi(api = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
|
||||
@Override
|
||||
public void onChanged(ObservableList sender) {
|
||||
List<AccettazioneBollaPickingListModel> listaOrdinata = new ArrayList<>();
|
||||
if (!sender.isEmpty()) {
|
||||
listaOrdinata = new ArrayList<>(sender);
|
||||
|
||||
Collections.sort(listaOrdinata, (a, b) -> {
|
||||
|
||||
boolean condA = a.getQtaEvasa().subtract(a.getQtaTot()).floatValue() == 0;
|
||||
boolean condB = b.getQtaEvasa().subtract(b.getQtaTot()).floatValue() == 0;
|
||||
|
||||
if (condA && !condB) {
|
||||
return -1;
|
||||
} else if (!condA && condB) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
mDataset.clear();
|
||||
mDataset.addAll(sender);
|
||||
mDataset.addAll(listaOrdinata);
|
||||
notifyDataSetChanged();
|
||||
notifyDataChanged();
|
||||
}
|
||||
@@ -75,6 +101,9 @@ public class AccettazioneBollaPickingListAdapter extends SectionedRecyclerViewAd
|
||||
this.mOnItemClicked = onItemClicked;
|
||||
}
|
||||
|
||||
public void setOnLongClickListener(RunnableArgs<PickingObjectDTO> onItemLongClicked){
|
||||
this.mOnItemLongClicked = onItemLongClicked;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccettazioneBollaPickingListAdapter.SubheaderHolder onCreateSubheaderViewHolder(ViewGroup parent, int viewType) {
|
||||
@@ -160,6 +189,12 @@ public class AccettazioneBollaPickingListAdapter extends SectionedRecyclerViewAd
|
||||
if (this.mOnItemClicked != null)
|
||||
this.mOnItemClicked.run(pickingObjectDTO.getOriginalModel());
|
||||
});
|
||||
|
||||
holder.mBinding.getRoot().setOnLongClickListener(v -> {
|
||||
if (this.mOnItemLongClicked != null)
|
||||
this.mOnItemLongClicked.run(pickingObjectDTO.getOriginalModel());
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
import android.view.Gravity;
|
||||
import android.view.Menu;
|
||||
@@ -78,6 +79,7 @@ import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUView;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||
import it.integry.integrywmsnative.view.dialogs.tracciamento_imballi.DialogTracciamentoImballiView;
|
||||
import it.integry.integrywmsnative.view.dialogs.versamento_automatico_ul_done.DialogVersamentoAutomaticoULDoneView;
|
||||
|
||||
public class AccettazioneOrdiniPickingActivity extends BaseActivity implements AccettazioneOrdiniPickingViewModel.Listener, BottomSheetFragmentLUContentViewModel.Listener, BottomSheetFragmentLUContentView.Listener {
|
||||
@@ -151,28 +153,30 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
boolean useQtaOrd = SettingsManager.iDB().isFlagAccettazioneUseQtaOrd();
|
||||
|
||||
mViewModel.setListeners(this);
|
||||
mViewModel.init(
|
||||
mOrders,
|
||||
mSitArts,
|
||||
useQtaOrd);
|
||||
mViewModel.init(mOrders, mSitArts, useQtaOrd);
|
||||
}
|
||||
|
||||
private void initFab() {
|
||||
fabPopupMenu = new PopupMenu(this, this.mBindings.accettazioneOrdineInevasoFab,
|
||||
(Gravity.END | Gravity.BOTTOM),
|
||||
androidx.appcompat.R.attr.popupMenuStyle,
|
||||
com.google.android.material.R.style.Widget_Material3_PopupMenu_ContextMenu);
|
||||
fabPopupMenu = new PopupMenu(this, this.mBindings.accettazioneOrdineInevasoFab, (Gravity.END | Gravity.BOTTOM), androidx.appcompat.R.attr.popupMenuStyle, com.google.android.material.R.style.Widget_Material3_PopupMenu_ContextMenu);
|
||||
|
||||
fabPopupMenu.setForceShowIcon(true);
|
||||
fabPopupMenu.getMenuInflater().inflate(R.menu.accettazione_ordine_inevaso_fab_menu, fabPopupMenu.getMenu());
|
||||
|
||||
if (!SettingsManager.iDB().isFlagTracciamentoImballiCaricoEnabled())
|
||||
fabPopupMenu.getMenu().removeItem(R.id.track_packaging);
|
||||
|
||||
fabPopupMenu.setOnMenuItemClickListener(item -> {
|
||||
int itemId = item.getItemId();
|
||||
|
||||
if (itemId == R.id.show_created_ul) {
|
||||
showCreatedUL();
|
||||
return true;
|
||||
} else if (itemId == R.id.track_packaging) {
|
||||
trackPackaging();
|
||||
return true;
|
||||
} else if (itemId == R.id.create_ul) {
|
||||
createNewLU();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -192,17 +196,11 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
mAppliedFilterViewModel.getCurrentDescrPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
mAppliedFilterViewModel.getCurrentPosPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
|
||||
List<FilterChipDTO> filterList = Stream.of(AccettazioneOrdiniPickingBindings.AVAILABLE_FILTERS.entrySet())
|
||||
.map(Map.Entry::getValue)
|
||||
.sortBy(FilterChipDTO::getPosizione)
|
||||
.toList();
|
||||
List<FilterChipDTO> filterList = Stream.of(AccettazioneOrdiniPickingBindings.AVAILABLE_FILTERS.entrySet()).map(Map.Entry::getValue).sortBy(FilterChipDTO::getPosizione).toList();
|
||||
|
||||
for (FilterChipDTO filterChipDTO : filterList) {
|
||||
|
||||
FilterChipView filterChipView = new FilterChipView(
|
||||
this,
|
||||
filterChipDTO.getFilterChipText(),
|
||||
v -> initBottomSheetDialogFilter(filterChipDTO));
|
||||
FilterChipView filterChipView = new FilterChipView(this, filterChipDTO.getFilterChipText(), v -> initBottomSheetDialogFilter(filterChipDTO));
|
||||
|
||||
switch (filterChipDTO.getID()) {
|
||||
case AccettazioneOrdiniPickingBindings.COD_ART_FILTER_ID -> {
|
||||
@@ -280,52 +278,20 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
|
||||
private void initBottomSheetDialogFilter(FilterChipDTO filterChipDTO) {
|
||||
|
||||
filterChipDTO
|
||||
.getFilterLayoutView()
|
||||
.setFilterName(filterChipDTO.getFilterChipText())
|
||||
.setContext(this);
|
||||
filterChipDTO.getFilterLayoutView().setFilterName(filterChipDTO.getFilterChipText()).setContext(this);
|
||||
|
||||
var filterLayoutView = filterChipDTO
|
||||
.getFilterLayoutView();
|
||||
var filterLayoutView = filterChipDTO.getFilterLayoutView();
|
||||
|
||||
switch (filterChipDTO.getID()) {
|
||||
case AccettazioneOrdiniPickingBindings.COD_ART_FILTER_ID ->
|
||||
((FilterCodArtLayoutView) filterLayoutView)
|
||||
.setAll(mAppliedFilterViewModel.getAllCodArts())
|
||||
.setAvailable(mAppliedFilterViewModel.getAvailableCodArts())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setCodArtFilter)
|
||||
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentCodArtPredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentCodArtPredicate().get())
|
||||
.map(x -> x.getSitArtOrdDTO().getCodMart())
|
||||
.toList());
|
||||
((FilterCodArtLayoutView) filterLayoutView).setAll(mAppliedFilterViewModel.getAllCodArts()).setAvailable(mAppliedFilterViewModel.getAvailableCodArts()).setOnFilterApplied(mAppliedFilterViewModel::setCodArtFilter).setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue())).filter(mAppliedFilterViewModel.getCurrentCodArtPredicate().get() == null ? x -> false : mAppliedFilterViewModel.getCurrentCodArtPredicate().get()).map(x -> x.getSitArtOrdDTO().getCodMart()).toList());
|
||||
case AccettazioneOrdiniPickingBindings.DESCR_FILTER_ID ->
|
||||
((FilterDescrLayoutView) filterLayoutView)
|
||||
.setAll(mAppliedFilterViewModel.getAllDescrs())
|
||||
.setAvailable(mAppliedFilterViewModel.getAvailableDescrs())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setDescrFilter)
|
||||
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentDescrPredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentDescrPredicate().get())
|
||||
.map(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt())
|
||||
.toList());
|
||||
((FilterDescrLayoutView) filterLayoutView).setAll(mAppliedFilterViewModel.getAllDescrs()).setAvailable(mAppliedFilterViewModel.getAvailableDescrs()).setOnFilterApplied(mAppliedFilterViewModel::setDescrFilter).setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue())).filter(mAppliedFilterViewModel.getCurrentDescrPredicate().get() == null ? x -> false : mAppliedFilterViewModel.getCurrentDescrPredicate().get()).map(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt()).toList());
|
||||
case AccettazioneOrdiniPickingBindings.POS_FILTER_ID ->
|
||||
((FilterPosizioneLayoutView) filterLayoutView)
|
||||
.setAll(mAppliedFilterViewModel.getAllPos())
|
||||
.setAvailable(mAppliedFilterViewModel.getAvailablePos())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setPosFilter)
|
||||
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentPosPredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentPosPredicate().get())
|
||||
.map(x -> x.getMtbAart().getPosizione())
|
||||
.toList());
|
||||
((FilterPosizioneLayoutView) filterLayoutView).setAll(mAppliedFilterViewModel.getAllPos()).setAvailable(mAppliedFilterViewModel.getAvailablePos()).setOnFilterApplied(mAppliedFilterViewModel::setPosFilter).setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue())).filter(mAppliedFilterViewModel.getCurrentPosPredicate().get() == null ? x -> false : mAppliedFilterViewModel.getCurrentPosPredicate().get()).map(x -> x.getMtbAart().getPosizione()).toList());
|
||||
}
|
||||
|
||||
if (!filterLayoutView.isAdded())
|
||||
filterLayoutView.show(getSupportFragmentManager(), "TAG");
|
||||
if (!filterLayoutView.isAdded()) filterLayoutView.show(getSupportFragmentManager(), "TAG");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -374,9 +340,7 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
}
|
||||
|
||||
private void initBarcodeReader() {
|
||||
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
.setOnScanSuccessful(onScanSuccessful)
|
||||
.setOnScanFailed(ex -> UtilityExceptions.defaultException(this, ex, false)));
|
||||
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO().setOnScanSuccessful(onScanSuccessful).setOnScanFailed(ex -> UtilityExceptions.defaultException(this, ex, false)));
|
||||
}
|
||||
|
||||
private void initRecyclerView() {
|
||||
@@ -417,9 +381,7 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
}
|
||||
|
||||
private List<AccettazioneOrdiniPickingListModel> convertDataModelToListModel(List<PickingObjectDTO> dataList) {
|
||||
List<PickingObjectDTO> tmpList = Stream.of(dataList)
|
||||
.filter(x -> !x.isHidden() && UtilityBigDecimal.greaterThan(x.getSitArtOrdDTO().getQtaDaEvadere(), BigDecimal.ZERO))
|
||||
.toList();
|
||||
List<PickingObjectDTO> tmpList = Stream.of(dataList).filter(x -> !x.isHidden() && UtilityBigDecimal.greaterThan(x.getSitArtOrdDTO().getQtaDaEvadere(), BigDecimal.ZERO)).toList();
|
||||
|
||||
return switch (mCurrentOrderBy) {
|
||||
case COD_ART_FOR -> convertDataModelToListModel__CodArtForn(tmpList);
|
||||
@@ -430,133 +392,118 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
|
||||
private List<AccettazioneOrdiniPickingListModel> convertDataModelToListModel__CodArtForn(List<PickingObjectDTO> dataList) {
|
||||
ArrayList<AccettazioneOrdiniPickingListModel> list = new ArrayList<>();
|
||||
Stream.of(dataList)
|
||||
.sortBy(x -> UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()) +
|
||||
(UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()))
|
||||
.forEach(x -> {
|
||||
AccettazioneOrdiniPickingListModel accettazioneOrdiniPickingListModel = new AccettazioneOrdiniPickingListModel();
|
||||
accettazioneOrdiniPickingListModel.setActive(true);
|
||||
Stream.of(dataList).sortBy(x -> UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()) + (UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa())).forEach(x -> {
|
||||
AccettazioneOrdiniPickingListModel accettazioneOrdiniPickingListModel = new AccettazioneOrdiniPickingListModel();
|
||||
accettazioneOrdiniPickingListModel.setActive(true);
|
||||
|
||||
accettazioneOrdiniPickingListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()) +
|
||||
(UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()));
|
||||
accettazioneOrdiniPickingListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()) + (UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSubDescrizione1("Consegna: " + UtilityDate.formatDate(x.getSitArtOrdDTO().getDataCons(), UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH));
|
||||
accettazioneOrdiniPickingListModel.setSubDescrizione1("Consegna: " + UtilityDate.formatDate(x.getSitArtOrdDTO().getDataCons(), UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||
|
||||
//Calc Num CNF
|
||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||
//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);
|
||||
}
|
||||
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;
|
||||
//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 (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())) {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||
} else {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||
} else {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
|
||||
accettazioneOrdiniPickingListModel.setOriginalModel(x);
|
||||
accettazioneOrdiniPickingListModel.setOriginalModel(x);
|
||||
|
||||
list.add(accettazioneOrdiniPickingListModel);
|
||||
});
|
||||
list.add(accettazioneOrdiniPickingListModel);
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private List<AccettazioneOrdiniPickingListModel> convertDataModelToListModel__DescrArt(List<PickingObjectDTO> dataList) {
|
||||
ArrayList<AccettazioneOrdiniPickingListModel> list = new ArrayList<>();
|
||||
Stream.of(dataList)
|
||||
.sortBy(x -> x.getMtbAart().getDescrizioneEstesa())
|
||||
.forEach(x -> {
|
||||
AccettazioneOrdiniPickingListModel accettazioneOrdiniPickingListModel = new AccettazioneOrdiniPickingListModel();
|
||||
accettazioneOrdiniPickingListModel.setActive(true);
|
||||
Stream.of(dataList).sortBy(x -> x.getMtbAart().getDescrizioneEstesa()).forEach(x -> {
|
||||
AccettazioneOrdiniPickingListModel accettazioneOrdiniPickingListModel = new AccettazioneOrdiniPickingListModel();
|
||||
accettazioneOrdiniPickingListModel.setActive(true);
|
||||
|
||||
accettazioneOrdiniPickingListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart())
|
||||
+ (UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()));
|
||||
accettazioneOrdiniPickingListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()) + (UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||
|
||||
//Calc Num CNF
|
||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||
//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);
|
||||
}
|
||||
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;
|
||||
//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 (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())) {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||
} else {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||
} else {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
|
||||
accettazioneOrdiniPickingListModel.setOriginalModel(x);
|
||||
accettazioneOrdiniPickingListModel.setOriginalModel(x);
|
||||
|
||||
list.add(accettazioneOrdiniPickingListModel);
|
||||
});
|
||||
list.add(accettazioneOrdiniPickingListModel);
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
@@ -564,136 +511,122 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
private List<AccettazioneOrdiniPickingListModel> convertDataModelToListModel__RagSocCom(List<PickingObjectDTO> dataList) {
|
||||
ArrayList<AccettazioneOrdiniPickingListModel> list = new ArrayList<>();
|
||||
|
||||
Stream.of(dataList)
|
||||
.filter(x -> !UtilityString.isNullOrEmpty(x.getSitArtOrdDTO().getDescrizioneCommessa()) && !x.getSitArtOrdDTO().getCodJcom().equalsIgnoreCase(CommonConst.Config.COMMESSA_MAG))
|
||||
.sortBy(x -> x.getSitArtOrdDTO().getDescrizioneCommessa())
|
||||
.forEach(x -> {
|
||||
AccettazioneOrdiniPickingListModel accettazioneOrdiniPickingListModel = new AccettazioneOrdiniPickingListModel();
|
||||
accettazioneOrdiniPickingListModel.setActive(true);
|
||||
Stream.of(dataList).filter(x -> !UtilityString.isNullOrEmpty(x.getSitArtOrdDTO().getDescrizioneCommessa()) && !x.getSitArtOrdDTO().getCodJcom().equalsIgnoreCase(CommonConst.Config.COMMESSA_MAG)).sortBy(x -> x.getSitArtOrdDTO().getDescrizioneCommessa()).forEach(x -> {
|
||||
AccettazioneOrdiniPickingListModel accettazioneOrdiniPickingListModel = new AccettazioneOrdiniPickingListModel();
|
||||
accettazioneOrdiniPickingListModel.setActive(true);
|
||||
|
||||
accettazioneOrdiniPickingListModel.setGroupTitle(x.getSitArtOrdDTO().getCodJcom() + (!UtilityString.isNullOrEmpty(x.getSitArtOrdDTO().getDescrizioneCommessa()) ? " - " + x.getSitArtOrdDTO().getDescrizioneCommessa() : ""));
|
||||
accettazioneOrdiniPickingListModel.setGroupTitle(x.getSitArtOrdDTO().getCodJcom() + (!UtilityString.isNullOrEmpty(x.getSitArtOrdDTO().getDescrizioneCommessa()) ? " - " + x.getSitArtOrdDTO().getDescrizioneCommessa() : ""));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()));
|
||||
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()));
|
||||
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||
|
||||
//Calc Num CNF
|
||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||
//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);
|
||||
}
|
||||
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;
|
||||
//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 (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())) {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||
} else {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||
} else {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
|
||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneEstesaOrd());
|
||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneEstesaOrd());
|
||||
|
||||
if (x.getMtbAart() != null) {
|
||||
accettazioneOrdiniPickingListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||
}
|
||||
if (x.getMtbAart() != null) {
|
||||
accettazioneOrdiniPickingListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||
}
|
||||
|
||||
accettazioneOrdiniPickingListModel.setOriginalModel(x);
|
||||
accettazioneOrdiniPickingListModel.setOriginalModel(x);
|
||||
|
||||
list.add(accettazioneOrdiniPickingListModel);
|
||||
});
|
||||
list.add(accettazioneOrdiniPickingListModel);
|
||||
});
|
||||
|
||||
Stream.of(dataList)
|
||||
.filter(x -> UtilityString.isNullOrEmpty(x.getSitArtOrdDTO().getDescrizioneCommessa()) || x.getSitArtOrdDTO().getCodJcom().equalsIgnoreCase(CommonConst.Config.COMMESSA_MAG))
|
||||
.forEach(x -> {
|
||||
AccettazioneOrdiniPickingListModel accettazioneOrdiniPickingListModel = new AccettazioneOrdiniPickingListModel();
|
||||
accettazioneOrdiniPickingListModel.setActive(true);
|
||||
Stream.of(dataList).filter(x -> UtilityString.isNullOrEmpty(x.getSitArtOrdDTO().getDescrizioneCommessa()) || x.getSitArtOrdDTO().getCodJcom().equalsIgnoreCase(CommonConst.Config.COMMESSA_MAG)).forEach(x -> {
|
||||
AccettazioneOrdiniPickingListModel accettazioneOrdiniPickingListModel = new AccettazioneOrdiniPickingListModel();
|
||||
accettazioneOrdiniPickingListModel.setActive(true);
|
||||
|
||||
accettazioneOrdiniPickingListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||
accettazioneOrdiniPickingListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()));
|
||||
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()));
|
||||
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||
|
||||
|
||||
//Calc Num CNF
|
||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||
//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);
|
||||
}
|
||||
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;
|
||||
//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 (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())) {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||
} else {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||
} else {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
|
||||
|
||||
if (x.getMtbAart() != null) {
|
||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getMtbAart().getDescrizioneEstesa());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
}
|
||||
if (x.getMtbAart() != null) {
|
||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getMtbAart().getDescrizioneEstesa());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
}
|
||||
|
||||
accettazioneOrdiniPickingListModel.setOriginalModel(x);
|
||||
accettazioneOrdiniPickingListModel.setOriginalModel(x);
|
||||
|
||||
list.add(accettazioneOrdiniPickingListModel);
|
||||
});
|
||||
list.add(accettazioneOrdiniPickingListModel);
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private boolean isThereAnyItemToPick(List<PickingObjectDTO> dataList) {
|
||||
return Stream.of(dataList)
|
||||
.anyMatch(x -> !x.isHidden());
|
||||
return Stream.of(dataList).anyMatch(x -> !x.isHidden());
|
||||
}
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
@@ -718,20 +651,26 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
});
|
||||
}
|
||||
|
||||
public void trackPackaging() {
|
||||
this.fabPopupMenu.dismiss();
|
||||
|
||||
DialogTracciamentoImballiView.newInstance(data -> {
|
||||
if (data != null && !data.isEmpty())
|
||||
mViewModel.registraImballi(data);
|
||||
}).show(getSupportFragmentManager(), DialogTracciamentoImballiView.class.getName());
|
||||
}
|
||||
|
||||
|
||||
public void showCreatedUL() {
|
||||
this.fabPopupMenu.dismiss();
|
||||
this.mViewModel.retrieveExistentLU(this::startListaBancaliRegistratiActivity);
|
||||
}
|
||||
|
||||
private void showOrderByDialog() {
|
||||
AlertDialog dialog = new AlertDialog.Builder(this)
|
||||
.setTitle(this.getText(R.string.action_orderBy))
|
||||
.setSingleChoiceItems(AccettazioneOrdineInevasoOrderBy.descriptions, mCurrentOrderBy.getVal(), (dialog12, which) -> {
|
||||
mCurrentOrderBy = AccettazioneOrdineInevasoOrderBy.Enum.fromInt(which);
|
||||
SettingsManager.i().getUserSession().setDefaultOrdinamentoPickingAccettazione(which);
|
||||
})
|
||||
.setPositiveButton(getText(R.string.ok), (dialog1, which) -> this.refreshList())
|
||||
.create();
|
||||
AlertDialog dialog = new AlertDialog.Builder(this).setTitle(this.getText(R.string.action_orderBy)).setSingleChoiceItems(AccettazioneOrdineInevasoOrderBy.descriptions, mCurrentOrderBy.getVal(), (dialog12, which) -> {
|
||||
mCurrentOrderBy = AccettazioneOrdineInevasoOrderBy.Enum.fromInt(which);
|
||||
SettingsManager.i().getUserSession().setDefaultOrdinamentoPickingAccettazione(which);
|
||||
}).setPositiveButton(getText(R.string.ok), (dialog1, which) -> this.refreshList()).create();
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
@@ -739,14 +678,9 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
|
||||
Intent myIntent = ListaBancaliActivity.createIntent(this,
|
||||
|
||||
Stream.of(mtbColts)
|
||||
.map(AlreadyRegisteredUDCDTO::getMtbColt)
|
||||
.toList(),
|
||||
Stream.of(mtbColts).map(AlreadyRegisteredUDCDTO::getMtbColt).toList(),
|
||||
|
||||
input -> Stream.of(mtbColts)
|
||||
.filter(x -> x.getMtbColt() == input)
|
||||
.findFirstOrElse(null)
|
||||
.isCanBeRecovered(),
|
||||
input -> Stream.of(mtbColts).filter(x -> x.getMtbColt() == input).findFirstOrElse(null).isCanBeRecovered(),
|
||||
|
||||
ReportManager.getReportNameLUFromGestione(GestioneEnum.ACQUISTO));
|
||||
|
||||
@@ -757,9 +691,7 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
public void onLUSuccessullyPrinted() {
|
||||
Resources res = getResources();
|
||||
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
||||
DialogSimpleMessageView
|
||||
.makeSuccessDialog(res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
DialogSimpleMessageView.makeSuccessDialog(res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null).show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -769,13 +701,7 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
@Override
|
||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||
this.onLoadingEnded();
|
||||
DialogSimpleMessageView.makeErrorDialog(
|
||||
new SpannableString(ex.getMessage()),
|
||||
null,
|
||||
null,
|
||||
R.string.button_ignore_print,
|
||||
onComplete)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
DialogSimpleMessageView.makeErrorDialog(new SpannableString(ex.getMessage()), null, null, R.string.button_ignore_print, onComplete).show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -795,20 +721,12 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
|
||||
@Override
|
||||
public void onVersamentoAutomaticoULRequest(RunnableArgs<Boolean> onComplete) {
|
||||
runOnUiThread(() -> {
|
||||
DialogAskShouldVersamentoAutomaticoULView.newInstance(onComplete)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
DialogAskShouldVersamentoAutomaticoULView.newInstance(onComplete).show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInfoAggiuntiveRequest(RunnableArgss<String, MtbTCol> onComplete) {
|
||||
// runOnUiThread(() -> {
|
||||
// DialogInfoAggiuntiveLU.newInstance(onComplete).show(getSupportFragmentManager(), "InfoAggiuntiveLUDialog");
|
||||
// });
|
||||
|
||||
DialogInfoAggiuntiveLUView.newInstance(onComplete, this::onLoadingEnded)
|
||||
.show(getSupportFragmentManager(), DialogInfoAggiuntiveLUView.class.getName());
|
||||
DialogInfoAggiuntiveLUView.newInstance(onComplete, this::onLoadingEnded).show(getSupportFragmentManager(), DialogInfoAggiuntiveLUView.class.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -824,43 +742,25 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWarning(String warningText, Runnable action) {
|
||||
this.runOnUiThread(() -> {
|
||||
this.onLoadingEnded();
|
||||
DialogSimpleMessageView
|
||||
.makeWarningDialog(new SpannableString(Html.fromHtml(warningText)), null, action)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
|
||||
@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, LocalDate dataScad, boolean canPartitaMagBeChanged, boolean canOverflowQuantity, String customArtDescription, RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
|
||||
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
||||
.setMtbAart(mtbAart)
|
||||
.setInitialNumCnf(initialNumCnf)
|
||||
.setInitialQtaCnf(initialQtaCnf)
|
||||
.setInitialQtaTot(initialQtaTot)
|
||||
.setTotalQtaOrd(totalQtaOrd)
|
||||
.setTotalNumCnfOrd(totalNumCnfOrd)
|
||||
.setQtaCnfOrd(qtaCnfOrd)
|
||||
.setTotalQtaToBeTaken(totalQtaToBeTaken)
|
||||
.setTotalNumCnfToBeTaken(totalNumCnfToBeTaken)
|
||||
.setQtaCnfToBeTaken(qtaCnfToBeTaken)
|
||||
.setTotalQtaAvailable(totalQtaAvailable)
|
||||
.setTotalNumCnfAvailable(totalNumCnfAvailable)
|
||||
.setQtaCnfAvailable(qtaCnfAvailable)
|
||||
.setPartitaMag(partitaMag)
|
||||
.setDataScad(dataScad)
|
||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||
.setCanLUBeClosed(true)
|
||||
.setCanOverflowOrderQuantity(canOverflowQuantity)
|
||||
.setCustomArtDescription(customArtDescription);
|
||||
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO().setMtbAart(mtbAart).setInitialNumCnf(initialNumCnf).setInitialQtaCnf(initialQtaCnf).setInitialQtaTot(initialQtaTot).setTotalQtaOrd(totalQtaOrd).setTotalNumCnfOrd(totalNumCnfOrd).setQtaCnfOrd(qtaCnfOrd).setTotalQtaToBeTaken(totalQtaToBeTaken).setTotalNumCnfToBeTaken(totalNumCnfToBeTaken).setQtaCnfToBeTaken(qtaCnfToBeTaken).setTotalQtaAvailable(totalQtaAvailable).setTotalNumCnfAvailable(totalNumCnfAvailable).setQtaCnfAvailable(qtaCnfAvailable).setPartitaMag(partitaMag).setDataScad(dataScad).setCanPartitaMagBeChanged(canPartitaMagBeChanged).setCanLUBeClosed(true).setCanOverflowOrderQuantity(canOverflowQuantity).setCustomArtDescription(customArtDescription);
|
||||
|
||||
if (!mDialogInputQuantityV2View.isVisible())
|
||||
mDialogInputQuantityV2View
|
||||
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||
.setNumCnf(resultDTO.getNumCnf())
|
||||
.setQtaCnf(resultDTO.getQtaCnf())
|
||||
.setQtaTot(resultDTO.getQtaTot())
|
||||
.setPartitaMag(resultDTO.getPartitaMag())
|
||||
.setDataScad(resultDTO.getDataScad());
|
||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||
})
|
||||
.setOnAbort(() -> this.mViewModel.resetMatchedRows())
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
mDialogInputQuantityV2View.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO).setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO().setNumCnf(resultDTO.getNumCnf()).setQtaCnf(resultDTO.getQtaCnf()).setQtaTot(resultDTO.getQtaTot()).setPartitaMag(resultDTO.getPartitaMag()).setDataScad(resultDTO.getDataScad());
|
||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||
}).setOnAbort(() -> this.mViewModel.resetMatchedRows()).show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -894,9 +794,7 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
public void onULVersata(VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, Runnable onComplete) {
|
||||
|
||||
runOnUiThread(() -> {
|
||||
DialogVersamentoAutomaticoULDoneView
|
||||
.newInstance(versamentoAutomaticoULResponseDTO, onComplete)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
DialogVersamentoAutomaticoULDoneView.newInstance(versamentoAutomaticoULResponseDTO, onComplete).show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
|
||||
}
|
||||
@@ -905,11 +803,7 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
public void onMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete) {
|
||||
runOnUiThread(() -> {
|
||||
String text = getResources().getString(R.string.alert_delete_mtb_colr);
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text),
|
||||
null,
|
||||
() -> onComplete.run(true),
|
||||
() -> onComplete.run(false)
|
||||
).show(getSupportFragmentManager(), "tag");
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text), null, () -> onComplete.run(true), () -> onComplete.run(false)).show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -925,15 +819,11 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
|
||||
@Override
|
||||
public void onLUClosed() {
|
||||
runOnUiThread(() -> {
|
||||
noLUPresent.set(true);
|
||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
|
||||
noLUPresent.set(true);
|
||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
|
||||
this.refreshList();
|
||||
|
||||
|
||||
this.refreshList();
|
||||
|
||||
if (this.mShouldCloseActivity) super.onBackPressed();
|
||||
});
|
||||
if (this.mShouldCloseActivity) super.onBackPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,7 +8,7 @@ import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliAccettazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ImballiRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.rest.AccettazioneOrdiniPickingRESTConsumer;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
||||
@@ -31,18 +31,19 @@ public class AccettazioneOrdiniPickingModule {
|
||||
ArticoloRESTConsumer articoloRESTConsumer,
|
||||
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||
PrinterRESTConsumer printerRESTConsumer,
|
||||
AccettazioneOrdiniPickingRESTConsumer accettazioneOrdiniPickingRESTConsumer,
|
||||
ColliAccettazioneRESTConsumer colliAccettazioneRESTConsumer,
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
|
||||
Ean128Service ean128Service) {
|
||||
Ean128Service ean128Service,
|
||||
ImballiRESTConsumer imballiRESTConsumer) {
|
||||
return new AccettazioneOrdiniPickingViewModel(articoloRESTConsumer,
|
||||
barcodeRESTConsumer,
|
||||
colliMagazzinoRESTConsumer,
|
||||
printerRESTConsumer,
|
||||
accettazioneOrdiniPickingRESTConsumer,
|
||||
colliAccettazioneRESTConsumer,
|
||||
colliLavorazioneRESTConsumer, ean128Service);
|
||||
colliLavorazioneRESTConsumer,
|
||||
ean128Service,
|
||||
imballiRESTConsumer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -40,11 +41,12 @@ import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliAccettazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ImballiRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliCaricoRESTConsumerInterface;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
||||
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.imballi.ImballoQuantityDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CreateUDCRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CreateUDCRequestOrderDTO;
|
||||
@@ -66,17 +68,18 @@ import it.integry.integrywmsnative.gest.accettazione_ordini_picking.rest.Accetta
|
||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.NotCurrentYearLUException;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.tracciamento_imballi.TracciamentoImballoDTO;
|
||||
|
||||
public class AccettazioneOrdiniPickingViewModel {
|
||||
|
||||
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||
private final BarcodeRESTConsumer mBarcodeRESTConsumer;
|
||||
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||
private final PrinterRESTConsumer mPrinterRESTConsumer;
|
||||
private final AccettazioneOrdiniPickingRESTConsumer mAccettazioneOrdiniPickingRESTConsumer;
|
||||
private final ColliAccettazioneRESTConsumer mColliAccettazioneRESTConsumer;
|
||||
private final ColliLavorazioneRESTConsumer mColliLavorazioneRESTConsumer;
|
||||
private final Ean128Service mEan128Service;
|
||||
private final ImballiRESTConsumer mImballiRESTConsumer;
|
||||
|
||||
private ColliCaricoRESTConsumerInterface mColliCaricoRESTConsumer;
|
||||
|
||||
@@ -88,6 +91,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
|
||||
private MtbColt mCurrentMtbColt = null;
|
||||
private GestioneEnum defaultGestioneOfUL = null;
|
||||
private String foundCodAnag = null;
|
||||
|
||||
private final List<HistoryMtbAartDTO> mHistoryUsedAarts = new ArrayList<>();
|
||||
|
||||
@@ -95,19 +99,19 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
public AccettazioneOrdiniPickingViewModel(ArticoloRESTConsumer articoloRESTConsumer,
|
||||
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||
PrinterRESTConsumer printerRESTConsumer,
|
||||
AccettazioneOrdiniPickingRESTConsumer accettazioneOrdiniPickingRESTConsumer,
|
||||
ColliAccettazioneRESTConsumer colliAccettazioneRESTConsumer,
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
|
||||
Ean128Service ean128Service) {
|
||||
Ean128Service ean128Service,
|
||||
ImballiRESTConsumer imballiRESTConsumer) {
|
||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||
this.mPrinterRESTConsumer = printerRESTConsumer;
|
||||
this.mAccettazioneOrdiniPickingRESTConsumer = accettazioneOrdiniPickingRESTConsumer;
|
||||
this.mColliAccettazioneRESTConsumer = colliAccettazioneRESTConsumer;
|
||||
this.mColliLavorazioneRESTConsumer = colliLavorazioneRESTConsumer;
|
||||
this.mEan128Service = ean128Service;
|
||||
this.mImballiRESTConsumer = imballiRESTConsumer;
|
||||
}
|
||||
|
||||
|
||||
@@ -131,6 +135,15 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
.findFirst()
|
||||
.get();
|
||||
|
||||
//Definizione codAnag
|
||||
var codAnagsOrd = mOrders.stream()
|
||||
.map(OrdineAccettazioneInevasoDTO::getCodAnagOrd)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if(codAnagsOrd.size() == 1) foundCodAnag = codAnagsOrd.get(0);
|
||||
|
||||
|
||||
//Definizione della gestione collo di default
|
||||
List<GestioneEnum> foundGestioni = Stream.of(mOrders)
|
||||
.map(OrdineAccettazioneInevasoDTO::getGestioneEnum)
|
||||
@@ -214,7 +227,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
//dell'etichetta anonima
|
||||
this.executeEtichettaAnonimaNotOpenedLU(barcodeScanDTO, onComplete);
|
||||
} else {
|
||||
if (SettingsManager.iDB().isFlagAllowBarcodeFornitore() && UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||
if (SettingsManager.iDB().isFlagAccettazioneAllowBarcodeFornitore() && UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||
this.executeSSCCFornitore(barcodeScanDTO, onComplete);
|
||||
} else {
|
||||
this.processBarcodeNotOpenedLU(barcodeScanDTO, null, onComplete);
|
||||
@@ -234,8 +247,14 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
try {
|
||||
Ean128Model ean128Model = mEan128Service.decode(barcodeScanDTO);
|
||||
|
||||
//Nel caso trovo un SSCC lo aggiungo
|
||||
this.processBarcodeNotOpenedLU(barcodeScanDTO, ean128Model.Sscc, onComplete);
|
||||
mColliAccettazioneRESTConsumer.checkBarcodeUl(ean128Model.Sscc, result -> {
|
||||
if (result){
|
||||
this.sendWarning("Barcode ul già registrato!", onComplete);
|
||||
} else {
|
||||
//Nel caso trovo un SSCC lo aggiungo
|
||||
this.processBarcodeNotOpenedLU(barcodeScanDTO, ean128Model.Sscc, onComplete);
|
||||
}
|
||||
}, this::sendError);
|
||||
|
||||
} catch (Exception e) {
|
||||
this.sendError(e);
|
||||
@@ -275,7 +294,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
null,
|
||||
false,
|
||||
() -> {
|
||||
if(UtilityString.isNullOrEmpty(customSSCC))
|
||||
if (UtilityString.isNullOrEmpty(customSSCC))
|
||||
processBarcodeAlreadyOpenedLU(barcodeScanDTO, onComplete);
|
||||
else onComplete.run();
|
||||
});
|
||||
@@ -537,7 +556,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
|
||||
if (dataScad == null && pickingObjectDTO.getMtbAart().getGgScadPartita() != null && pickingObjectDTO.getMtbAart().getGgScadPartita() > 0) {
|
||||
dataScad = UtilityDate.getNow();
|
||||
dataScad.plusDays(pickingObjectDTO.getMtbAart().getGgScadPartita());
|
||||
dataScad = dataScad.plusDays(pickingObjectDTO.getMtbAart().getGgScadPartita());
|
||||
}
|
||||
|
||||
if (partitaMag == null && dataScad == null) {
|
||||
@@ -767,9 +786,6 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
} else {
|
||||
postCloseOperations();
|
||||
}
|
||||
|
||||
this.sendLUClosed();
|
||||
this.sendOnLoadingEnded();
|
||||
};
|
||||
|
||||
sendVersamentoAutomaticoULRequest(response -> {
|
||||
@@ -815,13 +831,13 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
}
|
||||
|
||||
private void calculateQtaDaEvadere() {
|
||||
if (SettingsManager.iDB().isFlagDeleteRowOnClose()) {
|
||||
if (SettingsManager.iDB().isFlagAccettazioneDeleteRowOnClose()) {
|
||||
for (PickingObjectDTO pickingObjectDTO : this.mPickingList.getValue()) {
|
||||
List<MtbColr> withdrawMtbColrs = pickingObjectDTO.getWithdrawMtbColrs();
|
||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||
BigDecimal numCnf = BigDecimal.ZERO;
|
||||
|
||||
if (withdrawMtbColrs.size() > 0) {
|
||||
if (!withdrawMtbColrs.isEmpty()) {
|
||||
qtaEvasa = Stream.of(withdrawMtbColrs)
|
||||
.map(MtbColr::getQtaCol)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
@@ -887,6 +903,22 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
return optional.isPresent() ? optional.get() : null;
|
||||
}
|
||||
|
||||
public void registraImballi(List<TracciamentoImballoDTO> data) {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
|
||||
var inputData = data.stream()
|
||||
.map(x -> new ImballoQuantityDTO()
|
||||
.setQta(x.getQta().get())
|
||||
.setCodMart(x.getCodMart().get()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
mImballiRESTConsumer.registraCarico(foundCodAnag, inputData, () -> {
|
||||
this.sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
|
||||
private void sendOnLoadingStarted() {
|
||||
if (this.mListener != null) mListener.onLoadingStarted();
|
||||
}
|
||||
@@ -907,6 +939,10 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
if (this.mListener != null) mListener.onError(ex);
|
||||
}
|
||||
|
||||
private void sendWarning(String warningText, Runnable action) {
|
||||
if (this.mListener != null) mListener.onWarning(warningText, action);
|
||||
}
|
||||
|
||||
private void sendLUOpened(MtbColt mtbColt) {
|
||||
if (this.mListener != null) mListener.onLUOpened(mtbColt);
|
||||
}
|
||||
@@ -1024,6 +1060,8 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
|
||||
void onFilterPosizioneApplied(String posizioneToFilter);
|
||||
|
||||
void onWarning(String warningText, Runnable action);
|
||||
|
||||
void onULVersata(VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, Runnable onComplete);
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingL
|
||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
||||
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto.ArtsInGiacenzaDTO;
|
||||
|
||||
public class ArticoliInGiacenzaViewModel {
|
||||
private final InventarioService mInventarioService;
|
||||
|
||||
@@ -3,6 +3,8 @@ package it.integry.integrywmsnative.gest.contab_doc_interni;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -37,6 +39,7 @@ import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniE
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.ui.DocInterniListAdapter;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.ui.DocInterniListModel;
|
||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
|
||||
public class DocInterniFragment extends BaseFragment implements ITitledFragment, IScrollableFragment, DocInterniViewModel.Listener {
|
||||
|
||||
@@ -120,10 +123,21 @@ public class DocInterniFragment extends BaseFragment implements ITitledFragment,
|
||||
this.openDocumentSelectionDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWarning(String warningText, Runnable action) {
|
||||
this.requireActivity().runOnUiThread(() -> {
|
||||
this.onLoadingEnded();
|
||||
DialogSimpleMessageView
|
||||
.makeWarningDialog(new SpannableString(Html.fromHtml(warningText)), null, action)
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDocDetailsChanged(DialogSelectDocInfoResponseDTO selection) {
|
||||
mViewModel.setSelectedDocDetails(selection);
|
||||
mBinding.invalidateAll();
|
||||
mViewModel.setSelectedDocDetails(selection, () -> {
|
||||
mBinding.invalidateAll();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColtRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
|
||||
@@ -17,6 +18,8 @@ import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingL
|
||||
import it.integry.integrywmsnative.core.rest.consumers.DocumentRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.documento.DocumentoArtDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoResponseDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.FornitoreDTO;
|
||||
@@ -76,6 +79,14 @@ public class DocInterniViewModel {
|
||||
if (this.mListener != null) mListener.onError(ex);
|
||||
}
|
||||
|
||||
private void sendWarning(String warningText, Runnable action) {
|
||||
if (this.mListener != null) mListener.onWarning(warningText, action);
|
||||
}
|
||||
|
||||
private void sendDocDetailsChanged(DialogSelectDocInfoResponseDTO selection){
|
||||
if (this.mListener != null) mListener.onDocDetailsChanged(selection);
|
||||
}
|
||||
|
||||
public DocInterniViewModel setListeners(Listener listener) {
|
||||
this.mListener = listener;
|
||||
return this;
|
||||
@@ -85,7 +96,7 @@ public class DocInterniViewModel {
|
||||
return mDocsList;
|
||||
}
|
||||
|
||||
public void setSelectedDocDetails(DialogSelectDocInfoResponseDTO selection) {
|
||||
public void setSelectedDocDetails(DialogSelectDocInfoResponseDTO selection, Runnable action) {
|
||||
this.fornitore = selection.getFornitore();
|
||||
this.dtbTipi = selection.getTipoDoc();
|
||||
|
||||
@@ -94,10 +105,34 @@ public class DocInterniViewModel {
|
||||
this.numDoc = selection.getNumDoc() != null ? selection.getNumDoc().toString() : null;
|
||||
this.note = selection.getNote();
|
||||
|
||||
this.sendOnLoadingStarted();
|
||||
fetchProducts(() -> {
|
||||
fetchDocuments(this::sendOnLoadingEnded);
|
||||
});
|
||||
String codAnag = null;
|
||||
if (fornitore != null){
|
||||
codAnag = fornitore.getCodAnag();
|
||||
}
|
||||
|
||||
String codDtip = null;
|
||||
if (dtbTipi != null){
|
||||
codDtip = dtbTipi.getCodDtip();
|
||||
}
|
||||
|
||||
documentRESTConsumer.checkDocument(
|
||||
codAnag,
|
||||
numDoc,
|
||||
UtilityDate.formatDate(dataDoc, "yyyy/MM/dd"),
|
||||
codDtip,
|
||||
data -> {
|
||||
if (!data) {
|
||||
this.sendWarning("Documento di riferimento non trovato!", this::init);
|
||||
} else {
|
||||
action.run();
|
||||
this.sendOnLoadingStarted();
|
||||
fetchProducts(() -> {
|
||||
fetchDocuments(this::sendOnLoadingEnded);
|
||||
});
|
||||
}
|
||||
},
|
||||
this::sendError
|
||||
);
|
||||
}
|
||||
|
||||
public void fetchProducts(Runnable onComplete) {
|
||||
@@ -210,6 +245,8 @@ public class DocInterniViewModel {
|
||||
|
||||
void onError(Exception ex);
|
||||
|
||||
void onWarning(String warningText, Runnable action);
|
||||
|
||||
void onDocInterniSetupFetched(DocInterniSetupDTO docInterniSetupDTO);
|
||||
|
||||
void onDocDetailsChanged(DialogSelectDocInfoResponseDTO selection);
|
||||
|
||||
@@ -3,10 +3,14 @@ package it.integry.integrywmsnative.gest.contab_doc_interni.dialog;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.exception.DocumentRequiredException;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.exception.FornitoreRequiredException;
|
||||
@@ -33,9 +37,12 @@ public class DialogSelectDocInfoViewModel extends ViewModel {
|
||||
private final MutableLiveData<Boolean> noteRequired = new MutableLiveData<>(false);
|
||||
|
||||
public DialogSelectDocInfoViewModel() {
|
||||
String docInterniRequestNumDoc = SettingsManager.iDB().getDocInterniRequestNumDoc();
|
||||
List<String> requestNumDocList = docInterniRequestNumDoc != null ? Arrays.asList(docInterniRequestNumDoc.split("\\|")) : new ArrayList<>();
|
||||
|
||||
tipoDoc.observeForever(val -> fornitoreRequired.postValue(val != null && (val.getGestioneDoc().equals("T") || val.getGestioneDoc().equals("A") || (val.getGestioneDoc().equals("P") && !val.getGestione().equals("L")))));
|
||||
|
||||
tipoDoc.observeForever(val -> documentRequired.postValue(val != null && val.getGestioneDoc().equalsIgnoreCase("P") && !val.getGestione().equalsIgnoreCase("L")));
|
||||
tipoDoc.observeForever(val -> documentRequired.postValue(val != null && (val.getGestioneDoc().equalsIgnoreCase("P") && !val.getGestione().equalsIgnoreCase("L")) || requestNumDocList.contains(Objects.requireNonNull(val).getCodDtip())));
|
||||
|
||||
tipoDoc.observeForever(val -> noteRequired.postValue(val != null && val.getGestioneDoc().equals("P") && val.getGestione().equals("L")));
|
||||
}
|
||||
|
||||
@@ -29,8 +29,11 @@ public class ArtDTO {
|
||||
private LocalDate dataScad;
|
||||
|
||||
private String systemNote;
|
||||
|
||||
private String codAlis;
|
||||
|
||||
private Date datetimeRow;
|
||||
|
||||
public Integer getRigaOrd() {
|
||||
return rigaOrd;
|
||||
}
|
||||
@@ -135,4 +138,13 @@ public class ArtDTO {
|
||||
this.codAlis = codAlis;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDatetimeRow() {
|
||||
return datetimeRow;
|
||||
}
|
||||
|
||||
public ArtDTO setDatetimeRow(Date datetimeRow) {
|
||||
this.datetimeRow = datetimeRow;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class RetrieveLottiDTO {
|
||||
|
||||
private String codProd;
|
||||
private String partitaMag;
|
||||
private Date dataScad;
|
||||
|
||||
public String getCodProd() {
|
||||
return codProd;
|
||||
}
|
||||
|
||||
public RetrieveLottiDTO setCodProd(String codProd) {
|
||||
this.codProd = codProd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public RetrieveLottiDTO setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataScad() {
|
||||
return dataScad;
|
||||
}
|
||||
|
||||
public RetrieveLottiDTO setDataScad(Date dataScad) {
|
||||
this.dataScad = dataScad;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ public class TipoDocDTO {
|
||||
private String gestioneDoc;
|
||||
private boolean flagChkTracciabilita;
|
||||
private boolean requireNote = false;
|
||||
private boolean suggestLotti;
|
||||
|
||||
public String getCodDtip() {
|
||||
return codDtip;
|
||||
@@ -62,4 +63,13 @@ public class TipoDocDTO {
|
||||
this.flagChkTracciabilita = flagChkTracciabilita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isSuggestLotti() {
|
||||
return suggestLotti;
|
||||
}
|
||||
|
||||
public TipoDocDTO setSuggestLotti(boolean suggestLotti) {
|
||||
this.suggestLotti = suggestLotti;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,8 @@ import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDT
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipoDocDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsItemListModel;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsView;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectLotti.DialogSelectLottiItemListModel;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectLotti.DialogSelectLottiView;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.ui.DocumentRowsListAdapter;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalView;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||
@@ -302,6 +304,30 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
.setFlagDig(isUntMisDig ? "S" : "N");
|
||||
mtbAart.setMtbUntMis(Collections.singletonList(mtbUntMis));
|
||||
|
||||
if (this.viewModel.getTipoDoc().isSuggestLotti()) {
|
||||
this.viewModel.retrieveLotti(row.getCodMart(), lotti -> {
|
||||
var dataSet =
|
||||
Stream.of(lotti)
|
||||
.map(x -> new DialogSelectLottiItemListModel<>()
|
||||
.setPartitaMag(x.getPartitaMag())
|
||||
.setDataScad(UtilityDate.toLocalDate(x.getDataScad()))
|
||||
.setOriginalModel(x)
|
||||
)
|
||||
.toList();
|
||||
|
||||
DialogSelectLottiView.newInstance(dataSet, data -> {
|
||||
row.setPartitaMag(data.getPartitaMag());
|
||||
row.setDataScad(data.getDataScad());
|
||||
|
||||
openInputQuantity(mtbAart, row, flagTracciabilita);
|
||||
}, () -> {}).show(this.getSupportFragmentManager(), "dialogSelectLotti");;
|
||||
});
|
||||
} else {
|
||||
openInputQuantity(mtbAart, row, flagTracciabilita);
|
||||
}
|
||||
}
|
||||
|
||||
private void openInputQuantity(MtbAart mtbAart, SqlMtbColr row, boolean flagTracciabilita) {
|
||||
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
||||
.setMtbAart(mtbAart)
|
||||
.setInitialNumCnf(BigDecimal.valueOf(row.getNumCnf()))
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.annimon.stream.Stream;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -18,6 +19,7 @@ import it.integry.integrywmsnative.core.data_store.db.repository.MtbColrDataSour
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColtRepository;
|
||||
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||
import it.integry.integrywmsnative.core.exception.NoResultFromCodMartException;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
||||
@@ -31,6 +33,7 @@ import it.integry.integrywmsnative.gest.contab_doc_interni.dto.CheckFornitoreDTO
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.ColloDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.FornitoreDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.RetrieveLottiDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipoDocDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||
@@ -125,7 +128,12 @@ public class DocInterniEditFormViewModel {
|
||||
}
|
||||
|
||||
public void loadArticoloByCodMartOrBarcode(String codMart) {
|
||||
var matchedArt = Stream.of(productsList)
|
||||
if (productsList == null) {
|
||||
this.sendError(new NoResultFromCodMartException(codMart));
|
||||
return;
|
||||
}
|
||||
|
||||
var matchedArt = productsList.stream()
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(codMart) ||
|
||||
x.getBarcode().contains(codMart))
|
||||
.findFirst()
|
||||
@@ -234,6 +242,7 @@ public class DocInterniEditFormViewModel {
|
||||
artDto.setBarcode(row.getCodBarre());
|
||||
artDto.setQta(BigDecimal.valueOf(row.getQtaCol()));
|
||||
artDto.setDataIns(row.getDataCollo());
|
||||
artDto.setDatetimeRow(row.getDatetimeRow());
|
||||
artDto.setColli(BigDecimal.valueOf(row.getNumCnf()));
|
||||
artDto.setUntMis(row.getUntMis());
|
||||
artDto.setCodMart(row.getCodMart());
|
||||
@@ -350,6 +359,7 @@ public class DocInterniEditFormViewModel {
|
||||
row.setQtaCnf(resultDTO.getQtaCnf().floatValue());
|
||||
row.setNumCnf(resultDTO.getNumCnf().floatValue());
|
||||
row.setQtaCol(resultDTO.getQtaTot().floatValue());
|
||||
row.setDatetimeRow(new Date());
|
||||
row.setNote(resultDTO.getNote());
|
||||
row.setDataScad(resultDTO.getDataScad());
|
||||
row.setPartitaMag(resultDTO.getPartitaMag());
|
||||
@@ -364,6 +374,10 @@ public class DocInterniEditFormViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
public void retrieveLotti(String codProd, RunnableArgs<List<RetrieveLottiDTO>> onComplete) {
|
||||
docInterniRESTConsumer.retrieveLotti(codProd, onComplete, this::sendError);
|
||||
}
|
||||
|
||||
public void deleteRow(SqlMtbColr sqlMtbColr) {
|
||||
mtbColrRepository.delete(sqlMtbColr, this::fetchDocumentRows, this::sendError);
|
||||
}
|
||||
@@ -389,6 +403,10 @@ public class DocInterniEditFormViewModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public TipoDocDTO getTipoDoc() {
|
||||
return tipoDoc;
|
||||
}
|
||||
|
||||
public boolean isNotesMandatory() {
|
||||
return this.tipoDoc != null && this.tipoDoc.isRequireNote();
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user