Compare commits
182 Commits
v1.18.4(23
...
v1.24.0
| Author | SHA1 | Date | |
|---|---|---|---|
| a74d865c57 | |||
| 0a37323cef | |||
| b36b80eae0 | |||
| acb7727f3c | |||
| c16f5d2ddd | |||
| 4ca449d557 | |||
| da70d7c064 | |||
| 0be1eac5fe | |||
| e0eabbcbda | |||
| bd7b561b28 | |||
| 37c3a1ec76 | |||
| 62e69ad5bf | |||
| 3a6ba51a69 | |||
| 767088f1d0 | |||
| d0f6999dd8 | |||
| f88d7892bd | |||
| 3df5e406ef | |||
| 8e0728c2b4 | |||
| 0a2d47110d | |||
| 4ed8c825dd | |||
| 0a6d01628f | |||
| 453c8e0cad | |||
| ee43d1e985 | |||
| 86d472fb88 | |||
| 61c3458088 | |||
| 85c4768e51 | |||
| f1b4ce469e | |||
| 6071b3eb44 | |||
| 1d2bd20584 | |||
| 756389e6c6 | |||
| 4b19129a2f | |||
| f6aadf1115 | |||
| 3a5de50353 | |||
| cf3b8749dc | |||
| 34ff300515 | |||
| 0738993d4c | |||
| 9765fe1807 | |||
| 968e904715 | |||
| 90985b899b | |||
| d81e0dd72c | |||
| ee8751163c | |||
| 5476e9633e | |||
| 84d800a698 | |||
| eb39e1b7c5 | |||
| 57fa738c59 | |||
| bfc02a7d48 | |||
| e963e03c81 | |||
| f1c25a3673 | |||
| 90d5a8d43b | |||
| e1b4af2402 | |||
| 86c7be4e7d | |||
| 8686df3d8a | |||
| 6b04246f42 | |||
| 8e40092130 | |||
| b8dbde5ee1 | |||
| ae6d37e80d | |||
| 6dcc711006 | |||
| a616cb6022 | |||
| 837781389c | |||
| f23ff88878 | |||
| ddc038add4 | |||
| f037617dd9 | |||
| 84cff70567 | |||
| 8a1b3a1b00 | |||
| f11a81ef05 | |||
| eb8595e247 | |||
| 85520b937f | |||
| ec5bee558c | |||
| 857295d92b | |||
| 4da2c43251 | |||
| fc1681d111 | |||
| 692a350128 | |||
| 47f29899a2 | |||
| a0dfd20110 | |||
| 92aadad5cb | |||
| 52092e7e9c | |||
| ecfb8faf01 | |||
| e5dd4b15f4 | |||
| 6e070285e3 | |||
| d13cdf63c2 | |||
| c3884774e1 | |||
| 983b70821a | |||
| 8e60aa0249 | |||
| 69962781aa | |||
| a921b83c1f | |||
| ea8be0559a | |||
| 66f117186c | |||
| 4ff39009d2 | |||
| 981a42cd7e | |||
| 062938d0e4 | |||
| cc7044c7de | |||
| 7d771bf39b | |||
| 3261aa7c41 | |||
| d79c13b370 | |||
| 55c1cb40a2 | |||
| d570ab7e3d | |||
| e3ebfcb27d | |||
| 2230dade45 | |||
| 637e46b868 | |||
| 473d5d1a5a | |||
| c37f4d62a4 | |||
| b8ac75ed6d | |||
| df9d3a80ac | |||
| 6aacaef720 | |||
| 1fab62187f | |||
| 0c4d0f2b59 | |||
| dbf183c7c6 | |||
| 42649cd5bb | |||
| 1f1a8f75de | |||
| 5215d43bf4 | |||
| d2f262a9b8 | |||
| 1fc78d053b | |||
| 016be4799c | |||
| e837132996 | |||
| 925760720d | |||
| 2e872c23aa | |||
| 7a62c8855f | |||
| c1da07b23c | |||
| ba7e2a6d61 | |||
| e798db1427 | |||
| a79dee3574 | |||
| 4f753399bf | |||
| 80842e49e5 | |||
| 2eac741bbb | |||
| c3e2a2a8fd | |||
| 99f0691c55 | |||
| 37ebd96a0f | |||
| c012c54805 | |||
| 9de6dcce80 | |||
| fc403ec419 | |||
| 4968f2f4fa | |||
| a7ea9b9022 | |||
| 28a034f0d6 | |||
| ca3f1f5962 | |||
| 4117e69278 | |||
| 18ff1e2345 | |||
| 37e3024220 | |||
| ed35ea6894 | |||
| bd28db7422 | |||
| 9beea9f2e9 | |||
| 205af60edb | |||
| 21f9a9819a | |||
| 4059335e61 | |||
| 14252f0f4b | |||
| c13eee355e | |||
| 51528fda6f | |||
| 1486d39eb8 | |||
| 1951d8e2a4 | |||
| 420fdf6b4c | |||
| a14a593e4f | |||
| 5d7ffa02c4 | |||
| 4942807104 | |||
| 20dafb1250 | |||
| eb0746de0c | |||
| 2e255e0c47 | |||
| 6baebda5e1 | |||
| 8f943829ec | |||
| bd19d8c1a2 | |||
| 3e79d0a07a | |||
| d2111e36ee | |||
| 47a1ab8223 | |||
| 45df794280 | |||
| 7a9bd15cfa | |||
| f902439086 | |||
| e7334d358b | |||
| 262986f02c | |||
| 76188aa792 | |||
| eb67d2fc65 | |||
| 6e176c0b7f | |||
| 83b2327247 | |||
| 7605c4d70a | |||
| 5a8935675c | |||
| 1645fba77c | |||
| 6929a386db | |||
| 93c3350cb2 | |||
| 2b97faaa65 | |||
| 9260379c5f | |||
| 35e7fd60be | |||
| 1bbe5818f8 | |||
| 65d372c04c | |||
| be1c5ecd0b | |||
| 30e16fb765 |
1
.idea/.gitignore
generated
vendored
Normal file
1
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/saveactions_settings.xml
|
||||
558
.idea/dbnavigator.xml
generated
Normal file
558
.idea/dbnavigator.xml
generated
Normal file
File diff suppressed because one or more lines are too long
16
.idea/deploymentTargetDropDown.xml
generated
Normal file
16
.idea/deploymentTargetDropDown.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<runningDeviceTargetsSelectedWithDialog>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="SERIAL_NUMBER" />
|
||||
<value value="20119B1E55" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</runningDeviceTargetsSelectedWithDialog>
|
||||
</component>
|
||||
</project>
|
||||
7
.idea/runConfigurations/app_base.xml
generated
7
.idea/runConfigurations/app_base.xml
generated
@@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="app_base" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
||||
<module name="WMS_Native.app" />
|
||||
<module name="WMS.app" />
|
||||
<option name="DEPLOY" value="true" />
|
||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||
@@ -8,13 +8,14 @@
|
||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||
<option name="ALL_USERS" value="false" />
|
||||
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS_Native.dynamic_agricoper,WMS_Native.dynamic_frudis,WMS_Native.dynamic_gramm,WMS_Native.dynamic_ime,WMS_Native.dynamic_saporiveri,WMS_Native.dynamic_saporiveri_pv,WMS_Native.dynamic_vgalimenti,dynamic_frudis,dynamic_gramm,dynamic_ime,dynamic_saporiveri,dynamic_saporiveri_pv,dynamic_vgalimenti" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS.dynamic_vgalimenti" />
|
||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||
<option name="MODE" value="default_activity" />
|
||||
<option name="CLEAR_LOGCAT" value="true" />
|
||||
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
|
||||
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
|
||||
<option name="FORCE_STOP_RUNNING_APP" value="true" />
|
||||
<option name="INSPECTION_WITHOUT_ACTIVITY_RESTART" value="false" />
|
||||
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
|
||||
@@ -45,7 +46,7 @@
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Sample Java Methods" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Callstack Sample" />
|
||||
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
|
||||
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
|
||||
</Profilers>
|
||||
|
||||
7
.idea/runConfigurations/app_vglimenti.xml
generated
7
.idea/runConfigurations/app_vglimenti.xml
generated
@@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="app_vglimenti" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
||||
<module name="WMS_Native.app" />
|
||||
<module name="WMS.app" />
|
||||
<option name="DEPLOY" value="true" />
|
||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||
@@ -8,13 +8,14 @@
|
||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||
<option name="ALL_USERS" value="false" />
|
||||
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS_Native.dynamic__base,WMS_Native.dynamic_agricoper,WMS_Native.dynamic_frudis,WMS_Native.dynamic_gramm,WMS_Native.dynamic_ime,WMS_Native.dynamic_saporiveri,WMS_Native.dynamic_saporiveri_pv,dynamic__base,dynamic_frudis,dynamic_gramm,dynamic_ime,dynamic_saporiveri,dynamic_saporiveri_pv" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS.dynamic__base" />
|
||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||
<option name="MODE" value="default_activity" />
|
||||
<option name="CLEAR_LOGCAT" value="true" />
|
||||
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
|
||||
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
|
||||
<option name="FORCE_STOP_RUNNING_APP" value="true" />
|
||||
<option name="INSPECTION_WITHOUT_ACTIVITY_RESTART" value="false" />
|
||||
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
|
||||
@@ -45,7 +46,7 @@
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Sample Java Methods" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Callstack Sample" />
|
||||
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
|
||||
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
|
||||
</Profilers>
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
if (!project.hasProperty("disable-performance-plugin")) {
|
||||
apply plugin: 'com.google.firebase.firebase-perf'
|
||||
}
|
||||
|
||||
apply plugin: 'com.google.firebase.crashlytics'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 234
|
||||
def appVersionName = '1.18.4'
|
||||
def appVersionCode = 268
|
||||
def appVersionName = '1.24.0'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -27,12 +31,12 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
compileSdkVersion 30
|
||||
compileSdkVersion 31
|
||||
|
||||
defaultConfig {
|
||||
applicationId "it.integry.integrywmsnative"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 30
|
||||
targetSdkVersion 31
|
||||
versionCode appVersionCode
|
||||
versionName appVersionName
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
@@ -81,6 +85,7 @@ android {
|
||||
dynamicFeatures = [":dynamic__base", ":dynamic_vgalimenti"]
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -94,37 +99,37 @@ dependencies {
|
||||
//Firebase
|
||||
|
||||
// Import the Firebase BoM
|
||||
implementation platform('com.google.firebase:firebase-bom:26.3.0')
|
||||
implementation platform('com.google.firebase:firebase-bom:29.1.0')
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
implementation 'com.google.firebase:firebase-core'
|
||||
implementation 'com.google.firebase:firebase-crash'
|
||||
implementation 'com.google.firebase:firebase-crashlytics'
|
||||
implementation 'com.google.firebase:firebase-perf'
|
||||
implementation 'com.google.android.gms:play-services-basement:17.6.0'
|
||||
implementation 'com.google.android.gms:play-services-basement:18.0.0'
|
||||
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.android.material:material:1.3.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||
implementation 'com.google.android.material:material:1.5.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.2.0'
|
||||
implementation 'androidx.preference:preference-ktx:1.1.1'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||
implementation 'androidx.preference:preference-ktx:1.2.0'
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
||||
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.3.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-common-java8:2.3.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-common-java8:2.4.1'
|
||||
implementation 'org.apache.commons:commons-text:1.9'
|
||||
|
||||
//MVVM
|
||||
def dagger2_version = '2.29.1'
|
||||
def dagger2_version = '2.40'
|
||||
api "com.google.dagger:dagger:$dagger2_version"
|
||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
||||
api "com.google.dagger:dagger-android:$dagger2_version"
|
||||
api "com.google.dagger:dagger-android-support:$dagger2_version" // if you use the support libraries
|
||||
api "com.google.dagger:dagger-android-support:$dagger2_version"
|
||||
// if you use the support libraries
|
||||
annotationProcessor "com.google.dagger:dagger-android-processor:$dagger2_version"
|
||||
|
||||
//FAB
|
||||
@@ -134,13 +139,11 @@ dependencies {
|
||||
implementation 'com.github.cachapa:ExpandableLayout:2.9.2'
|
||||
implementation 'com.github.frankiesardo:linearlistview:1.0.1@aar'
|
||||
implementation 'com.github.fede87:StatusBarAlert:1.0.1'
|
||||
implementation 'com.github.akshay2211:Stash:master'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
implementation 'com.github.zhukic:sectioned-recyclerview:1.2.3'
|
||||
implementation 'com.github.pedromassango:doubleClick:3.0'
|
||||
|
||||
//SQLite ROOM
|
||||
def room_version = "2.3.0"
|
||||
def room_version = "2.4.1"
|
||||
|
||||
implementation "androidx.room:room-runtime:$room_version"
|
||||
annotationProcessor "androidx.room:room-compiler:$room_version"
|
||||
@@ -154,8 +157,14 @@ dependencies {
|
||||
implementation project(':barcode_base_android_library')
|
||||
implementation project(':honeywellscannerlibrary')
|
||||
implementation project(':keyobardemulatorscannerlibrary')
|
||||
androidTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1'
|
||||
androidTestImplementation 'org.testng:testng:7.4.0'
|
||||
|
||||
|
||||
implementation 'com.github.RaviKoradiya:LiveAdapter:1.3.4'
|
||||
|
||||
// Required -- JUnit 4 framework
|
||||
// testImplementation "org.junit.jupiter:junit-jupiter-api:5.8.1"
|
||||
// androidTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
|
||||
// androidTestImplementation 'org.testng:testng:7.4.0'
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package it.integry.integrywmsnative.gest.spedizione;
|
||||
|
||||
class SpedizioneViewModelTest {
|
||||
|
||||
@org.junit.jupiter.api.Test
|
||||
void createNewLU() {
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,8 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:fullBackupContent="@xml/backup_descriptor">
|
||||
android:fullBackupContent="@xml/backup_descriptor"
|
||||
android:requestLegacyExternalStorage="true">
|
||||
<activity
|
||||
android:name=".gest.spedizione.SpedizioneActivity"
|
||||
android:screenOrientation="portrait"
|
||||
@@ -29,6 +30,10 @@
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing" />
|
||||
<activity android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing" />
|
||||
<activity
|
||||
android:name=".gest.picking_resi.PickingResiActivity"
|
||||
android:screenOrientation="portrait"
|
||||
@@ -36,7 +41,8 @@
|
||||
<activity
|
||||
android:name=".gest.main.MainActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing">
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.CLIENTBARCODEACTIVITY" />
|
||||
|
||||
@@ -69,7 +75,8 @@
|
||||
<activity
|
||||
android:name=".SplashActivity"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/SplashTheme">
|
||||
android:theme="@style/SplashTheme"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
||||
@@ -5,14 +5,28 @@ import javax.inject.Singleton;
|
||||
import dagger.Component;
|
||||
import it.integry.integrywmsnative.core.context.AppContext;
|
||||
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivityComponent;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivityModule;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragmentComponent;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragmentModule;
|
||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneComponent;
|
||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneModule;
|
||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingComponent;
|
||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingModule;
|
||||
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;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormComponent;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsComponent;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsModule;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleComponent;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliComponent;
|
||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliModule;
|
||||
import it.integry.integrywmsnative.gest.login.LoginComponent;
|
||||
import it.integry.integrywmsnative.gest.login.LoginModule;
|
||||
import it.integry.integrywmsnative.gest.main.MainActivityComponent;
|
||||
import it.integry.integrywmsnative.gest.main.MainActivityModule;
|
||||
import it.integry.integrywmsnative.gest.main.MainFragmentComponent;
|
||||
@@ -37,6 +51,8 @@ import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamento
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeModule;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditComponent;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditModule;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.DialogEditArticoloComponent;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.DialogEditArticoloModule;
|
||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaComponent;
|
||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaModule;
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeComponent;
|
||||
@@ -51,10 +67,13 @@ import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviForn
|
||||
import it.integry.integrywmsnative.gest.ultimi_arrivi_fornitore.UltimiArriviFornitoreModule;
|
||||
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceComponent;
|
||||
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialogComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2Component;
|
||||
@@ -70,6 +89,9 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
RoomModule.class,
|
||||
SplashActivityModule.class,
|
||||
MainApplicationModule.class,
|
||||
BaseActivityModule.class,
|
||||
BaseFragmentModule.class,
|
||||
LoginModule.class,
|
||||
MainActivityModule.class,
|
||||
MainFragmentModule.class,
|
||||
MainAccettazioneModule.class,
|
||||
@@ -97,44 +119,100 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
ProdOrdineProduzioneElencoModule.class,
|
||||
ProdRecuperoMaterialeModule.class,
|
||||
ProdVersamentoMaterialeModule.class,
|
||||
DialogChooseArtsFromListaArtsModule.class
|
||||
DialogChooseArtsFromListaArtsModule.class,
|
||||
DocInterniModule.class,
|
||||
DialogSelectDocInfoModule.class,
|
||||
DocInterniEditFormModule.class,
|
||||
DialogSelectDocRowsModule.class,
|
||||
DialogAskClienteModule.class,
|
||||
DialogEditArticoloModule.class
|
||||
})
|
||||
public interface MainApplicationComponent {
|
||||
|
||||
BaseActivityComponent.Factory baseActivityComponent();
|
||||
|
||||
BaseFragmentComponent.Factory baseFragmentComponent();
|
||||
|
||||
SplashActivityComponent.Factory splashActivityComponent();
|
||||
|
||||
LoginComponent.Factory loginActivityComponent();
|
||||
|
||||
MainActivityComponent.Factory mainActivityComponent();
|
||||
|
||||
MainFragmentComponent.Factory mainFragmentComponent();
|
||||
|
||||
MainAccettazioneComponent.Factory mainAccettazioneComponent();
|
||||
|
||||
ListaBancaliComponent.Factory listaBancaliComponent();
|
||||
|
||||
ContenutoBancaleComponent.Factory contenutoBancaleComponent();
|
||||
|
||||
PVOrdiniAcquistoGrigliaComponent.Factory pvOrdineAcquistoGrigliaComponent();
|
||||
|
||||
PVOrdineAcquistoEditComponent.Factory pvOrdineAcquistoEditComponent();
|
||||
|
||||
PickingLiberoComponent.Factory pickingLiberoComponent();
|
||||
|
||||
RettificaGiacenzeComponent.Factory rettificaGiacenzeComponent();
|
||||
|
||||
SpedizioneComponent.Factory spedizioneComponent();
|
||||
|
||||
AccettazionePickingComponent.Factory accettazionePickingComponent();
|
||||
|
||||
UltimeConsegneClienteComponent.Factory ultimeConsegneClienteComponent();
|
||||
|
||||
UltimiArriviFornitoreComponent.Factory ultimiArriviFornitoreComponent();
|
||||
|
||||
PickingResiComponent.Factory pickingResiComponent();
|
||||
|
||||
OrdiniUscitaElencoComponent.Factory prodOrdineLavorazioneElencoComponent();
|
||||
|
||||
DialogAskClienteComponent.Factory dialogAskClienteComponent();
|
||||
|
||||
DialogInputQuantityV2Component.Factory dialogInputQuantityV2Component();
|
||||
|
||||
DialogInputLUProdComponent.Factory dialogInputLUProdComponent();
|
||||
|
||||
DialogScanArtComponent.Factory dialogScanArtComponent();
|
||||
|
||||
DialogScanOrCreateLUComponent.Factory dialogScanOrCreateLUComponent();
|
||||
|
||||
ProdFabbisognoLineeProdComponent.Factory prodFabbisognoLineeProdComponent();
|
||||
|
||||
VersamentoMerceComponent.Factory versamentoMerceComponent();
|
||||
|
||||
DialogAskMagazzinoProssimitaComponent.Factory dialogAskMagazzinoProssimitaComponent();
|
||||
|
||||
DialogChooseBatchLotComponent.Factory dialogChooseBatchLotComponent();
|
||||
|
||||
DialogRowInfoProdFabbisognoLineeProdComponent.Factory dialogRowInfoProdFabbisognoLineeProdComponent();
|
||||
|
||||
ProdRientroMerceComponent.Factory prodRientroMerceComponent();
|
||||
|
||||
ProdRientroMerceOrderDetailComponent.Factory prodRientroMerceOrderDetailComponent();
|
||||
|
||||
ProdOrdineProduzioneElencoComponent.Factory prodOrdineProduzioneElencoComponent();
|
||||
|
||||
ProdRecuperoMaterialeComponent.Factory prodRecuperoMaterialeComponent();
|
||||
|
||||
ProdVersamentoMaterialeComponent.Factory prodVersamentoMaterialeComponent();
|
||||
|
||||
DialogChooseArtsFromListaArtsComponent.Factory dialogChooseArtsFromListaArtsComponent();
|
||||
|
||||
DocInterniComponent.Factory docInterniComponent();
|
||||
|
||||
DialogSelectDocInfoComponent.Factory dialogSelectMgrpDtipPairComponent();
|
||||
|
||||
DialogSelectDocRowsComponent.Factory dialogSelectDocRowsComponent();
|
||||
|
||||
DocInterniEditFormComponent.Factory docInterniEditFormComponent();
|
||||
|
||||
InfoAggiuntiveLUDialogComponent.Factory infoAggiuntiveLUDialogComponent();
|
||||
|
||||
DialogEditArticoloComponent.Factory dialogEditArticoloComponent();
|
||||
|
||||
void inject(MainApplication mainApplication);
|
||||
|
||||
void inject(AppContext mainApplication);
|
||||
|
||||
}
|
||||
|
||||
@@ -15,16 +15,23 @@ import it.integry.integrywmsnative.core.menu.MenuService;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.CommessaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.EntityRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
||||
import it.integry.integrywmsnative.core.update.UpdatesManager;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||
|
||||
@Module
|
||||
public class MainApplicationModule {
|
||||
@@ -67,6 +74,24 @@ public class MainApplicationModule {
|
||||
return new MenuService(menuRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
UpdatesManager provideUpdatesManager() {
|
||||
return new UpdatesManager();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
DialogProgressView providesDialogProgressView() {
|
||||
return DialogProgressView.newInstance();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
DialogInputQuantityV2View providesDialogInputQuantityV2View() {
|
||||
return new DialogInputQuantityV2View();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
OrdiniRESTConsumer provideOrdiniRESTConsumer(SystemRESTConsumer systemRESTConsumer, EntityRESTConsumer entityRESTConsumer) {
|
||||
@@ -81,14 +106,20 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ArticoloRESTConsumer provideArticoloRESTConsumer() {
|
||||
return new ArticoloRESTConsumer();
|
||||
ArticoloRESTConsumer provideArticoloRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
return new ArticoloRESTConsumer(systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
DepositoRESTConsumer provideDepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer) {
|
||||
return new DepositoRESTConsumer(entityRESTConsumer);
|
||||
CommessaRESTConsumer provideCommessaRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
return new CommessaRESTConsumer(systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
DepositoRESTConsumer provideDepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer, SystemRESTConsumer systemRESTConsumer) {
|
||||
return new DepositoRESTConsumer(entityRESTConsumer, systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -151,5 +182,22 @@ public class MainApplicationModule {
|
||||
return new ProdFabbisognoLineeProdRESTConsumer(systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
DocInterniRESTConsumer provideDocInterniRESTConsumer() {
|
||||
return new DocInterniRESTConsumer();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
GiacenzaRESTConsumer provideGiacenzaRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
return new GiacenzaRESTConsumer(systemRESTConsumer, articoloRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
InventarioService provideInventarioService(GiacenzaRESTConsumer giacenzaRESTConsumer) {
|
||||
return new InventarioService(giacenzaRESTConsumer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package it.integry.integrywmsnative;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
@@ -38,6 +39,12 @@ public class SplashActivity extends BaseActivity implements MainContext.Listener
|
||||
|
||||
private RunnableArgsss<Integer, String[], List<Integer>> onRequestPermissionResult;
|
||||
|
||||
public static void startActivity(Context context) {
|
||||
Intent intent = new Intent(context, SplashActivity.class);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
@@ -16,7 +16,7 @@ public class CommonConst {
|
||||
|
||||
public static String DEFAULT_ANONYMOUS_UL_SERIE = "UL";
|
||||
|
||||
public static int NUMBER_OF_DECIMAL_DIGITS = 3;
|
||||
public static int NUMBER_OF_DECIMAL_DIGITS = 5;
|
||||
}
|
||||
|
||||
public static class Files {
|
||||
|
||||
@@ -23,7 +23,7 @@ public class BarcodeCallbackDTO {
|
||||
return onScanSuccessfull;
|
||||
}
|
||||
|
||||
public BarcodeCallbackDTO setOnScanSuccessfull(RunnableArgs<BarcodeScanDTO> onScanSuccessfull) {
|
||||
public BarcodeCallbackDTO setOnScanSuccessful(RunnableArgs<BarcodeScanDTO> onScanSuccessfull) {
|
||||
this.onScanSuccessfull = onScanSuccessfull;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package it.integry.integrywmsnative.core.class_router;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.configs.MenuConfiguration;
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityHashMap;
|
||||
|
||||
@@ -10,14 +9,12 @@ public class BaseCustomConfiguration implements ICustomConfiguration {
|
||||
|
||||
|
||||
public static class Keys {
|
||||
public static int MENU_CONFIGURATION = 0;
|
||||
public static int FLAG_SHOW_COD_FORN_IN_SPEDIZIONE = 1;
|
||||
public static int CUSTOM_DYNAMIC_VERSION_PATH = 2;
|
||||
public static int FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC = 3;
|
||||
}
|
||||
|
||||
protected HashMap<Integer, Object> configurations = new HashMap<Integer, Object>() {{
|
||||
put(Keys.MENU_CONFIGURATION, new MenuConfiguration());
|
||||
protected HashMap<Integer, Object> configurations = new HashMap<>() {{
|
||||
put(Keys.FLAG_SHOW_COD_FORN_IN_SPEDIZIONE, true);
|
||||
put(Keys.FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC, false);
|
||||
}};
|
||||
|
||||
@@ -3,11 +3,13 @@ package it.integry.integrywmsnative.core.class_router.configs;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneFragment;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniFragment;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoFragment;
|
||||
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment;
|
||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaFragment;
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeFragment;
|
||||
@@ -123,6 +125,14 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_recupero_materiale)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(ProdRecuperoMaterialeFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(it.integry.integrywmsnative.R.id.nav_prod_rientro_merce)
|
||||
.setCodMenu("MG059")
|
||||
.setTitleText(it.integry.integrywmsnative.R.string.rientro_merce_fragment_title)
|
||||
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_prod_accettazione_produzione)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_external)
|
||||
.setFragmentFactory(ProdRientroMerceFragment::newInstance))
|
||||
).addGroup(
|
||||
new MenuGroup()
|
||||
.setGroupText(R.string.internal_handling)
|
||||
@@ -159,6 +169,13 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
|
||||
.setFragmentFactory(PVOrdiniAcquistoGrigliaFragment::newInstance))
|
||||
.addItem(new MenuItem()
|
||||
.setCodMenu("MG058")
|
||||
.setID(it.integry.integrywmsnative.R.id.nav_pv_doc_interni)
|
||||
.setTitleText(it.integry.integrywmsnative.R.string.doc_interni)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_contab_doc_interni)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_contab_doc_interni)
|
||||
.setFragmentFactory(DocInterniFragment::newInstance))
|
||||
|
||||
// .addItem(new MenuItem()
|
||||
// .setID(it.integry.integrywmsnative.R.id.nav_pv_ordini_acquisto_trasmessi)
|
||||
|
||||
@@ -50,7 +50,6 @@ public class AppContext {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initSettings() {
|
||||
Stash.init(mApplicationContext);
|
||||
SettingsManager.init(mApplicationContext);
|
||||
@@ -80,5 +79,4 @@ public class AppContext {
|
||||
Logger.addLogAdapter(new AndroidLogAdapter());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ public class MainContext {
|
||||
}
|
||||
|
||||
public void logout(Runnable onLoggedOut) {
|
||||
menuService.invalidateCache();
|
||||
UtilityThread.executeParallel(() -> {
|
||||
SettingsManager.i().setUser(null);
|
||||
SettingsManager.i().setUserSession(null);
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection;
|
||||
|
||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||
import it.integry.integrywmsnative.core.coollection.matcher.custom.Contains;
|
||||
import it.integry.integrywmsnative.core.coollection.matcher.custom.Equals;
|
||||
import it.integry.integrywmsnative.core.coollection.matcher.custom.EqualsIgnoreCase;
|
||||
import it.integry.integrywmsnative.core.coollection.matcher.custom.GreaterThan;
|
||||
import it.integry.integrywmsnative.core.coollection.matcher.custom.IsNull;
|
||||
import it.integry.integrywmsnative.core.coollection.matcher.custom.LessThan;
|
||||
import it.integry.integrywmsnative.core.coollection.matcher.custom.Not;
|
||||
import it.integry.integrywmsnative.core.coollection.query.Query;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class Coollection {
|
||||
|
||||
public static <T> Query<T> from(Collection<T> collection) {
|
||||
return new Query<T>(collection);
|
||||
}
|
||||
|
||||
public static Matcher eq(Object value) {
|
||||
return new Equals(value);
|
||||
}
|
||||
|
||||
public static Matcher contains(String value) {
|
||||
return new Contains(value);
|
||||
}
|
||||
|
||||
public static Matcher eqIgnoreCase(String value) {
|
||||
return new EqualsIgnoreCase(value);
|
||||
}
|
||||
|
||||
public static Matcher not(Matcher matcher) {
|
||||
return new Not(matcher);
|
||||
}
|
||||
|
||||
public static Matcher greaterThan(Number value) {
|
||||
return new GreaterThan(value);
|
||||
}
|
||||
|
||||
public static Matcher lessThan(Number value) {
|
||||
return new LessThan(value);
|
||||
}
|
||||
|
||||
public static Matcher isNull() {
|
||||
return new IsNull();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.matcher;
|
||||
|
||||
public interface Matcher {
|
||||
|
||||
boolean match(Object value);
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
||||
|
||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||
|
||||
public class Contains implements Matcher {
|
||||
|
||||
private final String matcherValue;
|
||||
|
||||
public Contains(String matcherValue) {
|
||||
this.matcherValue = matcherValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean match(Object value) {
|
||||
return String.valueOf(value).contains(matcherValue);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
||||
|
||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||
|
||||
public class Equals implements Matcher {
|
||||
|
||||
private final Object value;
|
||||
|
||||
public Equals(Object value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean match(Object anotherValue) {
|
||||
return value.equals(anotherValue);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
||||
|
||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||
|
||||
public class EqualsIgnoreCase implements Matcher {
|
||||
|
||||
private final String value;
|
||||
|
||||
public EqualsIgnoreCase(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean match(Object anotherValue) {
|
||||
return (value).equalsIgnoreCase((String) anotherValue);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
||||
|
||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||
|
||||
public class GreaterThan implements Matcher {
|
||||
|
||||
private final Number value;
|
||||
|
||||
public GreaterThan(Number value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean match(Object matchValue) {
|
||||
if (matchValue == null) {
|
||||
return false;
|
||||
}
|
||||
return ((Number) matchValue).doubleValue() > value.doubleValue();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
||||
|
||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||
|
||||
public class IsNull implements Matcher {
|
||||
|
||||
@Override
|
||||
public boolean match(Object value) {
|
||||
return value == null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
||||
|
||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||
|
||||
public class LessThan implements Matcher {
|
||||
|
||||
private final Number value;
|
||||
|
||||
public LessThan(Number value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean match(Object matchValue) {
|
||||
if (matchValue == null) {
|
||||
return false;
|
||||
}
|
||||
return ((Number) matchValue).doubleValue() < value.doubleValue();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
||||
|
||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||
|
||||
public class Not implements Matcher {
|
||||
|
||||
private final Matcher matcher;
|
||||
|
||||
public Not(Matcher matcher) {
|
||||
this.matcher = matcher;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean match(Object value) {
|
||||
return !matcher.match(value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.query;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||
import it.integry.integrywmsnative.core.coollection.query.criteria.Criteria;
|
||||
import it.integry.integrywmsnative.core.coollection.query.criteria.CriteriaList;
|
||||
import it.integry.integrywmsnative.core.coollection.query.order.Order;
|
||||
import it.integry.integrywmsnative.core.coollection.query.order.OrderCriteria;
|
||||
import it.integry.integrywmsnative.core.coollection.query.specification.custom.AndSpecification;
|
||||
import it.integry.integrywmsnative.core.coollection.query.specification.custom.OrSpecification;
|
||||
|
||||
public class Query<T> {
|
||||
|
||||
private final Collection<T> collection;
|
||||
private CriteriaList<T> criterias;
|
||||
private OrderCriteria<T> orderCriteria;
|
||||
|
||||
public Query(Collection<T> collection) {
|
||||
this.collection = collection;
|
||||
criterias = new CriteriaList<T>();
|
||||
}
|
||||
|
||||
public Query<T> where(String method, Matcher matcher) {
|
||||
Criteria<T> criteria = new Criteria<T>(method, matcher);
|
||||
criterias.add(criteria);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Query<T> and(String method, Matcher matcher) {
|
||||
Criteria<T> criteria = new Criteria<T>(method, matcher);
|
||||
criteria.setSpecification(new AndSpecification<T>());
|
||||
criterias.add(criteria);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Query<T> or(String method, Matcher matcher) {
|
||||
Criteria<T> criteria = new Criteria<T>(method, matcher);
|
||||
criteria.setSpecification(new OrSpecification<T>());
|
||||
criterias.add(criteria);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Query<T> orderBy(String method, Order order) {
|
||||
orderCriteria = new OrderCriteria<T>(method, order);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Query<T> orderBy(String method) {
|
||||
return orderBy(method, Order.ASC);
|
||||
}
|
||||
|
||||
public List<T> all() {
|
||||
List<T> all = new ArrayList<T>();
|
||||
for (T item : collection) {
|
||||
if (criterias.match(item)) {
|
||||
all.add(item);
|
||||
}
|
||||
}
|
||||
if (orderCriteria != null) {
|
||||
all = orderCriteria.sort(all);
|
||||
}
|
||||
return all;
|
||||
}
|
||||
|
||||
public T first() {
|
||||
List<T> all = cloneCollection(collection);
|
||||
if (orderCriteria != null) {
|
||||
all = orderCriteria.sort(all);
|
||||
}
|
||||
for (T item : all) {
|
||||
if (criterias.match(item)) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<T> cloneCollection(Collection<T> collection) {
|
||||
List<T> list = new ArrayList<T>();
|
||||
for (T item : collection) {
|
||||
list.add(item);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.query.criteria;
|
||||
|
||||
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||
import it.integry.integrywmsnative.core.coollection.query.specification.Specification;
|
||||
import it.integry.integrywmsnative.core.coollection.reflection.Phanton;
|
||||
|
||||
public class Criteria<T> {
|
||||
|
||||
private final String method;
|
||||
private final Matcher matcher;
|
||||
private Specification<T> specification;
|
||||
|
||||
public Criteria(String method, Matcher matcher) {
|
||||
this.method = method;
|
||||
this.matcher = matcher;
|
||||
}
|
||||
|
||||
public void setSpecification(Specification<T> specification) {
|
||||
this.specification = specification;
|
||||
}
|
||||
|
||||
public Specification<T> specification() {
|
||||
return specification;
|
||||
}
|
||||
|
||||
public boolean match(T item) {
|
||||
try {
|
||||
Object value = Phanton.from(item).call(method);
|
||||
return matcher.match(value);
|
||||
} catch (Exception err) {
|
||||
throw new RuntimeException(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.query.criteria;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CriteriaList<T> {
|
||||
|
||||
private List<Criteria<T>> criterias;
|
||||
|
||||
public CriteriaList() {
|
||||
criterias = new ArrayList<Criteria<T>>();
|
||||
}
|
||||
|
||||
public void add(Criteria<T> criteria) {
|
||||
criterias.add(criteria);
|
||||
}
|
||||
|
||||
public boolean match(T item) {
|
||||
if (criterias.size() == 0) {
|
||||
return true;
|
||||
}
|
||||
if (criterias.size() == 1) {
|
||||
return criterias.get(0).match(item);
|
||||
}
|
||||
boolean matched = true;
|
||||
for (int i = criterias.size() - 1; i > 0; i--) {
|
||||
Criteria<T> one = criterias.get(i);
|
||||
Criteria<T> other = criterias.get(i - 1);
|
||||
matched = matched && one.specification().match(item, one, other);
|
||||
}
|
||||
return matched;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.query.order;
|
||||
|
||||
public enum Order {
|
||||
ASC, DESC
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.query.order;
|
||||
|
||||
import it.integry.integrywmsnative.core.coollection.reflection.Phanton;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
public class OrderComparator<T> implements Comparator<T> {
|
||||
|
||||
private final String method;
|
||||
|
||||
public OrderComparator(String method) {
|
||||
this.method = method;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public int compare(T one, T other) {
|
||||
Object oneValue = Phanton.from(one).call(method);
|
||||
Object otherValue = Phanton.from(other).call(method);
|
||||
if (oneValue == null || otherValue == null) {
|
||||
return 0;
|
||||
}
|
||||
if (oneValue instanceof Comparable) {
|
||||
return ((Comparable<Object>) oneValue).compareTo(otherValue);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.query.order;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class OrderCriteria<T> {
|
||||
|
||||
private final String method;
|
||||
private final Order order;
|
||||
|
||||
public OrderCriteria(String method, Order order) {
|
||||
this.method = method;
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
public List<T> sort(List<T> list) {
|
||||
Collections.sort(list, new OrderComparator<T>(method));
|
||||
if (order == Order.DESC) {
|
||||
Collections.reverse(list);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.query.specification;
|
||||
|
||||
import it.integry.integrywmsnative.core.coollection.query.criteria.Criteria;
|
||||
|
||||
public interface Specification<T> {
|
||||
|
||||
boolean match(T item, Criteria<T> one, Criteria<T> other);
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.query.specification.custom;
|
||||
|
||||
import it.integry.integrywmsnative.core.coollection.query.criteria.Criteria;
|
||||
import it.integry.integrywmsnative.core.coollection.query.specification.Specification;
|
||||
|
||||
public class AndSpecification<T> implements Specification<T> {
|
||||
|
||||
@Override
|
||||
public boolean match(T item, Criteria<T> one, Criteria<T> other) {
|
||||
return one.match(item) && other.match(item);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.query.specification.custom;
|
||||
|
||||
import it.integry.integrywmsnative.core.coollection.query.criteria.Criteria;
|
||||
import it.integry.integrywmsnative.core.coollection.query.specification.Specification;
|
||||
|
||||
public class OrSpecification<T> implements Specification<T> {
|
||||
|
||||
@Override
|
||||
public boolean match(T item, Criteria<T> one, Criteria<T> other) {
|
||||
return one.match(item) || other.match(item);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.coollection.reflection;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
public class Phanton<T> {
|
||||
|
||||
private final T target;
|
||||
private Class<?> clazz;
|
||||
|
||||
private Phanton(T target) {
|
||||
this.target = target;
|
||||
clazz = target.getClass();
|
||||
}
|
||||
|
||||
public static <T> Phanton<T> from(T target) {
|
||||
return new Phanton<T>(target);
|
||||
}
|
||||
|
||||
public Object call(String name) {
|
||||
return invoke(name);
|
||||
}
|
||||
|
||||
private Object invoke(String name) {
|
||||
for (final Field field : clazz.getDeclaredFields()) {
|
||||
try {
|
||||
if (name.equals(field.getName())) {
|
||||
field.setAccessible(Boolean.TRUE);
|
||||
return field.get(target);
|
||||
}
|
||||
} catch (final IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
throw new RuntimeException("No such property with name " + name);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,20 +8,22 @@ import it.integry.integrywmsnative.core.data_store.db.converter.DateConverter;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloGrigliaDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloOrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.GrigliaDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.OrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
|
||||
@Database(entities = {ArticoloGriglia.class, Griglia.class, Ordine.class, ArticoloOrdine.class}, version = 1, exportSchema = false)
|
||||
@Database(entities = {ArticoloGriglia.class, Griglia.class, Ordine.class, ArticoloOrdine.class, SqlMtbColt.class, SqlMtbColr.class}, version = 8, exportSchema = false)
|
||||
@TypeConverters({
|
||||
DateConverter.class
|
||||
})
|
||||
public abstract class AppDatabase extends RoomDatabase {
|
||||
|
||||
// private AppDatabase mRoomInstance;
|
||||
|
||||
public abstract ArticoloGrigliaDao articoloGrigliaDao();
|
||||
|
||||
public abstract GrigliaDao grigliaDao();
|
||||
@@ -30,26 +32,9 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
|
||||
public abstract ArticoloOrdineDao articoloOrdineDao();
|
||||
|
||||
// public static AppDatabase getDatabase(final Context context) {
|
||||
// if (INSTANCE == null) {
|
||||
// synchronized (AppDatabase.class) {
|
||||
// if (INSTANCE == null) {
|
||||
// INSTANCE = Room.databaseBuilder(context.getApplicationContext(),
|
||||
// AppDatabase.class, "integry_wms")
|
||||
// .fallbackToDestructiveMigration()
|
||||
// .build();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return INSTANCE;
|
||||
// }
|
||||
public abstract MtbColtDao mtbColtDao();
|
||||
|
||||
// public AppDatabase(Application application) {
|
||||
// mRoomInstance = Room.databaseBuilder(application,
|
||||
// AppDatabase.class, "integry_wms")
|
||||
// .fallbackToDestructiveMigration()
|
||||
// .build();
|
||||
// }
|
||||
public abstract MtbColrDao mtbColrDao();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,15 +11,21 @@ import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloGrigliaDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloOrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.GrigliaDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.OrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoliOrdineRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoloGrigliaRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.GrigliaRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColrRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColtRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.OrdineRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.ArticoliGrigliaDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.ArticoliOrdineDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.GrigliaDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.OrdineDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.SqlMtbColrDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.SqlMtbColtDataSource;
|
||||
|
||||
@Module
|
||||
public class RoomModule {
|
||||
@@ -66,6 +72,18 @@ public class RoomModule {
|
||||
return appDatabase.articoloOrdineDao();
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
MtbColtDao providesMtbColtDao(AppDatabase appDatabase) {
|
||||
return appDatabase.mtbColtDao();
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
MtbColrDao providesMtbColrDao(AppDatabase appDatabase) {
|
||||
return appDatabase.mtbColrDao();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -96,4 +114,16 @@ public class RoomModule {
|
||||
return new OrdineDataSource(ordineDao);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
MtbColtRepository providesMtbColtRepository(MtbColtDao mtbColtDao) {
|
||||
return new SqlMtbColtDataSource(mtbColtDao);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
MtbColrRepository providesMtbColrRepository(MtbColrDao mtbColrDao) {
|
||||
return new SqlMtbColrDataSource(mtbColrDao);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,9 +4,10 @@ import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.Query;
|
||||
import androidx.room.RawQuery;
|
||||
import androidx.room.Update;
|
||||
import androidx.sqlite.db.SupportSQLiteQuery;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
||||
@@ -21,10 +22,13 @@ public interface ArticoloGrigliaDao {
|
||||
|
||||
@Insert
|
||||
void insertAll(List<ArticoloGriglia> articoli);
|
||||
|
||||
@Insert
|
||||
Long insert(ArticoloGriglia articolo);
|
||||
|
||||
@Update
|
||||
void updateAll(List<ArticoloGriglia> articoli);
|
||||
|
||||
@Update
|
||||
void update(ArticoloGriglia articolo);
|
||||
|
||||
@@ -43,6 +47,12 @@ public interface ArticoloGrigliaDao {
|
||||
@Query("SELECT articolo_griglia_id FROM articoli_griglia WHERE (cod_mart = :codMart AND bar_code =:barCode) AND id_griglia = :idGriglia LIMIT 1")
|
||||
Integer getIdArticoloByGrigliaAndBarcodeAndCodMart(int idGriglia, String barCode, String codMart);
|
||||
|
||||
@RawQuery(observedEntities = ArticoloGriglia.class)
|
||||
List<ArticoloGriglia> getArticoli(SupportSQLiteQuery query);
|
||||
|
||||
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId")
|
||||
List<ArticoloGriglia> getArticoliFromGriglia(int grigliaId);
|
||||
|
||||
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId AND new_no_promo = 1")
|
||||
List<ArticoloGriglia> getNewArticoliInGriglia(int grigliaId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.dao;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.Query;
|
||||
import androidx.room.Update;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
|
||||
@Dao
|
||||
public interface MtbColrDao {
|
||||
@Query("SELECT * from mtb_colr ")
|
||||
List<SqlMtbColr> getAll();
|
||||
|
||||
@Insert
|
||||
Long insert(SqlMtbColr mtbColr);
|
||||
|
||||
@Update
|
||||
void update(SqlMtbColr mtbColr);
|
||||
|
||||
@Delete
|
||||
void delete(SqlMtbColr mtbColr);
|
||||
|
||||
@Query("SELECT * from mtb_colr where id_collo = :idDocument")
|
||||
List<SqlMtbColr> getDocumentRows(int idDocument);
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.dao;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.Query;
|
||||
import androidx.room.Update;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.view_model.OrdineWithGriglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.OrdineWrapper;
|
||||
|
||||
@Dao
|
||||
public interface MtbColtDao {
|
||||
@Query("SELECT * from mtb_colt")
|
||||
List<SqlMtbColt> getAll();
|
||||
|
||||
@Insert
|
||||
Long insert(SqlMtbColt mtbColt);
|
||||
|
||||
@Update
|
||||
void update(SqlMtbColt mtbColt);
|
||||
|
||||
@Delete
|
||||
void delete(SqlMtbColt mtbColt);
|
||||
|
||||
@Query("SELECT mtb_colt.*, count(mtb_colr.id) as countArticoli from mtb_colt left outer join mtb_colr on (mtb_colr.id_collo = mtb_colt.id) where" +
|
||||
" cod_dtip_provv = :codDtip " +
|
||||
" AND ( cod_anag = :codAnag OR (cod_anag is null and :codAnag is null)) " +
|
||||
" AND ( cod_vdes = :codVdes OR (cod_vdes is null and :codVdes is null)) " +
|
||||
" AND ( mtb_colt.data_doc = :dataDoc OR (mtb_colt.data_doc is null and :dataDoc is null)) " +
|
||||
" AND ( mtb_colt.num_doc = :numDoc OR (mtb_colt.num_doc is null and :numDoc is null)) " +
|
||||
" and cod_dtip is null group by mtb_colt.id")
|
||||
List<DocInternoWrapper> getLocalDocumentsByCodDtip(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc);
|
||||
|
||||
@Query("SELECT ifnull(MAX(num_collo),0) +1 as num_collo from mtb_colt")
|
||||
Integer getNextNumCollo();
|
||||
}
|
||||
@@ -6,6 +6,8 @@ import androidx.room.ForeignKey;
|
||||
import androidx.room.Index;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
|
||||
@Entity(
|
||||
@@ -25,7 +27,7 @@ import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
public class ArticoloGriglia {
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
@ColumnInfo(name = "articolo_griglia_id")
|
||||
private int articoloGrigliaId;
|
||||
private Integer articoloGrigliaId;
|
||||
|
||||
@ColumnInfo(name = "cod_mart")
|
||||
private String codMart;
|
||||
@@ -54,14 +56,29 @@ public class ArticoloGriglia {
|
||||
@ColumnInfo(name = "qta_min_ordinabile")
|
||||
private float qtaMinOrdinabile;
|
||||
|
||||
@ColumnInfo(name = "gg_scadenza")
|
||||
private int ggScadenza;
|
||||
|
||||
@ColumnInfo(name = "giacenza")
|
||||
private float giacenza;
|
||||
|
||||
@ColumnInfo(name = "qta_prevista_vendita")
|
||||
private float qtaPrevistaVendita;
|
||||
|
||||
@ColumnInfo(name = "qta_proposta")
|
||||
private float qtaProposta;
|
||||
|
||||
@ColumnInfo(name = "id_griglia")
|
||||
private int idGriglia;
|
||||
|
||||
public int getArticoloGrigliaId() {
|
||||
@ColumnInfo(name = "new_no_promo")
|
||||
private boolean newNoPromo = false;
|
||||
|
||||
public Integer getArticoloGrigliaId() {
|
||||
return articoloGrigliaId;
|
||||
}
|
||||
|
||||
public void setArticoloGrigliaId(int articoloGrigliaId) {
|
||||
public void setArticoloGrigliaId(Integer articoloGrigliaId) {
|
||||
this.articoloGrigliaId = articoloGrigliaId;
|
||||
}
|
||||
|
||||
@@ -145,6 +162,46 @@ public class ArticoloGriglia {
|
||||
this.idGriglia = idGriglia;
|
||||
}
|
||||
|
||||
public int getGgScadenza() {
|
||||
return ggScadenza;
|
||||
}
|
||||
|
||||
public void setGgScadenza(int ggScadenza) {
|
||||
this.ggScadenza = ggScadenza;
|
||||
}
|
||||
|
||||
public float getGiacenza() {
|
||||
return giacenza;
|
||||
}
|
||||
|
||||
public void setGiacenza(float giacenza) {
|
||||
this.giacenza = giacenza;
|
||||
}
|
||||
|
||||
public float getQtaPrevistaVendita() {
|
||||
return qtaPrevistaVendita;
|
||||
}
|
||||
|
||||
public void setQtaPrevistaVendita(float qtaPrevistaVendita) {
|
||||
this.qtaPrevistaVendita = qtaPrevistaVendita;
|
||||
}
|
||||
|
||||
public float getQtaProposta() {
|
||||
return qtaProposta;
|
||||
}
|
||||
|
||||
public void setQtaProposta(float qtaProposta) {
|
||||
this.qtaProposta = qtaProposta;
|
||||
}
|
||||
|
||||
public boolean isNewNoPromo() {
|
||||
return newNoPromo;
|
||||
}
|
||||
|
||||
public void setNewNoPromo(boolean newNoPromo) {
|
||||
this.newNoPromo = newNoPromo;
|
||||
}
|
||||
|
||||
public ArticoloOrdine convertToArticoloOrdine(Ordine ordine) {
|
||||
ArticoloOrdine articolo = new ArticoloOrdine();
|
||||
|
||||
@@ -160,6 +217,12 @@ public class ArticoloGriglia {
|
||||
articolo.setUntMis(this.getUntMis());
|
||||
articolo.setDescrizione(this.getDescrizione());
|
||||
articolo.setDataIns(UtilityDate.getDateInstance());
|
||||
articolo.setGgScadenza(this.getGgScadenza());
|
||||
articolo.setGiacenza(BigDecimal.valueOf(this.getGiacenza()));
|
||||
articolo.setQtaPrevistaVendita(BigDecimal.valueOf(this.getQtaPrevistaVendita()));
|
||||
articolo.setQtaProposta(BigDecimal.valueOf(this.getQtaProposta()));
|
||||
articolo.setNewNoPromo(this.isNewNoPromo());
|
||||
|
||||
articolo.setQtaOrd(0);
|
||||
|
||||
return articolo;
|
||||
|
||||
@@ -3,9 +3,12 @@ package it.integry.integrywmsnative.core.data_store.db.entity;
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.ForeignKey;
|
||||
import androidx.room.Ignore;
|
||||
import androidx.room.Index;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity(
|
||||
@@ -26,7 +29,7 @@ import java.util.Date;
|
||||
public class ArticoloOrdine {
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
@ColumnInfo(name = "articolo_ordine_id")
|
||||
private int articoloOrdineId;
|
||||
private Integer articoloOrdineId;
|
||||
|
||||
@ColumnInfo(name = "cod_mart")
|
||||
private String codMart;
|
||||
@@ -64,11 +67,27 @@ public class ArticoloOrdine {
|
||||
@ColumnInfo(name = "data_ins")
|
||||
private Date dataIns;
|
||||
|
||||
public int getArticoloOrdineId() {
|
||||
@ColumnInfo(name = "new_no_promo")
|
||||
private boolean newNoPromo;
|
||||
|
||||
@Ignore
|
||||
private int ggScadenza = 0;
|
||||
|
||||
@Ignore
|
||||
private BigDecimal giacenza = BigDecimal.ZERO;
|
||||
|
||||
@Ignore
|
||||
private BigDecimal qtaPrevistaVendita = BigDecimal.ZERO;
|
||||
|
||||
@Ignore
|
||||
private BigDecimal qtaProposta = BigDecimal.ZERO;
|
||||
|
||||
|
||||
public Integer getArticoloOrdineId() {
|
||||
return articoloOrdineId;
|
||||
}
|
||||
|
||||
public void setArticoloOrdineId(int articoloOrdineId) {
|
||||
public void setArticoloOrdineId(Integer articoloOrdineId) {
|
||||
this.articoloOrdineId = articoloOrdineId;
|
||||
}
|
||||
|
||||
@@ -167,4 +186,64 @@ public class ArticoloOrdine {
|
||||
public void setDataIns(Date dataIns) {
|
||||
this.dataIns = dataIns;
|
||||
}
|
||||
|
||||
public int getGgScadenza() {
|
||||
return ggScadenza;
|
||||
}
|
||||
|
||||
public ArticoloOrdine setGgScadenza(int ggScadenza) {
|
||||
this.ggScadenza = ggScadenza;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getGiacenza() {
|
||||
return giacenza;
|
||||
}
|
||||
|
||||
public ArticoloOrdine setGiacenza(BigDecimal giacenza) {
|
||||
this.giacenza = giacenza;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaPrevistaVendita() {
|
||||
return qtaPrevistaVendita;
|
||||
}
|
||||
|
||||
public ArticoloOrdine setQtaPrevistaVendita(BigDecimal qtaPrevistaVendita) {
|
||||
this.qtaPrevistaVendita = qtaPrevistaVendita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaProposta() {
|
||||
return qtaProposta;
|
||||
}
|
||||
|
||||
public ArticoloOrdine setQtaProposta(BigDecimal qtaProposta) {
|
||||
this.qtaProposta = qtaProposta;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnfPrevistaVendita() {
|
||||
return qtaPrevistaVendita.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaPrevistaVendita.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnfProposta() {
|
||||
return qtaProposta.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaProposta.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnfGiacenza() {
|
||||
return giacenza.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : giacenza.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
}
|
||||
|
||||
public boolean isNewNoPromo() {
|
||||
return newNoPromo;
|
||||
}
|
||||
|
||||
public void setNewNoPromo(boolean newNoPromo) {
|
||||
this.newNoPromo = newNoPromo;
|
||||
}
|
||||
|
||||
public float getCnfDaRic() {
|
||||
return qtaCnf > 0.f ? merceDaRic / qtaCnf : 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,438 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.entity;
|
||||
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.ForeignKey;
|
||||
import androidx.room.Index;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity(
|
||||
tableName = "mtb_colr",
|
||||
indices = {
|
||||
@Index(value = {"data_collo", "ser_collo", "num_collo", "gestione","riga"}, unique = true),
|
||||
@Index(value = {"id_collo"})
|
||||
},
|
||||
foreignKeys = {
|
||||
@ForeignKey(
|
||||
entity = SqlMtbColt.class,
|
||||
parentColumns = "id",
|
||||
childColumns = "id_collo",
|
||||
onDelete = ForeignKey.CASCADE
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
public class SqlMtbColr {
|
||||
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
@ColumnInfo(name = "id")
|
||||
private int id;
|
||||
|
||||
@ColumnInfo(name = "id_collo")
|
||||
private int idCollo;
|
||||
|
||||
|
||||
@ColumnInfo(name = "data_collo")
|
||||
private Date dataCollo;
|
||||
|
||||
@ColumnInfo(name = "gestione")
|
||||
private String gestione;
|
||||
|
||||
@ColumnInfo(name = "ser_collo")
|
||||
private String serCollo;
|
||||
|
||||
@ColumnInfo(name = "descrizione")
|
||||
private String descrizione;
|
||||
|
||||
@ColumnInfo(name = "num_collo")
|
||||
private Integer numCollo;
|
||||
|
||||
|
||||
@ColumnInfo(name = "riga")
|
||||
private Integer riga;
|
||||
|
||||
@ColumnInfo(name = "riga_ord")
|
||||
private Integer rigaOrd;
|
||||
|
||||
@ColumnInfo(name = "cod_mart")
|
||||
private String codMart;
|
||||
|
||||
@ColumnInfo(name = "cod_barre")
|
||||
private String codBarre;
|
||||
|
||||
@ColumnInfo(name = "cod_col")
|
||||
private String codCol;
|
||||
|
||||
@ColumnInfo(name = "cod_tagl")
|
||||
private String codTagl;
|
||||
|
||||
@ColumnInfo(name = "partita_mag")
|
||||
private String partitaMag;
|
||||
|
||||
@ColumnInfo(name = "gestione_rif")
|
||||
private String gestioneRif;
|
||||
|
||||
@ColumnInfo(name = "ser_collo_rif")
|
||||
private String serColloRif;
|
||||
|
||||
@ColumnInfo(name = "note")
|
||||
private String note;
|
||||
|
||||
@ColumnInfo(name = "data_ord")
|
||||
private Date dataOrd;
|
||||
|
||||
@ColumnInfo(name = "data_collo_rif")
|
||||
private Date dataColloRif;
|
||||
|
||||
@ColumnInfo(name = "qta_cnf")
|
||||
private Float qtaCnf;
|
||||
|
||||
@ColumnInfo(name = "qta_col")
|
||||
private Float qtaCol;
|
||||
|
||||
@ColumnInfo(name = "num_ord")
|
||||
private Integer numOrd;
|
||||
|
||||
@ColumnInfo(name = "num_etich")
|
||||
private Integer numEtich;
|
||||
|
||||
@ColumnInfo(name = "num_collo_rif")
|
||||
private Integer numColloRif;
|
||||
|
||||
@ColumnInfo(name = "datetime_row")
|
||||
private Date datetimeRow;
|
||||
|
||||
@ColumnInfo(name = "cod_jcom")
|
||||
private String codJcom;
|
||||
|
||||
@ColumnInfo(name = "num_cnf")
|
||||
private Float numCnf;
|
||||
|
||||
@ColumnInfo(name = "causale")
|
||||
private String causale;
|
||||
|
||||
@ColumnInfo(name = "utente")
|
||||
private String utente;
|
||||
|
||||
@ColumnInfo(name = "cod_anag_doc")
|
||||
private String codAnagDoc;
|
||||
|
||||
@ColumnInfo(name = "cod_dtip_doc")
|
||||
private String codDtipDoc;
|
||||
|
||||
@ColumnInfo(name = "data_doc")
|
||||
private Date dataDoc;
|
||||
|
||||
@ColumnInfo(name = "ser_doc")
|
||||
private String serDoc;
|
||||
|
||||
@ColumnInfo(name = "num_doc")
|
||||
private Integer numDoc;
|
||||
|
||||
@ColumnInfo(name = "id_riga_doc")
|
||||
private Integer idRigaDoc;
|
||||
|
||||
@ColumnInfo(name = "unt_mis")
|
||||
private String untMis;
|
||||
@ColumnInfo(name = "data_scad")
|
||||
private Date dataScad;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getIdCollo() {
|
||||
return idCollo;
|
||||
}
|
||||
|
||||
public void setIdCollo(int idCollo) {
|
||||
this.idCollo = idCollo;
|
||||
}
|
||||
|
||||
public Date getDataCollo() {
|
||||
return dataCollo;
|
||||
}
|
||||
|
||||
public void setDataCollo(Date dataCollo) {
|
||||
this.dataCollo = dataCollo;
|
||||
}
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
|
||||
public void setGestione(String gestione) {
|
||||
this.gestione = gestione;
|
||||
}
|
||||
|
||||
public String getSerCollo() {
|
||||
return serCollo;
|
||||
}
|
||||
|
||||
public void setSerCollo(String serCollo) {
|
||||
this.serCollo = serCollo;
|
||||
}
|
||||
|
||||
public Integer getNumCollo() {
|
||||
return numCollo;
|
||||
}
|
||||
|
||||
public void setNumCollo(Integer numCollo) {
|
||||
this.numCollo = numCollo;
|
||||
}
|
||||
|
||||
public Integer getRiga() {
|
||||
return riga;
|
||||
}
|
||||
|
||||
public void setRiga(Integer riga) {
|
||||
this.riga = riga;
|
||||
}
|
||||
|
||||
public Integer getRigaOrd() {
|
||||
return rigaOrd;
|
||||
}
|
||||
|
||||
public void setRigaOrd(Integer rigaOrd) {
|
||||
this.rigaOrd = rigaOrd;
|
||||
}
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public void setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
}
|
||||
|
||||
public String getCodBarre() {
|
||||
return codBarre;
|
||||
}
|
||||
|
||||
public void setCodBarre(String codBarre) {
|
||||
this.codBarre = codBarre;
|
||||
}
|
||||
|
||||
public String getCodCol() {
|
||||
return codCol;
|
||||
}
|
||||
|
||||
public void setCodCol(String codCol) {
|
||||
this.codCol = codCol;
|
||||
}
|
||||
|
||||
public String getCodTagl() {
|
||||
return codTagl;
|
||||
}
|
||||
|
||||
public void setCodTagl(String codTagl) {
|
||||
this.codTagl = codTagl;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public void setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
}
|
||||
|
||||
public String getGestioneRif() {
|
||||
return gestioneRif;
|
||||
}
|
||||
|
||||
public void setGestioneRif(String gestioneRif) {
|
||||
this.gestioneRif = gestioneRif;
|
||||
}
|
||||
|
||||
public String getSerColloRif() {
|
||||
return serColloRif;
|
||||
}
|
||||
|
||||
public void setSerColloRif(String serColloRif) {
|
||||
this.serColloRif = serColloRif;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
public Date getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public void setDataOrd(Date dataOrd) {
|
||||
this.dataOrd = dataOrd;
|
||||
}
|
||||
|
||||
public Date getDataColloRif() {
|
||||
return dataColloRif;
|
||||
}
|
||||
|
||||
public void setDataColloRif(Date dataColloRif) {
|
||||
this.dataColloRif = dataColloRif;
|
||||
}
|
||||
|
||||
public Float getQtaCnf() {
|
||||
return qtaCnf;
|
||||
}
|
||||
|
||||
public void setQtaCnf(Float qtaCnf) {
|
||||
this.qtaCnf = qtaCnf;
|
||||
}
|
||||
|
||||
public Float getQtaCol() {
|
||||
return qtaCol;
|
||||
}
|
||||
|
||||
public void setQtaCol(Float qtaCol) {
|
||||
this.qtaCol = qtaCol;
|
||||
}
|
||||
|
||||
public Integer getNumOrd() {
|
||||
return numOrd;
|
||||
}
|
||||
|
||||
public void setNumOrd(Integer numOrd) {
|
||||
this.numOrd = numOrd;
|
||||
}
|
||||
|
||||
public Integer getNumEtich() {
|
||||
return numEtich;
|
||||
}
|
||||
|
||||
public void setNumEtich(Integer numEtich) {
|
||||
this.numEtich = numEtich;
|
||||
}
|
||||
|
||||
public Integer getNumColloRif() {
|
||||
return numColloRif;
|
||||
}
|
||||
|
||||
public void setNumColloRif(Integer numColloRif) {
|
||||
this.numColloRif = numColloRif;
|
||||
}
|
||||
|
||||
public Date getDatetimeRow() {
|
||||
return datetimeRow;
|
||||
}
|
||||
|
||||
public void setDatetimeRow(Date datetimeRow) {
|
||||
this.datetimeRow = datetimeRow;
|
||||
}
|
||||
|
||||
public String getCodJcom() {
|
||||
return codJcom;
|
||||
}
|
||||
|
||||
public void setCodJcom(String codJcom) {
|
||||
this.codJcom = codJcom;
|
||||
}
|
||||
|
||||
public Float getNumCnf() {
|
||||
return numCnf;
|
||||
}
|
||||
|
||||
public void setNumCnf(Float numCnf) {
|
||||
this.numCnf = numCnf;
|
||||
}
|
||||
|
||||
public String getCausale() {
|
||||
return causale;
|
||||
}
|
||||
|
||||
public void setCausale(String causale) {
|
||||
this.causale = causale;
|
||||
}
|
||||
|
||||
public String getUtente() {
|
||||
return utente;
|
||||
}
|
||||
|
||||
public void setUtente(String utente) {
|
||||
this.utente = utente;
|
||||
}
|
||||
|
||||
public String getCodAnagDoc() {
|
||||
return codAnagDoc;
|
||||
}
|
||||
|
||||
public void setCodAnagDoc(String codAnagDoc) {
|
||||
this.codAnagDoc = codAnagDoc;
|
||||
}
|
||||
|
||||
public String getCodDtipDoc() {
|
||||
return codDtipDoc;
|
||||
}
|
||||
|
||||
public void setCodDtipDoc(String codDtipDoc) {
|
||||
this.codDtipDoc = codDtipDoc;
|
||||
}
|
||||
|
||||
public Date getDataDoc() {
|
||||
return dataDoc;
|
||||
}
|
||||
|
||||
public void setDataDoc(Date dataDoc) {
|
||||
this.dataDoc = dataDoc;
|
||||
}
|
||||
|
||||
public String getSerDoc() {
|
||||
return serDoc;
|
||||
}
|
||||
|
||||
public void setSerDoc(String serDoc) {
|
||||
this.serDoc = serDoc;
|
||||
}
|
||||
|
||||
public Integer getNumDoc() {
|
||||
return numDoc;
|
||||
}
|
||||
|
||||
public void setNumDoc(Integer numDoc) {
|
||||
this.numDoc = numDoc;
|
||||
}
|
||||
|
||||
public Integer getIdRigaDoc() {
|
||||
return idRigaDoc;
|
||||
}
|
||||
|
||||
public void setIdRigaDoc(Integer idRigaDoc) {
|
||||
this.idRigaDoc = idRigaDoc;
|
||||
}
|
||||
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
public void setUntMis(String untMis) {
|
||||
this.untMis = untMis;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public void setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
}
|
||||
|
||||
public Date getDataScad() {
|
||||
return dataScad;
|
||||
}
|
||||
|
||||
public void setDataScad(Date dataScad) {
|
||||
this.dataScad = dataScad;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,341 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.entity;
|
||||
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.Ignore;
|
||||
import androidx.room.Index;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Entity(
|
||||
tableName = "mtb_colt",
|
||||
indices = {
|
||||
@Index(value = {"data_collo", "ser_collo", "num_collo", "gestione"}, unique = true)
|
||||
}
|
||||
)
|
||||
|
||||
public class SqlMtbColt {
|
||||
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
@ColumnInfo(name = "id")
|
||||
private int id;
|
||||
|
||||
@ColumnInfo(name = "username")
|
||||
private String username;
|
||||
|
||||
@ColumnInfo
|
||||
private String gestione;
|
||||
|
||||
@ColumnInfo(name = "data_collo")
|
||||
private Date dataCollo;
|
||||
|
||||
@ColumnInfo(name = "ser_collo")
|
||||
private String serCollo;
|
||||
|
||||
@ColumnInfo(name = "num_collo")
|
||||
private Integer numCollo;
|
||||
|
||||
@ColumnInfo(name = "rif_ord")
|
||||
private String rifOrd;
|
||||
|
||||
@ColumnInfo(name = "cod_anag")
|
||||
private String codAnag;
|
||||
|
||||
@ColumnInfo(name = "cod_vdes")
|
||||
private String codVdes;
|
||||
|
||||
@ColumnInfo(name = "cod_mdep")
|
||||
private String codMdep;
|
||||
|
||||
@ColumnInfo(name = "cod_vlis")
|
||||
private String codVlis;
|
||||
|
||||
@ColumnInfo(name = "cod_dtip")
|
||||
private String codDtip;
|
||||
|
||||
@ColumnInfo(name = "cod_tcol")
|
||||
private String codTcol;
|
||||
|
||||
@ColumnInfo(name = "ser_doc")
|
||||
private String serDoc;
|
||||
|
||||
@ColumnInfo(name = "annotazioni")
|
||||
private String annotazioni;
|
||||
|
||||
@ColumnInfo(name = "posizione")
|
||||
private String posizione;
|
||||
|
||||
@ColumnInfo(name = "cod_dtip_provv")
|
||||
private String codDtipProvv;
|
||||
|
||||
@ColumnInfo(name = "ser_doc_provv")
|
||||
private String serDocProvv;
|
||||
|
||||
@ColumnInfo(name = "cod_jfas")
|
||||
private String codJfas;
|
||||
|
||||
@ColumnInfo(name = "data_ord")
|
||||
private Date dataOrd;
|
||||
|
||||
@ColumnInfo(name = "data_doc")
|
||||
private Date dataDoc;
|
||||
|
||||
@ColumnInfo(name = "data_doc_provv")
|
||||
private Date dataDocProvv;
|
||||
|
||||
@ColumnInfo(name = "cod_mgrp")
|
||||
private String codMgrp;
|
||||
|
||||
@ColumnInfo(name = "data_vers")
|
||||
private Date dataVers;
|
||||
|
||||
@ColumnInfo(name = "segno")
|
||||
private Integer segno;
|
||||
|
||||
@ColumnInfo(name = "num_ord")
|
||||
private Integer numOrd;
|
||||
|
||||
@ColumnInfo(name = "num_doc")
|
||||
private Integer numDoc;
|
||||
|
||||
@ColumnInfo(name = "num_doc_provv")
|
||||
private Integer numDocProvv;
|
||||
|
||||
@Ignore
|
||||
private List<SqlMtbColr> sqlMtbColrs = new ArrayList<>();
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
|
||||
public void setGestione(String gestione) {
|
||||
this.gestione = gestione;
|
||||
}
|
||||
|
||||
public Date getDataCollo() {
|
||||
return dataCollo;
|
||||
}
|
||||
|
||||
public void setDataCollo(Date dataCollo) {
|
||||
this.dataCollo = dataCollo;
|
||||
}
|
||||
|
||||
public String getSerCollo() {
|
||||
return serCollo;
|
||||
}
|
||||
|
||||
public void setSerCollo(String serCollo) {
|
||||
this.serCollo = serCollo;
|
||||
}
|
||||
|
||||
public Integer getNumCollo() {
|
||||
return numCollo;
|
||||
}
|
||||
|
||||
public void setNumCollo(Integer numCollo) {
|
||||
this.numCollo = numCollo;
|
||||
}
|
||||
|
||||
public String getRifOrd() {
|
||||
return rifOrd;
|
||||
}
|
||||
|
||||
public void setRifOrd(String rifOrd) {
|
||||
this.rifOrd = rifOrd;
|
||||
}
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public void setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
}
|
||||
|
||||
public String getCodVdes() {
|
||||
return codVdes;
|
||||
}
|
||||
|
||||
public void setCodVdes(String codVdes) {
|
||||
this.codVdes = codVdes;
|
||||
}
|
||||
|
||||
public String getCodMdep() {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public void setCodMdep(String codMdep) {
|
||||
this.codMdep = codMdep;
|
||||
}
|
||||
|
||||
public String getCodVlis() {
|
||||
return codVlis;
|
||||
}
|
||||
|
||||
public void setCodVlis(String codVlis) {
|
||||
this.codVlis = codVlis;
|
||||
}
|
||||
|
||||
public String getCodDtip() {
|
||||
return codDtip;
|
||||
}
|
||||
|
||||
public void setCodDtip(String codDtip) {
|
||||
this.codDtip = codDtip;
|
||||
}
|
||||
|
||||
public String getCodTcol() {
|
||||
return codTcol;
|
||||
}
|
||||
|
||||
public void setCodTcol(String codTcol) {
|
||||
this.codTcol = codTcol;
|
||||
}
|
||||
|
||||
public String getSerDoc() {
|
||||
return serDoc;
|
||||
}
|
||||
|
||||
public void setSerDoc(String serDoc) {
|
||||
this.serDoc = serDoc;
|
||||
}
|
||||
|
||||
public String getAnnotazioni() {
|
||||
return annotazioni;
|
||||
}
|
||||
|
||||
public void setAnnotazioni(String annotazioni) {
|
||||
this.annotazioni = annotazioni;
|
||||
}
|
||||
|
||||
public String getPosizione() {
|
||||
return posizione;
|
||||
}
|
||||
|
||||
public void setPosizione(String posizione) {
|
||||
this.posizione = posizione;
|
||||
}
|
||||
|
||||
public String getCodDtipProvv() {
|
||||
return codDtipProvv;
|
||||
}
|
||||
|
||||
public void setCodDtipProvv(String codDtipProvv) {
|
||||
this.codDtipProvv = codDtipProvv;
|
||||
}
|
||||
|
||||
public String getSerDocProvv() {
|
||||
return serDocProvv;
|
||||
}
|
||||
|
||||
public void setSerDocProvv(String serDocProvv) {
|
||||
this.serDocProvv = serDocProvv;
|
||||
}
|
||||
|
||||
public String getCodJfas() {
|
||||
return codJfas;
|
||||
}
|
||||
|
||||
public void setCodJfas(String codJfas) {
|
||||
this.codJfas = codJfas;
|
||||
}
|
||||
|
||||
public Date getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public void setDataOrd(Date dataOrd) {
|
||||
this.dataOrd = dataOrd;
|
||||
}
|
||||
|
||||
public Date getDataDoc() {
|
||||
return dataDoc;
|
||||
}
|
||||
|
||||
public void setDataDoc(Date dataDoc) {
|
||||
this.dataDoc = dataDoc;
|
||||
}
|
||||
|
||||
public Date getDataDocProvv() {
|
||||
return dataDocProvv;
|
||||
}
|
||||
|
||||
public void setDataDocProvv(Date dataDocProvv) {
|
||||
this.dataDocProvv = dataDocProvv;
|
||||
}
|
||||
|
||||
public Date getDataVers() {
|
||||
return dataVers;
|
||||
}
|
||||
|
||||
public void setDataVers(Date dataVers) {
|
||||
this.dataVers = dataVers;
|
||||
}
|
||||
|
||||
public Integer getSegno() {
|
||||
return segno;
|
||||
}
|
||||
|
||||
public void setSegno(Integer segno) {
|
||||
this.segno = segno;
|
||||
}
|
||||
|
||||
public Integer getNumOrd() {
|
||||
return numOrd;
|
||||
}
|
||||
|
||||
public void setNumOrd(Integer numOrd) {
|
||||
this.numOrd = numOrd;
|
||||
}
|
||||
|
||||
public Integer getNumDoc() {
|
||||
return numDoc;
|
||||
}
|
||||
|
||||
public void setNumDoc(Integer numDoc) {
|
||||
this.numDoc = numDoc;
|
||||
}
|
||||
|
||||
public Integer getNumDocProvv() {
|
||||
return numDocProvv;
|
||||
}
|
||||
|
||||
public void setNumDocProvv(Integer numDocProvv) {
|
||||
this.numDocProvv = numDocProvv;
|
||||
}
|
||||
|
||||
public List<SqlMtbColr> getSqlMtbColrs() {
|
||||
return sqlMtbColrs;
|
||||
}
|
||||
|
||||
public void setSqlMtbColrs(List<SqlMtbColr> sqlMtbColrs) {
|
||||
this.sqlMtbColrs = sqlMtbColrs;
|
||||
}
|
||||
|
||||
public String getCodMgrp() {
|
||||
return codMgrp;
|
||||
}
|
||||
|
||||
public void setCodMgrp(String codMgrp) {
|
||||
this.codMgrp = codMgrp;
|
||||
}
|
||||
}
|
||||
@@ -16,4 +16,6 @@ public interface ArticoloGrigliaRepository {
|
||||
|
||||
void findArticoloByScanAndGriglia(String scan, int idGriglia, RunnableArgs<ArticoloGriglia> onSuccess, RunnableArgs<Exception> onFail);
|
||||
|
||||
void findNewArticoliInGrigla(int idGriglia, RunnableArgs<List<ArticoloGriglia>> onSuccess, RunnableArgs<Exception> onFail);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public interface MtbColrRepository {
|
||||
|
||||
void selectAll(RunnableArgs<List<SqlMtbColr>> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void insert(SqlMtbColr mtbColr, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void update(SqlMtbColr mtbColr, RunnableArgs<SqlMtbColr> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void delete(SqlMtbColr mtbColr, Runnable onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void getDocumentRows(SqlMtbColt sqlMtbColt, RunnableArgs<List<SqlMtbColr>> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.view_model.OrdineWithGriglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
|
||||
import it.integry.integrywmsnative.core.data_store.db.wrappers.OrdineWrapper;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public interface MtbColtRepository {
|
||||
|
||||
void selectAll(RunnableArgs<List<SqlMtbColt>> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void insert(SqlMtbColt mtbColt, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void update(SqlMtbColt mtbColt, RunnableArgs<SqlMtbColt> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void delete(SqlMtbColt mtbColt, Runnable onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void getLocalDocumentsByCodDtip(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc, RunnableArgs<List<DocInternoWrapper>> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void getNextNumCollo(RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
}
|
||||
@@ -5,7 +5,14 @@ import com.annimon.stream.Stream;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -24,27 +31,21 @@ public class ArticoliGrigliaDataSource extends Repository implements ArticoloGri
|
||||
this.mArticoloGrigliaDao = articoloGrigliaDao;
|
||||
}
|
||||
|
||||
public void saveArticoliToGriglia(List<ArticoloGriglia> articoli, Griglia griglia, Runnable onSuccess, RunnableArgs<Exception> onFail) {
|
||||
public void saveArticoliToGriglia(List<ArticoloGriglia> updatedArts, Griglia griglia, Runnable onSuccess, RunnableArgs<Exception> onFail) {
|
||||
execute(() -> {
|
||||
try {
|
||||
List<ArticoloGriglia> toUpdate = new ArrayList<>();
|
||||
List<ArticoloGriglia> toInsert = new ArrayList<>();
|
||||
List<String> codMarts = new ArrayList<>();
|
||||
for (ArticoloGriglia art : articoli) {
|
||||
Integer id = mArticoloGrigliaDao.getIdArticoloByGrigliaAndBarcodeAndCodMart(griglia.getGrigliaId(), art.getBarCode(), art.getCodMart());
|
||||
codMarts.add(art.getCodMart());
|
||||
if (id != null) {
|
||||
art.setArticoloGrigliaId(id);
|
||||
toUpdate.add(art);
|
||||
} else {
|
||||
toInsert.add(art);
|
||||
}
|
||||
}
|
||||
var tmp = calcItemsToInsertAndUpdate(updatedArts);
|
||||
var toInsert = (List<ArticoloGriglia>) tmp.get("toInsert");
|
||||
var toUpdate = (List<ArticoloGriglia>) tmp.get("toUpdate");
|
||||
var codMarts = (List<String>) tmp.get("codMarts");
|
||||
|
||||
mArticoloGrigliaDao.insertAll(toInsert);
|
||||
mArticoloGrigliaDao.updateAll(toUpdate);
|
||||
|
||||
List<ArticoloGriglia> articoliGriglia = mArticoloGrigliaDao.getArticoliFromGriglia(griglia.getGrigliaId());
|
||||
List<ArticoloGriglia> toDelete = Stream.of(articoliGriglia).filter(articolo -> !codMarts.contains(articolo.getCodMart())).toList();
|
||||
mArticoloGrigliaDao.deleteList(toDelete);
|
||||
|
||||
onSuccess.run();
|
||||
} catch (Exception e) {
|
||||
onFail.run(e);
|
||||
@@ -52,6 +53,52 @@ public class ArticoliGrigliaDataSource extends Repository implements ArticoloGri
|
||||
});
|
||||
}
|
||||
|
||||
private HashMap<String, Object> calcItemsToInsertAndUpdate(List<ArticoloGriglia> updatedArts) throws InterruptedException, ExecutionException {
|
||||
var toInsert = new ArrayList<ArticoloGriglia>();
|
||||
var toUpdate = new ArrayList<ArticoloGriglia>();
|
||||
var codMarts = new ArrayList<String>();
|
||||
|
||||
int cores = Runtime.getRuntime().availableProcessors();
|
||||
ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(cores);
|
||||
List<Callable<ArticoloGriglia>> calls = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < updatedArts.size(); i++) {
|
||||
int finalI = i;
|
||||
Callable<ArticoloGriglia> callableTask = () -> {
|
||||
var updatedArt = updatedArts.get(finalI);
|
||||
Integer id = mArticoloGrigliaDao.getIdArticoloByGrigliaAndBarcodeAndCodMart(updatedArt.getIdGriglia(), updatedArt.getBarCode(), updatedArt.getCodMart());
|
||||
|
||||
if (id != null) {
|
||||
updatedArt.setArticoloGrigliaId(id);
|
||||
}
|
||||
|
||||
return updatedArt;
|
||||
};
|
||||
|
||||
calls.add(callableTask);
|
||||
}
|
||||
|
||||
List<Future<ArticoloGriglia>> futures = executor.invokeAll(calls, Long.MAX_VALUE, TimeUnit.MILLISECONDS);
|
||||
|
||||
for (Future<ArticoloGriglia> future : futures) {
|
||||
if (future.isDone()) {
|
||||
codMarts.add(future.get().getCodMart());
|
||||
if (future.get().getArticoloGrigliaId() == null) toInsert.add(future.get());
|
||||
else toUpdate.add(future.get());
|
||||
} else {
|
||||
future.cancel(true);
|
||||
}
|
||||
}
|
||||
|
||||
var tmp = new HashMap<String, Object>();
|
||||
|
||||
tmp.put("toInsert", toInsert);
|
||||
tmp.put("toUpdate", toUpdate);
|
||||
tmp.put("codMarts", codMarts);
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public void findArticoloByBarcodeAndGriglia(String barcode, int idGriglia, RunnableArgs<ArticoloGriglia> onSuccess, RunnableArgs<Exception> onFail) {
|
||||
execute(() -> {
|
||||
try {
|
||||
@@ -89,4 +136,14 @@ public class ArticoliGrigliaDataSource extends Repository implements ArticoloGri
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void findNewArticoliInGrigla(int idGriglia, RunnableArgs<List<ArticoloGriglia>> onSuccess, RunnableArgs<Exception> onFail) {
|
||||
execute(() -> {
|
||||
try {
|
||||
onSuccess.run(mArticoloGrigliaDao.getNewArticoliInGriglia(idGriglia));
|
||||
} catch (Exception e) {
|
||||
onFail.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,13 +28,15 @@ public class ArticoliOrdineDataSource extends Repository implements ArticoliOrdi
|
||||
List<ArticoloOrdine> toUpdate = new ArrayList<>();
|
||||
List<ArticoloOrdine> toInsert = new ArrayList<>();
|
||||
for (ArticoloOrdine art : articoli) {
|
||||
if (art.getArticoloOrdineId() > 0) {
|
||||
if (art.getArticoloOrdineId() != null && art.getArticoloOrdineId() > 0) {
|
||||
toUpdate.add(art);
|
||||
} else {
|
||||
toInsert.add(art);
|
||||
}
|
||||
}
|
||||
mArticoloOrdineDao.insertAll(toInsert);
|
||||
for (ArticoloOrdine newArt : toInsert) {
|
||||
mArticoloOrdineDao.insert(newArt);
|
||||
}
|
||||
mArticoloOrdineDao.updateAll(toUpdate);
|
||||
onSuccess.run();
|
||||
|
||||
@@ -48,7 +50,7 @@ public class ArticoliOrdineDataSource extends Repository implements ArticoliOrdi
|
||||
public void saveArticoloToOrdine(ArticoloOrdine articolo, Runnable onSuccess, RunnableArgs<Exception> onFail) {
|
||||
execute(() -> {
|
||||
try {
|
||||
if (articolo.getArticoloOrdineId() > 0) {
|
||||
if (articolo.getArticoloOrdineId() != null && articolo.getArticoloOrdineId() > 0) {
|
||||
mArticoloOrdineDao.update(articolo);
|
||||
} else {
|
||||
mArticoloOrdineDao.insert(articolo);
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.implementations;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColrRepository;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class SqlMtbColrDataSource extends Repository implements MtbColrRepository {
|
||||
|
||||
private MtbColrDao mMtbColrDao;
|
||||
|
||||
@Inject
|
||||
public SqlMtbColrDataSource(MtbColrDao mtbColrDao) {
|
||||
this.mMtbColrDao = mtbColrDao;
|
||||
}
|
||||
|
||||
public void selectAll(RunnableArgs<List<SqlMtbColr>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mMtbColrDao.getAll());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
|
||||
public void insert(SqlMtbColr mtbColr, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
Long id = mMtbColrDao.insert(mtbColr);
|
||||
onSuccess.run(id.intValue());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void update(SqlMtbColr mtbColr, RunnableArgs<SqlMtbColr> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
mMtbColrDao.update(mtbColr);
|
||||
onSuccess.run(mtbColr);
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void delete(SqlMtbColr mtbColr, Runnable onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
mMtbColrDao.delete(mtbColr);
|
||||
onSuccess.run();
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getDocumentRows(SqlMtbColt document, RunnableArgs<List<SqlMtbColr>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mMtbColrDao.getDocumentRows(document.getId()));
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository.implementations;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
||||
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;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class SqlMtbColtDataSource extends Repository implements MtbColtRepository {
|
||||
|
||||
private MtbColtDao mMtbColtDao;
|
||||
|
||||
@Inject
|
||||
public SqlMtbColtDataSource(MtbColtDao mtbColtDao) {
|
||||
this.mMtbColtDao = mtbColtDao;
|
||||
}
|
||||
|
||||
public void selectAll(RunnableArgs<List<SqlMtbColt>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mMtbColtDao.getAll());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
|
||||
public void insert(SqlMtbColt mtbColt, RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
Long id = mMtbColtDao.insert(mtbColt);
|
||||
onSuccess.run(id.intValue());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void update(SqlMtbColt mtbColt, RunnableArgs<SqlMtbColt> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
mMtbColtDao.update(mtbColt);
|
||||
onSuccess.run(mtbColt);
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void delete(SqlMtbColt mtbColt, Runnable onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> {
|
||||
try {
|
||||
mMtbColtDao.delete(mtbColt);
|
||||
onSuccess.run();
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getLocalDocumentsByCodDtip(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc, RunnableArgs<List<DocInternoWrapper>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mMtbColtDao.getLocalDocumentsByCodDtip(codDtip,codAnag,codVdes,dataDoc,numDoc));
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getNextNumCollo(RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError) {
|
||||
Runnable query = () -> {
|
||||
try {
|
||||
onSuccess.run(mMtbColtDao.getNextNumCollo());
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
};
|
||||
execute(query);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -4,31 +4,23 @@ import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
||||
|
||||
public class ArticoloDTO {
|
||||
|
||||
private String codMart;
|
||||
public String codMart;
|
||||
public String descrizione;
|
||||
public String untMis;
|
||||
public float qtaCnf;
|
||||
public String barcode;
|
||||
public float merceDaRic;
|
||||
public float mediaSett;
|
||||
public String flagQtaMultipla;
|
||||
public String flagTracciabilita;
|
||||
public float qtaMinOrdinabile;
|
||||
public boolean newNoPromo;
|
||||
private int ggScadenza;
|
||||
private float giacenza;
|
||||
private float qtaPrevistaVendita;
|
||||
private float qtaProposta;
|
||||
|
||||
|
||||
private String descrizione;
|
||||
|
||||
|
||||
private String untMis;
|
||||
|
||||
|
||||
private float qtaCnf;
|
||||
|
||||
|
||||
private String barcode;
|
||||
|
||||
|
||||
private float merceDaRic;
|
||||
|
||||
|
||||
private float mediaSett;
|
||||
|
||||
|
||||
private String flagQtaMultipla;
|
||||
|
||||
private float qtaMinOrdinabile;
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
@@ -101,6 +93,63 @@ public class ArticoloDTO {
|
||||
this.qtaMinOrdinabile = qtaMinOrdinabile;
|
||||
}
|
||||
|
||||
public String getBarcode() {
|
||||
return barcode;
|
||||
}
|
||||
|
||||
public void setBarcode(String barcode) {
|
||||
this.barcode = barcode;
|
||||
}
|
||||
|
||||
public int getGgScadenza() {
|
||||
return ggScadenza;
|
||||
}
|
||||
|
||||
public void setGgScadenza(int ggScadenza) {
|
||||
this.ggScadenza = ggScadenza;
|
||||
}
|
||||
|
||||
public float getGiacenza() {
|
||||
return giacenza;
|
||||
}
|
||||
|
||||
public void setGiacenza(float giacenza) {
|
||||
this.giacenza = giacenza;
|
||||
}
|
||||
|
||||
public float getQtaPrevistaVendita() {
|
||||
return qtaPrevistaVendita;
|
||||
}
|
||||
|
||||
public void setQtaPrevistaVendita(float qtaPrevistaVendita) {
|
||||
this.qtaPrevistaVendita = qtaPrevistaVendita;
|
||||
}
|
||||
|
||||
public float getQtaProposta() {
|
||||
return qtaProposta;
|
||||
}
|
||||
|
||||
public void setQtaProposta(float qtaProposta) {
|
||||
this.qtaProposta = qtaProposta;
|
||||
}
|
||||
|
||||
public String getFlagTracciabilita() {
|
||||
return flagTracciabilita;
|
||||
}
|
||||
|
||||
public ArticoloDTO setFlagTracciabilita(String flagTracciabilita) {
|
||||
this.flagTracciabilita = flagTracciabilita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isNewNoPromo() {
|
||||
return newNoPromo;
|
||||
}
|
||||
|
||||
public ArticoloDTO setNewNoPromo(boolean newNoPromo) {
|
||||
this.newNoPromo = newNoPromo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArticoloGriglia toArticoloGriglia() {
|
||||
ArticoloGriglia result = new ArticoloGriglia();
|
||||
@@ -113,6 +162,11 @@ public class ArticoloDTO {
|
||||
result.setMediaSett(this.getMediaSett());
|
||||
result.setFlagQtaMultipla(this.getFlagQtaMultipla());
|
||||
result.setQtaMinOrdinabile(this.getQtaMinOrdinabile());
|
||||
result.setGgScadenza(this.ggScadenza);
|
||||
result.setNewNoPromo(this.newNoPromo);
|
||||
result.setGiacenza(this.giacenza);
|
||||
result.setQtaPrevistaVendita(this.qtaPrevistaVendita);
|
||||
result.setQtaProposta(this.qtaProposta);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.wrappers;
|
||||
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Embedded;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
|
||||
public class DocInternoWrapper {
|
||||
@Embedded
|
||||
private SqlMtbColt document;
|
||||
|
||||
@ColumnInfo(name = "countArticoli")
|
||||
private int countArticoli = 0;
|
||||
|
||||
public SqlMtbColt getDocument() {
|
||||
return document;
|
||||
}
|
||||
|
||||
public void setDocument(SqlMtbColt document) {
|
||||
this.document = document;
|
||||
}
|
||||
|
||||
public int getCountArticoli() {
|
||||
return countArticoli;
|
||||
}
|
||||
|
||||
public void setCountArticoli(int countArticoli) {
|
||||
this.countArticoli = countArticoli;
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import androidx.databinding.PropertyChangeRegistry;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class BindableBigDecimal implements Observable {
|
||||
|
||||
BigDecimal mValue;
|
||||
@@ -102,9 +104,24 @@ public class BindableBigDecimal implements Observable {
|
||||
}
|
||||
|
||||
public void set(BigDecimal value, boolean forceRefresh) {
|
||||
if (!mValue.equals(value) || forceRefresh) {
|
||||
if ((mValue == null) || !mValue.equals(value) || forceRefresh) {
|
||||
this.mValue = value;
|
||||
notifyChange();
|
||||
}
|
||||
}
|
||||
|
||||
public static void registerListener(BindableBigDecimal bindableBigDecimal, RunnableArgs<BigDecimal> onValueChanged) {
|
||||
bindableBigDecimal.addOnPropertyChangedCallback(new OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
if(onValueChanged != null) onValueChanged.run(bindableBigDecimal.get());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void resetListeners(BindableBigDecimal bindableBigDecimal){
|
||||
BigDecimal oldValue = bindableBigDecimal.get();
|
||||
bindableBigDecimal = new BindableBigDecimal();
|
||||
bindableBigDecimal.set(oldValue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,5 +104,9 @@ public class BindableBoolean implements Observable {
|
||||
notifyChange();
|
||||
}
|
||||
}
|
||||
|
||||
public void toggle() {
|
||||
set(!get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package it.integry.integrywmsnative.core.di;
|
||||
|
||||
import androidx.databinding.BaseObservable;
|
||||
import androidx.databinding.Observable;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class BindableInteger extends BaseObservable {
|
||||
Integer mValue;
|
||||
@@ -34,4 +37,19 @@ public class BindableInteger extends BaseObservable {
|
||||
return mValue == null;
|
||||
}
|
||||
|
||||
public static void registerListener(BindableInteger bindableInteger, RunnableArgs<Integer> onValueChanged) {
|
||||
bindableInteger.addOnPropertyChangedCallback(new OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
if(onValueChanged != null) onValueChanged.run(bindableInteger.get());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void resetListeners(BindableInteger bindableInteger){
|
||||
Integer oldValue = bindableInteger.get();
|
||||
bindableInteger = new BindableInteger();
|
||||
bindableInteger.set(oldValue);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,20 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public class BindableString extends BaseObservable {
|
||||
String value;
|
||||
private boolean isHtml = false;
|
||||
|
||||
public BindableString(){};
|
||||
public BindableString(boolean isHtml){
|
||||
this.isHtml = isHtml;
|
||||
};
|
||||
public BindableString(String startingValue ,boolean isHtml){
|
||||
this.isHtml = isHtml;
|
||||
this.set(startingValue);
|
||||
};
|
||||
|
||||
public boolean isHtml() {
|
||||
return isHtml;
|
||||
}
|
||||
|
||||
public String get() {
|
||||
return value != null ? value : "";
|
||||
|
||||
@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.di;
|
||||
|
||||
import android.app.DatePickerDialog;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
@@ -75,7 +76,8 @@ public class Converters {
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
if(bindableInteger != null) bindableInteger.set(Integer.parseInt(s.toString()));
|
||||
if (bindableInteger != null)
|
||||
bindableInteger.set(Integer.parseInt(s.toString()));
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(bindableInteger, watcher));
|
||||
@@ -126,8 +128,9 @@ public class Converters {
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
String newValue = bindableString.get();
|
||||
boolean isHtml = bindableString.isHtml();
|
||||
if (!view.getText().toString().equals(newValue)) {
|
||||
view.setText(newValue);
|
||||
view.setText(isHtml ? Html.fromHtml(newValue) : newValue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +211,8 @@ 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());
|
||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||
value = new BigDecimal(s.toString());
|
||||
observableBigDecimal.set(value);
|
||||
}
|
||||
};
|
||||
@@ -223,6 +227,60 @@ public class Converters {
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindTextInputEditTextBigDecimal(TextInputEditText view, final BindableBigDecimal bindableBigDecimal) {
|
||||
Pair<BindableBigDecimal, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != bindableBigDecimal) {
|
||||
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;
|
||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||
value = new BigDecimal(s.toString());
|
||||
bindableBigDecimal.set(value);
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(bindableBigDecimal, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
BigDecimal newValue = bindableBigDecimal.get();
|
||||
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
|
||||
|
||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||
view.setText(UtilityNumber.decimalToString(newValue));
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindTextInputEditTextInteger(TextInputEditText view, final BindableInteger bindableInteger) {
|
||||
Pair<BindableInteger, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
if (pair == null || pair.first != bindableInteger) {
|
||||
if (pair != null) {
|
||||
view.removeTextChangedListener(pair.second);
|
||||
}
|
||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
Integer value = null;
|
||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||
value = Integer.valueOf(s.toString());
|
||||
bindableInteger.set(value);
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(bindableInteger, watcher));
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
Integer newValue = bindableInteger.get();
|
||||
Integer viewValue = view.getText().toString().trim().length() > 0 ? Integer.valueOf(view.getText().toString()) : Integer.valueOf(0);
|
||||
|
||||
if (!(viewValue.compareTo(newValue) == 0)) {
|
||||
view.setText(newValue.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@BindingAdapter("binding")
|
||||
public static void bindTextInputEditTextString(TextInputEditText view, final ObservableField<String> observableString) {
|
||||
Pair<ObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||
@@ -367,8 +425,9 @@ public class Converters {
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
String newValue = bindableString.get();
|
||||
boolean isHtml = bindableString.isHtml();
|
||||
if (!view.getText().toString().equals(newValue)) {
|
||||
view.setText(newValue);
|
||||
view.setText(isHtml ? Html.fromHtml(newValue) : newValue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -477,7 +536,7 @@ public class Converters {
|
||||
|
||||
|
||||
@BindingAdapter("visibility")
|
||||
public static void bindView(View view, final ObservableField<Boolean> bindableBoolean) {
|
||||
public static void bindViewVisibility(View view, final ObservableField<Boolean> bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
}
|
||||
@@ -492,6 +551,44 @@ public class Converters {
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter("visibility")
|
||||
public static void bindViewVisibility(View view, boolean bool) {
|
||||
view.setVisibility(bool ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter({"reverse_visibility"})
|
||||
public static void bindViewReverseVisibility(View view, final BindableBoolean bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
}
|
||||
bindableBoolean.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
view.setVisibility(bindableBoolean.get() ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
view.setVisibility(bindableBoolean.get() ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter("reverse_visibility")
|
||||
public static void bindViewReverseVisibility(View view, final ObservableField<Boolean> bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
}
|
||||
bindableBoolean.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
view.setVisibility(bindableBoolean.get() ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
view.setVisibility(bindableBoolean.get() ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter("android:layout_weight")
|
||||
public static void setLayoutWeight(View view, final Float weight) {
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public final class NoResultFromBarcodeException extends Exception {
|
||||
public NoResultFromBarcodeException() {
|
||||
super(UtilityResources.getString(R.string.no_result_from_barcode));
|
||||
public NoResultFromBarcodeException(String barcode) {
|
||||
super(UtilityResources.getString(R.string.no_result_from_barcode) + " (" + barcode + ")");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,39 @@
|
||||
package it.integry.integrywmsnative.core.expansion;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||
|
||||
public class BaseActivity extends AppCompatActivity {
|
||||
|
||||
@Inject
|
||||
public DialogProgressView mCurrentProgress;
|
||||
|
||||
protected Dialog mCurrentProgress;
|
||||
private boolean progressOpened;
|
||||
|
||||
public BaseActivity() {
|
||||
//Thread.setDefaultUncaughtExceptionHandler(new MyExceptionHandler(this, BaseActivity.class));
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@Nullable View parent, @NonNull String name, @NonNull Context context, @NonNull AttributeSet attrs) {
|
||||
var v = super.onCreateView(parent, name, context, attrs);
|
||||
|
||||
MainApplication.appComponent
|
||||
.baseActivityComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -40,37 +58,38 @@ public class BaseActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
protected void openProgress() {
|
||||
runOnUiThread(() -> {
|
||||
BarcodeManager.disable();
|
||||
if (this.mCurrentProgress == null) {
|
||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(this);
|
||||
}
|
||||
if (!progressOpened) {
|
||||
this.progressOpened = true;
|
||||
runOnUiThread(() -> {
|
||||
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected void closeProgress() {
|
||||
runOnUiThread(() -> {
|
||||
BarcodeManager.enable();
|
||||
if (mCurrentProgress != null) {
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
runOnUiThread(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
mCurrentProgress = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void onLoadingStarted() {
|
||||
new Thread(() -> {
|
||||
// new Thread(() -> {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
}).start();
|
||||
// }).start();
|
||||
}
|
||||
|
||||
public void onLoadingEnded() {
|
||||
new Thread(() -> {
|
||||
// new Thread(() -> {
|
||||
this.closeProgress();
|
||||
BarcodeManager.enable();
|
||||
}).start();
|
||||
// }).start();
|
||||
}
|
||||
|
||||
public void onError(Exception ex) {
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package it.integry.integrywmsnative.core.expansion;
|
||||
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface BaseActivityComponent {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
BaseActivityComponent create();
|
||||
}
|
||||
|
||||
void inject(BaseActivity baseActivity);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.expansion;
|
||||
|
||||
import dagger.Module;
|
||||
|
||||
@Module(subcomponents = BaseActivityComponent.class)
|
||||
public class BaseActivityModule {
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package it.integry.integrywmsnative.core.expansion;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
@@ -15,11 +14,12 @@ import androidx.fragment.app.FragmentTransaction;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||
|
||||
public class BaseDialogFragment extends DialogFragment {
|
||||
|
||||
private boolean mBarcodeListener = false;
|
||||
private Dialog mCurrentProgress;
|
||||
private DialogProgressView mCurrentProgress;
|
||||
|
||||
public BaseDialogFragment() {
|
||||
super();
|
||||
@@ -82,7 +82,7 @@ public class BaseDialogFragment extends DialogFragment {
|
||||
// new Thread(() -> {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
if (this.mCurrentProgress == null) {
|
||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(requireActivity());
|
||||
}
|
||||
});
|
||||
// }).start();
|
||||
|
||||
@@ -1,59 +1,70 @@
|
||||
package it.integry.integrywmsnative.core.expansion;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.interfaces.IPoppableActivity;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||
|
||||
public abstract class BaseFragment extends Fragment {
|
||||
|
||||
protected Dialog mCurrentProgress;
|
||||
@Inject
|
||||
public DialogProgressView mCurrentProgress;
|
||||
|
||||
protected ElevatedToolbar mToolbar;
|
||||
|
||||
protected final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||
|
||||
|
||||
private boolean progressOpened;
|
||||
|
||||
|
||||
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
||||
mToolbar = toolbar;
|
||||
}
|
||||
|
||||
|
||||
public void addOnPreDestroy(Runnable onPreDestroy) {
|
||||
this.mOnPreDestroyList.add(onPreDestroy);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View view = super.onCreateView(inflater, container, savedInstanceState);
|
||||
|
||||
MainApplication.appComponent
|
||||
.baseFragmentComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
public void onLoadingStarted() {
|
||||
new Thread(() -> {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
}).start();
|
||||
}
|
||||
|
||||
public void onLoadingEnded() {
|
||||
new Thread(() -> {
|
||||
this.closeProgress();
|
||||
BarcodeManager.enable();
|
||||
}).start();
|
||||
}
|
||||
|
||||
public void onError(Exception ex) {
|
||||
this.getActivity().runOnUiThread(() -> {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.closeProgress();
|
||||
UtilityExceptions.defaultException(getActivity(), ex, mCurrentProgress);
|
||||
BarcodeManager.enable();
|
||||
@@ -71,23 +82,26 @@ public abstract class BaseFragment extends Fragment {
|
||||
}
|
||||
|
||||
protected void openProgress() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (this.mCurrentProgress == null) {
|
||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
||||
}
|
||||
if (!progressOpened) {
|
||||
this.progressOpened = true;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected void closeProgress() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (mCurrentProgress != null) {
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
mCurrentProgress = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected void popMe() {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
((IPoppableActivity) requireActivity()).pop();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package it.integry.integrywmsnative.core.expansion;
|
||||
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface BaseFragmentComponent {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
BaseFragmentComponent create();
|
||||
}
|
||||
|
||||
void inject(BaseFragment baseFragment);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.expansion;
|
||||
|
||||
import dagger.Module;
|
||||
|
||||
@Module(subcomponents = BaseFragmentComponent.class)
|
||||
public class BaseFragmentModule {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package it.integry.integrywmsnative.core.expansion;
|
||||
|
||||
import androidx.databinding.Observable;
|
||||
|
||||
public abstract class OnGeneralChangedCallback extends Observable.OnPropertyChangedCallback implements Runnable{
|
||||
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
run();
|
||||
}
|
||||
|
||||
// public abstract void run();
|
||||
|
||||
}
|
||||
@@ -1,28 +1,28 @@
|
||||
package it.integry.integrywmsnative.core.expansion;
|
||||
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.databinding.ObservableList;
|
||||
import androidx.databinding.ObservableList.OnListChangedCallback;
|
||||
|
||||
public abstract class OnListGeneralChangedCallback extends ObservableList.OnListChangedCallback {
|
||||
public abstract class OnListGeneralChangedCallback<T> extends OnListChangedCallback<ObservableList<T>> {
|
||||
|
||||
|
||||
@Override
|
||||
public void onItemRangeChanged(ObservableList sender, int positionStart, int itemCount) {
|
||||
public void onItemRangeChanged(ObservableList<T> sender, int positionStart, int itemCount) {
|
||||
onChanged(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeInserted(ObservableList sender, int positionStart, int itemCount) {
|
||||
public void onItemRangeInserted(ObservableList<T> sender, int positionStart, int itemCount) {
|
||||
onChanged(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeMoved(ObservableList sender, int fromPosition, int toPosition, int itemCount) {
|
||||
public void onItemRangeMoved(ObservableList<T> sender, int fromPosition, int toPosition, int itemCount) {
|
||||
onChanged(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeRemoved(ObservableList sender, int positionStart, int itemCount) {
|
||||
public void onItemRangeRemoved(ObservableList<T> sender, int positionStart, int itemCount) {
|
||||
onChanged(sender);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package it.integry.integrywmsnative.core.interfaces;
|
||||
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
|
||||
public interface ISearcableFragment extends SearchView.OnQueryTextListener, IDestroyableFragment {
|
||||
public interface ISearchableFragment extends SearchView.OnQueryTextListener, IDestroyableFragment {
|
||||
|
||||
void onSearchEnabled();
|
||||
|
||||
@@ -73,4 +73,9 @@ public class MenuService {
|
||||
}
|
||||
}
|
||||
|
||||
public void invalidateCache() {
|
||||
this.mInternalCachedMenu = null;
|
||||
this.mInternalCachedFlatMenu = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -106,6 +106,9 @@ public class DtbOrdt extends EntityBase {
|
||||
private String noteConferma;
|
||||
private String codJflav;
|
||||
|
||||
public DtbOrdt() {
|
||||
this.type = "dtb_ordt";
|
||||
}
|
||||
|
||||
public String getDataOrd() {
|
||||
return dataOrd;
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
public class JtbComt extends EntityBase {
|
||||
|
||||
private String codJcom;
|
||||
private String codJfas;
|
||||
private String codJflav;
|
||||
private String descrizione;
|
||||
|
||||
public JtbComt() {
|
||||
this.type = "jtb_comt";
|
||||
}
|
||||
|
||||
public String getCodJcom() {
|
||||
return codJcom;
|
||||
}
|
||||
|
||||
public JtbComt setCodJcom(String codJcom) {
|
||||
this.codJcom = codJcom;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJfas() {
|
||||
return codJfas;
|
||||
}
|
||||
|
||||
public JtbComt setCodJfas(String codJfas) {
|
||||
this.codJfas = codJfas;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJflav() {
|
||||
return codJflav;
|
||||
}
|
||||
|
||||
public JtbComt setCodJflav(String codJflav) {
|
||||
this.codJflav = codJflav;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public JtbComt setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,6 @@ public class MtbColr extends EntityBase {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public MtbColr setGestione(GestioneEnum gestione) {
|
||||
this.gestione = gestione.getText();
|
||||
return this;
|
||||
@@ -124,6 +123,11 @@ public class MtbColr extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbColr setDataCollo(Date dataCollo) {
|
||||
setDataCollo(UtilityDate.formatDate(dataCollo, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Integer getRiga() {
|
||||
return riga;
|
||||
@@ -301,8 +305,6 @@ public class MtbColr extends EntityBase {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public String getDatetimeRowS() {
|
||||
return datetimeRow;
|
||||
}
|
||||
@@ -322,11 +324,6 @@ public class MtbColr extends EntityBase {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getCodJcom() {
|
||||
return codJcom;
|
||||
}
|
||||
@@ -364,11 +361,6 @@ public class MtbColr extends EntityBase {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public String getDataScadPartitaS() {
|
||||
return dataScadPartita;
|
||||
}
|
||||
@@ -398,7 +390,6 @@ public class MtbColr extends EntityBase {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class MtbCols extends EntityBase {
|
||||
type = "mtb_cols";
|
||||
setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep());
|
||||
setModificatoDa(SettingsManager.i().getUser().getFullname());
|
||||
setDataMove(UtilityDate.getDateInstance());
|
||||
//setDataMove(UtilityDate.getDateInstance());
|
||||
}
|
||||
|
||||
public String getDataCollo() {
|
||||
|
||||
@@ -57,6 +57,7 @@ public class MtbColt extends EntityBase {
|
||||
private String codJcom;
|
||||
|
||||
private List<MtbCols> mtbCols;
|
||||
private MtbTCol mtbTCol;
|
||||
|
||||
private Boolean disablePrint;
|
||||
private String ragSocCliente;
|
||||
@@ -83,7 +84,6 @@ public class MtbColt extends EntityBase {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private ObservableArrayList<MtbColr> mtbColr = new ObservableArrayList<>();
|
||||
|
||||
public ObservableArrayList<MtbColr> getMtbColr() {
|
||||
@@ -526,6 +526,15 @@ public class MtbColt extends EntityBase {
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbTCol getMtbTCol() {
|
||||
return mtbTCol;
|
||||
}
|
||||
|
||||
public MtbColt setMtbTCol(MtbTCol mtbTCol) {
|
||||
this.mtbTCol = mtbTCol;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void generaFiltroOrdineFromDTO(List<FiltroOrdineDTO> filtroOrdineDtos) {
|
||||
|
||||
String xmlPrefix = "{\"whereCond\": \"";
|
||||
@@ -540,13 +549,13 @@ public class MtbColt extends EntityBase {
|
||||
|
||||
try {
|
||||
whereCond.append("(");
|
||||
whereCond.append(String.format("dtb_ordt.gestione = %s AND dtb_ordt.data_ord = %s and dtb_ordt.num_ord = %s",
|
||||
whereCond.append(String.format("d.g = %s AND d.d = %s and d.n = %s",
|
||||
UtilityDB.valueToString(x.getGestioneOrd()),
|
||||
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH)),
|
||||
UtilityDB.valueToString(x.getNumOrd())));
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(x.getDataConsS())) {
|
||||
whereCond.append(String.format(" AND dtb_ordr.data_cons = %s",
|
||||
whereCond.append(String.format(" AND dr.dc = %s",
|
||||
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH))));
|
||||
}
|
||||
|
||||
@@ -554,8 +563,6 @@ public class MtbColt extends EntityBase {
|
||||
if (i < filtroOrdineDtos.size() - 1) {
|
||||
whereCond.append(" OR ");
|
||||
}
|
||||
|
||||
//whereCond.append("<DTB_ORDT COND=\"OR\"><GESTIONE type=\"V\">" + x.getGestioneOrd() + "</GESTIONE><DATA_ORD type=\"D\">" + UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH) + "</DATA_ORD><NUM_ORD type=\"N\">" + x.getNumOrd() + "</NUM_ORD></DTB_ORDT>");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -36,12 +36,12 @@ public class MtbDepo extends EntityBase implements Parcelable {
|
||||
private String flagTipoNegozio;
|
||||
private String codMdepReso;
|
||||
|
||||
|
||||
public MtbDepo() {
|
||||
type = "mtb_depo";
|
||||
}
|
||||
|
||||
protected MtbDepo(Parcel in) {
|
||||
type = "mtb_depo";
|
||||
codMdep = in.readString();
|
||||
descrizione = in.readString();
|
||||
flagVal = in.readString();
|
||||
@@ -357,4 +357,19 @@ public class MtbDepo extends EntityBase implements Parcelable {
|
||||
this.codMdepReso = codMdepReso;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
MtbDepo mtbDepo = (MtbDepo) o;
|
||||
|
||||
return getCodMdep().equals(mtbDepo.getCodMdep());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return getCodMdep().hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
public class MtbGrup extends EntityBase {
|
||||
|
||||
private String codMgrp;
|
||||
private String descrizione;
|
||||
private String flagValMag;
|
||||
private String logoWeb;
|
||||
private String criterioVal;
|
||||
private String tipoMgrp;
|
||||
|
||||
public MtbGrup() {
|
||||
this.type = "mtb_grup";
|
||||
}
|
||||
|
||||
public String getCodMgrp() {
|
||||
return codMgrp;
|
||||
}
|
||||
|
||||
public MtbGrup setCodMgrp(String codMgrp) {
|
||||
this.codMgrp = codMgrp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public MtbGrup setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagValMag() {
|
||||
return flagValMag;
|
||||
}
|
||||
|
||||
public MtbGrup setFlagValMag(String flagValMag) {
|
||||
this.flagValMag = flagValMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getLogoWeb() {
|
||||
return logoWeb;
|
||||
}
|
||||
|
||||
public MtbGrup setLogoWeb(String logoWeb) {
|
||||
this.logoWeb = logoWeb;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCriterioVal() {
|
||||
return criterioVal;
|
||||
}
|
||||
|
||||
public MtbGrup setCriterioVal(String criterioVal) {
|
||||
this.criterioVal = criterioVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTipoMgrp() {
|
||||
return tipoMgrp;
|
||||
}
|
||||
|
||||
public MtbGrup setTipoMgrp(String tipoMgrp) {
|
||||
this.tipoMgrp = tipoMgrp;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,273 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Created by ValerioC on 06/03/2018.
|
||||
*/
|
||||
|
||||
public class MvwSitArtUdcDetInventario {
|
||||
|
||||
private String gestione;
|
||||
private Date dataCollo;
|
||||
private String serCollo;
|
||||
private Integer numCollo;
|
||||
private Integer segno;
|
||||
private String codMdep;
|
||||
private String posizione;
|
||||
private Integer priorita;
|
||||
private String codGruppo;
|
||||
private String gruppo;
|
||||
private String codSgruppo;
|
||||
private String sottogruppo;
|
||||
private String codMart;
|
||||
private String diacod;
|
||||
private String descrizioneEstesa;
|
||||
private String partitaMag;
|
||||
private String codJcom;
|
||||
private String commessa;
|
||||
private String untMis;
|
||||
private BigDecimal qtaCol;
|
||||
private BigDecimal numCnf;
|
||||
private BigDecimal qtaCnf;
|
||||
private BigDecimal pesoNettoKg;
|
||||
private BigDecimal pesoLordoKg;
|
||||
private String codJfas;
|
||||
private MtbAart mtbAart;
|
||||
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setGestione(String gestione) {
|
||||
this.gestione = gestione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataCollo() {
|
||||
return dataCollo;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setDataCollo(Date dataCollo) {
|
||||
this.dataCollo = dataCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSerCollo() {
|
||||
return serCollo;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setSerCollo(String serCollo) {
|
||||
this.serCollo = serCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumCollo() {
|
||||
return numCollo;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setNumCollo(Integer numCollo) {
|
||||
this.numCollo = numCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getSegno() {
|
||||
return segno;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setSegno(Integer segno) {
|
||||
this.segno = segno;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMdep() {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setCodMdep(String codMdep) {
|
||||
this.codMdep = codMdep;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPosizione() {
|
||||
return posizione;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setPosizione(String posizione) {
|
||||
this.posizione = posizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getPriorita() {
|
||||
return priorita;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setPriorita(Integer priorita) {
|
||||
this.priorita = priorita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodGruppo() {
|
||||
return codGruppo;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setCodGruppo(String codGruppo) {
|
||||
this.codGruppo = codGruppo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGruppo() {
|
||||
return gruppo;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setGruppo(String gruppo) {
|
||||
this.gruppo = gruppo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodSgruppo() {
|
||||
return codSgruppo;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setCodSgruppo(String codSgruppo) {
|
||||
this.codSgruppo = codSgruppo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSottogruppo() {
|
||||
return sottogruppo;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setSottogruppo(String sottogruppo) {
|
||||
this.sottogruppo = sottogruppo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDiacod() {
|
||||
return diacod;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setDiacod(String diacod) {
|
||||
this.diacod = diacod;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizioneEstesa() {
|
||||
return descrizioneEstesa;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setDescrizioneEstesa(String descrizioneEstesa) {
|
||||
this.descrizioneEstesa = descrizioneEstesa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJcom() {
|
||||
return codJcom;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setCodJcom(String codJcom) {
|
||||
this.codJcom = codJcom;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCommessa() {
|
||||
return commessa;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setCommessa(String commessa) {
|
||||
this.commessa = commessa;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setUntMis(String untMis) {
|
||||
this.untMis = untMis;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCol() {
|
||||
return qtaCol;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setQtaCol(BigDecimal qtaCol) {
|
||||
this.qtaCol = qtaCol;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getNumCnf() {
|
||||
return numCnf;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setNumCnf(BigDecimal numCnf) {
|
||||
this.numCnf = numCnf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnf() {
|
||||
return qtaCnf;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setQtaCnf(BigDecimal qtaCnf) {
|
||||
this.qtaCnf = qtaCnf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getPesoNettoKg() {
|
||||
return pesoNettoKg;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setPesoNettoKg(BigDecimal pesoNettoKg) {
|
||||
this.pesoNettoKg = pesoNettoKg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getPesoLordoKg() {
|
||||
return pesoLordoKg;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setPesoLordoKg(BigDecimal pesoLordoKg) {
|
||||
this.pesoLordoKg = pesoLordoKg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJfas() {
|
||||
return codJfas;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setCodJfas(String codJfas) {
|
||||
this.codJfas = codJfas;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbAart getMtbAart() {
|
||||
return mtbAart;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setMtbAart(MtbAart mtbAart) {
|
||||
this.mtbAart = mtbAart;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.rest;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
@@ -50,6 +51,7 @@ public class RESTBuilder {
|
||||
|
||||
Gson gson = new GsonBuilder()
|
||||
.setDateFormat("dd/MM/yyyy HH:mm:ss")
|
||||
.excludeFieldsWithModifiers(Modifier.TRANSIENT)
|
||||
.create();
|
||||
|
||||
Retrofit retrofit = new Retrofit.Builder()
|
||||
|
||||
@@ -2,15 +2,21 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import com.annimon.stream.Collectors;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
@@ -18,6 +24,11 @@ import retrofit2.Response;
|
||||
@Singleton
|
||||
public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final SystemRESTConsumer systemRESTConsumer;
|
||||
|
||||
public ArticoloRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
this.systemRESTConsumer = systemRESTConsumer;
|
||||
}
|
||||
|
||||
public void getByBarcodeProd(String barcodeProd, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
@@ -86,4 +97,22 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void getArtsGroups(List<String> groupsToFind, RunnableArgs<List<MtbGrup>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
var whereCondMap = Stream.of(groupsToFind)
|
||||
.map(x -> {
|
||||
HashMap<String, Object> vars = new HashMap<>();
|
||||
vars.put("cod_mgrp", x);
|
||||
return vars;
|
||||
})
|
||||
.toList();
|
||||
|
||||
var whereCond = whereCondMap.isEmpty() ? "" : " WHERE " + UtilityQuery.concatFieldListInWhereCond(whereCondMap);
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbGrup>>() {
|
||||
}.getType();
|
||||
this.systemRESTConsumer.processSql("SELECT * FROM mtb_grup " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
@@ -32,6 +33,7 @@ import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
@@ -153,7 +155,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
mtbColrClone
|
||||
.setNumCollo(null)
|
||||
.setDataCollo(null)
|
||||
.setDataCollo((String) null)
|
||||
.setRiga(null)
|
||||
.setGestione(GestioneEnum.LAVORAZIONE)
|
||||
|
||||
@@ -207,7 +209,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
MtbColr mtbColrClone = new MtbColr();
|
||||
mtbColrClone
|
||||
.setNumCollo(null)
|
||||
.setDataCollo(null)
|
||||
.setDataCollo((String) null)
|
||||
.setRiga(null)
|
||||
.setGestione(GestioneEnum.LAVORAZIONE)
|
||||
.setDataColloRif(sourceMtbColt.getDataColloD())
|
||||
@@ -237,7 +239,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
saveCollo(newMtbColt, onComplete, onFailed);
|
||||
}
|
||||
|
||||
|
||||
public void createColloFromEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
createColloFromEtichettaAnonima(barcodeScanDTO.getStringValue(), gestione, onComplete, onFailed);
|
||||
}
|
||||
@@ -397,7 +398,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
|
||||
private void cyclicGetMultipleByTestate(@NotNull Iterator<MtbColt> sourceMtbColts, boolean onlyResiduo, ArrayList<MtbColt> resultMtbColt, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||
if (sourceMtbColts.hasNext()) {
|
||||
getByTestata(sourceMtbColts.next(), onlyResiduo, false, mtbColt -> {
|
||||
@@ -447,7 +447,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void changePosizione(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
String codMdep = posizione.getCodMdep();
|
||||
@@ -543,7 +542,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
|
||||
public static void retrieveBasketColli(RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService.getColliInBasket(SettingsManager.i().getUserSession().getDepo().getCodMdep()).enqueue(new Callback<ServiceRESTResponse<List<MtbColt>>>() {
|
||||
@@ -620,7 +618,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void assegnaLottoSuColloScarico(MtbColt sourceMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
MtbColt sourceMtbColtClone = (MtbColt) sourceMtbColt.clone();
|
||||
|
||||
@@ -646,4 +643,57 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
public void versamentoAutomaticoUL(MtbColt sourceMtbColt, RunnableArgs<VersamentoAutomaticoULResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
MtbColt sourceMtbColtClone = (MtbColt) sourceMtbColt.clone();
|
||||
|
||||
for (int i = 0; i < sourceMtbColtClone.getMtbColr().size(); i++) {
|
||||
sourceMtbColtClone.getMtbColr().get(i)
|
||||
.setMtbAart(null)
|
||||
.setMtbPartitaMag(null);
|
||||
}
|
||||
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService.versamentoAutomaticoUL(sourceMtbColtClone).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> call, Response<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> response) {
|
||||
analyzeAnswer(response, "versamentoAutomaticoUL", data -> {
|
||||
var result = response.body().getDto();
|
||||
|
||||
List<MtbColr> allMtbColr = new ArrayList<>();
|
||||
allMtbColr.addAll(result.getSuccess());
|
||||
allMtbColr.addAll(result.getFailed());
|
||||
|
||||
List<String> codMarts = Stream.of(allMtbColr)
|
||||
.map(x -> x.getCodMart().trim())
|
||||
.toList();
|
||||
|
||||
mArticoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
|
||||
for (var mtbColr : allMtbColr) {
|
||||
|
||||
MtbAart foundMtbAart = null;
|
||||
|
||||
Optional<MtbAart> mtbAartOpt = Stream.of(mtbAarts)
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart()))
|
||||
.findFirst();
|
||||
|
||||
if (mtbAartOpt.isPresent()) {
|
||||
foundMtbAart = mtbAartOpt.get();
|
||||
}
|
||||
|
||||
mtbColr.setMtbAart(foundMtbAart);
|
||||
}
|
||||
|
||||
onComplete.run(result);
|
||||
}, onFailed);
|
||||
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> call, Throwable t) {
|
||||
if (onFailed != null) onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
@@ -42,4 +43,7 @@ public interface ColliMagazzinoRESTConsumerService {
|
||||
@POST("wms/assegnaLottoSuColloScarico")
|
||||
Call<ServiceRESTResponse<MtbColt>> assegnaLottoSuColloScarico(@Body MtbColt mtbColt);
|
||||
|
||||
@POST("wms/versamentoAutomaticoUL")
|
||||
Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> versamentoAutomaticoUL(@Body MtbColt mtbColt);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.JtbComt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||
|
||||
@Singleton
|
||||
public class CommessaRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final SystemRESTConsumer systemRESTConsumer;
|
||||
|
||||
public CommessaRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
this.systemRESTConsumer = systemRESTConsumer;
|
||||
}
|
||||
|
||||
|
||||
public void getJtbComts(List<String> itemsToFind, RunnableArgs<List<JtbComt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
var whereCondMap = Stream.of(itemsToFind)
|
||||
.map(x -> {
|
||||
HashMap<String, Object> vars = new HashMap<>();
|
||||
vars.put("cod_jcom", x);
|
||||
return vars;
|
||||
})
|
||||
.toList();
|
||||
|
||||
var whereCond = " WHERE " + UtilityQuery.concatFieldListInWhereCond(whereCondMap);
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<JtbComt>>() {}.getType();
|
||||
this.systemRESTConsumer.processSql("SELECT * FROM jtb_comt " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
@@ -12,9 +16,17 @@ import it.integry.integrywmsnative.core.model.MtbDepo;
|
||||
public class DepositoRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final EntityRESTConsumer entityRESTConsumer;
|
||||
private final SystemRESTConsumer systemRESTConsumer;
|
||||
|
||||
public DepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer) {
|
||||
public DepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer, SystemRESTConsumer systemRESTConsumer) {
|
||||
this.entityRESTConsumer = entityRESTConsumer;
|
||||
this.systemRESTConsumer = systemRESTConsumer;
|
||||
}
|
||||
|
||||
public void getAll(RunnableArgs<List<MtbDepo>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbDepo>>() {
|
||||
}.getType();
|
||||
this.systemRESTConsumer.processSql("SELECT * FROM mtb_depo", typeOfObjectsList, onComplete, onFailed);
|
||||
}
|
||||
|
||||
public void getDepoByCodMdep(String codMdep, RunnableArgs<MtbDepo> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||
|
||||
@Singleton
|
||||
public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||
|
||||
public GiacenzaRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||
|
||||
}
|
||||
|
||||
public void getGiacenzeInPosizione(MtbDepoPosizione posizione, RunnableArgs<List<MvwSitArtUdcDetInventario>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
params.put("posizione", posizione.getPosizione());
|
||||
String whereCond = UtilityQuery.concatFieldsInWhereCond(params);
|
||||
String query = "SELECT * from mvw_sitart_udc_det_inventario" +
|
||||
" WHERE " + whereCond;
|
||||
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MvwSitArtUdcDetInventario>>() {
|
||||
}.getType();
|
||||
this.mSystemRESTConsumer.<ArrayList<MvwSitArtUdcDetInventario>>processSql(query, typeOfObjectsList, inventarioList -> {
|
||||
List<String> codMarts = Stream.of(inventarioList)
|
||||
.map(x -> x.getCodMart().trim())
|
||||
.toList();
|
||||
|
||||
mArticoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
|
||||
for (var row : inventarioList) {
|
||||
|
||||
MtbAart foundMtbAart = null;
|
||||
Optional<MtbAart> mtbAartOpt = Stream.of(mtbAarts)
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(row.getCodMart()))
|
||||
.findFirst();
|
||||
|
||||
if (mtbAartOpt.isPresent()) {
|
||||
foundMtbAart = mtbAartOpt.get();
|
||||
}
|
||||
|
||||
row.setMtbAart(foundMtbAart);
|
||||
}
|
||||
|
||||
onComplete.run(inventarioList);
|
||||
}, onFailed);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
public interface GiacenzaRESTConsumerService {
|
||||
}
|
||||
@@ -125,7 +125,7 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
||||
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class);
|
||||
|
||||
service.getOrdiniInevasi(codMdep, gestione.getText())
|
||||
.enqueue(new Callback<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>>() {
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> call, Response<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> response) {
|
||||
analyzeAnswer(response, "getOrdiniInevasi", responseDtoList -> {
|
||||
@@ -145,7 +145,7 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
public void retrieveListaArticoliFromOrdiniUscita(List<OrdineUscitaInevasoDTO> orders, RunnableArgs<List<SitArtOrdDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public void retrieveListaArticoliFromOrdiniUscita(String codMdep, List<OrdineUscitaInevasoDTO> orders, RunnableArgs<List<SitArtOrdDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
List<GetPickingListDTO> getPickingListDTOs = Stream.of(orders)
|
||||
.map(x -> new GetPickingListDTO()
|
||||
.setData(x.getDataOrdS())
|
||||
@@ -157,7 +157,7 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
OrdiniRESTConsumerService service = RESTBuilder.getService(OrdiniRESTConsumerService.class, 90);
|
||||
|
||||
service.getArticoliFromOrdini(getPickingListDTOs).enqueue(new Callback<ServiceRESTResponse<List<SitArtOrdDTO>>>() {
|
||||
service.getArticoliFromOrdini(codMdep, getPickingListDTOs).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Response<ServiceRESTResponse<List<SitArtOrdDTO>>> response) {
|
||||
analyzeAnswer(response, "retrieveListaArticoliFromOrdiniUscita", onComplete, onFailed);
|
||||
|
||||
@@ -16,7 +16,7 @@ import retrofit2.http.Query;
|
||||
public interface OrdiniRESTConsumerService {
|
||||
|
||||
@POST("wms/getArticoliFromOrdini")
|
||||
Call<ServiceRESTResponse<List<SitArtOrdDTO>>> getArticoliFromOrdini(@Body List<GetPickingListDTO> pickingListDTO);
|
||||
Call<ServiceRESTResponse<List<SitArtOrdDTO>>> getArticoliFromOrdini(@Query("codMdep") String codMdep, @Body List<GetPickingListDTO> pickingListDTO);
|
||||
|
||||
@POST("wms/getSuggestedPickingList")
|
||||
Call<ServiceRESTResponse<List<PickingObjectDTO>>> getSuggestedPickingList(@Query("codMdep") String codMdep, @Body List<SitArtOrdDTO> sitArtOrdDTOList);
|
||||
|
||||
@@ -6,8 +6,11 @@ import com.annimon.stream.Stream;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||
@@ -27,37 +30,47 @@ import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
@Singleton
|
||||
public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
public static void getArticoliListino(String codAlis, RunnableArgs<GrigliaDTO> onSuccess, RunnableArgs<Exception> onFailed) {
|
||||
public void getArticoliListino(String codAlis, RunnableArgs<GrigliaDTO> onSuccess, RunnableArgs<Exception> onFailed) {
|
||||
getArticoliListinoStatic(codAlis, onSuccess, onFailed);
|
||||
}
|
||||
|
||||
public static void getArticoliListinoStatic(String codAlis, RunnableArgs<GrigliaDTO> onSuccess, RunnableArgs<Exception> onFailed) {
|
||||
PVOrdiniAcquistoRESTConsumerService ordiniARestService = RESTBuilder.getService(PVOrdiniAcquistoRESTConsumerService.class);
|
||||
ordiniARestService
|
||||
.getArticoliListino(codAlis)
|
||||
.enqueue(new Callback<ServiceRESTResponse<GrigliaDTO>>() {
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<GrigliaDTO>> call, Response<ServiceRESTResponse<GrigliaDTO>> response) {
|
||||
analyzeAnswer(response, "getArticoliListino", griglia -> {
|
||||
|
||||
UtilityThread.executeParallel(() -> {
|
||||
var startTime = new Date().getTime();
|
||||
|
||||
List<ArticoloDTO> listaArticoli = new ArrayList<>();
|
||||
|
||||
Stream.of(griglia.getGrigliaAcquistiChild())
|
||||
.map(ArticoloDTO::getCodMart)
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.forEach(art -> {
|
||||
List<ArticoloDTO> inList = Stream.of(griglia.getGrigliaAcquistiChild()).filter(x -> x.getCodMart().equalsIgnoreCase(art)).toList();
|
||||
if (inList.size() > 1) {
|
||||
for (ArticoloDTO articolo : inList) {
|
||||
.groupBy(ArticoloDTO::getCodMart)
|
||||
.forEach(entry -> {
|
||||
|
||||
if(entry.getValue().size() == 1) {
|
||||
listaArticoli.add(entry.getValue().get(0));
|
||||
} else {
|
||||
for (ArticoloDTO articolo : entry.getValue()) {
|
||||
if (!articolo.getBarCode().endsWith(articolo.getCodMart())) {
|
||||
listaArticoli.add(articolo);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
listaArticoli.add(inList.get(0));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
griglia.setGrigliaAcquistiChild(listaArticoli);
|
||||
|
||||
Log.d("LOADING TIME 1", "MS: " + (new Date().getTime() - startTime));
|
||||
onSuccess.run(griglia);
|
||||
}, false);
|
||||
}, onFailed);
|
||||
@@ -72,7 +85,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
public static void saveOrdine(Ordine ordine, List<ArticoloOrdine> articoli, Griglia griglia, RunnableArgs<Ordine> onSuccess, RunnableArgs<Exception> onFailed) {
|
||||
public void saveOrdine(Ordine ordine, List<ArticoloOrdine> articoli, Griglia griglia, RunnableArgs<Ordine> onSuccess, RunnableArgs<Exception> onFailed) {
|
||||
SaveDTO saveDTO = new SaveDTO();
|
||||
OrdineDTO ordineDTO = new OrdineDTO();
|
||||
List<ArtDTO> artRows = new ArrayList<>();
|
||||
@@ -126,7 +139,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
}
|
||||
|
||||
private static ArtDTO convertArtToDTO(ArticoloOrdine art, int rigaOrd) {
|
||||
private ArtDTO convertArtToDTO(ArticoloOrdine art, int rigaOrd) {
|
||||
ArtDTO dto = new ArtDTO();
|
||||
dto.setRigaOrd(rigaOrd);
|
||||
dto.setCodMart(art.getCodMart());
|
||||
|
||||
@@ -53,7 +53,7 @@ public class PosizioniRESTConsumer extends _BaseRESTConsumer{
|
||||
String codMdep = null;
|
||||
|
||||
PosizioniRESTConsumerService posizioniRESTConsumerService = RESTBuilder.getService(PosizioniRESTConsumerService.class);
|
||||
posizioniRESTConsumerService.getAvailablePosizioni(codMdep).enqueue(new Callback<ServiceRESTResponse<List<MtbDepoPosizione>>>() {
|
||||
posizioniRESTConsumerService.getAvailablePosizioni(codMdep).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<MtbDepoPosizione>>> call, Response<ServiceRESTResponse<List<MtbDepoPosizione>>> response) {
|
||||
analyzeAnswer(response, "getAvailablePosizioni", (m) -> {
|
||||
|
||||
@@ -11,12 +11,12 @@ import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.BuildConfig;
|
||||
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.JasperPairDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import retrofit2.Call;
|
||||
@@ -32,26 +32,6 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
public void getAvailablePrinters(String codMdep, final RunnableArgs<List<String>> onComplete, final RunnableArgs<Exception> onFailed) {
|
||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||
printerService.getAvailablePrinters(codMdep).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
||||
analyzeAnswer(response, "GetAvailablePrinters", printers -> {
|
||||
onComplete.run(printers != null ? Stream.of(printers).withoutNulls().toList() : null);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, Throwable t) {
|
||||
Log.e("GetAvailablePrinters", t.toString());
|
||||
UtilityLogger.errorMe(new Exception(t));
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void getAvailablePrinters(String codMdep, Type printerType, RunnableArgs<List<String>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
String printerTypeStr = printerType != null ? printerType.toString() : null;
|
||||
@@ -75,29 +55,21 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
public void printCollo(String printerName, MtbColt testataColloToPrint, int quantity, String reportName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public void printCollo(Type printerType, MtbColt testataColloToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
if (UtilityString.isNullOrEmpty(printerName)) {
|
||||
onFailed.run(new Exception("Nessuna stampante configurata: valore null"));
|
||||
return;
|
||||
}
|
||||
// if (BuildConfig.DEBUG) {
|
||||
// onComplete.run();
|
||||
// return;
|
||||
// }
|
||||
|
||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||
printerService.printCollo(
|
||||
printerName,
|
||||
testataColloToPrint.getDataColloS(),
|
||||
testataColloToPrint.getGestione(),
|
||||
testataColloToPrint.getSerCollo(),
|
||||
testataColloToPrint.getNumCollo(),
|
||||
quantity,
|
||||
reportName)
|
||||
Call<ServiceRESTResponse<Object>> callable = null;
|
||||
if (printerType != null)
|
||||
callable = printerService.printCollo(printerType.toString(), testataColloToPrint);
|
||||
else
|
||||
callable = printerService.printCollo(testataColloToPrint);
|
||||
|
||||
.enqueue(new Callback<>() {
|
||||
callable.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
analyzeAnswer(response, "printCollo", data -> {
|
||||
@@ -114,6 +86,7 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void printReport(String printerName, String reportName, HashMap<String, Object> params, int quantity, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
// if (BuildConfig.DEBUG) {
|
||||
// onComplete.run();
|
||||
|
||||
@@ -2,20 +2,16 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface PrinterRESTConsumerService {
|
||||
|
||||
@POST("getAvailablePrinters")
|
||||
Call<ServiceRESTResponse<List<String>>> getAvailablePrinters();
|
||||
|
||||
@POST("getAvailablePrinters")
|
||||
Call<ServiceRESTResponse<List<String>>> getAvailablePrinters(@Query("codMdep") String codMdep);
|
||||
|
||||
@@ -23,19 +19,6 @@ public interface PrinterRESTConsumerService {
|
||||
Call<ServiceRESTResponse<List<String>>> getAvailablePrinters(@Query("codMdep") String codMdep, @Query("printerType") String printerType);
|
||||
|
||||
|
||||
@POST("pkgPrintLabel")
|
||||
@FormUrlEncoded
|
||||
Call<ServiceRESTResponse<Object>> printCollo(
|
||||
@Query("printerName") String printerName,
|
||||
@Field("dataCollo") String dataCollo,
|
||||
@Field("gestione") String gestione,
|
||||
@Field("serCollo") String serCollo,
|
||||
@Field("numCollo") int numCollo,
|
||||
@Query("printQuantity") int printQuantity,
|
||||
@Query("reportName") String reportName
|
||||
);
|
||||
|
||||
|
||||
@POST("processPrintReport")
|
||||
Call<ServiceRESTResponse<Object>> processPrintReport(
|
||||
@Query("printerName") String printerName,
|
||||
@@ -43,4 +26,16 @@ public interface PrinterRESTConsumerService {
|
||||
@Body JasperDTO jasperDTO
|
||||
);
|
||||
|
||||
|
||||
@POST("wms/printEtichettaSSCC")
|
||||
Call<ServiceRESTResponse<Object>> printCollo(
|
||||
@Query("printerType") String printerType,
|
||||
@Body MtbColt mtbColtToPrint
|
||||
);
|
||||
|
||||
@POST("wms/printEtichettaSSCC")
|
||||
Call<ServiceRESTResponse<Object>> printCollo(
|
||||
@Body MtbColt mtbColtToPrint
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@ 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.google.gson.reflect.TypeToken;
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
@@ -13,20 +16,22 @@ import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.BuildConfig;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.Azienda;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
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.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.Azienda;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import retrofit2.Call;
|
||||
@@ -46,7 +51,17 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
analyzeAnswer(response, "ProcessSql", o -> {
|
||||
Gson gson = new Gson();
|
||||
Gson gson = new GsonBuilder()
|
||||
.registerTypeAdapter(Date.class, (JsonDeserializer) (json, typeOfT, context) -> {
|
||||
try {
|
||||
return UtilityDate.recognizeDate(json.getAsString());
|
||||
} catch (Exception e) {
|
||||
throw new JsonParseException(e);
|
||||
}
|
||||
})
|
||||
.create();
|
||||
|
||||
|
||||
String json = gson.toJson(o);
|
||||
|
||||
InputStream ims = new ByteArrayInputStream(json.getBytes());
|
||||
@@ -100,7 +115,11 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
public static void getAvailableCodMdeps(final RunnableArgs<List<AvailableCodMdepsDTO>> onSuccess, RunnableArgs<Exception> onFailed) {
|
||||
public void getAvailableCodMdeps(final RunnableArgs<List<AvailableCodMdepsDTO>> onSuccess, RunnableArgs<Exception> onFailed) {
|
||||
getAvailableCodMdepsStatic(onSuccess, onFailed);
|
||||
}
|
||||
|
||||
public static void getAvailableCodMdepsStatic(final RunnableArgs<List<AvailableCodMdepsDTO>> onSuccess, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||
service.getAvailableCodMdeps().enqueue(new Callback<>() {
|
||||
|
||||
@@ -39,7 +39,7 @@ public class _BaseRESTConsumer {
|
||||
}
|
||||
} else {
|
||||
if (response.code() == 404) {
|
||||
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata");
|
||||
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url().toString() + ")");
|
||||
onFailed.run(new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")"));
|
||||
} else {
|
||||
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
||||
|
||||
@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.rest.model;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
@@ -43,9 +44,7 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
||||
private boolean flagEvaso;
|
||||
private String nomeAgente;
|
||||
private String codJfas;
|
||||
|
||||
|
||||
|
||||
private List<AvailableClassMerc> availableClassMerc;
|
||||
|
||||
public Integer getIdViaggio() {
|
||||
return idViaggio;
|
||||
@@ -363,6 +362,16 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<AvailableClassMerc> getAvailableClassMerc() {
|
||||
return availableClassMerc;
|
||||
}
|
||||
|
||||
public OrdineUscitaInevasoDTO setAvailableClassMerc(List<AvailableClassMerc> availableClassMerc) {
|
||||
this.availableClassMerc = availableClassMerc;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
@@ -382,4 +391,28 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
||||
result = 31 * result + getGestione().hashCode();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static class AvailableClassMerc {
|
||||
|
||||
private String codMgrp;
|
||||
private List<String> codMsgr;
|
||||
|
||||
public String getCodMgrp() {
|
||||
return codMgrp;
|
||||
}
|
||||
|
||||
public AvailableClassMerc setCodMgrp(String codMgrp) {
|
||||
this.codMgrp = codMgrp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getCodMsgr() {
|
||||
return codMsgr;
|
||||
}
|
||||
|
||||
public AvailableClassMerc setCodMsgr(List<String> codMsgr) {
|
||||
this.codMsgr = codMsgr;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ public class SitArtOrdDTO {
|
||||
private String idViaggio;
|
||||
private String codMdep;
|
||||
private boolean flagEnablePickManuale;
|
||||
private boolean flagEnableScanArt;
|
||||
private String codMgrp;
|
||||
private String descrizioneMgrp;
|
||||
private String codMsgr;
|
||||
@@ -145,6 +146,14 @@ public class SitArtOrdDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagEnableScanArt() {
|
||||
return flagEnableScanArt;
|
||||
}
|
||||
|
||||
public SitArtOrdDTO setFlagEnableScanArt(boolean flagEnableScanArt) {
|
||||
this.flagEnableScanArt = flagEnableScanArt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMgrp() {
|
||||
return codMgrp;
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package it.integry.integrywmsnative.core.rest.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
|
||||
public class VersamentoAutomaticoULResponseDTO {
|
||||
|
||||
private List<MtbColr> success;
|
||||
private List<MtbColr> failed;
|
||||
|
||||
public List<MtbColr> getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public VersamentoAutomaticoULResponseDTO setSuccess(List<MtbColr> success) {
|
||||
this.success = success;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbColr> getFailed() {
|
||||
return failed;
|
||||
}
|
||||
|
||||
public VersamentoAutomaticoULResponseDTO setFailed(List<MtbColr> failed) {
|
||||
this.failed = failed;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package it.integry.integrywmsnative.core.services.inventario;
|
||||
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
||||
|
||||
@Singleton
|
||||
public class InventarioService {
|
||||
|
||||
private final GiacenzaRESTConsumer mGiacenzaRESTConsumer;
|
||||
|
||||
public InventarioService(GiacenzaRESTConsumer giacenzaRESTConsumer) {
|
||||
this.mGiacenzaRESTConsumer = giacenzaRESTConsumer;
|
||||
}
|
||||
|
||||
public void getInventarioDaPosizione(MtbDepoPosizione posizione, RunnableArgs<List<MvwSitArtUdcDetInventario>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
mGiacenzaRESTConsumer.getGiacenzeInPosizione(posizione, onSuccess, onError);
|
||||
}
|
||||
|
||||
public void getInventarioDaPosizionePerArticolo(MtbDepoPosizione posizione, MtbAart articolo, RunnableArgs<List<MvwSitArtUdcDetInventario>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
getInventarioDaPosizione(posizione, (inventario) -> {
|
||||
List<MvwSitArtUdcDetInventario> inventarioArticolo = Stream.of(inventario).filter(
|
||||
x -> articolo.getCodMart().equalsIgnoreCase(x.getCodMart())
|
||||
).toList();
|
||||
onSuccess.run(inventarioArticolo);
|
||||
}, onError);
|
||||
}
|
||||
|
||||
public MtbColt mapInventarioToMtbColt(MvwSitArtUdcDetInventario inventario) {
|
||||
return mapInventarioToMtbColt(inventario, true);
|
||||
}
|
||||
|
||||
public MtbColt mapInventarioToMtbColt(MvwSitArtUdcDetInventario inventario, boolean includeRows) {
|
||||
MtbColt mtbColt = new MtbColt();
|
||||
|
||||
mtbColt.setGestione(inventario.getGestione());
|
||||
mtbColt.setDataCollo(inventario.getDataCollo());
|
||||
mtbColt.setSerCollo(inventario.getSerCollo());
|
||||
mtbColt.setNumCollo(inventario.getNumCollo());
|
||||
mtbColt.setSegno(inventario.getSegno());
|
||||
mtbColt.setCodMdep(inventario.getCodMdep());
|
||||
mtbColt.setPosizione(inventario.getPosizione());
|
||||
mtbColt.setCodJcom(inventario.getCodJcom());
|
||||
mtbColt.setPesoNettoKg(inventario.getPesoNettoKg());
|
||||
mtbColt.setPesoKg(inventario.getPesoLordoKg());
|
||||
mtbColt.setCodJfas(inventario.getCodJfas());
|
||||
|
||||
if (includeRows) {
|
||||
ObservableArrayList<MtbColr> rows = new ObservableArrayList<>();
|
||||
rows.add(mapInventarioToMtbColr(inventario));
|
||||
mtbColt.setMtbColr(rows);
|
||||
}
|
||||
return mtbColt;
|
||||
}
|
||||
|
||||
public MtbColr mapInventarioToMtbColr(MvwSitArtUdcDetInventario inventario) {
|
||||
MtbColr mtbColr = new MtbColr();
|
||||
|
||||
mtbColr.setGestione(inventario.getGestione());
|
||||
mtbColr.setDataCollo(inventario.getDataCollo());
|
||||
mtbColr.setSerCollo(inventario.getSerCollo());
|
||||
mtbColr.setNumCollo(inventario.getNumCollo());
|
||||
mtbColr.setCodMart(inventario.getCodMart());
|
||||
mtbColr.setDescrizione(inventario.getDescrizioneEstesa());
|
||||
mtbColr.setPartitaMag(inventario.getPartitaMag());
|
||||
mtbColr.setCodJcom(inventario.getCodJcom());
|
||||
mtbColr.setUntMis(inventario.getUntMis());
|
||||
mtbColr.setQtaCol(inventario.getQtaCol());
|
||||
mtbColr.setNumCnf(inventario.getNumCnf());
|
||||
mtbColr.setQtaCnf(inventario.getQtaCnf());
|
||||
mtbColr.setPesoNettoKg(inventario.getPesoNettoKg());
|
||||
mtbColr.setPesoLordoKg(inventario.getPesoLordoKg());
|
||||
mtbColr.setMtbAart(inventario.getMtbAart());
|
||||
|
||||
|
||||
return mtbColr;
|
||||
}
|
||||
|
||||
public List<MtbColt> mapInventarioToMtbColtList(List<MvwSitArtUdcDetInventario> inventario) {
|
||||
return new ArrayList<>(Stream.of(inventario).groupBy(x -> x.getNumCollo() + "-" + x.getDataCollo() + "-" + x.getSerCollo() + x.getGestione()).map(inv -> {
|
||||
List<MvwSitArtUdcDetInventario> rows = inv.getValue();
|
||||
MtbColt mtbColt = mapInventarioToMtbColt(rows.get(0), false);
|
||||
ObservableArrayList<MtbColr> mtbColrs = new ObservableArrayList<>();
|
||||
mtbColrs.addAll(Stream.of(rows).map(this::mapInventarioToMtbColr).toList());
|
||||
mtbColt.setMtbColr(mtbColrs);
|
||||
return mtbColt;
|
||||
}).toList());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
package it.integry.integrywmsnative.core.settings;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
||||
import it.integry.integrywmsnative.core.model.Azienda;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
||||
|
||||
public class DBSettingsModel {
|
||||
|
||||
@@ -21,7 +22,7 @@ public class DBSettingsModel {
|
||||
private String defaultCausaleRettificaGiacenze;
|
||||
private DistribuzioneColloDTO.CriterioDistribuzione defaultCriterioDistribuzione;
|
||||
private boolean flagAskClienteInPickingLibero;
|
||||
private boolean flagAllowEmptyClienteInPickingLibero;
|
||||
private boolean flagPickLiberoAllowEmptyCliente;
|
||||
|
||||
private boolean flagCanAddExtraItemSpedizione;
|
||||
private boolean flagCanAutoOpenNewULAccettazione;
|
||||
@@ -33,10 +34,15 @@ public class DBSettingsModel {
|
||||
private boolean flagForceAllToColli;
|
||||
private boolean flagSpedizioneEnableManualPick;
|
||||
private boolean flagSpedizioneCanSelectMultipleOrders;
|
||||
private List<String> notePerditaDocInterni = new ArrayList<>();
|
||||
private boolean flagSpedizioneUseQtaOrd;
|
||||
private boolean flagOrdinaNuoviArticoliInGriglia;
|
||||
private String docInterniCheckFornitore;
|
||||
private String produzioneDefaultCodAnag;
|
||||
private String reportNameSpedizionChiudiOrdine;
|
||||
private int onNumCnfInputChanged = 1;
|
||||
private boolean flagAccettazioneUseQtaOrd = false;
|
||||
private boolean flagPickLiberoAllowEmptyDest = false;
|
||||
|
||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||
return flagSpedizioneEnableFakeGiacenza;
|
||||
@@ -136,12 +142,12 @@ public class DBSettingsModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAllowEmptyClienteInPickingLibero() {
|
||||
return flagAllowEmptyClienteInPickingLibero;
|
||||
public boolean isFlagPickLiberoAllowEmptyCliente() {
|
||||
return flagPickLiberoAllowEmptyCliente;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAllowEmptyClienteInPickingLibero(boolean flagAllowEmptyClienteInPickingLibero) {
|
||||
this.flagAllowEmptyClienteInPickingLibero = flagAllowEmptyClienteInPickingLibero;
|
||||
public DBSettingsModel setFlagPickLiberoAllowEmptyCliente(boolean flagPickLiberoAllowEmptyCliente) {
|
||||
this.flagPickLiberoAllowEmptyCliente = flagPickLiberoAllowEmptyCliente;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -245,6 +251,15 @@ public class DBSettingsModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagOrdinaNuoviArticoliInGriglia(boolean flagOrdinaNuoviArticoliInGriglia) {
|
||||
this.flagOrdinaNuoviArticoliInGriglia = flagOrdinaNuoviArticoliInGriglia;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getFlagOrdinaNuoviArticoliInGriglia() {
|
||||
return this.flagOrdinaNuoviArticoliInGriglia;
|
||||
}
|
||||
|
||||
public String getProduzioneDefaultCodAnag() {
|
||||
return produzioneDefaultCodAnag;
|
||||
}
|
||||
@@ -271,4 +286,40 @@ public class DBSettingsModel {
|
||||
this.onNumCnfInputChanged = onNumCnfInputChanged;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getNotePerditaDocInterni() {
|
||||
return notePerditaDocInterni;
|
||||
}
|
||||
|
||||
public DBSettingsModel setNotePerditaDocInterni(List<String> notePerditaDocInterni) {
|
||||
this.notePerditaDocInterni = notePerditaDocInterni;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDocInterniCheckFornitore() {
|
||||
return docInterniCheckFornitore;
|
||||
}
|
||||
|
||||
public DBSettingsModel setDocInterniCheckFornitore(String docInterniCheckFornitore) {
|
||||
this.docInterniCheckFornitore = docInterniCheckFornitore;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAccettazioneUseQtaOrd() {
|
||||
return flagAccettazioneUseQtaOrd;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAccettazioneUseQtaOrd(boolean flagAccettazioneUseQtaOrd) {
|
||||
this.flagAccettazioneUseQtaOrd = flagAccettazioneUseQtaOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagPickLiberoAllowEmptyDest() {
|
||||
return flagPickLiberoAllowEmptyDest;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagPickLiberoAllowEmptyDest(boolean flagPickLiberoAllowEmptyDest) {
|
||||
this.flagPickLiberoAllowEmptyDest = flagPickLiberoAllowEmptyDest;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user