Compare commits
100 Commits
v1.19.1(24
...
v1.23.5(26
| Author | SHA1 | Date | |
|---|---|---|---|
| e963e03c81 | |||
| f1c25a3673 | |||
| 90d5a8d43b | |||
| e1b4af2402 | |||
| 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 |
1
.idea/.gitignore
generated
vendored
Normal file
1
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/saveactions_settings.xml
|
||||||
@@ -1,13 +1,17 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
apply plugin: 'com.google.firebase.firebase-perf'
|
|
||||||
|
if (!project.hasProperty("disable-performance-plugin")) {
|
||||||
|
apply plugin: 'com.google.firebase.firebase-perf'
|
||||||
|
}
|
||||||
|
|
||||||
apply plugin: 'com.google.firebase.crashlytics'
|
apply plugin: 'com.google.firebase.crashlytics'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 242
|
def appVersionCode = 260
|
||||||
def appVersionName = '1.19.1'
|
def appVersionName = '1.23.5'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
@@ -27,12 +31,12 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compileSdkVersion 30
|
compileSdkVersion 31
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "it.integry.integrywmsnative"
|
applicationId "it.integry.integrywmsnative"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 30
|
targetSdkVersion 31
|
||||||
versionCode appVersionCode
|
versionCode appVersionCode
|
||||||
versionName appVersionName
|
versionName appVersionName
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
@@ -94,37 +98,37 @@ dependencies {
|
|||||||
//Firebase
|
//Firebase
|
||||||
|
|
||||||
// Import the Firebase BoM
|
// Import the Firebase BoM
|
||||||
implementation platform('com.google.firebase:firebase-bom:26.3.0')
|
implementation platform('com.google.firebase:firebase-bom:29.1.0')
|
||||||
implementation 'com.google.firebase:firebase-analytics'
|
implementation 'com.google.firebase:firebase-analytics'
|
||||||
implementation 'com.google.firebase:firebase-core'
|
implementation 'com.google.firebase:firebase-core'
|
||||||
implementation 'com.google.firebase:firebase-crash'
|
|
||||||
implementation 'com.google.firebase:firebase-crashlytics'
|
implementation 'com.google.firebase:firebase-crashlytics'
|
||||||
implementation 'com.google.firebase:firebase-perf'
|
implementation 'com.google.firebase:firebase-perf'
|
||||||
implementation 'com.google.android.gms:play-services-basement:17.6.0'
|
implementation 'com.google.android.gms:play-services-basement:18.0.0'
|
||||||
|
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.3.1'
|
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'com.google.android.material:material:1.4.0'
|
implementation 'com.google.android.material:material:1.5.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
implementation 'androidx.preference:preference-ktx:1.1.1'
|
implementation 'androidx.preference:preference-ktx:1.2.0'
|
||||||
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
implementation 'com.annimon:stream:1.2.2'
|
implementation 'com.annimon:stream:1.2.2'
|
||||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
|
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
|
||||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||||
implementation 'androidx.lifecycle:lifecycle-common-java8:2.3.1'
|
implementation 'androidx.lifecycle:lifecycle-common-java8:2.4.1'
|
||||||
implementation 'org.apache.commons:commons-text:1.9'
|
implementation 'org.apache.commons:commons-text:1.9'
|
||||||
|
|
||||||
//MVVM
|
//MVVM
|
||||||
def dagger2_version = '2.35.1'
|
def dagger2_version = '2.40'
|
||||||
api "com.google.dagger:dagger:$dagger2_version"
|
api "com.google.dagger:dagger:$dagger2_version"
|
||||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
||||||
api "com.google.dagger:dagger-android:$dagger2_version"
|
api "com.google.dagger:dagger-android:$dagger2_version"
|
||||||
api "com.google.dagger:dagger-android-support:$dagger2_version" // if you use the support libraries
|
api "com.google.dagger:dagger-android-support:$dagger2_version"
|
||||||
|
// if you use the support libraries
|
||||||
annotationProcessor "com.google.dagger:dagger-android-processor:$dagger2_version"
|
annotationProcessor "com.google.dagger:dagger-android-processor:$dagger2_version"
|
||||||
|
|
||||||
//FAB
|
//FAB
|
||||||
@@ -134,13 +138,12 @@ dependencies {
|
|||||||
implementation 'com.github.cachapa:ExpandableLayout:2.9.2'
|
implementation 'com.github.cachapa:ExpandableLayout:2.9.2'
|
||||||
implementation 'com.github.frankiesardo:linearlistview:1.0.1@aar'
|
implementation 'com.github.frankiesardo:linearlistview:1.0.1@aar'
|
||||||
implementation 'com.github.fede87:StatusBarAlert:1.0.1'
|
implementation 'com.github.fede87:StatusBarAlert:1.0.1'
|
||||||
implementation 'com.github.akshay2211:Stash:master'
|
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
implementation 'com.github.zhukic:sectioned-recyclerview:1.2.3'
|
implementation 'com.github.zhukic:sectioned-recyclerview:1.2.3'
|
||||||
implementation 'com.github.pedromassango:doubleClick:3.0'
|
implementation 'com.github.pedromassango:doubleClick:3.0'
|
||||||
|
|
||||||
//SQLite ROOM
|
//SQLite ROOM
|
||||||
def room_version = "2.3.0"
|
def room_version = "2.4.1"
|
||||||
|
|
||||||
implementation "androidx.room:room-runtime:$room_version"
|
implementation "androidx.room:room-runtime:$room_version"
|
||||||
annotationProcessor "androidx.room:room-compiler:$room_version"
|
annotationProcessor "androidx.room:room-compiler:$room_version"
|
||||||
@@ -159,7 +162,6 @@ dependencies {
|
|||||||
|
|
||||||
|
|
||||||
implementation 'com.github.RaviKoradiya:LiveAdapter:1.3.4'
|
implementation 'com.github.RaviKoradiya:LiveAdapter:1.3.4'
|
||||||
implementation 'org.reflections:reflections:0.10.2'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -29,6 +29,10 @@
|
|||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/Light"
|
android:theme="@style/Light"
|
||||||
android:windowSoftInputMode="adjustNothing" />
|
android:windowSoftInputMode="adjustNothing" />
|
||||||
|
<activity android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/Light"
|
||||||
|
android:windowSoftInputMode="adjustNothing" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.picking_resi.PickingResiActivity"
|
android:name=".gest.picking_resi.PickingResiActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
@@ -36,7 +40,8 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".gest.main.MainActivity"
|
android:name=".gest.main.MainActivity"
|
||||||
android:theme="@style/Light"
|
android:theme="@style/Light"
|
||||||
android:windowSoftInputMode="adjustNothing">
|
android:windowSoftInputMode="adjustNothing"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.CLIENTBARCODEACTIVITY" />
|
<action android:name="android.intent.action.CLIENTBARCODEACTIVITY" />
|
||||||
|
|
||||||
@@ -69,7 +74,8 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".SplashActivity"
|
android:name=".SplashActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/SplashTheme">
|
android:theme="@style/SplashTheme"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,20 @@ import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneComponent;
|
|||||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneModule;
|
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneModule;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingComponent;
|
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingComponent;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingModule;
|
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.ContenutoBancaleComponent;
|
||||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
||||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliComponent;
|
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliComponent;
|
||||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliModule;
|
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliModule;
|
||||||
|
import it.integry.integrywmsnative.gest.login.LoginComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.login.LoginModule;
|
||||||
import it.integry.integrywmsnative.gest.main.MainActivityComponent;
|
import it.integry.integrywmsnative.gest.main.MainActivityComponent;
|
||||||
import it.integry.integrywmsnative.gest.main.MainActivityModule;
|
import it.integry.integrywmsnative.gest.main.MainActivityModule;
|
||||||
import it.integry.integrywmsnative.gest.main.MainFragmentComponent;
|
import it.integry.integrywmsnative.gest.main.MainFragmentComponent;
|
||||||
@@ -55,6 +65,7 @@ import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.Dial
|
|||||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsModule;
|
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsModule;
|
||||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotComponent;
|
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotComponent;
|
||||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotModule;
|
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotModule;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialogComponent;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdComponent;
|
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdComponent;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdModule;
|
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdModule;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2Component;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2Component;
|
||||||
@@ -70,6 +81,7 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
|||||||
RoomModule.class,
|
RoomModule.class,
|
||||||
SplashActivityModule.class,
|
SplashActivityModule.class,
|
||||||
MainApplicationModule.class,
|
MainApplicationModule.class,
|
||||||
|
LoginModule.class,
|
||||||
MainActivityModule.class,
|
MainActivityModule.class,
|
||||||
MainFragmentModule.class,
|
MainFragmentModule.class,
|
||||||
MainAccettazioneModule.class,
|
MainAccettazioneModule.class,
|
||||||
@@ -97,44 +109,90 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
|||||||
ProdOrdineProduzioneElencoModule.class,
|
ProdOrdineProduzioneElencoModule.class,
|
||||||
ProdRecuperoMaterialeModule.class,
|
ProdRecuperoMaterialeModule.class,
|
||||||
ProdVersamentoMaterialeModule.class,
|
ProdVersamentoMaterialeModule.class,
|
||||||
DialogChooseArtsFromListaArtsModule.class
|
DialogChooseArtsFromListaArtsModule.class,
|
||||||
|
DocInterniModule.class,
|
||||||
|
DialogSelectDocInfoModule.class,
|
||||||
|
DocInterniEditFormModule.class,
|
||||||
|
DialogSelectDocRowsModule.class
|
||||||
})
|
})
|
||||||
public interface MainApplicationComponent {
|
public interface MainApplicationComponent {
|
||||||
|
|
||||||
SplashActivityComponent.Factory splashActivityComponent();
|
SplashActivityComponent.Factory splashActivityComponent();
|
||||||
|
|
||||||
|
LoginComponent.Factory loginActivityComponent();
|
||||||
|
|
||||||
MainActivityComponent.Factory mainActivityComponent();
|
MainActivityComponent.Factory mainActivityComponent();
|
||||||
|
|
||||||
MainFragmentComponent.Factory mainFragmentComponent();
|
MainFragmentComponent.Factory mainFragmentComponent();
|
||||||
|
|
||||||
MainAccettazioneComponent.Factory mainAccettazioneComponent();
|
MainAccettazioneComponent.Factory mainAccettazioneComponent();
|
||||||
|
|
||||||
ListaBancaliComponent.Factory listaBancaliComponent();
|
ListaBancaliComponent.Factory listaBancaliComponent();
|
||||||
|
|
||||||
ContenutoBancaleComponent.Factory contenutoBancaleComponent();
|
ContenutoBancaleComponent.Factory contenutoBancaleComponent();
|
||||||
|
|
||||||
PVOrdiniAcquistoGrigliaComponent.Factory pvOrdineAcquistoGrigliaComponent();
|
PVOrdiniAcquistoGrigliaComponent.Factory pvOrdineAcquistoGrigliaComponent();
|
||||||
|
|
||||||
PVOrdineAcquistoEditComponent.Factory pvOrdineAcquistoEditComponent();
|
PVOrdineAcquistoEditComponent.Factory pvOrdineAcquistoEditComponent();
|
||||||
|
|
||||||
PickingLiberoComponent.Factory pickingLiberoComponent();
|
PickingLiberoComponent.Factory pickingLiberoComponent();
|
||||||
|
|
||||||
RettificaGiacenzeComponent.Factory rettificaGiacenzeComponent();
|
RettificaGiacenzeComponent.Factory rettificaGiacenzeComponent();
|
||||||
|
|
||||||
SpedizioneComponent.Factory spedizioneComponent();
|
SpedizioneComponent.Factory spedizioneComponent();
|
||||||
|
|
||||||
AccettazionePickingComponent.Factory accettazionePickingComponent();
|
AccettazionePickingComponent.Factory accettazionePickingComponent();
|
||||||
|
|
||||||
UltimeConsegneClienteComponent.Factory ultimeConsegneClienteComponent();
|
UltimeConsegneClienteComponent.Factory ultimeConsegneClienteComponent();
|
||||||
|
|
||||||
UltimiArriviFornitoreComponent.Factory ultimiArriviFornitoreComponent();
|
UltimiArriviFornitoreComponent.Factory ultimiArriviFornitoreComponent();
|
||||||
|
|
||||||
PickingResiComponent.Factory pickingResiComponent();
|
PickingResiComponent.Factory pickingResiComponent();
|
||||||
|
|
||||||
OrdiniUscitaElencoComponent.Factory prodOrdineLavorazioneElencoComponent();
|
OrdiniUscitaElencoComponent.Factory prodOrdineLavorazioneElencoComponent();
|
||||||
|
|
||||||
DialogInputQuantityV2Component.Factory dialogInputQuantityV2Component();
|
DialogInputQuantityV2Component.Factory dialogInputQuantityV2Component();
|
||||||
|
|
||||||
DialogInputLUProdComponent.Factory dialogInputLUProdComponent();
|
DialogInputLUProdComponent.Factory dialogInputLUProdComponent();
|
||||||
|
|
||||||
DialogScanArtComponent.Factory dialogScanArtComponent();
|
DialogScanArtComponent.Factory dialogScanArtComponent();
|
||||||
|
|
||||||
DialogScanOrCreateLUComponent.Factory dialogScanOrCreateLUComponent();
|
DialogScanOrCreateLUComponent.Factory dialogScanOrCreateLUComponent();
|
||||||
|
|
||||||
ProdFabbisognoLineeProdComponent.Factory prodFabbisognoLineeProdComponent();
|
ProdFabbisognoLineeProdComponent.Factory prodFabbisognoLineeProdComponent();
|
||||||
|
|
||||||
VersamentoMerceComponent.Factory versamentoMerceComponent();
|
VersamentoMerceComponent.Factory versamentoMerceComponent();
|
||||||
|
|
||||||
DialogAskMagazzinoProssimitaComponent.Factory dialogAskMagazzinoProssimitaComponent();
|
DialogAskMagazzinoProssimitaComponent.Factory dialogAskMagazzinoProssimitaComponent();
|
||||||
|
|
||||||
DialogChooseBatchLotComponent.Factory dialogChooseBatchLotComponent();
|
DialogChooseBatchLotComponent.Factory dialogChooseBatchLotComponent();
|
||||||
|
|
||||||
DialogRowInfoProdFabbisognoLineeProdComponent.Factory dialogRowInfoProdFabbisognoLineeProdComponent();
|
DialogRowInfoProdFabbisognoLineeProdComponent.Factory dialogRowInfoProdFabbisognoLineeProdComponent();
|
||||||
|
|
||||||
ProdRientroMerceComponent.Factory prodRientroMerceComponent();
|
ProdRientroMerceComponent.Factory prodRientroMerceComponent();
|
||||||
|
|
||||||
ProdRientroMerceOrderDetailComponent.Factory prodRientroMerceOrderDetailComponent();
|
ProdRientroMerceOrderDetailComponent.Factory prodRientroMerceOrderDetailComponent();
|
||||||
|
|
||||||
ProdOrdineProduzioneElencoComponent.Factory prodOrdineProduzioneElencoComponent();
|
ProdOrdineProduzioneElencoComponent.Factory prodOrdineProduzioneElencoComponent();
|
||||||
|
|
||||||
ProdRecuperoMaterialeComponent.Factory prodRecuperoMaterialeComponent();
|
ProdRecuperoMaterialeComponent.Factory prodRecuperoMaterialeComponent();
|
||||||
|
|
||||||
ProdVersamentoMaterialeComponent.Factory prodVersamentoMaterialeComponent();
|
ProdVersamentoMaterialeComponent.Factory prodVersamentoMaterialeComponent();
|
||||||
|
|
||||||
DialogChooseArtsFromListaArtsComponent.Factory dialogChooseArtsFromListaArtsComponent();
|
DialogChooseArtsFromListaArtsComponent.Factory dialogChooseArtsFromListaArtsComponent();
|
||||||
|
|
||||||
|
DocInterniComponent.Factory docInterniComponent();
|
||||||
|
|
||||||
|
DialogSelectDocInfoComponent.Factory dialogSelectMgrpDtipPairComponent();
|
||||||
|
|
||||||
|
DialogSelectDocRowsComponent.Factory dialogSelectDocRowsComponent();
|
||||||
|
|
||||||
|
DocInterniEditFormComponent.Factory docInterniEditFormComponent();
|
||||||
|
|
||||||
|
InfoAggiuntiveLUDialogComponent.Factory infoAggiuntiveLUDialogComponent();
|
||||||
|
|
||||||
void inject(MainApplication mainApplication);
|
void inject(MainApplication mainApplication);
|
||||||
|
|
||||||
void inject(AppContext mainApplication);
|
void inject(AppContext mainApplication);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,15 +15,19 @@ import it.integry.integrywmsnative.core.menu.MenuService;
|
|||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.CommessaRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.EntityRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.EntityRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
@@ -85,6 +89,12 @@ public class MainApplicationModule {
|
|||||||
return new ArticoloRESTConsumer(systemRESTConsumer);
|
return new ArticoloRESTConsumer(systemRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
CommessaRESTConsumer provideCommessaRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||||
|
return new CommessaRESTConsumer(systemRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
DepositoRESTConsumer provideDepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer, SystemRESTConsumer systemRESTConsumer) {
|
DepositoRESTConsumer provideDepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer, SystemRESTConsumer systemRESTConsumer) {
|
||||||
@@ -151,5 +161,22 @@ public class MainApplicationModule {
|
|||||||
return new ProdFabbisognoLineeProdRESTConsumer(systemRESTConsumer);
|
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;
|
package it.integry.integrywmsnative;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
@@ -38,6 +39,12 @@ public class SplashActivity extends BaseActivity implements MainContext.Listener
|
|||||||
|
|
||||||
private RunnableArgsss<Integer, String[], List<Integer>> onRequestPermissionResult;
|
private RunnableArgsss<Integer, String[], List<Integer>> onRequestPermissionResult;
|
||||||
|
|
||||||
|
public static void startActivity(Context context) {
|
||||||
|
Intent intent = new Intent(context, SplashActivity.class);
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public class CommonConst {
|
|||||||
|
|
||||||
public static String DEFAULT_ANONYMOUS_UL_SERIE = "UL";
|
public static String DEFAULT_ANONYMOUS_UL_SERIE = "UL";
|
||||||
|
|
||||||
public static int NUMBER_OF_DECIMAL_DIGITS = 3;
|
public static int NUMBER_OF_DECIMAL_DIGITS = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Files {
|
public static class Files {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package it.integry.integrywmsnative.core.class_router;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.class_router.configs.MenuConfiguration;
|
|
||||||
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityHashMap;
|
import it.integry.integrywmsnative.core.utility.UtilityHashMap;
|
||||||
|
|
||||||
@@ -10,14 +9,12 @@ public class BaseCustomConfiguration implements ICustomConfiguration {
|
|||||||
|
|
||||||
|
|
||||||
public static class Keys {
|
public static class Keys {
|
||||||
public static int MENU_CONFIGURATION = 0;
|
|
||||||
public static int FLAG_SHOW_COD_FORN_IN_SPEDIZIONE = 1;
|
public static int FLAG_SHOW_COD_FORN_IN_SPEDIZIONE = 1;
|
||||||
public static int CUSTOM_DYNAMIC_VERSION_PATH = 2;
|
public static int CUSTOM_DYNAMIC_VERSION_PATH = 2;
|
||||||
public static int FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC = 3;
|
public static int FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected HashMap<Integer, Object> configurations = new HashMap<Integer, Object>() {{
|
protected HashMap<Integer, Object> configurations = new HashMap<>() {{
|
||||||
put(Keys.MENU_CONFIGURATION, new MenuConfiguration());
|
|
||||||
put(Keys.FLAG_SHOW_COD_FORN_IN_SPEDIZIONE, true);
|
put(Keys.FLAG_SHOW_COD_FORN_IN_SPEDIZIONE, true);
|
||||||
put(Keys.FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC, false);
|
put(Keys.FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC, false);
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -3,11 +3,13 @@ package it.integry.integrywmsnative.core.class_router.configs;
|
|||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneFragment;
|
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneFragment;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniFragment;
|
||||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoFragment;
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoFragment;
|
||||||
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoFragment;
|
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoFragment;
|
||||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoFragment;
|
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoFragment;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdFragment;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdFragment;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceFragment;
|
||||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment;
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment;
|
||||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaFragment;
|
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaFragment;
|
||||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeFragment;
|
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)
|
.setTitleIcon(R.drawable.ic_dashboard_prod_recupero_materiale)
|
||||||
.setDrawerIcon(R.drawable.ic_black_external)
|
.setDrawerIcon(R.drawable.ic_black_external)
|
||||||
.setFragmentFactory(ProdRecuperoMaterialeFragment::newInstance))
|
.setFragmentFactory(ProdRecuperoMaterialeFragment::newInstance))
|
||||||
|
|
||||||
|
.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(
|
).addGroup(
|
||||||
new MenuGroup()
|
new MenuGroup()
|
||||||
.setGroupText(R.string.internal_handling)
|
.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)
|
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
|
||||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
|
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
|
||||||
.setFragmentFactory(PVOrdiniAcquistoGrigliaFragment::newInstance))
|
.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()
|
// .addItem(new MenuItem()
|
||||||
// .setID(it.integry.integrywmsnative.R.id.nav_pv_ordini_acquisto_trasmessi)
|
// .setID(it.integry.integrywmsnative.R.id.nav_pv_ordini_acquisto_trasmessi)
|
||||||
|
|||||||
@@ -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,13 +8,17 @@ import it.integry.integrywmsnative.core.data_store.db.converter.DateConverter;
|
|||||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloGrigliaDao;
|
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloGrigliaDao;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloOrdineDao;
|
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloOrdineDao;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.dao.GrigliaDao;
|
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.dao.OrdineDao;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
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.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 = 7, exportSchema = false)
|
||||||
@TypeConverters({
|
@TypeConverters({
|
||||||
DateConverter.class
|
DateConverter.class
|
||||||
})
|
})
|
||||||
@@ -30,26 +34,9 @@ public abstract class AppDatabase extends RoomDatabase {
|
|||||||
|
|
||||||
public abstract ArticoloOrdineDao articoloOrdineDao();
|
public abstract ArticoloOrdineDao articoloOrdineDao();
|
||||||
|
|
||||||
// public static AppDatabase getDatabase(final Context context) {
|
public abstract MtbColtDao mtbColtDao();
|
||||||
// if (INSTANCE == null) {
|
|
||||||
// synchronized (AppDatabase.class) {
|
|
||||||
// if (INSTANCE == null) {
|
|
||||||
// INSTANCE = Room.databaseBuilder(context.getApplicationContext(),
|
|
||||||
// AppDatabase.class, "integry_wms")
|
|
||||||
// .fallbackToDestructiveMigration()
|
|
||||||
// .build();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return INSTANCE;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public AppDatabase(Application application) {
|
public abstract MtbColrDao mtbColrDao();
|
||||||
// mRoomInstance = Room.databaseBuilder(application,
|
|
||||||
// AppDatabase.class, "integry_wms")
|
|
||||||
// .fallbackToDestructiveMigration()
|
|
||||||
// .build();
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.ArticoloGrigliaDao;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloOrdineDao;
|
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.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.dao.OrdineDao;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoliOrdineRepository;
|
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoliOrdineRepository;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoloGrigliaRepository;
|
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.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.OrdineRepository;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.ArticoliGrigliaDataSource;
|
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.ArticoliOrdineDataSource;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.GrigliaDataSource;
|
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.OrdineDataSource;
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.SqlMtbColrDataSource;
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.repository.implementations.SqlMtbColtDataSource;
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
public class RoomModule {
|
public class RoomModule {
|
||||||
@@ -66,6 +72,18 @@ public class RoomModule {
|
|||||||
return appDatabase.articoloOrdineDao();
|
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);
|
return new OrdineDataSource(ordineDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
@Provides
|
||||||
|
MtbColtRepository providesMtbColtRepository(MtbColtDao mtbColtDao) {
|
||||||
|
return new SqlMtbColtDataSource(mtbColtDao);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
@Provides
|
||||||
|
MtbColrRepository providesMtbColrRepository(MtbColrDao mtbColrDao) {
|
||||||
|
return new SqlMtbColrDataSource(mtbColrDao);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import androidx.room.Insert;
|
|||||||
import androidx.room.Query;
|
import androidx.room.Query;
|
||||||
import androidx.room.Update;
|
import androidx.room.Update;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
||||||
@@ -21,10 +20,13 @@ public interface ArticoloGrigliaDao {
|
|||||||
|
|
||||||
@Insert
|
@Insert
|
||||||
void insertAll(List<ArticoloGriglia> articoli);
|
void insertAll(List<ArticoloGriglia> articoli);
|
||||||
|
|
||||||
@Insert
|
@Insert
|
||||||
Long insert(ArticoloGriglia articolo);
|
Long insert(ArticoloGriglia articolo);
|
||||||
|
|
||||||
@Update
|
@Update
|
||||||
void updateAll(List<ArticoloGriglia> articoli);
|
void updateAll(List<ArticoloGriglia> articoli);
|
||||||
|
|
||||||
@Update
|
@Update
|
||||||
void update(ArticoloGriglia articolo);
|
void update(ArticoloGriglia articolo);
|
||||||
|
|
||||||
@@ -45,4 +47,7 @@ public interface ArticoloGrigliaDao {
|
|||||||
|
|
||||||
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId")
|
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId")
|
||||||
List<ArticoloGriglia> getArticoliFromGriglia(int grigliaId);
|
List<ArticoloGriglia> getArticoliFromGriglia(int grigliaId);
|
||||||
|
|
||||||
|
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId and 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.Index;
|
||||||
import androidx.room.PrimaryKey;
|
import androidx.room.PrimaryKey;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
|
||||||
@Entity(
|
@Entity(
|
||||||
@@ -54,9 +56,24 @@ public class ArticoloGriglia {
|
|||||||
@ColumnInfo(name = "qta_min_ordinabile")
|
@ColumnInfo(name = "qta_min_ordinabile")
|
||||||
private float qtaMinOrdinabile;
|
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")
|
@ColumnInfo(name = "id_griglia")
|
||||||
private int idGriglia;
|
private int idGriglia;
|
||||||
|
|
||||||
|
@ColumnInfo(name = "new_no_promo")
|
||||||
|
private boolean newNoPromo = false;
|
||||||
|
|
||||||
public int getArticoloGrigliaId() {
|
public int getArticoloGrigliaId() {
|
||||||
return articoloGrigliaId;
|
return articoloGrigliaId;
|
||||||
}
|
}
|
||||||
@@ -145,6 +162,46 @@ public class ArticoloGriglia {
|
|||||||
this.idGriglia = idGriglia;
|
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) {
|
public ArticoloOrdine convertToArticoloOrdine(Ordine ordine) {
|
||||||
ArticoloOrdine articolo = new ArticoloOrdine();
|
ArticoloOrdine articolo = new ArticoloOrdine();
|
||||||
|
|
||||||
@@ -160,6 +217,12 @@ public class ArticoloGriglia {
|
|||||||
articolo.setUntMis(this.getUntMis());
|
articolo.setUntMis(this.getUntMis());
|
||||||
articolo.setDescrizione(this.getDescrizione());
|
articolo.setDescrizione(this.getDescrizione());
|
||||||
articolo.setDataIns(UtilityDate.getDateInstance());
|
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);
|
articolo.setQtaOrd(0);
|
||||||
|
|
||||||
return articolo;
|
return articolo;
|
||||||
|
|||||||
@@ -3,16 +3,19 @@ package it.integry.integrywmsnative.core.data_store.db.entity;
|
|||||||
import androidx.room.ColumnInfo;
|
import androidx.room.ColumnInfo;
|
||||||
import androidx.room.Entity;
|
import androidx.room.Entity;
|
||||||
import androidx.room.ForeignKey;
|
import androidx.room.ForeignKey;
|
||||||
|
import androidx.room.Ignore;
|
||||||
import androidx.room.Index;
|
import androidx.room.Index;
|
||||||
import androidx.room.PrimaryKey;
|
import androidx.room.PrimaryKey;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Entity(
|
@Entity(
|
||||||
tableName = "articoli_ordine",
|
tableName = "articoli_ordine",
|
||||||
indices = {
|
indices = {
|
||||||
@Index(value = "id_ordine"),
|
@Index(value = "id_ordine"),
|
||||||
@Index(value = {"id_ordine","cod_mart"}, unique = true)
|
@Index(value = {"id_ordine", "cod_mart"}, unique = true)
|
||||||
},
|
},
|
||||||
foreignKeys = {
|
foreignKeys = {
|
||||||
@ForeignKey(
|
@ForeignKey(
|
||||||
@@ -22,11 +25,11 @@ import java.util.Date;
|
|||||||
onDelete = ForeignKey.CASCADE
|
onDelete = ForeignKey.CASCADE
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
public class ArticoloOrdine {
|
public class ArticoloOrdine {
|
||||||
@PrimaryKey(autoGenerate = true)
|
@PrimaryKey(autoGenerate = true)
|
||||||
@ColumnInfo(name = "articolo_ordine_id")
|
@ColumnInfo(name = "articolo_ordine_id")
|
||||||
private int articoloOrdineId;
|
private Integer articoloOrdineId;
|
||||||
|
|
||||||
@ColumnInfo(name = "cod_mart")
|
@ColumnInfo(name = "cod_mart")
|
||||||
private String codMart;
|
private String codMart;
|
||||||
@@ -64,7 +67,23 @@ public class ArticoloOrdine {
|
|||||||
@ColumnInfo(name = "data_ins")
|
@ColumnInfo(name = "data_ins")
|
||||||
private Date dataIns;
|
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;
|
return articoloOrdineId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,4 +186,60 @@ public class ArticoloOrdine {
|
|||||||
public void setDataIns(Date dataIns) {
|
public void setDataIns(Date dataIns) {
|
||||||
this.dataIns = 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 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);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -89,4 +89,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> toUpdate = new ArrayList<>();
|
||||||
List<ArticoloOrdine> toInsert = new ArrayList<>();
|
List<ArticoloOrdine> toInsert = new ArrayList<>();
|
||||||
for (ArticoloOrdine art : articoli) {
|
for (ArticoloOrdine art : articoli) {
|
||||||
if (art.getArticoloOrdineId() > 0) {
|
if (art.getArticoloOrdineId() != null && art.getArticoloOrdineId() > 0) {
|
||||||
toUpdate.add(art);
|
toUpdate.add(art);
|
||||||
} else {
|
} else {
|
||||||
toInsert.add(art);
|
toInsert.add(art);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mArticoloOrdineDao.insertAll(toInsert);
|
for (ArticoloOrdine newArt : toInsert) {
|
||||||
|
mArticoloOrdineDao.insert(newArt);
|
||||||
|
}
|
||||||
mArticoloOrdineDao.updateAll(toUpdate);
|
mArticoloOrdineDao.updateAll(toUpdate);
|
||||||
onSuccess.run();
|
onSuccess.run();
|
||||||
|
|
||||||
@@ -48,7 +50,7 @@ public class ArticoliOrdineDataSource extends Repository implements ArticoliOrdi
|
|||||||
public void saveArticoloToOrdine(ArticoloOrdine articolo, Runnable onSuccess, RunnableArgs<Exception> onFail) {
|
public void saveArticoloToOrdine(ArticoloOrdine articolo, Runnable onSuccess, RunnableArgs<Exception> onFail) {
|
||||||
execute(() -> {
|
execute(() -> {
|
||||||
try {
|
try {
|
||||||
if (articolo.getArticoloOrdineId() > 0) {
|
if (articolo.getArticoloOrdineId() != null && articolo.getArticoloOrdineId() > 0) {
|
||||||
mArticoloOrdineDao.update(articolo);
|
mArticoloOrdineDao.update(articolo);
|
||||||
} else {
|
} else {
|
||||||
mArticoloOrdineDao.insert(articolo);
|
mArticoloOrdineDao.insert(articolo);
|
||||||
|
|||||||
@@ -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 {
|
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() {
|
public String getCodMart() {
|
||||||
return codMart;
|
return codMart;
|
||||||
}
|
}
|
||||||
@@ -101,8 +93,65 @@ public class ArticoloDTO {
|
|||||||
this.qtaMinOrdinabile = qtaMinOrdinabile;
|
this.qtaMinOrdinabile = qtaMinOrdinabile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getBarcode() {
|
||||||
|
return barcode;
|
||||||
|
}
|
||||||
|
|
||||||
public ArticoloGriglia toArticoloGriglia(){
|
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();
|
ArticoloGriglia result = new ArticoloGriglia();
|
||||||
result.setBarCode(this.getBarCode());
|
result.setBarCode(this.getBarCode());
|
||||||
result.setDescrizione(this.getDescrizione());
|
result.setDescrizione(this.getDescrizione());
|
||||||
@@ -113,6 +162,11 @@ public class ArticoloDTO {
|
|||||||
result.setMediaSett(this.getMediaSett());
|
result.setMediaSett(this.getMediaSett());
|
||||||
result.setFlagQtaMultipla(this.getFlagQtaMultipla());
|
result.setFlagQtaMultipla(this.getFlagQtaMultipla());
|
||||||
result.setQtaMinOrdinabile(this.getQtaMinOrdinabile());
|
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;
|
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 java.math.BigDecimal;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
|
||||||
public class BindableBigDecimal implements Observable {
|
public class BindableBigDecimal implements Observable {
|
||||||
|
|
||||||
BigDecimal mValue;
|
BigDecimal mValue;
|
||||||
@@ -102,9 +104,24 @@ public class BindableBigDecimal implements Observable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void set(BigDecimal value, boolean forceRefresh) {
|
public void set(BigDecimal value, boolean forceRefresh) {
|
||||||
if (!mValue.equals(value) || forceRefresh) {
|
if ((mValue == null) || !mValue.equals(value) || forceRefresh) {
|
||||||
this.mValue = value;
|
this.mValue = value;
|
||||||
notifyChange();
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package it.integry.integrywmsnative.core.di;
|
package it.integry.integrywmsnative.core.di;
|
||||||
|
|
||||||
import androidx.databinding.BaseObservable;
|
import androidx.databinding.BaseObservable;
|
||||||
|
import androidx.databinding.Observable;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
|
||||||
public class BindableInteger extends BaseObservable {
|
public class BindableInteger extends BaseObservable {
|
||||||
Integer mValue;
|
Integer mValue;
|
||||||
@@ -34,4 +37,19 @@ public class BindableInteger extends BaseObservable {
|
|||||||
return mValue == null;
|
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 {
|
public class BindableString extends BaseObservable {
|
||||||
String value;
|
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() {
|
public String get() {
|
||||||
return value != null ? value : "";
|
return value != null ? value : "";
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.di;
|
|||||||
|
|
||||||
import android.app.DatePickerDialog;
|
import android.app.DatePickerDialog;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
|
import android.text.Html;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -51,7 +52,7 @@ public class Converters {
|
|||||||
|
|
||||||
@BindingConversion
|
@BindingConversion
|
||||||
public static String convertBindableToString(BindableString bindableString) {
|
public static String convertBindableToString(BindableString bindableString) {
|
||||||
if(bindableString != null) return bindableString.get();
|
if (bindableString != null) return bindableString.get();
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +76,8 @@ public class Converters {
|
|||||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
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));
|
view.setTag(R.id.bound_observable, new Pair<>(bindableInteger, watcher));
|
||||||
@@ -97,7 +99,7 @@ public class Converters {
|
|||||||
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
if(observableField != null) observableField.set(s.toString());
|
if (observableField != null) observableField.set(s.toString());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
view.setTag(R.id.bound_observable, new Pair<>(observableField, watcher));
|
view.setTag(R.id.bound_observable, new Pair<>(observableField, watcher));
|
||||||
@@ -126,8 +128,9 @@ public class Converters {
|
|||||||
view.addTextChangedListener(watcher);
|
view.addTextChangedListener(watcher);
|
||||||
}
|
}
|
||||||
String newValue = bindableString.get();
|
String newValue = bindableString.get();
|
||||||
|
boolean isHtml = bindableString.isHtml();
|
||||||
if (!view.getText().toString().equals(newValue)) {
|
if (!view.getText().toString().equals(newValue)) {
|
||||||
view.setText(newValue);
|
view.setText(isHtml ? Html.fromHtml(newValue) : newValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,7 +211,8 @@ public class Converters {
|
|||||||
@Override
|
@Override
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
BigDecimal value = null;
|
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);
|
observableBigDecimal.set(value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -218,11 +222,65 @@ public class Converters {
|
|||||||
BigDecimal newValue = observableBigDecimal.get();
|
BigDecimal newValue = observableBigDecimal.get();
|
||||||
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
|
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
|
||||||
|
|
||||||
if(!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||||
view.setText(UtilityNumber.decimalToString(newValue));
|
view.setText(UtilityNumber.decimalToString(newValue));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@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")
|
@BindingAdapter("binding")
|
||||||
public static void bindTextInputEditTextString(TextInputEditText view, final ObservableField<String> observableString) {
|
public static void bindTextInputEditTextString(TextInputEditText view, final ObservableField<String> observableString) {
|
||||||
Pair<ObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
Pair<ObservableField<String>, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
@@ -242,7 +300,7 @@ public class Converters {
|
|||||||
String newValue = observableString.get();
|
String newValue = observableString.get();
|
||||||
String viewValue = view.getText().toString();
|
String viewValue = view.getText().toString();
|
||||||
|
|
||||||
if(!viewValue.equalsIgnoreCase(newValue)) {
|
if (!viewValue.equalsIgnoreCase(newValue)) {
|
||||||
view.setText(newValue);
|
view.setText(newValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -266,7 +324,7 @@ public class Converters {
|
|||||||
// Get Current Date
|
// Get Current Date
|
||||||
Calendar c = UtilityDate.getCalendarInstance();
|
Calendar c = UtilityDate.getCalendarInstance();
|
||||||
|
|
||||||
if(observableDate.get() != null) {
|
if (observableDate.get() != null) {
|
||||||
c.setTime(observableDate.get());
|
c.setTime(observableDate.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,7 +336,7 @@ public class Converters {
|
|||||||
(cView, year, month, day) -> {
|
(cView, year, month, day) -> {
|
||||||
Date resultDate = new GregorianCalendar(year, month, day).getTime();
|
Date resultDate = new GregorianCalendar(year, month, day).getTime();
|
||||||
|
|
||||||
if(parentFragment != null && warningOnOldDates && resultDate.before(new Date())) {
|
if (parentFragment != null && warningOnOldDates && resultDate.before(new Date())) {
|
||||||
DialogSimpleMessageView
|
DialogSimpleMessageView
|
||||||
.makeWarningDialog(new SpannableString("Hai scelto una data precedente a quella odierna. Continuare?"), null, () -> {
|
.makeWarningDialog(new SpannableString("Hai scelto una data precedente a quella odierna. Continuare?"), null, () -> {
|
||||||
view.setText(UtilityDate.formatDate(resultDate, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
view.setText(UtilityDate.formatDate(resultDate, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||||
@@ -297,8 +355,8 @@ public class Converters {
|
|||||||
|
|
||||||
//Adding click-listener
|
//Adding click-listener
|
||||||
view.setOnClickListener(onClick::run);
|
view.setOnClickListener(onClick::run);
|
||||||
if(view.getParent() != null && view.getParent().getParent() != null && view.getParent().getParent() instanceof TextInputLayout) {
|
if (view.getParent() != null && view.getParent().getParent() != null && view.getParent().getParent() instanceof TextInputLayout) {
|
||||||
((FrameLayout)view.getParent()).setOnClickListener(onClick::run);
|
((FrameLayout) view.getParent()).setOnClickListener(onClick::run);
|
||||||
((TextInputLayout) view.getParent().getParent()).setOnClickListener(onClick::run);
|
((TextInputLayout) view.getParent().getParent()).setOnClickListener(onClick::run);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -367,8 +425,9 @@ public class Converters {
|
|||||||
view.addTextChangedListener(watcher);
|
view.addTextChangedListener(watcher);
|
||||||
}
|
}
|
||||||
String newValue = bindableString.get();
|
String newValue = bindableString.get();
|
||||||
|
boolean isHtml = bindableString.isHtml();
|
||||||
if (!view.getText().toString().equals(newValue)) {
|
if (!view.getText().toString().equals(newValue)) {
|
||||||
view.setText(newValue);
|
view.setText(isHtml ? Html.fromHtml(newValue) : newValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -492,6 +551,12 @@ public class Converters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@BindingAdapter("visibility")
|
||||||
|
public static void bindViewVisibility(View view, boolean bool) {
|
||||||
|
view.setVisibility(bool ? View.VISIBLE : View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@BindingAdapter({"reverse_visibility"})
|
@BindingAdapter({"reverse_visibility"})
|
||||||
public static void bindViewReverseVisibility(View view, final BindableBoolean bindableBoolean) {
|
public static void bindViewReverseVisibility(View view, final BindableBoolean bindableBoolean) {
|
||||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ public abstract class BaseFragment extends Fragment {
|
|||||||
protected final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
protected final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
||||||
mToolbar = toolbar;
|
mToolbar = toolbar;
|
||||||
}
|
}
|
||||||
@@ -34,10 +32,6 @@ public abstract class BaseFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void onLoadingStarted() {
|
public void onLoadingStarted() {
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
@@ -71,23 +65,25 @@ public abstract class BaseFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void openProgress() {
|
protected void openProgress() {
|
||||||
getActivity().runOnUiThread(() -> {
|
getActivity().runOnUiThread(() -> {
|
||||||
if (this.mCurrentProgress == null) {
|
if (this.mCurrentProgress == null) {
|
||||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void closeProgress() {
|
protected void closeProgress() {
|
||||||
getActivity().runOnUiThread(() -> {
|
getActivity().runOnUiThread(() -> {
|
||||||
if (mCurrentProgress != null) {
|
if (mCurrentProgress != null) {
|
||||||
mCurrentProgress.dismiss();
|
mCurrentProgress.dismiss();
|
||||||
mCurrentProgress = null;
|
mCurrentProgress = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void popMe() {
|
protected void popMe() {
|
||||||
((IPoppableActivity) requireActivity()).pop();
|
getActivity().runOnUiThread(() -> {
|
||||||
|
((IPoppableActivity) requireActivity()).pop();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package it.integry.integrywmsnative.core.interfaces;
|
|||||||
|
|
||||||
import androidx.appcompat.widget.SearchView;
|
import androidx.appcompat.widget.SearchView;
|
||||||
|
|
||||||
public interface ISearcableFragment extends SearchView.OnQueryTextListener, IDestroyableFragment {
|
public interface ISearchableFragment extends SearchView.OnQueryTextListener, IDestroyableFragment {
|
||||||
|
|
||||||
void onSearchEnabled();
|
void onSearchEnabled();
|
||||||
|
|
||||||
@@ -106,6 +106,9 @@ public class DtbOrdt extends EntityBase {
|
|||||||
private String noteConferma;
|
private String noteConferma;
|
||||||
private String codJflav;
|
private String codJflav;
|
||||||
|
|
||||||
|
public DtbOrdt() {
|
||||||
|
this.type = "dtb_ordt";
|
||||||
|
}
|
||||||
|
|
||||||
public String getDataOrd() {
|
public String getDataOrd() {
|
||||||
return dataOrd;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -60,7 +60,7 @@ public class MtbColr extends EntityBase {
|
|||||||
public MtbColr() {
|
public MtbColr() {
|
||||||
type = "mtb_colr";
|
type = "mtb_colr";
|
||||||
|
|
||||||
if(SettingsManager.i().isUserLoggedIn()) {
|
if (SettingsManager.i().isUserLoggedIn()) {
|
||||||
setUtente(SettingsManager.i().getUser().getFullname());
|
setUtente(SettingsManager.i().getUser().getFullname());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,6 @@ public class MtbColr extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public MtbColr setGestione(GestioneEnum gestione) {
|
public MtbColr setGestione(GestioneEnum gestione) {
|
||||||
this.gestione = gestione.getText();
|
this.gestione = gestione.getText();
|
||||||
return this;
|
return this;
|
||||||
@@ -124,6 +123,11 @@ public class MtbColr extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MtbColr setDataCollo(Date dataCollo) {
|
||||||
|
setDataCollo(UtilityDate.formatDate(dataCollo, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Integer getRiga() {
|
public Integer getRiga() {
|
||||||
return riga;
|
return riga;
|
||||||
@@ -301,8 +305,6 @@ public class MtbColr extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getDatetimeRowS() {
|
public String getDatetimeRowS() {
|
||||||
return datetimeRow;
|
return datetimeRow;
|
||||||
}
|
}
|
||||||
@@ -322,11 +324,6 @@ public class MtbColr extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getCodJcom() {
|
public String getCodJcom() {
|
||||||
return codJcom;
|
return codJcom;
|
||||||
}
|
}
|
||||||
@@ -364,11 +361,6 @@ public class MtbColr extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getDataScadPartitaS() {
|
public String getDataScadPartitaS() {
|
||||||
return dataScadPartita;
|
return dataScadPartita;
|
||||||
}
|
}
|
||||||
@@ -398,7 +390,6 @@ public class MtbColr extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getUntMis() {
|
public String getUntMis() {
|
||||||
return untMis;
|
return untMis;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class MtbCols extends EntityBase {
|
|||||||
type = "mtb_cols";
|
type = "mtb_cols";
|
||||||
setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep());
|
setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep());
|
||||||
setModificatoDa(SettingsManager.i().getUser().getFullname());
|
setModificatoDa(SettingsManager.i().getUser().getFullname());
|
||||||
setDataMove(UtilityDate.getDateInstance());
|
//setDataMove(UtilityDate.getDateInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDataCollo() {
|
public String getDataCollo() {
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ public class MtbColt extends EntityBase {
|
|||||||
private String codJcom;
|
private String codJcom;
|
||||||
|
|
||||||
private List<MtbCols> mtbCols;
|
private List<MtbCols> mtbCols;
|
||||||
|
private MtbTCol mtbTCol;
|
||||||
|
|
||||||
private Boolean disablePrint;
|
private Boolean disablePrint;
|
||||||
private String ragSocCliente;
|
private String ragSocCliente;
|
||||||
@@ -83,7 +84,6 @@ public class MtbColt extends EntityBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private ObservableArrayList<MtbColr> mtbColr = new ObservableArrayList<>();
|
private ObservableArrayList<MtbColr> mtbColr = new ObservableArrayList<>();
|
||||||
|
|
||||||
public ObservableArrayList<MtbColr> getMtbColr() {
|
public ObservableArrayList<MtbColr> getMtbColr() {
|
||||||
@@ -95,12 +95,12 @@ public class MtbColt extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MtbColt(){
|
public MtbColt() {
|
||||||
type = "mtb_colt";
|
type = "mtb_colt";
|
||||||
setDataCollo(UtilityDate.getDateInstance());
|
setDataCollo(UtilityDate.getDateInstance());
|
||||||
setSerCollo("/");
|
setSerCollo("/");
|
||||||
|
|
||||||
if(SettingsManager.i().isUserLoggedIn()) {
|
if (SettingsManager.i().isUserLoggedIn()) {
|
||||||
setPreparatoDa(SettingsManager.i().getUser().getFullname());
|
setPreparatoDa(SettingsManager.i().getUser().getFullname());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -137,11 +137,11 @@ public class MtbColt extends EntityBase {
|
|||||||
Date dataColloD = null;
|
Date dataColloD = null;
|
||||||
try {
|
try {
|
||||||
dataColloD = getDataColloD();
|
dataColloD = getDataColloD();
|
||||||
} catch (Exception ex){
|
} catch (Exception ex) {
|
||||||
UtilityLogger.errorMe(ex);
|
UtilityLogger.errorMe(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dataColloD != null){
|
if (dataColloD != null) {
|
||||||
return UtilityDate.formatDate(dataColloD, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN_LONG);
|
return UtilityDate.formatDate(dataColloD, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN_LONG);
|
||||||
} else return null;
|
} else return null;
|
||||||
}
|
}
|
||||||
@@ -392,7 +392,7 @@ public class MtbColt extends EntityBase {
|
|||||||
public String getTimeVers() {
|
public String getTimeVers() {
|
||||||
Date dataColloD = getDataVersD();
|
Date dataColloD = getDataVersD();
|
||||||
|
|
||||||
if(dataColloD != null){
|
if (dataColloD != null) {
|
||||||
return UtilityDate.formatDate(dataColloD, UtilityDate.COMMONS_DATE_FORMATS.TIME);
|
return UtilityDate.formatDate(dataColloD, UtilityDate.COMMONS_DATE_FORMATS.TIME);
|
||||||
} else return null;
|
} else return null;
|
||||||
}
|
}
|
||||||
@@ -526,6 +526,15 @@ public class MtbColt extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MtbTCol getMtbTCol() {
|
||||||
|
return mtbTCol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setMtbTCol(MtbTCol mtbTCol) {
|
||||||
|
this.mtbTCol = mtbTCol;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public void generaFiltroOrdineFromDTO(List<FiltroOrdineDTO> filtroOrdineDtos) {
|
public void generaFiltroOrdineFromDTO(List<FiltroOrdineDTO> filtroOrdineDtos) {
|
||||||
|
|
||||||
String xmlPrefix = "{\"whereCond\": \"";
|
String xmlPrefix = "{\"whereCond\": \"";
|
||||||
@@ -533,9 +542,9 @@ public class MtbColt extends EntityBase {
|
|||||||
|
|
||||||
StringBuilder whereCond = new StringBuilder();
|
StringBuilder whereCond = new StringBuilder();
|
||||||
|
|
||||||
if(filtroOrdineDtos != null && filtroOrdineDtos.size() > 0) {
|
if (filtroOrdineDtos != null && filtroOrdineDtos.size() > 0) {
|
||||||
|
|
||||||
for(int i = 0; i < filtroOrdineDtos.size(); i++){
|
for (int i = 0; i < filtroOrdineDtos.size(); i++) {
|
||||||
FiltroOrdineDTO x = filtroOrdineDtos.get(i);
|
FiltroOrdineDTO x = filtroOrdineDtos.get(i);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -545,13 +554,13 @@ public class MtbColt extends EntityBase {
|
|||||||
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH)),
|
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH)),
|
||||||
UtilityDB.valueToString(x.getNumOrd())));
|
UtilityDB.valueToString(x.getNumOrd())));
|
||||||
|
|
||||||
if(!UtilityString.isNullOrEmpty(x.getDataConsS())) {
|
if (!UtilityString.isNullOrEmpty(x.getDataConsS())) {
|
||||||
whereCond.append(String.format(" AND dr.dc = %s",
|
whereCond.append(String.format(" AND dr.dc = %s",
|
||||||
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH))));
|
UtilityDB.valueToString(UtilityDate.formatDate(x.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH))));
|
||||||
}
|
}
|
||||||
|
|
||||||
whereCond.append(")");
|
whereCond.append(")");
|
||||||
if(i < filtroOrdineDtos.size()-1) {
|
if (i < filtroOrdineDtos.size() - 1) {
|
||||||
whereCond.append(" OR ");
|
whereCond.append(" OR ");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -83,7 +83,7 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||||
analyzeAnswer(response, "getByCodMart", (m) -> {
|
analyzeAnswer(response, "getByCodMart", (m) -> {
|
||||||
if(response.body().getEntityList() != null && !response.body().getEntityList().isEmpty()) {
|
if (response.body().getEntityList() != null && !response.body().getEntityList().isEmpty()) {
|
||||||
onComplete.run(response.body().getEntityList().get(0));
|
onComplete.run(response.body().getEntityList().get(0));
|
||||||
} else onComplete.run(null);
|
} else onComplete.run(null);
|
||||||
|
|
||||||
@@ -107,9 +107,10 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
})
|
})
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
var whereCond = " WHERE " + UtilityQuery.concatFieldListInWhereCond(whereCondMap);
|
var whereCond = whereCondMap.isEmpty() ? "" : " WHERE " + UtilityQuery.concatFieldListInWhereCond(whereCondMap);
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbGrup>>() {}.getType();
|
Type typeOfObjectsList = new TypeToken<ArrayList<MtbGrup>>() {
|
||||||
|
}.getType();
|
||||||
this.systemRESTConsumer.processSql("SELECT * FROM mtb_grup " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
this.systemRESTConsumer.processSql("SELECT * FROM mtb_grup " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
|
||||||
|
import com.annimon.stream.Optional;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
@@ -32,6 +33,7 @@ import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
@@ -153,7 +155,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
mtbColrClone
|
mtbColrClone
|
||||||
.setNumCollo(null)
|
.setNumCollo(null)
|
||||||
.setDataCollo(null)
|
.setDataCollo((String) null)
|
||||||
.setRiga(null)
|
.setRiga(null)
|
||||||
.setGestione(GestioneEnum.LAVORAZIONE)
|
.setGestione(GestioneEnum.LAVORAZIONE)
|
||||||
|
|
||||||
@@ -207,7 +209,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
MtbColr mtbColrClone = new MtbColr();
|
MtbColr mtbColrClone = new MtbColr();
|
||||||
mtbColrClone
|
mtbColrClone
|
||||||
.setNumCollo(null)
|
.setNumCollo(null)
|
||||||
.setDataCollo(null)
|
.setDataCollo((String) null)
|
||||||
.setRiga(null)
|
.setRiga(null)
|
||||||
.setGestione(GestioneEnum.LAVORAZIONE)
|
.setGestione(GestioneEnum.LAVORAZIONE)
|
||||||
.setDataColloRif(sourceMtbColt.getDataColloD())
|
.setDataColloRif(sourceMtbColt.getDataColloD())
|
||||||
@@ -237,7 +239,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
saveCollo(newMtbColt, onComplete, onFailed);
|
saveCollo(newMtbColt, onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void createColloFromEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createColloFromEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
createColloFromEtichettaAnonima(barcodeScanDTO.getStringValue(), gestione, onComplete, onFailed);
|
createColloFromEtichettaAnonima(barcodeScanDTO.getStringValue(), gestione, onComplete, onFailed);
|
||||||
}
|
}
|
||||||
@@ -397,7 +398,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void cyclicGetMultipleByTestate(@NotNull Iterator<MtbColt> sourceMtbColts, boolean onlyResiduo, ArrayList<MtbColt> resultMtbColt, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
private void cyclicGetMultipleByTestate(@NotNull Iterator<MtbColt> sourceMtbColts, boolean onlyResiduo, ArrayList<MtbColt> resultMtbColt, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||||
if (sourceMtbColts.hasNext()) {
|
if (sourceMtbColts.hasNext()) {
|
||||||
getByTestata(sourceMtbColts.next(), onlyResiduo, false, mtbColt -> {
|
getByTestata(sourceMtbColts.next(), onlyResiduo, false, mtbColt -> {
|
||||||
@@ -447,7 +447,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void changePosizione(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void changePosizione(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
String codMdep = posizione.getCodMdep();
|
String codMdep = posizione.getCodMdep();
|
||||||
@@ -543,7 +542,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void retrieveBasketColli(RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void retrieveBasketColli(RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
colliMagazzinoRESTConsumerService.getColliInBasket(SettingsManager.i().getUserSession().getDepo().getCodMdep()).enqueue(new Callback<ServiceRESTResponse<List<MtbColt>>>() {
|
colliMagazzinoRESTConsumerService.getColliInBasket(SettingsManager.i().getUserSession().getDepo().getCodMdep()).enqueue(new Callback<ServiceRESTResponse<List<MtbColt>>>() {
|
||||||
@@ -620,7 +618,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void assegnaLottoSuColloScarico(MtbColt sourceMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void assegnaLottoSuColloScarico(MtbColt sourceMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MtbColt sourceMtbColtClone = (MtbColt) sourceMtbColt.clone();
|
MtbColt sourceMtbColtClone = (MtbColt) sourceMtbColt.clone();
|
||||||
|
|
||||||
@@ -646,4 +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.RettificaULDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.http.Body;
|
import retrofit2.http.Body;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
@@ -42,4 +43,7 @@ public interface ColliMagazzinoRESTConsumerService {
|
|||||||
@POST("wms/assegnaLottoSuColloScarico")
|
@POST("wms/assegnaLottoSuColloScarico")
|
||||||
Call<ServiceRESTResponse<MtbColt>> assegnaLottoSuColloScarico(@Body MtbColt mtbColt);
|
Call<ServiceRESTResponse<MtbColt>> assegnaLottoSuColloScarico(@Body MtbColt mtbColt);
|
||||||
|
|
||||||
|
@POST("wms/versamentoAutomaticoUL")
|
||||||
|
Call<ServiceRESTResponse<VersamentoAutomaticoULResponseDTO>> versamentoAutomaticoUL(@Body MtbColt mtbColt);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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 {
|
||||||
|
}
|
||||||
@@ -57,10 +57,10 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
public void printCollo(Type printerType, MtbColt testataColloToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void printCollo(Type printerType, MtbColt testataColloToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
if (BuildConfig.DEBUG) {
|
// if (BuildConfig.DEBUG) {
|
||||||
onComplete.run();
|
// onComplete.run();
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
Call<ServiceRESTResponse<Object>> callable = null;
|
Call<ServiceRESTResponse<Object>> callable = null;
|
||||||
@@ -88,10 +88,10 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
|
|
||||||
public void printReport(String printerName, String reportName, HashMap<String, Object> params, int quantity, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void printReport(String printerName, String reportName, HashMap<String, Object> params, int quantity, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
if (BuildConfig.DEBUG) {
|
// if (BuildConfig.DEBUG) {
|
||||||
onComplete.run();
|
// onComplete.run();
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
JasperDTO jasperDTO = new JasperDTO();
|
JasperDTO jasperDTO = new JasperDTO();
|
||||||
jasperDTO.setReportName(reportName);
|
jasperDTO.setReportName(reportName);
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import android.text.TextUtils;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
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.google.gson.reflect.TypeToken;
|
||||||
import com.orhanobut.logger.Logger;
|
import com.orhanobut.logger.Logger;
|
||||||
|
|
||||||
@@ -13,20 +16,22 @@ import java.io.InputStreamReader;
|
|||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.BuildConfig;
|
import it.integry.integrywmsnative.BuildConfig;
|
||||||
import it.integry.integrywmsnative.core.CommonConst;
|
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.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.MailRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.MailRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|
||||||
import it.integry.integrywmsnative.core.model.Azienda;
|
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
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.UtilityLogger;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
@@ -46,7 +51,17 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
analyzeAnswer(response, "ProcessSql", o -> {
|
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);
|
String json = gson.toJson(o);
|
||||||
|
|
||||||
InputStream ims = new ByteArrayInputStream(json.getBytes());
|
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);
|
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||||
service.getAvailableCodMdeps().enqueue(new Callback<>() {
|
service.getAvailableCodMdeps().enqueue(new Callback<>() {
|
||||||
|
|||||||
@@ -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;
|
package it.integry.integrywmsnative.core.settings;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
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.Azienda;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
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 {
|
public class DBSettingsModel {
|
||||||
|
|
||||||
@@ -33,7 +34,10 @@ public class DBSettingsModel {
|
|||||||
private boolean flagForceAllToColli;
|
private boolean flagForceAllToColli;
|
||||||
private boolean flagSpedizioneEnableManualPick;
|
private boolean flagSpedizioneEnableManualPick;
|
||||||
private boolean flagSpedizioneCanSelectMultipleOrders;
|
private boolean flagSpedizioneCanSelectMultipleOrders;
|
||||||
|
private List<String> notePerditaDocInterni = new ArrayList<>();
|
||||||
private boolean flagSpedizioneUseQtaOrd;
|
private boolean flagSpedizioneUseQtaOrd;
|
||||||
|
private boolean flagOrdinaNuoviArticoliInGriglia;
|
||||||
|
private String docInterniCheckFornitore;
|
||||||
private String produzioneDefaultCodAnag;
|
private String produzioneDefaultCodAnag;
|
||||||
private String reportNameSpedizionChiudiOrdine;
|
private String reportNameSpedizionChiudiOrdine;
|
||||||
private int onNumCnfInputChanged = 1;
|
private int onNumCnfInputChanged = 1;
|
||||||
@@ -70,7 +74,7 @@ public class DBSettingsModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public DBSettingsModel setDatiAzienda(Azienda datiAzienda) {
|
public DBSettingsModel setDatiAzienda(Azienda datiAzienda) {
|
||||||
this.datiAzienda = datiAzienda;
|
this.datiAzienda = datiAzienda;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,6 +249,15 @@ public class DBSettingsModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setFlagOrdinaNuoviArticoliInGriglia(boolean flagOrdinaNuoviArticoliInGriglia) {
|
||||||
|
this.flagOrdinaNuoviArticoliInGriglia = flagOrdinaNuoviArticoliInGriglia;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getFlagOrdinaNuoviArticoliInGriglia() {
|
||||||
|
return this.flagOrdinaNuoviArticoliInGriglia;
|
||||||
|
}
|
||||||
|
|
||||||
public String getProduzioneDefaultCodAnag() {
|
public String getProduzioneDefaultCodAnag() {
|
||||||
return produzioneDefaultCodAnag;
|
return produzioneDefaultCodAnag;
|
||||||
}
|
}
|
||||||
@@ -271,4 +284,22 @@ public class DBSettingsModel {
|
|||||||
this.onNumCnfInputChanged = onNumCnfInputChanged;
|
this.onNumCnfInputChanged = onNumCnfInputChanged;
|
||||||
return this;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.google.firebase.perf.metrics.Trace;
|
|||||||
|
|
||||||
import java.net.SocketTimeoutException;
|
import java.net.SocketTimeoutException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
@@ -129,7 +130,7 @@ public class SettingsManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void loadAvailableCodMdeps(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
private static void loadAvailableCodMdeps(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
SystemRESTConsumer.getAvailableCodMdeps(availableCodMdeps -> {
|
SystemRESTConsumer.getAvailableCodMdepsStatic(availableCodMdeps -> {
|
||||||
dbSettingsModelIstance.setAvailableCodMdep(availableCodMdeps);
|
dbSettingsModelIstance.setAvailableCodMdep(availableCodMdeps);
|
||||||
|
|
||||||
if (availableCodMdeps == null || availableCodMdeps.size() == 0) {
|
if (availableCodMdeps == null || availableCodMdeps.size() == 0) {
|
||||||
@@ -265,6 +266,18 @@ public class SettingsManager {
|
|||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("SETUP")
|
.setSection("SETUP")
|
||||||
.setKeySection("ON_NUM_CNF_INPUT_CHANGED"));
|
.setKeySection("ON_NUM_CNF_INPUT_CHANGED"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PVM")
|
||||||
|
.setSection("DOC_INTERNI")
|
||||||
|
.setKeySection("NOTE_PERDITA"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PVM")
|
||||||
|
.setSection("ORDINI_A")
|
||||||
|
.setKeySection("ORDINA_NUOVI_ARTICOLI"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PVM")
|
||||||
|
.setSection("DOC_INTERNI")
|
||||||
|
.setKeySection("CHECK_FORNITORE"));
|
||||||
|
|
||||||
|
|
||||||
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
|
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
|
||||||
@@ -289,6 +302,13 @@ public class SettingsManager {
|
|||||||
dbSettingsModelIstance.setFlagSpedizioneCanSelectMultipleOrders(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_SELECT_MULTIPLE_ORDERS", Boolean.class));
|
dbSettingsModelIstance.setFlagSpedizioneCanSelectMultipleOrders(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_SELECT_MULTIPLE_ORDERS", Boolean.class));
|
||||||
dbSettingsModelIstance.setReportNameSpedizionChiudiOrdine(getValueFromList(list, "SPEDIZIONE", "REPORT_PACKING_LIST", String.class));
|
dbSettingsModelIstance.setReportNameSpedizionChiudiOrdine(getValueFromList(list, "SPEDIZIONE", "REPORT_PACKING_LIST", String.class));
|
||||||
dbSettingsModelIstance.setFlagSpedizioneUseQtaOrd(getValueFromList(list, "SPEDIZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
dbSettingsModelIstance.setFlagSpedizioneUseQtaOrd(getValueFromList(list, "SPEDIZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
||||||
|
dbSettingsModelIstance.setFlagOrdinaNuoviArticoliInGriglia(getValueFromList(list, "ORDINI_A", "ORDINA_NUOVI_ARTICOLI", Boolean.class));
|
||||||
|
dbSettingsModelIstance.setDocInterniCheckFornitore(getValueFromList(list, "DOC_INTERNI", "CHECK_FORNITORE", String.class));
|
||||||
|
|
||||||
|
String notePerdita = getValueFromList(list, "DOC_INTERNI", "NOTE_PERDITA", String.class);
|
||||||
|
if (notePerdita != null) {
|
||||||
|
dbSettingsModelIstance.setNotePerditaDocInterni(Arrays.asList(notePerdita.split("\\|")));
|
||||||
|
}
|
||||||
|
|
||||||
Integer onNumCnfInputChanged = getValueFromList(list, "SETUP", "ON_NUM_CNF_INPUT_CHANGED", Integer.class);
|
Integer onNumCnfInputChanged = getValueFromList(list, "SETUP", "ON_NUM_CNF_INPUT_CHANGED", Integer.class);
|
||||||
if (onNumCnfInputChanged != null) {
|
if (onNumCnfInputChanged != null) {
|
||||||
|
|||||||
@@ -13,13 +13,19 @@ import java.lang.reflect.Type;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by akshay on 01/03/18.
|
||||||
|
*/
|
||||||
|
|
||||||
public class Stash {
|
public class Stash {
|
||||||
|
|
||||||
private static Stash stash;
|
private static Stash stash;
|
||||||
|
private static Context instance;
|
||||||
private SharedPreferences sp;
|
private SharedPreferences sp;
|
||||||
|
|
||||||
public static void init(Context context) {
|
public static void init(Context context) {
|
||||||
stash = new Stash();
|
stash = new Stash();
|
||||||
|
instance = context;
|
||||||
if (stash.sp == null) {
|
if (stash.sp == null) {
|
||||||
stash.sp = PreferenceManager.getDefaultSharedPreferences(context);
|
stash.sp = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
}
|
}
|
||||||
@@ -34,7 +40,7 @@ public class Stash {
|
|||||||
public static void put(String key, String value) {
|
public static void put(String key, String value) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
stash.sp.edit().putString(key, value).apply();
|
stash.sp.edit().putString(key, value).commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -44,7 +50,7 @@ public class Stash {
|
|||||||
public static void put(String key, Set<String> value) {
|
public static void put(String key, Set<String> value) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
stash.sp.edit().putStringSet(key, value).apply();
|
stash.sp.edit().putStringSet(key, value).commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -54,7 +60,7 @@ public class Stash {
|
|||||||
public static void put(String key, int value) {
|
public static void put(String key, int value) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
stash.sp.edit().putInt(key, value).apply();
|
stash.sp.edit().putInt(key, value).commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -64,7 +70,7 @@ public class Stash {
|
|||||||
public static void put(String key, long value) {
|
public static void put(String key, long value) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
stash.sp.edit().putLong(key, value).apply();
|
stash.sp.edit().putLong(key, value).commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -74,7 +80,7 @@ public class Stash {
|
|||||||
public static void put(String key, float value) {
|
public static void put(String key, float value) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
stash.sp.edit().putFloat(key, value).apply();
|
stash.sp.edit().putFloat(key, value).commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -84,7 +90,7 @@ public class Stash {
|
|||||||
public static void put(String key, boolean value) {
|
public static void put(String key, boolean value) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
stash.sp.edit().putBoolean(key, value).apply();
|
stash.sp.edit().putBoolean(key, value).commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -95,7 +101,7 @@ public class Stash {
|
|||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
Gson gson = new GsonBuilder().create();
|
Gson gson = new GsonBuilder().create();
|
||||||
stash.sp.edit().putString(key, gson.toJson(value).toString()).apply();
|
stash.sp.edit().putString(key, gson.toJson(value)).commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -112,18 +118,26 @@ public class Stash {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getString(String key) {
|
||||||
|
return getString(key, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//getStringSet
|
//getStringSet
|
||||||
public static Set<String> getStringSet(String key, Set<String> defaultvalue) {
|
public static Set<String> getStringSet(String key, Set<String> defaultvalue) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
return getStringSet(key, defaultvalue);
|
return stash.sp.getStringSet(key, defaultvalue);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return defaultvalue;
|
return defaultvalue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Set<String> getStringSet(String key) {
|
||||||
|
return getStringSet(key, null);
|
||||||
|
}
|
||||||
|
|
||||||
//getInt
|
//getInt
|
||||||
public static int getInt(String key, int defaultvalue) {
|
public static int getInt(String key, int defaultvalue) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
@@ -135,6 +149,10 @@ public class Stash {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int getInt(String key) {
|
||||||
|
return getInt(key, 0);
|
||||||
|
}
|
||||||
|
|
||||||
//getLong
|
//getLong
|
||||||
public static long getLong(String key, long defaultvalue) {
|
public static long getLong(String key, long defaultvalue) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
@@ -146,6 +164,10 @@ public class Stash {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static long getLong(String key) {
|
||||||
|
return getLong(key, (long) 0);
|
||||||
|
}
|
||||||
|
|
||||||
//getFloat
|
//getFloat
|
||||||
public static float getFloat(String key, float defaultvalue) {
|
public static float getFloat(String key, float defaultvalue) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
@@ -157,6 +179,10 @@ public class Stash {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static float getFloat(String key) {
|
||||||
|
return getFloat(key, 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
//getBoolean
|
//getBoolean
|
||||||
public static boolean getBoolean(String key, boolean defaultvalue) {
|
public static boolean getBoolean(String key, boolean defaultvalue) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
@@ -168,6 +194,10 @@ public class Stash {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean getBoolean(String key) {
|
||||||
|
return getBoolean(key, false);
|
||||||
|
}
|
||||||
|
|
||||||
//getObject
|
//getObject
|
||||||
public static <T> Object getObject(String key, Class<?> tClass) {
|
public static <T> Object getObject(String key, Class<?> tClass) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
@@ -196,7 +226,7 @@ public class Stash {
|
|||||||
public static void clear(String key) {
|
public static void clear(String key) {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
stash.sp.edit().remove(key).apply();
|
stash.sp.edit().remove(key).commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -206,12 +236,22 @@ public class Stash {
|
|||||||
public static void clearAll() {
|
public static void clearAll() {
|
||||||
checkfornull();
|
checkfornull();
|
||||||
try {
|
try {
|
||||||
stash.sp.edit().clear().apply();
|
stash.sp.edit().clear().commit();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void addListener(StashListener listener){
|
||||||
|
checkfornull();
|
||||||
|
stash.sp.registerOnSharedPreferenceChangeListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void removeListener(StashListener listener){
|
||||||
|
checkfornull();
|
||||||
|
stash.sp.unregisterOnSharedPreferenceChangeListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
private static class GenericType implements ParameterizedType {
|
private static class GenericType implements ParameterizedType {
|
||||||
|
|
||||||
private Type type;
|
private Type type;
|
||||||
@@ -238,4 +278,7 @@ public class Stash {
|
|||||||
// implement equals method too! (as per javadoc)
|
// implement equals method too! (as per javadoc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface StashListener extends SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,8 @@ public class UtilityFocus {
|
|||||||
|
|
||||||
public static void focusTextBox(Context context, EditText editTextToFocus) {
|
public static void focusTextBox(Context context, EditText editTextToFocus) {
|
||||||
editTextToFocus.requestFocus();
|
editTextToFocus.requestFocus();
|
||||||
|
editTextToFocus.setSelectAllOnFocus(true);
|
||||||
|
editTextToFocus.selectAll();
|
||||||
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
imm.showSoftInput(editTextToFocus, InputMethodManager.SHOW_IMPLICIT);
|
imm.showSoftInput(editTextToFocus, InputMethodManager.SHOW_IMPLICIT);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.core.utility;
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
import com.google.android.gms.common.internal.service.Common;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.text.DecimalFormatSymbols;
|
import java.text.DecimalFormatSymbols;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import it.integry.integrywmsnative.core.data_cache.DataCache;
|
|||||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.ISearcableFragment;
|
import it.integry.integrywmsnative.core.interfaces.ISearchableFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
@@ -43,7 +43,7 @@ import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePicking
|
|||||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
public class MainAccettazioneFragment extends BaseFragment implements ISearcableFragment, ITitledFragment, IScrollableFragment, MainAccettazioneViewModel.Listener {
|
public class MainAccettazioneFragment extends BaseFragment implements ISearchableFragment, ITitledFragment, IScrollableFragment, MainAccettazioneViewModel.Listener {
|
||||||
|
|
||||||
public BindableBoolean fabVisible = new BindableBoolean(false);
|
public BindableBoolean fabVisible = new BindableBoolean(false);
|
||||||
|
|
||||||
@@ -53,6 +53,7 @@ public class MainAccettazioneFragment extends BaseFragment implements ISearcable
|
|||||||
private final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
private final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||||
private ElevatedToolbar mToolbar;
|
private ElevatedToolbar mToolbar;
|
||||||
|
|
||||||
|
private String mTextFilter;
|
||||||
private FragmentMainAccettazioneBinding mBinding;
|
private FragmentMainAccettazioneBinding mBinding;
|
||||||
|
|
||||||
private final ObservableArrayList<MainListAccettazioneListModel> mOrdiniInevasiMutableData = new ObservableArrayList<>();
|
private final ObservableArrayList<MainListAccettazioneListModel> mOrdiniInevasiMutableData = new ObservableArrayList<>();
|
||||||
@@ -65,10 +66,7 @@ public class MainAccettazioneFragment extends BaseFragment implements ISearcable
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static MainAccettazioneFragment newInstance() {
|
public static MainAccettazioneFragment newInstance() {
|
||||||
MainAccettazioneFragment fragment = new MainAccettazioneFragment();
|
return new MainAccettazioneFragment();
|
||||||
Bundle args = new Bundle();
|
|
||||||
fragment.setArguments(args);
|
|
||||||
return fragment;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -122,7 +120,9 @@ public class MainAccettazioneFragment extends BaseFragment implements ISearcable
|
|||||||
|
|
||||||
|
|
||||||
private void initRecyclerView() {
|
private void initRecyclerView() {
|
||||||
this.mViewModel.getOrderList().observe(getViewLifecycleOwner(), this::refreshList);
|
this.mViewModel.getOrderList().observe(getViewLifecycleOwner(), x->{
|
||||||
|
this.refreshList(getFilteredList(mTextFilter));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
MainListAccettazioneAdapter adapter = new MainListAccettazioneAdapter(getActivity(), mOrdiniInevasiMutableData)
|
MainListAccettazioneAdapter adapter = new MainListAccettazioneAdapter(getActivity(), mOrdiniInevasiMutableData)
|
||||||
@@ -228,20 +228,25 @@ public class MainAccettazioneFragment extends BaseFragment implements ISearcable
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextChange(String newText) {
|
public boolean onQueryTextChange(String newText) {
|
||||||
|
List<OrdineAccettazioneInevasoDTO> originalList = this.mViewModel.getOrderList().getValue();
|
||||||
|
if(originalList == null || originalList.isEmpty()) return false;
|
||||||
|
mTextFilter = newText;
|
||||||
|
List<OrdineAccettazioneInevasoDTO> filteredOrders = getFilteredList(newText);
|
||||||
|
|
||||||
|
refreshList(filteredOrders);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<OrdineAccettazioneInevasoDTO> getFilteredList(String newText) {
|
||||||
List<OrdineAccettazioneInevasoDTO> filteredOrders = new ArrayList<>();
|
List<OrdineAccettazioneInevasoDTO> filteredOrders = new ArrayList<>();
|
||||||
List<OrdineAccettazioneInevasoDTO> originalList = this.mViewModel.getOrderList().getValue();
|
List<OrdineAccettazioneInevasoDTO> originalList = this.mViewModel.getOrderList().getValue();
|
||||||
|
if(originalList == null || originalList.isEmpty() || newText == null) return originalList;
|
||||||
if(originalList == null || originalList.isEmpty()) return false;
|
|
||||||
|
|
||||||
for(int i = 0; i < originalList.size(); i++){
|
for(int i = 0; i < originalList.size(); i++){
|
||||||
|
|
||||||
if(originalList.get(i).getRagSocOrd().toLowerCase().contains(newText.toLowerCase())){
|
if(originalList.get(i).getRagSocOrd().toLowerCase().contains(newText.toLowerCase())){
|
||||||
filteredOrders.add(originalList.get(i));
|
filteredOrders.add(originalList.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return filteredOrders;
|
||||||
refreshList(filteredOrders);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ import java.math.BigDecimal;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@@ -33,14 +35,17 @@ import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
|||||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.OnGeneralChangedCallback;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
@@ -50,20 +55,28 @@ import it.integry.integrywmsnative.core.utility.UtilityToast;
|
|||||||
import it.integry.integrywmsnative.databinding.ActivityAccettazioneOrdineInevasoBinding;
|
import it.integry.integrywmsnative.databinding.ActivityAccettazioneOrdineInevasoBinding;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.ui.AccettazioneListAdapter;
|
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.ui.AccettazioneListModel;
|
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.AccettazioneOrdineInevasoOrderBy;
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.AccettazioneOrdineInevasoOrderBy;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.AccettazionePickingFiltroOrdineViewModel;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterCodArtLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterDescrLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterPosizioneLayoutView;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.rest.RecoverMtbColt;
|
import it.integry.integrywmsnative.gest.accettazione_picking.rest.RecoverMtbColt;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.ui.AccettazioneListAdapter;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.ui.AccettazioneListModel;
|
||||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliActivity;
|
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliActivity;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterChipView;
|
||||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView;
|
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView;
|
||||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.ask_should_versamento_automatico_ul.DialogAskShouldVersamentoAutomaticoULView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialog;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||||
import it.integry.integrywmsnative.view.dialogs.note_aggiuntive_lu.NoteAggiuntiveLUDialog;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.versamento_automatico_ul_done.DialogVersamentoAutomaticoULDoneView;
|
||||||
|
|
||||||
public class AccettazionePickingActivity extends BaseActivity implements AccettazionePickingViewModel.Listener, BottomSheetFragmentLUContentViewModel.Listener, BottomSheetFragmentLUContentView.Listener {
|
public class AccettazionePickingActivity extends BaseActivity implements AccettazionePickingViewModel.Listener, BottomSheetFragmentLUContentViewModel.Listener, BottomSheetFragmentLUContentView.Listener {
|
||||||
|
|
||||||
@@ -72,6 +85,8 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
@Inject
|
@Inject
|
||||||
AccettazionePickingViewModel mViewModel;
|
AccettazionePickingViewModel mViewModel;
|
||||||
|
|
||||||
|
private final AccettazionePickingFiltroOrdineViewModel mAppliedFilterViewModel = new AccettazionePickingFiltroOrdineViewModel();
|
||||||
|
|
||||||
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
||||||
|
|
||||||
private final ObservableArrayList<AccettazioneListModel> mAccettazioneMutableData = new ObservableArrayList<>();
|
private final ObservableArrayList<AccettazioneListModel> mAccettazioneMutableData = new ObservableArrayList<>();
|
||||||
@@ -123,6 +138,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
this.initVars();
|
this.initVars();
|
||||||
this.initBarcodeReader();
|
this.initBarcodeReader();
|
||||||
this.initRecyclerView();
|
this.initRecyclerView();
|
||||||
|
this.initFilters();
|
||||||
|
|
||||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||||
|
|
||||||
@@ -130,6 +146,158 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
mViewModel.init(mOrders, mSitArts, codMdep);
|
mViewModel.init(mOrders, mSitArts, codMdep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initFilters() {
|
||||||
|
|
||||||
|
var onPredicateChanged = new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
refreshList();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
mAppliedFilterViewModel.getCurrentCodArtPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
mAppliedFilterViewModel.getCurrentDescrPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
mAppliedFilterViewModel.getCurrentPosPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
|
||||||
|
List<FilterChipDTO> filterList = Stream.of(AccettazionePickingBindings.AVAILABLE_FILTERS.entrySet())
|
||||||
|
.map(Map.Entry::getValue)
|
||||||
|
.sortBy(FilterChipDTO::getPosizione)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
for (FilterChipDTO filterChipDTO : filterList) {
|
||||||
|
|
||||||
|
FilterChipView filterChipView = new FilterChipView(
|
||||||
|
this,
|
||||||
|
filterChipDTO.getFilterChipText(),
|
||||||
|
v -> initBottomSheetDialogFilter(filterChipDTO));
|
||||||
|
|
||||||
|
switch (filterChipDTO.getID()) {
|
||||||
|
case AccettazionePickingBindings.COD_ART_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentCodArtPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentCodArtPredicate().get() == null) {
|
||||||
|
mViewModel.resetMatchedRows();
|
||||||
|
filterChipView.disableCloseIcon();
|
||||||
|
|
||||||
|
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||||
|
mBindings.filterChipsGroup.addView(filterChipView);
|
||||||
|
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||||
|
} else {
|
||||||
|
filterChipView.enableCloseIcon();
|
||||||
|
|
||||||
|
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||||
|
mBindings.filterChipsGroup.addView(filterChipView, 0);
|
||||||
|
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
filterChipView.setOnResetClicked(() -> mAppliedFilterViewModel.getCurrentCodArtPredicate().set(null));
|
||||||
|
break;
|
||||||
|
case AccettazionePickingBindings.DESCR_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentDescrPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentDescrPredicate().get() == null) {
|
||||||
|
mViewModel.resetMatchedRows();
|
||||||
|
filterChipView.disableCloseIcon();
|
||||||
|
|
||||||
|
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||||
|
mBindings.filterChipsGroup.addView(filterChipView);
|
||||||
|
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||||
|
} else {
|
||||||
|
filterChipView.enableCloseIcon();
|
||||||
|
|
||||||
|
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||||
|
mBindings.filterChipsGroup.addView(filterChipView, 0);
|
||||||
|
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
filterChipView.setOnResetClicked(() -> mAppliedFilterViewModel.getCurrentDescrPredicate().set(null));
|
||||||
|
break;
|
||||||
|
case AccettazionePickingBindings.POS_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentPosPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentPosPredicate().get() == null) {
|
||||||
|
mViewModel.resetMatchedRows();
|
||||||
|
filterChipView.disableCloseIcon();
|
||||||
|
|
||||||
|
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||||
|
mBindings.filterChipsGroup.addView(filterChipView);
|
||||||
|
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||||
|
} else {
|
||||||
|
filterChipView.enableCloseIcon();
|
||||||
|
|
||||||
|
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||||
|
mBindings.filterChipsGroup.addView(filterChipView, 0);
|
||||||
|
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
filterChipView.setOnResetClicked(() -> mAppliedFilterViewModel.getCurrentPosPredicate().set(null));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.mBindings.filterChipsGroup.addView(filterChipView);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initBottomSheetDialogFilter(FilterChipDTO filterChipDTO) {
|
||||||
|
|
||||||
|
filterChipDTO
|
||||||
|
.getFilterLayoutView()
|
||||||
|
.setFilterName(filterChipDTO.getFilterChipText())
|
||||||
|
.setContext(this);
|
||||||
|
|
||||||
|
var filterLayoutView = filterChipDTO
|
||||||
|
.getFilterLayoutView();
|
||||||
|
|
||||||
|
switch (filterChipDTO.getID()) {
|
||||||
|
case AccettazionePickingBindings.COD_ART_FILTER_ID:
|
||||||
|
((FilterCodArtLayoutView) filterLayoutView)
|
||||||
|
.setAll(mAppliedFilterViewModel.getAllCodArts())
|
||||||
|
.setAvailable(mAppliedFilterViewModel.getAvailableCodArts())
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setCodArtFilter)
|
||||||
|
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||||
|
.filter(mAppliedFilterViewModel.getCurrentCodArtPredicate().get() == null ?
|
||||||
|
x -> false :
|
||||||
|
mAppliedFilterViewModel.getCurrentCodArtPredicate().get())
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getCodMart())
|
||||||
|
.toList());
|
||||||
|
break;
|
||||||
|
case AccettazionePickingBindings.DESCR_FILTER_ID:
|
||||||
|
((FilterDescrLayoutView) filterLayoutView)
|
||||||
|
.setAll(mAppliedFilterViewModel.getAllDescrs())
|
||||||
|
.setAvailable(mAppliedFilterViewModel.getAvailableDescrs())
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setDescrFilter)
|
||||||
|
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||||
|
.filter(mAppliedFilterViewModel.getCurrentDescrPredicate().get() == null ?
|
||||||
|
x -> false :
|
||||||
|
mAppliedFilterViewModel.getCurrentDescrPredicate().get())
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt())
|
||||||
|
.toList());
|
||||||
|
break;
|
||||||
|
case AccettazionePickingBindings.POS_FILTER_ID:
|
||||||
|
((FilterPosizioneLayoutView) filterLayoutView)
|
||||||
|
.setAll(mAppliedFilterViewModel.getAllPos())
|
||||||
|
.setAvailable(mAppliedFilterViewModel.getAvailablePos())
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setPosFilter)
|
||||||
|
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||||
|
.filter(mAppliedFilterViewModel.getCurrentPosPredicate().get() == null ?
|
||||||
|
x -> false :
|
||||||
|
mAppliedFilterViewModel.getCurrentPosPredicate().get())
|
||||||
|
.map(x -> x.getMtbAart().getPosizione())
|
||||||
|
.toList());
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
filterLayoutView.show(getSupportFragmentManager(), "TAG");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onSupportNavigateUp() {
|
public boolean onSupportNavigateUp() {
|
||||||
onBackPressed();
|
onBackPressed();
|
||||||
@@ -162,7 +330,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
// Handle item selection
|
// Handle item selection
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.action_filter:
|
case R.id.action_filter:
|
||||||
showOrderDialog();
|
showOrderByDialog();
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
@@ -189,6 +357,8 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
this.mBindings.accettazionePickingList.setLayoutManager(new LinearLayoutManager(this));
|
this.mBindings.accettazionePickingList.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
|
||||||
this.mViewModel.getPickingList().observe(this, updatedData -> {
|
this.mViewModel.getPickingList().observe(this, updatedData -> {
|
||||||
|
mAppliedFilterViewModel.init(updatedData);
|
||||||
|
|
||||||
refreshList();
|
refreshList();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -198,9 +368,28 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void refreshList() {
|
private void refreshList() {
|
||||||
this.mAccettazioneMutableData.clear();
|
//this.onLoadingStarted();
|
||||||
this.mAccettazioneMutableData.addAll(convertDataModelToListModel(this.mViewModel.getPickingList().getValue()));
|
|
||||||
this.noItemsToPick.set(!isThereAnyItemToPick(this.mViewModel.getPickingList().getValue()));
|
//new Thread(() -> {
|
||||||
|
|
||||||
|
runOnUiThread(() -> {
|
||||||
|
List<PickingObjectDTO> tmpList;
|
||||||
|
|
||||||
|
if (mAppliedFilterViewModel != null) {
|
||||||
|
mAppliedFilterViewModel.applyAllTests();
|
||||||
|
tmpList = mAppliedFilterViewModel.getMutableFilteredOrderList().getValue();
|
||||||
|
} else {
|
||||||
|
tmpList = mViewModel.getPickingList().getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
var list = convertDataModelToListModel(tmpList);
|
||||||
|
|
||||||
|
this.mAccettazioneMutableData.clear();
|
||||||
|
this.mAccettazioneMutableData.addAll(list);
|
||||||
|
this.noItemsToPick.set(!isThereAnyItemToPick(tmpList));
|
||||||
|
|
||||||
|
//this.onLoadingEnded();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<AccettazioneListModel> convertDataModelToListModel(List<PickingObjectDTO> dataList) {
|
private List<AccettazioneListModel> convertDataModelToListModel(List<PickingObjectDTO> dataList) {
|
||||||
@@ -228,17 +417,21 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
private List<AccettazioneListModel> convertDataModelToListModel__CodArtForn(List<PickingObjectDTO> dataList) {
|
private List<AccettazioneListModel> convertDataModelToListModel__CodArtForn(List<PickingObjectDTO> dataList) {
|
||||||
ArrayList<AccettazioneListModel> list = new ArrayList<>();
|
ArrayList<AccettazioneListModel> list = new ArrayList<>();
|
||||||
Stream.of(dataList)
|
Stream.of(dataList)
|
||||||
.sortBy(x -> x.getSitArtOrdDTO().getCodArtFor() + (UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()))
|
.sortBy(x -> UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()) +
|
||||||
|
(UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()))
|
||||||
.forEach(x -> {
|
.forEach(x -> {
|
||||||
AccettazioneListModel accettazioneListModel = new AccettazioneListModel();
|
AccettazioneListModel accettazioneListModel = new AccettazioneListModel();
|
||||||
accettazioneListModel.setActive(true);
|
accettazioneListModel.setActive(true);
|
||||||
|
|
||||||
accettazioneListModel.setGroupTitle(x.getSitArtOrdDTO().getCodArtFor() + (UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()));
|
accettazioneListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()) +
|
||||||
|
(UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()));
|
||||||
|
|
||||||
accettazioneListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
accettazioneListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||||
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||||
|
|
||||||
accettazioneListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
accettazioneListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
||||||
|
if (x.getMtbAart() != null)
|
||||||
|
accettazioneListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||||
|
|
||||||
//Calc Num CNF
|
//Calc Num CNF
|
||||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||||
@@ -295,12 +488,15 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
AccettazioneListModel accettazioneListModel = new AccettazioneListModel();
|
AccettazioneListModel accettazioneListModel = new AccettazioneListModel();
|
||||||
accettazioneListModel.setActive(true);
|
accettazioneListModel.setActive(true);
|
||||||
|
|
||||||
accettazioneListModel.setGroupTitle(x.getSitArtOrdDTO().getCodArtFor() + (UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()));
|
accettazioneListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart())
|
||||||
|
+ (UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()));
|
||||||
|
|
||||||
accettazioneListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
accettazioneListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||||
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||||
|
|
||||||
accettazioneListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
accettazioneListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
||||||
|
if (x.getMtbAart() != null)
|
||||||
|
accettazioneListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||||
|
|
||||||
//Calc Num CNF
|
//Calc Num CNF
|
||||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||||
@@ -361,7 +557,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
accettazioneListModel.setGroupTitle(x.getSitArtOrdDTO().getCodJcom() + (!UtilityString.isNullOrEmpty(x.getSitArtOrdDTO().getDescrizioneCommessa()) ? " - " + x.getSitArtOrdDTO().getDescrizioneCommessa() : ""));
|
accettazioneListModel.setGroupTitle(x.getSitArtOrdDTO().getCodJcom() + (!UtilityString.isNullOrEmpty(x.getSitArtOrdDTO().getDescrizioneCommessa()) ? " - " + x.getSitArtOrdDTO().getDescrizioneCommessa() : ""));
|
||||||
|
|
||||||
accettazioneListModel.setBadge1(x.getSitArtOrdDTO().getCodArtFor());
|
accettazioneListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()));
|
||||||
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||||
|
|
||||||
//Calc Num CNF
|
//Calc Num CNF
|
||||||
@@ -405,6 +601,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
if (x.getMtbAart() != null) {
|
if (x.getMtbAart() != null) {
|
||||||
accettazioneListModel.setDescrizione(x.getMtbAart().getDescrizioneEstesa());
|
accettazioneListModel.setDescrizione(x.getMtbAart().getDescrizioneEstesa());
|
||||||
|
accettazioneListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||||
}
|
}
|
||||||
|
|
||||||
accettazioneListModel.setOriginalModel(x);
|
accettazioneListModel.setOriginalModel(x);
|
||||||
@@ -420,7 +617,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
accettazioneListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
accettazioneListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||||
|
|
||||||
accettazioneListModel.setBadge1(x.getSitArtOrdDTO().getCodArtFor());
|
accettazioneListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()));
|
||||||
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
accettazioneListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||||
|
|
||||||
|
|
||||||
@@ -514,8 +711,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
this.mViewModel.retrieveExistentLU(this::startListaBancaliRegistratiActivity);
|
this.mViewModel.retrieveExistentLU(this::startListaBancaliRegistratiActivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showOrderDialog() {
|
private void showOrderByDialog() {
|
||||||
|
|
||||||
AlertDialog dialog = new AlertDialog.Builder(this)
|
AlertDialog dialog = new AlertDialog.Builder(this)
|
||||||
.setTitle(this.getText(R.string.action_orderBy))
|
.setTitle(this.getText(R.string.action_orderBy))
|
||||||
.setSingleChoiceItems(AccettazioneOrdineInevasoOrderBy.descriptions, mCurrentOrderBy.getVal(), (dialog12, which) -> {
|
.setSingleChoiceItems(AccettazioneOrdineInevasoOrderBy.descriptions, mCurrentOrderBy.getVal(), (dialog12, which) -> {
|
||||||
@@ -527,7 +723,6 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void startListaBancaliRegistratiActivity(ArrayList<RecoverMtbColt> mtbColts) {
|
public void startListaBancaliRegistratiActivity(ArrayList<RecoverMtbColt> mtbColts) {
|
||||||
|
|
||||||
Intent myIntent = ListaBancaliActivity.createIntent(this,
|
Intent myIntent = ListaBancaliActivity.createIntent(this,
|
||||||
@@ -560,7 +755,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
null,
|
null,
|
||||||
R.string.button_ignore_print,
|
R.string.button_ignore_print,
|
||||||
onComplete)
|
onComplete)
|
||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -589,8 +784,18 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNoteAggiuntiveRequest(RunnableArgs<String> onComplete) {
|
public void onVersamentoAutomaticoULRequest(RunnableArgs<Boolean> onComplete) {
|
||||||
NoteAggiuntiveLUDialog.make(this, onComplete::run, () -> onComplete.run(null)).show();
|
runOnUiThread(() -> {
|
||||||
|
DialogAskShouldVersamentoAutomaticoULView.newInstance(onComplete)
|
||||||
|
.show(getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInfoAggiuntiveRequest(RunnableArgss<String, MtbTCol> onComplete) {
|
||||||
|
runOnUiThread(() -> {
|
||||||
|
InfoAggiuntiveLUDialog.newInstance(onComplete).show(getSupportFragmentManager(), "InfoAggiuntiveLUDialog");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -645,44 +850,72 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRowSaved() {
|
public void onRowSaved() {
|
||||||
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
runOnUiThread(() -> {
|
||||||
|
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFilterApplied(String newValue) {
|
public void onFilterCodMartApplied(String codMartToFilter) {
|
||||||
this.mBindings.filteredArtsInListExpandableLayout.expand(true);
|
runOnUiThread(() -> {
|
||||||
this.mBindings.descriptionFilterText.setText(!UtilityString.isNullOrEmpty(newValue) ? newValue : "");
|
var codMarts = new ArrayList<String>();
|
||||||
|
codMarts.add(codMartToFilter);
|
||||||
|
|
||||||
|
this.mAppliedFilterViewModel.setCodArtFilter(codMarts);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFilterRemoved() {
|
public void onFilterPosizioneApplied(String posizioneToFilter) {
|
||||||
mBindings.filteredArtsInListExpandableLayout.collapse(true);
|
runOnUiThread(() -> {
|
||||||
|
var posizioni = new ArrayList<String>();
|
||||||
|
posizioni.add(posizioneToFilter);
|
||||||
|
|
||||||
|
this.mAppliedFilterViewModel.setPosFilter(posizioni);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onULVersata(VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, Runnable onComplete) {
|
||||||
|
|
||||||
|
runOnUiThread(() -> {
|
||||||
|
DialogVersamentoAutomaticoULDoneView
|
||||||
|
.newInstance(versamentoAutomaticoULResponseDTO, onComplete)
|
||||||
|
.show(getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete) {
|
public void onMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete) {
|
||||||
String text = getResources().getString(R.string.alert_delete_mtb_colr);
|
runOnUiThread(() -> {
|
||||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text),
|
String text = getResources().getString(R.string.alert_delete_mtb_colr);
|
||||||
null,
|
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text),
|
||||||
() -> onComplete.run(true),
|
null,
|
||||||
() -> onComplete.run(false)
|
() -> onComplete.run(true),
|
||||||
).show(getSupportFragmentManager(), "tag");
|
() -> onComplete.run(false)
|
||||||
|
).show(getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUOpened(MtbColt mtbColt) {
|
public void onLUOpened(MtbColt mtbColt) {
|
||||||
noLUPresent.set(false);
|
runOnUiThread(() -> {
|
||||||
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
noLUPresent.set(false);
|
||||||
|
FBToast.successToast(this, getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||||
|
|
||||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(mtbColt);
|
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(mtbColt);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUClosed() {
|
public void onLUClosed() {
|
||||||
noLUPresent.set(true);
|
runOnUiThread(() -> {
|
||||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
|
noLUPresent.set(true);
|
||||||
|
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
|
||||||
|
|
||||||
if (this.mShouldCloseActivity) super.onBackPressed();
|
if (this.mShouldCloseActivity) super.onBackPressed();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterCodArtLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterDescrLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterPosizioneLayoutView;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||||
|
|
||||||
|
public class AccettazionePickingBindings {
|
||||||
|
|
||||||
|
public static final int COD_ART_FILTER_ID = 0;
|
||||||
|
public static final int DESCR_FILTER_ID = 1;
|
||||||
|
public static final int POS_FILTER_ID = 2;
|
||||||
|
|
||||||
|
public static final HashMap<Integer, FilterChipDTO> AVAILABLE_FILTERS = new HashMap<>() {
|
||||||
|
{
|
||||||
|
put(COD_ART_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(COD_ART_FILTER_ID)
|
||||||
|
.setPosizione(0)
|
||||||
|
.setFilterChipText("Codice articolo")
|
||||||
|
.setFilterLayoutView(new FilterCodArtLayoutView()));
|
||||||
|
|
||||||
|
put(DESCR_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(DESCR_FILTER_ID)
|
||||||
|
.setPosizione(1)
|
||||||
|
.setFilterChipText("Descrizione articolo")
|
||||||
|
.setFilterLayoutView(new FilterDescrLayoutView()));
|
||||||
|
|
||||||
|
put(POS_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(POS_FILTER_ID)
|
||||||
|
.setPosizione(1)
|
||||||
|
.setFilterChipText("Posizione")
|
||||||
|
.setFilterLayoutView(new FilterPosizioneLayoutView()));
|
||||||
|
}};
|
||||||
|
|
||||||
|
}
|
||||||
@@ -34,6 +34,7 @@ import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
|||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||||
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
@@ -42,11 +43,13 @@ import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsume
|
|||||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityThread;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.HistoryMtbAartDTO;
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.HistoryMtbAartDTO;
|
||||||
@@ -243,6 +246,10 @@ public class AccettazionePickingViewModel {
|
|||||||
this.executeEtichettaEanPeso(barcodeScanDTO, onComplete);
|
this.executeEtichettaEanPeso(barcodeScanDTO, onComplete);
|
||||||
|
|
||||||
|
|
||||||
|
} else if (UtilityBarcode.isEtichettaPosizione(barcodeScanDTO)) {
|
||||||
|
//Applico filtro per posizione
|
||||||
|
this.executeEtichettaPosizione(barcodeScanDTO, onComplete);
|
||||||
|
|
||||||
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||||
//Cerco tramite etichetta ean 128 (che può indicarmi un articolo o una UL)
|
//Cerco tramite etichetta ean 128 (che può indicarmi un articolo o una UL)
|
||||||
this.executeEtichettaEan128(barcodeScanDTO, onComplete);
|
this.executeEtichettaEan128(barcodeScanDTO, onComplete);
|
||||||
@@ -293,6 +300,15 @@ public class AccettazionePickingViewModel {
|
|||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void executeEtichettaPosizione(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||||
|
|
||||||
|
var optionalPos = Stream.of(SettingsManager.iDB().getAvailablePosizioni())
|
||||||
|
.filter(x -> x.getPosizione().equalsIgnoreCase(barcodeScanDTO.getStringValue()))
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
this.sendFilterPosizioneApplied(optionalPos.get().getPosizione());
|
||||||
|
onComplete.run();
|
||||||
|
}
|
||||||
|
|
||||||
private void loadArticolo(String barcodeProd, PickDataDTO pickData, Runnable onComplete) {
|
private void loadArticolo(String barcodeProd, PickDataDTO pickData, Runnable onComplete) {
|
||||||
if (barcodeProd.length() == 14) {
|
if (barcodeProd.length() == 14) {
|
||||||
@@ -332,21 +348,19 @@ public class AccettazionePickingViewModel {
|
|||||||
} else if (matchedRows.size() == 1) {
|
} else if (matchedRows.size() == 1) {
|
||||||
this.dispatchOrdineRow(matchedRows.get(0));
|
this.dispatchOrdineRow(matchedRows.get(0));
|
||||||
} else {
|
} else {
|
||||||
List<PickingObjectDTO> pickingList = mPickingList.getValue();
|
//So che il codMart sarà solo 1
|
||||||
|
var firstCodMart = Stream.of(matchedRows)
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getCodMart())
|
||||||
|
.distinct()
|
||||||
|
.findFirst()
|
||||||
|
.get();
|
||||||
|
|
||||||
for (int i = 0; i < pickingList.size(); i++) {
|
this.sendFilterCodMartApplied(firstCodMart);
|
||||||
if (!matchedRows.contains(pickingList.get(i))) {
|
|
||||||
pickingList.get(i).setHidden(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.sendFilterApplied(null);
|
|
||||||
this.getPickingList().postValue(pickingList);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createNewLU(Integer customNumCollo, String customSerCollo, boolean disablePrint, Runnable onComplete) {
|
public void createNewLU(Integer customNumCollo, String customSerCollo, boolean disablePrint, Runnable onComplete) {
|
||||||
this.sendOnNoteAggiuntiveRequest(additionalNotes -> {
|
this.sendOnInfoAggiuntiveRequest((additionalNotes, tCol) -> {
|
||||||
|
|
||||||
this.mGestSetupRESTConsumer.getValue("PICKING", "SETUP", "DEFAULT_POSIZIONE_COLLI_ACCETTAZIONE", defaultPosAccettazioneDTO -> {
|
this.mGestSetupRESTConsumer.getValue("PICKING", "SETUP", "DEFAULT_POSIZIONE_COLLI_ACCETTAZIONE", defaultPosAccettazioneDTO -> {
|
||||||
|
|
||||||
@@ -362,6 +376,11 @@ public class AccettazionePickingViewModel {
|
|||||||
.setPosizione(defaultPosAccettazione)
|
.setPosizione(defaultPosAccettazione)
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
|
if (tCol != null) {
|
||||||
|
mtbColt.setCodTcol(tCol.getCodTcol());
|
||||||
|
mtbColt.setMtbTCol(tCol);
|
||||||
|
}
|
||||||
|
|
||||||
if (customNumCollo != null) {
|
if (customNumCollo != null) {
|
||||||
mtbColt.setNumCollo(customNumCollo);
|
mtbColt.setNumCollo(customNumCollo);
|
||||||
}
|
}
|
||||||
@@ -571,64 +590,67 @@ public class AccettazionePickingViewModel {
|
|||||||
public void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) {
|
public void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) {
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
String gestioneRif = pickingObjectDTO.getSitArtOrdDTO().getGestioneEnum() == GestioneEnum.PRODUZIONE ? "L" : pickingObjectDTO.getSitArtOrdDTO().getGestione();
|
UtilityThread.executeParallel(() -> {
|
||||||
|
|
||||||
final MtbColr mtbColr = new MtbColr()
|
String gestioneRif = pickingObjectDTO.getSitArtOrdDTO().getGestioneEnum() == GestioneEnum.PRODUZIONE ? "L" : pickingObjectDTO.getSitArtOrdDTO().getGestione();
|
||||||
.setCodMart(pickingObjectDTO.getMtbAart().getCodMart())
|
|
||||||
.setPartitaMag(partitaMag)
|
final MtbColr mtbColr = new MtbColr()
|
||||||
.setDataScadPartita(dataScad)
|
.setCodMart(pickingObjectDTO.getMtbAart().getCodMart())
|
||||||
.setQtaCol(qtaTot)
|
.setPartitaMag(partitaMag)
|
||||||
.setQtaCnf(qtaCnf)
|
.setDataScadPartita(dataScad)
|
||||||
.setNumCnf(numCnf)
|
.setQtaCol(qtaTot)
|
||||||
.setGestioneRif(gestioneRif)
|
.setQtaCnf(qtaCnf)
|
||||||
.setCodJcom(pickingObjectDTO.getSitArtOrdDTO().getCodJcom())
|
.setNumCnf(numCnf)
|
||||||
.setDescrizione(pickingObjectDTO.getMtbAart().getDescrizioneEstesa())
|
.setGestioneRif(gestioneRif)
|
||||||
.setDatetimeRow(UtilityDate.getDateInstance())
|
.setCodJcom(pickingObjectDTO.getSitArtOrdDTO().getCodJcom())
|
||||||
.setDataOrd(pickingObjectDTO.getSitArtOrdDTO().getDataOrd())
|
.setDescrizione(pickingObjectDTO.getMtbAart().getDescrizioneEstesa())
|
||||||
.setNumOrd(pickingObjectDTO.getSitArtOrdDTO().getNumOrd())
|
.setDatetimeRow(UtilityDate.getDateInstance())
|
||||||
.setRigaOrd(pickingObjectDTO.getSitArtOrdDTO().getRigaOrd());
|
.setDataOrd(pickingObjectDTO.getSitArtOrdDTO().getDataOrd())
|
||||||
|
.setNumOrd(pickingObjectDTO.getSitArtOrdDTO().getNumOrd())
|
||||||
|
.setRigaOrd(pickingObjectDTO.getSitArtOrdDTO().getRigaOrd());
|
||||||
|
|
||||||
|
|
||||||
this.addHistoryItem(mtbColr);
|
this.addHistoryItem(mtbColr);
|
||||||
|
|
||||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||||
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
||||||
|
|
||||||
cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
||||||
cloneMtbColt.getMtbColr().add((MtbColr) mtbColr.clone());
|
cloneMtbColt.getMtbColr().add((MtbColr) mtbColr.clone());
|
||||||
|
|
||||||
if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) {
|
if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) {
|
||||||
resetMatchedRows();
|
resetMatchedRows();
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
if (shouldCloseLU) closeLU();
|
if (shouldCloseLU) closeLU();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
||||||
|
|
||||||
mtbColr
|
mtbColr
|
||||||
.setDataCollo(value.getDataColloS())
|
.setDataCollo(value.getDataColloS())
|
||||||
.setNumCollo(value.getNumCollo())
|
.setNumCollo(value.getNumCollo())
|
||||||
.setGestione(value.getGestione())
|
.setGestione(value.getGestione())
|
||||||
.setSerCollo(value.getSerCollo())
|
.setSerCollo(value.getSerCollo())
|
||||||
.setRiga(value.getMtbColr().get(value.getMtbColr().size() - 1).getRiga())
|
.setRiga(value.getMtbColr().get(value.getMtbColr().size() - 1).getRiga())
|
||||||
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||||
|
|
||||||
pickingObjectDTO.getWithdrawMtbColrs().add(mtbColr);
|
pickingObjectDTO.getWithdrawMtbColrs().add(mtbColr);
|
||||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||||
|
|
||||||
//Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei
|
//Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei
|
||||||
resetMatchedRows();
|
resetMatchedRows();
|
||||||
|
|
||||||
this.sendOnRowSaved();
|
this.sendOnRowSaved();
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
if (shouldCloseLU) closeLU();
|
if (shouldCloseLU) closeLU();
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -772,23 +794,47 @@ public class AccettazionePickingViewModel {
|
|||||||
} else {
|
} else {
|
||||||
mColliMagazzinoRESTConsumer.updateDataFine(mCurrentMtbColt, () -> {
|
mColliMagazzinoRESTConsumer.updateDataFine(mCurrentMtbColt, () -> {
|
||||||
|
|
||||||
if (!mCurrentMtbColt.getDisablePrint()) {
|
Runnable onVersamentoCompleted = () -> {
|
||||||
printCollo(this::postCloseOperations);
|
if (!mCurrentMtbColt.getDisablePrint()) {
|
||||||
} else {
|
printCollo(this::postCloseOperations);
|
||||||
postCloseOperations();
|
} else {
|
||||||
}
|
postCloseOperations();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.sendLUClosed();
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
};
|
||||||
|
|
||||||
|
sendVersamentoAutomaticoULRequest(response -> {
|
||||||
|
if (response) {
|
||||||
|
versaAutomaticamenteUL(onVersamentoCompleted);
|
||||||
|
} else {
|
||||||
|
onVersamentoCompleted.run();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
this.sendLUClosed();
|
|
||||||
this.sendOnLoadingEnded();
|
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void versaAutomaticamenteUL(Runnable onComplete) {
|
||||||
|
if (mCurrentMtbColt == null) return;
|
||||||
|
|
||||||
|
mColliMagazzinoRESTConsumer.versamentoAutomaticoUL(mCurrentMtbColt, versamentoResult -> {
|
||||||
|
this.notifyVersamentoAutomaticoResult(versamentoResult, onComplete);
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void printCollo(Runnable onComplete) {
|
private void printCollo(Runnable onComplete) {
|
||||||
|
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||||
|
cloneMtbColt.setGestione(cloneMtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE ? GestioneEnum.PRODUZIONE : cloneMtbColt.getGestioneEnum());
|
||||||
|
|
||||||
this.mPrinterRESTConsumer.printCollo(
|
this.mPrinterRESTConsumer.printCollo(
|
||||||
PrinterRESTConsumer.Type.SECONDARIA,
|
PrinterRESTConsumer.Type.SECONDARIA,
|
||||||
mCurrentMtbColt,
|
cloneMtbColt,
|
||||||
() -> {
|
() -> {
|
||||||
this.sendLUSuccessfullyPrinted();
|
this.sendLUSuccessfullyPrinted();
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
@@ -813,12 +859,10 @@ public class AccettazionePickingViewModel {
|
|||||||
public void resetMatchedRows() {
|
public void resetMatchedRows() {
|
||||||
for (PickingObjectDTO pickingObjectDTO : this.mPickingList.getValue()) {
|
for (PickingObjectDTO pickingObjectDTO : this.mPickingList.getValue()) {
|
||||||
pickingObjectDTO
|
pickingObjectDTO
|
||||||
.setTempPickData(null)
|
.setTempPickData(null);
|
||||||
.setHidden(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mPickingList.postValue(this.mPickingList.getValue());
|
this.mPickingList.postValue(this.mPickingList.getValue());
|
||||||
this.sendFilterRemoved();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addHistoryItem(@NonNull MtbColr mtbColr) {
|
private void addHistoryItem(@NonNull MtbColr mtbColr) {
|
||||||
@@ -854,8 +898,12 @@ public class AccettazionePickingViewModel {
|
|||||||
if (this.mListener != null) mListener.onLoadingEnded();
|
if (this.mListener != null) mListener.onLoadingEnded();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendOnNoteAggiuntiveRequest(RunnableArgs<String> onComplete) {
|
private void sendVersamentoAutomaticoULRequest(RunnableArgs<Boolean> onComplete) {
|
||||||
if (this.mListener != null) this.mListener.onNoteAggiuntiveRequest(onComplete);
|
if (this.mListener != null) this.mListener.onVersamentoAutomaticoULRequest(onComplete);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnInfoAggiuntiveRequest(RunnableArgss<String, MtbTCol> onComplete) {
|
||||||
|
if (this.mListener != null) this.mListener.onInfoAggiuntiveRequest(onComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendError(Exception ex) {
|
private void sendError(Exception ex) {
|
||||||
@@ -922,27 +970,33 @@ public class AccettazionePickingViewModel {
|
|||||||
if (this.mListener != null) mListener.onRowSaved();
|
if (this.mListener != null) mListener.onRowSaved();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendFilterApplied(String newValue) {
|
private void sendFilterCodMartApplied(String codMart) {
|
||||||
if (this.mListener != null) mListener.onFilterApplied(newValue);
|
if (this.mListener != null) mListener.onFilterCodMartApplied(codMart);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendFilterRemoved() {
|
private void sendFilterPosizioneApplied(String posizione) {
|
||||||
if (this.mListener != null) mListener.onFilterRemoved();
|
if (this.mListener != null) mListener.onFilterPosizioneApplied(posizione);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete) {
|
private void sendMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete) {
|
||||||
if (this.mListener != null) mListener.onMtbColrDeleteRequest(onComplete);
|
if (this.mListener != null) mListener.onMtbColrDeleteRequest(onComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AccettazionePickingViewModel setListeners(AccettazionePickingViewModel.Listener
|
private void notifyVersamentoAutomaticoResult(VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, Runnable onComplete) {
|
||||||
listener) {
|
if (this.mListener != null)
|
||||||
|
mListener.onULVersata(versamentoAutomaticoULResponseDTO, onComplete);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AccettazionePickingViewModel setListeners(AccettazionePickingViewModel.Listener listener) {
|
||||||
this.mListener = listener;
|
this.mListener = listener;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface Listener extends ILoadingListener, ILUPrintListener, ILUBaseOperationsListener {
|
public interface Listener extends ILoadingListener, ILUPrintListener, ILUBaseOperationsListener {
|
||||||
|
|
||||||
void onNoteAggiuntiveRequest(RunnableArgs<String> onComplete);
|
void onVersamentoAutomaticoULRequest(RunnableArgs<Boolean> onComplete);
|
||||||
|
|
||||||
|
void onInfoAggiuntiveRequest(RunnableArgss<String, MtbTCol> onComplete);
|
||||||
|
|
||||||
void onError(Exception ex);
|
void onError(Exception ex);
|
||||||
|
|
||||||
@@ -966,9 +1020,11 @@ public class AccettazionePickingViewModel {
|
|||||||
boolean canOverflowQuantity,
|
boolean canOverflowQuantity,
|
||||||
RunnableArgss<PickedQuantityDTO, Boolean> onComplete);
|
RunnableArgss<PickedQuantityDTO, Boolean> onComplete);
|
||||||
|
|
||||||
void onFilterApplied(String newValue);
|
void onFilterCodMartApplied(String codMartToFilter);
|
||||||
|
|
||||||
void onFilterRemoved();
|
void onFilterPosizioneApplied(String posizioneToFilter);
|
||||||
|
|
||||||
|
void onULVersata(VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, Runnable onComplete);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,174 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking.filters;
|
||||||
|
|
||||||
|
import androidx.databinding.ObservableField;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.annimon.stream.function.Predicate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
||||||
|
|
||||||
|
public class AccettazionePickingFiltroOrdineViewModel {
|
||||||
|
|
||||||
|
private final ObservableField<Predicate<PickingObjectDTO>> currentCodArtPredicate = new ObservableField<>();
|
||||||
|
private final ObservableField<Predicate<PickingObjectDTO>> currentDescrPredicate = new ObservableField<>();
|
||||||
|
private final ObservableField<Predicate<PickingObjectDTO>> currentPosPredicate = new ObservableField<>();
|
||||||
|
|
||||||
|
|
||||||
|
private List<PickingObjectDTO> initialOrderList;
|
||||||
|
private final MutableLiveData<List<PickingObjectDTO>> currentFilteredOrderList = new MutableLiveData<>();
|
||||||
|
|
||||||
|
public void init(List<PickingObjectDTO> initialList) {
|
||||||
|
this.initialOrderList = initialList;
|
||||||
|
this.currentFilteredOrderList.setValue(this.initialOrderList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MutableLiveData<List<PickingObjectDTO>> getMutableFilteredOrderList() {
|
||||||
|
return this.currentFilteredOrderList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setCodArtFilter(List<String> codArts) {
|
||||||
|
if (codArts == null || codArts.isEmpty()) currentCodArtPredicate.set(null);
|
||||||
|
else {
|
||||||
|
currentCodArtPredicate.set(o -> codArts.contains(o.getSitArtOrdDTO().getCodMart()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setDescrFilter(List<String> descrs) {
|
||||||
|
if (descrs == null || descrs.isEmpty()) currentDescrPredicate.set(null);
|
||||||
|
else {
|
||||||
|
currentDescrPredicate.set(o -> descrs.contains(o.getSitArtOrdDTO().getDescrizioneEstesaArt()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setPosFilter(List<String> pos) {
|
||||||
|
if (pos == null || pos.isEmpty()) currentPosPredicate.set(null);
|
||||||
|
else {
|
||||||
|
currentPosPredicate.set(o -> o.getMtbAart() != null && o.getMtbAart().getPosizione() == null ? pos.contains(null) : pos.contains(o.getMtbAart().getPosizione()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void applyAllTests() {
|
||||||
|
|
||||||
|
List<PickingObjectDTO> returnList = null;
|
||||||
|
|
||||||
|
if (currentCodArtPredicate.get() == null &&
|
||||||
|
currentDescrPredicate.get() == null &&
|
||||||
|
currentPosPredicate.get() == null) {
|
||||||
|
returnList = this.initialOrderList;
|
||||||
|
} else {
|
||||||
|
Stream<PickingObjectDTO> tmpStream = Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentCodArtPredicate.get() == null || (currentCodArtPredicate.get().test(x))) &&
|
||||||
|
(currentDescrPredicate.get() == null || (currentDescrPredicate.get().test(x))) &&
|
||||||
|
(currentPosPredicate.get() == null || (currentPosPredicate.get().test(x)))
|
||||||
|
);
|
||||||
|
|
||||||
|
returnList = tmpStream.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.currentFilteredOrderList.setValue(returnList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<PickingObjectDTO>> getCurrentCodArtPredicate() {
|
||||||
|
return currentCodArtPredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<PickingObjectDTO>> getCurrentDescrPredicate() {
|
||||||
|
return currentDescrPredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<PickingObjectDTO>> getCurrentPosPredicate() {
|
||||||
|
return currentPosPredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllCodArts() {
|
||||||
|
return Stream
|
||||||
|
.of(Objects.requireNonNull(initialOrderList))
|
||||||
|
.filter(x -> x.getSitArtOrdDTO().getCodMart() != null)
|
||||||
|
.sortBy(x -> x.getSitArtOrdDTO().getCodMart())
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getCodMart() != null ? x.getSitArtOrdDTO().getCodMart() : null)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableCodArts() {
|
||||||
|
|
||||||
|
if (currentDescrPredicate.get() == null &&
|
||||||
|
currentPosPredicate.get() == null) {
|
||||||
|
return getAllCodArts();
|
||||||
|
} else {
|
||||||
|
return Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentDescrPredicate.get() == null || (currentDescrPredicate.get().test(x))) &&
|
||||||
|
(currentPosPredicate.get() == null || (currentPosPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getCodMart())
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllDescrs() {
|
||||||
|
return Stream
|
||||||
|
.of(Objects.requireNonNull(initialOrderList))
|
||||||
|
.filter(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt() != null)
|
||||||
|
.sortBy(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt())
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt() != null ? x.getSitArtOrdDTO().getDescrizioneEstesaArt() : null)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableDescrs() {
|
||||||
|
|
||||||
|
if (currentCodArtPredicate.get() == null &&
|
||||||
|
currentPosPredicate.get() == null) {
|
||||||
|
return getAllDescrs();
|
||||||
|
} else {
|
||||||
|
return Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentCodArtPredicate.get() == null || (currentCodArtPredicate.get().test(x))) &&
|
||||||
|
(currentPosPredicate.get() == null || (currentPosPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt())
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllPos() {
|
||||||
|
return Stream
|
||||||
|
.of(Objects.requireNonNull(initialOrderList))
|
||||||
|
.filter(x -> x.getMtbAart() != null && x.getMtbAart().getPosizione() != null)
|
||||||
|
.sortBy(x -> UtilityString.isNull(x.getMtbAart().getPosizione(), "000000"))
|
||||||
|
.map(x -> x.getMtbAart().getPosizione() != null ? x.getMtbAart().getPosizione() : null)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailablePos() {
|
||||||
|
|
||||||
|
if (currentCodArtPredicate.get() == null &&
|
||||||
|
currentDescrPredicate.get() == null) {
|
||||||
|
return getAllPos();
|
||||||
|
} else {
|
||||||
|
return Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentCodArtPredicate.get() == null || (currentCodArtPredicate.get().test(x))) &&
|
||||||
|
(currentDescrPredicate.get() == null || (currentDescrPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.map(x -> x.getMtbAart().getPosizione())
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,184 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking.filters;
|
||||||
|
|
||||||
|
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.databinding.DataBindingUtil;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.BR;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||||
|
import it.integry.integrywmsnative.databinding.LayoutFilterCodArtBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterCodArtLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterCodArtBinding mBindings;
|
||||||
|
|
||||||
|
private List<String> all;
|
||||||
|
private List<String> available;
|
||||||
|
private List<String> preselected = new ArrayList<>();
|
||||||
|
private List<String> hidden = new ArrayList<>();
|
||||||
|
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||||
|
|
||||||
|
private RunnableArgs<List<String>> onFilterApplied;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_cod_art, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
|
||||||
|
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||||
|
hidden = Stream.of(all)
|
||||||
|
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)) &&
|
||||||
|
!x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_cod_art__list_item)
|
||||||
|
.into(this.mBindings.recyclerview);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshList() {
|
||||||
|
ComparatorCompat<ListModel> c =
|
||||||
|
ComparatorCompat
|
||||||
|
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||||
|
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||||
|
.thenComparing(new ComparatorCompat<>((x, y) -> y.getOriginalModel().compareToIgnoreCase(x.getOriginalModel())))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
|
||||||
|
listModel.setValue(Stream.of(getAll())
|
||||||
|
.filter(x -> !hidden.contains(x))
|
||||||
|
.map(x -> {
|
||||||
|
var selectedBoolean = new BindableBoolean(preselected.contains(x));
|
||||||
|
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||||
|
if (selectedBoolean.get()) preselected.add(x);
|
||||||
|
else preselected.remove(x);
|
||||||
|
});
|
||||||
|
|
||||||
|
return new ListModel()
|
||||||
|
.setSelected(selectedBoolean)
|
||||||
|
.setEnabled(new BindableBoolean(available.contains(x)))
|
||||||
|
.setOriginalModel(x);
|
||||||
|
})
|
||||||
|
.sorted(c)
|
||||||
|
.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAll() {
|
||||||
|
return all;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCodArtLayoutView setAll(List<String> all) {
|
||||||
|
this.all = all;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailable() {
|
||||||
|
return available;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCodArtLayoutView setAvailable(List<String> available) {
|
||||||
|
this.available = available;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getPreselected() {
|
||||||
|
return preselected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCodArtLayoutView setPreselected(List<String> preselected) {
|
||||||
|
this.preselected = preselected;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCodArtLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getHidden() {
|
||||||
|
return hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCodArtLayoutView setHidden(List<String> hidden) {
|
||||||
|
this.hidden = hidden;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ListModel {
|
||||||
|
private BindableBoolean selected = new BindableBoolean();
|
||||||
|
private BindableBoolean enabled = new BindableBoolean();
|
||||||
|
private String originalModel;
|
||||||
|
|
||||||
|
public BindableBoolean getSelected() {
|
||||||
|
return selected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setSelected(BindableBoolean selected) {
|
||||||
|
this.selected = selected;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBoolean getEnabled() {
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setEnabled(BindableBoolean enabled) {
|
||||||
|
this.enabled = enabled;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOriginalModel() {
|
||||||
|
return originalModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setOriginalModel(String originalModel) {
|
||||||
|
this.originalModel = originalModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,184 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking.filters;
|
||||||
|
|
||||||
|
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.databinding.DataBindingUtil;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.BR;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||||
|
import it.integry.integrywmsnative.databinding.LayoutFilterDescrBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterDescrLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterDescrBinding mBindings;
|
||||||
|
|
||||||
|
private List<String> all;
|
||||||
|
private List<String> available;
|
||||||
|
private List<String> preselected = new ArrayList<>();
|
||||||
|
private List<String> hidden = new ArrayList<>();
|
||||||
|
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||||
|
|
||||||
|
private RunnableArgs<List<String>> onFilterApplied;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_descr, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
|
||||||
|
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||||
|
hidden = Stream.of(all)
|
||||||
|
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)) &&
|
||||||
|
!x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_descr__list_item)
|
||||||
|
.into(this.mBindings.recyclerview);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshList() {
|
||||||
|
ComparatorCompat<ListModel> c =
|
||||||
|
ComparatorCompat
|
||||||
|
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||||
|
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||||
|
.thenComparing(new ComparatorCompat<>((x, y) -> y.getOriginalModel().compareToIgnoreCase(x.getOriginalModel())))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
|
||||||
|
listModel.setValue(Stream.of(getAll())
|
||||||
|
.filter(x -> !hidden.contains(x))
|
||||||
|
.map(x -> {
|
||||||
|
var selectedBoolean = new BindableBoolean(preselected.contains(x));
|
||||||
|
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||||
|
if (selectedBoolean.get()) preselected.add(x);
|
||||||
|
else preselected.remove(x);
|
||||||
|
});
|
||||||
|
|
||||||
|
return new ListModel()
|
||||||
|
.setSelected(selectedBoolean)
|
||||||
|
.setEnabled(new BindableBoolean(available.contains(x)))
|
||||||
|
.setOriginalModel(x);
|
||||||
|
})
|
||||||
|
.sorted(c)
|
||||||
|
.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAll() {
|
||||||
|
return all;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDescrLayoutView setAll(List<String> all) {
|
||||||
|
this.all = all;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailable() {
|
||||||
|
return available;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDescrLayoutView setAvailable(List<String> available) {
|
||||||
|
this.available = available;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getPreselected() {
|
||||||
|
return preselected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDescrLayoutView setPreselected(List<String> preselected) {
|
||||||
|
this.preselected = preselected;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDescrLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getHidden() {
|
||||||
|
return hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDescrLayoutView setHidden(List<String> hidden) {
|
||||||
|
this.hidden = hidden;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ListModel {
|
||||||
|
private BindableBoolean selected = new BindableBoolean();
|
||||||
|
private BindableBoolean enabled = new BindableBoolean();
|
||||||
|
private String originalModel;
|
||||||
|
|
||||||
|
public BindableBoolean getSelected() {
|
||||||
|
return selected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setSelected(BindableBoolean selected) {
|
||||||
|
this.selected = selected;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBoolean getEnabled() {
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setEnabled(BindableBoolean enabled) {
|
||||||
|
this.enabled = enabled;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOriginalModel() {
|
||||||
|
return originalModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setOriginalModel(String originalModel) {
|
||||||
|
this.originalModel = originalModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,186 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking.filters;
|
||||||
|
|
||||||
|
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.databinding.DataBindingUtil;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.BR;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.databinding.LayoutFilterPosizioneBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterPosizioneLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterPosizioneBinding mBindings;
|
||||||
|
|
||||||
|
private List<String> all;
|
||||||
|
private List<String> available;
|
||||||
|
private List<String> preselected = new ArrayList<>();
|
||||||
|
private List<String> hidden = new ArrayList<>();
|
||||||
|
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||||
|
|
||||||
|
private RunnableArgs<List<String>> onFilterApplied;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_posizione, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
|
||||||
|
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||||
|
hidden = Stream.of(all)
|
||||||
|
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)) &&
|
||||||
|
!x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_posizione__list_item)
|
||||||
|
.into(this.mBindings.recyclerview);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshList() {
|
||||||
|
ComparatorCompat<ListModel> c =
|
||||||
|
ComparatorCompat
|
||||||
|
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||||
|
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||||
|
.thenComparing(new ComparatorCompat<>((x, y) ->
|
||||||
|
UtilityString.isNull(y.getOriginalModel(), "000000").compareToIgnoreCase(UtilityString.isNull(x.getOriginalModel(), "000000"))))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
|
||||||
|
listModel.setValue(Stream.of(getAll())
|
||||||
|
.filter(x -> !hidden.contains(x))
|
||||||
|
.map(x -> {
|
||||||
|
var selectedBoolean = new BindableBoolean(preselected.contains(x));
|
||||||
|
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||||
|
if (selectedBoolean.get()) preselected.add(x);
|
||||||
|
else preselected.remove(x);
|
||||||
|
});
|
||||||
|
|
||||||
|
return new ListModel()
|
||||||
|
.setSelected(selectedBoolean)
|
||||||
|
.setEnabled(new BindableBoolean(available.contains(x)))
|
||||||
|
.setOriginalModel(x);
|
||||||
|
})
|
||||||
|
.sorted(c)
|
||||||
|
.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAll() {
|
||||||
|
return all;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterPosizioneLayoutView setAll(List<String> all) {
|
||||||
|
this.all = all;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailable() {
|
||||||
|
return available;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterPosizioneLayoutView setAvailable(List<String> available) {
|
||||||
|
this.available = available;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getPreselected() {
|
||||||
|
return preselected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterPosizioneLayoutView setPreselected(List<String> preselected) {
|
||||||
|
this.preselected = preselected;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterPosizioneLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getHidden() {
|
||||||
|
return hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterPosizioneLayoutView setHidden(List<String> hidden) {
|
||||||
|
this.hidden = hidden;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ListModel {
|
||||||
|
private BindableBoolean selected = new BindableBoolean();
|
||||||
|
private BindableBoolean enabled = new BindableBoolean();
|
||||||
|
private String originalModel;
|
||||||
|
|
||||||
|
public BindableBoolean getSelected() {
|
||||||
|
return selected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setSelected(BindableBoolean selected) {
|
||||||
|
this.selected = selected;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBoolean getEnabled() {
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setEnabled(BindableBoolean enabled) {
|
||||||
|
this.enabled = enabled;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOriginalModel() {
|
||||||
|
return originalModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setOriginalModel(String originalModel) {
|
||||||
|
this.originalModel = originalModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -114,7 +114,7 @@ public class AccettazioneListAdapter extends SectionedRecyclerViewAdapter<Accett
|
|||||||
|
|
||||||
holder.mBinding.deactivatedOverBg.setVisibility(!pickingObjectDTO.isActive() ? View.VISIBLE : View.GONE);
|
holder.mBinding.deactivatedOverBg.setVisibility(!pickingObjectDTO.isActive() ? View.VISIBLE : View.GONE);
|
||||||
holder.mBinding.getRoot().setAlpha(!pickingObjectDTO.isActive() ? 0.8f : 1);
|
holder.mBinding.getRoot().setAlpha(!pickingObjectDTO.isActive() ? 0.8f : 1);
|
||||||
holder.mBinding.badge1.setBackground(ResourcesCompat.getDrawable(mContext.getResources(), !pickingObjectDTO.isActive() ? R.drawable.badge_gray_round_corner : R.drawable.badge1_round_corner, null));
|
holder.mBinding.badge1.setBackground(ResourcesCompat.getDrawable(mContext.getResources(), !pickingObjectDTO.isActive() ? R.drawable.badge_round_corner : R.drawable.badge1_round_corner, null));
|
||||||
holder.mBinding.qtaEvasa.setTextColor(ResourcesCompat.getColor(mContext.getResources(), !pickingObjectDTO.isActive() ? R.color.gray_600 : R.color.green_700, null));
|
holder.mBinding.qtaEvasa.setTextColor(ResourcesCompat.getColor(mContext.getResources(), !pickingObjectDTO.isActive() ? R.color.gray_600 : R.color.green_700, null));
|
||||||
|
|
||||||
holder.mBinding.descrizione.setText(pickingObjectDTO.getDescrizione());
|
holder.mBinding.descrizione.setText(pickingObjectDTO.getDescrizione());
|
||||||
@@ -125,6 +125,9 @@ public class AccettazioneListAdapter extends SectionedRecyclerViewAdapter<Accett
|
|||||||
holder.mBinding.badge2.setText(pickingObjectDTO.getBadge2());
|
holder.mBinding.badge2.setText(pickingObjectDTO.getBadge2());
|
||||||
holder.mBinding.badge2.setVisibility(UtilityString.isNullOrEmpty(pickingObjectDTO.getBadge2()) ? View.GONE : View.VISIBLE);
|
holder.mBinding.badge2.setVisibility(UtilityString.isNullOrEmpty(pickingObjectDTO.getBadge2()) ? View.GONE : View.VISIBLE);
|
||||||
|
|
||||||
|
holder.mBinding.badge3.setText(pickingObjectDTO.getPosizione());
|
||||||
|
holder.mBinding.badge3Layout.setVisibility(UtilityString.isNullOrEmpty(pickingObjectDTO.getPosizione()) ? View.GONE : View.VISIBLE);
|
||||||
|
|
||||||
|
|
||||||
holder.mBinding.qtaEvasa.setText(UtilityNumber.decimalToString(pickingObjectDTO.getQtaEvasa()));
|
holder.mBinding.qtaEvasa.setText(UtilityNumber.decimalToString(pickingObjectDTO.getQtaEvasa()));
|
||||||
holder.mBinding.qtaTot.setText(UtilityNumber.decimalToString(pickingObjectDTO.getQtaTot()));
|
holder.mBinding.qtaTot.setText(UtilityNumber.decimalToString(pickingObjectDTO.getQtaTot()));
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ public class AccettazioneListModel implements Cloneable {
|
|||||||
private BigDecimal secQtaTot;
|
private BigDecimal secQtaTot;
|
||||||
private String secUntMis;
|
private String secUntMis;
|
||||||
|
|
||||||
|
private String posizione;
|
||||||
|
|
||||||
private boolean active;
|
private boolean active;
|
||||||
|
|
||||||
private PickingObjectDTO mOriginalModel;
|
private PickingObjectDTO mOriginalModel;
|
||||||
@@ -154,6 +156,15 @@ public class AccettazioneListModel implements Cloneable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPosizione() {
|
||||||
|
return posizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AccettazioneListModel setPosizione(String posizione) {
|
||||||
|
this.posizione = posizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isActive() {
|
public boolean isActive() {
|
||||||
return active;
|
return active;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent()
|
||||||
|
public interface DocInterniComponent {
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
DocInterniComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(DocInterniFragment docInterniFragment);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,206 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni;
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.wrappers.DocInternoWrapper;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
import it.integry.integrywmsnative.databinding.FragmentDocInterniBinding;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoView;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoViewModel;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormActivity;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.ui.DocInterniListAdapter;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.ui.DocInterniListModel;
|
||||||
|
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||||
|
|
||||||
|
public class DocInterniFragment extends BaseFragment implements ITitledFragment, IScrollableFragment, DocInterniViewModel.Listener {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DocInterniViewModel mViewModel;
|
||||||
|
|
||||||
|
private final ObservableArrayList<DocInterniListModel> mDocInterniMutableData = new ObservableArrayList<>();
|
||||||
|
private ElevatedToolbar mToolbar;
|
||||||
|
private FragmentDocInterniBinding mBinding;
|
||||||
|
private DocInterniSetupDTO mDocInterniSetupDTO;
|
||||||
|
private final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||||
|
private boolean dialogInitialized = false;
|
||||||
|
|
||||||
|
|
||||||
|
public DocInterniFragment() {
|
||||||
|
// Required empty public constructor
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DocInterniFragment newInstance() {
|
||||||
|
DocInterniFragment fragment = new DocInterniFragment();
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
fragment.setArguments(args);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||||
|
titleText.setText(context.getText(R.string.doc_interni).toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
|
||||||
|
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_doc_interni, container, false);
|
||||||
|
MainApplication.appComponent
|
||||||
|
.docInterniComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
|
mViewModel.setListeners(this);
|
||||||
|
mBinding.setLifecycleOwner(this);
|
||||||
|
mBinding.setView(this);
|
||||||
|
mBinding.setViewModel(mViewModel);
|
||||||
|
mViewModel.mtbGrup.observe(getViewLifecycleOwner(),mtbGrup-> mViewModel.fetchProducts());
|
||||||
|
mViewModel.dtbTipi.observe(getViewLifecycleOwner(),dtbTipi-> mViewModel.fetchDocuments());
|
||||||
|
this.initRecyclerView();
|
||||||
|
|
||||||
|
return mBinding.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
if (!this.mViewModel.hasDocDetails()){
|
||||||
|
mViewModel.init();
|
||||||
|
}else{
|
||||||
|
this.mViewModel.fetchDocuments();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
for (Runnable onPreDestroy : mOnPreDestroyList) {
|
||||||
|
onPreDestroy.run();
|
||||||
|
}
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDocInterniSetupFetched(DocInterniSetupDTO docInterniSetupDTO) {
|
||||||
|
this.mDocInterniSetupDTO = docInterniSetupDTO;
|
||||||
|
this.dialogInitialized = true;
|
||||||
|
this.selectDocInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDocDetailsChanged(DialogSelectDocInfoViewModel selection) {
|
||||||
|
if(selection.isInputValid()){
|
||||||
|
mViewModel.setSelectedDocDetails(selection);
|
||||||
|
mBinding.mainFab.setVisibility(View.VISIBLE);
|
||||||
|
}else{
|
||||||
|
mBinding.mainFab.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selection.requiresFornitore()){
|
||||||
|
mBinding.codAnagContainer.setVisibility(View.VISIBLE);
|
||||||
|
}else{
|
||||||
|
mBinding.codAnagContainer.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (selection.getSelectedGruppoArt() != null){
|
||||||
|
mBinding.mtbGrpContainer.setVisibility(View.VISIBLE);
|
||||||
|
}else{
|
||||||
|
mBinding.mtbGrpContainer.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selection.requiresDocData()){
|
||||||
|
mBinding.docContainer.setVisibility(View.VISIBLE);
|
||||||
|
mBinding.document.setText(Html.fromHtml(getString(R.string.doc_testata, String.valueOf(selection.getNumDoc()), UtilityDate.formatDate(selection.getDataDoc(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN))));
|
||||||
|
}else{
|
||||||
|
mBinding.docContainer.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
||||||
|
mToolbar = toolbar;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addOnPreDestroy(Runnable onPreDestroy) {
|
||||||
|
this.mOnPreDestroyList.add(onPreDestroy);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void selectDocInfo() {
|
||||||
|
if (this.dialogInitialized){
|
||||||
|
DialogSelectDocInfoView.newInstance(
|
||||||
|
mDocInterniSetupDTO,
|
||||||
|
this.mViewModel.dtbTipi.getValue(),
|
||||||
|
this.mViewModel.mtbGrup.getValue(),
|
||||||
|
this.mViewModel.fornitore.getValue(),
|
||||||
|
this.mViewModel.dataDoc.getValue(),
|
||||||
|
this.mViewModel.numDoc.getValue(),
|
||||||
|
this.mViewModel.note.getValue(),
|
||||||
|
this::onDocDetailsChanged
|
||||||
|
).show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initRecyclerView() {
|
||||||
|
this.mViewModel.getDocsList().observe(getViewLifecycleOwner(), this::refreshList);
|
||||||
|
DocInterniListAdapter docInterniListAdapter = new DocInterniListAdapter(this.requireActivity(), this.mDocInterniMutableData);
|
||||||
|
docInterniListAdapter.setEmptyView(this.mBinding.docInterniEmptyView);
|
||||||
|
this.mBinding.docInterniMainList.setAdapter(docInterniListAdapter);
|
||||||
|
this.mBinding.docInterniMainList.setLayoutManager(new LinearLayoutManager(this.requireActivity()));
|
||||||
|
|
||||||
|
docInterniListAdapter.setOnItemClicked(this.mViewModel::editDocument);
|
||||||
|
if (mToolbar != null)
|
||||||
|
mToolbar.setRecyclerView(this.mBinding.docInterniMainList);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshList(List<DocInternoWrapper> filteredList) {
|
||||||
|
this.mDocInterniMutableData.clear();
|
||||||
|
this.mDocInterniMutableData.addAll(convertDataModelToListModel(mViewModel.getDocsList().getValue()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<DocInterniListModel> convertDataModelToListModel(List<DocInternoWrapper> dataList) {
|
||||||
|
|
||||||
|
return Stream.of(dataList)
|
||||||
|
.map(x -> {
|
||||||
|
DocInterniListModel listModel = new DocInterniListModel();
|
||||||
|
listModel.setDocument(x.getDocument());
|
||||||
|
listModel.setProductsCount(x.getCountArticoli());
|
||||||
|
return listModel;
|
||||||
|
})
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDocumentEditRequest(SqlMtbColt document, GrigliaAcquistiDTO arts) {
|
||||||
|
requireActivity().startActivity(DocInterniEditFormActivity.newInstance(requireActivity(),document,arts));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
import dagger.Provides;
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColtRepository;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||||
|
|
||||||
|
@Module(subcomponents = DocInterniComponent.class)
|
||||||
|
public class DocInterniModule {
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
DocInterniViewModel docInterniViewModel(DocInterniRESTConsumer docInterniRESTConsumer, MtbColtRepository mtbColtRepository) {
|
||||||
|
return new DocInterniViewModel(docInterniRESTConsumer,mtbColtRepository);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,200 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni;
|
||||||
|
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
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.di.BindableInteger;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoViewModel;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.FornitoreDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GruppiArticoloDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipiDocDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||||
|
|
||||||
|
public class DocInterniViewModel {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
MtbColtRepository documentRepository;
|
||||||
|
private Listener mListener;
|
||||||
|
private final DocInterniRESTConsumer mDocInterniRESTConsumer;
|
||||||
|
private boolean productsFetched = true;
|
||||||
|
private boolean docsFetched = true;
|
||||||
|
private int nextNumCollo = 0;
|
||||||
|
private GrigliaAcquistiDTO productsList;
|
||||||
|
private final MutableLiveData<List<DocInternoWrapper>> mDocsList = new MutableLiveData<>();
|
||||||
|
|
||||||
|
public final MutableLiveData<TipiDocDTO> dtbTipi = new MutableLiveData<>();
|
||||||
|
public final MutableLiveData<GruppiArticoloDTO> mtbGrup = new MutableLiveData<>();
|
||||||
|
public final MutableLiveData<FornitoreDTO> fornitore = new MutableLiveData<>();
|
||||||
|
public final MutableLiveData<Date> dataDoc = new MutableLiveData<>();
|
||||||
|
public final MutableLiveData<String> numDoc = new MutableLiveData<>();
|
||||||
|
public final MutableLiveData<String> note = new MutableLiveData<>();
|
||||||
|
public final BindableInteger artsSize = new BindableInteger(0);
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public DocInterniViewModel(DocInterniRESTConsumer docInterniRESTConsumer, MtbColtRepository documentRepository) {
|
||||||
|
mDocInterniRESTConsumer = docInterniRESTConsumer;
|
||||||
|
this.documentRepository = documentRepository;
|
||||||
|
this.mDocsList.setValue(new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void init() {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
// new Thread(() -> {
|
||||||
|
mDocInterniRESTConsumer.getDocInterniSetup(returnDto -> {
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
this.mListener.onDocInterniSetupFetched(returnDto);
|
||||||
|
}, this::sendError);
|
||||||
|
// }).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnLoadingStarted() {
|
||||||
|
if (this.mListener != null) mListener.onLoadingStarted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnLoadingEnded() {
|
||||||
|
if (this.mListener != null) mListener.onLoadingEnded();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendError(Exception ex) {
|
||||||
|
if (this.mListener != null) mListener.onError(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DocInterniViewModel setListeners(Listener listener) {
|
||||||
|
this.mListener = listener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MutableLiveData<List<DocInternoWrapper>> getDocsList() {
|
||||||
|
return mDocsList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelectedDocDetails(DialogSelectDocInfoViewModel selection) {
|
||||||
|
|
||||||
|
this.fornitore.postValue(selection.getSelectedFornitore());
|
||||||
|
this.mtbGrup.postValue(selection.getSelectedGruppoArt());
|
||||||
|
this.dataDoc.postValue(selection.getDataDoc());
|
||||||
|
this.numDoc.postValue(selection.getNumDoc());
|
||||||
|
this.note.postValue(selection.getNote());
|
||||||
|
|
||||||
|
if (selection.getSelectedTipoDoc() != null ) {
|
||||||
|
this.dtbTipi.postValue(selection.getSelectedTipoDoc());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fetchProducts() {
|
||||||
|
this.productsFetched = false;
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
mDocInterniRESTConsumer.fetchProducts(this.getCodDtip(), this.getCodMgrp(), returnDto -> {
|
||||||
|
this.productsFetched = true;
|
||||||
|
this.productsList = returnDto;
|
||||||
|
this.artsSize.set(returnDto.getGrigliaAcquistiChild().size());
|
||||||
|
if (this.docsFetched) {
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
}
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fetchDocuments() {
|
||||||
|
this.docsFetched = false;
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
String codAnag = null, codVdes = null;
|
||||||
|
FornitoreDTO fornitore = this.fornitore.getValue();
|
||||||
|
if (fornitore != null){
|
||||||
|
codAnag = fornitore.getCodAnag();
|
||||||
|
codVdes = fornitore.getCodVdes();
|
||||||
|
}
|
||||||
|
documentRepository.getLocalDocumentsByCodDtip(this.getCodDtip(), codAnag, codVdes, dataDoc.getValue(),numDoc.getValue(), list -> {
|
||||||
|
documentRepository.getNextNumCollo(nextNumCollo -> {
|
||||||
|
this.mDocsList.postValue(list);
|
||||||
|
this.setNextNumCollo(nextNumCollo);
|
||||||
|
this.docsFetched = true;
|
||||||
|
if (this.productsFetched) {
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
}
|
||||||
|
}, this::sendError);
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setNextNumCollo(Integer nextNumCollo) {
|
||||||
|
this.nextNumCollo = nextNumCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getCodDtip() {
|
||||||
|
if (this.dtbTipi.getValue() == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return this.dtbTipi.getValue().getCodDtip();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getCodMgrp() {
|
||||||
|
if (this.mtbGrup.getValue() == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return this.mtbGrup.getValue().getCodMgrp();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void editDocument(SqlMtbColt document) {
|
||||||
|
this.mListener.onDocumentEditRequest(document, productsList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void newDocument() {
|
||||||
|
SqlMtbColt document = new SqlMtbColt();
|
||||||
|
if (this.dtbTipi.getValue() == null) {
|
||||||
|
this.sendError(new Exception("Nessun tipo documento selezionato!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
document.setCodDtipProvv(this.getCodDtip());
|
||||||
|
document.setCodMgrp(this.getCodMgrp());
|
||||||
|
document.setDataCollo(new Date());
|
||||||
|
document.setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep());
|
||||||
|
document.setAnnotazioni(this.note.getValue());
|
||||||
|
document.setSegno(-1);
|
||||||
|
document.setSerCollo("/");
|
||||||
|
document.setNumCollo(this.nextNumCollo);
|
||||||
|
document.setGestione("L");
|
||||||
|
document.setDataDoc(this.dataDoc.getValue());
|
||||||
|
if (this.numDoc.getValue() != null){
|
||||||
|
document.setNumDoc(Integer.parseInt(this.numDoc.getValue()));
|
||||||
|
}
|
||||||
|
if (this.fornitore.getValue() != null){
|
||||||
|
document.setCodAnag(this.fornitore.getValue().getCodAnag());
|
||||||
|
document.setCodVdes(this.fornitore.getValue().getCodVdes());
|
||||||
|
}
|
||||||
|
documentRepository.insert(document, id -> {
|
||||||
|
document.setId(id);
|
||||||
|
this.editDocument(document);
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasDocDetails() {
|
||||||
|
return this.dtbTipi.getValue() != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface Listener extends ILoadingListener {
|
||||||
|
|
||||||
|
void onError(Exception ex);
|
||||||
|
|
||||||
|
void onDocInterniSetupFetched(DocInterniSetupDTO docInterniSetupDTO);
|
||||||
|
|
||||||
|
void onDocDetailsChanged(DialogSelectDocInfoViewModel selection);
|
||||||
|
|
||||||
|
void onDocumentEditRequest(SqlMtbColt document, GrigliaAcquistiDTO arts);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni.dialog;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface DialogSelectDocInfoComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
DialogSelectDocInfoComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void inject(DialogSelectDocInfoView dialogSelectDocInfoView);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni.dialog;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
import dagger.Provides;
|
||||||
|
|
||||||
|
@Module(subcomponents = DialogSelectDocInfoComponent.class)
|
||||||
|
public class DialogSelectDocInfoModule {
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
@Provides
|
||||||
|
DialogSelectDocInfoViewModel dialogSelectMgrpDtipPairViewModel() {
|
||||||
|
return new DialogSelectDocInfoViewModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,240 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni.dialog;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.databinding.ObservableField;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableString;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityObservable;
|
||||||
|
import it.integry.integrywmsnative.databinding.DialogSelectDocInfoBinding;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.FornitoreDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GruppiArticoloDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipiDocDTO;
|
||||||
|
|
||||||
|
public class DialogSelectDocInfoView extends BaseDialogFragment implements DialogSelectDocInfoViewModel.Listener {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogSelectDocInfoViewModel mViewModel;
|
||||||
|
private Context mCurrentContext;
|
||||||
|
|
||||||
|
|
||||||
|
public BindableString codDtip = new BindableString();
|
||||||
|
public BindableString codMgrp = new BindableString();
|
||||||
|
public BindableString codAnag = new BindableString();
|
||||||
|
public BindableString numDoc = new BindableString();
|
||||||
|
public BindableString note = new BindableString();
|
||||||
|
public ObservableField<Date> dataDoc = new ObservableField<>();
|
||||||
|
|
||||||
|
private ArrayAdapter<String> arrayAdapterCodDtips;
|
||||||
|
private ArrayAdapter<String> arrayAdapterCodMgrps;
|
||||||
|
private ArrayAdapter<String> arrayAdapterCodAnags;
|
||||||
|
private ArrayAdapter<String> arrayAdapterNote;
|
||||||
|
private DialogSelectDocInfoBinding mBindings;
|
||||||
|
|
||||||
|
private final RunnableArgs<DialogSelectDocInfoViewModel> currentOnFilterDone;
|
||||||
|
private final DocInterniSetupDTO docInterniSetupDTO;
|
||||||
|
private final TipiDocDTO selectedDtip;
|
||||||
|
private final GruppiArticoloDTO selectedGrp;
|
||||||
|
private final FornitoreDTO selectedAnag;
|
||||||
|
private final Date selectedDataDoc;
|
||||||
|
private final String selectedNumDoc;
|
||||||
|
private final String selectedNote;
|
||||||
|
|
||||||
|
public static DialogSelectDocInfoView newInstance(
|
||||||
|
DocInterniSetupDTO docInterniSetupDTO,
|
||||||
|
TipiDocDTO tipiDocDTO,
|
||||||
|
GruppiArticoloDTO gruppiArticoloDTO,
|
||||||
|
FornitoreDTO fornitoreDTO,
|
||||||
|
Date dataDoc,
|
||||||
|
String numDoc,
|
||||||
|
String note,
|
||||||
|
RunnableArgs<DialogSelectDocInfoViewModel> onDismiss
|
||||||
|
) {
|
||||||
|
return new DialogSelectDocInfoView(docInterniSetupDTO, tipiDocDTO, gruppiArticoloDTO, fornitoreDTO, dataDoc, numDoc,note, onDismiss);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private DialogSelectDocInfoView(DocInterniSetupDTO docInterniSetupDTO,
|
||||||
|
TipiDocDTO tipiDocDTO,
|
||||||
|
GruppiArticoloDTO gruppiArticoloDTO,
|
||||||
|
FornitoreDTO fornitoreDTO,
|
||||||
|
Date dataDoc,
|
||||||
|
String numDoc,
|
||||||
|
String note,
|
||||||
|
RunnableArgs<DialogSelectDocInfoViewModel> onDismiss) {
|
||||||
|
super();
|
||||||
|
currentOnFilterDone = onDismiss;
|
||||||
|
this.docInterniSetupDTO = docInterniSetupDTO;
|
||||||
|
selectedDtip = tipiDocDTO;
|
||||||
|
selectedGrp = gruppiArticoloDTO;
|
||||||
|
selectedDataDoc = dataDoc;
|
||||||
|
selectedNumDoc = numDoc;
|
||||||
|
selectedNote = note;
|
||||||
|
selectedAnag = fornitoreDTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||||
|
super.onDismiss(dialog);
|
||||||
|
if (currentOnFilterDone != null) currentOnFilterDone.run(mViewModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
this.mCurrentContext = this.requireActivity();
|
||||||
|
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.dialog_select_doc_info, container, false);
|
||||||
|
mBindings.setLifecycleOwner(this);
|
||||||
|
|
||||||
|
MainApplication
|
||||||
|
.appComponent
|
||||||
|
.dialogSelectMgrpDtipPairComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
mViewModel.init(docInterniSetupDTO);
|
||||||
|
mViewModel.setListeners(this);
|
||||||
|
mBindings.setView(this);
|
||||||
|
mBindings.setViewmodel(mViewModel);
|
||||||
|
|
||||||
|
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||||
|
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
initView();
|
||||||
|
|
||||||
|
|
||||||
|
mBindings.positiveBtn.setOnClickListener(view -> {
|
||||||
|
if (this.isInputValid()) {
|
||||||
|
getDialog().dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initView() {
|
||||||
|
initArrayAdapters();
|
||||||
|
initBindables();
|
||||||
|
|
||||||
|
if (selectedDtip != null) {
|
||||||
|
codDtip.set(selectedDtip.getLabel());
|
||||||
|
}
|
||||||
|
if (selectedGrp != null) {
|
||||||
|
codMgrp.set(selectedGrp.getLabel());
|
||||||
|
}
|
||||||
|
if (selectedAnag != null) {
|
||||||
|
codAnag.set(selectedAnag.getLabel());
|
||||||
|
}
|
||||||
|
if (selectedDataDoc != null) {
|
||||||
|
dataDoc.set(selectedDataDoc);
|
||||||
|
}
|
||||||
|
if (selectedNumDoc != null) {
|
||||||
|
numDoc.set(selectedNumDoc);
|
||||||
|
}
|
||||||
|
if (selectedNote != null) {
|
||||||
|
note.set(selectedNote);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isInputValid() {
|
||||||
|
if (this.mViewModel.getSelectedTipoDoc() == null) {
|
||||||
|
mBindings.inputCodDtip.setErrorEnabled(true);
|
||||||
|
mBindings.inputCodDtip.setError("Seleziona un tipo documento");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.mViewModel.requiresFornitore() && this.mViewModel.getSelectedFornitore() == null) {
|
||||||
|
mBindings.inputCodAnagForn.setErrorEnabled(true);
|
||||||
|
mBindings.inputCodAnagForn.setError("Seleziona un fornitore/destinatario");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.mViewModel.requiresDocData() && this.mViewModel.getDataDoc() == null){
|
||||||
|
mBindings.inputDataDoc.setError("Seleziona la data del documento");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.mViewModel.requiresDocData() && (this.mViewModel.getNumDoc() == null || this.mViewModel.getNumDoc().isEmpty() )){
|
||||||
|
mBindings.inputNumDoc.setError("Seleziona il numero del documento");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.mViewModel.requiresNote() && (this.mViewModel.getNote() == null || this.mViewModel.getNote().isEmpty() )){
|
||||||
|
mBindings.inputNoteLayout.setErrorEnabled(true);
|
||||||
|
mBindings.inputNoteLayout.setError("Specifica delle note per il documento");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initArrayAdapters() {
|
||||||
|
|
||||||
|
arrayAdapterCodDtips = new ArrayAdapter<>(mCurrentContext, R.layout.dialog_select_doc_info__single_item);
|
||||||
|
arrayAdapterCodDtips.addAll(mViewModel.getAvailableCodDtips());
|
||||||
|
mBindings.filledExposedDropdownCodDtips.setAdapter(arrayAdapterCodDtips);
|
||||||
|
|
||||||
|
arrayAdapterCodMgrps = new ArrayAdapter<>(mCurrentContext, R.layout.dialog_select_doc_info__single_item);
|
||||||
|
arrayAdapterCodMgrps.addAll(mViewModel.getAvailableCodMgrps());
|
||||||
|
mBindings.filledExposedDropdownCodMgrps.setAdapter(arrayAdapterCodMgrps);
|
||||||
|
|
||||||
|
arrayAdapterCodAnags = new ArrayAdapter<>(mCurrentContext, R.layout.dialog_select_doc_info__single_item);
|
||||||
|
arrayAdapterCodAnags.addAll(mViewModel.getAvailableFornitori());
|
||||||
|
mBindings.filledExposedDropdownCodAnagList.setAdapter(arrayAdapterCodAnags);
|
||||||
|
|
||||||
|
arrayAdapterNote = new ArrayAdapter<>(mCurrentContext, R.layout.dialog_select_doc_info__single_item);
|
||||||
|
arrayAdapterNote.addAll(mViewModel.getAdditionalNotes());
|
||||||
|
mBindings.filledExposedDropdownNote.setAdapter(arrayAdapterNote);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initBindables() {
|
||||||
|
BindableString.registerListener(codDtip, codDtip -> {
|
||||||
|
mViewModel.setCodDtip(codDtip);
|
||||||
|
mBindings.inputCodAnagForn.setVisibility(mViewModel.requiresFornitore() ? View.VISIBLE : View.GONE);
|
||||||
|
mBindings.inputDataDocLayout.setVisibility(mViewModel.requiresDocData() ? View.VISIBLE : View.GONE);
|
||||||
|
mBindings.inputNumDocLayout.setVisibility(mViewModel.requiresDocData() ? View.VISIBLE : View.GONE);
|
||||||
|
mBindings.inputNoteLayout.setVisibility(mViewModel.requiresNote() ? View.VISIBLE : View.GONE);
|
||||||
|
});
|
||||||
|
BindableString.registerListener(codMgrp, mViewModel::setCodMgrp);
|
||||||
|
BindableString.registerListener(codAnag, mViewModel::setCodAnag);
|
||||||
|
BindableString.registerListener(numDoc, mViewModel::setNumDoc);
|
||||||
|
BindableString.registerListener(note, mViewModel::setNote);
|
||||||
|
UtilityObservable.addPropertyChanged(this.dataDoc, (value) -> {
|
||||||
|
this.mViewModel.setDataDoc(value);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDocTypeSelected() {
|
||||||
|
arrayAdapterCodAnags.clear();
|
||||||
|
if (mViewModel.getSelectedFornitore() != null && !mViewModel.getAvailableFornitori().contains(mViewModel.getSelectedFornitore().getLabel())) {
|
||||||
|
codAnag.set("");
|
||||||
|
}
|
||||||
|
if (mViewModel.getNote() != null && ! mViewModel.requiresNote()){
|
||||||
|
mViewModel.setNote(null);
|
||||||
|
}
|
||||||
|
arrayAdapterCodAnags.addAll(mViewModel.getAvailableFornitori());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,192 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni.dialog;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.FornitoreDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GruppiArticoloDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipiDocDTO;
|
||||||
|
|
||||||
|
|
||||||
|
public class DialogSelectDocInfoViewModel {
|
||||||
|
|
||||||
|
|
||||||
|
private DocInterniSetupDTO mDocInterniSetupDTO;
|
||||||
|
|
||||||
|
private String mTipoDoc;
|
||||||
|
|
||||||
|
private String mGruppoArt;
|
||||||
|
|
||||||
|
private String mFornitore;
|
||||||
|
|
||||||
|
private Date mDataDoc;
|
||||||
|
|
||||||
|
private String mNumDoc;
|
||||||
|
|
||||||
|
private String mNote;
|
||||||
|
|
||||||
|
private Listener mListener;
|
||||||
|
|
||||||
|
public void init(DocInterniSetupDTO initialList) {
|
||||||
|
this.mDocInterniSetupDTO = initialList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodDtip() {
|
||||||
|
return mTipoDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodDtip(String codDtip) {
|
||||||
|
this.mTipoDoc = codDtip;
|
||||||
|
if (this.getSelectedTipoDoc() != null) {
|
||||||
|
this.mListener.onDocTypeSelected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMgrp() {
|
||||||
|
return mGruppoArt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodMgrp(String codMgrp) {
|
||||||
|
this.mGruppoArt = codMgrp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodAnag(String codAnag) {
|
||||||
|
this.mFornitore = codAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataDoc() {
|
||||||
|
return mDataDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataDoc(Date mDataDoc) {
|
||||||
|
this.mDataDoc = mDataDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNumDoc() {
|
||||||
|
return mNumDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumDoc(String numDoc) {
|
||||||
|
this.mNumDoc = numDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNote() {
|
||||||
|
return mNote;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogSelectDocInfoViewModel setNote(String note) {
|
||||||
|
this.mNote = note;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogSelectDocInfoViewModel setListeners(Listener listener) {
|
||||||
|
this.mListener = listener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableCodDtips() {
|
||||||
|
return mDocInterniSetupDTO.getTipiDoc() != null ? Stream.of(mDocInterniSetupDTO.getTipiDoc()).map(TipiDocDTO::getLabel).toList() : new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableCodMgrps() {
|
||||||
|
return mDocInterniSetupDTO.getGruppiArt() != null ? Stream.of(mDocInterniSetupDTO.getGruppiArt()).map(GruppiArticoloDTO::getLabel).toList() : new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableFornitori() {
|
||||||
|
if (!this.requiresFornitore()) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
TipiDocDTO selectedDocType = getSelectedTipoDoc();
|
||||||
|
|
||||||
|
return Stream.of(mDocInterniSetupDTO.getFornitori())
|
||||||
|
.filter(forn -> {
|
||||||
|
if (selectedDocType.getGestioneDoc().equalsIgnoreCase("T")) {
|
||||||
|
return forn.getTipoAnag().equalsIgnoreCase("D") &&
|
||||||
|
forn.getGestioneAnag().equalsIgnoreCase(
|
||||||
|
selectedDocType.getGestione().equalsIgnoreCase("V") ? "V" : "A"
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return forn.getTipoAnag().equalsIgnoreCase("F") ;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.map(FornitoreDTO::getLabel).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public TipiDocDTO getSelectedTipoDoc() {
|
||||||
|
return Stream.of(mDocInterniSetupDTO.getTipiDoc()).filter(x -> x.getLabel().equals(mTipoDoc)).findFirstOrElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FornitoreDTO getSelectedFornitore() {
|
||||||
|
return Stream.of(mDocInterniSetupDTO.getFornitori()).filter(x -> x.getLabel().equals(mFornitore)).findFirstOrElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GruppiArticoloDTO getSelectedGruppoArt() {
|
||||||
|
if (mGruppoArt == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Stream.of(mDocInterniSetupDTO.getGruppiArt()).filter(x -> x.getLabel().equals(mGruppoArt)).findFirstOrElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean requiresFornitore() {
|
||||||
|
return this.getSelectedTipoDoc() != null && (
|
||||||
|
this.getSelectedTipoDoc().getGestioneDoc().equals("T") ||
|
||||||
|
this.getSelectedTipoDoc().getGestioneDoc().equals("A") ||
|
||||||
|
(
|
||||||
|
this.getSelectedTipoDoc().getGestioneDoc().equals("P") &&
|
||||||
|
!this.getSelectedTipoDoc().getGestione().equals("L")
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean requiresNote() {
|
||||||
|
return this.getSelectedTipoDoc() != null &&
|
||||||
|
this.getSelectedTipoDoc().getGestioneDoc().equals("P") &&
|
||||||
|
this.getSelectedTipoDoc().getGestione().equals("L")
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isInputValid() {
|
||||||
|
if (this.getSelectedTipoDoc() == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.requiresFornitore() && this.getSelectedFornitore() == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.requiresDocData() && (this.getDataDoc() == null || this.getNumDoc() == null)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (this.requiresNote() && (this.getNote() == null || this.getNote().length() <= 0) ){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean requiresDocData() {
|
||||||
|
TipiDocDTO doc = this.getSelectedTipoDoc();
|
||||||
|
return doc != null && doc.getGestioneDoc().equalsIgnoreCase("P") && !doc.getGestione().equalsIgnoreCase("L");
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAdditionalNotes() {
|
||||||
|
return SettingsManager.iDB().getNotePerditaDocInterni();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface Listener extends ILoadingListener {
|
||||||
|
|
||||||
|
void onError(Exception ex);
|
||||||
|
|
||||||
|
void onDocTypeSelected();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class ArtDTO {
|
||||||
|
|
||||||
|
private Integer rigaOrd;
|
||||||
|
|
||||||
|
private String codMart;
|
||||||
|
|
||||||
|
private String barcode;
|
||||||
|
|
||||||
|
private String descrizione;
|
||||||
|
|
||||||
|
private Date dataIns;
|
||||||
|
|
||||||
|
private String untMis;
|
||||||
|
|
||||||
|
private BigDecimal qta;
|
||||||
|
|
||||||
|
private BigDecimal qtaCnf;
|
||||||
|
|
||||||
|
private BigDecimal colli;
|
||||||
|
|
||||||
|
private String partitaMag;
|
||||||
|
|
||||||
|
private Date dataScad;
|
||||||
|
|
||||||
|
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 getBarcode() {
|
||||||
|
return barcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBarcode(String barcode) {
|
||||||
|
this.barcode = barcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescrizione(String descrizione) {
|
||||||
|
this.descrizione = descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataIns() {
|
||||||
|
return dataIns;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataIns(Date dataIns) {
|
||||||
|
this.dataIns = dataIns;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUntMis() {
|
||||||
|
return untMis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUntMis(String untMis) {
|
||||||
|
this.untMis = untMis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQta() {
|
||||||
|
return qta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQta(BigDecimal qta) {
|
||||||
|
this.qta = qta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaCnf() {
|
||||||
|
return qtaCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQtaCnf(BigDecimal qtaCnf) {
|
||||||
|
this.qtaCnf = qtaCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getColli() {
|
||||||
|
return colli;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColli(BigDecimal colli) {
|
||||||
|
this.colli = colli;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPartitaMag() {
|
||||||
|
return partitaMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPartitaMag(String partitaMag) {
|
||||||
|
this.partitaMag = partitaMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataScad() {
|
||||||
|
return dataScad;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataScad(Date dataScad) {
|
||||||
|
this.dataScad = dataScad;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,167 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ColloDTO {
|
||||||
|
|
||||||
|
private String codMdep;
|
||||||
|
private String createdDate;
|
||||||
|
private String annotazioni;
|
||||||
|
private String gestione;
|
||||||
|
private String segno;
|
||||||
|
private String idDisp;
|
||||||
|
private String codDtip;
|
||||||
|
private String codAnag;
|
||||||
|
private String codVdes;
|
||||||
|
private Integer numDoc;
|
||||||
|
private Date dataDoc;
|
||||||
|
private List<ArtDTO> artRows = new ArrayList<>();
|
||||||
|
private RifOrd rifOrd;
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreatedDate() {
|
||||||
|
return createdDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatedDate(String createdDate) {
|
||||||
|
this.createdDate = createdDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAnnotazioni() {
|
||||||
|
return annotazioni;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAnnotazioni(String annotazioni) {
|
||||||
|
this.annotazioni = annotazioni;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGestione() {
|
||||||
|
return gestione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGestione(String gestione) {
|
||||||
|
this.gestione = gestione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSegno() {
|
||||||
|
return segno;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSegno(String segno) {
|
||||||
|
this.segno = segno;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIdDisp() {
|
||||||
|
return idDisp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdDisp(String idDisp) {
|
||||||
|
this.idDisp = idDisp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodDtip() {
|
||||||
|
return codDtip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodDtip(String codDtip) {
|
||||||
|
this.codDtip = codDtip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ArtDTO> getArtRows() {
|
||||||
|
return artRows;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArtRows(List<ArtDTO> artRows) {
|
||||||
|
this.artRows = artRows;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addArtRow(ArtDTO artRow){
|
||||||
|
this.artRows.add(artRow);
|
||||||
|
}
|
||||||
|
|
||||||
|
public RifOrd getRifOrd() {
|
||||||
|
return rifOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodAnag() {
|
||||||
|
return codAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ColloDTO setCodAnag(String codAnag) {
|
||||||
|
this.codAnag = codAnag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumDoc() {
|
||||||
|
return numDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ColloDTO setNumDoc(Integer numDoc) {
|
||||||
|
this.numDoc = numDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataDoc() {
|
||||||
|
return dataDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ColloDTO setDataDoc(Date dataDoc) {
|
||||||
|
this.dataDoc = dataDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodVdes() {
|
||||||
|
return codVdes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ColloDTO setCodVdes(String codVdes) {
|
||||||
|
this.codVdes = codVdes;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRifOrd(RifOrd rifOrd) {
|
||||||
|
this.rifOrd = rifOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class RifOrd {
|
||||||
|
|
||||||
|
private Date dataOrd;
|
||||||
|
|
||||||
|
private Integer numOrd;
|
||||||
|
|
||||||
|
private String chiaveOrd;
|
||||||
|
|
||||||
|
public Date getDataOrd() {
|
||||||
|
return dataOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataOrd(Date dataOrd) {
|
||||||
|
this.dataOrd = dataOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumOrd() {
|
||||||
|
return numOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumOrd(Integer numOrd) {
|
||||||
|
this.numOrd = numOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getChiaveOrd() {
|
||||||
|
return chiaveOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChiaveOrd(String chiaveOrd) {
|
||||||
|
this.chiaveOrd = chiaveOrd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
|
||||||
|
public class DialogChooseRowFromListaDocRowsListModel {
|
||||||
|
|
||||||
|
private String codMart;
|
||||||
|
private String descrizione;
|
||||||
|
private String qtaOrdReadable;
|
||||||
|
private String barcode;
|
||||||
|
private boolean isNew;
|
||||||
|
private SqlMtbColr originalModel;
|
||||||
|
private BindableBoolean checked = new BindableBoolean(false);
|
||||||
|
|
||||||
|
public DialogChooseRowFromListaDocRowsListModel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBoolean getChecked() {
|
||||||
|
return checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseRowFromListaDocRowsListModel setChecked(BindableBoolean checked) {
|
||||||
|
this.checked = checked;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void toggleCheck() {
|
||||||
|
this.checked.set(!this.checked.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMart() {
|
||||||
|
return codMart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseRowFromListaDocRowsListModel setCodMart(String codMart) {
|
||||||
|
this.codMart = codMart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseRowFromListaDocRowsListModel setDescrizione(String descrizione) {
|
||||||
|
this.descrizione = descrizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQtaOrdReadable() {
|
||||||
|
return qtaOrdReadable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseRowFromListaDocRowsListModel setQtaOrdReadable(String qtaOrdReadable) {
|
||||||
|
this.qtaOrdReadable = qtaOrdReadable;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBarcode() {
|
||||||
|
return barcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseRowFromListaDocRowsListModel setBarcode(String barcode) {
|
||||||
|
this.barcode = barcode;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isNew() {
|
||||||
|
return isNew;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseRowFromListaDocRowsListModel setNew(boolean aNew) {
|
||||||
|
isNew = aNew;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SqlMtbColr getOriginalModel() {
|
||||||
|
return originalModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogChooseRowFromListaDocRowsListModel setOriginalModel(SqlMtbColr originalModel) {
|
||||||
|
this.originalModel = originalModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||||
|
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DocFromPickingDTO {
|
||||||
|
String codAnag, codVdes, tipoLista, noteDoc;
|
||||||
|
Date dataDoc;
|
||||||
|
Integer numDoc;
|
||||||
|
List<DatiCollo> colli;
|
||||||
|
List<Pedane> pedane;
|
||||||
|
|
||||||
|
public String getCodAnag() {
|
||||||
|
return codAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DocFromPickingDTO setCodAnag(String codAnag) {
|
||||||
|
this.codAnag = codAnag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodVdes() {
|
||||||
|
return codVdes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DocFromPickingDTO setCodVdes(String codVdes) {
|
||||||
|
this.codVdes = codVdes;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTipoLista() {
|
||||||
|
return tipoLista;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DocFromPickingDTO setTipoLista(String tipoLista) {
|
||||||
|
this.tipoLista = tipoLista;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNoteDoc() {
|
||||||
|
return noteDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DocFromPickingDTO setNoteDoc(String noteDoc) {
|
||||||
|
this.noteDoc = noteDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataDoc() {
|
||||||
|
return dataDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DocFromPickingDTO setDataDoc(Date dataDoc) {
|
||||||
|
this.dataDoc = dataDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumDoc() {
|
||||||
|
return numDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DocFromPickingDTO setNumDoc(Integer numDoc) {
|
||||||
|
this.numDoc = numDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<DatiCollo> getColli() {
|
||||||
|
return colli;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DocFromPickingDTO setColli(List<DatiCollo> colli) {
|
||||||
|
this.colli = colli;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Pedane> getPedane() {
|
||||||
|
return pedane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPedane(List<Pedane> pedane) {
|
||||||
|
this.pedane = pedane;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Pedane {
|
||||||
|
String codTcol;
|
||||||
|
BigDecimal qta;
|
||||||
|
|
||||||
|
public String getCodTcol() {
|
||||||
|
return codTcol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodTcol(String codTcol) {
|
||||||
|
this.codTcol = codTcol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQta() {
|
||||||
|
return qta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQta(BigDecimal qta) {
|
||||||
|
this.qta = qta;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class DatiCollo {
|
||||||
|
String gestione, serCollo;
|
||||||
|
Date dataCollo;
|
||||||
|
Integer numCollo;
|
||||||
|
|
||||||
|
public String getGestione() {
|
||||||
|
return gestione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatiCollo setGestione(String gestione) {
|
||||||
|
this.gestione = gestione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSerCollo() {
|
||||||
|
return serCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatiCollo setSerCollo(String serCollo) {
|
||||||
|
this.serCollo = serCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataCollo() {
|
||||||
|
return dataCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatiCollo setDataCollo(Date dataCollo) {
|
||||||
|
this.dataCollo = dataCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumCollo() {
|
||||||
|
return numCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DatiCollo setNumCollo(Integer numCollo) {
|
||||||
|
this.numCollo = numCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DocInterniSetupDTO {
|
||||||
|
|
||||||
|
|
||||||
|
private List<TipiDocDTO> tipiDoc;
|
||||||
|
|
||||||
|
private List<GruppiArticoloDTO> gruppiArt;
|
||||||
|
|
||||||
|
private List<FornitoreDTO> fornitori;
|
||||||
|
|
||||||
|
|
||||||
|
public List<TipiDocDTO> getTipiDoc() {
|
||||||
|
return tipiDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTipiDoc(List<TipiDocDTO> tipiDoc) {
|
||||||
|
this.tipiDoc = tipiDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<GruppiArticoloDTO> getGruppiArt() {
|
||||||
|
return gruppiArt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGruppiArt(List<GruppiArticoloDTO> gruppiArt) {
|
||||||
|
this.gruppiArt = gruppiArt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<FornitoreDTO> getFornitori() {
|
||||||
|
return fornitori;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFornitori(List<FornitoreDTO> fornitori) {
|
||||||
|
this.fornitori = fornitori;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||||
|
|
||||||
|
public class DocSetupDTO {
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||||
|
|
||||||
|
public class FornitoreDTO {
|
||||||
|
|
||||||
|
|
||||||
|
private String codAnag;
|
||||||
|
|
||||||
|
private String descrizione;
|
||||||
|
|
||||||
|
private String codVdes;
|
||||||
|
|
||||||
|
private String tipoAnag;
|
||||||
|
|
||||||
|
private String gestioneAnag;
|
||||||
|
|
||||||
|
|
||||||
|
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 getDescrizione() {
|
||||||
|
return descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescrizione(String descrizione) {
|
||||||
|
this.descrizione = descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTipoAnag() {
|
||||||
|
return tipoAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTipoAnag(String tipoAnag) {
|
||||||
|
this.tipoAnag = tipoAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGestioneAnag() {
|
||||||
|
return gestioneAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGestioneAnag(String gestioneAnag) {
|
||||||
|
this.gestioneAnag = gestioneAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return this.codAnag + (this.codVdes != null ? " - "+ this.codVdes : "") +" ( " + this.descrizione+" )";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class GrigliaAcquistiChildDTO {
|
||||||
|
|
||||||
|
public String codMart;
|
||||||
|
public String descrizione;
|
||||||
|
public String untMis;
|
||||||
|
public BigDecimal qtaCnf;
|
||||||
|
public String barcode;
|
||||||
|
public BigDecimal merceDaRic;
|
||||||
|
public BigDecimal mediaSett;
|
||||||
|
public String flagQtaMultipla;
|
||||||
|
public String flagTracciabilita;
|
||||||
|
public BigDecimal qtaMinOrdinabile;
|
||||||
|
public boolean newNoPromo;
|
||||||
|
private int ggScadenza;
|
||||||
|
private float giacenza;
|
||||||
|
private float qtaPrevistaVendita;
|
||||||
|
private float qtaProposta;
|
||||||
|
|
||||||
|
public String getCodMart() {
|
||||||
|
return codMart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrigliaAcquistiChildDTO setCodMart(String codMart) {
|
||||||
|
this.codMart = codMart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrigliaAcquistiChildDTO setDescrizione(String descrizione) {
|
||||||
|
this.descrizione = descrizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUntMis() {
|
||||||
|
return untMis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrigliaAcquistiChildDTO setUntMis(String untMis) {
|
||||||
|
this.untMis = untMis;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaCnf() {
|
||||||
|
return qtaCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrigliaAcquistiChildDTO setQtaCnf(BigDecimal qtaCnf) {
|
||||||
|
this.qtaCnf = qtaCnf;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBarcode() {
|
||||||
|
return barcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrigliaAcquistiChildDTO setBarcode(String barcode) {
|
||||||
|
this.barcode = barcode;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getMerceDaRic() {
|
||||||
|
return merceDaRic;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrigliaAcquistiChildDTO setMerceDaRic(BigDecimal merceDaRic) {
|
||||||
|
this.merceDaRic = merceDaRic;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getMediaSett() {
|
||||||
|
return mediaSett;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrigliaAcquistiChildDTO setMediaSett(BigDecimal mediaSett) {
|
||||||
|
this.mediaSett = mediaSett;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagQtaMultipla() {
|
||||||
|
return flagQtaMultipla;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrigliaAcquistiChildDTO setFlagQtaMultipla(String flagQtaMultipla) {
|
||||||
|
this.flagQtaMultipla = flagQtaMultipla;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaMinOrdinabile() {
|
||||||
|
return qtaMinOrdinabile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrigliaAcquistiChildDTO setQtaMinOrdinabile(BigDecimal qtaMinOrdinabile) {
|
||||||
|
this.qtaMinOrdinabile = qtaMinOrdinabile;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagTracciabilita() {
|
||||||
|
return flagTracciabilita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrigliaAcquistiChildDTO setFlagTracciabilita(String flagTracciabilita) {
|
||||||
|
this.flagTracciabilita = flagTracciabilita;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getGgScadenza() {
|
||||||
|
return ggScadenza;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrigliaAcquistiChildDTO setGgScadenza(int ggScadenza) {
|
||||||
|
this.ggScadenza = ggScadenza;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getGiacenza() {
|
||||||
|
return giacenza;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrigliaAcquistiChildDTO setGiacenza(float giacenza) {
|
||||||
|
this.giacenza = giacenza;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getQtaPrevistaVendita() {
|
||||||
|
return qtaPrevistaVendita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrigliaAcquistiChildDTO setQtaPrevistaVendita(float qtaPrevistaVendita) {
|
||||||
|
this.qtaPrevistaVendita = qtaPrevistaVendita;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getQtaProposta() {
|
||||||
|
return qtaProposta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrigliaAcquistiChildDTO setQtaProposta(float qtaProposta) {
|
||||||
|
this.qtaProposta = qtaProposta;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isNewNoPromo() {
|
||||||
|
return newNoPromo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrigliaAcquistiChildDTO setNewNoPromo(boolean newNoPromo) {
|
||||||
|
this.newNoPromo = newNoPromo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class GrigliaAcquistiDTO {
|
||||||
|
|
||||||
|
private String descrLisa;
|
||||||
|
|
||||||
|
private String descrDepo;
|
||||||
|
|
||||||
|
private List<GrigliaAcquistiChildDTO> grigliaAcquistiChild;
|
||||||
|
|
||||||
|
public String getDescrLisa() {
|
||||||
|
return descrLisa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescrLisa(String descrLisa) {
|
||||||
|
this.descrLisa = descrLisa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrDepo() {
|
||||||
|
return descrDepo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescrDepo(String descrDepo) {
|
||||||
|
this.descrDepo = descrDepo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<GrigliaAcquistiChildDTO> getGrigliaAcquistiChild() {
|
||||||
|
return grigliaAcquistiChild;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGrigliaAcquistiChild(List<GrigliaAcquistiChildDTO> grigliaAcquistiChild) {
|
||||||
|
this.grigliaAcquistiChild = grigliaAcquistiChild;
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user