Compare commits
125 Commits
v1.24.3(27
...
v1.28.3(29
| Author | SHA1 | Date | |
|---|---|---|---|
| 84876bf7c1 | |||
| fca325855e | |||
| c6fc287a3f | |||
| 29fd0292e7 | |||
| 90cf83e3cd | |||
| f4c1f1fe34 | |||
| 9e85b9f828 | |||
| a9fd55c01f | |||
| 506a56a1a2 | |||
| c93e29606c | |||
| 4adc40aa90 | |||
| 4842a6091b | |||
| 9faf4123ef | |||
| cdf5b413a2 | |||
| 4dd2ccdb13 | |||
| 56c54d3cde | |||
| 19e2d5b869 | |||
| 0acf023556 | |||
| 71f6dc83fb | |||
| 3479ee2b87 | |||
| 609b9f1852 | |||
| 23c98d9218 | |||
| 57900a9617 | |||
| c3274a4311 | |||
| 356e2562da | |||
| 46c0078331 | |||
| bbc81f3d99 | |||
| 0dd662518e | |||
| 08d332e2c6 | |||
| b9001790be | |||
| d43bd8e659 | |||
| ef2886c963 | |||
| 7a6097fa69 | |||
| 9c45cebf51 | |||
| 344fc42d03 | |||
| 33a01b2c15 | |||
| d165174345 | |||
| 05314803bc | |||
| 9db8337f9b | |||
| abfd92ce07 | |||
| c11858aea2 | |||
| a67b28f0ad | |||
| b9f5baae5f | |||
| cb5e36ffb7 | |||
| 82ff37f4ee | |||
| 350c4bc4ed | |||
| 33f0866ea2 | |||
| df13a6e29d | |||
| ee8fa96c40 | |||
| c264cd38e3 | |||
| 64f669753f | |||
| aabc4310fd | |||
| 9dc3996aef | |||
| e0e9e657c9 | |||
| 84cbab334f | |||
| f9751e770a | |||
| 6539c9179e | |||
| f43a7acf35 | |||
| ca96bacde6 | |||
| d4c94b7ab9 | |||
| 0c9e607c33 | |||
| b5c6ce2aa5 | |||
| 66f58ea20d | |||
| d6979289e2 | |||
| 496387b5c6 | |||
| 6b0d75fc60 | |||
| 7d263699da | |||
| 63e4e4e791 | |||
| 98c260f621 | |||
| 1b57dc74cf | |||
| 4f140d0d58 | |||
| 0d021e6bad | |||
| 1a0af47613 | |||
| ead509bb32 | |||
| ddfde73f1e | |||
| 3de5a2320d | |||
| 5cb32a9a77 | |||
| ecbb4ac55c | |||
| 84e0561fff | |||
| 71bfbb2afc | |||
| 2cb563320b | |||
| f3837f35b0 | |||
| fa52b8e040 | |||
| c80b5a9160 | |||
| 65ac5590c7 | |||
| 3cee7f2a95 | |||
| 3034b49586 | |||
| 718ffb3124 | |||
| 7173c49561 | |||
| 4407f37f8c | |||
| 37a16f6292 | |||
| 83d9e0c5f7 | |||
| d2249e031a | |||
| 2522e67705 | |||
| 371514157c | |||
| de889045e6 | |||
| 6225ba8207 | |||
| 36c9319bce | |||
| d4d494218b | |||
| a3d6b11c69 | |||
| 852edf1b13 | |||
| 6806290d98 | |||
| 66f7a51462 | |||
| 0e1e69dc9a | |||
| 2ef24fe6e9 | |||
| 54c2d90334 | |||
| 577f2041a1 | |||
| 2f3e74fbfe | |||
| b0fa911322 | |||
| 473b9f22fb | |||
| cc1e1bf221 | |||
| a0c85b3fcb | |||
| 0f41bd99aa | |||
| 7a3a207462 | |||
| 7206b3c37e | |||
| 4cf8b6167f | |||
| b19b438489 | |||
| d3ee6d9ea3 | |||
| dd9789c4f3 | |||
| 67571e3d7a | |||
| a0e17f557d | |||
| 684946bb14 | |||
| 4aab6b1688 | |||
| 310a79f41d | |||
| f8164ca1eb |
11
.idea/deploymentTargetDropDown.xml
generated
11
.idea/deploymentTargetDropDown.xml
generated
@@ -1,16 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="deploymentTargetDropDown">
|
<component name="deploymentTargetDropDown">
|
||||||
<runningDeviceTargetsSelectedWithDialog>
|
<targetSelectedWithDropDown>
|
||||||
<Target>
|
<Target>
|
||||||
<type value="RUNNING_DEVICE_TARGET" />
|
<type value="QUICK_BOOT_TARGET" />
|
||||||
<deviceKey>
|
<deviceKey>
|
||||||
<Key>
|
<Key>
|
||||||
<type value="SERIAL_NUMBER" />
|
<type value="VIRTUAL_DEVICE_PATH" />
|
||||||
<value value="20119B1E55" />
|
<value value="C:\Users\ValerioC.STUDIO-ML\.android\avd\Pixel_4_XL_API_30.avd" />
|
||||||
</Key>
|
</Key>
|
||||||
</deviceKey>
|
</deviceKey>
|
||||||
</Target>
|
</Target>
|
||||||
</runningDeviceTargetsSelectedWithDialog>
|
</targetSelectedWithDropDown>
|
||||||
|
<timeTargetWasSelectedWithDropDown value="2022-07-15T15:36:03.605659600Z" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 271
|
def appVersionCode = 297
|
||||||
def appVersionName = '1.24.3'
|
def appVersionName = '1.28.3'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
@@ -78,11 +78,11 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lintOptions {
|
|
||||||
abortOnError false
|
|
||||||
}
|
|
||||||
|
|
||||||
dynamicFeatures = [":dynamic__base", ":dynamic_vgalimenti"]
|
dynamicFeatures = [":dynamic__base", ":dynamic_vgalimenti"]
|
||||||
|
lint {
|
||||||
|
abortOnError false
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -113,6 +113,7 @@ dependencies {
|
|||||||
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.2.0'
|
implementation 'androidx.preference:preference-ktx:1.2.0'
|
||||||
|
implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0"
|
||||||
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
@@ -164,6 +165,14 @@ dependencies {
|
|||||||
// testImplementation "org.junit.jupiter:junit-jupiter-api:5.8.1"
|
// testImplementation "org.junit.jupiter:junit-jupiter-api:5.8.1"
|
||||||
// androidTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
|
// androidTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
|
||||||
// androidTestImplementation 'org.testng:testng:7.4.0'
|
// androidTestImplementation 'org.testng:testng:7.4.0'
|
||||||
|
|
||||||
|
|
||||||
|
//Bluetooth device manager
|
||||||
|
implementation 'com.github.harry1453:android-bluetooth-serial:v1.1'
|
||||||
|
|
||||||
|
// RxJava is also required.
|
||||||
|
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
|
||||||
|
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".MainApplication"
|
android:name=".MainApplication"
|
||||||
@@ -26,11 +27,18 @@
|
|||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/Light"
|
android:theme="@style/Light"
|
||||||
android:windowSoftInputMode="adjustNothing" />
|
android:windowSoftInputMode="adjustNothing" />
|
||||||
<activity android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity"
|
<activity
|
||||||
|
android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/Light"
|
android:theme="@style/Light"
|
||||||
android:windowSoftInputMode="adjustNothing" />
|
android:windowSoftInputMode="adjustNothing" />
|
||||||
<activity android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
<activity
|
||||||
|
android:name=".gest.prod_dettaglio_linea.ProdDettaglioLineaActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/Light"
|
||||||
|
android:windowSoftInputMode="adjustNothing" />
|
||||||
|
<activity
|
||||||
|
android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/Light"
|
android:theme="@style/Light"
|
||||||
android:windowSoftInputMode="adjustNothing" />
|
android:windowSoftInputMode="adjustNothing" />
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import it.integry.integrywmsnative.core.context.AppContext;
|
|||||||
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseActivityComponent;
|
import it.integry.integrywmsnative.core.expansion.BaseActivityComponent;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseActivityModule;
|
import it.integry.integrywmsnative.core.expansion.BaseActivityModule;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragmentComponent;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragmentModule;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseFragmentComponent;
|
import it.integry.integrywmsnative.core.expansion.BaseFragmentComponent;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseFragmentModule;
|
import it.integry.integrywmsnative.core.expansion.BaseFragmentModule;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneComponent;
|
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneComponent;
|
||||||
@@ -39,10 +41,14 @@ import it.integry.integrywmsnative.gest.picking_resi.PickingResiComponent;
|
|||||||
import it.integry.integrywmsnative.gest.picking_resi.PickingResiModule;
|
import it.integry.integrywmsnative.gest.picking_resi.PickingResiModule;
|
||||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoComponent;
|
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoComponent;
|
||||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoModule;
|
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoModule;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_dettaglio_linea.ProdDettaglioLineaComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_dettaglio_linea.ProdDettaglioLineaModule;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdComponent;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdComponent;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdModule;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdModule;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaComponent;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaComponent;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaModule;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaModule;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.ProdLineeProduzioneComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.ProdLineeProduzioneModule;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeComponent;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeComponent;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeModule;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeModule;
|
||||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceComponent;
|
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceComponent;
|
||||||
@@ -59,6 +65,8 @@ import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeComp
|
|||||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeModule;
|
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeModule;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.SpedizioneComponent;
|
import it.integry.integrywmsnative.gest.spedizione.SpedizioneComponent;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.SpedizioneModule;
|
import it.integry.integrywmsnative.gest.spedizione.SpedizioneModule;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione.dialogs.print_sscc_list.DialogPrintOrderSSCCListComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione.dialogs.print_sscc_list.DialogPrintOrderSSCCListModule;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.prod_fabbisogno_linee_prod.DialogRowInfoProdFabbisognoLineeProdComponent;
|
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.prod_fabbisogno_linee_prod.DialogRowInfoProdFabbisognoLineeProdComponent;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.prod_fabbisogno_linee_prod.DialogRowInfoProdFabbisognoLineeProdModule;
|
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.prod_fabbisogno_linee_prod.DialogRowInfoProdFabbisognoLineeProdModule;
|
||||||
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneClienteComponent;
|
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneClienteComponent;
|
||||||
@@ -91,6 +99,7 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
|||||||
MainApplicationModule.class,
|
MainApplicationModule.class,
|
||||||
BaseActivityModule.class,
|
BaseActivityModule.class,
|
||||||
BaseFragmentModule.class,
|
BaseFragmentModule.class,
|
||||||
|
BaseDialogFragmentModule.class,
|
||||||
LoginModule.class,
|
LoginModule.class,
|
||||||
MainActivityModule.class,
|
MainActivityModule.class,
|
||||||
MainFragmentModule.class,
|
MainFragmentModule.class,
|
||||||
@@ -125,7 +134,10 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
|||||||
DocInterniEditFormModule.class,
|
DocInterniEditFormModule.class,
|
||||||
DialogSelectDocRowsModule.class,
|
DialogSelectDocRowsModule.class,
|
||||||
DialogAskClienteModule.class,
|
DialogAskClienteModule.class,
|
||||||
DialogEditArticoloModule.class
|
DialogEditArticoloModule.class,
|
||||||
|
DialogPrintOrderSSCCListModule.class,
|
||||||
|
ProdLineeProduzioneModule.class,
|
||||||
|
ProdDettaglioLineaModule.class
|
||||||
})
|
})
|
||||||
public interface MainApplicationComponent {
|
public interface MainApplicationComponent {
|
||||||
|
|
||||||
@@ -133,6 +145,8 @@ public interface MainApplicationComponent {
|
|||||||
|
|
||||||
BaseFragmentComponent.Factory baseFragmentComponent();
|
BaseFragmentComponent.Factory baseFragmentComponent();
|
||||||
|
|
||||||
|
BaseDialogFragmentComponent.Factory baseDialogFragmentComponent();
|
||||||
|
|
||||||
SplashActivityComponent.Factory splashActivityComponent();
|
SplashActivityComponent.Factory splashActivityComponent();
|
||||||
|
|
||||||
LoginComponent.Factory loginActivityComponent();
|
LoginComponent.Factory loginActivityComponent();
|
||||||
@@ -211,6 +225,12 @@ public interface MainApplicationComponent {
|
|||||||
|
|
||||||
DialogEditArticoloComponent.Factory dialogEditArticoloComponent();
|
DialogEditArticoloComponent.Factory dialogEditArticoloComponent();
|
||||||
|
|
||||||
|
DialogPrintOrderSSCCListComponent.Factory dialogPrintOrderSSCCListComponent();
|
||||||
|
|
||||||
|
ProdLineeProduzioneComponent.Factory prodLineeProduzioneComponent();
|
||||||
|
|
||||||
|
ProdDettaglioLineaComponent.Factory prodDettaglioLineaComponent();
|
||||||
|
|
||||||
void inject(MainApplication mainApplication);
|
void inject(MainApplication mainApplication);
|
||||||
|
|
||||||
void inject(AppContext mainApplication);
|
void inject(AppContext mainApplication);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
|||||||
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
||||||
import it.integry.integrywmsnative.core.update.UpdatesManager;
|
import it.integry.integrywmsnative.core.update.UpdatesManager;
|
||||||
@@ -200,4 +201,10 @@ public class MainApplicationModule {
|
|||||||
return new InventarioService(giacenzaRESTConsumer);
|
return new InventarioService(giacenzaRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
ProductionLinesRESTConsumer provideProductionLinesRESTConsumer() {
|
||||||
|
return new ProductionLinesRESTConsumer();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoF
|
|||||||
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoFragment;
|
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoFragment;
|
||||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoFragment;
|
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoFragment;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdFragment;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisognoLineeProdFragment;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.ProdLineeProduzioneFragment;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
|
||||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceFragment;
|
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceFragment;
|
||||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment;
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment;
|
||||||
@@ -45,137 +46,145 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
.setDrawerIcon(R.drawable.ic_black_latest_delivery)
|
.setDrawerIcon(R.drawable.ic_black_latest_delivery)
|
||||||
.setFragmentFactory(UltimiArriviFornitoreFragment::newInstance))
|
.setFragmentFactory(UltimiArriviFornitoreFragment::newInstance))
|
||||||
).addGroup(
|
).addGroup(
|
||||||
new MenuGroup()
|
new MenuGroup()
|
||||||
.setGroupText(R.string.checkout)
|
.setGroupText(R.string.checkout)
|
||||||
.setGroupId(R.id.nav_group_spedizione)
|
.setGroupId(R.id.nav_group_spedizione)
|
||||||
.setCodMenu("MM010")
|
.setCodMenu("MM010")
|
||||||
|
|
||||||
|
.addItem(new MenuItem()
|
||||||
|
.setID(R.id.nav_spedizione)
|
||||||
|
.setCodMenu("MG046")
|
||||||
|
.setTitleText(R.string.vendita_title_fragment)
|
||||||
|
.setTitleIcon(R.drawable.ic_dashboard_spedizione)
|
||||||
|
.setDrawerIcon(R.drawable.ic_black_upload)
|
||||||
|
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.VENDITA, null, -1, null)))
|
||||||
|
|
||||||
|
.addItem(new MenuItem()
|
||||||
|
.setID(R.id.nav_free_picking)
|
||||||
|
.setCodMenu("MG047")
|
||||||
|
.setTitleText(R.string.free_picking)
|
||||||
|
.setTitleIcon(R.drawable.ic_dashboard_picking_libero)
|
||||||
|
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
|
||||||
|
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.VENDITA)))
|
||||||
|
|
||||||
|
.addItem(new MenuItem()
|
||||||
|
.setID(R.id.nav_resi_cliente)
|
||||||
|
.setCodMenu("MG048")
|
||||||
|
.setTitleText(R.string.fragment_ultime_consegne_cliente_title)
|
||||||
|
.setTitleIcon(R.drawable.ic_latest_delivery_customer)
|
||||||
|
.setDrawerIcon(R.drawable.ic_black_latest_delivery)
|
||||||
|
.setFragmentFactory(UltimeConsegneClienteFragment::newInstance))
|
||||||
|
).addGroup(new MenuGroup()
|
||||||
|
.setGroupText(R.string.manufacture)
|
||||||
|
.setGroupId(R.id.nav_group_produzione)
|
||||||
|
.setCodMenu("MM009")
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_spedizione)
|
.setID(R.id.nav_prod_ordine_produzione)
|
||||||
.setCodMenu("MG046")
|
.setCodMenu("MG049")
|
||||||
.setTitleText(R.string.vendita_title_fragment)
|
.setTitleText(R.string.prod_ordine_produzione_title_fragment)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_spedizione)
|
.setTitleIcon(R.drawable.ic_dashboard_prod_accettazione_produzione)
|
||||||
.setDrawerIcon(R.drawable.ic_black_upload)
|
.setDrawerIcon(R.drawable.ic_black_external)
|
||||||
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.VENDITA, null, -1, null)))
|
.setFragmentFactory(ProdOrdineProduzioneElencoFragment::newInstance))
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_free_picking)
|
.setID(R.id.nav_prod_ordine_lavorazione)
|
||||||
.setCodMenu("MG047")
|
.setCodMenu("MG050")
|
||||||
.setTitleText(R.string.free_picking)
|
.setTitleText(R.string.prod_ordine_lavorazione_title_fragment)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_picking_libero)
|
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_lavorazione)
|
||||||
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
|
.setDrawerIcon(R.drawable.ic_black_external)
|
||||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.VENDITA)))
|
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.PRODUZIONE, GestioneEnum.LAVORAZIONE, -1, null)))
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_resi_cliente)
|
.setID(R.id.nav_free_lav_picking)
|
||||||
.setCodMenu("MG048")
|
.setCodMenu("MG051")
|
||||||
.setTitleText(R.string.fragment_ultime_consegne_cliente_title)
|
.setTitleText(it.integry.integrywmsnative.R.string.free_lav_picking)
|
||||||
.setTitleIcon(R.drawable.ic_latest_delivery_customer)
|
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_libero)
|
||||||
.setDrawerIcon(R.drawable.ic_black_latest_delivery)
|
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_barcode_scanner)
|
||||||
.setFragmentFactory(UltimeConsegneClienteFragment::newInstance))
|
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.LAVORAZIONE)))
|
||||||
).addGroup(new MenuGroup()
|
|
||||||
.setGroupText(R.string.manufacture)
|
|
||||||
.setGroupId(R.id.nav_group_produzione)
|
|
||||||
.setCodMenu("MM009")
|
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
|
||||||
.setID(R.id.nav_prod_ordine_produzione)
|
|
||||||
.setCodMenu("MG049")
|
|
||||||
.setTitleText(R.string.prod_ordine_produzione_title_fragment)
|
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_prod_accettazione_produzione)
|
|
||||||
.setDrawerIcon(R.drawable.ic_black_external)
|
|
||||||
.setFragmentFactory(ProdOrdineProduzioneElencoFragment::newInstance))
|
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
|
||||||
.setID(R.id.nav_prod_ordine_lavorazione)
|
|
||||||
.setCodMenu("MG050")
|
|
||||||
.setTitleText(R.string.prod_ordine_lavorazione_title_fragment)
|
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_lavorazione)
|
|
||||||
.setDrawerIcon(R.drawable.ic_black_external)
|
|
||||||
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.PRODUZIONE, GestioneEnum.LAVORAZIONE, -1, null)))
|
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
|
||||||
.setID(R.id.nav_free_lav_picking)
|
|
||||||
.setCodMenu("MG051")
|
|
||||||
.setTitleText(it.integry.integrywmsnative.R.string.free_lav_picking)
|
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_libero)
|
|
||||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_barcode_scanner)
|
|
||||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.LAVORAZIONE)))
|
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
|
||||||
.setID(R.id.nav_prod_posizionamento_da_ord)
|
|
||||||
.setCodMenu("MG052")
|
|
||||||
.setTitleText(R.string.prod_fabbisogno_linee_prod_title)
|
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_merce)
|
|
||||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_load_shelf)
|
|
||||||
.setFragmentFactory(ProdFabbisognoLineeProdFragment::newInstance))
|
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
|
||||||
.setID(R.id.nav_prod_versamento_materiale)
|
|
||||||
.setCodMenu("MG053")
|
|
||||||
.setTitleText(R.string.prod_versamento_materiale_title_fragment)
|
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_materiale)
|
|
||||||
.setDrawerIcon(R.drawable.ic_black_external)
|
|
||||||
.setFragmentFactory(ProdVersamentoMaterialeFragment::newInstance))
|
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
|
||||||
.setID(R.id.nav_prod_recupero_materiale)
|
|
||||||
.setCodMenu("MG054")
|
|
||||||
.setTitleText(R.string.prod_recupero_materiale_title_fragment)
|
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_prod_recupero_materiale)
|
|
||||||
.setDrawerIcon(R.drawable.ic_black_external)
|
|
||||||
.setFragmentFactory(ProdRecuperoMaterialeFragment::newInstance))
|
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
|
||||||
.setID(it.integry.integrywmsnative.R.id.nav_prod_rientro_merce)
|
|
||||||
.setCodMenu("MG059")
|
|
||||||
.setTitleText(it.integry.integrywmsnative.R.string.rientro_merce_fragment_title)
|
|
||||||
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_prod_accettazione_produzione)
|
|
||||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_external)
|
|
||||||
.setFragmentFactory(ProdRientroMerceFragment::newInstance))
|
|
||||||
).addGroup(
|
|
||||||
new MenuGroup()
|
|
||||||
.setGroupText(R.string.internal_handling)
|
|
||||||
.setGroupId(R.id.nav_group_movimentazione_interna)
|
|
||||||
.setCodMenu("MM011")
|
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_versamento_merce)
|
.setID(R.id.nav_prod_posizionamento_da_ord)
|
||||||
.setCodMenu("MG055")
|
.setCodMenu("MG052")
|
||||||
.setTitleText(R.string.versamento_merce_fragment_title)
|
.setTitleText(R.string.prod_fabbisogno_linee_prod_title)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_versamento_merce)
|
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_merce)
|
||||||
.setDrawerIcon(R.drawable.ic_black_load_shelf)
|
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_load_shelf)
|
||||||
.setFragmentFactory(VersamentoMerceFragment::newInstance))
|
.setFragmentFactory(ProdFabbisognoLineeProdFragment::newInstance))
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setID(R.id.nav_rettifica_giacenze)
|
.setID(R.id.nav_prod_versamento_materiale)
|
||||||
.setCodMenu("MG056")
|
.setCodMenu("MG053")
|
||||||
.setTitleText(R.string.rettifica_giacenze_fragment_title)
|
.setTitleText(R.string.prod_versamento_materiale_title_fragment)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_rettifica_giacenze)
|
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_materiale)
|
||||||
.setDrawerIcon(R.drawable.ic_black_empty_box)
|
.setDrawerIcon(R.drawable.ic_black_external)
|
||||||
.setFragmentFactory(RettificaGiacenzeFragment::newInstance))
|
.setFragmentFactory(ProdVersamentoMaterialeFragment::newInstance))
|
||||||
|
|
||||||
|
|
||||||
).addGroup(
|
|
||||||
new MenuGroup()
|
|
||||||
.setCodMenu("MM012")
|
|
||||||
.setGroupText(it.integry.integrywmsnative.R.string.punto_vendita)
|
|
||||||
.setGroupId(it.integry.integrywmsnative.R.id.nav_group_puntivendita)
|
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setCodMenu("MG057")
|
.setID(R.id.nav_prod_recupero_materiale)
|
||||||
.setID(it.integry.integrywmsnative.R.id.nav_pv_ordini_acquisto)
|
.setCodMenu("MG054")
|
||||||
.setTitleText(it.integry.integrywmsnative.R.string.generate_orders)
|
.setTitleText(R.string.prod_recupero_materiale_title_fragment)
|
||||||
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
|
.setTitleIcon(R.drawable.ic_dashboard_prod_recupero_materiale)
|
||||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
|
.setDrawerIcon(R.drawable.ic_black_external)
|
||||||
.setFragmentFactory(PVOrdiniAcquistoGrigliaFragment::newInstance))
|
.setFragmentFactory(ProdRecuperoMaterialeFragment::newInstance))
|
||||||
|
|
||||||
.addItem(new MenuItem()
|
.addItem(new MenuItem()
|
||||||
.setCodMenu("MG058")
|
.setID(it.integry.integrywmsnative.R.id.nav_prod_rientro_merce)
|
||||||
.setID(it.integry.integrywmsnative.R.id.nav_pv_doc_interni)
|
.setCodMenu("MG059")
|
||||||
.setTitleText(it.integry.integrywmsnative.R.string.doc_interni)
|
.setTitleText(it.integry.integrywmsnative.R.string.rientro_merce_fragment_title)
|
||||||
.setTitleIcon(R.drawable.ic_dashboard_contab_doc_interni)
|
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_prod_accettazione_produzione)
|
||||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_contab_doc_interni)
|
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_external)
|
||||||
.setFragmentFactory(DocInterniFragment::newInstance))
|
.setFragmentFactory(ProdRientroMerceFragment::newInstance))
|
||||||
|
|
||||||
|
.addItem(new MenuItem()
|
||||||
|
.setID(it.integry.integrywmsnative.R.id.nav_prod_linee)
|
||||||
|
.setCodMenu("MG061")
|
||||||
|
.setTitleText(it.integry.integrywmsnative.R.string.nav_prod_linee_title)
|
||||||
|
.setTitleIcon(R.drawable.ic_production_line)
|
||||||
|
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_production_line)
|
||||||
|
.setFragmentFactory(ProdLineeProduzioneFragment::newInstance))
|
||||||
|
).addGroup(
|
||||||
|
new MenuGroup()
|
||||||
|
.setGroupText(R.string.internal_handling)
|
||||||
|
.setGroupId(R.id.nav_group_movimentazione_interna)
|
||||||
|
.setCodMenu("MM011")
|
||||||
|
|
||||||
|
.addItem(new MenuItem()
|
||||||
|
.setID(R.id.nav_versamento_merce)
|
||||||
|
.setCodMenu("MG055")
|
||||||
|
.setTitleText(R.string.versamento_merce_fragment_title)
|
||||||
|
.setTitleIcon(R.drawable.ic_dashboard_versamento_merce)
|
||||||
|
.setDrawerIcon(R.drawable.ic_black_load_shelf)
|
||||||
|
.setFragmentFactory(VersamentoMerceFragment::newInstance))
|
||||||
|
|
||||||
|
.addItem(new MenuItem()
|
||||||
|
.setID(R.id.nav_rettifica_giacenze)
|
||||||
|
.setCodMenu("MG056")
|
||||||
|
.setTitleText(R.string.rettifica_giacenze_fragment_title)
|
||||||
|
.setTitleIcon(R.drawable.ic_dashboard_rettifica_giacenze)
|
||||||
|
.setDrawerIcon(R.drawable.ic_black_empty_box)
|
||||||
|
.setFragmentFactory(RettificaGiacenzeFragment::newInstance))
|
||||||
|
|
||||||
|
|
||||||
|
).addGroup(
|
||||||
|
new MenuGroup()
|
||||||
|
.setCodMenu("MM012")
|
||||||
|
.setGroupText(it.integry.integrywmsnative.R.string.punto_vendita)
|
||||||
|
.setGroupId(it.integry.integrywmsnative.R.id.nav_group_puntivendita)
|
||||||
|
|
||||||
|
.addItem(new MenuItem()
|
||||||
|
.setCodMenu("MG057")
|
||||||
|
.setID(it.integry.integrywmsnative.R.id.nav_pv_ordini_acquisto)
|
||||||
|
.setTitleText(it.integry.integrywmsnative.R.string.generate_orders)
|
||||||
|
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
|
||||||
|
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_purchase_orders_pv)
|
||||||
|
.setFragmentFactory(PVOrdiniAcquistoGrigliaFragment::newInstance))
|
||||||
|
.addItem(new MenuItem()
|
||||||
|
.setCodMenu("MG058")
|
||||||
|
.setID(it.integry.integrywmsnative.R.id.nav_pv_doc_interni)
|
||||||
|
.setTitleText(it.integry.integrywmsnative.R.string.doc_interni)
|
||||||
|
.setTitleIcon(R.drawable.ic_dashboard_contab_doc_interni)
|
||||||
|
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_contab_doc_interni)
|
||||||
|
.setFragmentFactory(DocInterniFragment::newInstance))
|
||||||
|
|
||||||
// .addItem(new MenuItem()
|
// .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)
|
||||||
@@ -183,7 +192,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
|||||||
// .setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_trasmitted_orders_list)
|
// .setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_trasmitted_orders_list)
|
||||||
// .setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_trasmitted_orders_list)
|
// .setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_trasmitted_orders_list)
|
||||||
// .setFragmentClass(PVOrdiniAcquistoTransmittedListFragment.newInstance()))
|
// .setFragmentClass(PVOrdiniAcquistoTransmittedListFragment.newInstance()))
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import java.util.UUID;
|
|||||||
|
|
||||||
public class DataCache {
|
public class DataCache {
|
||||||
|
|
||||||
private static List<DataCacheDTO> dataCacheList = new ArrayList<>();
|
private static final List<DataCacheDTO> dataCacheList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
public static String addItem(Object item) {
|
public static String addItem(Object item) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
|||||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||||
|
|
||||||
@Database(entities = {ArticoloGriglia.class, Griglia.class, Ordine.class, ArticoloOrdine.class, SqlMtbColt.class, SqlMtbColr.class}, version = 8, exportSchema = false)
|
@Database(entities = {ArticoloGriglia.class, Griglia.class, Ordine.class, ArticoloOrdine.class, SqlMtbColt.class, SqlMtbColr.class}, version = 10, exportSchema = false)
|
||||||
@TypeConverters({
|
@TypeConverters({
|
||||||
DateConverter.class,
|
DateConverter.class,
|
||||||
BigDecimalConverter.class
|
BigDecimalConverter.class
|
||||||
|
|||||||
@@ -53,6 +53,6 @@ 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")
|
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId AND qta_ord >= 1")
|
||||||
List<ArticoloGriglia> getNewArticoliInGriglia(int grigliaId);
|
List<ArticoloGriglia> getNewArticoliInGriglia(int grigliaId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,10 @@ import androidx.room.ForeignKey;
|
|||||||
import androidx.room.Index;
|
import androidx.room.Index;
|
||||||
import androidx.room.PrimaryKey;
|
import androidx.room.PrimaryKey;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
|
||||||
@@ -68,6 +71,9 @@ public class ArticoloGriglia {
|
|||||||
@ColumnInfo(name = "qta_proposta")
|
@ColumnInfo(name = "qta_proposta")
|
||||||
private float qtaProposta;
|
private float qtaProposta;
|
||||||
|
|
||||||
|
@ColumnInfo(name = "qta_ord")
|
||||||
|
private float qtaOrd;
|
||||||
|
|
||||||
@ColumnInfo(name = "id_griglia")
|
@ColumnInfo(name = "id_griglia")
|
||||||
private int idGriglia;
|
private int idGriglia;
|
||||||
|
|
||||||
@@ -202,6 +208,22 @@ public class ArticoloGriglia {
|
|||||||
this.newNoPromo = newNoPromo;
|
this.newNoPromo = newNoPromo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float getQtaOrd() {
|
||||||
|
return qtaOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQtaOrd(float qtaOrd) {
|
||||||
|
this.qtaOrd = qtaOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String generateSystemNote() {
|
||||||
|
HashMap<String, String> pairs = new HashMap<>();
|
||||||
|
pairs.put("qta_proposta", String.valueOf(qtaProposta));
|
||||||
|
pairs.put("giacenza", String.valueOf(giacenza));
|
||||||
|
|
||||||
|
return new JSONObject(pairs).toString();
|
||||||
|
}
|
||||||
|
|
||||||
public ArticoloOrdine convertToArticoloOrdine(Ordine ordine) {
|
public ArticoloOrdine convertToArticoloOrdine(Ordine ordine) {
|
||||||
ArticoloOrdine articolo = new ArticoloOrdine();
|
ArticoloOrdine articolo = new ArticoloOrdine();
|
||||||
|
|
||||||
@@ -222,8 +244,8 @@ public class ArticoloGriglia {
|
|||||||
articolo.setQtaPrevistaVendita(BigDecimal.valueOf(this.getQtaPrevistaVendita()));
|
articolo.setQtaPrevistaVendita(BigDecimal.valueOf(this.getQtaPrevistaVendita()));
|
||||||
articolo.setQtaProposta(BigDecimal.valueOf(this.getQtaProposta()));
|
articolo.setQtaProposta(BigDecimal.valueOf(this.getQtaProposta()));
|
||||||
articolo.setNewNoPromo(this.isNewNoPromo());
|
articolo.setNewNoPromo(this.isNewNoPromo());
|
||||||
|
articolo.setSystemNote(generateSystemNote());
|
||||||
articolo.setQtaOrd(0);
|
articolo.setQtaOrd(this.getQtaOrd());
|
||||||
|
|
||||||
return articolo;
|
return articolo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,9 @@ public class ArticoloOrdine {
|
|||||||
@ColumnInfo(name = "new_no_promo")
|
@ColumnInfo(name = "new_no_promo")
|
||||||
private boolean newNoPromo;
|
private boolean newNoPromo;
|
||||||
|
|
||||||
|
@ColumnInfo(name = "system_note")
|
||||||
|
private String systemNote;
|
||||||
|
|
||||||
@Ignore
|
@Ignore
|
||||||
private int ggScadenza = 0;
|
private int ggScadenza = 0;
|
||||||
|
|
||||||
@@ -266,4 +269,12 @@ public class ArticoloOrdine {
|
|||||||
this.bgTint = bgTint;
|
this.bgTint = bgTint;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSystemNote() {
|
||||||
|
return systemNote;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSystemNote(String systemNote) {
|
||||||
|
this.systemNote = systemNote;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ public class Ordine {
|
|||||||
@Ignore
|
@Ignore
|
||||||
private int countArticoli = 0;
|
private int countArticoli = 0;
|
||||||
|
|
||||||
|
@Ignore
|
||||||
|
private boolean orderNewProducts = false;
|
||||||
|
|
||||||
@ColumnInfo(name = "id_griglia")
|
@ColumnInfo(name = "id_griglia")
|
||||||
private int idGriglia;
|
private int idGriglia;
|
||||||
|
|
||||||
@@ -149,4 +152,13 @@ public class Ordine {
|
|||||||
public void setDataOrdS(String dataOrd) {
|
public void setDataOrdS(String dataOrd) {
|
||||||
setDataOrd(UtilityDate.recognizeDateWithExceptionHandler(dataOrd));
|
setDataOrd(UtilityDate.recognizeDateWithExceptionHandler(dataOrd));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isOrderNewProducts() {
|
||||||
|
return orderNewProducts;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ordine setOrderNewProducts(boolean orderNewProducts) {
|
||||||
|
this.orderNewProducts = orderNewProducts;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ public class ArticoloDTO {
|
|||||||
private float giacenza;
|
private float giacenza;
|
||||||
private float qtaPrevistaVendita;
|
private float qtaPrevistaVendita;
|
||||||
private float qtaProposta;
|
private float qtaProposta;
|
||||||
|
private float qtaOrd;
|
||||||
|
|
||||||
|
|
||||||
public String getCodMart() {
|
public String getCodMart() {
|
||||||
@@ -151,6 +152,15 @@ public class ArticoloDTO {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float getQtaOrd() {
|
||||||
|
return qtaOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArticoloDTO setQtaOrd(float qtaOrd) {
|
||||||
|
this.qtaOrd = qtaOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public ArticoloGriglia toArticoloGriglia() {
|
public ArticoloGriglia toArticoloGriglia() {
|
||||||
ArticoloGriglia result = new ArticoloGriglia();
|
ArticoloGriglia result = new ArticoloGriglia();
|
||||||
result.setBarCode(this.getBarCode());
|
result.setBarCode(this.getBarCode());
|
||||||
@@ -164,6 +174,7 @@ public class ArticoloDTO {
|
|||||||
result.setQtaMinOrdinabile(this.getQtaMinOrdinabile());
|
result.setQtaMinOrdinabile(this.getQtaMinOrdinabile());
|
||||||
result.setGgScadenza(this.ggScadenza);
|
result.setGgScadenza(this.ggScadenza);
|
||||||
result.setNewNoPromo(this.newNoPromo);
|
result.setNewNoPromo(this.newNoPromo);
|
||||||
|
result.setQtaOrd(this.getQtaOrd());
|
||||||
result.setGiacenza(this.giacenza);
|
result.setGiacenza(this.giacenza);
|
||||||
result.setQtaPrevistaVendita(this.qtaPrevistaVendita);
|
result.setQtaPrevistaVendita(this.qtaPrevistaVendita);
|
||||||
result.setQtaProposta(this.qtaProposta);
|
result.setQtaProposta(this.qtaProposta);
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di.binders;
|
||||||
|
|
||||||
|
import androidx.appcompat.widget.AppCompatImageView;
|
||||||
|
import androidx.databinding.BindingAdapter;
|
||||||
|
|
||||||
|
public class ImageViewBinders {
|
||||||
|
@BindingAdapter("tint")
|
||||||
|
public static void bindImageViewTint(final AppCompatImageView view, final int color) {
|
||||||
|
view.setColorFilter(color, android.graphics.PorterDuff.Mode.MULTIPLY);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
public class BluetoothConnectionException extends Exception {
|
||||||
|
|
||||||
|
public BluetoothConnectionException(String btDeviceName, String btDeviceMac, Throwable th) {
|
||||||
|
super("Impossibile collegarsi al dispositivo bluetooth: " + btDeviceName + " [" + btDeviceMac + "]. Riprovare.");
|
||||||
|
initCause(th);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
public class InvalidConnectionException extends Exception {
|
||||||
|
|
||||||
|
|
||||||
|
public InvalidConnectionException(String host, int port, Throwable cause) {
|
||||||
|
super(String.format(Locale.ITALY, "Impossibile stabilire la connessione con il server (%s:%d)", host, port), cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,6 +4,11 @@ import it.integry.integrywmsnative.R;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
|
||||||
public final class NoResultFromBarcodeException extends Exception {
|
public final class NoResultFromBarcodeException extends Exception {
|
||||||
|
|
||||||
|
public NoResultFromBarcodeException() {
|
||||||
|
super(UtilityResources.getString(R.string.no_result_from_barcode));
|
||||||
|
}
|
||||||
|
|
||||||
public NoResultFromBarcodeException(String barcode) {
|
public NoResultFromBarcodeException(String barcode) {
|
||||||
super(UtilityResources.getString(R.string.no_result_from_barcode) + " (" + barcode + ")");
|
super(UtilityResources.getString(R.string.no_result_from_barcode) + " (" + barcode + ")");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,45 @@ public class BaseActivity extends AppCompatActivity {
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onLoadingStarted() {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
this.openProgress();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onLoadingEnded() {
|
||||||
|
this.closeProgress();
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onError(Exception ex) {
|
||||||
|
this.runOnUiThread(() -> {
|
||||||
|
this.closeProgress();
|
||||||
|
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
||||||
|
BarcodeManager.enable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void openProgress() {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||||
|
this.progressOpened = true;
|
||||||
|
runOnUiThread(() -> {
|
||||||
|
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void closeProgress() {
|
||||||
|
BarcodeManager.enable();
|
||||||
|
if (progressOpened) {
|
||||||
|
this.progressOpened = false;
|
||||||
|
runOnUiThread(() -> {
|
||||||
|
mCurrentProgress.dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||||
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
||||||
@@ -56,47 +95,4 @@ public class BaseActivity extends AppCompatActivity {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void openProgress() {
|
|
||||||
BarcodeManager.disable();
|
|
||||||
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
|
||||||
this.progressOpened = true;
|
|
||||||
runOnUiThread(() -> {
|
|
||||||
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void closeProgress() {
|
|
||||||
BarcodeManager.enable();
|
|
||||||
if (progressOpened) {
|
|
||||||
this.progressOpened = false;
|
|
||||||
runOnUiThread(() -> {
|
|
||||||
mCurrentProgress.dismiss();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
// new Thread(() -> {
|
|
||||||
BarcodeManager.disable();
|
|
||||||
this.openProgress();
|
|
||||||
// }).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
// new Thread(() -> {
|
|
||||||
this.closeProgress();
|
|
||||||
BarcodeManager.enable();
|
|
||||||
// }).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onError(Exception ex) {
|
|
||||||
this.runOnUiThread(() -> {
|
|
||||||
this.closeProgress();
|
|
||||||
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
|
||||||
BarcodeManager.enable();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,19 +11,20 @@ import androidx.fragment.app.DialogFragment;
|
|||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
|
||||||
public class BaseDialogFragment extends DialogFragment {
|
public class BaseDialogFragment extends DialogFragment {
|
||||||
|
|
||||||
private boolean mBarcodeListener = false;
|
@Inject
|
||||||
private DialogProgressView mCurrentProgress;
|
public DialogProgressView mCurrentProgress;
|
||||||
|
private boolean progressOpened;
|
||||||
|
|
||||||
public BaseDialogFragment() {
|
private boolean mBarcodeListener = false;
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -41,6 +42,11 @@ public class BaseDialogFragment extends DialogFragment {
|
|||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
MainApplication.appComponent
|
||||||
|
.baseDialogFragmentComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
||||||
getDialog().setOnKeyListener((dialog, keyCode, event) -> {
|
getDialog().setOnKeyListener((dialog, keyCode, event) -> {
|
||||||
if (mBarcodeListener && (event.getAction() == KeyEvent.ACTION_DOWN || event.getAction() == KeyEvent.ACTION_MULTIPLE) && !isControlKey(event)) {
|
if (mBarcodeListener && (event.getAction() == KeyEvent.ACTION_DOWN || event.getAction() == KeyEvent.ACTION_MULTIPLE) && !isControlKey(event)) {
|
||||||
@@ -51,6 +57,42 @@ public class BaseDialogFragment extends DialogFragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onLoadingStarted() {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
this.openProgress();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onLoadingEnded() {
|
||||||
|
this.closeProgress();
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openProgress() {
|
||||||
|
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||||
|
this.progressOpened = true;
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void closeProgress() {
|
||||||
|
if (progressOpened) {
|
||||||
|
this.progressOpened = false;
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
mCurrentProgress.dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onError(Exception ex) {
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
UtilityExceptions.defaultException(requireActivity(), ex);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isControlKey(KeyEvent keyEvent) {
|
private boolean isControlKey(KeyEvent keyEvent) {
|
||||||
int keyCode = keyEvent.getKeyCode();
|
int keyCode = keyEvent.getKeyCode();
|
||||||
return (
|
return (
|
||||||
@@ -65,45 +107,4 @@ public class BaseDialogFragment extends DialogFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
BarcodeManager.disable();
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void openProgress() {
|
|
||||||
|
|
||||||
// new Thread(() -> {
|
|
||||||
requireActivity().runOnUiThread(() -> {
|
|
||||||
if (this.mCurrentProgress == null) {
|
|
||||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(requireActivity());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// }).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void closeProgress() {
|
|
||||||
// new Thread(() -> {
|
|
||||||
requireActivity().runOnUiThread(() -> {
|
|
||||||
if (mCurrentProgress != null) {
|
|
||||||
mCurrentProgress.dismiss();
|
|
||||||
mCurrentProgress = null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// }).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void onError(Exception ex) {
|
|
||||||
requireActivity().runOnUiThread(() -> {
|
|
||||||
this.closeProgress();
|
|
||||||
UtilityExceptions.defaultException(requireActivity(), ex);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface BaseDialogFragmentComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
BaseDialogFragmentComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(BaseDialogFragment baseDialogFragment);
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
|
||||||
|
@Module(subcomponents = BaseDialogFragmentComponent.class)
|
||||||
|
public class BaseDialogFragmentModule {
|
||||||
|
}
|
||||||
@@ -54,13 +54,31 @@ public abstract class BaseFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onLoadingStarted() {
|
public void onLoadingStarted() {
|
||||||
BarcodeManager.disable();
|
|
||||||
this.openProgress();
|
this.openProgress();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onLoadingEnded() {
|
public void onLoadingEnded() {
|
||||||
this.closeProgress();
|
this.closeProgress();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openProgress() {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||||
|
this.progressOpened = true;
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void closeProgress() {
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
|
if (progressOpened) {
|
||||||
|
this.progressOpened = false;
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
mCurrentProgress.dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
@@ -81,27 +99,17 @@ public abstract class BaseFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void openProgress() {
|
public boolean onBackPressed() {
|
||||||
if (!progressOpened) {
|
return false;
|
||||||
this.progressOpened = true;
|
|
||||||
requireActivity().runOnUiThread(() -> {
|
|
||||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void closeProgress() {
|
|
||||||
if (progressOpened) {
|
|
||||||
this.progressOpened = false;
|
|
||||||
requireActivity().runOnUiThread(() -> {
|
|
||||||
mCurrentProgress.dismiss();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void popMe() {
|
protected void popMe() {
|
||||||
requireActivity().runOnUiThread(() -> {
|
if (requireActivity() instanceof IPoppableActivity) {
|
||||||
((IPoppableActivity) requireActivity()).pop();
|
requireActivity().runOnUiThread(() -> {
|
||||||
});
|
((IPoppableActivity) requireActivity()).pop();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
requireActivity().getSupportFragmentManager().popBackStack();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package it.integry.integrywmsnative.core.expansion;
|
|||||||
|
|
||||||
import androidx.databinding.Observable;
|
import androidx.databinding.Observable;
|
||||||
|
|
||||||
public abstract class OnGeneralChangedCallback extends Observable.OnPropertyChangedCallback implements Runnable{
|
public abstract class OnGeneralChangedCallback extends Observable.OnPropertyChangedCallback implements Runnable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||||
|
|||||||
@@ -21,13 +21,13 @@ public abstract class ExtendedSectionedRecyclerView<T, SH extends RecyclerView.V
|
|||||||
public ExtendedSectionedRecyclerView(ObservableArrayList<T> myDataset) {
|
public ExtendedSectionedRecyclerView(ObservableArrayList<T> myDataset) {
|
||||||
mDataset.addAll(myDataset);
|
mDataset.addAll(myDataset);
|
||||||
|
|
||||||
myDataset.addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
myDataset.addOnListChangedCallback(new OnListGeneralChangedCallback<T>() {
|
||||||
@Override
|
@Override
|
||||||
public void onChanged(ObservableList sender) {
|
public void onChanged(ObservableList<T> sender) {
|
||||||
mDataset.clear();
|
mDataset.clear();
|
||||||
mDataset.addAll(sender);
|
mDataset.addAll(sender);
|
||||||
notifyDataSetChanged();
|
|
||||||
notifyDataChanged();
|
notifyDataChanged();
|
||||||
|
notifyDataSetChanged();
|
||||||
checkIfEmpty();
|
checkIfEmpty();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package it.integry.integrywmsnative.core.interfaces.viewmodel_listeners;
|
||||||
|
|
||||||
|
public interface IOrdersLoadingListener {
|
||||||
|
|
||||||
|
void onOrderLoadingStarted();
|
||||||
|
|
||||||
|
void onOrderLoadingEnded();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.model;
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
|
||||||
import com.annimon.stream.Optional;
|
import com.annimon.stream.Optional;
|
||||||
@@ -8,6 +10,7 @@ import com.annimon.stream.Stream;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -120,24 +123,24 @@ public class MtbColt extends EntityBase {
|
|||||||
case ACQUISTO:
|
case ACQUISTO:
|
||||||
case LAVORAZIONE:
|
case LAVORAZIONE:
|
||||||
case PRODUZIONE:
|
case PRODUZIONE:
|
||||||
if(SettingsManager.iDB().getInternalCodAnags() == null) break;
|
if (SettingsManager.iDB().getInternalCodAnags() == null) break;
|
||||||
|
|
||||||
Optional<InternalCodAnagsDTO> optCodAnagForn = Stream.of(SettingsManager.iDB().getInternalCodAnags())
|
Optional<InternalCodAnagsDTO> optCodAnagForn = Stream.of(SettingsManager.iDB().getInternalCodAnags())
|
||||||
.filter(InternalCodAnagsDTO::isFornitore)
|
.filter(InternalCodAnagsDTO::isFornitore)
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
if(optCodAnagForn.isEmpty()) break;
|
if (optCodAnagForn.isEmpty()) break;
|
||||||
|
|
||||||
codAnagToUse = optCodAnagForn.get().getCodAnag();
|
codAnagToUse = optCodAnagForn.get().getCodAnag();
|
||||||
break;
|
break;
|
||||||
case VENDITA:
|
case VENDITA:
|
||||||
if(SettingsManager.iDB().getInternalCodAnags() == null) break;
|
if (SettingsManager.iDB().getInternalCodAnags() == null) break;
|
||||||
|
|
||||||
Optional<InternalCodAnagsDTO> optCodAnagClie = Stream.of(SettingsManager.iDB().getInternalCodAnags())
|
Optional<InternalCodAnagsDTO> optCodAnagClie = Stream.of(SettingsManager.iDB().getInternalCodAnags())
|
||||||
.filter(InternalCodAnagsDTO::isCliente)
|
.filter(InternalCodAnagsDTO::isCliente)
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
if(optCodAnagClie.isEmpty()) break;
|
if (optCodAnagClie.isEmpty()) break;
|
||||||
|
|
||||||
codAnagToUse = optCodAnagClie.get().getCodAnag();
|
codAnagToUse = optCodAnagClie.get().getCodAnag();
|
||||||
break;
|
break;
|
||||||
@@ -574,9 +577,41 @@ public class MtbColt extends EntityBase {
|
|||||||
String xmlPrefix = "{\"whereCond\": \"";
|
String xmlPrefix = "{\"whereCond\": \"";
|
||||||
String xmlSuffix = "\"}";
|
String xmlSuffix = "\"}";
|
||||||
|
|
||||||
StringBuilder whereCond = new StringBuilder();
|
// StringBuilder whereCond = new StringBuilder();
|
||||||
|
String whereCond;
|
||||||
|
List<String> conditions = new ArrayList<>();
|
||||||
|
String existingFilter;
|
||||||
|
if (this.filtroOrdini != null) {
|
||||||
|
existingFilter = this.filtroOrdini;
|
||||||
|
existingFilter = existingFilter.replace(xmlPrefix, "").replace(xmlSuffix, "");
|
||||||
|
conditions.add(existingFilter);
|
||||||
|
} else {
|
||||||
|
existingFilter = "";
|
||||||
|
}
|
||||||
|
|
||||||
if (filtroOrdineDtos != null && filtroOrdineDtos.size() > 0) {
|
|
||||||
|
for (FiltroOrdineDTO filtroOrdineDTO : filtroOrdineDtos) {
|
||||||
|
try {
|
||||||
|
String condition = (String.format("(d.g = %s AND d.d = %s and d.n = %s",
|
||||||
|
UtilityDB.valueToString(filtroOrdineDTO.getGestioneOrd()),
|
||||||
|
UtilityDB.valueToString(UtilityDate.formatDate(filtroOrdineDTO.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH)),
|
||||||
|
UtilityDB.valueToString(filtroOrdineDTO.getNumOrd())));
|
||||||
|
|
||||||
|
if (!UtilityString.isNullOrEmpty(filtroOrdineDTO.getDataConsS())) {
|
||||||
|
condition += (String.format(" AND dr.dc = %s",
|
||||||
|
UtilityDB.valueToString(UtilityDate.formatDate(filtroOrdineDTO.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH))));
|
||||||
|
}
|
||||||
|
|
||||||
|
condition += ")";
|
||||||
|
if (!existingFilter.contains(condition)) {
|
||||||
|
conditions.add(condition);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*if (filtroOrdineDtos != null && filtroOrdineDtos.size() > 0) {
|
||||||
|
|
||||||
for (int i = 0; i < filtroOrdineDtos.size(); i++) {
|
for (int i = 0; i < filtroOrdineDtos.size(); i++) {
|
||||||
FiltroOrdineDTO x = filtroOrdineDtos.get(i);
|
FiltroOrdineDTO x = filtroOrdineDtos.get(i);
|
||||||
@@ -602,7 +637,8 @@ public class MtbColt extends EntityBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
whereCond = TextUtils.join(" OR ", conditions);
|
||||||
|
|
||||||
this.filtroOrdini = xmlPrefix + whereCond + xmlSuffix;
|
this.filtroOrdini = xmlPrefix + whereCond + xmlSuffix;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package it.integry.integrywmsnative.core.report;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public enum ReportType {
|
||||||
|
|
||||||
|
@SerializedName("0")
|
||||||
|
ETICHETTA_SSCC_ACCETTAZIONE(0),
|
||||||
|
@SerializedName("1")
|
||||||
|
ETICHETTA_SSCC_LAVORAZIONE(1),
|
||||||
|
@SerializedName("2")
|
||||||
|
ETICHETTA_SSCC_SPEDIZIONE(2),
|
||||||
|
@SerializedName("3")
|
||||||
|
WMS_SPEDIZIONE_ETICHETTE_SSCC_ORD(3),
|
||||||
|
@SerializedName("4")
|
||||||
|
WMS_SPEDIZIONE_PACKING_LIST_ORD(4),
|
||||||
|
@SerializedName("5")
|
||||||
|
STAMPA_LISTINI_VENDITA(5);
|
||||||
|
|
||||||
|
private final int value;
|
||||||
|
|
||||||
|
ReportType(int value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ReportType from(Object value) {
|
||||||
|
int castValue = (int) value;
|
||||||
|
for (ReportType b : ReportType.values()) {
|
||||||
|
if (b.value == castValue)
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import java.net.SocketTimeoutException;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
||||||
|
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by GiuseppeS on 22/03/2018.
|
* Created by GiuseppeS on 22/03/2018.
|
||||||
@@ -15,13 +16,16 @@ public class CommonRESTException {
|
|||||||
private static String MESSAGE_KEY = "message";
|
private static String MESSAGE_KEY = "message";
|
||||||
private static String EXCEPTION_KEY = "exception";
|
private static String EXCEPTION_KEY = "exception";
|
||||||
|
|
||||||
private static HashMap<String, HashMap<String, Object>> bindingExceptions = new HashMap() {{
|
private static final HashMap<String, HashMap<String, Object>> bindingExceptions = new HashMap<>() {{
|
||||||
put("Printer not found", new HashMap<String, Object>(){{
|
put("Printer not found", new HashMap<>() {{
|
||||||
put(MESSAGE_KEY, "Stampante non trovata");
|
put(MESSAGE_KEY, "Stampante non trovata");
|
||||||
put(EXCEPTION_KEY, NoPrintersFoundException.class);
|
put(EXCEPTION_KEY, NoPrintersFoundException.class);
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
put("barcode non letto correttamente", new HashMap<>() {{
|
||||||
|
put(MESSAGE_KEY, "Barcode non letto correttamente");
|
||||||
|
put(EXCEPTION_KEY, NoResultFromBarcodeException.class);
|
||||||
|
}});
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|
||||||
@@ -42,13 +46,11 @@ public class CommonRESTException {
|
|||||||
|
|
||||||
for(String key : bindingExceptions.keySet()) {
|
for(String key : bindingExceptions.keySet()) {
|
||||||
if(message.contains(key)) {
|
if(message.contains(key)) {
|
||||||
Class classType = (Class) bindingExceptions.get(key).get(EXCEPTION_KEY);
|
Class<?> classType = (Class<?>) bindingExceptions.get(key).get(EXCEPTION_KEY);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return (Exception) classType.newInstance();
|
return (Exception) classType.newInstance();
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException | InstantiationException e) {
|
||||||
e.printStackTrace();
|
|
||||||
} catch (InstantiationException e) {
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ public class RESTBuilder {
|
|||||||
return getService(service, SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true);
|
return getService(service, SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> T getService(final Class<T> service, int timeout) {
|
public static <T> T getService(final Class<T> service, int timeout) {
|
||||||
return getService(service, SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true, true, timeout);
|
return getService(service, SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true, true, timeout);
|
||||||
|
|
||||||
@@ -34,7 +35,7 @@ public class RESTBuilder {
|
|||||||
return getService(service, host, port, addInterceptors, addEmsApi, 30);
|
return getService(service, host, port, addInterceptors, addEmsApi, 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors, boolean addEmsApi, int timeout){
|
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors, boolean addEmsApi, int timeout) {
|
||||||
OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder();
|
OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder();
|
||||||
|
|
||||||
clientBuilder.connectTimeout(timeout, TimeUnit.SECONDS);
|
clientBuilder.connectTimeout(timeout, TimeUnit.SECONDS);
|
||||||
@@ -43,7 +44,7 @@ public class RESTBuilder {
|
|||||||
|
|
||||||
clientBuilder.retryOnConnectionFailure(true);
|
clientBuilder.retryOnConnectionFailure(true);
|
||||||
|
|
||||||
if(addInterceptors) clientBuilder.addInterceptor(new HttpInterceptor());
|
if (addInterceptors) clientBuilder.addInterceptor(new HttpInterceptor());
|
||||||
|
|
||||||
OkHttpClient client = clientBuilder.build();
|
OkHttpClient client = clientBuilder.build();
|
||||||
|
|
||||||
@@ -62,4 +63,13 @@ public class RESTBuilder {
|
|||||||
|
|
||||||
return retrofit.create(service);
|
return retrofit.create(service);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String getDefaultHost() {
|
||||||
|
return SettingsManager.i().getServer().getHost();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getDefaultPort() {
|
||||||
|
return SettingsManager.i().getServer().getPort();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,9 @@ 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, "getByBarcodeProd", (m) -> {
|
analyzeAnswer(response, "getByBarcodeProd", (m) -> {
|
||||||
onComplete.run(response.body().getEntityList());
|
List<MtbAart> aartList = response.body().getEntityList();
|
||||||
|
aartList = Stream.of(aartList).filter(x -> x.getFlagStato().equalsIgnoreCase("A")).toList();
|
||||||
|
onComplete.run(aartList);
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -245,7 +245,14 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
MtbColt mtbColtToCreate = new MtbColt()
|
MtbColt mtbColtToCreate = new MtbColt()
|
||||||
.initDefaultFields(gestione);
|
.initDefaultFields(gestione);
|
||||||
|
|
||||||
Integer customNumCollo = UtilityBarcode.getNumColloFromULAnonima(barcode);
|
Integer customNumCollo = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
customNumCollo = UtilityBarcode.getNumColloFromULAnonima(barcode);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
onFailed.run(ex);
|
||||||
|
}
|
||||||
|
|
||||||
String customSerCollo = CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE;
|
String customSerCollo = CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE;
|
||||||
|
|
||||||
if (customNumCollo != null) {
|
if (customNumCollo != null) {
|
||||||
@@ -582,35 +589,37 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MtbColt mtbColtToMoveClone = (MtbColt) sourceMtbColt.clone();
|
new Thread(() -> {
|
||||||
MtbColt mtbColtDestClone = (MtbColt) destMtbColt.clone();
|
MtbColt mtbColtToMoveClone = (MtbColt) sourceMtbColt.clone();
|
||||||
|
MtbColt mtbColtDestClone = (MtbColt) destMtbColt.clone();
|
||||||
|
|
||||||
for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) {
|
for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) {
|
||||||
mtbColtToMoveClone.getMtbColr().get(i)
|
mtbColtToMoveClone.getMtbColr().get(i)
|
||||||
.setMtbAart(null)
|
.setMtbAart(null)
|
||||||
.setMtbPartitaMag(null);
|
.setMtbPartitaMag(null);
|
||||||
}
|
|
||||||
|
|
||||||
mtbColtDestClone.setMtbColr(null);
|
|
||||||
|
|
||||||
SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO = new SpostaArtsTraULRequestDTO()
|
|
||||||
.setSourceMtbColt(mtbColtToMoveClone)
|
|
||||||
.setDestinationMtbColt(mtbColtDestClone);
|
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
|
||||||
colliMagazzinoRESTConsumerService.spostaArtsTraUL(spostaArtsTraULRequestDTO).enqueue(new Callback<>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
|
||||||
analyzeAnswer(response, "spostaArtsTraUL", data -> {
|
|
||||||
onComplete.run();
|
|
||||||
}, onFailed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
mtbColtDestClone.setMtbColr(null);
|
||||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
|
||||||
if (onFailed != null) onFailed.run(new Exception(t));
|
SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO = new SpostaArtsTraULRequestDTO()
|
||||||
}
|
.setSourceMtbColt(mtbColtToMoveClone)
|
||||||
});
|
.setDestinationMtbColt(mtbColtDestClone);
|
||||||
|
|
||||||
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
|
colliMagazzinoRESTConsumerService.spostaArtsTraUL(spostaArtsTraULRequestDTO).enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
|
analyzeAnswer(response, "spostaArtsTraUL", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||||
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void assegnaLottoSuColloScarico(MtbColt sourceMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void assegnaLottoSuColloScarico(MtbColt sourceMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ import java.util.List;
|
|||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.StbGestSetup;
|
import it.integry.integrywmsnative.core.model.StbGestSetup;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.model.GestSetupDTO;
|
import it.integry.integrywmsnative.core.rest.model.GestSetupDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
@@ -35,18 +35,18 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
|||||||
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
|
||||||
Log.e("GestSetup", t.toString());
|
Log.e("GestSetup", t.toString());
|
||||||
// UtilityLogger.errorMe(new Exception(t));
|
// UtilityLogger.errorMe(new Exception(t));
|
||||||
if(onFailed != null) onFailed.run(new Exception(t));
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void getBooleanValue(String gestName, String sectionName, String keySection, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void getBooleanValue(String gestName, String sectionName, String keySection, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
getValueStatic(gestName, sectionName, keySection, value -> {
|
getValueStatic(gestName, sectionName, keySection, value -> {
|
||||||
if(value != null){
|
if (value != null) {
|
||||||
onComplete.run("S".equalsIgnoreCase(value.value));
|
onComplete.run("S".equalsIgnoreCase(value.value));
|
||||||
} else onComplete.run(false);
|
} else onComplete.run(false);
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,25 +62,25 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
|||||||
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
|
||||||
Log.e("PrintCollo", t.toString());
|
Log.e("PrintCollo", t.toString());
|
||||||
UtilityLogger.errorMe(new Exception(t));
|
UtilityLogger.errorMe(new Exception(t));
|
||||||
if(onFailed != null) onFailed.run(new Exception(t));
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void getBooleanValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void getBooleanValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
getValueStatic(gestName, sectionName, keySection, codMdep, value -> {
|
getValueStatic(gestName, sectionName, keySection, codMdep, value -> {
|
||||||
if(value != null){
|
if (value != null) {
|
||||||
onComplete.run("S".equalsIgnoreCase(value.value));
|
onComplete.run("S".equalsIgnoreCase(value.value));
|
||||||
} else onComplete.run(false);
|
} else onComplete.run(false);
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
if(onFailed != null) onFailed.run(ex);
|
if (onFailed != null) onFailed.run(ex);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void getValues(List<StbGestSetup> stbGestSetupList, RunnableArgs<List<StbGestSetup>> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void getValues(String codMdep, List<StbGestSetup> stbGestSetupList, RunnableArgs<List<StbGestSetup>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
|
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
|
||||||
service.getGestSetupValues(stbGestSetupList).enqueue(new Callback<ServiceRESTResponse<List<StbGestSetup>>>() {
|
service.getGestSetupValues(codMdep, stbGestSetupList).enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Response<ServiceRESTResponse<List<StbGestSetup>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Response<ServiceRESTResponse<List<StbGestSetup>>> response) {
|
||||||
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
|
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
|
||||||
@@ -89,7 +89,7 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
|||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Throwable t) {
|
||||||
UtilityLogger.errorMe(new Exception(t));
|
UtilityLogger.errorMe(new Exception(t));
|
||||||
if(onFailed != null) onFailed.run(new Exception(t));
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public interface GestSetupRESTConsumerService {
|
|||||||
|
|
||||||
@POST("gestSetupList")
|
@POST("gestSetupList")
|
||||||
Call<ServiceRESTResponse<List<StbGestSetup>>> getGestSetupValues(
|
Call<ServiceRESTResponse<List<StbGestSetup>>> getGestSetupValues(
|
||||||
|
@Query("codMdep") String codMdep,
|
||||||
@Body List<StbGestSetup> stbGestSetupList);
|
@Body List<StbGestSetup> stbGestSetupList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,11 +46,11 @@ public class MesRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getOrdiniLavorazione(String flagEvaso, String codJfas, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getOrdiniLavorazione(String flagEvaso, String codJfas, String codAnag, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
||||||
|
|
||||||
mesRESTConsumerService.getOrdiniLavorazione(flagEvaso, codJfas)
|
mesRESTConsumerService.getOrdiniLavorazione(null, flagEvaso, codJfas, codAnag)
|
||||||
.enqueue(new Callback<ServiceRESTResponse<List<OrdineLavorazioneDTO>>>() {
|
.enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
||||||
analyzeAnswer(response, "getOrdiniLavorazione", (m) -> onComplete.run(response.body().getDto()), onFailed);
|
analyzeAnswer(response, "getOrdiniLavorazione", (m) -> onComplete.run(response.body().getDto()), onFailed);
|
||||||
@@ -63,6 +63,7 @@ public class MesRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void getOrdiniLavorazione(Date dateStart, String flagEvaso, String codJfas, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getOrdiniLavorazione(Date dateStart, String flagEvaso, String codJfas, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
||||||
|
|
||||||
@@ -82,7 +83,8 @@ public class MesRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
public void getLineeProduzione(String codJfasParent, RunnableArgs<List<JtbFasi>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getLineeProduzione(String codJfasParent, RunnableArgs<List<JtbFasi>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<JtbFasi>>() {}.getType();
|
Type typeOfObjectsList = new TypeToken<ArrayList<JtbFasi>>() {
|
||||||
|
}.getType();
|
||||||
this.mSystemRESTConsumer.processSql(
|
this.mSystemRESTConsumer.processSql(
|
||||||
"SELECT * FROM jtb_fasi WHERE cod_jfas_parent = " + UtilityDB.valueToString(codJfasParent),
|
"SELECT * FROM jtb_fasi WHERE cod_jfas_parent = " + UtilityDB.valueToString(codJfasParent),
|
||||||
typeOfObjectsList,
|
typeOfObjectsList,
|
||||||
|
|||||||
@@ -22,4 +22,7 @@ public interface MesRESTConsumerService {
|
|||||||
@GET("mes_v2/getOrdiniLavorazione")
|
@GET("mes_v2/getOrdiniLavorazione")
|
||||||
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazione(@Query("startDate") String startDate, @Query("flagEvaso") String flagEvaso, @Query("codJfas") String codJfas);
|
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazione(@Query("startDate") String startDate, @Query("flagEvaso") String flagEvaso, @Query("codJfas") String codJfas);
|
||||||
|
|
||||||
|
@GET("mes_v2/getOrdiniLavorazione")
|
||||||
|
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazione(@Query("startDate") String startDate, @Query("flagEvaso") String flagEvaso, @Query("codJfas") String codJfas, @Query("codAnag") String codAnag);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,8 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
&& (!UtilityString.isNullOrEmpty(x.getPartitaMag()) && x.getPartitaMag().equalsIgnoreCase(mtbColr.getPartitaMag())))
|
&& (!UtilityString.isNullOrEmpty(x.getPartitaMag()) && x.getPartitaMag().equalsIgnoreCase(mtbColr.getPartitaMag())))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
if (optionalMtbPartitaMag.isPresent()) mtbColr.setMtbPartitaMag(optionalMtbPartitaMag.get());
|
if (optionalMtbPartitaMag.isPresent())
|
||||||
|
mtbColr.setMtbPartitaMag(optionalMtbPartitaMag.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -160,7 +161,15 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
service.getArticoliFromOrdini(codMdep, getPickingListDTOs).enqueue(new Callback<>() {
|
service.getArticoliFromOrdini(codMdep, getPickingListDTOs).enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Response<ServiceRESTResponse<List<SitArtOrdDTO>>> response) {
|
public void onResponse(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Response<ServiceRESTResponse<List<SitArtOrdDTO>>> response) {
|
||||||
analyzeAnswer(response, "retrieveListaArticoliFromOrdiniUscita", onComplete, onFailed);
|
analyzeAnswer(response, "retrieveListaArticoliFromOrdiniUscita", sitArtOrds -> {
|
||||||
|
if (sitArtOrds != null) {
|
||||||
|
for (SitArtOrdDTO sitArtOrd : sitArtOrds) {
|
||||||
|
sitArtOrd.setCodMart(sitArtOrd.getCodMart().trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onComplete.run(sitArtOrds);
|
||||||
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -182,13 +191,13 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String baseSql = "SELECT DISTINCT mtb_colt.* " +
|
String baseSql = "SELECT DISTINCT mtb_colt.* " +
|
||||||
"FROM mtb_colt, " +
|
"FROM mtb_colt " +
|
||||||
" mtb_colr " +
|
" INNER JOIN mtb_colr ON " +
|
||||||
"WHERE mtb_colt.gestione = mtb_colr.gestione " +
|
" mtb_colt.gestione = mtb_colr.gestione " +
|
||||||
" AND mtb_colt.ser_collo = mtb_colr.ser_collo " +
|
" AND mtb_colt.ser_collo = mtb_colr.ser_collo " +
|
||||||
" AND mtb_colt.data_collo = mtb_colr.data_collo " +
|
" AND mtb_colt.data_collo = mtb_colr.data_collo " +
|
||||||
" AND mtb_colt.num_collo = mtb_colr.num_collo " +
|
" AND mtb_colt.num_collo = mtb_colr.num_collo " +
|
||||||
" AND " + whereCondGestione +
|
" WHERE " + whereCondGestione +
|
||||||
" AND mtb_colt.segno = " + UtilityDB.valueToString(segno) + " " +
|
" AND mtb_colt.segno = " + UtilityDB.valueToString(segno) + " " +
|
||||||
" AND mtb_colt.data_doc IS NULL AND ";
|
" AND mtb_colt.data_doc IS NULL AND ";
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.groupBy(ArticoloDTO::getCodMart)
|
.groupBy(ArticoloDTO::getCodMart)
|
||||||
.forEach(entry -> {
|
.forEach(entry -> {
|
||||||
|
|
||||||
if(entry.getValue().size() == 1) {
|
if (entry.getValue().size() == 1) {
|
||||||
listaArticoli.add(entry.getValue().get(0));
|
listaArticoli.add(entry.getValue().get(0));
|
||||||
} else {
|
} else {
|
||||||
for (ArticoloDTO articolo : entry.getValue()) {
|
for (ArticoloDTO articolo : entry.getValue()) {
|
||||||
@@ -93,7 +93,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
for (ArticoloOrdine art : articoli) {
|
for (ArticoloOrdine art : articoli) {
|
||||||
i++;
|
i++;
|
||||||
artRows.add(convertArtToDTO(art,i));
|
artRows.add(convertArtToDTO(art, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
ordineDTO.setChiaveGriglia(griglia.getCodAlis());
|
ordineDTO.setChiaveGriglia(griglia.getCodAlis());
|
||||||
@@ -109,9 +109,9 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
.enqueue(new Callback<List<ServiceRESTResponse<DtbOrdt>>>() {
|
.enqueue(new Callback<List<ServiceRESTResponse<DtbOrdt>>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<List<ServiceRESTResponse<DtbOrdt>>> call, Response<List<ServiceRESTResponse<DtbOrdt>>> response) {
|
public void onResponse(Call<List<ServiceRESTResponse<DtbOrdt>>> call, Response<List<ServiceRESTResponse<DtbOrdt>>> response) {
|
||||||
if (response.body() != null && response.body().size() > 0){
|
if (response.body() != null && response.body().size() > 0) {
|
||||||
analyzeListOfAnswers(response, "getArticoliListino", dtoList-> {
|
analyzeListOfAnswers(response, "getArticoliListino", dtoList -> {
|
||||||
if (dtoList.size() > 0){
|
if (dtoList.size() > 0) {
|
||||||
DtbOrdt dto = dtoList.get(0);
|
DtbOrdt dto = dtoList.get(0);
|
||||||
ordine.setTransmitted(true);
|
ordine.setTransmitted(true);
|
||||||
ordine.setTransmissionDate(UtilityDate.getDateInstance());
|
ordine.setTransmissionDate(UtilityDate.getDateInstance());
|
||||||
@@ -120,7 +120,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
ordine.setCodMdep(dto.getCodMdep());
|
ordine.setCodMdep(dto.getCodMdep());
|
||||||
ordine.setNumOrd(dto.getNumOrd());
|
ordine.setNumOrd(dto.getNumOrd());
|
||||||
onSuccess.run(ordine);
|
onSuccess.run(ordine);
|
||||||
}else{
|
} else {
|
||||||
onFailed.run(new Exception("Nessun ordine generato"));
|
onFailed.run(new Exception("Nessun ordine generato"));
|
||||||
}
|
}
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
@@ -128,7 +128,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<List<ServiceRESTResponse<DtbOrdt>>>call, Throwable t) {
|
public void onFailure(Call<List<ServiceRESTResponse<DtbOrdt>>> call, Throwable t) {
|
||||||
Log.e("saveOrdineTerminale_pv", t.toString());
|
Log.e("saveOrdineTerminale_pv", t.toString());
|
||||||
UtilityLogger.errorMe(new Exception(t));
|
UtilityLogger.errorMe(new Exception(t));
|
||||||
onFailed.run(new Exception(t));
|
onFailed.run(new Exception(t));
|
||||||
@@ -136,7 +136,6 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ArtDTO convertArtToDTO(ArticoloOrdine art, int rigaOrd) {
|
private ArtDTO convertArtToDTO(ArticoloOrdine art, int rigaOrd) {
|
||||||
@@ -147,6 +146,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
dto.setDescrizione(art.getDescrizione());
|
dto.setDescrizione(art.getDescrizione());
|
||||||
dto.setDataInsD(art.getDataIns());
|
dto.setDataInsD(art.getDataIns());
|
||||||
dto.setUntMis(art.getUntMis());
|
dto.setUntMis(art.getUntMis());
|
||||||
|
dto.setSystemNote(art.getSystemNote());
|
||||||
dto.setQta(BigDecimal.valueOf(art.getQtaOrd()));
|
dto.setQta(BigDecimal.valueOf(art.getQtaOrd()));
|
||||||
dto.setQtaCnf(BigDecimal.valueOf(art.getQtaCnf()));
|
dto.setQtaCnf(BigDecimal.valueOf(art.getQtaCnf()));
|
||||||
dto.setColli(BigDecimal.ZERO);
|
dto.setColli(BigDecimal.ZERO);
|
||||||
|
|||||||
@@ -9,16 +9,18 @@ import java.util.List;
|
|||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.BuildConfig;
|
|
||||||
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.report.ReportType;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.JasperPairDTO;
|
import it.integry.integrywmsnative.core.rest.model.JasperPairDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ReportTypeDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
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 it.integry.integrywmsnative.gest.spedizione.model.PrintOrderCloseDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
@@ -55,7 +57,7 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void printCollo(Type printerType, MtbColt testataColloToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void printCollo(MtbColt testataColloToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
// if (BuildConfig.DEBUG) {
|
// if (BuildConfig.DEBUG) {
|
||||||
// onComplete.run();
|
// onComplete.run();
|
||||||
@@ -64,10 +66,7 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
Call<ServiceRESTResponse<Object>> callable = null;
|
Call<ServiceRESTResponse<Object>> callable = null;
|
||||||
if (printerType != null)
|
callable = printerService.printCollo(testataColloToPrint);
|
||||||
callable = printerService.printCollo(printerType.toString(), testataColloToPrint);
|
|
||||||
else
|
|
||||||
callable = printerService.printCollo(testataColloToPrint);
|
|
||||||
|
|
||||||
callable.enqueue(new Callback<>() {
|
callable.enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
@@ -119,4 +118,64 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void printReportType(ReportType reportType, String codMdep, String codAnag, HashMap<String, Object> params, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
ReportTypeDTO reportTypeDTO = new ReportTypeDTO();
|
||||||
|
reportTypeDTO.setReportType(reportType);
|
||||||
|
reportTypeDTO.setCodAnag(codAnag);
|
||||||
|
reportTypeDTO.setCodMdep(codMdep);
|
||||||
|
|
||||||
|
Stream.of(params)
|
||||||
|
.forEach(x -> reportTypeDTO.getParams().add(new JasperPairDTO(x.getKey(), x.getValue())));
|
||||||
|
|
||||||
|
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
|
printerService
|
||||||
|
.printReportType(reportTypeDTO)
|
||||||
|
.enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
|
analyzeAnswer(response, "printReportType", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||||
|
if (t.getMessage().contains("Printer not found")) {
|
||||||
|
onFailed.run(new NoPrintersFoundException());
|
||||||
|
} else onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printReportType(ReportType reportType, HashMap<String, Object> params, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
printReportType(reportType, null, null, params, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printReportType(ReportType reportType, String codMdep, HashMap<String, Object> params, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
printReportType(reportType, codMdep, null, params, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void printClosedOrders(PrintOrderCloseDTO dto, String codMdep, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class, 240);
|
||||||
|
Call<ServiceRESTResponse<Object>> callable = printerService.printClosedOrders(codMdep, dto);
|
||||||
|
callable.enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
|
analyzeAnswer(response, "printCollo", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||||
|
if (t.getMessage().contains("Printer not found")) {
|
||||||
|
onFailed.run(new NoPrintersFoundException());
|
||||||
|
} else onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ import java.util.List;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ReportTypeDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione.model.PrintOrderCloseDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.http.Body;
|
import retrofit2.http.Body;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
@@ -26,11 +28,9 @@ public interface PrinterRESTConsumerService {
|
|||||||
@Body JasperDTO jasperDTO
|
@Body JasperDTO jasperDTO
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@POST("printReportType")
|
||||||
@POST("wms/printEtichettaSSCC")
|
Call<ServiceRESTResponse<Object>> printReportType(
|
||||||
Call<ServiceRESTResponse<Object>> printCollo(
|
@Body ReportTypeDTO reportTypeDTO
|
||||||
@Query("printerType") String printerType,
|
|
||||||
@Body MtbColt mtbColtToPrint
|
|
||||||
);
|
);
|
||||||
|
|
||||||
@POST("wms/printEtichettaSSCC")
|
@POST("wms/printEtichettaSSCC")
|
||||||
@@ -38,4 +38,10 @@ public interface PrinterRESTConsumerService {
|
|||||||
@Body MtbColt mtbColtToPrint
|
@Body MtbColt mtbColtToPrint
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@POST("wms/printClosedOrders")
|
||||||
|
Call<ServiceRESTResponse<Object>> printClosedOrders(
|
||||||
|
@Query("codMdep") String codMdep,
|
||||||
|
@Body PrintOrderCloseDTO printOrderCloseDTO
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,112 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
public void avviaLineaDiProduzione(String codJfas, Integer hrNum, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class);
|
||||||
|
Call<ServiceRESTResponse<JsonObject>> callable = restService.avviaLineaDiProduzione(codJfas, hrNum);
|
||||||
|
callable.enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||||
|
analyzeAnswer(response, "avviaLineaDiProduzione", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void arrestaLineaDiProduzione(String codJfas, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class);
|
||||||
|
Call<ServiceRESTResponse<JsonObject>> callable = restService.arrestaLineaDiProduzione(codJfas);
|
||||||
|
callable.enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||||
|
analyzeAnswer(response, "arrestaLineaDiProduzione", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void avviaProduzioneArticoloSuLinea(String codJfas, String codMart, String partitaMag, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class, 300);
|
||||||
|
Call<ServiceRESTResponse<JsonObject>> callable = restService.avviaProduzioneArticoloSuLinea(codJfas, codMart, partitaMag);
|
||||||
|
callable.enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||||
|
analyzeAnswer(response, "avviaProduzioneArticoloSuLinea", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getStatoLinee(String codMdep, RunnableArgs<List<ProdLineStatusDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class);
|
||||||
|
Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> callable = restService.getStatoLinee(codMdep);
|
||||||
|
callable.enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Response<ServiceRESTResponse<List<ProdLineStatusDTO>>> response) {
|
||||||
|
analyzeAnswer(response, "getStatoLinee", onComplete::run, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void getLineDetails(ProdLineStatusDTO lineaProd, RunnableArgs<ProdLineStatusDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class);
|
||||||
|
Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> callable = restService.getStatoLinee(lineaProd.getCodMdepLav());
|
||||||
|
callable.enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Response<ServiceRESTResponse<List<ProdLineStatusDTO>>> response) {
|
||||||
|
analyzeAnswer(response, "getLineDetails", (lines) -> {
|
||||||
|
ProdLineStatusDTO newLine = Stream.of(lines).filter(dto -> dto.getCodJfas().equalsIgnoreCase(lineaProd.getCodJfas())).findFirstOrElse(null);
|
||||||
|
onComplete.run(newLine);
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface ProductionLinesRESTConsumerService {
|
||||||
|
|
||||||
|
@POST("mes_v2/avviaLineaDiProduzione")
|
||||||
|
Call<ServiceRESTResponse<JsonObject>> avviaLineaDiProduzione(@Query("codJfas") String codJfas, @Query("hrNum") Integer hrNum);
|
||||||
|
|
||||||
|
@POST("mes_v2/arrestaLineaDiProduzione")
|
||||||
|
Call<ServiceRESTResponse<JsonObject>> arrestaLineaDiProduzione(@Query("codJfas") String codJfas);
|
||||||
|
|
||||||
|
@POST("mes_v2/avviaProduzioneArticoloSuLinea")
|
||||||
|
Call<ServiceRESTResponse<JsonObject>> avviaProduzioneArticoloSuLinea(@Query("codJfas") String codJfas, @Query("codMart") String codMart, @Query("partitaMag") String partitaMag);
|
||||||
|
|
||||||
|
@GET("mes_v2/statoLineeProd")
|
||||||
|
Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> getStatoLinee(@Query("codMdep") String codMdep);
|
||||||
|
}
|
||||||
@@ -15,6 +15,7 @@ import java.io.InputStream;
|
|||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
|
import java.net.ConnectException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -23,6 +24,7 @@ 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.exception.InvalidConnectionException;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.Azienda;
|
import it.integry.integrywmsnative.core.model.Azienda;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
@@ -47,37 +49,43 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
nativeSqlDTO.nativeSql = nativeSql;
|
nativeSqlDTO.nativeSql = nativeSql;
|
||||||
|
|
||||||
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||||
service.processSql(nativeSqlDTO).enqueue(new Callback<>() {
|
service
|
||||||
@Override
|
.processSql(nativeSqlDTO)
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
.enqueue(new Callback<>() {
|
||||||
analyzeAnswer(response, "ProcessSql", o -> {
|
@Override
|
||||||
Gson gson = new GsonBuilder()
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
.registerTypeAdapter(Date.class, (JsonDeserializer) (json, typeOfT, context) -> {
|
analyzeAnswer(response, "ProcessSql", o -> {
|
||||||
try {
|
Gson gson = new GsonBuilder()
|
||||||
return UtilityDate.recognizeDate(json.getAsString());
|
.registerTypeAdapter(Date.class, (JsonDeserializer<?>) (json, typeOfT, context) -> {
|
||||||
} catch (Exception e) {
|
try {
|
||||||
throw new JsonParseException(e);
|
return UtilityDate.recognizeDate(json.getAsString());
|
||||||
}
|
} catch (Exception e) {
|
||||||
})
|
throw new JsonParseException(e);
|
||||||
.create();
|
}
|
||||||
|
})
|
||||||
|
.create();
|
||||||
|
|
||||||
|
|
||||||
String json = gson.toJson(o);
|
String json = gson.toJson(o);
|
||||||
|
|
||||||
InputStream ims = new ByteArrayInputStream(json.getBytes());
|
InputStream ims = new ByteArrayInputStream(json.getBytes());
|
||||||
Reader reader = new InputStreamReader(ims);
|
Reader reader = new InputStreamReader(ims);
|
||||||
T gsonObj = gson.fromJson(reader, clazz);
|
T gsonObj = gson.fromJson(reader, clazz);
|
||||||
|
|
||||||
onComplete.run(gsonObj);
|
onComplete.run(gsonObj);
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||||
Logger.e(t, "ProcessSQL");
|
Logger.e(t, "ProcessSQL");
|
||||||
onFailed.run(new Exception(t));
|
|
||||||
}
|
if (t instanceof ConnectException)
|
||||||
});
|
onFailed.run(new InvalidConnectionException(RESTBuilder.getDefaultHost(), RESTBuilder.getDefaultPort(), t));
|
||||||
|
else
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
public class _BaseRESTConsumer {
|
public abstract class _BaseRESTConsumer {
|
||||||
|
|
||||||
public static <T> void analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle, RunnableArgs<T> onComplete, RunnableArgs<Exception> onFailed) {
|
public static <T> void analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle, RunnableArgs<T> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
@@ -31,7 +31,6 @@ public class _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.e(logTitle, response.body().getErrorMessage());
|
Log.e(logTitle, response.body().getErrorMessage());
|
||||||
// callback.onFailed(new Exception(response.body().getErrorMessage()));
|
|
||||||
onFailed.run(CommonRESTException.tryRecognizeException(response.body().getErrorMessage()));
|
onFailed.run(CommonRESTException.tryRecognizeException(response.body().getErrorMessage()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -67,7 +66,7 @@ public class _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.e(logTitle, response.body().getErrorMessage());
|
Log.e(logTitle, response.body().getErrorMessage());
|
||||||
onFailed.run(new Exception(response.body().getErrorMessage()));
|
onFailed.run(CommonRESTException.tryRecognizeException(response.body().getErrorMessage()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.e(logTitle, response.message());
|
Log.e(logTitle, response.message());
|
||||||
@@ -77,7 +76,9 @@ public class _BaseRESTConsumer {
|
|||||||
if (response.code() == 404) {
|
if (response.code() == 404) {
|
||||||
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata");
|
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata");
|
||||||
onFailed.run(new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")"));
|
onFailed.run(new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")"));
|
||||||
} else {
|
} else if (response.code() == 550)
|
||||||
|
onFailed.run(new NotValidLicenseException());
|
||||||
|
else {
|
||||||
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
||||||
onFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
|
onFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
|
||||||
}
|
}
|
||||||
@@ -114,7 +115,9 @@ public class _BaseRESTConsumer {
|
|||||||
if (responseList.code() == 404) {
|
if (responseList.code() == 404) {
|
||||||
Log.e(logTitle, "Errore " + responseList.code() + ": risorsa non trovata");
|
Log.e(logTitle, "Errore " + responseList.code() + ": risorsa non trovata");
|
||||||
onFailed.run(new Exception("Errore " + responseList.code() + ": risorsa non trovata (" + logTitle + ")"));
|
onFailed.run(new Exception("Errore " + responseList.code() + ": risorsa non trovata (" + logTitle + ")"));
|
||||||
} else {
|
} else if (responseList.code() == 550)
|
||||||
|
onFailed.run(new NotValidLicenseException());
|
||||||
|
else {
|
||||||
Log.e(logTitle, "Status " + responseList.code() + ": " + responseList.message());
|
Log.e(logTitle, "Status " + responseList.code() + ": " + responseList.message());
|
||||||
onFailed.run(new Exception("Status " + responseList.code() + ": " + responseList.message()));
|
onFailed.run(new Exception("Status " + responseList.code() + ": " + responseList.message()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.report.ReportType;
|
||||||
|
|
||||||
|
public class ReportTypeDTO {
|
||||||
|
|
||||||
|
|
||||||
|
private ReportType reportType;
|
||||||
|
private String codAnag;
|
||||||
|
private String codMdep;
|
||||||
|
private List<JasperPairDTO> params = new ArrayList<>();
|
||||||
|
|
||||||
|
public List<JasperPairDTO> getParams() {
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportTypeDTO setParams(List<JasperPairDTO> params) {
|
||||||
|
this.params = params;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportType getReportType() {
|
||||||
|
return reportType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportTypeDTO setReportType(ReportType reportType) {
|
||||||
|
this.reportType = reportType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodAnag() {
|
||||||
|
return codAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportTypeDTO setCodAnag(String codAnag) {
|
||||||
|
this.codAnag = codAnag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportTypeDTO setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,6 +26,7 @@ public class SitArtOrdDTO {
|
|||||||
private String descrizioneMsgr;
|
private String descrizioneMsgr;
|
||||||
private String codMsfa;
|
private String codMsfa;
|
||||||
private String descrizioneMsfa;
|
private String descrizioneMsfa;
|
||||||
|
private String untord;
|
||||||
|
|
||||||
private final HashMap<String, Object> extraInfo = new HashMap<>();
|
private final HashMap<String, Object> extraInfo = new HashMap<>();
|
||||||
|
|
||||||
@@ -212,4 +213,13 @@ public class SitArtOrdDTO {
|
|||||||
public HashMap<String, Object> getExtraInfo() {
|
public HashMap<String, Object> getExtraInfo() {
|
||||||
return extraInfo;
|
return extraInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getUntord() {
|
||||||
|
return untord;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SitArtOrdDTO setUntord(String untord) {
|
||||||
|
this.untord = untord;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,10 +42,14 @@ public class DBSettingsModel {
|
|||||||
private boolean flagOrdinaArticoliOnScan;
|
private boolean flagOrdinaArticoliOnScan;
|
||||||
private String docInterniCheckFornitore;
|
private String docInterniCheckFornitore;
|
||||||
private String produzioneDefaultCodAnag;
|
private String produzioneDefaultCodAnag;
|
||||||
private String reportNameSpedizionChiudiOrdine;
|
private boolean flagPrintPackingListOnOrderClose;
|
||||||
|
private boolean flagPrintEtichetteOnOrderClose;
|
||||||
private int onNumCnfInputChanged = 1;
|
private int onNumCnfInputChanged = 1;
|
||||||
|
private int onQtaTotInputChanged = 1;
|
||||||
private boolean flagAccettazioneUseQtaOrd = false;
|
private boolean flagAccettazioneUseQtaOrd = false;
|
||||||
private boolean flagPickLiberoAllowEmptyDest = false;
|
private boolean flagPickLiberoAllowEmptyDest = false;
|
||||||
|
private boolean flagAskInfoAggiuntiveSpedizione = false;
|
||||||
|
private String filterFornitoreProd;
|
||||||
|
|
||||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||||
return flagSpedizioneEnableFakeGiacenza;
|
return flagSpedizioneEnableFakeGiacenza;
|
||||||
@@ -281,12 +285,21 @@ public class DBSettingsModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getReportNameSpedizionChiudiOrdine() {
|
public boolean isFlagPrintPackingListOnOrderClose() {
|
||||||
return reportNameSpedizionChiudiOrdine;
|
return flagPrintPackingListOnOrderClose;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DBSettingsModel setReportNameSpedizionChiudiOrdine(String reportNameSpedizionChiudiOrdine) {
|
public DBSettingsModel setFlagPrintPackingListOnOrderClose(boolean flagPrintPackingListOnOrderClose) {
|
||||||
this.reportNameSpedizionChiudiOrdine = reportNameSpedizionChiudiOrdine;
|
this.flagPrintPackingListOnOrderClose = flagPrintPackingListOnOrderClose;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFlagPrintEtichetteOnOrderClose() {
|
||||||
|
return flagPrintEtichetteOnOrderClose;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setFlagPrintEtichetteOnOrderClose(boolean flagPrintEtichetteOnOrderClose) {
|
||||||
|
this.flagPrintEtichetteOnOrderClose = flagPrintEtichetteOnOrderClose;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,6 +312,15 @@ public class DBSettingsModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getOnQtaTotInputChanged() {
|
||||||
|
return onQtaTotInputChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setOnQtaTotInputChanged(int onQtaTotInputChanged) {
|
||||||
|
this.onQtaTotInputChanged = onQtaTotInputChanged;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public List<String> getNotePerditaDocInterni() {
|
public List<String> getNotePerditaDocInterni() {
|
||||||
return notePerditaDocInterni;
|
return notePerditaDocInterni;
|
||||||
}
|
}
|
||||||
@@ -336,7 +358,7 @@ public class DBSettingsModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean getFlagOrdinaArticoliOnScan() {
|
public boolean isFlagOrdinaArticoliOnScan() {
|
||||||
return flagOrdinaArticoliOnScan;
|
return flagOrdinaArticoliOnScan;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -344,4 +366,22 @@ public class DBSettingsModel {
|
|||||||
this.flagOrdinaArticoliOnScan = flagOrdinaArticoliOnScan;
|
this.flagOrdinaArticoliOnScan = flagOrdinaArticoliOnScan;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFlagAskInfoAggiuntiveSpedizione() {
|
||||||
|
return flagAskInfoAggiuntiveSpedizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setFlagAskInfoAggiuntiveSpedizione(boolean flagAskInfoAggiuntiveSpedizione) {
|
||||||
|
this.flagAskInfoAggiuntiveSpedizione = flagAskInfoAggiuntiveSpedizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFilterFornitoreProd() {
|
||||||
|
return filterFornitoreProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setFilterFornitoreProd(String filterFornitoreProd) {
|
||||||
|
this.filterFornitoreProd = filterFornitoreProd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -258,6 +258,10 @@ public class SettingsManager {
|
|||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("PRODUZIONE")
|
.setSection("PRODUZIONE")
|
||||||
.setKeySection("FLAG_VERSAMENTO_DIRETTO"));
|
.setKeySection("FLAG_VERSAMENTO_DIRETTO"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PICKING")
|
||||||
|
.setSection("PRODUZIONE")
|
||||||
|
.setKeySection("FILTER_FORNTIORE_PROD"));
|
||||||
stbGestSetupList.add(new StbGestSetup()
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("SPEDIZIONE")
|
.setSection("SPEDIZIONE")
|
||||||
@@ -270,10 +274,6 @@ public class SettingsManager {
|
|||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("SPEDIZIONE")
|
.setSection("SPEDIZIONE")
|
||||||
.setKeySection("FLAG_CAN_SELECT_MULTIPLE_ORDERS"));
|
.setKeySection("FLAG_CAN_SELECT_MULTIPLE_ORDERS"));
|
||||||
stbGestSetupList.add(new StbGestSetup()
|
|
||||||
.setGestName("PICKING")
|
|
||||||
.setSection("SPEDIZIONE")
|
|
||||||
.setKeySection("REPORT_PACKING_LIST"));
|
|
||||||
stbGestSetupList.add(new StbGestSetup()
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("SPEDIZIONE")
|
.setSection("SPEDIZIONE")
|
||||||
@@ -282,6 +282,10 @@ 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("PICKING")
|
||||||
|
.setSection("SETUP")
|
||||||
|
.setKeySection("ON_QTA_TOT_INPUT_CHANGED"));
|
||||||
stbGestSetupList.add(new StbGestSetup()
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
.setGestName("PVM")
|
.setGestName("PVM")
|
||||||
.setSection("DOC_INTERNI")
|
.setSection("DOC_INTERNI")
|
||||||
@@ -306,9 +310,25 @@ public class SettingsManager {
|
|||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("PICKING_LIBERO")
|
.setSection("PICKING_LIBERO")
|
||||||
.setKeySection("FLAG_ALLOW_EMPTY_DEST"));
|
.setKeySection("FLAG_ALLOW_EMPTY_DEST"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PICKING")
|
||||||
|
.setSection("SPEDIZIONE")
|
||||||
|
.setKeySection("FLAG_PRINT_PACKING_LIST_ON_CLOSE"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PICKING")
|
||||||
|
.setSection("SPEDIZIONE")
|
||||||
|
.setKeySection("FLAG_PRINT_ETICHETTE_ON_CLOSE"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PICKING")
|
||||||
|
.setSection("SPEDIZIONE")
|
||||||
|
.setKeySection("FLAG_ALLOW_EMPTY_DEST"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PICKING")
|
||||||
|
.setSection("SPEDIZIONE")
|
||||||
|
.setKeySection("FLAG_ASK_INFO_AGGIUNTIVE"));
|
||||||
|
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||||
|
|
||||||
|
GestSetupRESTConsumer.getValues(codMdep, stbGestSetupList, list -> {
|
||||||
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
|
|
||||||
dbSettingsModelIstance.setDefaultCausaleRettificaGiacenze(getValueFromList(list, "SETUP", "DEFAULT_CAUSALE_RETTIFICA_GIACENZE", String.class));
|
dbSettingsModelIstance.setDefaultCausaleRettificaGiacenze(getValueFromList(list, "SETUP", "DEFAULT_CAUSALE_RETTIFICA_GIACENZE", String.class));
|
||||||
dbSettingsModelIstance.setEnableCheckPartitaMagCheckPickingV(getValueFromList(list, "SETUP", "ENABLE_CHECK_PARTITA_MAG_PICKING_V", Boolean.class));
|
dbSettingsModelIstance.setEnableCheckPartitaMagCheckPickingV(getValueFromList(list, "SETUP", "ENABLE_CHECK_PARTITA_MAG_PICKING_V", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagMultiClienteOrdV(getValueFromList(list, "SETUP", "FLAG_MULTI_CLIENTE_ORD_VENDITA", Boolean.class));
|
dbSettingsModelIstance.setFlagMultiClienteOrdV(getValueFromList(list, "SETUP", "FLAG_MULTI_CLIENTE_ORD_VENDITA", Boolean.class));
|
||||||
@@ -327,23 +347,28 @@ public class SettingsManager {
|
|||||||
dbSettingsModelIstance.setFlagSpedizioneEnableManualPick(getValueFromList(list, "SPEDIZIONE", "ENABLE_MANUAL_PICK", Boolean.class));
|
dbSettingsModelIstance.setFlagSpedizioneEnableManualPick(getValueFromList(list, "SPEDIZIONE", "ENABLE_MANUAL_PICK", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagSpedizioneEnableFakeGiacenza(getValueFromList(list, "SPEDIZIONE", "ENABLE_FAKE_GIACENZA", Boolean.class));
|
dbSettingsModelIstance.setFlagSpedizioneEnableFakeGiacenza(getValueFromList(list, "SPEDIZIONE", "ENABLE_FAKE_GIACENZA", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagSpedizioneCanSelectMultipleOrders(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_SELECT_MULTIPLE_ORDERS", Boolean.class));
|
dbSettingsModelIstance.setFlagSpedizioneCanSelectMultipleOrders(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_SELECT_MULTIPLE_ORDERS", Boolean.class));
|
||||||
dbSettingsModelIstance.setReportNameSpedizionChiudiOrdine(getValueFromList(list, "SPEDIZIONE", "REPORT_PACKING_LIST", String.class));
|
|
||||||
dbSettingsModelIstance.setFlagSpedizioneUseQtaOrd(getValueFromList(list, "SPEDIZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
dbSettingsModelIstance.setFlagSpedizioneUseQtaOrd(getValueFromList(list, "SPEDIZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagOrdinaNuoviArticoliInGriglia(getValueFromList(list, "ORDINI_A", "ORDINA_NUOVI_ARTICOLI", Boolean.class));
|
dbSettingsModelIstance.setFlagOrdinaNuoviArticoliInGriglia(getValueFromList(list, "ORDINI_A", "ORDINA_NUOVI_ARTICOLI", Boolean.class));
|
||||||
dbSettingsModelIstance.setDocInterniCheckFornitore(getValueFromList(list, "DOC_INTERNI", "CHECK_FORNITORE", String.class));
|
dbSettingsModelIstance.setDocInterniCheckFornitore(getValueFromList(list, "DOC_INTERNI", "CHECK_FORNITORE", String.class));
|
||||||
dbSettingsModelIstance.setFlagAccettazioneUseQtaOrd(getValueFromList(list, "ACCETTAZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
dbSettingsModelIstance.setFlagAccettazioneUseQtaOrd(getValueFromList(list, "ACCETTAZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagPickLiberoAllowEmptyDest(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_DEST", Boolean.class));
|
dbSettingsModelIstance.setFlagPickLiberoAllowEmptyDest(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_DEST", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagOrdinaArticoliOnScan(getValueFromList(list, "ORDINI_A", "ORDINA_ARTICOLI_ON_SCAN", Boolean.class));
|
dbSettingsModelIstance.setFlagOrdinaArticoliOnScan(getValueFromList(list, "ORDINI_A", "ORDINA_ARTICOLI_ON_SCAN", Boolean.class));
|
||||||
|
dbSettingsModelIstance.setFlagPrintPackingListOnOrderClose(getValueFromList(list, "SPEDIZIONE", "FLAG_PRINT_PACKING_LIST_ON_CLOSE", Boolean.class));
|
||||||
|
dbSettingsModelIstance.setFlagPrintEtichetteOnOrderClose(getValueFromList(list, "SPEDIZIONE", "FLAG_PRINT_ETICHETTE_ON_CLOSE", Boolean.class));
|
||||||
|
dbSettingsModelIstance.setFlagAskInfoAggiuntiveSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_ASK_INFO_AGGIUNTIVE", Boolean.class));
|
||||||
|
dbSettingsModelIstance.setFilterFornitoreProd(getValueFromList(list, "PRODUZIONE", "FILTER_FORNTIORE_PROD", String.class));
|
||||||
|
|
||||||
String notePerdita = getValueFromList(list, "DOC_INTERNI", "NOTE_PERDITA", String.class);
|
String notePerdita = getValueFromList(list, "DOC_INTERNI", "NOTE_PERDITA", String.class);
|
||||||
if (notePerdita != null) {
|
if (notePerdita != null)
|
||||||
dbSettingsModelIstance.setNotePerditaDocInterni(Arrays.asList(notePerdita.split("\\|")));
|
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)
|
||||||
dbSettingsModelIstance.setOnNumCnfInputChanged(onNumCnfInputChanged);
|
dbSettingsModelIstance.setOnNumCnfInputChanged(onNumCnfInputChanged);
|
||||||
}
|
|
||||||
|
Integer onQtaTotInputChanged = getValueFromList(list, "SETUP", "ON_QTA_TOT_INPUT_CHANGED", Integer.class);
|
||||||
|
if (onQtaTotInputChanged != null)
|
||||||
|
dbSettingsModelIstance.setOnQtaTotInputChanged(onQtaTotInputChanged);
|
||||||
|
|
||||||
if (onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
@@ -355,7 +380,7 @@ public class SettingsManager {
|
|||||||
|
|
||||||
StbGestSetup value = Stream.of(stbGestSetupList)
|
StbGestSetup value = Stream.of(stbGestSetupList)
|
||||||
.filter(x -> x.getSection().equalsIgnoreCase(section) && x.getKeySection().equalsIgnoreCase(keySectionName))
|
.filter(x -> x.getSection().equalsIgnoreCase(section) && x.getKeySection().equalsIgnoreCase(keySectionName))
|
||||||
.findFirst().get();
|
.findFirstOrElse(new StbGestSetup());
|
||||||
|
|
||||||
if (clazz == String.class) {
|
if (clazz == String.class) {
|
||||||
return clazz.cast(value.getValue());
|
return clazz.cast(value.getValue());
|
||||||
|
|||||||
@@ -3,16 +3,15 @@ package it.integry.integrywmsnative.core.utility;
|
|||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.widget.Toast;
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.core.app.ActivityCompat;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.core.app.ActivityCompat;
|
|
||||||
import it.integry.integrywmsnative.SplashActivity;
|
import it.integry.integrywmsnative.SplashActivity;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
|
||||||
@@ -31,6 +30,11 @@ public class PermissionsHelper {
|
|||||||
if(Build.VERSION.SDK_INT >= 23) {
|
if(Build.VERSION.SDK_INT >= 23) {
|
||||||
//permissionsToAsk.add(Manifest.permission.REQUEST_INSTALL_PACKAGES);
|
//permissionsToAsk.add(Manifest.permission.REQUEST_INSTALL_PACKAGES);
|
||||||
}
|
}
|
||||||
|
if(Build.VERSION.SDK_INT >= 31) {
|
||||||
|
permissionsToAsk.add(Manifest.permission.BLUETOOTH_CONNECT);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] permissionArray = new String[permissionsToAsk.size()];
|
String[] permissionArray = new String[permissionsToAsk.size()];
|
||||||
permissionsToAsk.toArray(permissionArray);
|
permissionsToAsk.toArray(permissionArray);
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ public class UtilityBarcode {
|
|||||||
|
|
||||||
|
|
||||||
public static boolean isBarcodeOrdineV(BarcodeScanDTO barcodeScanDTO) {
|
public static boolean isBarcodeOrdineV(BarcodeScanDTO barcodeScanDTO) {
|
||||||
return (isEan13(barcodeScanDTO) || isEtichetta128(barcodeScanDTO)) && barcodeScanDTO.getStringValue().startsWith("3");
|
return (isEan13(barcodeScanDTO) || isEtichetta128(barcodeScanDTO)) && barcodeScanDTO.getStringValue().startsWith("3");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isEtichettaAnonima(BarcodeScanDTO barcodeScanDTO){
|
public static boolean isEtichettaAnonima(BarcodeScanDTO barcodeScanDTO) {
|
||||||
return barcodeScanDTO != null && barcodeScanDTO.getType() == BarcodeType.CODE128 && barcodeScanDTO.getStringValue().startsWith("U");
|
return barcodeScanDTO != null && barcodeScanDTO.getType() == BarcodeType.CODE128 && barcodeScanDTO.getStringValue().startsWith("U");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,10 +28,14 @@ public class UtilityBarcode {
|
|||||||
return fullYear.equalsIgnoreCase("" + currentYear);
|
return fullYear.equalsIgnoreCase("" + currentYear);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isEtichetta128(BarcodeScanDTO barcodeScanDTO){
|
public static boolean isEtichetta128(BarcodeScanDTO barcodeScanDTO) {
|
||||||
return barcodeScanDTO != null && (barcodeScanDTO.getType() == BarcodeType.CODE128 || barcodeScanDTO.getType() == BarcodeType.EAN128);
|
return barcodeScanDTO != null && (barcodeScanDTO.getType() == BarcodeType.CODE128 || barcodeScanDTO.getType() == BarcodeType.EAN128);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isEan128(BarcodeScanDTO barcodeScanDTO) {
|
||||||
|
return barcodeScanDTO != null && barcodeScanDTO.getType() == BarcodeType.EAN128;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isEtichettaPosizione(BarcodeScanDTO barcodeScanDTO) {
|
public static boolean isEtichettaPosizione(BarcodeScanDTO barcodeScanDTO) {
|
||||||
return isEtichettaPosizione(barcodeScanDTO, true);
|
return isEtichettaPosizione(barcodeScanDTO, true);
|
||||||
}
|
}
|
||||||
@@ -42,12 +46,12 @@ public class UtilityBarcode {
|
|||||||
String barcode = barcodeScanDTO.getStringValue();
|
String barcode = barcodeScanDTO.getStringValue();
|
||||||
boolean isPosizione = false;
|
boolean isPosizione = false;
|
||||||
|
|
||||||
if(SettingsManager.iDB().getAvailablePosizioni() != null) {
|
if (SettingsManager.iDB().getAvailablePosizioni() != null) {
|
||||||
Stream<MtbDepoPosizione> tmpStream = Stream.of(SettingsManager.iDB().getAvailablePosizioni())
|
Stream<MtbDepoPosizione> tmpStream = Stream.of(SettingsManager.iDB().getAvailablePosizioni())
|
||||||
.filter(x -> x.getPosizione().equalsIgnoreCase(barcode) && (!enableCheckCodMdep || currentCodMdep.equalsIgnoreCase(x.getCodMdep())));
|
.filter(x -> x.getPosizione().equalsIgnoreCase(barcode) && (!enableCheckCodMdep || currentCodMdep.equalsIgnoreCase(x.getCodMdep())));
|
||||||
|
|
||||||
if(tmpStream.count() > 0){
|
if (tmpStream.count() > 0) {
|
||||||
isPosizione = true;
|
isPosizione = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +63,6 @@ public class UtilityBarcode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static boolean isEanPeso(BarcodeScanDTO barcodeScanDTO) {
|
public static boolean isEanPeso(BarcodeScanDTO barcodeScanDTO) {
|
||||||
return (isEtichetta128(barcodeScanDTO) || isEan13(barcodeScanDTO)) && barcodeScanDTO.getStringValue().startsWith("2");
|
return (isEtichetta128(barcodeScanDTO) || isEan13(barcodeScanDTO)) && barcodeScanDTO.getStringValue().startsWith("2");
|
||||||
}
|
}
|
||||||
@@ -81,31 +84,31 @@ public class UtilityBarcode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Integer getNumColloFromULAnonima(String barcode) throws Exception {
|
||||||
public static Integer getNumColloFromULAnonima(String barcode) {
|
if (!UtilityString.isNullOrEmpty(barcode)) {
|
||||||
if(!UtilityString.isNullOrEmpty(barcode)) {
|
|
||||||
barcode = barcode.trim();
|
barcode = barcode.trim();
|
||||||
|
try {
|
||||||
return Integer.parseInt(barcode.substring(3));
|
return Integer.parseInt(barcode.substring(3, 10));
|
||||||
|
} catch (NumberFormatException nfex) {
|
||||||
|
throw new Exception("Impossibile leggere il numero collo dal barcode: " + barcode);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static Integer getAnnoColloFromULAnonima(String barcode) {
|
public static Integer getAnnoColloFromULAnonima(String barcode) {
|
||||||
if(barcode != null){
|
if (barcode != null) {
|
||||||
return Integer.parseInt(barcode.substring(1, 3));
|
return Integer.parseInt(barcode.substring(1, 3));
|
||||||
} else
|
} else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static String convertITF14toEAN13(String barcodeITF14) {
|
public static String convertITF14toEAN13(String barcodeITF14) {
|
||||||
String barcodeEAN13 = null;
|
String barcodeEAN13 = null;
|
||||||
|
|
||||||
if(barcodeITF14.length() == 14) {
|
if (barcodeITF14.length() == 14) {
|
||||||
barcodeEAN13 = barcodeITF14.substring(1, barcodeITF14.length() - 1).trim();
|
barcodeEAN13 = barcodeITF14.substring(1, barcodeITF14.length() - 1).trim();
|
||||||
barcodeEAN13 += getEAN13CheckDigit(barcodeEAN13);
|
barcodeEAN13 += getEAN13CheckDigit(barcodeEAN13);
|
||||||
}
|
}
|
||||||
@@ -116,7 +119,7 @@ public class UtilityBarcode {
|
|||||||
public static String convertITF14toNeutral(String barcodeITF14) {
|
public static String convertITF14toNeutral(String barcodeITF14) {
|
||||||
String barcodeNeutral = null;
|
String barcodeNeutral = null;
|
||||||
|
|
||||||
if(barcodeITF14.length() == 14) {
|
if (barcodeITF14.length() == 14) {
|
||||||
barcodeNeutral = barcodeITF14.substring(1, barcodeITF14.length() - 1);
|
barcodeNeutral = barcodeITF14.substring(1, barcodeITF14.length() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,10 +127,10 @@ public class UtilityBarcode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static String getEAN13CheckDigit(String ean) {
|
private static String getEAN13CheckDigit(String ean) {
|
||||||
|
|
||||||
if (ean.length() != 12) {
|
if (ean.length() != 12) {
|
||||||
UtilityLogger.errorMe(new Exception("Please provide an input string of 12 chars. Current lenght: "+ean.length()));
|
UtilityLogger.errorMe(new Exception("Please provide an input string of 12 chars. Current lenght: " + ean.length()));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
long tot = 0;
|
long tot = 0;
|
||||||
@@ -135,7 +138,7 @@ public class UtilityBarcode {
|
|||||||
for (int i = 0; i < 12; i++) {
|
for (int i = 0; i < 12; i++) {
|
||||||
tot = tot + (Long.parseLong(String.valueOf(ean.charAt(i))) * (i % 2 == 0 ? 1 : 3));
|
tot = tot + (Long.parseLong(String.valueOf(ean.charAt(i))) * (i % 2 == 0 ? 1 : 3));
|
||||||
}
|
}
|
||||||
return tot % 10 == 0 ? "0" : "" + ( 10 - ( tot % 10));
|
return tot % 10 == 0 ? "0" : "" + (10 - (tot % 10));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,14 +11,19 @@ import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
|||||||
import com.orhanobut.logger.Logger;
|
import com.orhanobut.logger.Logger;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.BuildConfig;
|
import it.integry.integrywmsnative.BuildConfig;
|
||||||
|
import it.integry.integrywmsnative.core.exception.InvalidConnectionException;
|
||||||
|
import it.integry.integrywmsnative.core.exception.InvalidLUException;
|
||||||
|
import it.integry.integrywmsnative.core.exception.InvalidLUGestioneException;
|
||||||
import it.integry.integrywmsnative.core.rest.CommonRESTException;
|
import it.integry.integrywmsnative.core.rest.CommonRESTException;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
public class UtilityExceptions {
|
public class UtilityExceptions {
|
||||||
|
|
||||||
private static final Class<? extends Exception>[] FIREBASE_IGNORED_EXCEPTIONS = new Class[] {
|
private static final Class<?>[] FIREBASE_IGNORED_EXCEPTIONS = new Class[] {
|
||||||
|
InvalidConnectionException.class,
|
||||||
|
InvalidLUGestioneException.class,
|
||||||
|
InvalidLUException.class
|
||||||
};
|
};
|
||||||
|
|
||||||
public static void defaultException(Context context, Exception ex, DialogProgressView progressDialog) {
|
public static void defaultException(Context context, Exception ex, DialogProgressView progressDialog) {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.core.utility;
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
@@ -13,10 +12,5 @@ public class UtilityProgress {
|
|||||||
return progress;
|
return progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DialogProgressView createDefaultProgressDialog(AppCompatActivity mContext, String title, String subtitle) {
|
|
||||||
DialogProgressView progress = DialogProgressView.newInstance(title, subtitle, true);
|
|
||||||
progress.show(mContext.getSupportFragmentManager(), "tag");
|
|
||||||
return progress;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.widget.AppCompatTextView;
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
@@ -76,10 +77,23 @@ public class MainAccettazioneFragment extends BaseFragment implements ISearchabl
|
|||||||
mAppBarTitle.setText(context.getText(R.string.accettazione_title_fragment).toString());
|
mAppBarTitle.setText(context.getText(R.string.accettazione_title_fragment).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
|
onLoadingEnded();
|
||||||
|
outState.putString("mToolbar", DataCache.addItem(mToolbar));
|
||||||
|
|
||||||
|
super.onSaveInstanceState(outState);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
|
|
||||||
|
if(savedInstanceState != null && savedInstanceState.containsKey("mToolbar"))
|
||||||
|
mToolbar = DataCache.retrieveItem(savedInstanceState.getString("mToolbar"));
|
||||||
|
|
||||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_main_accettazione, container, false);
|
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_main_accettazione, container, false);
|
||||||
|
|
||||||
MainApplication.appComponent
|
MainApplication.appComponent
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ import it.integry.integrywmsnative.core.model.MtbColt;
|
|||||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
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.model.VersamentoAutomaticoULResponseDTO;
|
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;
|
||||||
@@ -303,7 +302,8 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
filterLayoutView.show(getSupportFragmentManager(), "TAG");
|
if (!filterLayoutView.isAdded())
|
||||||
|
filterLayoutView.show(getSupportFragmentManager(), "TAG");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -688,13 +688,10 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -705,11 +702,10 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
public void createNewLU() {
|
public void createNewLU() {
|
||||||
this.mBindings.accettazioneOrdineInevasoFab.close(true);
|
this.mBindings.accettazioneOrdineInevasoFab.close(true);
|
||||||
|
this.onLoadingStarted();
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.createNewLU(null, null, false, () -> {
|
this.mViewModel.createNewLU(null, null, false, () -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -736,7 +732,6 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
Intent myIntent = ListaBancaliActivity.createIntent(this,
|
Intent myIntent = ListaBancaliActivity.createIntent(this,
|
||||||
Stream.of(mtbColts).map(x -> (MtbColt) x).toList(),
|
Stream.of(mtbColts).map(x -> (MtbColt) x).toList(),
|
||||||
input -> ((RecoverMtbColt) input).isFlagCanBeRecovered(),
|
input -> ((RecoverMtbColt) input).isFlagCanBeRecovered(),
|
||||||
PrinterRESTConsumer.Type.SECONDARIA,
|
|
||||||
ReportManager.getReportNameLUFromGestione(GestioneEnum.ACQUISTO));
|
ReportManager.getReportNameLUFromGestione(GestioneEnum.ACQUISTO));
|
||||||
this.startActivityForResult(myIntent, PICK_UL_REQUEST);
|
this.startActivityForResult(myIntent, PICK_UL_REQUEST);
|
||||||
}
|
}
|
||||||
@@ -756,7 +751,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
DialogSimpleMessageView.makeErrorDialog(
|
DialogSimpleMessageView.makeErrorDialog(
|
||||||
new SpannableString(ex.getMessage()),
|
new SpannableString(ex.getMessage()),
|
||||||
null,
|
null,
|
||||||
@@ -766,16 +761,6 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMtbColrEdit(MtbColr mtbColr) {
|
public void onMtbColrEdit(MtbColr mtbColr) {
|
||||||
this.mViewModel.dispatchRowEdit(mtbColr);
|
this.mViewModel.dispatchRowEdit(mtbColr);
|
||||||
@@ -808,7 +793,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
|
|
||||||
if (ex instanceof InvalidPesoKGException) {
|
if (ex instanceof InvalidPesoKGException) {
|
||||||
UtilityToast.showToast(ex.getMessage());
|
UtilityToast.showToast(ex.getMessage());
|
||||||
@@ -841,19 +826,20 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
.setCanLUBeClosed(true)
|
.setCanLUBeClosed(true)
|
||||||
.setCanOverflowOrderQuantity(canOverflowQuantity);
|
.setCanOverflowOrderQuantity(canOverflowQuantity);
|
||||||
|
|
||||||
mDialogInputQuantityV2View
|
if (!mDialogInputQuantityV2View.isVisible())
|
||||||
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
mDialogInputQuantityV2View
|
||||||
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setQtaCnf(resultDTO.getQtaCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
.setQtaTot(resultDTO.getQtaTot())
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
.setPartitaMag(resultDTO.getPartitaMag())
|
.setQtaTot(resultDTO.getQtaTot())
|
||||||
.setDataScad(resultDTO.getDataScad());
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
.setDataScad(resultDTO.getDataScad());
|
||||||
})
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
.setOnAbort(() -> this.mViewModel.resetMatchedRows())
|
})
|
||||||
.show(getSupportFragmentManager(), "tag");
|
.setOnAbort(() -> this.mViewModel.resetMatchedRows())
|
||||||
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -221,10 +221,16 @@ public class AccettazionePickingViewModel {
|
|||||||
if (!UtilityBarcode.isEtichettaAnonimaOfCurrentYear(barcodeScanDTO.getStringValue())) {
|
if (!UtilityBarcode.isEtichettaAnonimaOfCurrentYear(barcodeScanDTO.getStringValue())) {
|
||||||
this.sendError(new NotCurrentYearLUException());
|
this.sendError(new NotCurrentYearLUException());
|
||||||
} else {
|
} else {
|
||||||
|
int numCollo = -1;
|
||||||
|
|
||||||
this.createNewLU(
|
try {
|
||||||
UtilityBarcode.getNumColloFromULAnonima(barcodeScanDTO.getStringValue()),
|
numCollo = UtilityBarcode.getNumColloFromULAnonima(barcodeScanDTO.getStringValue());
|
||||||
CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE, true, onComplete);
|
this.createNewLU(
|
||||||
|
numCollo,
|
||||||
|
CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE, true, onComplete);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
this.sendError(ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.sendError(new AlreadyUsedAnonymousLabelException());
|
this.sendError(new AlreadyUsedAnonymousLabelException());
|
||||||
@@ -837,7 +843,6 @@ public class AccettazionePickingViewModel {
|
|||||||
cloneMtbColt.setGestione(cloneMtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE ? GestioneEnum.PRODUZIONE : cloneMtbColt.getGestioneEnum());
|
cloneMtbColt.setGestione(cloneMtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE ? GestioneEnum.PRODUZIONE : cloneMtbColt.getGestioneEnum());
|
||||||
|
|
||||||
this.mPrinterRESTConsumer.printCollo(
|
this.mPrinterRESTConsumer.printCollo(
|
||||||
PrinterRESTConsumer.Type.SECONDARIA,
|
|
||||||
cloneMtbColt,
|
cloneMtbColt,
|
||||||
() -> {
|
() -> {
|
||||||
this.sendLUSuccessfullyPrinted();
|
this.sendLUSuccessfullyPrinted();
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ import it.integry.integrywmsnative.core.utility.UtilityDate;
|
|||||||
import it.integry.integrywmsnative.databinding.FragmentDocInterniBinding;
|
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.DialogSelectDocInfoView;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoViewModel;
|
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.dto.DocInterniSetupDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiDTO;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormActivity;
|
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.DocInterniListAdapter;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.ui.DocInterniListModel;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.ui.DocInterniListModel;
|
||||||
@@ -81,8 +81,8 @@ public class DocInterniFragment extends BaseFragment implements ITitledFragment,
|
|||||||
mBinding.setLifecycleOwner(this);
|
mBinding.setLifecycleOwner(this);
|
||||||
mBinding.setView(this);
|
mBinding.setView(this);
|
||||||
mBinding.setViewModel(mViewModel);
|
mBinding.setViewModel(mViewModel);
|
||||||
mViewModel.mtbGrup.observe(getViewLifecycleOwner(),mtbGrup-> mViewModel.fetchProducts());
|
mViewModel.mtbGrup.observe(getViewLifecycleOwner(), mtbGrup -> mViewModel.fetchProducts());
|
||||||
mViewModel.dtbTipi.observe(getViewLifecycleOwner(),dtbTipi-> mViewModel.fetchDocuments());
|
mViewModel.dtbTipi.observe(getViewLifecycleOwner(), dtbTipi -> mViewModel.fetchDocuments());
|
||||||
this.initRecyclerView();
|
this.initRecyclerView();
|
||||||
|
|
||||||
return mBinding.getRoot();
|
return mBinding.getRoot();
|
||||||
@@ -91,9 +91,9 @@ public class DocInterniFragment extends BaseFragment implements ITitledFragment,
|
|||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
if (!this.mViewModel.hasDocDetails()){
|
if (!this.mViewModel.hasDocDetails()) {
|
||||||
mViewModel.init();
|
mViewModel.init();
|
||||||
}else{
|
} else {
|
||||||
this.mViewModel.fetchDocuments();
|
this.mViewModel.fetchDocuments();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -115,30 +115,30 @@ public class DocInterniFragment extends BaseFragment implements ITitledFragment,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDocDetailsChanged(DialogSelectDocInfoViewModel selection) {
|
public void onDocDetailsChanged(DialogSelectDocInfoViewModel selection) {
|
||||||
if(selection.isInputValid()){
|
if (selection.isInputValid()) {
|
||||||
mViewModel.setSelectedDocDetails(selection);
|
mViewModel.setSelectedDocDetails(selection);
|
||||||
mBinding.mainFab.setVisibility(View.VISIBLE);
|
mBinding.mainFab.setVisibility(View.VISIBLE);
|
||||||
}else{
|
} else {
|
||||||
mBinding.mainFab.setVisibility(View.GONE);
|
mBinding.mainFab.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selection.requiresFornitore()){
|
if (selection.requiresFornitore()) {
|
||||||
mBinding.codAnagContainer.setVisibility(View.VISIBLE);
|
mBinding.codAnagContainer.setVisibility(View.VISIBLE);
|
||||||
}else{
|
} else {
|
||||||
mBinding.codAnagContainer.setVisibility(View.GONE);
|
mBinding.codAnagContainer.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (selection.getSelectedGruppoArt() != null){
|
if (selection.getSelectedGruppoArt() != null) {
|
||||||
mBinding.mtbGrpContainer.setVisibility(View.VISIBLE);
|
mBinding.mtbGrpContainer.setVisibility(View.VISIBLE);
|
||||||
}else{
|
} else {
|
||||||
mBinding.mtbGrpContainer.setVisibility(View.GONE);
|
mBinding.mtbGrpContainer.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selection.requiresDocData()){
|
if (selection.requiresDocData()) {
|
||||||
mBinding.docContainer.setVisibility(View.VISIBLE);
|
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))));
|
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{
|
} else {
|
||||||
mBinding.docContainer.setVisibility(View.GONE);
|
mBinding.docContainer.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ public class DocInterniFragment extends BaseFragment implements ITitledFragment,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void selectDocInfo() {
|
public void selectDocInfo() {
|
||||||
if (this.dialogInitialized){
|
if (this.dialogInitialized) {
|
||||||
DialogSelectDocInfoView.newInstance(
|
DialogSelectDocInfoView.newInstance(
|
||||||
mDocInterniSetupDTO,
|
mDocInterniSetupDTO,
|
||||||
this.mViewModel.dtbTipi.getValue(),
|
this.mViewModel.dtbTipi.getValue(),
|
||||||
@@ -201,6 +201,6 @@ public class DocInterniFragment extends BaseFragment implements ITitledFragment,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDocumentEditRequest(SqlMtbColt document, GrigliaAcquistiDTO arts) {
|
public void onDocumentEditRequest(SqlMtbColt document, GrigliaAcquistiDTO arts) {
|
||||||
requireActivity().startActivity(DocInterniEditFormActivity.newInstance(requireActivity(),document,arts));
|
requireActivity().startActivity(DocInterniEditFormActivity.newInstance(requireActivity(), document, arts, mViewModel.getTipoDoc()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package it.integry.integrywmsnative.gest.contab_doc_interni;
|
|||||||
|
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -17,10 +15,10 @@ import it.integry.integrywmsnative.core.di.BindableInteger;
|
|||||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
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.dialog.DialogSelectDocInfoViewModel;
|
||||||
|
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.FornitoreDTO;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiDTO;
|
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.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.dto.TipiDocDTO;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||||
|
|
||||||
@@ -91,7 +89,7 @@ public class DocInterniViewModel {
|
|||||||
this.numDoc.postValue(selection.getNumDoc());
|
this.numDoc.postValue(selection.getNumDoc());
|
||||||
this.note.postValue(selection.getNote());
|
this.note.postValue(selection.getNote());
|
||||||
|
|
||||||
if (selection.getSelectedTipoDoc() != null ) {
|
if (selection.getSelectedTipoDoc() != null) {
|
||||||
this.dtbTipi.postValue(selection.getSelectedTipoDoc());
|
this.dtbTipi.postValue(selection.getSelectedTipoDoc());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -114,11 +112,11 @@ public class DocInterniViewModel {
|
|||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
String codAnag = null, codVdes = null;
|
String codAnag = null, codVdes = null;
|
||||||
FornitoreDTO fornitore = this.fornitore.getValue();
|
FornitoreDTO fornitore = this.fornitore.getValue();
|
||||||
if (fornitore != null){
|
if (fornitore != null) {
|
||||||
codAnag = fornitore.getCodAnag();
|
codAnag = fornitore.getCodAnag();
|
||||||
codVdes = fornitore.getCodVdes();
|
codVdes = fornitore.getCodVdes();
|
||||||
}
|
}
|
||||||
documentRepository.getLocalDocumentsByCodDtip(this.getCodDtip(), codAnag, codVdes, dataDoc.getValue(),numDoc.getValue(), list -> {
|
documentRepository.getLocalDocumentsByCodDtip(this.getCodDtip(), codAnag, codVdes, dataDoc.getValue(), numDoc.getValue(), list -> {
|
||||||
documentRepository.getNextNumCollo(nextNumCollo -> {
|
documentRepository.getNextNumCollo(nextNumCollo -> {
|
||||||
this.mDocsList.postValue(list);
|
this.mDocsList.postValue(list);
|
||||||
this.setNextNumCollo(nextNumCollo);
|
this.setNextNumCollo(nextNumCollo);
|
||||||
@@ -141,6 +139,13 @@ public class DocInterniViewModel {
|
|||||||
return this.dtbTipi.getValue().getCodDtip();
|
return this.dtbTipi.getValue().getCodDtip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TipiDocDTO getTipoDoc() {
|
||||||
|
if (this.dtbTipi.getValue() == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return this.dtbTipi.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
private String getCodMgrp() {
|
private String getCodMgrp() {
|
||||||
if (this.mtbGrup.getValue() == null) {
|
if (this.mtbGrup.getValue() == null) {
|
||||||
return null;
|
return null;
|
||||||
@@ -168,10 +173,10 @@ public class DocInterniViewModel {
|
|||||||
document.setNumCollo(this.nextNumCollo);
|
document.setNumCollo(this.nextNumCollo);
|
||||||
document.setGestione("L");
|
document.setGestione("L");
|
||||||
document.setDataDoc(this.dataDoc.getValue());
|
document.setDataDoc(this.dataDoc.getValue());
|
||||||
if (this.numDoc.getValue() != null){
|
if (this.numDoc.getValue() != null) {
|
||||||
document.setNumDoc(Integer.parseInt(this.numDoc.getValue()));
|
document.setNumDoc(Integer.parseInt(this.numDoc.getValue()));
|
||||||
}
|
}
|
||||||
if (this.fornitore.getValue() != null){
|
if (this.fornitore.getValue() != null) {
|
||||||
document.setCodAnag(this.fornitore.getValue().getCodAnag());
|
document.setCodAnag(this.fornitore.getValue().getCodAnag());
|
||||||
document.setCodVdes(this.fornitore.getValue().getCodVdes());
|
document.setCodVdes(this.fornitore.getValue().getCodVdes());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,13 @@ public class DialogSelectDocInfoViewModel {
|
|||||||
|
|
||||||
public void init(DocInterniSetupDTO initialList) {
|
public void init(DocInterniSetupDTO initialList) {
|
||||||
this.mDocInterniSetupDTO = initialList;
|
this.mDocInterniSetupDTO = initialList;
|
||||||
|
this.mTipoDoc = null;
|
||||||
|
this.mGruppoArt = null;
|
||||||
|
this.mFornitore = null;
|
||||||
|
this.mDataDoc = null;
|
||||||
|
this.mNumDoc = null;
|
||||||
|
this.mNote = null;
|
||||||
|
this.mListener = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCodDtip() {
|
public String getCodDtip() {
|
||||||
@@ -112,7 +119,7 @@ public class DialogSelectDocInfoViewModel {
|
|||||||
selectedDocType.getGestione().equalsIgnoreCase("V") ? "V" : "A"
|
selectedDocType.getGestione().equalsIgnoreCase("V") ? "V" : "A"
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return forn.getTipoAnag().equalsIgnoreCase("F") ;
|
return forn.getTipoAnag().equalsIgnoreCase("F");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.map(FornitoreDTO::getLabel).toList();
|
.map(FornitoreDTO::getLabel).toList();
|
||||||
@@ -148,8 +155,7 @@ public class DialogSelectDocInfoViewModel {
|
|||||||
public boolean requiresNote() {
|
public boolean requiresNote() {
|
||||||
return this.getSelectedTipoDoc() != null &&
|
return this.getSelectedTipoDoc() != null &&
|
||||||
this.getSelectedTipoDoc().getGestioneDoc().equals("P") &&
|
this.getSelectedTipoDoc().getGestioneDoc().equals("P") &&
|
||||||
this.getSelectedTipoDoc().getGestione().equals("L")
|
this.getSelectedTipoDoc().getGestione().equals("L");
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInputValid() {
|
public boolean isInputValid() {
|
||||||
@@ -161,12 +167,12 @@ public class DialogSelectDocInfoViewModel {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.requiresDocData() && (this.getDataDoc() == null || this.getNumDoc() == null)){
|
if (this.requiresDocData() && (this.getDataDoc() == null || this.getNumDoc() == null)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (this.requiresNote() && (this.getNote() == null || this.getNote().length() <= 0) ){
|
if (this.requiresNote() && (this.getNote() == null || this.getNote().length() <= 0)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,7 +180,7 @@ public class DialogSelectDocInfoViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean requiresDocData() {
|
public boolean requiresDocData() {
|
||||||
TipiDocDTO doc = this.getSelectedTipoDoc();
|
TipiDocDTO doc = this.getSelectedTipoDoc();
|
||||||
return doc != null && doc.getGestioneDoc().equalsIgnoreCase("P") && !doc.getGestione().equalsIgnoreCase("L");
|
return doc != null && doc.getGestioneDoc().equalsIgnoreCase("P") && !doc.getGestione().equalsIgnoreCase("L");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ public class GrigliaAcquistiChildDTO {
|
|||||||
private float giacenza;
|
private float giacenza;
|
||||||
private float qtaPrevistaVendita;
|
private float qtaPrevistaVendita;
|
||||||
private float qtaProposta;
|
private float qtaProposta;
|
||||||
|
private BigDecimal qtaOrd;
|
||||||
|
|
||||||
|
|
||||||
public String getCodMart() {
|
public String getCodMart() {
|
||||||
return codMart;
|
return codMart;
|
||||||
@@ -154,4 +156,13 @@ public class GrigliaAcquistiChildDTO {
|
|||||||
this.newNoPromo = newNoPromo;
|
this.newNoPromo = newNoPromo;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaOrd() {
|
||||||
|
return qtaOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrigliaAcquistiChildDTO setQtaOrd(BigDecimal qtaOrd) {
|
||||||
|
this.qtaOrd = qtaOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ public class TipiDocDTO {
|
|||||||
private String descrizione;
|
private String descrizione;
|
||||||
private String gestione;
|
private String gestione;
|
||||||
private String gestioneDoc;
|
private String gestioneDoc;
|
||||||
|
private boolean requireNote = false;
|
||||||
|
|
||||||
public String getCodDtip() {
|
public String getCodDtip() {
|
||||||
return codDtip;
|
return codDtip;
|
||||||
@@ -38,7 +39,17 @@ public class TipiDocDTO {
|
|||||||
public void setGestioneDoc(String gestioneDoc) {
|
public void setGestioneDoc(String gestioneDoc) {
|
||||||
this.gestioneDoc = gestioneDoc;
|
this.gestioneDoc = gestioneDoc;
|
||||||
}
|
}
|
||||||
public String getLabel(){
|
|
||||||
return this.codDtip +" - "+this.descrizione;
|
public String getLabel() {
|
||||||
|
return this.codDtip + " - " + this.descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isRequireNote() {
|
||||||
|
return requireNote;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TipiDocDTO setRequireNote(boolean requireNote) {
|
||||||
|
this.requireNote = requireNote;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import it.integry.integrywmsnative.core.utility.UtilityDate;
|
|||||||
import it.integry.integrywmsnative.databinding.ActivityContabDocInterniEditBinding;
|
import it.integry.integrywmsnative.databinding.ActivityContabDocInterniEditBinding;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiChildDTO;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiChildDTO;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiDTO;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipiDocDTO;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsView;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsView;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.ui.DocumentRowsListAdapter;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.ui.DocumentRowsListAdapter;
|
||||||
import it.integry.integrywmsnative.ui.FabMenuCustomAnimations;
|
import it.integry.integrywmsnative.ui.FabMenuCustomAnimations;
|
||||||
@@ -52,6 +53,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
|
|
||||||
private static final String DATA_KEY_DOCUMENT = "document";
|
private static final String DATA_KEY_DOCUMENT = "document";
|
||||||
private static final String DATA_KEY_PRODUCTS_LIST = "productsList";
|
private static final String DATA_KEY_PRODUCTS_LIST = "productsList";
|
||||||
|
private static final String DATA_KEY_TIPO_DOC = "docType";
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
MtbColrRepository documentRowsRepository;
|
MtbColrRepository documentRowsRepository;
|
||||||
@@ -75,13 +77,15 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
public BindableBoolean isDocumentExportable = new BindableBoolean(false);
|
public BindableBoolean isDocumentExportable = new BindableBoolean(false);
|
||||||
private final ObservableArrayList<SqlMtbColr> documentRowsObservableList = new ObservableArrayList<>();
|
private final ObservableArrayList<SqlMtbColr> documentRowsObservableList = new ObservableArrayList<>();
|
||||||
|
|
||||||
public static Intent newInstance(Context context, SqlMtbColt document, GrigliaAcquistiDTO productList) {
|
public static Intent newInstance(Context context, SqlMtbColt document, GrigliaAcquistiDTO productList, TipiDocDTO tipoDoc) {
|
||||||
Intent myIntent = new Intent(context, DocInterniEditFormActivity.class);
|
Intent myIntent = new Intent(context, DocInterniEditFormActivity.class);
|
||||||
|
|
||||||
String doc = DataCache.addItem(document);
|
String doc = DataCache.addItem(document);
|
||||||
String productsKey = DataCache.addItem(productList);
|
String productsKey = DataCache.addItem(productList);
|
||||||
|
String docType = DataCache.addItem(tipoDoc);
|
||||||
myIntent.putExtra(DATA_KEY_DOCUMENT, doc);
|
myIntent.putExtra(DATA_KEY_DOCUMENT, doc);
|
||||||
myIntent.putExtra(DATA_KEY_PRODUCTS_LIST, productsKey);
|
myIntent.putExtra(DATA_KEY_PRODUCTS_LIST, productsKey);
|
||||||
|
myIntent.putExtra(DATA_KEY_TIPO_DOC, docType);
|
||||||
return myIntent;
|
return myIntent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +100,14 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
SqlMtbColt document = DataCache.retrieveItem(getIntent().getStringExtra(DATA_KEY_DOCUMENT));
|
SqlMtbColt document = DataCache.retrieveItem(getIntent().getStringExtra(DATA_KEY_DOCUMENT));
|
||||||
GrigliaAcquistiDTO griglia = DataCache.retrieveItem(getIntent().getStringExtra(DATA_KEY_PRODUCTS_LIST));
|
GrigliaAcquistiDTO griglia = DataCache.retrieveItem(getIntent().getStringExtra(DATA_KEY_PRODUCTS_LIST));
|
||||||
List<GrigliaAcquistiChildDTO> productList = griglia.getGrigliaAcquistiChild();
|
List<GrigliaAcquistiChildDTO> productList = griglia.getGrigliaAcquistiChild();
|
||||||
this.initViewModel(document, productList);
|
TipiDocDTO docType = DataCache.retrieveItem(getIntent().getStringExtra(DATA_KEY_TIPO_DOC));
|
||||||
|
|
||||||
|
this.initViewModel();
|
||||||
|
this.viewModel.setDocument(document);
|
||||||
|
this.viewModel.setProductsList(productList);
|
||||||
|
this.viewModel.setTipoDoc(docType);
|
||||||
|
|
||||||
|
|
||||||
this.initView();
|
this.initView();
|
||||||
this.initBindables();
|
this.initBindables();
|
||||||
this.initRecyclerView();
|
this.initRecyclerView();
|
||||||
@@ -137,12 +148,9 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
binding.bottomSheetMtbColrEdit.init(binding.bottomSheetMtbColrEdit, binding.bottomSheetMtbColrEditBackground);
|
binding.bottomSheetMtbColrEdit.init(binding.bottomSheetMtbColrEdit, binding.bottomSheetMtbColrEditBackground);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initViewModel(SqlMtbColt document, List<GrigliaAcquistiChildDTO> productList) {
|
private void initViewModel() {
|
||||||
this.viewModel.init();
|
this.viewModel.init();
|
||||||
this.viewModel.setListeners(this);
|
this.viewModel.setListeners(this);
|
||||||
this.viewModel.setDocument(document);
|
|
||||||
this.viewModel.setProductsList(productList);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initRecyclerView() {
|
private void initRecyclerView() {
|
||||||
@@ -239,8 +247,10 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
.setCanOverflowOrderQuantity(false)
|
.setCanOverflowOrderQuantity(false)
|
||||||
.setCanLUBeClosed(false)
|
.setCanLUBeClosed(false)
|
||||||
.setNotesAllowed(true)
|
.setNotesAllowed(true)
|
||||||
|
.setNotesMandatory(this.viewModel.isNotesMandatory())
|
||||||
.setDataScadMandatory(flagTracciabilita)
|
.setDataScadMandatory(flagTracciabilita)
|
||||||
.setCanPartitaMagBeChanged(flagTracciabilita)
|
.setCanPartitaMagBeChanged(flagTracciabilita)
|
||||||
|
.setNumCnfEditable(false)
|
||||||
.setSuggestPartitaMag(data -> {
|
.setSuggestPartitaMag(data -> {
|
||||||
Date dataScad = data.getDataScad();
|
Date dataScad = data.getDataScad();
|
||||||
String partitaMag = null;
|
String partitaMag = null;
|
||||||
@@ -249,13 +259,15 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
|||||||
}
|
}
|
||||||
return partitaMag;
|
return partitaMag;
|
||||||
});
|
});
|
||||||
dialogInputQuantityV2View.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
|
||||||
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
if (!dialogInputQuantityV2View.isAdded())
|
||||||
this.onLoadingStarted();
|
dialogInputQuantityV2View.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
this.viewModel.saveRow(row, resultDTO);
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
})
|
this.onLoadingStarted();
|
||||||
.setOnAbort(this::onLoadingEnded)
|
this.viewModel.saveRow(row, resultDTO);
|
||||||
.show(getSupportFragmentManager(), "tag");
|
})
|
||||||
|
.setOnAbort(this::onLoadingEnded)
|
||||||
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import it.integry.integrywmsnative.gest.contab_doc_interni.dto.ArtDTO;
|
|||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.ColloDTO;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.ColloDTO;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiChildDTO;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.GrigliaAcquistiChildDTO;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipiDocDTO;
|
||||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2ResultDTO;
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2ResultDTO;
|
||||||
|
|
||||||
@@ -38,6 +39,7 @@ public class DocInterniEditFormViewModel {
|
|||||||
private final DocInterniRESTConsumer docInterniRESTConsumer;
|
private final DocInterniRESTConsumer docInterniRESTConsumer;
|
||||||
private DocInterniEditFormViewModel.Listener listener;
|
private DocInterniEditFormViewModel.Listener listener;
|
||||||
private List<GrigliaAcquistiChildDTO> productsList;
|
private List<GrigliaAcquistiChildDTO> productsList;
|
||||||
|
private TipiDocDTO tipoDoc;
|
||||||
private boolean isCheckPartitaMag = false;
|
private boolean isCheckPartitaMag = false;
|
||||||
private JSONObject checkFornitoreRules = null;
|
private JSONObject checkFornitoreRules = null;
|
||||||
public MutableLiveData<SqlMtbColt> document = new MutableLiveData<>();
|
public MutableLiveData<SqlMtbColt> document = new MutableLiveData<>();
|
||||||
@@ -299,6 +301,15 @@ public class DocInterniEditFormViewModel {
|
|||||||
return Stream.of(productsList).filter(prod -> prod.codMart.equalsIgnoreCase(codMart)).findFirstOrElse(null);
|
return Stream.of(productsList).filter(prod -> prod.codMart.equalsIgnoreCase(codMart)).findFirstOrElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DocInterniEditFormViewModel setTipoDoc(TipiDocDTO docType) {
|
||||||
|
this.tipoDoc = docType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isNotesMandatory() {
|
||||||
|
return this.tipoDoc != null && this.tipoDoc.isRequireNote();
|
||||||
|
}
|
||||||
|
|
||||||
public interface Listener extends ILoadingListener {
|
public interface Listener extends ILoadingListener {
|
||||||
|
|
||||||
void onError(Exception ex);
|
void onError(Exception ex);
|
||||||
|
|||||||
@@ -45,16 +45,14 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
|||||||
public ObservableField<Boolean> recoverFabMenuVisible = new ObservableField<>(false);
|
public ObservableField<Boolean> recoverFabMenuVisible = new ObservableField<>(false);
|
||||||
|
|
||||||
private String mReportName;
|
private String mReportName;
|
||||||
private PrinterRESTConsumer.Type mPrinterType;
|
|
||||||
|
|
||||||
private static class Key {
|
private static class Key {
|
||||||
private static final String MtbColtKey = "mtbColtKey";
|
private static final String MtbColtKey = "mtbColtKey";
|
||||||
private static final String CanRecoverUL = "canRecoverUL";
|
private static final String CanRecoverUL = "canRecoverUL";
|
||||||
private static final String PrinterType = "printerType";
|
|
||||||
private static final String ReportName = "reportName";
|
private static final String ReportName = "reportName";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Intent createIntent(Context context, MtbColt item, boolean canRecoverUl, PrinterRESTConsumer.Type printerType, String reportName) {
|
public static Intent createIntent(Context context, MtbColt item, boolean canRecoverUl, String reportName) {
|
||||||
Intent myIntent = new Intent(context, ContenutoBancaleActivity.class);
|
Intent myIntent = new Intent(context, ContenutoBancaleActivity.class);
|
||||||
|
|
||||||
String keyMtbColt = DataCache.addItem(item);
|
String keyMtbColt = DataCache.addItem(item);
|
||||||
@@ -63,9 +61,6 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
|||||||
String keyCanRecoverUL = DataCache.addItem(canRecoverUl);
|
String keyCanRecoverUL = DataCache.addItem(canRecoverUl);
|
||||||
myIntent.putExtra(Key.CanRecoverUL, keyCanRecoverUL);
|
myIntent.putExtra(Key.CanRecoverUL, keyCanRecoverUL);
|
||||||
|
|
||||||
String keyPrinterType = DataCache.addItem(printerType);
|
|
||||||
myIntent.putExtra(Key.PrinterType, keyPrinterType);
|
|
||||||
|
|
||||||
String keyReportName = DataCache.addItem(reportName);
|
String keyReportName = DataCache.addItem(reportName);
|
||||||
myIntent.putExtra(Key.ReportName, keyReportName);
|
myIntent.putExtra(Key.ReportName, keyReportName);
|
||||||
|
|
||||||
@@ -79,7 +74,6 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
|||||||
boolean canRecoverUL = DataCache.retrieveItem(getIntent().getStringExtra(Key.CanRecoverUL));
|
boolean canRecoverUL = DataCache.retrieveItem(getIntent().getStringExtra(Key.CanRecoverUL));
|
||||||
mtbColt.set(DataCache.retrieveItem(getIntent().getStringExtra(Key.MtbColtKey)));
|
mtbColt.set(DataCache.retrieveItem(getIntent().getStringExtra(Key.MtbColtKey)));
|
||||||
mReportName = DataCache.retrieveItem(getIntent().getStringExtra(Key.ReportName));
|
mReportName = DataCache.retrieveItem(getIntent().getStringExtra(Key.ReportName));
|
||||||
mPrinterType = DataCache.retrieveItem(getIntent().getStringExtra(Key.PrinterType));
|
|
||||||
|
|
||||||
bindings = DataBindingUtil.setContentView(this, R.layout.activity_contenuto_bancale);
|
bindings = DataBindingUtil.setContentView(this, R.layout.activity_contenuto_bancale);
|
||||||
|
|
||||||
@@ -97,7 +91,7 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
|||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
mViewModel.setListener(this);
|
mViewModel.setListener(this);
|
||||||
mViewModel.init(mtbColt.get(), mPrinterType, mReportName);
|
mViewModel.init(mtbColt.get(), mReportName);
|
||||||
|
|
||||||
recoverFabMenuVisible.set(canRecoverUL);
|
recoverFabMenuVisible.set(canRecoverUL);
|
||||||
|
|
||||||
@@ -143,7 +137,7 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
|||||||
this.bindings.contenutoBancaleFab.close(true);
|
this.bindings.contenutoBancaleFab.close(true);
|
||||||
this.onLoadingStarted();
|
this.onLoadingStarted();
|
||||||
try {
|
try {
|
||||||
this.mPrinterRESTConsumer.printCollo(mPrinterType, mtbColt.get(),
|
this.mPrinterRESTConsumer.printCollo(mtbColt.get(),
|
||||||
() -> {
|
() -> {
|
||||||
this.onLoadingEnded();
|
this.onLoadingEnded();
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import javax.inject.Inject;
|
|||||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
|
||||||
|
|
||||||
public class ContenutoBancaleViewModel {
|
public class ContenutoBancaleViewModel {
|
||||||
|
|
||||||
@@ -19,7 +18,7 @@ public class ContenutoBancaleViewModel {
|
|||||||
this.mDepositoRESTConsumer = depositoRESTConsumer;
|
this.mDepositoRESTConsumer = depositoRESTConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init(MtbColt mtbColt, PrinterRESTConsumer.Type printerType, String defaultReportName) {
|
public void init(MtbColt mtbColt, String defaultReportName) {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import it.integry.integrywmsnative.core.data_cache.DataCache;
|
|||||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgsWithReturn;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgsWithReturn;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.databinding.ActivityListaBancaliBinding;
|
import it.integry.integrywmsnative.databinding.ActivityListaBancaliBinding;
|
||||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleActivity;
|
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleActivity;
|
||||||
import it.integry.integrywmsnative.gest.lista_bancali.ui.ListaColliMainListAdapter;
|
import it.integry.integrywmsnative.gest.lista_bancali.ui.ListaColliMainListAdapter;
|
||||||
@@ -30,7 +29,6 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
|||||||
private static class Key {
|
private static class Key {
|
||||||
private static final String MtbColtsKey = "mtbColtsKey";
|
private static final String MtbColtsKey = "mtbColtsKey";
|
||||||
private static final String CanRecoverUL = "canRecoverUL";
|
private static final String CanRecoverUL = "canRecoverUL";
|
||||||
private static final String PrinterType = "printerType";
|
|
||||||
private static final String ReportName = "reportName";
|
private static final String ReportName = "reportName";
|
||||||
private static final String FlagOnlyResiduo = "flagOnlyResiduo";
|
private static final String FlagOnlyResiduo = "flagOnlyResiduo";
|
||||||
}
|
}
|
||||||
@@ -43,7 +41,6 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
|||||||
private final ObservableArrayList<MtbColt> mtbColts = new ObservableArrayList<>();
|
private final ObservableArrayList<MtbColt> mtbColts = new ObservableArrayList<>();
|
||||||
|
|
||||||
private RunnableArgsWithReturn<MtbColt, Boolean> mCanRecoverUl;
|
private RunnableArgsWithReturn<MtbColt, Boolean> mCanRecoverUl;
|
||||||
private PrinterRESTConsumer.Type mPrinterType;
|
|
||||||
private String mReportName;
|
private String mReportName;
|
||||||
private boolean mFlagOnlyResiduo;
|
private boolean mFlagOnlyResiduo;
|
||||||
|
|
||||||
@@ -51,19 +48,19 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, PrinterRESTConsumer.Type printerType, String reportName) {
|
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, String reportName) {
|
||||||
return createIntent(context, items, canRecoverUlAction, printerType, true, reportName);
|
return createIntent(context, items, canRecoverUlAction, true, reportName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Intent createIntent(Context context, List<MtbColt> items, boolean canRecoverUl, PrinterRESTConsumer.Type printerType, boolean onlyResiduo) {
|
public static Intent createIntent(Context context, List<MtbColt> items, boolean canRecoverUl, boolean onlyResiduo) {
|
||||||
return createIntent(context, items, input -> canRecoverUl, printerType, onlyResiduo);
|
return createIntent(context, items, input -> canRecoverUl, onlyResiduo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, PrinterRESTConsumer.Type printerType, boolean onlyResiduo) {
|
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, boolean onlyResiduo) {
|
||||||
return createIntent(context, items, canRecoverUlAction, printerType, onlyResiduo, null);
|
return createIntent(context, items, canRecoverUlAction, onlyResiduo, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, PrinterRESTConsumer.Type printerType, boolean onlyResiduo, String reportName) {
|
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, boolean onlyResiduo, String reportName) {
|
||||||
Intent myIntent = new Intent(context, ListaBancaliActivity.class);
|
Intent myIntent = new Intent(context, ListaBancaliActivity.class);
|
||||||
|
|
||||||
String mtbColtsKey = DataCache.addItem(items);
|
String mtbColtsKey = DataCache.addItem(items);
|
||||||
@@ -72,9 +69,6 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
|||||||
String canRecoverULKey = DataCache.addItem(canRecoverUlAction);
|
String canRecoverULKey = DataCache.addItem(canRecoverUlAction);
|
||||||
myIntent.putExtra(Key.CanRecoverUL, canRecoverULKey);
|
myIntent.putExtra(Key.CanRecoverUL, canRecoverULKey);
|
||||||
|
|
||||||
String printerTypeKey = DataCache.addItem(printerType);
|
|
||||||
myIntent.putExtra(Key.PrinterType, printerTypeKey);
|
|
||||||
|
|
||||||
String flagOnlyResiduoKey = DataCache.addItem(onlyResiduo);
|
String flagOnlyResiduoKey = DataCache.addItem(onlyResiduo);
|
||||||
myIntent.putExtra(Key.FlagOnlyResiduo, flagOnlyResiduoKey);
|
myIntent.putExtra(Key.FlagOnlyResiduo, flagOnlyResiduoKey);
|
||||||
|
|
||||||
@@ -97,7 +91,6 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
|||||||
|
|
||||||
|
|
||||||
mCanRecoverUl = DataCache.retrieveItem(getIntent().getStringExtra(Key.CanRecoverUL));
|
mCanRecoverUl = DataCache.retrieveItem(getIntent().getStringExtra(Key.CanRecoverUL));
|
||||||
mPrinterType = DataCache.retrieveItem(getIntent().getStringExtra(Key.PrinterType));
|
|
||||||
mReportName = DataCache.retrieveItem(getIntent().getStringExtra(Key.ReportName));
|
mReportName = DataCache.retrieveItem(getIntent().getStringExtra(Key.ReportName));
|
||||||
mFlagOnlyResiduo = DataCache.retrieveItem(getIntent().getStringExtra(Key.FlagOnlyResiduo));
|
mFlagOnlyResiduo = DataCache.retrieveItem(getIntent().getStringExtra(Key.FlagOnlyResiduo));
|
||||||
|
|
||||||
@@ -138,7 +131,7 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void startContenutoBancaleActivity(MtbColt item){
|
public void startContenutoBancaleActivity(MtbColt item){
|
||||||
Intent myIntent = ContenutoBancaleActivity.createIntent(this, item, mCanRecoverUl.run(item), mPrinterType, mReportName);
|
Intent myIntent = ContenutoBancaleActivity.createIntent(this, item, mCanRecoverUl.run(item), mReportName);
|
||||||
startActivityForResult(myIntent, PICK_UL_REQUEST);
|
startActivityForResult(myIntent, PICK_UL_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,10 +75,7 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static MainFragment newInstance() {
|
public static MainFragment newInstance() {
|
||||||
MainFragment fragment = new MainFragment();
|
return new MainFragment();
|
||||||
Bundle args = new Bundle();
|
|
||||||
fragment.setArguments(args);
|
|
||||||
return fragment;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ 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.MtbDepo;
|
import it.integry.integrywmsnative.core.model.MtbDepo;
|
||||||
import it.integry.integrywmsnative.core.model.MtbGrup;
|
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||||
|
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
||||||
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;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||||
@@ -180,6 +181,8 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
for (Runnable onPreDestroy : mOnPreDestroyList) {
|
for (Runnable onPreDestroy : mOnPreDestroyList) {
|
||||||
onPreDestroy.run();
|
onPreDestroy.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mViewModel.setListener(null);
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -682,50 +685,38 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
filterLayoutView.show(requireActivity().getSupportFragmentManager(), "TAG");
|
if (!filterLayoutView.isAdded())
|
||||||
|
filterLayoutView.show(requireActivity().getSupportFragmentManager(), "TAG");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
this.mViewModel.processBarcodeDTO(data, this::onLoadingEnded);
|
||||||
BarcodeManager.enable();
|
|
||||||
this.closeProgress();
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private void refreshList(List<OrdiniUscitaElencoDTO> filteredList) {
|
private void refreshList(List<OrdiniUscitaElencoDTO> filteredList) {
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
List<OrdiniUscitaElencoDTO> tmpList;
|
||||||
|
|
||||||
// new Thread(() -> {
|
if (filteredList != null) {
|
||||||
|
tmpList = filteredList;
|
||||||
|
} else if (mAppliedFilterViewModel != null) {
|
||||||
|
mAppliedFilterViewModel.applyAllTests();
|
||||||
|
tmpList = mAppliedFilterViewModel.getMutableFilteredOrderList().getValue();
|
||||||
|
} else {
|
||||||
|
tmpList = mViewModel.getOrderList().getValue();
|
||||||
|
}
|
||||||
|
|
||||||
// requireActivity().runOnUiThread(() -> {
|
var list = convertDataModelToListModel(tmpList);
|
||||||
// this.onLoadingStarted();
|
|
||||||
List<OrdiniUscitaElencoDTO> tmpList;
|
|
||||||
|
|
||||||
if (filteredList != null) {
|
this.mOrdiniInevasiMutableData.clear();
|
||||||
tmpList = filteredList;
|
this.mOrdiniInevasiMutableData.addAll(list);
|
||||||
} else if (mAppliedFilterViewModel != null) {
|
|
||||||
mAppliedFilterViewModel.applyAllTests();
|
|
||||||
tmpList = mAppliedFilterViewModel.getMutableFilteredOrderList().getValue();
|
|
||||||
} else {
|
|
||||||
tmpList = mViewModel.getOrderList().getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
var list = convertDataModelToListModel(tmpList);
|
|
||||||
|
|
||||||
this.mOrdiniInevasiMutableData.clear();
|
|
||||||
this.mOrdiniInevasiMutableData.addAll(list);
|
|
||||||
|
|
||||||
fabVisible.set(Stream.of(mOrdiniInevasiMutableData)
|
|
||||||
.anyMatch(y -> y.getSelectedObservable().get()));
|
|
||||||
|
|
||||||
// this.onLoadingEnded();
|
|
||||||
// });
|
|
||||||
|
|
||||||
// }).start();
|
|
||||||
|
|
||||||
|
fabVisible.set(Stream.of(mOrdiniInevasiMutableData)
|
||||||
|
.anyMatch(y -> y.getSelectedObservable().get()));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<OrdiniUscitaElencoListModel> convertDataModelToListModel(List<OrdiniUscitaElencoDTO> dataList) {
|
private List<OrdiniUscitaElencoListModel> convertDataModelToListModel(List<OrdiniUscitaElencoDTO> dataList) {
|
||||||
@@ -790,6 +781,17 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
this.mViewModel.loadPicking(selectedOrders, this.mAppliedFilterViewModel.getSelectedMtbGrup());
|
this.mViewModel.loadPicking(selectedOrders, this.mAppliedFilterViewModel.getSelectedMtbGrup());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFilterNumOrderApplied(List<OrdiniUscitaElencoDTO> filteredOrder) {
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
var numOrders = Stream.of(filteredOrder)
|
||||||
|
.map(OrdineInevasoDTO::getNumOrd)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
this.mAppliedFilterViewModel.setNumOrdFilter(numOrders);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onOrderFiltered(List<OrdiniUscitaElencoDTO> filteredOrders) {
|
public void onOrderFiltered(List<OrdiniUscitaElencoDTO> filteredOrders) {
|
||||||
refreshList(filteredOrders);
|
refreshList(filteredOrders);
|
||||||
|
|||||||
@@ -154,12 +154,15 @@ public class OrdiniUscitaElencoViewModel {
|
|||||||
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||||
|
|
||||||
RunnableArgs<List<OrdiniUscitaElencoDTO>> onBarcodeScanComplete = orderList -> {
|
RunnableArgs<List<OrdiniUscitaElencoDTO>> onBarcodeScanComplete = orderList -> {
|
||||||
onComplete.run();
|
|
||||||
this.sendOnOrderFiltered(orderList);
|
this.sendOnOrderFiltered(orderList);
|
||||||
|
onComplete.run();
|
||||||
};
|
};
|
||||||
|
|
||||||
if (UtilityBarcode.isBarcodeOrdineV(barcodeScanDTO)) {
|
if (UtilityBarcode.isBarcodeOrdineV(barcodeScanDTO)) {
|
||||||
this.executeEtichettaOrdineV(barcodeScanDTO.getStringValue(), onBarcodeScanComplete);
|
this.executeEtichettaOrdineV(barcodeScanDTO.getStringValue(), foundOrder -> {
|
||||||
|
this.sendOnFilterNumOrderApplied(foundOrder);
|
||||||
|
onComplete.run();
|
||||||
|
});
|
||||||
} else if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
} else if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
||||||
this.executeEtichettaLU(barcodeScanDTO.getStringValue(), onBarcodeScanComplete);
|
this.executeEtichettaLU(barcodeScanDTO.getStringValue(), onBarcodeScanComplete);
|
||||||
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||||
@@ -196,10 +199,11 @@ public class OrdiniUscitaElencoViewModel {
|
|||||||
final String finalGestione = gestione;
|
final String finalGestione = gestione;
|
||||||
final Date finalDate = date;
|
final Date finalDate = date;
|
||||||
|
|
||||||
List<OrdiniUscitaElencoDTO> filteredOrders = Stream.of(mOrderList.getValue())
|
List<OrdiniUscitaElencoDTO> foundItem = Stream.of(mOrderList.getValue())
|
||||||
.filter(x -> x.getNumOrd() == numOrd && x.getGestione().equalsIgnoreCase(finalGestione) && x.getDataOrdD().equals(finalDate)).toList();
|
.filter(x -> x.getNumOrd() == numOrd && x.getGestione().equalsIgnoreCase(finalGestione) && x.getDataOrdD().equals(finalDate))
|
||||||
|
.toList();
|
||||||
|
|
||||||
onComplete.run(filteredOrders);
|
onComplete.run(foundItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -284,6 +288,10 @@ public class OrdiniUscitaElencoViewModel {
|
|||||||
if (this.mListener != null) mListener.onError(ex);
|
if (this.mListener != null) mListener.onError(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendOnFilterNumOrderApplied(List<OrdiniUscitaElencoDTO> filteredOrder) {
|
||||||
|
if (this.mListener != null) mListener.onFilterNumOrderApplied(filteredOrder);
|
||||||
|
}
|
||||||
|
|
||||||
private void sendOnOrderFiltered(List<OrdiniUscitaElencoDTO> filteredOrders) {
|
private void sendOnOrderFiltered(List<OrdiniUscitaElencoDTO> filteredOrders) {
|
||||||
if (this.mListener != null) mListener.onOrderFiltered(filteredOrders);
|
if (this.mListener != null) mListener.onOrderFiltered(filteredOrders);
|
||||||
}
|
}
|
||||||
@@ -297,6 +305,8 @@ public class OrdiniUscitaElencoViewModel {
|
|||||||
|
|
||||||
void onError(Exception ex);
|
void onError(Exception ex);
|
||||||
|
|
||||||
|
void onFilterNumOrderApplied(List<OrdiniUscitaElencoDTO> filteredOrder);
|
||||||
|
|
||||||
void onOrderFiltered(List<OrdiniUscitaElencoDTO> filteredOrders);
|
void onOrderFiltered(List<OrdiniUscitaElencoDTO> filteredOrders);
|
||||||
|
|
||||||
void onOrdersDispatched(List<OrdineUscitaInevasoDTO> orders, List<SitArtOrdDTO> sitArts, List<MtbColt> alreadyRegisteredMtbColts);
|
void onOrdersDispatched(List<OrdineUscitaInevasoDTO> orders, List<SitArtOrdDTO> sitArts, List<MtbColt> alreadyRegisteredMtbColts);
|
||||||
|
|||||||
@@ -266,13 +266,13 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
null,
|
null,
|
||||||
() -> onComplete.run(true),
|
() -> onComplete.run(true),
|
||||||
() -> onComplete.run(false)
|
() -> onComplete.run(false)
|
||||||
).show(getActivity().getSupportFragmentManager(), "tag");
|
).show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
getActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
|
|
||||||
if (ex instanceof InvalidPesoKGException) {
|
if (ex instanceof InvalidPesoKGException) {
|
||||||
UtilityToast.showToast(ex.getMessage());
|
UtilityToast.showToast(ex.getMessage());
|
||||||
@@ -287,7 +287,7 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
@Override
|
@Override
|
||||||
public void onLUClienteRequired(RunnableArgss<VtbDest, String> onComplete, Runnable onAbort) {
|
public void onLUClienteRequired(RunnableArgss<VtbDest, String> onComplete, Runnable onAbort) {
|
||||||
DialogAskClienteView.newInstance(onComplete, onAbort)
|
DialogAskClienteView.newInstance(onComplete, onAbort)
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -337,20 +337,21 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||||
.setCanLUBeClosed(canLUBeClosed);
|
.setCanLUBeClosed(canLUBeClosed);
|
||||||
|
|
||||||
mDialogInputQuantityV2View.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
if (!mDialogInputQuantityV2View.isVisible())
|
||||||
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
mDialogInputQuantityV2View.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setQtaCnf(resultDTO.getQtaCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
.setQtaTot(resultDTO.getQtaTot())
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
.setPartitaMag(resultDTO.getPartitaMag())
|
.setQtaTot(resultDTO.getQtaTot())
|
||||||
.setDataScad(resultDTO.getDataScad());
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
|
.setDataScad(resultDTO.getDataScad());
|
||||||
|
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
})
|
})
|
||||||
.setOnAbort(this::closeProgress)
|
.setOnAbort(this::onLoadingEnded)
|
||||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ public class PickingLiberoViewModel {
|
|||||||
|
|
||||||
if (posizione != null && posizione.isFlagMonoCollo()) {
|
if (posizione != null && posizione.isFlagMonoCollo()) {
|
||||||
this.executePosizione(posizione, articolo, onComplete);
|
this.executePosizione(posizione, articolo, onComplete);
|
||||||
} else if(mDefaultGestione == GestioneEnum.VENDITA){
|
} else if (mDefaultGestione == GestioneEnum.VENDITA) {
|
||||||
this.dispatchArt(articolo, ean128Model);
|
this.dispatchArt(articolo, ean128Model);
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
} else {
|
} else {
|
||||||
@@ -439,6 +439,7 @@ public class PickingLiberoViewModel {
|
|||||||
mColliMagazzinoRESTConsumer.saveCollo(clonedTestata, value -> {
|
mColliMagazzinoRESTConsumer.saveCollo(clonedTestata, value -> {
|
||||||
for (int i = 0; i < mtbColrObservableField.size(); i++) {
|
for (int i = 0; i < mtbColrObservableField.size(); i++) {
|
||||||
MtbColr initialMtbColr = mtbColrObservableField.get(i);
|
MtbColr initialMtbColr = mtbColrObservableField.get(i);
|
||||||
|
var startIdx = (value.getMtbColr().size() - mtbColrObservableField.size());
|
||||||
|
|
||||||
initialMtbColr
|
initialMtbColr
|
||||||
.setDataCollo(value.getDataColloS())
|
.setDataCollo(value.getDataColloS())
|
||||||
@@ -446,7 +447,7 @@ public class PickingLiberoViewModel {
|
|||||||
.setGestione(value.getGestione())
|
.setGestione(value.getGestione())
|
||||||
.setSerCollo(value.getSerCollo());
|
.setSerCollo(value.getSerCollo());
|
||||||
|
|
||||||
initialMtbColr.setRiga(value.getMtbColr().get(i).getRiga());
|
initialMtbColr.setRiga(value.getMtbColr().get(startIdx + i).getRiga());
|
||||||
mCurrentMtbColt.getMtbColr().add(mtbColrObservableField.get(i));
|
mCurrentMtbColt.getMtbColr().add(mtbColrObservableField.get(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -626,7 +627,7 @@ public class PickingLiberoViewModel {
|
|||||||
UtilityString.equalsIgnoreCase(x.getCodCol(), mtbColrToUpdate.getCodCol()) &&
|
UtilityString.equalsIgnoreCase(x.getCodCol(), mtbColrToUpdate.getCodCol()) &&
|
||||||
UtilityString.equalsIgnoreCase(x.getCodTagl(), mtbColrToUpdate.getCodTagl()) &&
|
UtilityString.equalsIgnoreCase(x.getCodTagl(), mtbColrToUpdate.getCodTagl()) &&
|
||||||
UtilityString.equalsIgnoreCase(x.getPartitaMag(), mtbColrToUpdate.getPartitaMag()))
|
UtilityString.equalsIgnoreCase(x.getPartitaMag(), mtbColrToUpdate.getPartitaMag()))
|
||||||
.single();
|
.findFirstOrElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -239,24 +239,20 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
return pickingResiListModels;
|
return pickingResiListModels;
|
||||||
}
|
}
|
||||||
|
|
||||||
private RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewmodel.processBarcodeDTO(data, () -> {
|
this.mViewmodel.processBarcodeDTO(data, () -> {
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
public void createNewLU() {
|
public void createNewLU() {
|
||||||
this.mBindings.mainFab.close(true);
|
this.mBindings.mainFab.close(true);
|
||||||
|
this.onLoadingStarted();
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewmodel.createNewLU(null, null, () -> {
|
this.mViewmodel.createNewLU(null, null, () -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,7 +282,7 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
|
|
||||||
if (ex instanceof InvalidPesoKGException) {
|
if (ex instanceof InvalidPesoKGException) {
|
||||||
UtilityToast.showToast(ex.getMessage());
|
UtilityToast.showToast(ex.getMessage());
|
||||||
@@ -322,23 +318,24 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
.setCanLUBeClosed(false)
|
.setCanLUBeClosed(false)
|
||||||
.setCanPartitaMagBeChanged(false);
|
.setCanPartitaMagBeChanged(false);
|
||||||
|
|
||||||
mDialogInputQuantityV2View
|
if (!mDialogInputQuantityV2View.isVisible())
|
||||||
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
mDialogInputQuantityV2View
|
||||||
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setQtaCnf(resultDTO.getQtaCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
.setQtaTot(resultDTO.getQtaTot())
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
.setPartitaMag(resultDTO.getPartitaMag())
|
.setQtaTot(resultDTO.getQtaTot())
|
||||||
.setDataScad(resultDTO.getDataScad());
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
|
.setDataScad(resultDTO.getDataScad());
|
||||||
|
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
})
|
})
|
||||||
.setOnAbort(() -> {
|
.setOnAbort(() -> {
|
||||||
this.mViewmodel.resetMatchedRows();
|
this.mViewmodel.resetMatchedRows();
|
||||||
})
|
})
|
||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -400,7 +397,7 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
DialogSimpleMessageView.makeErrorDialog(
|
DialogSimpleMessageView.makeErrorDialog(
|
||||||
new SpannableString(ex.getMessage()),
|
new SpannableString(ex.getMessage()),
|
||||||
null,
|
null,
|
||||||
@@ -409,14 +406,4 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
onComplete)
|
onComplete)
|
||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -218,7 +218,6 @@ public class PickingResiViewModel {
|
|||||||
private void singlePrint(MtbColt mtbColtToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
private void singlePrint(MtbColt mtbColtToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
this.mPrinterRESTConsumer.printCollo(
|
this.mPrinterRESTConsumer.printCollo(
|
||||||
PrinterRESTConsumer.Type.PRIMARIA,
|
|
||||||
mtbColtToPrint,
|
mtbColtToPrint,
|
||||||
onComplete, onFailed);
|
onComplete, onFailed);
|
||||||
|
|
||||||
@@ -303,10 +302,16 @@ public class PickingResiViewModel {
|
|||||||
if (!UtilityBarcode.isEtichettaAnonimaOfCurrentYear(barcodeScanDTO.getStringValue())) {
|
if (!UtilityBarcode.isEtichettaAnonimaOfCurrentYear(barcodeScanDTO.getStringValue())) {
|
||||||
this.sendError(new NotCurrentYearLUException());
|
this.sendError(new NotCurrentYearLUException());
|
||||||
} else {
|
} else {
|
||||||
|
int numCollo = -1;
|
||||||
|
|
||||||
this.createNewLU(
|
try {
|
||||||
UtilityBarcode.getNumColloFromULAnonima(barcodeScanDTO.getStringValue()),
|
numCollo = UtilityBarcode.getNumColloFromULAnonima(barcodeScanDTO.getStringValue());
|
||||||
CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE, onComplete);
|
this.createNewLU(
|
||||||
|
numCollo,
|
||||||
|
CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE, onComplete);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
this.sendError(ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|||||||
@@ -274,7 +274,8 @@ public class ProdOrdineProduzioneElencoFragment extends BaseFragment implements
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
filterLayoutView.show(requireActivity().getSupportFragmentManager(), "TAG");
|
if (!filterLayoutView.isAdded())
|
||||||
|
filterLayoutView.show(requireActivity().getSupportFragmentManager(), "TAG");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -382,8 +383,6 @@ public class ProdOrdineProduzioneElencoFragment extends BaseFragment implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void initJtbComtCache(Runnable onComplete) {
|
private void initJtbComtCache(Runnable onComplete) {
|
||||||
var jtbComts = Stream.of(Objects.requireNonNull(this.mViewModel.getOrderList().getValue()))
|
var jtbComts = Stream.of(Objects.requireNonNull(this.mViewModel.getOrderList().getValue()))
|
||||||
.flatMap(x -> Stream.of(x.getCodJcom()))
|
.flatMap(x -> Stream.of(x.getCodJcom()))
|
||||||
|
|||||||
@@ -0,0 +1,355 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_dettaglio_linea;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.text.InputType;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.databinding.Observable;
|
||||||
|
import androidx.databinding.ObservableField;
|
||||||
|
|
||||||
|
import com.google.android.material.chip.Chip;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableString;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
||||||
|
import it.integry.integrywmsnative.databinding.ActivityProdDettaglioLineaBinding;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_dettaglio_linea.dialogs.BottomSheetLineAction;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_dettaglio_linea.dialogs.DialogStartProduction;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleInputHelper;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||||
|
|
||||||
|
public class ProdDettaglioLineaActivity extends BaseActivity implements ProdDettaglioLineaViewModel.Listener {
|
||||||
|
|
||||||
|
private static final String DATA_KEY_LINE = "keyLinea";
|
||||||
|
private static final String DATA_KEY_FRAGMENT_LISTENER = "onFragmentClose";
|
||||||
|
|
||||||
|
private ActivityProdDettaglioLineaBinding mBinding;
|
||||||
|
public final ObservableField<String> listaOrd = new ObservableField<>();
|
||||||
|
public final BindableString lineaLabel = new BindableString();
|
||||||
|
public final BindableBoolean isStarted = new BindableBoolean(false);
|
||||||
|
public final BindableBoolean isPaused = new BindableBoolean(false);
|
||||||
|
public final BindableBoolean flagShowProdInfo = new BindableBoolean(false);
|
||||||
|
public final BindableString hrNum = new BindableString();
|
||||||
|
public final BindableString codMart = new BindableString();
|
||||||
|
public final BindableString partitaMag = new BindableString();
|
||||||
|
public final BindableString productDescription = new BindableString();
|
||||||
|
private Runnable onResumeRunnable = null;
|
||||||
|
|
||||||
|
private int barcodeScannerIstanceID = -1;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
ProdDettaglioLineaViewModel mViewModel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DialogInputQuantityV2View mDialogInputQuantityV2View;
|
||||||
|
|
||||||
|
|
||||||
|
public static Intent newInstance(Context context, ProdLineStatusDTO prodLine) {
|
||||||
|
Intent myIntent = new Intent(context, ProdDettaglioLineaActivity.class);
|
||||||
|
String keyLine = DataCache.addItem(prodLine);
|
||||||
|
myIntent.putExtra(DATA_KEY_LINE, keyLine);
|
||||||
|
return myIntent;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
mBinding = ActivityProdDettaglioLineaBinding.inflate(getLayoutInflater());
|
||||||
|
setContentView(mBinding.getRoot());
|
||||||
|
setSupportActionBar(mBinding.toolbar);
|
||||||
|
setTitle(R.string.line_details);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
ProdLineStatusDTO lineaProd = DataCache.retrieveItem(getIntent().getStringExtra(DATA_KEY_LINE));
|
||||||
|
if (lineaProd == null) {
|
||||||
|
Toast.makeText(this, "Selezionare una linea di produzione e riprovare", Toast.LENGTH_SHORT).show();
|
||||||
|
close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MainApplication.appComponent
|
||||||
|
.prodDettaglioLineaComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
|
|
||||||
|
mViewModel.setListener(this);
|
||||||
|
mBinding.setViewModel(mViewModel);
|
||||||
|
mBinding.setView(this);
|
||||||
|
this.init();
|
||||||
|
mViewModel.init(lineaProd);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
initBarcodeReader();
|
||||||
|
mViewModel.lineaProd.observe(this, lineaProd -> {
|
||||||
|
this.listaOrd.set(lineaProd.getListaOrd());
|
||||||
|
this.lineaLabel.set(lineaProd.getLabel());
|
||||||
|
this.isStarted.set(lineaProd.isStarted());
|
||||||
|
this.isPaused.set(lineaProd.isPaused());
|
||||||
|
this.partitaMag.set(lineaProd.getPartitaMag());
|
||||||
|
this.codMart.set(lineaProd.getCodMart());
|
||||||
|
this.productDescription.set(lineaProd.getDescrizioneProd());
|
||||||
|
this.flagShowProdInfo.set(lineaProd.isStarted() && !UtilityString.isNullOrEmpty(lineaProd.getCodMart()));
|
||||||
|
this.hrNum.set(lineaProd.getQtaAllocate().toString());
|
||||||
|
});
|
||||||
|
listaOrd.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||||
|
renderOrdersChips();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
getSupportFragmentManager()
|
||||||
|
.setFragmentResultListener(DATA_KEY_FRAGMENT_LISTENER, this, (requestKey, result) -> {
|
||||||
|
if (onResumeRunnable != null) {
|
||||||
|
onResumeRunnable.run();
|
||||||
|
onResumeRunnable = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderOrdersChips() {
|
||||||
|
mBinding.ordersList.removeAllViews();
|
||||||
|
String listaOrdString = listaOrd.get();
|
||||||
|
if (!UtilityString.isNullOrEmpty(listaOrdString)) {
|
||||||
|
for (String ord : listaOrdString.split("\\|")) {
|
||||||
|
Chip chip = new Chip(this);
|
||||||
|
chip.setClickable(false);
|
||||||
|
chip.setText(ord);
|
||||||
|
mBinding.ordersList.addView(chip);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onSupportNavigateUp() {
|
||||||
|
onBackPressed();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSettingsRequest(ProdLineStatusDTO lineaProd) {
|
||||||
|
BottomSheetLineAction.newInstance(lineaProd, this::requestResources, this::requestOrderChange, this::requestProductionStop, this::requestMaterialRecover, BarcodeManager::enable).show(getSupportFragmentManager(), "BottomSheetLineAction");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void confirmInconsistentDeposit(Runnable onConfirm) {
|
||||||
|
this.runOnUiThread(() -> {
|
||||||
|
DialogSimpleMessageView.makeWarningDialog(
|
||||||
|
Html.fromHtml("L'articolo che si vuole versare non è compatibile con nessun ordine presente sulla linea!"
|
||||||
|
+ "<br /> <br/>" +
|
||||||
|
"Vuoi versarlo comunque?"),
|
||||||
|
null,
|
||||||
|
onConfirm,
|
||||||
|
() -> {
|
||||||
|
onLoadingEnded();
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}
|
||||||
|
).show(getSupportFragmentManager(), "confirmOrderClose");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void requestQtaVersamento(MtbColr mtbColr,
|
||||||
|
RunnableArgs<PickedQuantityDTO> onComplete) {
|
||||||
|
onLoadingStarted();
|
||||||
|
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
||||||
|
.setMtbAart(mtbColr.getMtbAart())
|
||||||
|
.setInitialNumCnf(mtbColr.getNumCnf())
|
||||||
|
.setInitialQtaCnf(mtbColr.getQtaCnf())
|
||||||
|
.setInitialQtaTot(mtbColr.getQtaCol())
|
||||||
|
.setTotalQtaAvailable(mtbColr.getQtaCol())
|
||||||
|
.setTotalNumCnfAvailable(mtbColr.getNumCnf())
|
||||||
|
.setQtaCnfAvailable(mtbColr.getQtaCnf())
|
||||||
|
.setPartitaMag(mtbColr.getPartitaMag())
|
||||||
|
.setDataScad(mtbColr.getDataScadPartitaD())
|
||||||
|
.setCanOverflowOrderQuantity(false)
|
||||||
|
.setCanPartitaMagBeChanged(false)
|
||||||
|
.setCanLUBeClosed(false)
|
||||||
|
.setFocusOnStart(false);
|
||||||
|
|
||||||
|
if (!mDialogInputQuantityV2View.isVisible())
|
||||||
|
this.runOnUiThread(() -> {
|
||||||
|
onLoadingEnded();
|
||||||
|
mDialogInputQuantityV2View
|
||||||
|
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
|
|
||||||
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
|
.setQtaTot(resultDTO.getQtaTot())
|
||||||
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
|
.setDataScad(resultDTO.getDataScad());
|
||||||
|
|
||||||
|
onComplete.run(pickedQuantityDTO);
|
||||||
|
|
||||||
|
})
|
||||||
|
.setOnAbort(this::onLoadingEnded)
|
||||||
|
.show(this.getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
|
else this.onLoadingEnded();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onLineStop() {
|
||||||
|
onBackPressed();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initBarcodeReader() {
|
||||||
|
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||||
|
.setOnScanSuccessful(onScanSuccessful)
|
||||||
|
.setOnScanFailed(this::onError));
|
||||||
|
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void requestResources() {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
BarcodeManager.disable();
|
||||||
|
this.runOnUiThread(() -> {
|
||||||
|
|
||||||
|
DialogSimpleInputHelper.makeInputDialog(this, "Inserisci il numero di risorse da allocare", this.hrNum.get(), "n. risorse", qta -> {
|
||||||
|
this.onLoadingStarted();
|
||||||
|
try {
|
||||||
|
Integer hrNum = Integer.parseInt(qta);
|
||||||
|
this.mViewModel.startProductionLine(hrNum);
|
||||||
|
} catch (NumberFormatException ex) {
|
||||||
|
this.onError(new Exception("Inserire un numero di risorse valido"));
|
||||||
|
}
|
||||||
|
}, BarcodeManager::enable, InputType.TYPE_CLASS_NUMBER).show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void requestOrderChange() {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
this.runOnUiThread(() -> {
|
||||||
|
DialogStartProduction.newInstance((dto) -> {
|
||||||
|
this.mViewModel.checkBarcodeAndStartOrdine(dto);
|
||||||
|
}).show(getSupportFragmentManager(), "DialogStartProduction");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void requestProductionStop() {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
BarcodeManager.disable();
|
||||||
|
ProdLineStatusDTO lineaProd = mViewModel.getLineaProd();
|
||||||
|
if (UtilityString.isNullOrEmpty(lineaProd.getListaOrd())) {
|
||||||
|
mViewModel.stopProduction();
|
||||||
|
} else {
|
||||||
|
this.confirmOrderClose(() -> {
|
||||||
|
mViewModel.stopProduction();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void requestMaterialRecover() {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
BarcodeManager.disable();
|
||||||
|
this.runOnUiThread(() -> {
|
||||||
|
getSupportFragmentManager()
|
||||||
|
.beginTransaction()
|
||||||
|
.add(R.id.frame_layout_container,
|
||||||
|
ProdRecuperoMaterialeFragment.newInstance(mViewModel.lineaProd.getValue().getCodJfas(), DATA_KEY_FRAGMENT_LISTENER))
|
||||||
|
.addToBackStack("ProdRecuperoMaterialeFragment")
|
||||||
|
.commit();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void successDialog(String message, Runnable onComplete) {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
|
||||||
|
this.runOnUiThread(() -> DialogSimpleMessageView.makeSuccessDialog(getResources().getString(R.string.success),
|
||||||
|
new SpannableString(message), null, onComplete).show(getSupportFragmentManager(), "successDialog"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showToast(String message, Runnable onComplete) {
|
||||||
|
this.runOnUiThread(() -> {
|
||||||
|
UtilityToast.showToast(message);
|
||||||
|
onComplete.run();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
|
this.onLoadingStarted();
|
||||||
|
|
||||||
|
this.mViewModel.processBarcodeDTO(data, this::onLoadingEnded);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void confirmOrderClose(Runnable onConfirm) {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
this.runOnUiThread(() -> {
|
||||||
|
DialogSimpleMessageView.makeWarningDialog(
|
||||||
|
Html.fromHtml("Per completare l'operazione è necessario chiudere gli ordini attualmente aperti sulla linea."
|
||||||
|
+ "<br /> <br/>" +
|
||||||
|
"Continuare?"),
|
||||||
|
null,
|
||||||
|
() -> {
|
||||||
|
DialogSimpleMessageView.makeInfoDialog(
|
||||||
|
null,
|
||||||
|
Html.fromHtml("Vuoi recuperare del materiale prima di chiudere gli ordini?"),
|
||||||
|
null,
|
||||||
|
() -> {
|
||||||
|
onResumeRunnable = onConfirm;
|
||||||
|
this.requestMaterialRecover();
|
||||||
|
},
|
||||||
|
onConfirm
|
||||||
|
).show(getSupportFragmentManager(), "confirmOrderClose");
|
||||||
|
},
|
||||||
|
BarcodeManager::enable
|
||||||
|
).show(getSupportFragmentManager(), "confirmOrderClose");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void close() {
|
||||||
|
onBackPressed();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
int count = getSupportFragmentManager().getBackStackEntryCount();
|
||||||
|
if (count > 0) {
|
||||||
|
getSupportFragmentManager().popBackStack();
|
||||||
|
} else {
|
||||||
|
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||||
|
super.onBackPressed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_dettaglio_linea;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface ProdDettaglioLineaComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
|
||||||
|
ProdDettaglioLineaComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(ProdDettaglioLineaActivity prodDettaglioLineaActivity);
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_dettaglio_linea;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
import dagger.Provides;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||||
|
|
||||||
|
@Module(subcomponents = ProdDettaglioLineaComponent.class)
|
||||||
|
public class ProdDettaglioLineaModule {
|
||||||
|
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
ProdDettaglioLineaViewModel providesProdDettaglioLineaViewModel(ProductionLinesRESTConsumer productionLinesRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, MesRESTConsumer mesRESTConsumer) {
|
||||||
|
return new ProdDettaglioLineaViewModel(productionLinesRESTConsumer, barcodeRESTConsumer, colliMagazzinoRESTConsumer, mesRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,236 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_dettaglio_linea;
|
||||||
|
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
|
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.rest.consumers.BarcodeRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
|
|
||||||
|
public class ProdDettaglioLineaViewModel {
|
||||||
|
|
||||||
|
private Listener mListener;
|
||||||
|
|
||||||
|
private final ProductionLinesRESTConsumer productionLinesRESTConsumer;
|
||||||
|
private final ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer;
|
||||||
|
private final MesRESTConsumer mesRESTConsumer;
|
||||||
|
private final BarcodeRESTConsumer mBarcodeRESTConsumer;
|
||||||
|
public final MutableLiveData<ProdLineStatusDTO> lineaProd = new MutableLiveData<>();
|
||||||
|
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public ProdDettaglioLineaViewModel(ProductionLinesRESTConsumer productionLinesRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, ColliMagazzinoRESTConsumer magazzinoRESTConsumer, MesRESTConsumer mesRESTConsumer) {
|
||||||
|
this.productionLinesRESTConsumer = productionLinesRESTConsumer;
|
||||||
|
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||||
|
this.colliMagazzinoRESTConsumer = magazzinoRESTConsumer;
|
||||||
|
this.mesRESTConsumer = mesRESTConsumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||||
|
if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
||||||
|
this.executeEtichettaAnonima(barcodeScanDTO, onComplete);
|
||||||
|
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||||
|
this.executeEAN128(barcodeScanDTO, onComplete);
|
||||||
|
} else {
|
||||||
|
onComplete.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void executeEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||||
|
handleSSCCBarcode(barcodeScanDTO.getStringValue(), onComplete);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleSSCCBarcode(String sscc, Runnable onComplete) {
|
||||||
|
this.colliMagazzinoRESTConsumer.getBySSCC(sscc, true, false, mtbColt -> {
|
||||||
|
|
||||||
|
if (mtbColt == null) {
|
||||||
|
this.sendError(new NoLUFoundException());
|
||||||
|
} else {
|
||||||
|
if (mtbColt.getMtbColr().size() <= 0) {
|
||||||
|
this.sendError(new Exception("E' stata scansionata una UL già vuota"));
|
||||||
|
} else {
|
||||||
|
this.sendOnLUSelected(mtbColt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnLUSelected(MtbColt mtbColt) {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
this.checkOrdersCompatibility(mtbColt, () -> {
|
||||||
|
MtbColr row = mtbColt.getMtbColr().get(0);
|
||||||
|
mListener.requestQtaVersamento(
|
||||||
|
row,
|
||||||
|
dto -> {
|
||||||
|
sendOnLoadingStarted();
|
||||||
|
row.setQtaCnf(dto.getQtaCnf());
|
||||||
|
row.setNumCnf(dto.getNumCnf());
|
||||||
|
row.setQtaCol(dto.getQtaTot());
|
||||||
|
row.setPesoLordoKg(null);
|
||||||
|
row.setPesoNettoKg(null);
|
||||||
|
ProdLineStatusDTO prodLine = lineaProd.getValue();
|
||||||
|
MtbDepoPosizione posizione = new MtbDepoPosizione();
|
||||||
|
posizione.setPosizione(prodLine.getCodJfas());
|
||||||
|
posizione.setCodMdep(prodLine.getCodMdepLav());
|
||||||
|
posizione.setFlagLineaProduzione("S");
|
||||||
|
this.colliMagazzinoRESTConsumer.createColloScaricoDaCarico(mtbColt, posizione,
|
||||||
|
generatedMtbColt -> {
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
this.mListener.showToast("Versamento completato!", BarcodeManager::enable);
|
||||||
|
}, this::sendError);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkOrdersCompatibility(MtbColt mtbColt, Runnable onComplete) {
|
||||||
|
mesRESTConsumer.getOrdiniLavorazioneMateriale(lineaProd.getValue().getCodJfas(), getIdMaterialeFromCollo(mtbColt), ordini -> {
|
||||||
|
if (ordini != null && ordini.size() > 0) {
|
||||||
|
onComplete.run();
|
||||||
|
} else {
|
||||||
|
this.mListener.confirmInconsistentDeposit(onComplete);
|
||||||
|
}
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getIdMaterialeFromCollo(MtbColt mtbColt) {
|
||||||
|
MtbAart articolo = mtbColt.getMtbColr().get(0).getMtbAart();
|
||||||
|
return UtilityString.isNullOrEmpty(articolo.getIdArtEqui()) ? articolo.getCodMart() : articolo.getIdArtEqui();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void executeEAN128(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||||
|
this.mBarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
||||||
|
if (ean128Model != null && !UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
|
||||||
|
handleSSCCBarcode(ean128Model.Sscc, onComplete);
|
||||||
|
} else {
|
||||||
|
this.sendError(new NoLUFoundException());
|
||||||
|
}
|
||||||
|
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void settings() {
|
||||||
|
this.mListener.onSettingsRequest(lineaProd.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
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 void startProductionLine(Integer hrNum) {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
ProdLineStatusDTO prodLine = lineaProd.getValue();
|
||||||
|
this.productionLinesRESTConsumer.avviaLineaDiProduzione(prodLine.getCodJfas(),
|
||||||
|
hrNum,
|
||||||
|
() -> this.mListener.successDialog("Operazione completata", this::loadLineDetails),
|
||||||
|
this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void startProduction(String codMart, String partitaMag) {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
ProdLineStatusDTO prodLine = lineaProd.getValue();
|
||||||
|
this.productionLinesRESTConsumer.avviaProduzioneArticoloSuLinea(prodLine.getCodJfas(), codMart, partitaMag,
|
||||||
|
() -> this.mListener.successDialog("Operazione completata", this::loadLineDetails),
|
||||||
|
this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stopProduction() {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
ProdLineStatusDTO prodLine = lineaProd.getValue();
|
||||||
|
this.productionLinesRESTConsumer.arrestaLineaDiProduzione(prodLine.getCodJfas(),
|
||||||
|
() -> this.mListener.successDialog("Operazione completata", this::onLineStop),
|
||||||
|
this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onLineStop() {
|
||||||
|
this.mListener.onLineStop();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void checkBarcodeAndStartOrdine(BarcodeScanDTO dto) {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
ProdLineStatusDTO prodLine = lineaProd.getValue();
|
||||||
|
mBarcodeRESTConsumer.decodeEan128(dto, (ean128) -> {
|
||||||
|
String codMart = ean128.Content;
|
||||||
|
String partitaMag = ean128.BatchLot;
|
||||||
|
if (!prodLine.isStarted()) {
|
||||||
|
this.sendError(new Exception("Impossibile avviare una produzione su una linea ferma!"));
|
||||||
|
} else if (UtilityString.isNullOrEmpty(prodLine.getListaOrd())) {
|
||||||
|
this.startProduction(codMart, partitaMag);
|
||||||
|
} else {
|
||||||
|
this.mListener.confirmOrderClose(() -> {
|
||||||
|
this.startProduction(codMart, partitaMag);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadLineDetails() {
|
||||||
|
sendOnLoadingStarted();
|
||||||
|
if (lineaProd.getValue() == null) {
|
||||||
|
this.sendError(new Exception("Nessuna linea selezionata!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
productionLinesRESTConsumer.getLineDetails(lineaProd.getValue(), linea -> {
|
||||||
|
this.lineaProd.postValue(linea);
|
||||||
|
sendOnLoadingEnded();
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(ProdLineStatusDTO lineaProd) {
|
||||||
|
this.lineaProd.setValue(lineaProd);
|
||||||
|
this.loadLineDetails();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO getLineaProd() {
|
||||||
|
return lineaProd.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public interface Listener extends ILoadingListener {
|
||||||
|
void onError(Exception ex);
|
||||||
|
|
||||||
|
void successDialog(String message, Runnable onComplete);
|
||||||
|
|
||||||
|
void showToast(String message, Runnable onComplete);
|
||||||
|
|
||||||
|
void requestQtaVersamento(MtbColr mtbColr, RunnableArgs<PickedQuantityDTO> onComplete);
|
||||||
|
|
||||||
|
void onSettingsRequest(ProdLineStatusDTO lineaProd);
|
||||||
|
|
||||||
|
void confirmInconsistentDeposit(Runnable onConfirm);
|
||||||
|
|
||||||
|
void onLineStop();
|
||||||
|
|
||||||
|
void confirmOrderClose(Runnable onConfirm);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdDettaglioLineaViewModel setListener(Listener listener) {
|
||||||
|
this.mListener = listener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_dettaglio_linea.dialogs;
|
||||||
|
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
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 com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.databinding.BottomSheetLineActionsBinding;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||||
|
|
||||||
|
public class BottomSheetLineAction extends BottomSheetDialogFragment {
|
||||||
|
|
||||||
|
private BottomSheetLineActionsBinding mBinding;
|
||||||
|
|
||||||
|
private ProdLineStatusDTO prodLine;
|
||||||
|
private Runnable onChangeResourcesRequest;
|
||||||
|
private Runnable onChangeOrdersRequest;
|
||||||
|
private Runnable onLineCloseRequest;
|
||||||
|
private Runnable onRecoverRequest;
|
||||||
|
private Runnable onCancelAction;
|
||||||
|
|
||||||
|
public static BottomSheetLineAction newInstance(ProdLineStatusDTO dto, Runnable onChangeResourcesRequest, Runnable onChangeOrdersRequest, Runnable onLineCloseRequest, Runnable onRecoverRequest, Runnable onCancel) {
|
||||||
|
BottomSheetLineAction fragment = new BottomSheetLineAction();
|
||||||
|
fragment
|
||||||
|
.setProdLine(dto)
|
||||||
|
.setOnChangeResourcesRequest(onChangeResourcesRequest)
|
||||||
|
.setOnChangeOrdersRequest(onChangeOrdersRequest)
|
||||||
|
.setOnRecoverRequest(onRecoverRequest)
|
||||||
|
.setOnLineCloseRequest(onLineCloseRequest)
|
||||||
|
.setOnCancelAction(onCancel);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBinding = BottomSheetLineActionsBinding.inflate(inflater, container, false);
|
||||||
|
mBinding.setLifecycleOwner(this);
|
||||||
|
mBinding.setView(this);
|
||||||
|
mBinding.setListModel(this.prodLine);
|
||||||
|
|
||||||
|
return mBinding.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BottomSheetLineAction setOnCancelAction(Runnable onCancelAction) {
|
||||||
|
this.onCancelAction = onCancelAction;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BottomSheetLineAction setOnChangeResourcesRequest(Runnable onChangeResourcesRequest) {
|
||||||
|
this.onChangeResourcesRequest = onChangeResourcesRequest;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public BottomSheetLineAction setOnChangeOrdersRequest(Runnable onChangeOrdersRequest) {
|
||||||
|
this.onChangeOrdersRequest = onChangeOrdersRequest;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BottomSheetLineAction setOnRecoverRequest(Runnable onRecoverRequest) {
|
||||||
|
this.onRecoverRequest = onRecoverRequest;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public BottomSheetLineAction setOnLineCloseRequest(Runnable onLineCloseRequest) {
|
||||||
|
this.onLineCloseRequest = onLineCloseRequest;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO getProdLine() {
|
||||||
|
return prodLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BottomSheetLineAction setProdLine(ProdLineStatusDTO prodLine) {
|
||||||
|
this.prodLine = prodLine;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onResourcesClicked() {
|
||||||
|
if (this.onChangeResourcesRequest != null) {
|
||||||
|
this.onChangeResourcesRequest.run();
|
||||||
|
}
|
||||||
|
this.dismiss();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onPlayClicked() {
|
||||||
|
if (this.onChangeOrdersRequest != null) {
|
||||||
|
this.onChangeOrdersRequest.run();
|
||||||
|
}
|
||||||
|
this.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onStopClicked() {
|
||||||
|
if (this.onLineCloseRequest != null) {
|
||||||
|
this.onLineCloseRequest.run();
|
||||||
|
}
|
||||||
|
this.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onRecoverClicked() {
|
||||||
|
if (this.onRecoverRequest != null) {
|
||||||
|
this.onRecoverRequest.run();
|
||||||
|
}
|
||||||
|
this.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCancel(@NonNull DialogInterface dialog) {
|
||||||
|
if (this.onCancelAction != null) {
|
||||||
|
onCancelAction.run();
|
||||||
|
}
|
||||||
|
super.onCancel(dialog);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_dettaglio_linea.dialogs;
|
||||||
|
|
||||||
|
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 androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
|
import it.integry.integrywmsnative.databinding.DialogStartProductionBinding;
|
||||||
|
|
||||||
|
public class DialogRecoverUl extends BaseDialogFragment {
|
||||||
|
private int barcodeScannerIstanceID = -1;
|
||||||
|
private RunnableArgs<BarcodeScanDTO> onScanSuccessful;
|
||||||
|
private DialogStartProductionBinding mBinding;
|
||||||
|
|
||||||
|
public static DialogRecoverUl newInstance(RunnableArgs<BarcodeScanDTO> onScanSuccessful) {
|
||||||
|
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
|
||||||
|
DialogRecoverUl fragment = new DialogRecoverUl();
|
||||||
|
fragment.setArguments(args);
|
||||||
|
fragment.setOnScanSuccessful(onScanSuccessful);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||||
|
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||||
|
super.onDismiss(dialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogRecoverUl setOnScanSuccessful(RunnableArgs<BarcodeScanDTO> onScanSuccessful) {
|
||||||
|
this.onScanSuccessful = onScanSuccessful;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBinding = DialogStartProductionBinding.inflate(inflater, container, false);
|
||||||
|
mBinding.setLifecycleOwner(this);
|
||||||
|
this.initBarcodeReader();
|
||||||
|
setCancelable(true);
|
||||||
|
getDialog().setCanceledOnTouchOutside(true);
|
||||||
|
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
return mBinding.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initBarcodeReader() {
|
||||||
|
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||||
|
.setOnScanSuccessful(this::processBarcode)
|
||||||
|
.setOnScanFailed(this::onError));
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processBarcode(BarcodeScanDTO barcodeScanDTO) {
|
||||||
|
if (UtilityBarcode.isEan128(barcodeScanDTO)) {
|
||||||
|
this.onScanSuccessful.run(barcodeScanDTO);
|
||||||
|
this.dismiss();
|
||||||
|
} else {
|
||||||
|
this.onError(new Exception("Il barcode scansionato non è valido!"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_dettaglio_linea.dialogs;
|
||||||
|
|
||||||
|
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 androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.databinding.DialogStartProductionBinding;
|
||||||
|
|
||||||
|
public class DialogStartProduction extends BaseDialogFragment {
|
||||||
|
private int barcodeScannerIstanceID = -1;
|
||||||
|
private RunnableArgs<BarcodeScanDTO> onScanSuccessful;
|
||||||
|
private DialogStartProductionBinding mBinding;
|
||||||
|
private String title;
|
||||||
|
private String label;
|
||||||
|
|
||||||
|
public static DialogStartProduction newInstance(RunnableArgs<BarcodeScanDTO> onScanSuccessful) {
|
||||||
|
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
|
||||||
|
DialogStartProduction fragment = new DialogStartProduction();
|
||||||
|
fragment.setArguments(args);
|
||||||
|
fragment.setOnScanSuccessful(onScanSuccessful);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogStartProduction setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogStartProduction setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||||
|
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||||
|
super.onDismiss(dialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogStartProduction setOnScanSuccessful(RunnableArgs<BarcodeScanDTO> onScanSuccessful) {
|
||||||
|
this.onScanSuccessful = onScanSuccessful;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBinding = DialogStartProductionBinding.inflate(inflater, container, false);
|
||||||
|
mBinding.setLifecycleOwner(this);
|
||||||
|
this.initBarcodeReader();
|
||||||
|
setCancelable(true);
|
||||||
|
getDialog().setCanceledOnTouchOutside(true);
|
||||||
|
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
|
||||||
|
if (!UtilityString.isNullOrEmpty(title)) {
|
||||||
|
mBinding.titleText.setText(title);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!UtilityString.isNullOrEmpty(label)) {
|
||||||
|
mBinding.scanLabel.setText(label);
|
||||||
|
}
|
||||||
|
return mBinding.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initBarcodeReader() {
|
||||||
|
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||||
|
.setOnScanSuccessful(this::processBarcode)
|
||||||
|
.setOnScanFailed(this::onError));
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processBarcode(BarcodeScanDTO barcodeScanDTO) {
|
||||||
|
if (UtilityBarcode.isEan128(barcodeScanDTO)) {
|
||||||
|
this.dismiss();
|
||||||
|
this.onScanSuccessful.run(barcodeScanDTO);
|
||||||
|
} else {
|
||||||
|
this.onError(new Exception("Il barcode scansionato non è valido!"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,7 +26,6 @@ import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||||
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.databinding.FragmentProdFabbisognoLineeProdBinding;
|
import it.integry.integrywmsnative.databinding.FragmentProdFabbisognoLineeProdBinding;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaView;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaView;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto.ProdFabbisognoLineeProdDTO;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto.ProdFabbisognoLineeProdDTO;
|
||||||
@@ -112,24 +111,6 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
|||||||
titleText.setText(context.getText(R.string.prod_fabbisogno_linee_prod_title).toString());
|
titleText.setText(context.getText(R.string.prod_fabbisogno_linee_prod_title).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Exception ex) {
|
|
||||||
this.closeProgress();
|
|
||||||
UtilityExceptions.defaultException(getActivity(), ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void startPickingActivity(List<ProdFabbisognoLineeProdDTO> fabbisognoList) {
|
private void startPickingActivity(List<ProdFabbisognoLineeProdDTO> fabbisognoList) {
|
||||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||||
|
|
||||||
|
|||||||
@@ -22,14 +22,12 @@ import javax.inject.Inject;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.MainApplication;
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||||
import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;
|
import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgsss;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgsss;
|
||||||
import it.integry.integrywmsnative.core.model.JtbFasi;
|
import it.integry.integrywmsnative.core.model.JtbFasi;
|
||||||
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.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|
||||||
import it.integry.integrywmsnative.databinding.DialogAskMagazzinoProssimitaBinding;
|
import it.integry.integrywmsnative.databinding.DialogAskMagazzinoProssimitaBinding;
|
||||||
|
|
||||||
public class DialogAskMagazzinoProssimitaView extends BaseDialogFragment implements DialogAskMagazzinoProssimitaViewModel.Listener {
|
public class DialogAskMagazzinoProssimitaView extends BaseDialogFragment implements DialogAskMagazzinoProssimitaViewModel.Listener {
|
||||||
@@ -178,20 +176,4 @@ public class DialogAskMagazzinoProssimitaView extends BaseDialogFragment impleme
|
|||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Exception ex) {
|
|
||||||
this.closeProgress();
|
|
||||||
UtilityExceptions.defaultException(mContext, ex);
|
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_linee_produzione;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface ProdLineeProduzioneComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
ProdLineeProduzioneComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(ProdLineeProduzioneFragment prodLineeProduzioneFragment);
|
||||||
|
}
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_linee_produzione;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.InputType;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||||
|
import it.integry.integrywmsnative.databinding.FragmentLineeProdBinding;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_dettaglio_linea.ProdDettaglioLineaActivity;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.ui.LinesListAdapter;
|
||||||
|
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleInputHelper;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
|
public class ProdLineeProduzioneFragment extends BaseFragment implements ITitledFragment, IScrollableFragment, ProdLineeProduzioneViewModel.Listener {
|
||||||
|
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
ProdLineeProduzioneViewModel mViewModel;
|
||||||
|
|
||||||
|
private final ObservableArrayList<ProdLineStatusDTO> mLinesObservableList = new ObservableArrayList<>();
|
||||||
|
private FragmentLineeProdBinding mBinding;
|
||||||
|
private ElevatedToolbar mToolbar;
|
||||||
|
private int barcodeScannerIstanceID = -1;
|
||||||
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
|
this.onLoadingStarted();
|
||||||
|
|
||||||
|
this.mViewModel.processBarcodeDTO(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
public static ProdLineeProduzioneFragment newInstance() {
|
||||||
|
return new ProdLineeProduzioneFragment();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
mBinding = FragmentLineeProdBinding.inflate(inflater, container, false);
|
||||||
|
MainApplication.appComponent
|
||||||
|
.prodLineeProduzioneComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
|
mViewModel.setListener(this);
|
||||||
|
mBinding.setLifecycleOwner(this);
|
||||||
|
this.initRecyclerView();
|
||||||
|
this.initBarcodeReader();
|
||||||
|
|
||||||
|
return mBinding.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
mViewModel.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initBarcodeReader() {
|
||||||
|
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||||
|
.setOnScanSuccessful(onScanSuccessful)
|
||||||
|
.setOnScanFailed(this::onError));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
||||||
|
mToolbar = toolbar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void refreshLineeProd(List<ProdLineStatusDTO> linesList) {
|
||||||
|
this.mLinesObservableList.clear();
|
||||||
|
if (linesList != null) {
|
||||||
|
|
||||||
|
this.mLinesObservableList.addAll(linesList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initRecyclerView() {
|
||||||
|
this.mViewModel.getProdLinesList().observe(getViewLifecycleOwner(), this::refreshLineeProd);
|
||||||
|
LinesListAdapter prodLinesListAdapter = new LinesListAdapter(this.requireActivity(), this.mLinesObservableList);
|
||||||
|
prodLinesListAdapter.setEmptyView(this.mBinding.linesListEmptyView);
|
||||||
|
this.mBinding.linesMainList.setAdapter(prodLinesListAdapter);
|
||||||
|
this.mBinding.linesMainList.setLayoutManager(new LinearLayoutManager(this.requireActivity()));
|
||||||
|
prodLinesListAdapter.setOnItemClicked(this.mViewModel::onLineSelected);
|
||||||
|
if (mToolbar != null)
|
||||||
|
mToolbar.setRecyclerView(this.mBinding.linesMainList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void requestResources(ProdLineStatusDTO prodLine) {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
BarcodeManager.disable();
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
|
||||||
|
DialogSimpleInputHelper.makeInputDialog(requireContext(), "Inserisci il numero di risorse da allocare", prodLine.getQtaAllocate().toString(), "n. risorse", qta -> {
|
||||||
|
this.onLoadingStarted();
|
||||||
|
try {
|
||||||
|
Integer hrNum = Integer.parseInt(qta);
|
||||||
|
this.mViewModel.startProductionLine(prodLine, hrNum);
|
||||||
|
} catch (NumberFormatException ex) {
|
||||||
|
this.onError(new Exception("Inserire un numero di risorse valido"));
|
||||||
|
}
|
||||||
|
}, BarcodeManager::enable, InputType.TYPE_CLASS_NUMBER).show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void successDialog(String message, Runnable onComplete) {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
requireActivity().runOnUiThread(() -> DialogSimpleMessageView.makeSuccessDialog(getResources().getString(R.string.success),
|
||||||
|
new SpannableString(message), null, onComplete).show(getChildFragmentManager(), "successDialog"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void selectLine(ProdLineStatusDTO dto) {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
BarcodeManager.disable();
|
||||||
|
if (!dto.isStarted()) {
|
||||||
|
this.requestResources(dto);
|
||||||
|
} else {
|
||||||
|
requireActivity().startActivity(ProdDettaglioLineaActivity.newInstance(requireActivity(), dto));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||||
|
titleText.setText(context.getText(R.string.nav_prod_linee_title).toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_linee_produzione;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
import dagger.Provides;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceComponent;
|
||||||
|
|
||||||
|
@Module(subcomponents = ProdRientroMerceComponent.class)
|
||||||
|
public class ProdLineeProduzioneModule {
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
ProdLineeProduzioneViewModel providesProdRientroMerceViewModel(ProductionLinesRESTConsumer productionLinesRESTConsumer) {
|
||||||
|
return new ProdLineeProduzioneViewModel(productionLinesRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_linee_produzione;
|
||||||
|
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||||
|
|
||||||
|
public class ProdLineeProduzioneViewModel {
|
||||||
|
|
||||||
|
|
||||||
|
private final ProductionLinesRESTConsumer productionLinesRESTConsumer;
|
||||||
|
private final MutableLiveData<List<ProdLineStatusDTO>> prodLines = new MutableLiveData<>();
|
||||||
|
|
||||||
|
private Listener mListener;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public ProdLineeProduzioneViewModel(ProductionLinesRESTConsumer productionLinesRESTConsumer) {
|
||||||
|
this.productionLinesRESTConsumer = productionLinesRESTConsumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init() {
|
||||||
|
reloadLines();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void reloadLines() {
|
||||||
|
sendOnLoadingStarted();
|
||||||
|
BarcodeManager.disable();
|
||||||
|
this.productionLinesRESTConsumer.getStatoLinee(SettingsManager.i().getUserSession().getDepo().getCodMdep(), lineeProdList -> {
|
||||||
|
BarcodeManager.enable();
|
||||||
|
prodLines.postValue(lineeProdList);
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MutableLiveData<List<ProdLineStatusDTO>> getProdLinesList() {
|
||||||
|
return prodLines;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setListener(Listener listener) {
|
||||||
|
this.mListener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO) {
|
||||||
|
String codJfas = barcodeScanDTO.getStringValue();
|
||||||
|
ProdLineStatusDTO prodLine = prodLines.getValue() != null ? Stream.of(prodLines.getValue()).filter(x -> x.getCodJfas().equalsIgnoreCase(codJfas)).findFirstOrElse(null) : null;
|
||||||
|
if (prodLine != null) {
|
||||||
|
this.onLineSelected(prodLine);
|
||||||
|
} else {
|
||||||
|
this.sendError(new Exception("Linea di produzione " + codJfas + " non trovata"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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 void startProductionLine(ProdLineStatusDTO prodLine, Integer hrNum) {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
this.productionLinesRESTConsumer.avviaLineaDiProduzione(prodLine.getCodJfas(),
|
||||||
|
hrNum,
|
||||||
|
() -> this.mListener.successDialog("Operazione completata", this::reloadLines),
|
||||||
|
this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onLineSelected(ProdLineStatusDTO lineSelected) {
|
||||||
|
mListener.selectLine(lineSelected);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public interface Listener extends ILoadingListener {
|
||||||
|
|
||||||
|
void onError(Exception ex);
|
||||||
|
|
||||||
|
void successDialog(String message, Runnable onComplete);
|
||||||
|
|
||||||
|
void selectLine(ProdLineStatusDTO prodLineStatusDTO);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_linee_produzione.dto;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class ProdLineStatusDTO {
|
||||||
|
|
||||||
|
private String codJfas;
|
||||||
|
|
||||||
|
private String descrizione;
|
||||||
|
|
||||||
|
private String codMdepLav;
|
||||||
|
|
||||||
|
private Date datetimeStart;
|
||||||
|
|
||||||
|
private Date datetimeEnd;
|
||||||
|
|
||||||
|
private String codMart;
|
||||||
|
|
||||||
|
private String partitaMag;
|
||||||
|
|
||||||
|
private BigDecimal maxAllocazione;
|
||||||
|
|
||||||
|
private Integer qtaAllocate;
|
||||||
|
|
||||||
|
private String listaOrd;
|
||||||
|
|
||||||
|
private String descrizioneProd;
|
||||||
|
|
||||||
|
|
||||||
|
public String getCodJfas() {
|
||||||
|
return codJfas;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setCodJfas(String codJfas) {
|
||||||
|
this.codJfas = codJfas;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setDescrizione(String descrizione) {
|
||||||
|
this.descrizione = descrizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMdepLav() {
|
||||||
|
return codMdepLav;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setCodMdepLav(String codMdepLav) {
|
||||||
|
this.codMdepLav = codMdepLav;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDatetimeStart() {
|
||||||
|
return datetimeStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setDatetimeStart(Date datetimeStart) {
|
||||||
|
this.datetimeStart = datetimeStart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDatetimeEnd() {
|
||||||
|
return datetimeEnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setDatetimeEnd(Date datetimeEnd) {
|
||||||
|
this.datetimeEnd = datetimeEnd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getMaxAllocazione() {
|
||||||
|
return maxAllocazione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setMaxAllocazione(BigDecimal maxAllocazione) {
|
||||||
|
this.maxAllocazione = maxAllocazione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getQtaAllocate() {
|
||||||
|
return qtaAllocate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setQtaAllocate(Integer qtaAllocate) {
|
||||||
|
this.qtaAllocate = qtaAllocate;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getListaOrd() {
|
||||||
|
return listaOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setListaOrd(String listaOrd) {
|
||||||
|
this.listaOrd = listaOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isStarted() {
|
||||||
|
return datetimeStart != null && datetimeEnd == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isPaused() {
|
||||||
|
if (datetimeEnd == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Calendar today = Calendar.getInstance();
|
||||||
|
today.set(Calendar.MILLISECOND, 0);
|
||||||
|
today.set(Calendar.SECOND, 0);
|
||||||
|
today.set(Calendar.MINUTE, 0);
|
||||||
|
today.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
Calendar lastCloseTime = Calendar.getInstance();
|
||||||
|
lastCloseTime.setTime(datetimeEnd);
|
||||||
|
lastCloseTime.set(Calendar.MILLISECOND, 0);
|
||||||
|
lastCloseTime.set(Calendar.SECOND, 0);
|
||||||
|
lastCloseTime.set(Calendar.MINUTE, 0);
|
||||||
|
lastCloseTime.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
return datetimeStart != null && datetimeEnd != null && today.equals(lastCloseTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return codJfas + " - " + descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRisorseLabel() {
|
||||||
|
return qtaAllocate + (maxAllocazione != null && maxAllocazione.compareTo(BigDecimal.ZERO) > 0 ? "/" + maxAllocazione : "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMart() {
|
||||||
|
return codMart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setCodMart(String codMart) {
|
||||||
|
this.codMart = codMart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPartitaMag() {
|
||||||
|
return partitaMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setPartitaMag(String partitaMag) {
|
||||||
|
this.partitaMag = partitaMag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getDescrizioneProd() {
|
||||||
|
return descrizioneProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setDescrizioneProd(String descrizioneProd) {
|
||||||
|
this.descrizioneProd = descrizioneProd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_linee_produzione.ui;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.view.ExtendedRecyclerView;
|
||||||
|
import it.integry.integrywmsnative.databinding.FragmentLineeProdMainListModelBinding;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||||
|
|
||||||
|
public class LinesListAdapter extends ExtendedRecyclerView<ProdLineStatusDTO, LinesListAdapter.SingleItemViewHolder> {
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
private RunnableArgs<ProdLineStatusDTO> mOnItemClicked;
|
||||||
|
|
||||||
|
public LinesListAdapter(Context context, ObservableArrayList<ProdLineStatusDTO> myDataset) {
|
||||||
|
super(myDataset);
|
||||||
|
this.mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public LinesListAdapter.SingleItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
FragmentLineeProdMainListModelBinding binding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.fragment_linee_prod_main_list_model, parent, false);
|
||||||
|
return new LinesListAdapter.SingleItemViewHolder(binding);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull LinesListAdapter.SingleItemViewHolder holder, int position) {
|
||||||
|
final ProdLineStatusDTO line = mDataset.get(position);
|
||||||
|
|
||||||
|
holder.binding.setListModel(line);
|
||||||
|
holder.binding.executePendingBindings();
|
||||||
|
holder.binding.getRoot().setOnClickListener(v -> {
|
||||||
|
if (this.mOnItemClicked != null)
|
||||||
|
this.mOnItemClicked.run(line);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setOnItemClicked(RunnableArgs<ProdLineStatusDTO> onItemClicked) {
|
||||||
|
this.mOnItemClicked = onItemClicked;
|
||||||
|
}
|
||||||
|
|
||||||
|
static class SingleItemViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
FragmentLineeProdMainListModelBinding binding;
|
||||||
|
|
||||||
|
SingleItemViewHolder(FragmentLineeProdMainListModelBinding binding) {
|
||||||
|
super(binding.getRoot());
|
||||||
|
this.binding = binding;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -59,6 +59,8 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
private FragmentProdRecuperoMaterialeBinding mBinding;
|
private FragmentProdRecuperoMaterialeBinding mBinding;
|
||||||
|
|
||||||
private int barcodeScannerIstanceID = -1;
|
private int barcodeScannerIstanceID = -1;
|
||||||
|
private String codJfas;
|
||||||
|
private String fragmentResultKeyString;
|
||||||
|
|
||||||
private final ObservableArrayList<HistoryULsListModel> mHistoryULMutableData = new ObservableArrayList<>();
|
private final ObservableArrayList<HistoryULsListModel> mHistoryULMutableData = new ObservableArrayList<>();
|
||||||
|
|
||||||
@@ -67,10 +69,22 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static ProdRecuperoMaterialeFragment newInstance() {
|
public static ProdRecuperoMaterialeFragment newInstance() {
|
||||||
|
return newInstance(null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ProdRecuperoMaterialeFragment newInstance(String codJfas, String keyString) {
|
||||||
ProdRecuperoMaterialeFragment fragment = new ProdRecuperoMaterialeFragment();
|
ProdRecuperoMaterialeFragment fragment = new ProdRecuperoMaterialeFragment();
|
||||||
|
if (keyString != null) {
|
||||||
|
fragment.setFragmentResultKeyString(keyString);
|
||||||
|
}
|
||||||
|
fragment.setCodJfas(codJfas);
|
||||||
return fragment;
|
return fragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ProdRecuperoMaterialeFragment newInstance(String codJfas) {
|
||||||
|
return newInstance(codJfas, null);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
@@ -89,6 +103,14 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
this.initBarcodeReader();
|
this.initBarcodeReader();
|
||||||
this.initRecyclerView();
|
this.initRecyclerView();
|
||||||
|
|
||||||
|
this.addOnPreDestroy(() -> {
|
||||||
|
if (!UtilityString.isNullOrEmpty(fragmentResultKeyString)) {
|
||||||
|
Bundle result = new Bundle();
|
||||||
|
result.putString(fragmentResultKeyString, "result");
|
||||||
|
getParentFragmentManager().setFragmentResult(fragmentResultKeyString, result);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return mBinding.getRoot();
|
return mBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,8 +118,12 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
|
this.addOnPreDestroy(() -> {
|
||||||
mViewModel.init();
|
if (barcodeScannerIstanceID > -1) {
|
||||||
|
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mViewModel.init(codJfas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -115,10 +141,26 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
public String getCodJfas() {
|
||||||
BarcodeManager.disable();
|
return codJfas;
|
||||||
|
}
|
||||||
|
|
||||||
this.openProgress();
|
public ProdRecuperoMaterialeFragment setCodJfas(String codJfas) {
|
||||||
|
this.codJfas = codJfas;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFragmentResultKeyString() {
|
||||||
|
return fragmentResultKeyString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdRecuperoMaterialeFragment setFragmentResultKeyString(String fragmentResultKeyString) {
|
||||||
|
this.fragmentResultKeyString = fragmentResultKeyString;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data);
|
this.mViewModel.processBarcodeDTO(data);
|
||||||
};
|
};
|
||||||
@@ -135,7 +177,9 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
|
|
||||||
mBinding.prodRecuperoMaterialeMainList.setAdapter(adapter);
|
mBinding.prodRecuperoMaterialeMainList.setAdapter(adapter);
|
||||||
|
|
||||||
mToolbar.setRecyclerView(mBinding.prodRecuperoMaterialeMainList);
|
if (mToolbar != null)
|
||||||
|
mToolbar.setRecyclerView(mBinding.prodRecuperoMaterialeMainList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshList(List<HistoryVersamentoProdULDTO> filteredList) {
|
private void refreshList(List<HistoryVersamentoProdULDTO> filteredList) {
|
||||||
@@ -203,20 +247,22 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
.setCanOverflowOrderQuantity(canOverflowOrderQuantity)
|
.setCanOverflowOrderQuantity(canOverflowOrderQuantity)
|
||||||
.setCanLUBeClosed(canLUBeClosed);
|
.setCanLUBeClosed(canLUBeClosed);
|
||||||
|
|
||||||
mDialogInputQuantityV2View
|
if (!mDialogInputQuantityV2View.isVisible())
|
||||||
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
mDialogInputQuantityV2View
|
||||||
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||||
.setQtaCnf(resultDTO.getQtaCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
.setQtaTot(resultDTO.getQtaTot())
|
.setQtaCnf(resultDTO.getQtaCnf())
|
||||||
.setPartitaMag(resultDTO.getPartitaMag())
|
.setQtaTot(resultDTO.getQtaTot())
|
||||||
.setDataScad(resultDTO.getDataScad());
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
|
.setDataScad(resultDTO.getDataScad());
|
||||||
|
|
||||||
this.mViewModel.onItemDispatched(item, pickedQuantityDTO, sourceMtbColt);
|
this.mViewModel.onItemDispatched(item, pickedQuantityDTO, sourceMtbColt);
|
||||||
})
|
})
|
||||||
.setOnAbort(this::onLoadingEnded)
|
.setOnAbort(this::onLoadingEnded)
|
||||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
else this.onLoadingEnded();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -228,13 +274,13 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
DialogSimpleMessageView.makeErrorDialog(
|
DialogSimpleMessageView.makeErrorDialog(
|
||||||
new SpannableString(ex.getMessage()),
|
new SpannableString(ex.getMessage()),
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
R.string.button_ignore_print,
|
R.string.button_ignore_print,
|
||||||
onComplete)
|
onComplete)
|
||||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,11 +51,11 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
this.mPrinterRESTConsumer = printerRESTConsumer;
|
this.mPrinterRESTConsumer = printerRESTConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init() {
|
public void init(String codJfas) {
|
||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
|
|
||||||
mProdRecuperMaterialeRESTConsumer.loadLastULVersate(ulList -> {
|
mProdRecuperMaterialeRESTConsumer.loadLastULVersate(codJfas, ulList -> {
|
||||||
this.mUlList.setValue(ulList);
|
this.mUlList.setValue(ulList);
|
||||||
|
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
@@ -115,7 +115,10 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
qtaDaEvadere = qtaDaEvadere.add(item.getQtaCol());
|
qtaDaEvadere = qtaDaEvadere.add(item.getQtaCol());
|
||||||
|
|
||||||
if (!UtilityBigDecimal.equalsTo(qtaDaEvadere, BigDecimal.ZERO)) {
|
if (!UtilityBigDecimal.equalsTo(qtaDaEvadere, BigDecimal.ZERO)) {
|
||||||
numCnfDaEvadere = UtilityBigDecimal.divide(qtaDaEvadere, item.getQtaCnf());
|
|
||||||
|
if(item.getMtbAart().isFlagQtaCnfFissaBoolean())
|
||||||
|
numCnfDaEvadere = UtilityBigDecimal.divide(qtaDaEvadere, item.getQtaCnf());
|
||||||
|
else numCnfDaEvadere = item.getNumCnf();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.sendOnItemDispatched(item,
|
this.sendOnItemDispatched(item,
|
||||||
@@ -151,27 +154,64 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
BigDecimal totalSumOfQtaCol = BigDecimal.ZERO;
|
BigDecimal totalSumOfQtaCol = BigDecimal.ZERO;
|
||||||
BigDecimal totalSumOfNumCnf = BigDecimal.ZERO;
|
BigDecimal totalSumOfNumCnf = BigDecimal.ZERO;
|
||||||
|
|
||||||
for (HistoryVersamentoProdULDTO.OrdineDto ordine : item.getOrdini()) {
|
if (SettingsManager.iDB().isFlagVersamentoDirettoProduzione()) {
|
||||||
|
for (HistoryVersamentoProdULDTO.OrdineDto ordine : item.getOrdini()) {
|
||||||
|
|
||||||
|
BigDecimal qtaColToSave;
|
||||||
|
BigDecimal numCnfToSave;
|
||||||
|
|
||||||
|
if (SettingsManager.iDB().isFlagForceAllToColli() || (item.getMtbAart() != null && !item.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||||
|
numCnfToSave = UtilityBigDecimal.divideAndRoundToInteger(inputNumCnf.multiply(BigDecimal.valueOf(ordine.getPercentageHr())), BigDecimal.valueOf(100), RoundingMode.FLOOR);
|
||||||
|
qtaColToSave = numCnfToSave.multiply(inputQtaCnf).setScale(0, BigDecimal.ROUND_FLOOR);
|
||||||
|
} else {
|
||||||
|
qtaColToSave = UtilityBigDecimal.divideAndRoundToInteger(inputQtaTot.multiply(BigDecimal.valueOf(ordine.getPercentageHr())), BigDecimal.valueOf(100), RoundingMode.FLOOR);
|
||||||
|
numCnfToSave = UtilityBigDecimal.divide(qtaColToSave, item.getQtaCnf(), RoundingMode.FLOOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
totalSumOfQtaCol = totalSumOfQtaCol.add(qtaColToSave);
|
||||||
|
totalSumOfNumCnf = totalSumOfNumCnf.add(numCnfToSave);
|
||||||
|
|
||||||
|
numCnfToSave = numCnfToSave.multiply(BigDecimal.valueOf(-1));
|
||||||
|
qtaColToSave = qtaColToSave.multiply(BigDecimal.valueOf(-1));
|
||||||
|
|
||||||
|
|
||||||
|
final MtbColr mtbColrScarico = new MtbColr()
|
||||||
|
.setCodMart(item.getCodMart())
|
||||||
|
.setPartitaMag(UtilityString.empty2null(item.getPartitaMag()))
|
||||||
|
.setQtaCol(qtaColToSave)
|
||||||
|
.setQtaCnf(inputQtaCnf)
|
||||||
|
.setNumCnf(numCnfToSave)
|
||||||
|
.setDescrizione(UtilityString.isNullOrEmpty(item.getMtbAart().getDescrizioneEstesa()) ? item.getMtbAart().getDescrizione() : item.getMtbAart().getDescrizioneEstesa())
|
||||||
|
.setDatetimeRow(UtilityDate.getDateInstance())
|
||||||
|
.setNumColloRif(item.getNumColloRif())
|
||||||
|
.setDataColloRif(item.getDataColloRif())
|
||||||
|
.setGestioneRif(item.getGestioneRif())
|
||||||
|
.setSerColloRif(item.getSerColloRif())
|
||||||
|
.setDataOrd(ordine.getData())
|
||||||
|
.setNumOrd(ordine.getNumero())
|
||||||
|
.setRigaOrd(ordine.getRigaOrd());
|
||||||
|
|
||||||
|
mtbColrScarico.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
|
mtbColtScarico.getMtbColr().add(mtbColrScarico);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
BigDecimal qtaColToSave;
|
BigDecimal qtaColToSave;
|
||||||
BigDecimal numCnfToSave;
|
BigDecimal numCnfToSave;
|
||||||
|
|
||||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (item.getMtbAart() != null && !item.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
if (SettingsManager.iDB().isFlagForceAllToColli() || (item.getMtbAart() != null && !item.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||||
numCnfToSave = UtilityBigDecimal.divideAndRoundToInteger(inputNumCnf.multiply(BigDecimal.valueOf(ordine.getPercentageHr())), BigDecimal.valueOf(100), RoundingMode.FLOOR);
|
numCnfToSave = inputNumCnf;
|
||||||
qtaColToSave = numCnfToSave.multiply(inputQtaCnf).setScale(0, BigDecimal.ROUND_FLOOR);
|
qtaColToSave = numCnfToSave.multiply(inputQtaCnf).setScale(0, BigDecimal.ROUND_FLOOR);
|
||||||
} else {
|
} else {
|
||||||
qtaColToSave = UtilityBigDecimal.divideAndRoundToInteger(inputQtaTot.multiply(BigDecimal.valueOf(ordine.getPercentageHr())), BigDecimal.valueOf(100), RoundingMode.FLOOR);
|
qtaColToSave = inputQtaTot;
|
||||||
numCnfToSave = UtilityBigDecimal.divide(qtaColToSave, item.getQtaCnf(), RoundingMode.FLOOR);
|
numCnfToSave = UtilityBigDecimal.divide(qtaColToSave, item.getQtaCnf(), RoundingMode.FLOOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
totalSumOfQtaCol = qtaColToSave;
|
||||||
totalSumOfQtaCol = totalSumOfQtaCol.add(qtaColToSave);
|
totalSumOfNumCnf = numCnfToSave;
|
||||||
totalSumOfNumCnf = totalSumOfNumCnf.add(numCnfToSave);
|
|
||||||
|
|
||||||
numCnfToSave = numCnfToSave.multiply(BigDecimal.valueOf(-1));
|
numCnfToSave = numCnfToSave.multiply(BigDecimal.valueOf(-1));
|
||||||
qtaColToSave = qtaColToSave.multiply(BigDecimal.valueOf(-1));
|
qtaColToSave = qtaColToSave.multiply(BigDecimal.valueOf(-1));
|
||||||
|
|
||||||
|
|
||||||
final MtbColr mtbColrScarico = new MtbColr()
|
final MtbColr mtbColrScarico = new MtbColr()
|
||||||
.setCodMart(item.getCodMart())
|
.setCodMart(item.getCodMart())
|
||||||
.setPartitaMag(UtilityString.empty2null(item.getPartitaMag()))
|
.setPartitaMag(UtilityString.empty2null(item.getPartitaMag()))
|
||||||
@@ -183,10 +223,7 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
.setNumColloRif(item.getNumColloRif())
|
.setNumColloRif(item.getNumColloRif())
|
||||||
.setDataColloRif(item.getDataColloRif())
|
.setDataColloRif(item.getDataColloRif())
|
||||||
.setGestioneRif(item.getGestioneRif())
|
.setGestioneRif(item.getGestioneRif())
|
||||||
.setSerColloRif(item.getSerColloRif())
|
.setSerColloRif(item.getSerColloRif());
|
||||||
.setDataOrd(ordine.getData())
|
|
||||||
.setNumOrd(ordine.getNumero())
|
|
||||||
.setRigaOrd(ordine.getRigaOrd());
|
|
||||||
|
|
||||||
mtbColrScarico.setOperation(CommonModelConsts.OPERATION.INSERT);
|
mtbColrScarico.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
mtbColtScarico.getMtbColr().add(mtbColrScarico);
|
mtbColtScarico.getMtbColr().add(mtbColrScarico);
|
||||||
@@ -291,7 +328,6 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
|
|
||||||
private void singlePrint(MtbColt mtbColtToPrint, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
private void singlePrint(MtbColt mtbColtToPrint, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||||
this.mPrinterRESTConsumer.printCollo(
|
this.mPrinterRESTConsumer.printCollo(
|
||||||
PrinterRESTConsumer.Type.PRIMARIA,
|
|
||||||
mtbColtToPrint,
|
mtbColtToPrint,
|
||||||
onComplete, onAbort);
|
onComplete, onAbort);
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ import it.integry.integrywmsnative.core.model.MtbAart;
|
|||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULRestDTO;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULRestDTO;
|
||||||
|
|
||||||
@@ -32,6 +35,10 @@ public class ProdRecuperMaterialeRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
|
|
||||||
public void loadLastULVersate(RunnableArgs<List<HistoryVersamentoProdULDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void loadLastULVersate(RunnableArgs<List<HistoryVersamentoProdULDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
loadLastULVersate(null, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadLastULVersate(String codJfas, RunnableArgs<List<HistoryVersamentoProdULDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
String sql = "WITH ul_list AS ( " +
|
String sql = "WITH ul_list AS ( " +
|
||||||
" SELECT jtb_fasi.cod_jfas, " +
|
" SELECT jtb_fasi.cod_jfas, " +
|
||||||
@@ -68,7 +75,7 @@ public class ProdRecuperMaterialeRESTConsumer extends _BaseRESTConsumer {
|
|||||||
" AND mtb_colr.data_collo = mtb_colt.data_collo " +
|
" AND mtb_colr.data_collo = mtb_colt.data_collo " +
|
||||||
" AND mtb_colr.ser_collo = mtb_colt.ser_collo " +
|
" AND mtb_colr.ser_collo = mtb_colt.ser_collo " +
|
||||||
" AND mtb_colr.gestione = mtb_colt.gestione " +
|
" AND mtb_colr.gestione = mtb_colt.gestione " +
|
||||||
" INNER JOIN dtb_ord_steps ON dtb_ord_steps.data_ord = mtb_colr.data_ord " +
|
" " + (SettingsManager.iDB().isFlagVersamentoDirettoProduzione() ? "INNER" : "LEFT OUTER") + " join dtb_ord_steps ON dtb_ord_steps.data_ord = mtb_colr.data_ord " +
|
||||||
" AND dtb_ord_steps.gestione = mtb_colr.gestione " +
|
" AND dtb_ord_steps.gestione = mtb_colr.gestione " +
|
||||||
" AND dtb_ord_steps.num_ord = mtb_colr.num_ord " +
|
" AND dtb_ord_steps.num_ord = mtb_colr.num_ord " +
|
||||||
" AND dtb_ord_steps.data_iniz is not null " +
|
" AND dtb_ord_steps.data_iniz is not null " +
|
||||||
@@ -76,6 +83,7 @@ public class ProdRecuperMaterialeRESTConsumer extends _BaseRESTConsumer {
|
|||||||
" INNER JOIN mtb_aart ON mtb_colr.cod_mart = mtb_aart.cod_mart " +
|
" INNER JOIN mtb_aart ON mtb_colr.cod_mart = mtb_aart.cod_mart " +
|
||||||
" LEFT OUTER JOIN jtb_fasi ON mtb_colt.cod_jfas = jtb_fasi.cod_jfas " +
|
" LEFT OUTER JOIN jtb_fasi ON mtb_colt.cod_jfas = jtb_fasi.cod_jfas " +
|
||||||
" WHERE jtb_fasi.cod_jfas IS NOT NULL " +
|
" WHERE jtb_fasi.cod_jfas IS NOT NULL " +
|
||||||
|
(UtilityString.isNullOrEmpty(codJfas) ? "" : " AND jtb_fasi.cod_jfas = " + UtilityDB.valueToString(codJfas)) +
|
||||||
" AND segno = -1 " +
|
" AND segno = -1 " +
|
||||||
" AND mtb_colr.data_collo > DATEADD(DAY, -5, GETDATE()) " +
|
" AND mtb_colr.data_collo > DATEADD(DAY, -5, GETDATE()) " +
|
||||||
" GROUP BY jtb_fasi.cod_jfas, " +
|
" GROUP BY jtb_fasi.cod_jfas, " +
|
||||||
@@ -177,7 +185,8 @@ public class ProdRecuperMaterialeRESTConsumer extends _BaseRESTConsumer {
|
|||||||
" ISNULL(max_ul.hr, '') = ISNULL(ul_list.hr, '') AND " +
|
" ISNULL(max_ul.hr, '') = ISNULL(ul_list.hr, '') AND " +
|
||||||
" max_ul.max_datetime_row = ul_list.datetime_row";
|
" max_ul.max_datetime_row = ul_list.datetime_row";
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<HistoryVersamentoProdULRestDTO>>() {}.getType();
|
Type typeOfObjectsList = new TypeToken<ArrayList<HistoryVersamentoProdULRestDTO>>() {
|
||||||
|
}.getType();
|
||||||
this.mSystemRESTConsumer.<ArrayList<HistoryVersamentoProdULRestDTO>>processSql(sql, typeOfObjectsList, ulList -> {
|
this.mSystemRESTConsumer.<ArrayList<HistoryVersamentoProdULRestDTO>>processSql(sql, typeOfObjectsList, ulList -> {
|
||||||
|
|
||||||
if (ulList == null) {
|
if (ulList == null) {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.widget.AppCompatTextView;
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.databinding.ObservableField;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -19,7 +20,9 @@ import javax.inject.Inject;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.MainApplication;
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.ILifecycleFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
@@ -32,9 +35,18 @@ import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFrag
|
|||||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView;
|
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
public class ProdRientroMerceFragment extends BaseFragment implements ITitledFragment, IScrollableFragment, ProdRientroMerceViewModel.Listener, BottomSheetFragmentLUContentView.Listener, BottomSheetMtbColrEditView.Listener {
|
public class ProdRientroMerceFragment extends BaseFragment implements
|
||||||
|
ITitledFragment,
|
||||||
|
IScrollableFragment,
|
||||||
|
ILifecycleFragment,
|
||||||
|
ProdRientroMerceViewModel.Listener,
|
||||||
|
BottomSheetFragmentLUContentView.Listener,
|
||||||
|
BottomSheetMtbColrEditView.Listener,
|
||||||
|
ProdRientroMerceOrderListFragment.OnRefreshListener {
|
||||||
|
|
||||||
|
|
||||||
|
public final ObservableField<Boolean> isLargeLayout = new ObservableField<>(false);
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ProdRientroMerceViewModel mViewModel;
|
ProdRientroMerceViewModel mViewModel;
|
||||||
|
|
||||||
@@ -56,20 +68,47 @@ public class ProdRientroMerceFragment extends BaseFragment implements ITitledFra
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setRetainInstance(true);
|
setRetainInstance(true);
|
||||||
|
|
||||||
|
boolean isLargeLayout = getResources().getBoolean(R.bool.large_layout);
|
||||||
|
this.isLargeLayout.set(isLargeLayout);
|
||||||
|
|
||||||
mProdRientroMerceOrderListFragment = ProdRientroMerceOrderListFragment.newInstance(mToolbar);
|
mProdRientroMerceOrderListFragment = ProdRientroMerceOrderListFragment.newInstance(mToolbar);
|
||||||
mProdRientroMerceOrderDetailFragment = ProdRientroMerceOrderDetailFragment.newInstance();
|
mProdRientroMerceOrderDetailFragment = ProdRientroMerceOrderDetailFragment.newInstance();
|
||||||
|
|
||||||
mProdRientroMerceOrderListFragment.setOnItemSelectedRunnable(mProdRientroMerceOrderDetailFragment::setOrder);
|
|
||||||
|
|
||||||
|
mProdRientroMerceOrderListFragment
|
||||||
|
.setOnItemSelectedRunnable(order -> {
|
||||||
|
if (!isLargeLayout) {
|
||||||
|
getChildFragmentManager()
|
||||||
|
.beginTransaction()
|
||||||
|
.show(mProdRientroMerceOrderDetailFragment)
|
||||||
|
.addToBackStack(ProdRientroMerceOrderDetailFragment.class.getName())
|
||||||
|
.commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
mProdRientroMerceOrderDetailFragment.setOrder(order);
|
||||||
|
})
|
||||||
|
.setOnRefreshListener(this);
|
||||||
mProdRientroMerceOrderDetailFragment.setOnMtbColtClicked(item -> {
|
mProdRientroMerceOrderDetailFragment.setOnMtbColtClicked(item -> {
|
||||||
mBindings.bottomSheetMtbColrEdit.setMtbColr(item.getMtbColr().get(0));
|
mBindings.bottomSheetMtbColrEdit.setMtbColr(item.getMtbColr().get(0));
|
||||||
mBindings.bottomSheetMtbColrEdit.expand();
|
mBindings.bottomSheetMtbColrEdit.expand();
|
||||||
});
|
});
|
||||||
|
|
||||||
getChildFragmentManager()
|
if (isLargeLayout) {
|
||||||
.beginTransaction()
|
getChildFragmentManager()
|
||||||
.replace(R.id.order_list_fragment, mProdRientroMerceOrderListFragment)
|
.beginTransaction()
|
||||||
.replace(R.id.order_detail_fragment, mProdRientroMerceOrderDetailFragment)
|
.replace(R.id.left_side_fragment_container, mProdRientroMerceOrderListFragment)
|
||||||
.commit();
|
.replace(R.id.right_side_fragment_container, mProdRientroMerceOrderDetailFragment)
|
||||||
|
.commit();
|
||||||
|
} else {
|
||||||
|
getChildFragmentManager()
|
||||||
|
.beginTransaction()
|
||||||
|
.add(R.id.full_width_container, mProdRientroMerceOrderListFragment)
|
||||||
|
.add(R.id.full_width_container, mProdRientroMerceOrderDetailFragment)
|
||||||
|
.hide(mProdRientroMerceOrderDetailFragment)
|
||||||
|
.commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MainApplication.appComponent
|
MainApplication.appComponent
|
||||||
.prodRientroMerceComponent()
|
.prodRientroMerceComponent()
|
||||||
@@ -82,6 +121,8 @@ public class ProdRientroMerceFragment extends BaseFragment implements ITitledFra
|
|||||||
@Nullable Bundle savedInstanceState) {
|
@Nullable Bundle savedInstanceState) {
|
||||||
mBindings = DataBindingUtil.inflate(LayoutInflater.from(getActivity()), R.layout.fragment_prod_rientro_merce, container, false);
|
mBindings = DataBindingUtil.inflate(LayoutInflater.from(getActivity()), R.layout.fragment_prod_rientro_merce, container, false);
|
||||||
mBindings.setLifecycleOwner(this);
|
mBindings.setLifecycleOwner(this);
|
||||||
|
mBindings.setView(this);
|
||||||
|
mBindings.setViewmodel(mViewModel);
|
||||||
|
|
||||||
mViewModel.setListener(this);
|
mViewModel.setListener(this);
|
||||||
|
|
||||||
@@ -94,13 +135,13 @@ public class ProdRientroMerceFragment extends BaseFragment implements ITitledFra
|
|||||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||||
super.onActivityCreated(savedInstanceState);
|
super.onActivityCreated(savedInstanceState);
|
||||||
|
|
||||||
if(savedInstanceState == null) {
|
if (savedInstanceState == null) {
|
||||||
this.mViewModel.getOrdiniLavorazioneAperti().observe(this.getViewLifecycleOwner(), this::ordersUpdated);
|
this.mViewModel.getOrdiniLavorazioneAperti().observe(this.getViewLifecycleOwner(), this::ordersUpdated);
|
||||||
|
mViewModel.refreshOrderList();
|
||||||
mViewModel.init();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||||
mAppBarTitle = titleText;
|
mAppBarTitle = titleText;
|
||||||
@@ -117,10 +158,12 @@ public class ProdRientroMerceFragment extends BaseFragment implements ITitledFra
|
|||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
|
|
||||||
for (Runnable onPreDestroy :
|
for (Runnable onPreDestroy : mOnPreDestroyList) {
|
||||||
mOnPreDestroyList) {
|
|
||||||
onPreDestroy.run();
|
onPreDestroy.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mProdRientroMerceOrderDetailFragment.onDetach();
|
||||||
|
mProdRientroMerceOrderListFragment.onDetach();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -137,7 +180,6 @@ public class ProdRientroMerceFragment extends BaseFragment implements ITitledFra
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void initBottomSheet() {
|
private void initBottomSheet() {
|
||||||
mBindings.bottomSheetMtbColrEdit.setListener(this);
|
mBindings.bottomSheetMtbColrEdit.setListener(this);
|
||||||
mBindings.bottomSheetMtbColrEdit.disableEditButton();
|
mBindings.bottomSheetMtbColrEdit.disableEditButton();
|
||||||
@@ -155,7 +197,33 @@ public class ProdRientroMerceFragment extends BaseFragment implements ITitledFra
|
|||||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text),
|
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text),
|
||||||
null,
|
null,
|
||||||
() -> mProdRientroMerceOrderDetailFragment.deleteMtbColr(mtbColr),
|
() -> mProdRientroMerceOrderDetailFragment.deleteMtbColr(mtbColr),
|
||||||
() -> {}
|
() -> {
|
||||||
).show(getActivity().getSupportFragmentManager(), "tag");
|
}
|
||||||
|
).show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onOrderLoadingStarted() {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
this.mProdRientroMerceOrderListFragment.onOrderLoadingStarted();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onOrderLoadingEnded() {
|
||||||
|
BarcodeManager.enable();
|
||||||
|
this.mProdRientroMerceOrderListFragment.onOrderLoadingEnded();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRefresh() {
|
||||||
|
this.mViewModel.refreshOrderList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPreDestroy(Runnable onComplete) {
|
||||||
|
if(getChildFragmentManager().getBackStackEntryCount() > 0)
|
||||||
|
getChildFragmentManager().popBackStack();
|
||||||
|
|
||||||
|
else onComplete.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,9 +7,11 @@ import java.util.List;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.IOrdersLoadingListener;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||||
import it.integry.integrywmsnative.gest.picking_resi.exceptions.DocumentsLoadException;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.spedizione.exceptions.OrdersLoadException;
|
||||||
|
|
||||||
public class ProdRientroMerceViewModel {
|
public class ProdRientroMerceViewModel {
|
||||||
|
|
||||||
@@ -25,13 +27,13 @@ public class ProdRientroMerceViewModel {
|
|||||||
this.mMesRESTConsumer = mesRESTConsumer;
|
this.mMesRESTConsumer = mesRESTConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init() {
|
public void refreshOrderList() {
|
||||||
new Thread(this::sendOnLoadingStarted).start();
|
new Thread(this::sendOnOrdersLoadingStarted).start();
|
||||||
|
String codAnag = SettingsManager.iDB().getFilterFornitoreProd();
|
||||||
this.mMesRESTConsumer.getOrdiniLavorazione("I", null, ordiniLavorazioneList -> {
|
this.mMesRESTConsumer.getOrdiniLavorazione("I", null, codAnag, ordiniLavorazioneList -> {
|
||||||
this.mOrdiniLavorazioneAperti.postValue(ordiniLavorazioneList);
|
this.mOrdiniLavorazioneAperti.postValue(ordiniLavorazioneList);
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnOrdersLoadingEnded();
|
||||||
}, ex -> this.sendError(new DocumentsLoadException(ex)));
|
}, ex -> this.sendError(new OrdersLoadException(ex)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public MutableLiveData<List<OrdineLavorazioneDTO>> getOrdiniLavorazioneAperti() {
|
public MutableLiveData<List<OrdineLavorazioneDTO>> getOrdiniLavorazioneAperti() {
|
||||||
@@ -51,12 +53,20 @@ public class ProdRientroMerceViewModel {
|
|||||||
if (this.mListener != null) mListener.onLoadingEnded();
|
if (this.mListener != null) mListener.onLoadingEnded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendOnOrdersLoadingStarted() {
|
||||||
|
if (this.mListener != null) mListener.onOrderLoadingStarted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnOrdersLoadingEnded() {
|
||||||
|
if (this.mListener != null) mListener.onOrderLoadingEnded();
|
||||||
|
}
|
||||||
|
|
||||||
private void sendError(Exception ex) {
|
private void sendError(Exception ex) {
|
||||||
if (this.mListener != null) mListener.onError(ex);
|
if (this.mListener != null) mListener.onError(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public interface Listener extends ILoadingListener {
|
public interface Listener extends ILoadingListener, IOrdersLoadingListener {
|
||||||
|
|
||||||
void onDataSaved();
|
void onDataSaved();
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
package it.integry.integrywmsnative.gest.prod_rientro_merce.order_detail;
|
package it.integry.integrywmsnative.gest.prod_rientro_merce.order_detail;
|
||||||
|
|
||||||
|
import android.bluetooth.BluetoothDevice;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
@@ -12,10 +15,13 @@ import androidx.databinding.ObservableArrayList;
|
|||||||
import androidx.databinding.ObservableField;
|
import androidx.databinding.ObservableField;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
import androidx.preference.PreferenceManager;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.harrysoft.androidbluetoothserial.BluetoothManager;
|
||||||
|
import com.harrysoft.androidbluetoothserial.BluetoothSerialDevice;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -23,8 +29,11 @@ import java.util.List;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
import it.integry.integrywmsnative.MainApplication;
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.exception.BluetoothConnectionException;
|
||||||
import it.integry.integrywmsnative.core.expansion.AtomicBigDecimal;
|
import it.integry.integrywmsnative.core.expansion.AtomicBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
@@ -36,6 +45,7 @@ import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||||
import it.integry.integrywmsnative.databinding.FragmentProdRientroMerceOrderDetailBinding;
|
import it.integry.integrywmsnative.databinding.FragmentProdRientroMerceOrderDetailBinding;
|
||||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.settings.MainSettingsFragment;
|
||||||
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdDTO;
|
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdDTO;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdView;
|
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdView;
|
||||||
@@ -64,11 +74,16 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
|
|
||||||
private RunnableArgs<MtbColt> onMtbColtClicked;
|
private RunnableArgs<MtbColt> onMtbColtClicked;
|
||||||
|
|
||||||
|
private BluetoothManager bluetoothManager;
|
||||||
|
private BluetoothSerialDevice mConnectedBluetoothDevice;
|
||||||
|
|
||||||
|
|
||||||
public ObservableField<BigDecimal> sumLUNumber = new ObservableField<>(BigDecimal.ZERO);
|
public ObservableField<BigDecimal> sumLUNumber = new ObservableField<>(BigDecimal.ZERO);
|
||||||
public ObservableField<BigDecimal> sumColliNumber = new ObservableField<>(BigDecimal.ZERO);
|
public ObservableField<BigDecimal> sumColliNumber = new ObservableField<>(BigDecimal.ZERO);
|
||||||
public ObservableField<BigDecimal> sumNetKG = new ObservableField<>(BigDecimal.ZERO);
|
public ObservableField<BigDecimal> sumNetKG = new ObservableField<>(BigDecimal.ZERO);
|
||||||
public ObservableField<BigDecimal> sumGrossKG = new ObservableField<>(BigDecimal.ZERO);
|
public ObservableField<BigDecimal> sumGrossKG = new ObservableField<>(BigDecimal.ZERO);
|
||||||
|
public ObservableField<Integer> progress = new ObservableField<>(0);
|
||||||
|
public boolean isOrderColli = false;
|
||||||
|
|
||||||
public ProdRientroMerceOrderDetailFragment() {
|
public ProdRientroMerceOrderDetailFragment() {
|
||||||
// Required empty public constructor
|
// Required empty public constructor
|
||||||
@@ -100,20 +115,26 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
|
|
||||||
mViewModel.setListener(this);
|
mViewModel.setListener(this);
|
||||||
|
|
||||||
|
if (currentOrder.getValue() != null) {
|
||||||
|
refreshOrder();
|
||||||
|
isOrderColli = currentOrder.getValue().getQtaCnf().compareTo(BigDecimal.ONE) == 0;
|
||||||
|
}
|
||||||
this.mViewModel.mtbColtsOfOrder.observe(getViewLifecycleOwner(), this::refreshList);
|
this.mViewModel.mtbColtsOfOrder.observe(getViewLifecycleOwner(), this::refreshList);
|
||||||
|
|
||||||
this.initRecyclerView();
|
this.initRecyclerView();
|
||||||
|
this.initULScaleBluetoothConnection();
|
||||||
|
|
||||||
|
mBindings.executePendingBindings();
|
||||||
return mBindings.getRoot();
|
return mBindings.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initRecyclerView() {
|
private void initRecyclerView() {
|
||||||
mBindings.mainList.setNestedScrollingEnabled(false);
|
mBindings.mainList.setNestedScrollingEnabled(false);
|
||||||
mBindings.mainList.setHasFixedSize(true);
|
mBindings.mainList.setHasFixedSize(true);
|
||||||
mBindings.mainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
mBindings.mainList.setLayoutManager(new LinearLayoutManager(requireActivity()));
|
||||||
|
|
||||||
SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(getActivity(), SimpleDividerItemDecoration.VERTICAL);
|
SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(requireActivity(), SimpleDividerItemDecoration.VERTICAL);
|
||||||
itemDecorator.setDrawable(ContextCompat.getDrawable(getActivity(), R.drawable.divider));
|
itemDecorator.setDrawable(ContextCompat.getDrawable(requireActivity(), R.drawable.divider));
|
||||||
mBindings.mainList.addItemDecoration(itemDecorator);
|
mBindings.mainList.addItemDecoration(itemDecorator);
|
||||||
|
|
||||||
mAdapter = new ProdRientroMerceOrderDetailMtbColtListAdapter(new ObservableArrayList<>());
|
mAdapter = new ProdRientroMerceOrderDetailMtbColtListAdapter(new ObservableArrayList<>());
|
||||||
@@ -121,20 +142,66 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
|
|
||||||
mBindings.mainList.setAdapter(mAdapter);
|
mBindings.mainList.setAdapter(mAdapter);
|
||||||
mAdapter.setOnItemClickListener(item -> {
|
mAdapter.setOnItemClickListener(item -> {
|
||||||
if(this.onMtbColtClicked != null) this.onMtbColtClicked.run(item);
|
if (this.onMtbColtClicked != null) this.onMtbColtClicked.run(item);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOrder(OrdineLavorazioneDTO order) {
|
private void initULScaleBluetoothConnection() {
|
||||||
currentOrder.postValue(order);
|
bluetoothManager = BluetoothManager.getInstance();
|
||||||
mBindings.invalidateAll();
|
if (bluetoothManager == null) {
|
||||||
mAdapter.clearDataset();
|
// Bluetooth unavailable on this device :( tell the user
|
||||||
|
Toast.makeText(requireActivity(), "Bluetooth not available.", Toast.LENGTH_LONG).show(); // Replace context with your context instance.
|
||||||
|
|
||||||
mViewModel.setOrder(order);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext());
|
||||||
|
var btMacAddress = sharedPreferences.getString(MainSettingsFragment.KEY_PALLET_BT_DEVICE, null);
|
||||||
|
|
||||||
|
if (btMacAddress == null) {
|
||||||
|
Toast.makeText(requireActivity(), "Nessun dispositivo BLUETOOTH configurato nelle impostazioni.", Toast.LENGTH_LONG).show(); // Replace context with your context instance.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var btName = Stream.of(bluetoothManager.getPairedDevicesList())
|
||||||
|
.filter(x -> x.getAddress().equalsIgnoreCase(btMacAddress))
|
||||||
|
.map(BluetoothDevice::getName)
|
||||||
|
.findFirstOrElse(null);
|
||||||
|
|
||||||
|
var disposableBluetooth = bluetoothManager.openSerialDevice(btMacAddress)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(this::onConnected, x -> this.onError(new BluetoothConnectionException(btName, btMacAddress, x)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onConnected(BluetoothSerialDevice connectedDevice) {
|
||||||
|
Toast.makeText(requireActivity(), "Connesso a: " + connectedDevice.getMac(), Toast.LENGTH_LONG).show();
|
||||||
|
mConnectedBluetoothDevice = connectedDevice;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDetach() {
|
||||||
|
if (mConnectedBluetoothDevice != null)
|
||||||
|
bluetoothManager.close();
|
||||||
|
|
||||||
|
super.onDetach();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrder(OrdineLavorazioneDTO order) {
|
||||||
|
currentOrder.setValue(order);
|
||||||
|
|
||||||
|
refreshOrder();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshOrder() {
|
||||||
|
if (mBindings != null) mBindings.invalidateAll();
|
||||||
|
if (mAdapter != null) mAdapter.clearDataset();
|
||||||
|
if (mViewModel != null) mViewModel.setOrder(currentOrder.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshList(List<MtbColt> mtbColts) {
|
private void refreshList(List<MtbColt> mtbColts) {
|
||||||
if(mtbColts != null) {
|
if (mtbColts != null) {
|
||||||
sumLUNumber.set(new BigDecimal(mtbColts.size()));
|
sumLUNumber.set(new BigDecimal(mtbColts.size()));
|
||||||
|
|
||||||
AtomicBigDecimal sumColli = new AtomicBigDecimal(BigDecimal.ZERO);
|
AtomicBigDecimal sumColli = new AtomicBigDecimal(BigDecimal.ZERO);
|
||||||
@@ -149,6 +216,7 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
}));
|
}));
|
||||||
sumColliNumber.set(sumColli.get());
|
sumColliNumber.set(sumColli.get());
|
||||||
sumGrossKG.set(sumGross.get());
|
sumGrossKG.set(sumGross.get());
|
||||||
|
progress.set(currentOrder.getValue().getProgress());
|
||||||
sumNetKG.set(sumNet.get());
|
sumNetKG.set(sumNet.get());
|
||||||
} else {
|
} else {
|
||||||
sumLUNumber.set(BigDecimal.ZERO);
|
sumLUNumber.set(BigDecimal.ZERO);
|
||||||
@@ -167,7 +235,7 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
|
|
||||||
|
|
||||||
public void addULButtonClick() {
|
public void addULButtonClick() {
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
String codProd = this.currentOrder.getValue().getCodProd();
|
String codProd = this.currentOrder.getValue().getCodProd();
|
||||||
mArticoloRESTConsumer.getByCodMart(codProd, mtbAart -> {
|
mArticoloRESTConsumer.getByCodMart(codProd, mtbAart -> {
|
||||||
@@ -186,9 +254,10 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
" AND (data_fine IS NULL OR last_step = id_step) " +
|
" AND (data_fine IS NULL OR last_step = id_step) " +
|
||||||
"ORDER BY id_step DESC";
|
"ORDER BY id_step DESC";
|
||||||
|
|
||||||
mSystemRESTConsumer.<List<DtbOrdSteps>>processSql(sql, new TypeToken<ArrayList<DtbOrdSteps>>() {}.getType(), dtbOrdStep -> {
|
mSystemRESTConsumer.<List<DtbOrdSteps>>processSql(sql, new TypeToken<ArrayList<DtbOrdSteps>>() {
|
||||||
|
}.getType(), dtbOrdStep -> {
|
||||||
|
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
|
|
||||||
DialogInputLUProdDTO dialogInputLUProdDTO = new DialogInputLUProdDTO()
|
DialogInputLUProdDTO dialogInputLUProdDTO = new DialogInputLUProdDTO()
|
||||||
.setMtbAart(mtbAart)
|
.setMtbAart(mtbAart)
|
||||||
@@ -203,7 +272,7 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
|
|
||||||
|
|
||||||
DialogInputLUProdView
|
DialogInputLUProdView
|
||||||
.newInstance(dialogInputLUProdDTO, resultDTO -> {
|
.newInstance(mConnectedBluetoothDevice != null ? mConnectedBluetoothDevice.toSimpleDeviceInterface() : null, dialogInputLUProdDTO, resultDTO -> {
|
||||||
ProdRientroMerceOrderDetailPickedQuantityDTO pickedQuantityDTO = new ProdRientroMerceOrderDetailPickedQuantityDTO()
|
ProdRientroMerceOrderDetailPickedQuantityDTO pickedQuantityDTO = new ProdRientroMerceOrderDetailPickedQuantityDTO()
|
||||||
.setNumCnf(resultDTO.getNumCnf())
|
.setNumCnf(resultDTO.getNumCnf())
|
||||||
.setPesoCollo(resultDTO.getPesoCollo())
|
.setPesoCollo(resultDTO.getPesoCollo())
|
||||||
@@ -216,9 +285,9 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
|
|
||||||
this.mViewModel.createLU(pickedQuantityDTO);
|
this.mViewModel.createLU(pickedQuantityDTO);
|
||||||
}, () -> {
|
}, () -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
})
|
})
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
|
||||||
}, this::onError);
|
}, this::onError);
|
||||||
|
|
||||||
@@ -248,63 +317,59 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
if (currentOrder.getValue() != null) {
|
if (currentOrder.getValue() != null) {
|
||||||
switch (currentOrder.getValue().getStatoEnum()) {
|
switch (currentOrder.getValue().getStatoEnum()) {
|
||||||
case IN_CORSO:
|
case IN_CORSO:
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.ic_play_circle_filled_24dp);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.ic_play_circle_filled_24dp);
|
||||||
case PAUSA:
|
case PAUSA:
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.ic_pause_circle_filled_24dp);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.ic_pause_circle_filled_24dp);
|
||||||
case PROGRAMMATO:
|
case PROGRAMMATO:
|
||||||
default:
|
default:
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.ic_clock_circle_outline_24dp);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.ic_clock_circle_outline_24dp);
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.ic_clock_circle_outline_24dp);
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.ic_clock_circle_outline_24dp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getOrderStatusIconTintColor() {
|
public Integer getOrderStatusIconTintColor() {
|
||||||
if (currentOrder.getValue() != null) {
|
if (currentOrder.getValue() != null) {
|
||||||
switch (currentOrder.getValue().getStatoEnum()) {
|
switch (currentOrder.getValue().getStatoEnum()) {
|
||||||
case IN_CORSO:
|
case IN_CORSO:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.green_800);
|
return ContextCompat.getColor(requireActivity(), R.color.green_800);
|
||||||
case PAUSA:
|
case PAUSA:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.yellow_800);
|
return ContextCompat.getColor(requireActivity(), R.color.yellow_800);
|
||||||
case PROGRAMMATO:
|
case PROGRAMMATO:
|
||||||
default:
|
default:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.blue_800);
|
return ContextCompat.getColor(requireActivity(), R.color.blue_800);
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
return ContextCompat.getColor(requireActivity(), R.color.blue_800);
|
||||||
return ContextCompat.getColor(getActivity(), R.color.blue_800);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Drawable getOrderStatusLabelBackgroud() {
|
public Drawable getOrderStatusLabelBackgroud() {
|
||||||
if (currentOrder.getValue() != null) {
|
if (currentOrder.getValue() != null) {
|
||||||
switch (currentOrder.getValue().getStatoEnum()) {
|
switch (currentOrder.getValue().getStatoEnum()) {
|
||||||
case IN_CORSO:
|
case IN_CORSO:
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.label_success_text);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.label_success_text);
|
||||||
case PAUSA:
|
case PAUSA:
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.label_warning_text);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.label_warning_text);
|
||||||
case PROGRAMMATO:
|
case PROGRAMMATO:
|
||||||
default:
|
default:
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.label_primary_text);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.label_primary_text);
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.label_primary_text);
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.label_primary_text);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getOrderStatusLabelTextColor() {
|
public Integer getOrderStatusLabelTextColor() {
|
||||||
if (currentOrder.getValue() != null) {
|
if (currentOrder.getValue() != null) {
|
||||||
switch (currentOrder.getValue().getStatoEnum()) {
|
switch (currentOrder.getValue().getStatoEnum()) {
|
||||||
case IN_CORSO:
|
case IN_CORSO:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.green_800);
|
return ContextCompat.getColor(requireActivity(), R.color.green_800);
|
||||||
case PAUSA:
|
case PAUSA:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.yellow_800);
|
return ContextCompat.getColor(requireActivity(), R.color.yellow_800);
|
||||||
case PROGRAMMATO:
|
case PROGRAMMATO:
|
||||||
default:
|
default:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.blue_800);
|
return ContextCompat.getColor(requireActivity(), R.color.blue_800);
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
return ContextCompat.getColor(requireActivity(), R.color.blue_800);
|
||||||
return ContextCompat.getColor(getActivity(), R.color.blue_800);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,7 @@ public class ProdRientroMerceOrderDetailViewModel {
|
|||||||
.setCodJcom(currentOrder.getCodJcom())
|
.setCodJcom(currentOrder.getCodJcom())
|
||||||
.setCodJfas(pickedQuantityDTO.getJtbFasi() != null ? pickedQuantityDTO.getJtbFasi().getCodJfas() : null)
|
.setCodJfas(pickedQuantityDTO.getJtbFasi() != null ? pickedQuantityDTO.getJtbFasi().getCodJfas() : null)
|
||||||
.setCodMart(currentOrder.getCodProd())
|
.setCodMart(currentOrder.getCodProd())
|
||||||
.setCodTcol(pickedQuantityDTO.getMtbTCol().getCodTcol())
|
.setCodTcol(pickedQuantityDTO.getMtbTCol() != null ? pickedQuantityDTO.getMtbTCol().getCodTcol() : null)
|
||||||
.setDataCollo(new Date())
|
.setDataCollo(new Date())
|
||||||
.setDataOrd(currentOrder.getDataOrdD())
|
.setDataOrd(currentOrder.getDataOrdD())
|
||||||
.setNumOrd(currentOrder.getNumOrd())
|
.setNumOrd(currentOrder.getNumOrd())
|
||||||
|
|||||||
@@ -129,15 +129,18 @@ public class ProdRientroMerceOrderListAdapter extends SectionedRecyclerViewAdapt
|
|||||||
case START:
|
case START:
|
||||||
holder.mBinding.ordineStateIcon.setImageResource(R.drawable.ic_play_circle_filled_24dp);
|
holder.mBinding.ordineStateIcon.setImageResource(R.drawable.ic_play_circle_filled_24dp);
|
||||||
holder.mBinding.ordineStateIcon.setColorFilter(ContextCompat.getColor(mContext, R.color.green_800), android.graphics.PorterDuff.Mode.SRC_IN);
|
holder.mBinding.ordineStateIcon.setColorFilter(ContextCompat.getColor(mContext, R.color.green_800), android.graphics.PorterDuff.Mode.SRC_IN);
|
||||||
|
holder.mBinding.orderProgress.setVisibility(View.VISIBLE);
|
||||||
break;
|
break;
|
||||||
case PAUSE:
|
case PAUSE:
|
||||||
holder.mBinding.ordineStateIcon.setImageResource(R.drawable.ic_pause_circle_filled_24dp);
|
holder.mBinding.ordineStateIcon.setImageResource(R.drawable.ic_pause_circle_filled_24dp);
|
||||||
holder.mBinding.ordineStateIcon.setColorFilter(ContextCompat.getColor(mContext, R.color.yellow_800), android.graphics.PorterDuff.Mode.SRC_IN);
|
holder.mBinding.ordineStateIcon.setColorFilter(ContextCompat.getColor(mContext, R.color.yellow_800), android.graphics.PorterDuff.Mode.SRC_IN);
|
||||||
|
holder.mBinding.orderProgress.setVisibility(View.VISIBLE);
|
||||||
break;
|
break;
|
||||||
case SCHEDULED:
|
case SCHEDULED:
|
||||||
default:
|
default:
|
||||||
holder.mBinding.ordineStateIcon.setImageResource(R.drawable.ic_clock_circle_outline_24dp);
|
holder.mBinding.ordineStateIcon.setImageResource(R.drawable.ic_clock_circle_outline_24dp);
|
||||||
holder.mBinding.ordineStateIcon.setColorFilter(ContextCompat.getColor(mContext, R.color.blue_700), android.graphics.PorterDuff.Mode.SRC_IN);
|
holder.mBinding.ordineStateIcon.setColorFilter(ContextCompat.getColor(mContext, R.color.blue_700), android.graphics.PorterDuff.Mode.SRC_IN);
|
||||||
|
holder.mBinding.orderProgress.setVisibility(View.GONE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,6 +169,8 @@ public class ProdRientroMerceOrderListAdapter extends SectionedRecyclerViewAdapt
|
|||||||
holder.mBinding.rightSubDescrizione.setVisibility(View.VISIBLE);
|
holder.mBinding.rightSubDescrizione.setVisibility(View.VISIBLE);
|
||||||
} else holder.mBinding.rightSubDescrizione.setVisibility(View.GONE);
|
} else holder.mBinding.rightSubDescrizione.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
holder.mBinding.orderProgress.setProgress(listModel.getProgress());
|
||||||
|
|
||||||
holder.mBinding.executePendingBindings();
|
holder.mBinding.executePendingBindings();
|
||||||
|
|
||||||
holder.mBinding.getRoot().setOnClickListener(v -> {
|
holder.mBinding.getRoot().setOnClickListener(v -> {
|
||||||
|
|||||||
@@ -36,12 +36,10 @@ import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
|||||||
public class ProdRientroMerceOrderListFragment extends Fragment {
|
public class ProdRientroMerceOrderListFragment extends Fragment {
|
||||||
|
|
||||||
private final ObservableArrayList<ProdRientroMerceOrderListModel> mOrdiniApertiMutableData = new ObservableArrayList<>();
|
private final ObservableArrayList<ProdRientroMerceOrderListModel> mOrdiniApertiMutableData = new ObservableArrayList<>();
|
||||||
|
|
||||||
private FragmentProdRientroMerceOrderListBinding mBindings = null;
|
private FragmentProdRientroMerceOrderListBinding mBindings = null;
|
||||||
|
|
||||||
private RunnableArgs<OrdineLavorazioneDTO> mOnItemSelectedRunnable;
|
private RunnableArgs<OrdineLavorazioneDTO> mOnItemSelectedRunnable;
|
||||||
|
|
||||||
private ElevatedToolbar mToolbar;
|
private ElevatedToolbar mToolbar;
|
||||||
|
private OnRefreshListener onRefreshListener;
|
||||||
|
|
||||||
public ProdRientroMerceOrderListFragment() {
|
public ProdRientroMerceOrderListFragment() {
|
||||||
// Required empty public constructor
|
// Required empty public constructor
|
||||||
@@ -72,7 +70,7 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
|||||||
|
|
||||||
mBindings.setLifecycleOwner(this);
|
mBindings.setLifecycleOwner(this);
|
||||||
|
|
||||||
if(savedInstanceState == null) this.initRecyclerView();
|
if (savedInstanceState == null) this.initRecyclerView();
|
||||||
|
|
||||||
return mBindings.getRoot();
|
return mBindings.getRoot();
|
||||||
}
|
}
|
||||||
@@ -86,13 +84,18 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
|||||||
ProdRientroMerceOrderListAdapter prodRientroMerceOrderListAdapter = new ProdRientroMerceOrderListAdapter(getActivity(), mOrdiniApertiMutableData)
|
ProdRientroMerceOrderListAdapter prodRientroMerceOrderListAdapter = new ProdRientroMerceOrderListAdapter(getActivity(), mOrdiniApertiMutableData)
|
||||||
.setEmptyView(this.mBindings.emptyView)
|
.setEmptyView(this.mBindings.emptyView)
|
||||||
.setOnItemChecked(x -> {
|
.setOnItemChecked(x -> {
|
||||||
if(mOnItemSelectedRunnable != null) mOnItemSelectedRunnable.run(x.getOriginalModel());
|
if (mOnItemSelectedRunnable != null)
|
||||||
|
mOnItemSelectedRunnable.run(x.getOriginalModel());
|
||||||
});
|
});
|
||||||
|
|
||||||
this.mBindings.mainList.setAdapter(prodRientroMerceOrderListAdapter);
|
this.mBindings.mainList.setAdapter(prodRientroMerceOrderListAdapter);
|
||||||
this.mBindings.mainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
this.mBindings.mainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
|
|
||||||
this.mToolbar.setRecyclerView(mBindings.mainList);
|
this.mToolbar.setRecyclerView(mBindings.mainList);
|
||||||
|
|
||||||
|
this.mBindings.swiperefresh.setOnRefreshListener(() -> {
|
||||||
|
if (onRefreshListener != null) onRefreshListener.onRefresh();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void pushOrderList(List<OrdineLavorazioneDTO> orderList) {
|
public void pushOrderList(List<OrdineLavorazioneDTO> orderList) {
|
||||||
@@ -101,6 +104,14 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onOrderLoadingStarted() {
|
||||||
|
this.mBindings.swiperefresh.setRefreshing(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onOrderLoadingEnded() {
|
||||||
|
this.mBindings.swiperefresh.setRefreshing(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private List<ProdRientroMerceOrderListModel> convertDataModelToListModel(List<OrdineLavorazioneDTO> dataList) {
|
private List<ProdRientroMerceOrderListModel> convertDataModelToListModel(List<OrdineLavorazioneDTO> dataList) {
|
||||||
|
|
||||||
@@ -109,7 +120,7 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
|||||||
.thenComparing(ComparatorCompat.comparing(ordineLavorazioneDTO -> ordineLavorazioneDTO.getDataOrd() != null ? ordineLavorazioneDTO.getDataOrd() : "zzzzzzzz")).reversed()
|
.thenComparing(ComparatorCompat.comparing(ordineLavorazioneDTO -> ordineLavorazioneDTO.getDataOrd() != null ? ordineLavorazioneDTO.getDataOrd() : "zzzzzzzz")).reversed()
|
||||||
.thenComparing(ComparatorCompat.comparing(OrdineLavorazioneDTO::getNumOrd));
|
.thenComparing(ComparatorCompat.comparing(OrdineLavorazioneDTO::getNumOrd));
|
||||||
|
|
||||||
if(dataList == null) return new ArrayList<>();
|
if (dataList == null) return new ArrayList<>();
|
||||||
|
|
||||||
List<ProdRientroMerceOrderListModel> notHiddenElements = Stream.of(dataList)
|
List<ProdRientroMerceOrderListModel> notHiddenElements = Stream.of(dataList)
|
||||||
.sorted(comparator)
|
.sorted(comparator)
|
||||||
@@ -131,8 +142,12 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
|||||||
|
|
||||||
listModel.setGroupTitle(x.getCodJfas());
|
listModel.setGroupTitle(x.getCodJfas());
|
||||||
|
|
||||||
if(!UtilityString.isNullOrEmpty(x.getRagSocAnag()))
|
if (!UtilityString.isNullOrEmpty(x.getDataConsCommessa())) {
|
||||||
listModel.setPreDescription("Provenienza: " + x.getRagSocAnag());
|
listModel.setPreDescription("Consegna: " + UtilityDate.formatDate(x.getDataConsCommessaD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||||
|
} else {
|
||||||
|
/* if (!UtilityString.isNullOrEmpty(x.getRagSocAnag()))
|
||||||
|
listModel.setPreDescription("Provenienza: " + x.getRagSocAnag());*/
|
||||||
|
}
|
||||||
|
|
||||||
String testataOrdString = "N° " + x.getNumOrd();
|
String testataOrdString = "N° " + x.getNumOrd();
|
||||||
listModel.setDescription(testataOrdString);
|
listModel.setDescription(testataOrdString);
|
||||||
@@ -141,11 +156,13 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
|||||||
|
|
||||||
listModel.setRightDescription(x.getCodJcom() != null ? (x.getDescCommessa() + " (" + x.getCodJcom() + ")") : "");
|
listModel.setRightDescription(x.getCodJcom() != null ? (x.getDescCommessa() + " (" + x.getCodJcom() + ")") : "");
|
||||||
|
|
||||||
try {
|
listModel.setProgress(x.getProgress());
|
||||||
|
listModel.setRightSubDescription(x.getNumCnf().stripTrailingZeros().toPlainString() + " COL");
|
||||||
|
/*try {
|
||||||
listModel.setRightSubDescription(UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
listModel.setRightSubDescription(UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
listModel.setOriginalModel(x);
|
listModel.setOriginalModel(x);
|
||||||
|
|
||||||
@@ -164,4 +181,13 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
|||||||
public RecyclerView getList() {
|
public RecyclerView getList() {
|
||||||
return mBindings.mainList;
|
return mBindings.mainList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ProdRientroMerceOrderListFragment setOnRefreshListener(OnRefreshListener onRefreshListener) {
|
||||||
|
this.onRefreshListener = onRefreshListener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnRefreshListener {
|
||||||
|
void onRefresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@ public class ProdRientroMerceOrderListModel implements Cloneable {
|
|||||||
private String subDescription;
|
private String subDescription;
|
||||||
private String rightDescription;
|
private String rightDescription;
|
||||||
private String rightSubDescription;
|
private String rightSubDescription;
|
||||||
|
private int progress;
|
||||||
|
|
||||||
private boolean hidden;
|
private boolean hidden;
|
||||||
|
|
||||||
@@ -105,4 +106,13 @@ public class ProdRientroMerceOrderListModel implements Cloneable {
|
|||||||
START,
|
START,
|
||||||
SCHEDULED
|
SCHEDULED
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getProgress() {
|
||||||
|
return progress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdRientroMerceOrderListModel setProgress(int progress) {
|
||||||
|
this.progress = progress;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ public class ProdVersamentoMaterialeFragment extends BaseFragment implements Pro
|
|||||||
@Override
|
@Override
|
||||||
public void onWarning(String warningText, Runnable action) {
|
public void onWarning(String warningText, Runnable action) {
|
||||||
this.requireActivity().runOnUiThread(() -> {
|
this.requireActivity().runOnUiThread(() -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
DialogSimpleMessageView
|
DialogSimpleMessageView
|
||||||
.makeWarningDialog(new SpannableString(Html.fromHtml(warningText)), null, action)
|
.makeWarningDialog(new SpannableString(Html.fromHtml(warningText)), null, action)
|
||||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.gest.prod_versamento_materiale.dto;
|
package it.integry.integrywmsnative.gest.prod_versamento_materiale.dto;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.di.BindableFloat;
|
import it.integry.integrywmsnative.core.di.BindableFloat;
|
||||||
@@ -50,6 +51,7 @@ public class OrdineLavorazioneDTO {
|
|||||||
|
|
||||||
private String dataScad;
|
private String dataScad;
|
||||||
|
|
||||||
|
|
||||||
private String partitaMagSuggested;
|
private String partitaMagSuggested;
|
||||||
|
|
||||||
private String dataScadSuggested;
|
private String dataScadSuggested;
|
||||||
@@ -90,6 +92,8 @@ public class OrdineLavorazioneDTO {
|
|||||||
|
|
||||||
private String descCommessa;
|
private String descCommessa;
|
||||||
|
|
||||||
|
private String dataConsCommessa;
|
||||||
|
|
||||||
private BigDecimal prodStd;
|
private BigDecimal prodStd;
|
||||||
|
|
||||||
private Object mtbColtToEdit;
|
private Object mtbColtToEdit;
|
||||||
@@ -135,6 +139,7 @@ public class OrdineLavorazioneDTO {
|
|||||||
public String getDataOrd() {
|
public String getDataOrd() {
|
||||||
return dataOrd;
|
return dataOrd;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getDataOrdD() {
|
public Date getDataOrdD() {
|
||||||
return UtilityDate.recognizeDateWithExceptionHandler(dataOrd);
|
return UtilityDate.recognizeDateWithExceptionHandler(dataOrd);
|
||||||
}
|
}
|
||||||
@@ -490,4 +495,32 @@ public class OrdineLavorazioneDTO {
|
|||||||
public OrdineLavorazioneStatoEnum getStatoEnum() {
|
public OrdineLavorazioneStatoEnum getStatoEnum() {
|
||||||
return OrdineLavorazioneStatoEnum.fromString(getStato());
|
return OrdineLavorazioneStatoEnum.fromString(getStato());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDataConsCommessa() {
|
||||||
|
return dataConsCommessa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataConsCommessaD() {
|
||||||
|
return UtilityDate.recognizeDateWithExceptionHandler(getDataConsCommessa());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataConsCommessa(String dataConsCommessa) {
|
||||||
|
this.dataConsCommessa = dataConsCommessa;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getProgress() {
|
||||||
|
|
||||||
|
int progress = 0;
|
||||||
|
if (this.getQtaProd().compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
if (this.getQtaTrasferite().compareTo(this.getQtaProd()) > 0) {
|
||||||
|
progress = 100;
|
||||||
|
} else {
|
||||||
|
progress = this.getQtaTrasferite().multiply(BigDecimal.valueOf(100)).divide(this.getQtaProd(), 0, RoundingMode.UP).intValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return progress;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,8 +108,9 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity implements PVOrdi
|
|||||||
mBinding.closeActivityFab.close(false);
|
mBinding.closeActivityFab.close(false);
|
||||||
mBinding.scanArtSpinner.setVisibility(articoli.size() > 0 ? View.GONE : View.VISIBLE);
|
mBinding.scanArtSpinner.setVisibility(articoli.size() > 0 ? View.GONE : View.VISIBLE);
|
||||||
|
|
||||||
if (articoli.isEmpty() && isOrderNewProdsForced()) {
|
if (mOrdine.isOrderNewProducts() && articoli.isEmpty() && isOrderNewProdsForced()) {
|
||||||
this.mViewModel.orderNewProducts();
|
this.mViewModel.orderNewProducts();
|
||||||
|
mOrdine.setOrderNewProducts(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user