Compare commits
141 Commits
v1.25.4(28
...
v1.29.5(30
| Author | SHA1 | Date | |
|---|---|---|---|
| ca04b87a8e | |||
| 10ab47a1b7 | |||
| fdaa2b7f21 | |||
| e9b179ca7f | |||
| 04d811af93 | |||
| cb2421f263 | |||
| 16a565fc51 | |||
| f68691df6b | |||
| f4f7f4a6f0 | |||
| b129bb51c6 | |||
| 8c80918521 | |||
| e8dea4cef0 | |||
| b51bf1d9cb | |||
| 3c25e223ab | |||
| 16d9f2f6ff | |||
| fd3dfb9afe | |||
| 2916d2b5d0 | |||
| dac12905ef | |||
| bf56c8e4c7 | |||
| 7272e3e541 | |||
| 020c99e700 | |||
| 12a9610e7a | |||
| 0e6f4a7892 | |||
| f8c0852cb7 | |||
| ee48e7e2a4 | |||
| 821099c037 | |||
| 9a6211fc46 | |||
| ee8abe3ea8 | |||
| 654a9e0161 | |||
| 076c84c119 | |||
| 6fa80a5485 | |||
| e0ea6b17a1 | |||
| 60978167c2 | |||
| 6a848e081a | |||
| 2960d0d4b4 | |||
| 6b01861a26 | |||
| 5889942ff9 | |||
| 0359ddcc90 | |||
| 8409507dab | |||
| 208653223c | |||
| 62f6e12a86 | |||
| b662929c19 | |||
| 40895eac2f | |||
| dc7e90b2fe | |||
| 5d1f275ebc | |||
| 79192ce337 | |||
| 7f0f6c969a | |||
| e23beddf65 | |||
| 1fd51a4097 | |||
| 5ea124bcf6 | |||
| fa6ab9f58f | |||
| f7806103fb | |||
| 87acc5a4e3 | |||
| 7c49af085d | |||
| 0c3d5bd0f1 | |||
| 37d956bb5c | |||
| fef564b090 | |||
| d1c491ee80 | |||
| 0cd8a3b41f | |||
| f7e4a3d005 | |||
| a22ecb9620 | |||
| 57c22b617e | |||
| 84876bf7c1 | |||
| 2718f0ff2b | |||
| 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 |
16
.idea/deploymentTargetDropDown.xml
generated
16
.idea/deploymentTargetDropDown.xml
generated
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<runningDeviceTargetsSelectedWithDialog>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="SERIAL_NUMBER" />
|
||||
<value value="20119B1E55" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</runningDeviceTargetsSelectedWithDialog>
|
||||
</component>
|
||||
</project>
|
||||
@@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 281
|
||||
def appVersionName = '1.25.4'
|
||||
def appVersionCode = 309
|
||||
def appVersionName = '1.29.5'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -31,12 +31,12 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
compileSdkVersion 31
|
||||
compileSdkVersion 32
|
||||
|
||||
defaultConfig {
|
||||
applicationId "it.integry.integrywmsnative"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 31
|
||||
targetSdkVersion 32
|
||||
versionCode appVersionCode
|
||||
versionName appVersionName
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
@@ -83,6 +83,7 @@ android {
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
namespace 'it.integry.integrywmsnative'
|
||||
|
||||
|
||||
}
|
||||
@@ -103,28 +104,32 @@ dependencies {
|
||||
implementation 'com.google.firebase:firebase-core'
|
||||
implementation 'com.google.firebase:firebase-crashlytics'
|
||||
implementation 'com.google.firebase:firebase-perf'
|
||||
implementation 'com.google.android.gms:play-services-basement:18.0.0'
|
||||
implementation 'com.google.android.gms:play-services-basement:18.1.0'
|
||||
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||
implementation 'androidx.appcompat:appcompat:1.5.1'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.android.material:material:1.5.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||
implementation 'com.google.android.material:material:1.6.1'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||
implementation 'androidx.preference:preference-ktx:1.2.0'
|
||||
|
||||
implementation('androidx.preference:preference-ktx:1.2.0') {
|
||||
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel'
|
||||
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
|
||||
}
|
||||
|
||||
implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0"
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||
implementation 'com.annimon:stream:1.2.2'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-common-java8:2.4.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
|
||||
// implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||
implementation 'org.apache.commons:commons-text:1.9'
|
||||
|
||||
//MVVM
|
||||
def dagger2_version = '2.40'
|
||||
def dagger2_version = '2.40.1'
|
||||
api "com.google.dagger:dagger:$dagger2_version"
|
||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
||||
api "com.google.dagger:dagger-android:$dagger2_version"
|
||||
@@ -143,7 +148,7 @@ dependencies {
|
||||
implementation 'com.github.pedromassango:doubleClick:3.0'
|
||||
|
||||
//SQLite ROOM
|
||||
def room_version = "2.4.1"
|
||||
def room_version = "2.4.3"
|
||||
|
||||
implementation "androidx.room:room-runtime:$room_version"
|
||||
annotationProcessor "androidx.room:room-compiler:$room_version"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="it.integry.integrywmsnative">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
@@ -27,11 +26,18 @@
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light"
|
||||
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:theme="@style/Light"
|
||||
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:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing" />
|
||||
|
||||
@@ -41,10 +41,14 @@ import it.integry.integrywmsnative.gest.picking_resi.PickingResiComponent;
|
||||
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.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.ProdFabbisognoLineeProdModule;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaModule;
|
||||
import it.integry.integrywmsnative.gest.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.ProdRecuperoMaterialeModule;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceComponent;
|
||||
@@ -61,6 +65,8 @@ import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeComp
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeModule;
|
||||
import it.integry.integrywmsnative.gest.spedizione.SpedizioneComponent;
|
||||
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.DialogRowInfoProdFabbisognoLineeProdModule;
|
||||
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.UltimeConsegneClienteComponent;
|
||||
@@ -80,6 +86,8 @@ import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdC
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2Component;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2Module;
|
||||
import it.integry.integrywmsnative.view.dialogs.printSsccUl.DialogPrintUlSSCCComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.printSsccUl.DialogPrintUlSSCCModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUComponent;
|
||||
@@ -128,7 +136,11 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
DocInterniEditFormModule.class,
|
||||
DialogSelectDocRowsModule.class,
|
||||
DialogAskClienteModule.class,
|
||||
DialogEditArticoloModule.class
|
||||
DialogEditArticoloModule.class,
|
||||
DialogPrintOrderSSCCListModule.class,
|
||||
ProdLineeProduzioneModule.class,
|
||||
ProdDettaglioLineaModule.class,
|
||||
DialogPrintUlSSCCModule.class
|
||||
})
|
||||
public interface MainApplicationComponent {
|
||||
|
||||
@@ -216,6 +228,14 @@ public interface MainApplicationComponent {
|
||||
|
||||
DialogEditArticoloComponent.Factory dialogEditArticoloComponent();
|
||||
|
||||
DialogPrintOrderSSCCListComponent.Factory dialogPrintOrderSSCCListComponent();
|
||||
|
||||
ProdLineeProduzioneComponent.Factory prodLineeProduzioneComponent();
|
||||
|
||||
ProdDettaglioLineaComponent.Factory prodDettaglioLineaComponent();
|
||||
|
||||
DialogPrintUlSSCCComponent.Factory dialogPrintUlSSCCComponent();
|
||||
|
||||
void inject(MainApplication mainApplication);
|
||||
|
||||
void inject(AppContext mainApplication);
|
||||
|
||||
@@ -17,6 +17,7 @@ import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.CommessaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.DocumentiRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.EntityRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
||||
@@ -25,6 +26,7 @@ import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
||||
import it.integry.integrywmsnative.core.update.UpdatesManager;
|
||||
@@ -200,4 +202,16 @@ public class MainApplicationModule {
|
||||
return new InventarioService(giacenzaRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ProductionLinesRESTConsumer provideProductionLinesRESTConsumer() {
|
||||
return new ProductionLinesRESTConsumer();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
DocumentiRESTConsumer provideDocumentiRESTConsumer() {
|
||||
return new DocumentiRESTConsumer();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
package it.integry.integrywmsnative.core.barcode_reader;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.util.Pair;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.barcode_base_android_library.interfaces.BarcodeReaderInterface;
|
||||
import it.integry.barcode_base_android_library.model.BarcodeSetting;
|
||||
import it.integry.honeywellscannerlibrary.HoneyWellBarcodeReader;
|
||||
import it.integry.integrywmsnative.gest.settings.MainSettingsFragment;
|
||||
import it.integry.keyobardemulatorscannerlibrary.KeyboardEmulatorBarcodeReader;
|
||||
import it.integry.pointmobilescannerlibrary.PointMobileBarcodeReader;
|
||||
import it.integry.zebrascannerlibrary.ZebraBarcodeReader;
|
||||
@@ -21,12 +27,7 @@ public class BarcodeManager {
|
||||
private static boolean mEnabled = true;
|
||||
|
||||
|
||||
private static final Class<? extends BarcodeReaderInterface>[] registeredBarcodeReaderInterfaces = new Class[]{
|
||||
PointMobileBarcodeReader.class,
|
||||
ZebraBarcodeReader.class,
|
||||
HoneyWellBarcodeReader.class,
|
||||
KeyboardEmulatorBarcodeReader.class
|
||||
};
|
||||
private static final Class<? extends BarcodeReaderInterface>[] registeredBarcodeReaderInterfaces = new Class[]{PointMobileBarcodeReader.class, ZebraBarcodeReader.class, HoneyWellBarcodeReader.class, KeyboardEmulatorBarcodeReader.class};
|
||||
|
||||
|
||||
public static void init(Context applicationContext) throws Exception {
|
||||
@@ -65,6 +66,18 @@ public class BarcodeManager {
|
||||
}
|
||||
});
|
||||
|
||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(applicationContext);
|
||||
var additionalSettings = new ArrayList<Pair<String, Object>>();
|
||||
var scanDelay = sharedPreferences.getString(MainSettingsFragment.KEY_TRIGGER_SCAN_DELAY, null);
|
||||
var scanDelaySetting = new Pair<String, Object>(BarcodeSetting.P_TRIGGER_SCAN_DELAY, scanDelay);
|
||||
additionalSettings.add(scanDelaySetting);
|
||||
|
||||
var scanMode = sharedPreferences.getString(MainSettingsFragment.KEY_TRIGGER_SCAN_MODE, null);
|
||||
var scanModeSetting = new Pair<String, Object>(BarcodeSetting.P_TRIGGER_SCAN_MODE, scanMode);
|
||||
additionalSettings.add(scanModeSetting);
|
||||
|
||||
BarcodeManager.changeSettings(additionalSettings);
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -81,8 +94,7 @@ public class BarcodeManager {
|
||||
}
|
||||
|
||||
public static boolean onKeyDown(int keyCode, KeyEvent keyEvent) {
|
||||
if (mCurrentBarcodeInterface != null)
|
||||
mCurrentBarcodeInterface.onKeyEvent(keyEvent);
|
||||
if (mCurrentBarcodeInterface != null) mCurrentBarcodeInterface.onKeyEvent(keyEvent);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -133,6 +145,9 @@ public class BarcodeManager {
|
||||
return mEnabled;
|
||||
}
|
||||
|
||||
public static void changeSettings(List<Pair<String, Object>> settings) {
|
||||
mCurrentBarcodeInterface.changeSettings(settings);
|
||||
}
|
||||
|
||||
public static boolean isKeyboardEmulator() {
|
||||
return mCurrentBarcodeInterface instanceof KeyboardEmulatorBarcodeReader;
|
||||
|
||||
@@ -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.prod_accettazione_ord_produzione.ProdOrdineProduzioneElencoFragment;
|
||||
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_rientro_merce.ProdRientroMerceFragment;
|
||||
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)
|
||||
.setFragmentFactory(UltimiArriviFornitoreFragment::newInstance))
|
||||
).addGroup(
|
||||
new MenuGroup()
|
||||
.setGroupText(R.string.checkout)
|
||||
.setGroupId(R.id.nav_group_spedizione)
|
||||
.setCodMenu("MM010")
|
||||
new MenuGroup()
|
||||
.setGroupText(R.string.checkout)
|
||||
.setGroupId(R.id.nav_group_spedizione)
|
||||
.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()
|
||||
.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)))
|
||||
.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_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)))
|
||||
.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_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()
|
||||
.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")
|
||||
.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_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))
|
||||
.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_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)
|
||||
.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()
|
||||
.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))
|
||||
.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()
|
||||
.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))
|
||||
.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))
|
||||
|
||||
.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()
|
||||
// .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)
|
||||
// .setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_trasmitted_orders_list)
|
||||
// .setFragmentClass(PVOrdiniAcquistoTransmittedListFragment.newInstance()))
|
||||
);
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class MainContext {
|
||||
try {
|
||||
BarcodeManager.init(applicationContext);
|
||||
} catch (Exception exception) {
|
||||
|
||||
exception.printStackTrace();
|
||||
}
|
||||
|
||||
this.initDBData(() -> {
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.UUID;
|
||||
|
||||
public class DataCache {
|
||||
|
||||
private static List<DataCacheDTO> dataCacheList = new ArrayList<>();
|
||||
private static final List<DataCacheDTO> dataCacheList = new ArrayList<>();
|
||||
|
||||
|
||||
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.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({
|
||||
DateConverter.class,
|
||||
BigDecimalConverter.class
|
||||
|
||||
@@ -53,6 +53,6 @@ public interface ArticoloGrigliaDao {
|
||||
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId")
|
||||
List<ArticoloGriglia> getArticoliFromGriglia(int grigliaId);
|
||||
|
||||
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId AND new_no_promo = 1")
|
||||
@Query("SELECT * FROM articoli_griglia WHERE id_griglia = :grigliaId AND qta_ord >= 1")
|
||||
List<ArticoloGriglia> getNewArticoliInGriglia(int grigliaId);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,10 @@ import androidx.room.ForeignKey;
|
||||
import androidx.room.Index;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
|
||||
@@ -68,6 +71,9 @@ public class ArticoloGriglia {
|
||||
@ColumnInfo(name = "qta_proposta")
|
||||
private float qtaProposta;
|
||||
|
||||
@ColumnInfo(name = "qta_ord")
|
||||
private float qtaOrd;
|
||||
|
||||
@ColumnInfo(name = "id_griglia")
|
||||
private int idGriglia;
|
||||
|
||||
@@ -202,6 +208,22 @@ public class ArticoloGriglia {
|
||||
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) {
|
||||
ArticoloOrdine articolo = new ArticoloOrdine();
|
||||
|
||||
@@ -222,8 +244,8 @@ public class ArticoloGriglia {
|
||||
articolo.setQtaPrevistaVendita(BigDecimal.valueOf(this.getQtaPrevistaVendita()));
|
||||
articolo.setQtaProposta(BigDecimal.valueOf(this.getQtaProposta()));
|
||||
articolo.setNewNoPromo(this.isNewNoPromo());
|
||||
|
||||
articolo.setQtaOrd(0);
|
||||
articolo.setSystemNote(generateSystemNote());
|
||||
articolo.setQtaOrd(this.getQtaOrd());
|
||||
|
||||
return articolo;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,9 @@ public class ArticoloOrdine {
|
||||
@ColumnInfo(name = "new_no_promo")
|
||||
private boolean newNoPromo;
|
||||
|
||||
@ColumnInfo(name = "system_note")
|
||||
private String systemNote;
|
||||
|
||||
@Ignore
|
||||
private int ggScadenza = 0;
|
||||
|
||||
@@ -266,4 +269,12 @@ public class ArticoloOrdine {
|
||||
this.bgTint = bgTint;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSystemNote() {
|
||||
return systemNote;
|
||||
}
|
||||
|
||||
public void setSystemNote(String systemNote) {
|
||||
this.systemNote = systemNote;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,9 @@ public class Ordine {
|
||||
@Ignore
|
||||
private int countArticoli = 0;
|
||||
|
||||
@Ignore
|
||||
private boolean orderNewProducts = false;
|
||||
|
||||
@ColumnInfo(name = "id_griglia")
|
||||
private int idGriglia;
|
||||
|
||||
@@ -149,4 +152,13 @@ public class Ordine {
|
||||
public void setDataOrdS(String 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 qtaPrevistaVendita;
|
||||
private float qtaProposta;
|
||||
private float qtaOrd;
|
||||
|
||||
|
||||
public String getCodMart() {
|
||||
@@ -151,6 +152,15 @@ public class ArticoloDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public float getQtaOrd() {
|
||||
return qtaOrd;
|
||||
}
|
||||
|
||||
public ArticoloDTO setQtaOrd(float qtaOrd) {
|
||||
this.qtaOrd = qtaOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArticoloGriglia toArticoloGriglia() {
|
||||
ArticoloGriglia result = new ArticoloGriglia();
|
||||
result.setBarCode(this.getBarCode());
|
||||
@@ -164,6 +174,7 @@ public class ArticoloDTO {
|
||||
result.setQtaMinOrdinabile(this.getQtaMinOrdinabile());
|
||||
result.setGgScadenza(this.ggScadenza);
|
||||
result.setNewNoPromo(this.newNoPromo);
|
||||
result.setQtaOrd(this.getQtaOrd());
|
||||
result.setGiacenza(this.giacenza);
|
||||
result.setQtaPrevistaVendita(this.qtaPrevistaVendita);
|
||||
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;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public final class EmptyLUException extends Exception {
|
||||
public EmptyLUException() {
|
||||
super(UtilityResources.getString(R.string.empty_lu));
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@ import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public final class NoArtsFoundException extends Exception {
|
||||
public NoArtsFoundException() {
|
||||
super(UtilityResources.getString(R.string.no_result_from_barcode));
|
||||
super(UtilityResources.getString(R.string.no_arts_found));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class BaseActivity extends AppCompatActivity {
|
||||
public void onError(Exception ex) {
|
||||
this.runOnUiThread(() -> {
|
||||
this.closeProgress();
|
||||
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
||||
UtilityExceptions.defaultException(this, ex);
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ public class BaseDialogFragment extends DialogFragment {
|
||||
private boolean mBarcodeListener = false;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void show(FragmentManager manager, String tag) {
|
||||
try {
|
||||
|
||||
@@ -84,7 +84,7 @@ public abstract class BaseFragment extends Fragment {
|
||||
public void onError(Exception ex) {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.closeProgress();
|
||||
UtilityExceptions.defaultException(getActivity(), ex, mCurrentProgress);
|
||||
UtilityExceptions.defaultException(getActivity(), ex);
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
}
|
||||
@@ -99,9 +99,17 @@ public abstract class BaseFragment extends Fragment {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean onBackPressed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void popMe() {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
((IPoppableActivity) requireActivity()).pop();
|
||||
});
|
||||
if (requireActivity() instanceof IPoppableActivity) {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
((IPoppableActivity) requireActivity()).pop();
|
||||
});
|
||||
} else {
|
||||
requireActivity().getSupportFragmentManager().popBackStack();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,13 +21,13 @@ public abstract class ExtendedSectionedRecyclerView<T, SH extends RecyclerView.V
|
||||
public ExtendedSectionedRecyclerView(ObservableArrayList<T> myDataset) {
|
||||
mDataset.addAll(myDataset);
|
||||
|
||||
myDataset.addOnListChangedCallback(new OnListGeneralChangedCallback() {
|
||||
myDataset.addOnListChangedCallback(new OnListGeneralChangedCallback<T>() {
|
||||
@Override
|
||||
public void onChanged(ObservableList sender) {
|
||||
public void onChanged(ObservableList<T> sender) {
|
||||
mDataset.clear();
|
||||
mDataset.addAll(sender);
|
||||
notifyDataSetChanged();
|
||||
notifyDataChanged();
|
||||
notifyDataSetChanged();
|
||||
checkIfEmpty();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package it.integry.integrywmsnative.core.interfaces.viewmodel_listeners;
|
||||
|
||||
public interface IOrdersLoadingListener {
|
||||
|
||||
void onOrderLoadingStarted();
|
||||
|
||||
void onOrderLoadingEnded();
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -88,6 +88,11 @@ public class MtbAart extends EntityBase {
|
||||
private String marchio;
|
||||
private Integer sezione;
|
||||
private UntMisRifPesoEnum untMisRifPeso;
|
||||
|
||||
private BigDecimal qtaEsistente;
|
||||
private BigDecimal qtaImpegnata;
|
||||
private BigDecimal numCnfEsistente;
|
||||
private BigDecimal numCnfImpegnata;
|
||||
|
||||
private List<MtbUntMis> mtbUntMis;
|
||||
|
||||
@@ -819,4 +824,40 @@ public class MtbAart extends EntityBase {
|
||||
this.untMisRifPeso = untMisRifPeso;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaEsistente() {
|
||||
return qtaEsistente;
|
||||
}
|
||||
|
||||
public MtbAart setQtaEsistente(BigDecimal qtaEsistente) {
|
||||
this.qtaEsistente = qtaEsistente;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaImpegnata() {
|
||||
return qtaImpegnata;
|
||||
}
|
||||
|
||||
public MtbAart setQtaImpegnata(BigDecimal qtaImpegnata) {
|
||||
this.qtaImpegnata = qtaImpegnata;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getNumCnfEsistente() {
|
||||
return numCnfEsistente;
|
||||
}
|
||||
|
||||
public MtbAart setNumCnfEsistente(BigDecimal numCnfEsistente) {
|
||||
this.numCnfEsistente = numCnfEsistente;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getNumCnfImpegnata() {
|
||||
return numCnfImpegnata;
|
||||
}
|
||||
|
||||
public MtbAart setNumCnfImpegnata(BigDecimal numCnfImpegnata) {
|
||||
this.numCnfImpegnata = numCnfImpegnata;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
package it.integry.integrywmsnative.core.model.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class StatoArticoloDTO {
|
||||
private String codMart;
|
||||
|
||||
private String partitaMag;
|
||||
|
||||
private Date dataScad;
|
||||
|
||||
private Integer ggScadPartita;
|
||||
|
||||
private Integer ggMax;
|
||||
|
||||
private Integer ggScadEffettivi;
|
||||
|
||||
private Integer ggUtili;
|
||||
|
||||
private Integer statoArt;
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public StatoArticoloDTO setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public StatoArticoloDTO setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataScad() {
|
||||
return dataScad;
|
||||
}
|
||||
|
||||
public StatoArticoloDTO setDataScad(Date dataScad) {
|
||||
this.dataScad = dataScad;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getGgScadPartita() {
|
||||
return ggScadPartita;
|
||||
}
|
||||
|
||||
public StatoArticoloDTO setGgScadPartita(Integer ggScadPartita) {
|
||||
this.ggScadPartita = ggScadPartita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getGgMax() {
|
||||
return ggMax;
|
||||
}
|
||||
|
||||
public StatoArticoloDTO setGgMax(Integer ggMax) {
|
||||
this.ggMax = ggMax;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getGgScadEffettivi() {
|
||||
return ggScadEffettivi;
|
||||
}
|
||||
|
||||
public StatoArticoloDTO setGgScadEffettivi(Integer ggScadEffettivi) {
|
||||
this.ggScadEffettivi = ggScadEffettivi;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getGgUtili() {
|
||||
return ggUtili;
|
||||
}
|
||||
|
||||
public StatoArticoloDTO setGgUtili(Integer ggUtili) {
|
||||
this.ggUtili = ggUtili;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getStatoArt() {
|
||||
return statoArt;
|
||||
}
|
||||
|
||||
public StatoArticoloDTO setStatoArt(Integer statoArt) {
|
||||
this.statoArt = statoArt;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package it.integry.integrywmsnative.core.model.secondary;
|
||||
|
||||
public enum StatoPartitaMag {
|
||||
|
||||
IN_SCADENZA(1),
|
||||
SCADUTO(2),
|
||||
NON_IN_SCADENZA(3);
|
||||
|
||||
private final int text;
|
||||
|
||||
StatoPartitaMag(int text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public int getText() {
|
||||
return this.text;
|
||||
}
|
||||
|
||||
public static StatoPartitaMag from(int text) {
|
||||
for (StatoPartitaMag b : StatoPartitaMag.values()) {
|
||||
if (b.text == text) return b;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,8 +26,6 @@ public class CommonRESTException {
|
||||
put(MESSAGE_KEY, "Barcode non letto correttamente");
|
||||
put(EXCEPTION_KEY, NoResultFromBarcodeException.class);
|
||||
}});
|
||||
|
||||
|
||||
}};
|
||||
|
||||
|
||||
|
||||
@@ -28,11 +28,11 @@ public class RESTBuilder {
|
||||
}
|
||||
|
||||
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors) {
|
||||
return getService(service, host, port, addInterceptors, true, 30);
|
||||
return getService(service, host, port, addInterceptors, true, 60);
|
||||
}
|
||||
|
||||
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors, boolean addEmsApi) {
|
||||
return getService(service, host, port, addInterceptors, addEmsApi, 30);
|
||||
return getService(service, host, port, addInterceptors, addEmsApi, 60);
|
||||
}
|
||||
|
||||
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors, boolean addEmsApi, int timeout) {
|
||||
|
||||
@@ -14,6 +14,7 @@ import javax.inject.Singleton;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||
import it.integry.integrywmsnative.core.model.dto.StatoArticoloDTO;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||
@@ -32,11 +33,13 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public void getByBarcodeProd(String barcodeProd, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
articoloRESTConsumerService.getByBarcodeProd(barcodeProd).enqueue(new Callback<ServiceRESTResponse<MtbAart>>() {
|
||||
articoloRESTConsumerService.getByBarcodeProd(barcodeProd).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||
analyzeAnswer(response, "getByBarcodeProd", (m) -> {
|
||||
onComplete.run(response.body().getEntityList());
|
||||
List<MtbAart> aartList = response.body().getEntityList();
|
||||
aartList = aartList != null ? Stream.of(aartList).filter(x -> x.getFlagStato().equalsIgnoreCase("A")).toList() : null;
|
||||
onComplete.run(aartList);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@@ -59,7 +62,7 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
articoloRESTConsumer.getByCodMart(joinedCods).enqueue(new Callback<ServiceRESTResponse<MtbAart>>() {
|
||||
articoloRESTConsumer.getByCodMart(joinedCods).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||
analyzeAnswer(response, "getByCodMart", (m) -> {
|
||||
@@ -75,11 +78,28 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
}
|
||||
|
||||
public void getStatoPartita(String codMart, String partitaMag, RunnableArgs<List<StatoArticoloDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
articoloRESTConsumer.getStatoPartita(codMart, partitaMag).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<StatoArticoloDTO>>> call, Response<ServiceRESTResponse<List<StatoArticoloDTO>>> response) {
|
||||
analyzeAnswer(response, "getStatoPartita", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<List<StatoArticoloDTO>>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void getByCodMart(String codMartToFind, RunnableArgs<MtbAart> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
articoloRESTConsumer.getByCodMart(codMartToFind).enqueue(new Callback<ServiceRESTResponse<MtbAart>>() {
|
||||
articoloRESTConsumer.getByCodMart(codMartToFind).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||
analyzeAnswer(response, "getByCodMart", (m) -> {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.dto.StatoArticoloDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
@@ -16,4 +19,7 @@ public interface ArticoloRESTConsumerService {
|
||||
@GET("SM2getArticoloByCodMart")
|
||||
Call<ServiceRESTResponse<MtbAart>> getByCodMart(@Query("codMart") String barcodeProd);
|
||||
|
||||
@GET("getProductLotStatus")
|
||||
Call<ServiceRESTResponse<List<StatoArticoloDTO>>> getStatoPartita(@Query("codMart") String codMart, @Query("partitaMag") String partitaMag);
|
||||
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public void getBySSCC(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
|
||||
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||
analyzeAnswer(response, "GetBySSCC", mtbColt -> {
|
||||
@@ -700,4 +700,29 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
public void loadShipmentUlFromProductionUL(MtbColt mtbColt, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
params.put("mtb_colr.gestione_rif", mtbColt.getGestione());
|
||||
params.put("mtb_colr.ser_collo_rif", mtbColt.getSerCollo());
|
||||
params.put("mtb_colr.num_collo_rif", mtbColt.getNumCollo());
|
||||
params.put("mtb_colr.data_collo_rif", mtbColt.getDataColloD());
|
||||
|
||||
String whereCond = UtilityQuery.concatFieldsInWhereCond(params);
|
||||
|
||||
|
||||
String query = "select distinct mtb_colt.*\n" +
|
||||
"from mtb_colt\n" +
|
||||
" left join mtb_colr on mtb_colt.gestione = mtb_colr.gestione and mtb_colt.data_collo = mtb_colr.data_collo and\n" +
|
||||
" mtb_colt.ser_collo = mtb_colr.ser_collo and mtb_colt.num_collo = mtb_colr.num_collo\n" +
|
||||
"where mtb_colt.gestione = 'V'" +
|
||||
" AND " + whereCond;
|
||||
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {
|
||||
}.getType();
|
||||
this.mSystemRESTConsumer.<ArrayList<MtbColt>>processSql(query, typeOfObjectsList, data -> {
|
||||
onComplete.run(data.get(0));
|
||||
}, onFailed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.DtbDoct;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.LoadColliDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
@Singleton
|
||||
public class DocumentiRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
public void createDocsFromColli(List<LoadColliDTO> listColli, RunnableArgs<List<DtbDoct>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
DocumentiRESTConsumerService documentiRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
||||
documentiRESTConsumerService.createDocsFromColli(listColli).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<DtbDoct>>> call, Response<ServiceRESTResponse<List<DtbDoct>>> response) {
|
||||
analyzeAnswer(response, "createDocsFromColli", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<List<DtbDoct>>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void createDocFromColli(LoadColliDTO loadColliDTO, RunnableArgs<DtbDoct> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
DocumentiRESTConsumerService documentiRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
||||
documentiRESTConsumerService.createDocFromColli(loadColliDTO).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<DtbDoct>> call, Response<ServiceRESTResponse<DtbDoct>> response) {
|
||||
analyzeAnswer(response, "createDocFromColli", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<DtbDoct>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.DtbDoct;
|
||||
import it.integry.integrywmsnative.core.rest.model.LoadColliDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface DocumentiRESTConsumerService {
|
||||
|
||||
@POST("getDatiColliForDocs")
|
||||
Call<ServiceRESTResponse<List<DtbDoct>>> createDocsFromColli(@Body List<LoadColliDTO> listColli);
|
||||
|
||||
@POST("createDocFromColli")
|
||||
Call<ServiceRESTResponse<DtbDoct>> createDocFromColli(@Body LoadColliDTO listColli);
|
||||
|
||||
}
|
||||
@@ -6,11 +6,11 @@ import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.StbGestSetup;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.GestSetupDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
@@ -35,18 +35,18 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
||||
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
|
||||
Log.e("GestSetup", t.toString());
|
||||
// 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) {
|
||||
getValueStatic(gestName, sectionName, keySection, value -> {
|
||||
if(value != null){
|
||||
if (value != null) {
|
||||
onComplete.run("S".equalsIgnoreCase(value.value));
|
||||
} else onComplete.run(false);
|
||||
}, 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) {
|
||||
Log.e("PrintCollo", t.toString());
|
||||
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) {
|
||||
getValueStatic(gestName, sectionName, keySection, codMdep, value -> {
|
||||
if(value != null){
|
||||
if (value != null) {
|
||||
onComplete.run("S".equalsIgnoreCase(value.value));
|
||||
} else onComplete.run(false);
|
||||
}, 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);
|
||||
service.getGestSetupValues(stbGestSetupList).enqueue(new Callback<ServiceRESTResponse<List<StbGestSetup>>>() {
|
||||
service.getGestSetupValues(codMdep, stbGestSetupList).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Response<ServiceRESTResponse<List<StbGestSetup>>> response) {
|
||||
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
|
||||
@@ -89,7 +89,7 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Throwable 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")
|
||||
Call<ServiceRESTResponse<List<StbGestSetup>>> getGestSetupValues(
|
||||
@Query("codMdep") String codMdep,
|
||||
@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.getOrdiniLavorazione(flagEvaso, codJfas)
|
||||
.enqueue(new Callback<ServiceRESTResponse<List<OrdineLavorazioneDTO>>>() {
|
||||
mesRESTConsumerService.getOrdiniLavorazione(null, flagEvaso, codJfas, codAnag)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
||||
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) {
|
||||
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) {
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<JtbFasi>>() {}.getType();
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<JtbFasi>>() {
|
||||
}.getType();
|
||||
this.mSystemRESTConsumer.processSql(
|
||||
"SELECT * FROM jtb_fasi WHERE cod_jfas_parent = " + UtilityDB.valueToString(codJfasParent),
|
||||
typeOfObjectsList,
|
||||
|
||||
@@ -22,4 +22,7 @@ public interface MesRESTConsumerService {
|
||||
@GET("mes_v2/getOrdiniLavorazione")
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
||||
.groupBy(ArticoloDTO::getCodMart)
|
||||
.forEach(entry -> {
|
||||
|
||||
if(entry.getValue().size() == 1) {
|
||||
if (entry.getValue().size() == 1) {
|
||||
listaArticoli.add(entry.getValue().get(0));
|
||||
} else {
|
||||
for (ArticoloDTO articolo : entry.getValue()) {
|
||||
@@ -93,7 +93,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
||||
int i = 0;
|
||||
for (ArticoloOrdine art : articoli) {
|
||||
i++;
|
||||
artRows.add(convertArtToDTO(art,i));
|
||||
artRows.add(convertArtToDTO(art, i));
|
||||
}
|
||||
|
||||
ordineDTO.setChiaveGriglia(griglia.getCodAlis());
|
||||
@@ -109,9 +109,9 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
||||
.enqueue(new Callback<List<ServiceRESTResponse<DtbOrdt>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<List<ServiceRESTResponse<DtbOrdt>>> call, Response<List<ServiceRESTResponse<DtbOrdt>>> response) {
|
||||
if (response.body() != null && response.body().size() > 0){
|
||||
analyzeListOfAnswers(response, "getArticoliListino", dtoList-> {
|
||||
if (dtoList.size() > 0){
|
||||
if (response.body() != null && response.body().size() > 0) {
|
||||
analyzeListOfAnswers(response, "getArticoliListino", dtoList -> {
|
||||
if (dtoList.size() > 0) {
|
||||
DtbOrdt dto = dtoList.get(0);
|
||||
ordine.setTransmitted(true);
|
||||
ordine.setTransmissionDate(UtilityDate.getDateInstance());
|
||||
@@ -120,7 +120,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
||||
ordine.setCodMdep(dto.getCodMdep());
|
||||
ordine.setNumOrd(dto.getNumOrd());
|
||||
onSuccess.run(ordine);
|
||||
}else{
|
||||
} else {
|
||||
onFailed.run(new Exception("Nessun ordine generato"));
|
||||
}
|
||||
}, onFailed);
|
||||
@@ -128,7 +128,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
@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());
|
||||
UtilityLogger.errorMe(new Exception(t));
|
||||
onFailed.run(new Exception(t));
|
||||
@@ -136,7 +136,6 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private ArtDTO convertArtToDTO(ArticoloOrdine art, int rigaOrd) {
|
||||
@@ -147,6 +146,7 @@ public class PVOrdiniAcquistoRESTConsumer extends _BaseRESTConsumer {
|
||||
dto.setDescrizione(art.getDescrizione());
|
||||
dto.setDataInsD(art.getDataIns());
|
||||
dto.setUntMis(art.getUntMis());
|
||||
dto.setSystemNote(art.getSystemNote());
|
||||
dto.setQta(BigDecimal.valueOf(art.getQtaOrd()));
|
||||
dto.setQtaCnf(BigDecimal.valueOf(art.getQtaCnf()));
|
||||
dto.setColli(BigDecimal.ZERO);
|
||||
|
||||
@@ -12,12 +12,15 @@ import javax.inject.Singleton;
|
||||
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.report.ReportType;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.JasperDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.JasperPairDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ReportTypeDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PrintOrderCloseDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
@@ -63,7 +66,7 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||
Call<ServiceRESTResponse<Object>> callable = null;
|
||||
callable = printerService.printCollo(testataColloToPrint);
|
||||
callable = printerService.printCollo(testataColloToPrint);
|
||||
|
||||
callable.enqueue(new Callback<>() {
|
||||
@Override
|
||||
@@ -115,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.rest.model.JasperDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ReportTypeDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PrintOrderCloseDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.POST;
|
||||
@@ -26,9 +28,20 @@ public interface PrinterRESTConsumerService {
|
||||
@Body JasperDTO jasperDTO
|
||||
);
|
||||
|
||||
@POST("printReportType")
|
||||
Call<ServiceRESTResponse<Object>> printReportType(
|
||||
@Body ReportTypeDTO reportTypeDTO
|
||||
);
|
||||
|
||||
@POST("wms/printEtichettaSSCC")
|
||||
Call<ServiceRESTResponse<Object>> printCollo(
|
||||
@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);
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public abstract class _BaseRESTConsumer {
|
||||
}
|
||||
} else {
|
||||
Log.e(logTitle, response.body().getErrorMessage());
|
||||
onFailed.run(new Exception(response.body().getErrorMessage()));
|
||||
onFailed.run(CommonRESTException.tryRecognizeException(response.body().getErrorMessage()));
|
||||
}
|
||||
} else {
|
||||
Log.e(logTitle, response.message());
|
||||
@@ -76,7 +76,9 @@ public abstract class _BaseRESTConsumer {
|
||||
if (response.code() == 404) {
|
||||
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata");
|
||||
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());
|
||||
onFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
|
||||
}
|
||||
@@ -113,7 +115,9 @@ public abstract class _BaseRESTConsumer {
|
||||
if (responseList.code() == 404) {
|
||||
Log.e(logTitle, "Errore " + responseList.code() + ": risorsa non trovata");
|
||||
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());
|
||||
onFailed.run(new Exception("Status " + responseList.code() + ": " + responseList.message()));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
package it.integry.integrywmsnative.core.rest.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
|
||||
public class LoadColliDTO {
|
||||
|
||||
private String gestione;
|
||||
private String codDtip;
|
||||
private String codAnag;
|
||||
private String codVdes;
|
||||
private Date dataDoc;
|
||||
private String serDoc;
|
||||
private Integer numDoc;
|
||||
private String codMdep;
|
||||
private String calcPrz;
|
||||
private boolean datiOrd;
|
||||
private Date dataOrd;
|
||||
private Integer numOrd;
|
||||
private String flagEvasoForzato;
|
||||
private Date dataVers;
|
||||
private String note;
|
||||
private boolean saveDoc = true;
|
||||
|
||||
private List<MtbColt> colli = new ArrayList<>();
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
|
||||
public LoadColliDTO setGestione(String gestione) {
|
||||
this.gestione = gestione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodDtip() {
|
||||
return codDtip;
|
||||
}
|
||||
|
||||
public LoadColliDTO setCodDtip(String codDtip) {
|
||||
this.codDtip = codDtip;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public LoadColliDTO setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodVdes() {
|
||||
return codVdes;
|
||||
}
|
||||
|
||||
public LoadColliDTO setCodVdes(String codVdes) {
|
||||
this.codVdes = codVdes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataDoc() {
|
||||
return dataDoc;
|
||||
}
|
||||
|
||||
public LoadColliDTO setDataDoc(Date dataDoc) {
|
||||
this.dataDoc = dataDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSerDoc() {
|
||||
return serDoc;
|
||||
}
|
||||
|
||||
public LoadColliDTO setSerDoc(String serDoc) {
|
||||
this.serDoc = serDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumDoc() {
|
||||
return numDoc;
|
||||
}
|
||||
|
||||
public LoadColliDTO setNumDoc(Integer numDoc) {
|
||||
this.numDoc = numDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMdep() {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public LoadColliDTO setCodMdep(String codMdep) {
|
||||
this.codMdep = codMdep;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCalcPrz() {
|
||||
return calcPrz;
|
||||
}
|
||||
|
||||
public LoadColliDTO setCalcPrz(String calcPrz) {
|
||||
this.calcPrz = calcPrz;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isDatiOrd() {
|
||||
return datiOrd;
|
||||
}
|
||||
|
||||
public LoadColliDTO setDatiOrd(boolean datiOrd) {
|
||||
this.datiOrd = datiOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public LoadColliDTO setDataOrd(Date dataOrd) {
|
||||
this.dataOrd = dataOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumOrd() {
|
||||
return numOrd;
|
||||
}
|
||||
|
||||
public LoadColliDTO setNumOrd(Integer numOrd) {
|
||||
this.numOrd = numOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagEvasoForzato() {
|
||||
return flagEvasoForzato;
|
||||
}
|
||||
|
||||
public LoadColliDTO setFlagEvasoForzato(String flagEvasoForzato) {
|
||||
this.flagEvasoForzato = flagEvasoForzato;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataVers() {
|
||||
return dataVers;
|
||||
}
|
||||
|
||||
public LoadColliDTO setDataVers(Date dataVers) {
|
||||
this.dataVers = dataVers;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public LoadColliDTO setNote(String note) {
|
||||
this.note = note;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isSaveDoc() {
|
||||
return saveDoc;
|
||||
}
|
||||
|
||||
public LoadColliDTO setSaveDoc(boolean saveDoc) {
|
||||
this.saveDoc = saveDoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbColt> getColli() {
|
||||
return colli;
|
||||
}
|
||||
|
||||
public LoadColliDTO setColli(List<MtbColt> colli) {
|
||||
this.colli = colli;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,8 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
||||
private String nomeAgente;
|
||||
private String codJfas;
|
||||
private List<AvailableClassMerc> availableClassMerc;
|
||||
private boolean ordTrasf;
|
||||
|
||||
|
||||
public Integer getIdViaggio() {
|
||||
return idViaggio;
|
||||
@@ -56,7 +58,6 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getListino() {
|
||||
return listino;
|
||||
}
|
||||
@@ -371,6 +372,14 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isOrdTrasf() {
|
||||
return ordTrasf;
|
||||
}
|
||||
|
||||
public OrdineUscitaInevasoDTO setOrdTrasf(boolean ordTrasf) {
|
||||
this.ordTrasf = ordTrasf;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -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,8 @@ public class SitArtOrdDTO {
|
||||
private String descrizioneMsgr;
|
||||
private String codMsfa;
|
||||
private String descrizioneMsfa;
|
||||
private String untord;
|
||||
private BigDecimal qtaOmg;
|
||||
|
||||
private final HashMap<String, Object> extraInfo = new HashMap<>();
|
||||
|
||||
@@ -212,4 +214,22 @@ public class SitArtOrdDTO {
|
||||
public HashMap<String, Object> getExtraInfo() {
|
||||
return extraInfo;
|
||||
}
|
||||
|
||||
public String getUntord() {
|
||||
return untord;
|
||||
}
|
||||
|
||||
public SitArtOrdDTO setUntord(String untord) {
|
||||
this.untord = untord;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaOmg() {
|
||||
return qtaOmg;
|
||||
}
|
||||
|
||||
public SitArtOrdDTO setQtaOmg(BigDecimal qtaOmg) {
|
||||
this.qtaOmg = qtaOmg;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,10 +42,16 @@ public class DBSettingsModel {
|
||||
private boolean flagOrdinaArticoliOnScan;
|
||||
private String docInterniCheckFornitore;
|
||||
private String produzioneDefaultCodAnag;
|
||||
private String reportNameSpedizionChiudiOrdine;
|
||||
private boolean flagPrintPackingListOnOrderClose;
|
||||
private boolean flagPrintEtichetteOnOrderClose;
|
||||
private int onNumCnfInputChanged = 1;
|
||||
private int onQtaTotInputChanged = 1;
|
||||
private boolean flagAccettazioneUseQtaOrd = false;
|
||||
private boolean flagPickLiberoAllowEmptyDest = false;
|
||||
private boolean flagAskInfoAggiuntiveSpedizione = false;
|
||||
private String filterFornitoreProd;
|
||||
private String codDtipOrdTrasfV;
|
||||
private boolean notifyLotStatus = false;
|
||||
|
||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||
return flagSpedizioneEnableFakeGiacenza;
|
||||
@@ -281,12 +287,21 @@ public class DBSettingsModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getReportNameSpedizionChiudiOrdine() {
|
||||
return reportNameSpedizionChiudiOrdine;
|
||||
public boolean isFlagPrintPackingListOnOrderClose() {
|
||||
return flagPrintPackingListOnOrderClose;
|
||||
}
|
||||
|
||||
public DBSettingsModel setReportNameSpedizionChiudiOrdine(String reportNameSpedizionChiudiOrdine) {
|
||||
this.reportNameSpedizionChiudiOrdine = reportNameSpedizionChiudiOrdine;
|
||||
public DBSettingsModel setFlagPrintPackingListOnOrderClose(boolean flagPrintPackingListOnOrderClose) {
|
||||
this.flagPrintPackingListOnOrderClose = flagPrintPackingListOnOrderClose;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagPrintEtichetteOnOrderClose() {
|
||||
return flagPrintEtichetteOnOrderClose;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagPrintEtichetteOnOrderClose(boolean flagPrintEtichetteOnOrderClose) {
|
||||
this.flagPrintEtichetteOnOrderClose = flagPrintEtichetteOnOrderClose;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -299,6 +314,15 @@ public class DBSettingsModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getOnQtaTotInputChanged() {
|
||||
return onQtaTotInputChanged;
|
||||
}
|
||||
|
||||
public DBSettingsModel setOnQtaTotInputChanged(int onQtaTotInputChanged) {
|
||||
this.onQtaTotInputChanged = onQtaTotInputChanged;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getNotePerditaDocInterni() {
|
||||
return notePerditaDocInterni;
|
||||
}
|
||||
@@ -344,4 +368,40 @@ public class DBSettingsModel {
|
||||
this.flagOrdinaArticoliOnScan = flagOrdinaArticoliOnScan;
|
||||
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;
|
||||
}
|
||||
|
||||
public String getCodDtipOrdTrasfV() {
|
||||
return codDtipOrdTrasfV;
|
||||
}
|
||||
|
||||
public DBSettingsModel setCodDtipOrdTrasfV(String codDtipOrdTrasfV) {
|
||||
this.codDtipOrdTrasfV = codDtipOrdTrasfV;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isNotifyLotStatus() {
|
||||
return notifyLotStatus;
|
||||
}
|
||||
|
||||
public DBSettingsModel setNotifyLotStatus(boolean notifyLotStatus) {
|
||||
this.notifyLotStatus = notifyLotStatus;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,6 +258,10 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("PRODUZIONE")
|
||||
.setKeySection("FLAG_VERSAMENTO_DIRETTO"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("PRODUZIONE")
|
||||
.setKeySection("FILTER_FORNTIORE_PROD"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
@@ -270,10 +274,6 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_CAN_SELECT_MULTIPLE_ORDERS"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("REPORT_PACKING_LIST"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
@@ -282,6 +282,10 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("SETUP")
|
||||
.setKeySection("ON_NUM_CNF_INPUT_CHANGED"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SETUP")
|
||||
.setKeySection("ON_QTA_TOT_INPUT_CHANGED"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PVM")
|
||||
.setSection("DOC_INTERNI")
|
||||
@@ -306,9 +310,33 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("PICKING_LIBERO")
|
||||
.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"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("COD_DTIP_ORD_TRASF"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_NOTIFICA_STATO_PARTITA"));
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
|
||||
|
||||
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
|
||||
GestSetupRESTConsumer.getValues(codMdep, stbGestSetupList, list -> {
|
||||
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.setFlagMultiClienteOrdV(getValueFromList(list, "SETUP", "FLAG_MULTI_CLIENTE_ORD_VENDITA", Boolean.class));
|
||||
@@ -327,23 +355,30 @@ public class SettingsManager {
|
||||
dbSettingsModelIstance.setFlagSpedizioneEnableManualPick(getValueFromList(list, "SPEDIZIONE", "ENABLE_MANUAL_PICK", 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.setReportNameSpedizionChiudiOrdine(getValueFromList(list, "SPEDIZIONE", "REPORT_PACKING_LIST", String.class));
|
||||
dbSettingsModelIstance.setFlagSpedizioneUseQtaOrd(getValueFromList(list, "SPEDIZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagOrdinaNuoviArticoliInGriglia(getValueFromList(list, "ORDINI_A", "ORDINA_NUOVI_ARTICOLI", Boolean.class));
|
||||
dbSettingsModelIstance.setDocInterniCheckFornitore(getValueFromList(list, "DOC_INTERNI", "CHECK_FORNITORE", String.class));
|
||||
dbSettingsModelIstance.setFlagAccettazioneUseQtaOrd(getValueFromList(list, "ACCETTAZIONE", "FLAG_USE_QTA_ORD", 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.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));
|
||||
dbSettingsModelIstance.setCodDtipOrdTrasfV(getValueFromList(list, "SPEDIZIONE", "COD_DTIP_ORD_TRASF", String.class));
|
||||
dbSettingsModelIstance.setNotifyLotStatus(getValueFromList(list, "SPEDIZIONE", "FLAG_NOTIFICA_STATO_PARTITA", Boolean.class));
|
||||
|
||||
String notePerdita = getValueFromList(list, "DOC_INTERNI", "NOTE_PERDITA", String.class);
|
||||
if (notePerdita != null) {
|
||||
if (notePerdita != null)
|
||||
dbSettingsModelIstance.setNotePerditaDocInterni(Arrays.asList(notePerdita.split("\\|")));
|
||||
}
|
||||
|
||||
Integer onNumCnfInputChanged = getValueFromList(list, "SETUP", "ON_NUM_CNF_INPUT_CHANGED", Integer.class);
|
||||
if (onNumCnfInputChanged != null) {
|
||||
if (onNumCnfInputChanged != null)
|
||||
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();
|
||||
}, onFailed);
|
||||
@@ -355,7 +390,7 @@ public class SettingsManager {
|
||||
|
||||
StbGestSetup value = Stream.of(stbGestSetupList)
|
||||
.filter(x -> x.getSection().equalsIgnoreCase(section) && x.getKeySection().equalsIgnoreCase(keySectionName))
|
||||
.findFirst().get();
|
||||
.findFirstOrElse(new StbGestSetup());
|
||||
|
||||
if (clazz == String.class) {
|
||||
return clazz.cast(value.getValue());
|
||||
|
||||
@@ -61,8 +61,8 @@ public class UpdatesManager {
|
||||
|
||||
String destination = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/";
|
||||
|
||||
var progressDialog = DialogProgressView.newInstance("Download", null, false);
|
||||
progressDialog.show(mContext.getSupportFragmentManager(), "tag");
|
||||
var progressDialogBuilder = new DialogProgressView("Download", null, false);
|
||||
progressDialogBuilder.show(mContext.getSupportFragmentManager(), "tag");
|
||||
|
||||
|
||||
var fileDownloader = new FileDownloader()
|
||||
@@ -70,13 +70,13 @@ public class UpdatesManager {
|
||||
.setUrlString(downloadURL)
|
||||
.setOnProgressUpdate(progress -> {
|
||||
mContext.runOnUiThread(() -> {
|
||||
progressDialog.setProgress(progress);
|
||||
progressDialogBuilder.setProgress(progress);
|
||||
});
|
||||
})
|
||||
.setOnDownloadCompleted(destPath -> {
|
||||
|
||||
mContext.runOnUiThread(() -> {
|
||||
progressDialog.dismiss();
|
||||
progressDialogBuilder.dismiss();
|
||||
|
||||
Uri fileLoc;
|
||||
Intent intent;
|
||||
|
||||
@@ -32,6 +32,10 @@ public class UtilityBarcode {
|
||||
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) {
|
||||
return isEtichettaPosizione(barcodeScanDTO, true);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,21 @@ public class UtilityDate {
|
||||
|
||||
|
||||
public static Date getDateInstance() {
|
||||
return getCalendarInstance().getTime();
|
||||
return getDateInstance(false);
|
||||
}
|
||||
|
||||
|
||||
public static Date getDateInstance(boolean removeTime) {
|
||||
var calendar = getCalendarInstance();
|
||||
|
||||
if(removeTime) {
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
}
|
||||
|
||||
return calendar.getTime();
|
||||
}
|
||||
|
||||
public static Calendar getCalendarInstance() {
|
||||
|
||||
@@ -15,7 +15,6 @@ 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.view.dialogs.DialogProgressView;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
|
||||
public class UtilityExceptions {
|
||||
@@ -25,12 +24,6 @@ public class UtilityExceptions {
|
||||
InvalidLUGestioneException.class,
|
||||
InvalidLUException.class
|
||||
};
|
||||
|
||||
public static void defaultException(Context context, Exception ex, DialogProgressView progressDialog) {
|
||||
defaultException(context, ex);
|
||||
if (progressDialog != null && progressDialog.isVisible()) progressDialog.dismiss();
|
||||
}
|
||||
|
||||
public static void defaultException(Context context, Exception ex) {
|
||||
defaultException(context, ex, false);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ public class UtilityNumber {
|
||||
decimalFormat.setMaximumFractionDigits(decimal);
|
||||
decimalFormat.setDecimalFormatSymbols(otherSymbols);
|
||||
decimalFormat.setGroupingUsed(false);
|
||||
decimalFormat.setMinimumFractionDigits(2);
|
||||
|
||||
return decimalFormat.format(floatValue);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||
public class UtilityProgress {
|
||||
|
||||
public static DialogProgressView createDefaultProgressDialog(FragmentActivity mContext) {
|
||||
var progress = DialogProgressView.newInstance();
|
||||
var progress = DialogProgressView.newInstance(null, null, true);
|
||||
progress.show(mContext.getSupportFragmentManager(), "tag");
|
||||
return progress;
|
||||
}
|
||||
|
||||
@@ -798,7 +798,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
if (ex instanceof InvalidPesoKGException) {
|
||||
UtilityToast.showToast(ex.getMessage());
|
||||
} else {
|
||||
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
||||
UtilityExceptions.defaultException(this, ex);
|
||||
}
|
||||
|
||||
BarcodeManager.enable();
|
||||
|
||||
@@ -35,6 +35,13 @@ public class DialogSelectDocInfoViewModel {
|
||||
|
||||
public void init(DocInterniSetupDTO 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() {
|
||||
|
||||
@@ -19,6 +19,8 @@ public class GrigliaAcquistiChildDTO {
|
||||
private float giacenza;
|
||||
private float qtaPrevistaVendita;
|
||||
private float qtaProposta;
|
||||
private BigDecimal qtaOrd;
|
||||
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
@@ -154,4 +156,13 @@ public class GrigliaAcquistiChildDTO {
|
||||
this.newNoPromo = newNoPromo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaOrd() {
|
||||
return qtaOrd;
|
||||
}
|
||||
|
||||
public GrigliaAcquistiChildDTO setQtaOrd(BigDecimal qtaOrd) {
|
||||
this.qtaOrd = qtaOrd;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,6 +250,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
.setNotesMandatory(this.viewModel.isNotesMandatory())
|
||||
.setDataScadMandatory(flagTracciabilita)
|
||||
.setCanPartitaMagBeChanged(flagTracciabilita)
|
||||
.setNumCnfEditable(false)
|
||||
.setSuggestPartitaMag(data -> {
|
||||
Date dataScad = data.getDataScad();
|
||||
String partitaMag = null;
|
||||
|
||||
@@ -49,6 +49,7 @@ import it.integry.integrywmsnative.core.utility.UtilityContext;
|
||||
import it.integry.integrywmsnative.databinding.ActivityMainBinding;
|
||||
import it.integry.integrywmsnative.gest.login.LoginActivity;
|
||||
import it.integry.integrywmsnative.gest.settings.MainSettingsFragment;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||
|
||||
public class MainActivity extends BaseActivity
|
||||
implements NavigationView.OnNavigationItemSelectedListener, IPoppableActivity {
|
||||
@@ -70,12 +71,16 @@ public class MainActivity extends BaseActivity
|
||||
@Inject
|
||||
UpdatesManager updatesManager;
|
||||
|
||||
@Inject
|
||||
DialogProgressView mDialogProgressView;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
MainApplication.appComponent
|
||||
.mainActivityComponent()
|
||||
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
|
||||
@@ -241,18 +241,18 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
||||
|
||||
private void initGestMenu() {
|
||||
int menuSpanCount = 2;
|
||||
if(UtilityDimension.getDisplayInchs(this.getActivity()) > 8) menuSpanCount = 4;
|
||||
else if(UtilityDimension.getDisplayInchs(this.getActivity()) > 6.5) menuSpanCount = 3;
|
||||
if (UtilityDimension.getDisplayInchs(this.getActivity()) > 8) menuSpanCount = 4;
|
||||
else if (UtilityDimension.getDisplayInchs(this.getActivity()) > 6.5) menuSpanCount = 3;
|
||||
|
||||
MenuConfiguration baseMenuConfiguration = new MenuConfiguration();
|
||||
List<MenuConfiguration.MenuGroup> menuGroups = baseMenuConfiguration.getGroups();
|
||||
|
||||
for(int i = 0; i < menuGroups.size(); i++) {
|
||||
for (int i = 0; i < menuGroups.size(); i++) {
|
||||
try {
|
||||
|
||||
BaseMenuConfiguration.MenuGroup menuGroup = menuGroups.get(i);
|
||||
|
||||
if(menuService.isGroupEnabled(menuGroup)) {
|
||||
if (menuService.isGroupEnabled(menuGroup)) {
|
||||
|
||||
FragmentMainMenuGroupLayoutBinding groupBinding = DataBindingUtil.inflate(mLayoutInflater, R.layout.fragment_main_menu_group_layout, null, false);
|
||||
|
||||
@@ -261,8 +261,8 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
||||
|
||||
List<BaseMenuConfiguration.MenuItem> enableMenuItems = new ArrayList<>();
|
||||
|
||||
for(int j = 0; j < menuGroup.getItems().size(); j++) {
|
||||
if(menuService.isItemEnabled(menuGroup.getItems().get(j))) {
|
||||
for (int j = 0; j < menuGroup.getItems().size(); j++) {
|
||||
if (menuService.isItemEnabled(menuGroup.getItems().get(j))) {
|
||||
enableMenuItems.add(menuGroup.getItems().get(j));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepo;
|
||||
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.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||
@@ -692,30 +693,30 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
this.mViewModel.processBarcodeDTO(data, this::onLoadingEnded);
|
||||
};
|
||||
|
||||
private void refreshList(List<OrdiniUscitaElencoDTO> filteredList) {
|
||||
List<OrdiniUscitaElencoDTO> tmpList;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
List<OrdiniUscitaElencoDTO> tmpList;
|
||||
|
||||
if (filteredList != null) {
|
||||
tmpList = filteredList;
|
||||
} else if (mAppliedFilterViewModel != null) {
|
||||
mAppliedFilterViewModel.applyAllTests();
|
||||
tmpList = mAppliedFilterViewModel.getMutableFilteredOrderList().getValue();
|
||||
} else {
|
||||
tmpList = mViewModel.getOrderList().getValue();
|
||||
}
|
||||
if (filteredList != null) {
|
||||
tmpList = filteredList;
|
||||
} else if (mAppliedFilterViewModel != null) {
|
||||
mAppliedFilterViewModel.applyAllTests();
|
||||
tmpList = mAppliedFilterViewModel.getMutableFilteredOrderList().getValue();
|
||||
} else {
|
||||
tmpList = mViewModel.getOrderList().getValue();
|
||||
}
|
||||
|
||||
var list = convertDataModelToListModel(tmpList);
|
||||
var list = convertDataModelToListModel(tmpList);
|
||||
|
||||
this.mOrdiniInevasiMutableData.clear();
|
||||
this.mOrdiniInevasiMutableData.addAll(list);
|
||||
this.mOrdiniInevasiMutableData.clear();
|
||||
this.mOrdiniInevasiMutableData.addAll(list);
|
||||
|
||||
fabVisible.set(Stream.of(mOrdiniInevasiMutableData)
|
||||
.anyMatch(y -> y.getSelectedObservable().get()));
|
||||
fabVisible.set(Stream.of(mOrdiniInevasiMutableData)
|
||||
.anyMatch(y -> y.getSelectedObservable().get()));
|
||||
});
|
||||
}
|
||||
|
||||
private List<OrdiniUscitaElencoListModel> convertDataModelToListModel(List<OrdiniUscitaElencoDTO> dataList) {
|
||||
@@ -780,6 +781,17 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
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
|
||||
public void onOrderFiltered(List<OrdiniUscitaElencoDTO> filteredOrders) {
|
||||
refreshList(filteredOrders);
|
||||
|
||||
@@ -154,12 +154,15 @@ public class OrdiniUscitaElencoViewModel {
|
||||
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||
|
||||
RunnableArgs<List<OrdiniUscitaElencoDTO>> onBarcodeScanComplete = orderList -> {
|
||||
onComplete.run();
|
||||
this.sendOnOrderFiltered(orderList);
|
||||
onComplete.run();
|
||||
};
|
||||
|
||||
if (UtilityBarcode.isBarcodeOrdineV(barcodeScanDTO)) {
|
||||
this.executeEtichettaOrdineV(barcodeScanDTO.getStringValue(), onBarcodeScanComplete);
|
||||
this.executeEtichettaOrdineV(barcodeScanDTO.getStringValue(), foundOrder -> {
|
||||
this.sendOnFilterNumOrderApplied(foundOrder);
|
||||
onComplete.run();
|
||||
});
|
||||
} else if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
||||
this.executeEtichettaLU(barcodeScanDTO.getStringValue(), onBarcodeScanComplete);
|
||||
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||
@@ -196,10 +199,11 @@ public class OrdiniUscitaElencoViewModel {
|
||||
final String finalGestione = gestione;
|
||||
final Date finalDate = date;
|
||||
|
||||
List<OrdiniUscitaElencoDTO> filteredOrders = Stream.of(mOrderList.getValue())
|
||||
.filter(x -> x.getNumOrd() == numOrd && x.getGestione().equalsIgnoreCase(finalGestione) && x.getDataOrdD().equals(finalDate)).toList();
|
||||
List<OrdiniUscitaElencoDTO> foundItem = Stream.of(mOrderList.getValue())
|
||||
.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);
|
||||
}
|
||||
|
||||
private void sendOnFilterNumOrderApplied(List<OrdiniUscitaElencoDTO> filteredOrder) {
|
||||
if (this.mListener != null) mListener.onFilterNumOrderApplied(filteredOrder);
|
||||
}
|
||||
|
||||
private void sendOnOrderFiltered(List<OrdiniUscitaElencoDTO> filteredOrders) {
|
||||
if (this.mListener != null) mListener.onOrderFiltered(filteredOrders);
|
||||
}
|
||||
@@ -297,6 +305,8 @@ public class OrdiniUscitaElencoViewModel {
|
||||
|
||||
void onError(Exception ex);
|
||||
|
||||
void onFilterNumOrderApplied(List<OrdiniUscitaElencoDTO> filteredOrder);
|
||||
|
||||
void onOrderFiltered(List<OrdiniUscitaElencoDTO> filteredOrders);
|
||||
|
||||
void onOrdersDispatched(List<OrdineUscitaInevasoDTO> orders, List<SitArtOrdDTO> sitArts, List<MtbColt> alreadyRegisteredMtbColts);
|
||||
|
||||
@@ -171,10 +171,10 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
private void initRecyclerView() {
|
||||
mBindings.pickingLiberoMainList.setNestedScrollingEnabled(false);
|
||||
mBindings.pickingLiberoMainList.setHasFixedSize(true);
|
||||
mBindings.pickingLiberoMainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
mBindings.pickingLiberoMainList.setLayoutManager(new LinearLayoutManager(requireActivity()));
|
||||
|
||||
SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(getActivity(), SimpleDividerItemDecoration.VERTICAL);
|
||||
itemDecorator.setDrawable(ContextCompat.getDrawable(getActivity(), R.drawable.divider));
|
||||
SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(requireActivity(), SimpleDividerItemDecoration.VERTICAL);
|
||||
itemDecorator.setDrawable(ContextCompat.getDrawable(requireActivity(), R.drawable.divider));
|
||||
mBindings.pickingLiberoMainList.addItemDecoration(itemDecorator);
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
if (ex instanceof InvalidPesoKGException) {
|
||||
UtilityToast.showToast(ex.getMessage());
|
||||
} else {
|
||||
UtilityExceptions.defaultException(getActivity(), ex, mCurrentProgress);
|
||||
UtilityExceptions.defaultException(getActivity(), ex);
|
||||
}
|
||||
|
||||
BarcodeManager.enable();
|
||||
|
||||
@@ -213,7 +213,7 @@ public class PickingLiberoViewModel {
|
||||
|
||||
if (posizione != null && posizione.isFlagMonoCollo()) {
|
||||
this.executePosizione(posizione, articolo, onComplete);
|
||||
} else if(mDefaultGestione == GestioneEnum.VENDITA){
|
||||
} else if (mDefaultGestione == GestioneEnum.VENDITA) {
|
||||
this.dispatchArt(articolo, ean128Model);
|
||||
onComplete.run();
|
||||
} else {
|
||||
@@ -439,6 +439,7 @@ public class PickingLiberoViewModel {
|
||||
mColliMagazzinoRESTConsumer.saveCollo(clonedTestata, value -> {
|
||||
for (int i = 0; i < mtbColrObservableField.size(); i++) {
|
||||
MtbColr initialMtbColr = mtbColrObservableField.get(i);
|
||||
var startIdx = (value.getMtbColr().size() - mtbColrObservableField.size());
|
||||
|
||||
initialMtbColr
|
||||
.setDataCollo(value.getDataColloS())
|
||||
@@ -446,7 +447,7 @@ public class PickingLiberoViewModel {
|
||||
.setGestione(value.getGestione())
|
||||
.setSerCollo(value.getSerCollo());
|
||||
|
||||
initialMtbColr.setRiga(value.getMtbColr().get(i).getRiga());
|
||||
initialMtbColr.setRiga(value.getMtbColr().get(startIdx + i).getRiga());
|
||||
mCurrentMtbColt.getMtbColr().add(mtbColrObservableField.get(i));
|
||||
}
|
||||
|
||||
@@ -626,7 +627,7 @@ public class PickingLiberoViewModel {
|
||||
UtilityString.equalsIgnoreCase(x.getCodCol(), mtbColrToUpdate.getCodCol()) &&
|
||||
UtilityString.equalsIgnoreCase(x.getCodTagl(), mtbColrToUpdate.getCodTagl()) &&
|
||||
UtilityString.equalsIgnoreCase(x.getPartitaMag(), mtbColrToUpdate.getPartitaMag()))
|
||||
.single();
|
||||
.findFirstOrElse(null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -287,7 +287,7 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
||||
if (ex instanceof InvalidPesoKGException) {
|
||||
UtilityToast.showToast(ex.getMessage());
|
||||
} else {
|
||||
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
||||
UtilityExceptions.defaultException(this, ex);
|
||||
}
|
||||
|
||||
BarcodeManager.enable();
|
||||
|
||||
@@ -17,8 +17,8 @@ import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
||||
import it.integry.integrywmsnative.core.exception.InvalidLUException;
|
||||
import it.integry.integrywmsnative.core.exception.NoArtsFoundException;
|
||||
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILUBaseOperationsListener;
|
||||
@@ -333,7 +333,7 @@ public class PickingResiViewModel {
|
||||
searchArtFromUL(mtbColt, onComplete);
|
||||
} else this.sendError(new InvalidLUException());
|
||||
} else {
|
||||
this.sendError(new NoArtsFoundException());
|
||||
this.sendError(new NoResultFromBarcodeException(SSCC));
|
||||
}
|
||||
|
||||
}, this::sendError);
|
||||
@@ -417,7 +417,7 @@ public class PickingResiViewModel {
|
||||
|
||||
private void loadMatchedRows(List<WithdrawableDtbDocr> matchedRows) {
|
||||
if (matchedRows == null || matchedRows.size() == 0) {
|
||||
this.sendError(new NoArtsFoundException());
|
||||
this.sendError(new NoResultFromBarcodeException());
|
||||
} else if (matchedRows.size() == 1) {
|
||||
WithdrawableDtbDocr matchedItem = matchedRows.get(0);
|
||||
|
||||
|
||||
@@ -0,0 +1,356 @@
|
||||
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(null, 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!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,154 @@
|
||||
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 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;
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
this.onLoadingStarted();
|
||||
this.mViewModel.processBarcodeDTO(data);
|
||||
};
|
||||
|
||||
@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.mLinesObservableList);
|
||||
this.mBinding.linesMainList.setAdapter(prodLinesListAdapter);
|
||||
|
||||
prodLinesListAdapter
|
||||
.setOnItemClicked(this::selectLine)
|
||||
.setEmptyView(this.mBinding.linesListEmptyView);
|
||||
|
||||
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,61 @@
|
||||
package it.integry.integrywmsnative.gest.prod_linee_produzione.ui;
|
||||
|
||||
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 RunnableArgs<ProdLineStatusDTO> mOnItemClicked;
|
||||
|
||||
public LinesListAdapter(ObservableArrayList<ProdLineStatusDTO> myDataset) {
|
||||
super(myDataset);
|
||||
}
|
||||
|
||||
@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 LinesListAdapter setOnItemClicked(RunnableArgs<ProdLineStatusDTO> onItemClicked) {
|
||||
this.mOnItemClicked = onItemClicked;
|
||||
return this;
|
||||
}
|
||||
|
||||
static class SingleItemViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
FragmentLineeProdMainListModelBinding binding;
|
||||
|
||||
SingleItemViewHolder(FragmentLineeProdMainListModelBinding binding) {
|
||||
super(binding.getRoot());
|
||||
this.binding = binding;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,10 +9,8 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
@@ -59,6 +57,8 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
private FragmentProdRecuperoMaterialeBinding mBinding;
|
||||
|
||||
private int barcodeScannerIstanceID = -1;
|
||||
private String codJfas;
|
||||
private String fragmentResultKeyString;
|
||||
|
||||
private final ObservableArrayList<HistoryULsListModel> mHistoryULMutableData = new ObservableArrayList<>();
|
||||
|
||||
@@ -67,14 +67,26 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
}
|
||||
|
||||
public static ProdRecuperoMaterialeFragment newInstance() {
|
||||
return newInstance(null, null);
|
||||
}
|
||||
|
||||
public static ProdRecuperoMaterialeFragment newInstance(String codJfas, String keyString) {
|
||||
ProdRecuperoMaterialeFragment fragment = new ProdRecuperoMaterialeFragment();
|
||||
if (keyString != null) {
|
||||
fragment.setFragmentResultKeyString(keyString);
|
||||
}
|
||||
fragment.setCodJfas(codJfas);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
public static ProdRecuperoMaterialeFragment newInstance(String codJfas) {
|
||||
return newInstance(codJfas, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_prod_recupero_materiale, container, false);
|
||||
mBinding = FragmentProdRecuperoMaterialeBinding.inflate(inflater, container, false);
|
||||
|
||||
MainApplication.appComponent
|
||||
.prodRecuperoMaterialeComponent()
|
||||
@@ -89,6 +101,14 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
this.initBarcodeReader();
|
||||
this.initRecyclerView();
|
||||
|
||||
this.addOnPreDestroy(() -> {
|
||||
if (!UtilityString.isNullOrEmpty(fragmentResultKeyString)) {
|
||||
Bundle result = new Bundle();
|
||||
result.putString(fragmentResultKeyString, "result");
|
||||
getParentFragmentManager().setFragmentResult(fragmentResultKeyString, result);
|
||||
}
|
||||
});
|
||||
|
||||
return mBinding.getRoot();
|
||||
}
|
||||
|
||||
@@ -96,8 +116,12 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
|
||||
mViewModel.init();
|
||||
this.addOnPreDestroy(() -> {
|
||||
if (barcodeScannerIstanceID > -1) {
|
||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||
}
|
||||
});
|
||||
mViewModel.init(codJfas);
|
||||
}
|
||||
|
||||
|
||||
@@ -115,6 +139,24 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
public String getCodJfas() {
|
||||
return codJfas;
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
@@ -124,8 +166,6 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
private void initRecyclerView() {
|
||||
this.mViewModel.getOrderList().observe(getViewLifecycleOwner(), this::refreshList);
|
||||
|
||||
mBinding.prodRecuperoMaterialeMainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
|
||||
HistoryULsListAdapter adapter = new HistoryULsListAdapter(getActivity(), mHistoryULMutableData)
|
||||
.setOnItemClicked(data -> this.mViewModel.dispatchItem(data.getOriginalModel(), null));
|
||||
|
||||
@@ -133,7 +173,9 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
|
||||
mBinding.prodRecuperoMaterialeMainList.setAdapter(adapter);
|
||||
|
||||
mToolbar.setRecyclerView(mBinding.prodRecuperoMaterialeMainList);
|
||||
if (mToolbar != null)
|
||||
mToolbar.setRecyclerView(mBinding.prodRecuperoMaterialeMainList);
|
||||
|
||||
}
|
||||
|
||||
private void refreshList(List<HistoryVersamentoProdULDTO> filteredList) {
|
||||
@@ -230,11 +272,11 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||
this.onLoadingEnded();
|
||||
DialogSimpleMessageView.makeErrorDialog(
|
||||
new SpannableString(ex.getMessage()),
|
||||
null,
|
||||
null,
|
||||
R.string.button_ignore_print,
|
||||
onComplete)
|
||||
new SpannableString(ex.getMessage()),
|
||||
null,
|
||||
null,
|
||||
R.string.button_ignore_print,
|
||||
onComplete)
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
|
||||
@@ -51,11 +51,11 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
this.mPrinterRESTConsumer = printerRESTConsumer;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
public void init(String codJfas) {
|
||||
this.sendOnLoadingStarted();
|
||||
new Thread(() -> {
|
||||
|
||||
mProdRecuperMaterialeRESTConsumer.loadLastULVersate(ulList -> {
|
||||
mProdRecuperMaterialeRESTConsumer.loadLastULVersate(codJfas, ulList -> {
|
||||
this.mUlList.setValue(ulList);
|
||||
|
||||
this.sendOnLoadingEnded();
|
||||
@@ -115,7 +115,10 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
qtaDaEvadere = qtaDaEvadere.add(item.getQtaCol());
|
||||
|
||||
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,
|
||||
@@ -151,27 +154,64 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
BigDecimal totalSumOfQtaCol = 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 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);
|
||||
numCnfToSave = inputNumCnf;
|
||||
qtaColToSave = numCnfToSave.multiply(inputQtaCnf).setScale(0, BigDecimal.ROUND_FLOOR);
|
||||
} 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);
|
||||
}
|
||||
|
||||
|
||||
totalSumOfQtaCol = totalSumOfQtaCol.add(qtaColToSave);
|
||||
totalSumOfNumCnf = totalSumOfNumCnf.add(numCnfToSave);
|
||||
totalSumOfQtaCol = qtaColToSave;
|
||||
totalSumOfNumCnf = 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()))
|
||||
@@ -183,10 +223,7 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
.setNumColloRif(item.getNumColloRif())
|
||||
.setDataColloRif(item.getDataColloRif())
|
||||
.setGestioneRif(item.getGestioneRif())
|
||||
.setSerColloRif(item.getSerColloRif())
|
||||
.setDataOrd(ordine.getData())
|
||||
.setNumOrd(ordine.getNumero())
|
||||
.setRigaOrd(ordine.getRigaOrd());
|
||||
.setSerColloRif(item.getSerColloRif());
|
||||
|
||||
mtbColrScarico.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||
mtbColtScarico.getMtbColr().add(mtbColrScarico);
|
||||
|
||||
@@ -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.SystemRESTConsumer;
|
||||
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.HistoryVersamentoProdULRestDTO;
|
||||
|
||||
@@ -32,6 +35,10 @@ public class ProdRecuperMaterialeRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
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 ( " +
|
||||
" 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.ser_collo = mtb_colt.ser_collo " +
|
||||
" 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.num_ord = mtb_colr.num_ord " +
|
||||
" 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 " +
|
||||
" LEFT OUTER JOIN jtb_fasi ON mtb_colt.cod_jfas = jtb_fasi.cod_jfas " +
|
||||
" WHERE jtb_fasi.cod_jfas IS NOT NULL " +
|
||||
(UtilityString.isNullOrEmpty(codJfas) ? "" : " AND jtb_fasi.cod_jfas = " + UtilityDB.valueToString(codJfas)) +
|
||||
" AND segno = -1 " +
|
||||
" AND mtb_colr.data_collo > DATEADD(DAY, -5, GETDATE()) " +
|
||||
" GROUP BY jtb_fasi.cod_jfas, " +
|
||||
@@ -177,7 +185,8 @@ public class ProdRecuperMaterialeRESTConsumer extends _BaseRESTConsumer {
|
||||
" ISNULL(max_ul.hr, '') = ISNULL(ul_list.hr, '') AND " +
|
||||
" 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 -> {
|
||||
|
||||
if (ulList == null) {
|
||||
@@ -238,6 +247,7 @@ public class ProdRecuperMaterialeRESTConsumer extends _BaseRESTConsumer {
|
||||
.setCodCol(restDTO.getCodCol())
|
||||
.setCodTagl(restDTO.getCodTagl())
|
||||
.setCodJfas(restDTO.getCodJfas())
|
||||
.setDescrizioneArt(restDTO.getDescrizioneArt())
|
||||
.setDescrizioneFase(restDTO.getDescrizioneFase())
|
||||
.setQtaCol(qtaColTot)
|
||||
.setNumCnf(numCnfColTot)
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.List;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.view.ExtendedSectionedRecyclerView;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.ProdRecuperoMaterialeListHeaderBinding;
|
||||
import it.integry.integrywmsnative.databinding.ProdRecuperoMaterialeListItemBinding;
|
||||
@@ -99,7 +100,7 @@ public class HistoryULsListAdapter extends ExtendedSectionedRecyclerView<History
|
||||
holder.binding.numCollo.setText(String.valueOf(ul.getNumCollo()));
|
||||
holder.binding.partitaMag.setText("(" + ul.getPartitaMag() + ")");
|
||||
|
||||
holder.binding.qtaVersata.setText(String.valueOf(ul.getQtaVersata()));
|
||||
holder.binding.qtaVersata.setText(UtilityNumber.decimalToString(ul.getQtaVersata(), 2));
|
||||
holder.binding.untMisQtaVersata.setText(String.valueOf(ul.getUntMisVersata()));
|
||||
|
||||
holder.binding.getRoot().setOnClickListener(v -> {
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableField;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -19,7 +20,9 @@ import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
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.interfaces.ILifecycleFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
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.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
|
||||
ProdRientroMerceViewModel mViewModel;
|
||||
|
||||
@@ -51,25 +63,54 @@ public class ProdRientroMerceFragment extends BaseFragment implements ITitledFra
|
||||
return new ProdRientroMerceFragment();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setRetainInstance(true);
|
||||
|
||||
boolean isLargeLayout = getResources().getBoolean(R.bool.large_layout);
|
||||
this.isLargeLayout.set(isLargeLayout);
|
||||
|
||||
mProdRientroMerceOrderListFragment = ProdRientroMerceOrderListFragment.newInstance(mToolbar);
|
||||
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 -> {
|
||||
mBindings.bottomSheetMtbColrEdit.setMtbColr(item.getMtbColr().get(0));
|
||||
mBindings.bottomSheetMtbColrEdit.expand();
|
||||
});
|
||||
|
||||
getChildFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.order_list_fragment, mProdRientroMerceOrderListFragment)
|
||||
.replace(R.id.order_detail_fragment, mProdRientroMerceOrderDetailFragment)
|
||||
.commit();
|
||||
if (isLargeLayout) {
|
||||
getChildFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.left_side_fragment_container, mProdRientroMerceOrderListFragment)
|
||||
.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
|
||||
.prodRientroMerceComponent()
|
||||
@@ -82,6 +123,8 @@ public class ProdRientroMerceFragment extends BaseFragment implements ITitledFra
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
mBindings = DataBindingUtil.inflate(LayoutInflater.from(getActivity()), R.layout.fragment_prod_rientro_merce, container, false);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
mBindings.setView(this);
|
||||
mBindings.setViewmodel(mViewModel);
|
||||
|
||||
mViewModel.setListener(this);
|
||||
|
||||
@@ -94,13 +137,13 @@ public class ProdRientroMerceFragment extends BaseFragment implements ITitledFra
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
|
||||
if(savedInstanceState == null) {
|
||||
if (savedInstanceState == null) {
|
||||
this.mViewModel.getOrdiniLavorazioneAperti().observe(this.getViewLifecycleOwner(), this::ordersUpdated);
|
||||
|
||||
mViewModel.init();
|
||||
mViewModel.refreshOrderList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||
mAppBarTitle = titleText;
|
||||
@@ -139,7 +182,6 @@ public class ProdRientroMerceFragment extends BaseFragment implements ITitledFra
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initBottomSheet() {
|
||||
mBindings.bottomSheetMtbColrEdit.setListener(this);
|
||||
mBindings.bottomSheetMtbColrEdit.disableEditButton();
|
||||
@@ -157,7 +199,33 @@ public class ProdRientroMerceFragment extends BaseFragment implements ITitledFra
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text),
|
||||
null,
|
||||
() -> 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,7 +7,9 @@ import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
|
||||
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.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.OrdersLoadException;
|
||||
|
||||
@@ -25,12 +27,12 @@ public class ProdRientroMerceViewModel {
|
||||
this.mMesRESTConsumer = mesRESTConsumer;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
new Thread(this::sendOnLoadingStarted).start();
|
||||
|
||||
this.mMesRESTConsumer.getOrdiniLavorazione("I", null, ordiniLavorazioneList -> {
|
||||
public void refreshOrderList() {
|
||||
new Thread(this::sendOnOrdersLoadingStarted).start();
|
||||
String codAnag = SettingsManager.iDB().getFilterFornitoreProd();
|
||||
this.mMesRESTConsumer.getOrdiniLavorazione("I", null, codAnag, ordiniLavorazioneList -> {
|
||||
this.mOrdiniLavorazioneAperti.postValue(ordiniLavorazioneList);
|
||||
this.sendOnLoadingEnded();
|
||||
this.sendOnOrdersLoadingEnded();
|
||||
}, ex -> this.sendError(new OrdersLoadException(ex)));
|
||||
}
|
||||
|
||||
@@ -51,12 +53,20 @@ public class ProdRientroMerceViewModel {
|
||||
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) {
|
||||
if (this.mListener != null) mListener.onError(ex);
|
||||
}
|
||||
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
public interface Listener extends ILoadingListener, IOrdersLoadingListener {
|
||||
|
||||
void onDataSaved();
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.annimon.stream.ComparatorCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.harrysoft.androidbluetoothserial.BluetoothManager;
|
||||
@@ -43,12 +44,14 @@ import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.FragmentProdRientroMerceOrderDetailBinding;
|
||||
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.view.dialogs.input_lu_prod.DialogInputLUProdDTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdView;
|
||||
import it.integry.integrywmsnative.view.dialogs.printSsccUl.DialogPrintUlSSCCView;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
@@ -76,12 +79,15 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
|
||||
private BluetoothManager bluetoothManager;
|
||||
private BluetoothSerialDevice mConnectedBluetoothDevice;
|
||||
private String mLatestCodTcol;
|
||||
|
||||
|
||||
public ObservableField<BigDecimal> sumLUNumber = new ObservableField<>(BigDecimal.ZERO);
|
||||
public ObservableField<BigDecimal> sumColliNumber = new ObservableField<>(BigDecimal.ZERO);
|
||||
public ObservableField<BigDecimal> sumNetKG = 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() {
|
||||
// Required empty public constructor
|
||||
@@ -113,11 +119,16 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
|
||||
mViewModel.setListener(this);
|
||||
|
||||
if (currentOrder.getValue() != null) {
|
||||
refreshOrder();
|
||||
isOrderColli = currentOrder.getValue().getQtaCnf().compareTo(BigDecimal.ONE) == 0;
|
||||
}
|
||||
this.mViewModel.mtbColtsOfOrder.observe(getViewLifecycleOwner(), this::refreshList);
|
||||
|
||||
this.initRecyclerView();
|
||||
this.initULScaleBluetoothConnection();
|
||||
|
||||
mBindings.executePendingBindings();
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
@@ -175,6 +186,7 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
|
||||
@Override
|
||||
public void onDetach() {
|
||||
mLatestCodTcol = null;
|
||||
if (mConnectedBluetoothDevice != null)
|
||||
bluetoothManager.close();
|
||||
|
||||
@@ -182,11 +194,15 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
}
|
||||
|
||||
public void setOrder(OrdineLavorazioneDTO order) {
|
||||
currentOrder.postValue(order);
|
||||
mBindings.invalidateAll();
|
||||
mAdapter.clearDataset();
|
||||
currentOrder.setValue(order);
|
||||
|
||||
mViewModel.setOrder(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) {
|
||||
@@ -196,15 +212,31 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
AtomicBigDecimal sumColli = new AtomicBigDecimal(BigDecimal.ZERO);
|
||||
AtomicBigDecimal sumNet = new AtomicBigDecimal(BigDecimal.ZERO);
|
||||
AtomicBigDecimal sumGross = new AtomicBigDecimal(BigDecimal.ZERO);
|
||||
AtomicBigDecimal sumQtaCol = new AtomicBigDecimal(BigDecimal.ZERO);
|
||||
|
||||
Stream.of(mtbColts)
|
||||
.forEach(x -> Stream.of(x.getMtbColr()).forEach(y -> {
|
||||
sumColli.getAndAdd(y.getNumCnf());
|
||||
sumNet.getAndAdd(y.getPesoNettoKg());
|
||||
sumGross.getAndAdd(y.getPesoLordoKg());
|
||||
sumQtaCol.getAndAdd(y.getQtaCol());
|
||||
}));
|
||||
|
||||
ComparatorCompat<MtbColt> c = ComparatorCompat
|
||||
.chain(
|
||||
new ComparatorCompat<MtbColt>((x, y) -> x.getDataVersD().compareTo(y.getDataVersD()))
|
||||
)
|
||||
.reversed();
|
||||
MtbColt lastUl = Stream.of(mtbColts).sorted(c).findFirstOrElse(null);
|
||||
if (lastUl != null && !UtilityString.isNullOrEmpty(lastUl.getCodTcol())) {
|
||||
mLatestCodTcol = lastUl.getCodTcol();
|
||||
}
|
||||
|
||||
currentOrder.getValue().setQtaTrasferite(sumQtaCol.get());
|
||||
this.progress.set(currentOrder.getValue().getProgress());
|
||||
sumColliNumber.set(sumColli.get());
|
||||
sumGrossKG.set(sumGross.get());
|
||||
progress.set(currentOrder.getValue().getProgress());
|
||||
sumNetKG.set(sumNet.get());
|
||||
} else {
|
||||
sumLUNumber.set(BigDecimal.ZERO);
|
||||
@@ -217,7 +249,17 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataSaved() {
|
||||
public void onDataSaved(MtbColt mtbColt) {
|
||||
String codJcom = currentOrder.getValue().getCodJcom();
|
||||
|
||||
DialogPrintUlSSCCView.newInstance(codJcom, mtbColt, result -> {
|
||||
if (result.isFlagPrintShipmentLabel() || result.isFlagPrintProductionLabel()) {
|
||||
this.mViewModel.printSavedMtbColt(result);
|
||||
} else {
|
||||
this.mViewModel.refreshMtbColts();
|
||||
}
|
||||
})
|
||||
.show(requireActivity().getSupportFragmentManager(), "DialogPrintUlSSCC");
|
||||
|
||||
}
|
||||
|
||||
@@ -225,7 +267,12 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
public void addULButtonClick() {
|
||||
this.onLoadingStarted();
|
||||
|
||||
String codProd = this.currentOrder.getValue().getCodProd();
|
||||
OrdineLavorazioneDTO currentOrder = this.currentOrder.getValue();
|
||||
if (currentOrder == null) {
|
||||
this.onError(new Exception("Nessun ordine rilevato!"));
|
||||
return;
|
||||
}
|
||||
String codProd = currentOrder.getCodProd();
|
||||
mArticoloRESTConsumer.getByCodMart(codProd, mtbAart -> {
|
||||
|
||||
String sql = "SELECT TOP 1 * " +
|
||||
@@ -234,9 +281,9 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
" * " +
|
||||
" FROM dtb_ord_steps " +
|
||||
" WHERE cod_jfas IS NOT NULL " +
|
||||
" AND gestione = " + UtilityDB.valueToString(this.currentOrder.getValue().getGestione()) +
|
||||
" AND num_ord = " + UtilityDB.valueToString(this.currentOrder.getValue().getNumOrd()) +
|
||||
" AND data_ord = " + UtilityDB.valueToString(this.currentOrder.getValue().getDataOrdD()) +
|
||||
" AND gestione = " + UtilityDB.valueToString(currentOrder.getGestione()) +
|
||||
" AND num_ord = " + UtilityDB.valueToString(currentOrder.getNumOrd()) +
|
||||
" AND data_ord = " + UtilityDB.valueToString(currentOrder.getDataOrdD()) +
|
||||
" ) tmp " +
|
||||
"WHERE data_iniz IS NOT NULL " +
|
||||
" AND (data_fine IS NULL OR last_step = id_step) " +
|
||||
@@ -247,15 +294,24 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
|
||||
this.onLoadingEnded();
|
||||
|
||||
String codTcol = currentOrder.getCodTcolUl();
|
||||
if (UtilityString.isNullOrEmpty(codTcol)) {
|
||||
if (!UtilityString.isNullOrEmpty(mLatestCodTcol)) {
|
||||
codTcol = mLatestCodTcol;
|
||||
} else {
|
||||
codTcol = mtbAart.getCodTcolUl();
|
||||
}
|
||||
}
|
||||
|
||||
DialogInputLUProdDTO dialogInputLUProdDTO = new DialogInputLUProdDTO()
|
||||
.setMtbAart(mtbAart)
|
||||
.setNumCnf(this.currentOrder.getValue().getColliPedana())
|
||||
.setNumCnf(currentOrder.getColliPedana())
|
||||
.setQtaCnf(mtbAart.getQtaCnf())
|
||||
.setQtaTot(this.currentOrder.getValue().getColliPedana().multiply(mtbAart.getQtaCnf()))
|
||||
.setPartitaMag(this.currentOrder.getValue().getPartitaMag())
|
||||
.setDataScad(this.currentOrder.getValue().getDataScadD())
|
||||
.setCodJfasParent(this.currentOrder.getValue().getCodJfas())
|
||||
.setCodTcol(this.currentOrder.getValue().getCodTcolUl())
|
||||
.setQtaTot(currentOrder.getColliPedana().multiply(mtbAart.getQtaCnf()))
|
||||
.setPartitaMag(currentOrder.getPartitaMag())
|
||||
.setDataScad(currentOrder.getDataScadD())
|
||||
.setCodJfasParent(currentOrder.getCodJfas())
|
||||
.setCodTcol(codTcol)
|
||||
.setSuggestedCodJfas(dtbOrdStep != null && dtbOrdStep.size() > 0 ? dtbOrdStep.get(0).getCodJfas() : null);
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.gest.prod_rientro_merce.order_detail;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.order_detail.rest.ProdRientroMerceOrderDetailRESTConsumer;
|
||||
|
||||
@@ -17,8 +18,9 @@ public class ProdRientroMerceOrderDetailModule {
|
||||
@Provides
|
||||
ProdRientroMerceOrderDetailViewModel provideProdRientroMerceOrderDetailViewModel(
|
||||
ProdRientroMerceOrderDetailRESTConsumer prodRientroMerceOrderDetailRESTConsumer,
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer) {
|
||||
return new ProdRientroMerceOrderDetailViewModel(prodRientroMerceOrderDetailRESTConsumer, colliMagazzinoRESTConsumer);
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||
PrinterRESTConsumer printerRESTConsumer) {
|
||||
return new ProdRientroMerceOrderDetailViewModel(prodRientroMerceOrderDetailRESTConsumer, colliMagazzinoRESTConsumer, printerRESTConsumer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,32 +6,42 @@ import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.report.ReportType;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.order_detail.rest.ProdRientroMerceOrderDetailRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.order_detail.rest.dto.ImportColliDaProduzioneRequestDTO;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.printSsccUl.dto.PrintUlDTO;
|
||||
|
||||
public class ProdRientroMerceOrderDetailViewModel {
|
||||
|
||||
public MutableLiveData<List<MtbColt>> mtbColtsOfOrder = new MutableLiveData<>();
|
||||
public final MutableLiveData<List<MtbColt>> mtbColtsOfOrder = new MutableLiveData<>();
|
||||
private OrdineLavorazioneDTO currentOrder;
|
||||
|
||||
private final ProdRientroMerceOrderDetailRESTConsumer mProdRientroMerceOrderDetailRESTConsumer;
|
||||
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||
private final PrinterRESTConsumer mPrinterRESTConsumer;
|
||||
|
||||
private Listener mListener;
|
||||
|
||||
@Inject
|
||||
public ProdRientroMerceOrderDetailViewModel(ProdRientroMerceOrderDetailRESTConsumer prodRientroMerceOrderDetailRESTConsumer,
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer) {
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||
PrinterRESTConsumer printerRESTConsumer) {
|
||||
this.mProdRientroMerceOrderDetailRESTConsumer = prodRientroMerceOrderDetailRESTConsumer;
|
||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||
this.mPrinterRESTConsumer = printerRESTConsumer;
|
||||
}
|
||||
|
||||
public void setOrder(OrdineLavorazioneDTO order) {
|
||||
@@ -40,7 +50,7 @@ public class ProdRientroMerceOrderDetailViewModel {
|
||||
refreshMtbColts();
|
||||
}
|
||||
|
||||
private void refreshMtbColts() {
|
||||
public void refreshMtbColts() {
|
||||
this.sendOnLoadingStarted();
|
||||
this.mtbColtsOfOrder.postValue(null);
|
||||
|
||||
@@ -70,7 +80,7 @@ public class ProdRientroMerceOrderDetailViewModel {
|
||||
.setCodJcom(currentOrder.getCodJcom())
|
||||
.setCodJfas(pickedQuantityDTO.getJtbFasi() != null ? pickedQuantityDTO.getJtbFasi().getCodJfas() : null)
|
||||
.setCodMart(currentOrder.getCodProd())
|
||||
.setCodTcol(pickedQuantityDTO.getMtbTCol().getCodTcol())
|
||||
.setCodTcol(pickedQuantityDTO.getMtbTCol() != null ? pickedQuantityDTO.getMtbTCol().getCodTcol() : null)
|
||||
.setDataCollo(new Date())
|
||||
.setDataOrd(currentOrder.getDataOrdD())
|
||||
.setNumOrd(currentOrder.getNumOrd())
|
||||
@@ -81,12 +91,9 @@ public class ProdRientroMerceOrderDetailViewModel {
|
||||
.setPesoNetto(pickedQuantityDTO.getPesoNetto());
|
||||
|
||||
this.mProdRientroMerceOrderDetailRESTConsumer.importColloDaProduzione(importColliDaProduzioneRequestDTO, mtbColtSaved -> {
|
||||
|
||||
synchronized (this.mtbColtsOfOrder) {
|
||||
refreshMtbColts();
|
||||
this.mListener.onDataSaved(mtbColtSaved);
|
||||
}
|
||||
|
||||
this.sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
|
||||
|
||||
@@ -136,9 +143,39 @@ public class ProdRientroMerceOrderDetailViewModel {
|
||||
if (this.mListener != null) mListener.onError(ex);
|
||||
}
|
||||
|
||||
public void printSavedMtbColt(PrintUlDTO result) {
|
||||
if (result.isFlagPrintProductionLabel()) {
|
||||
this.startPrint(result.getMtbColt(), ReportType.ETICHETTA_SSCC_LAVORAZIONE, currentOrder.getCodAnag());
|
||||
} else {
|
||||
this.loadShipmentUlFromProductionUL(result.getMtbColt(), mtbColt -> {
|
||||
this.startPrint(mtbColt, ReportType.ETICHETTA_SSCC_SPEDIZIONE, mtbColt.getCodAnag());
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void loadShipmentUlFromProductionUL(MtbColt productionUL, RunnableArgs<MtbColt> onLoad, RunnableArgs<Exception> onError) {
|
||||
this.mColliMagazzinoRESTConsumer.loadShipmentUlFromProductionUL(productionUL, onLoad, onError);
|
||||
}
|
||||
|
||||
private void startPrint(MtbColt mtbColt, ReportType reportType, String codAnag) {
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
params.put("gestione", mtbColt.getGestione());
|
||||
params.put("ser_collo", mtbColt.getSerCollo());
|
||||
params.put("num_collo", mtbColt.getNumCollo());
|
||||
params.put("data_collo", UtilityDate.formatDate(mtbColt.getDataColloD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_DASH));
|
||||
this.mPrinterRESTConsumer.printReportType(
|
||||
reportType,
|
||||
SettingsManager.i().getUserSession().getDepo().getCodMdep(),
|
||||
codAnag,
|
||||
params,
|
||||
this::refreshMtbColts,
|
||||
this::sendError);
|
||||
}
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
|
||||
void onDataSaved();
|
||||
void onDataSaved(MtbColt mtbColt);
|
||||
|
||||
void onError(Exception ex);
|
||||
|
||||
|
||||
@@ -129,15 +129,18 @@ public class ProdRientroMerceOrderListAdapter extends SectionedRecyclerViewAdapt
|
||||
case START:
|
||||
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.orderProgress.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case PAUSE:
|
||||
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.orderProgress.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case SCHEDULED:
|
||||
default:
|
||||
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.orderProgress.setVisibility(View.GONE);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -166,6 +169,8 @@ public class ProdRientroMerceOrderListAdapter extends SectionedRecyclerViewAdapt
|
||||
holder.mBinding.rightSubDescrizione.setVisibility(View.VISIBLE);
|
||||
} else holder.mBinding.rightSubDescrizione.setVisibility(View.GONE);
|
||||
|
||||
holder.mBinding.orderProgress.setProgress(listModel.getProgress());
|
||||
|
||||
holder.mBinding.executePendingBindings();
|
||||
|
||||
holder.mBinding.getRoot().setOnClickListener(v -> {
|
||||
|
||||
@@ -15,6 +15,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.annimon.stream.ComparatorCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -36,12 +37,10 @@ import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||
public class ProdRientroMerceOrderListFragment extends Fragment {
|
||||
|
||||
private final ObservableArrayList<ProdRientroMerceOrderListModel> mOrdiniApertiMutableData = new ObservableArrayList<>();
|
||||
|
||||
private FragmentProdRientroMerceOrderListBinding mBindings = null;
|
||||
|
||||
private RunnableArgs<OrdineLavorazioneDTO> mOnItemSelectedRunnable;
|
||||
|
||||
private ElevatedToolbar mToolbar;
|
||||
private OnRefreshListener onRefreshListener;
|
||||
|
||||
public ProdRientroMerceOrderListFragment() {
|
||||
// Required empty public constructor
|
||||
@@ -72,7 +71,7 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
||||
|
||||
mBindings.setLifecycleOwner(this);
|
||||
|
||||
if(savedInstanceState == null) this.initRecyclerView();
|
||||
if (savedInstanceState == null) this.initRecyclerView();
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
@@ -86,13 +85,18 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
||||
ProdRientroMerceOrderListAdapter prodRientroMerceOrderListAdapter = new ProdRientroMerceOrderListAdapter(getActivity(), mOrdiniApertiMutableData)
|
||||
.setEmptyView(this.mBindings.emptyView)
|
||||
.setOnItemChecked(x -> {
|
||||
if(mOnItemSelectedRunnable != null) mOnItemSelectedRunnable.run(x.getOriginalModel());
|
||||
if (mOnItemSelectedRunnable != null)
|
||||
mOnItemSelectedRunnable.run(x.getOriginalModel());
|
||||
});
|
||||
|
||||
this.mBindings.mainList.setAdapter(prodRientroMerceOrderListAdapter);
|
||||
this.mBindings.mainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
|
||||
this.mToolbar.setRecyclerView(mBindings.mainList);
|
||||
|
||||
this.mBindings.swiperefresh.setOnRefreshListener(() -> {
|
||||
if (onRefreshListener != null) onRefreshListener.onRefresh();
|
||||
});
|
||||
}
|
||||
|
||||
public void pushOrderList(List<OrdineLavorazioneDTO> orderList) {
|
||||
@@ -101,15 +105,25 @@ 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) {
|
||||
|
||||
ComparatorCompat<OrdineLavorazioneDTO> comparator = ComparatorCompat
|
||||
.comparing(OrdineLavorazioneDTO::getCodJfas)
|
||||
.comparing(OrdineLavorazioneDTO::getCodAnag)
|
||||
.thenComparing(ComparatorCompat.comparing(ordineLavorazioneDTO -> ordineLavorazioneDTO.getDescCommessa() != null ? ordineLavorazioneDTO.getDescCommessa() : "zzzzzzzz"))
|
||||
.thenComparing(ComparatorCompat.comparing(ordineLavorazioneDTO -> ordineLavorazioneDTO.getDataConsCommessaD() != null ? String.valueOf(ordineLavorazioneDTO.getDataConsCommessaD().getTime()) : "999999999999")).reversed()
|
||||
.thenComparing(ComparatorCompat.comparing(ordineLavorazioneDTO -> ordineLavorazioneDTO.getDataOrd() != null ? ordineLavorazioneDTO.getDataOrd() : "zzzzzzzz")).reversed()
|
||||
.thenComparing(ComparatorCompat.comparing(OrdineLavorazioneDTO::getNumOrd));
|
||||
|
||||
if(dataList == null) return new ArrayList<>();
|
||||
if (dataList == null) return new ArrayList<>();
|
||||
|
||||
List<ProdRientroMerceOrderListModel> notHiddenElements = Stream.of(dataList)
|
||||
.sorted(comparator)
|
||||
@@ -129,10 +143,14 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
||||
break;
|
||||
}
|
||||
|
||||
listModel.setGroupTitle(x.getCodJfas());
|
||||
listModel.setGroupTitle(x.getRagSocAnag());
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(x.getRagSocAnag()))
|
||||
listModel.setPreDescription("Provenienza: " + x.getRagSocAnag());
|
||||
if (!UtilityString.isNullOrEmpty(x.getDataConsCommessa())) {
|
||||
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();
|
||||
listModel.setDescription(testataOrdString);
|
||||
@@ -141,11 +159,27 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
||||
|
||||
listModel.setRightDescription(x.getCodJcom() != null ? (x.getDescCommessa() + " (" + x.getCodJcom() + ")") : "");
|
||||
|
||||
try {
|
||||
listModel.setProgress(x.getProgress());
|
||||
int numPedane = x.getNumCnf().divide(x.getColliPedana(), 0, RoundingMode.DOWN).intValue();
|
||||
int numCnf = x.getNumCnf().remainder(x.getColliPedana()).intValue();
|
||||
String qtaOrdLabel = "";
|
||||
if (numPedane > 0) {
|
||||
qtaOrdLabel += numPedane + "UL x " + x.getColliPedana().stripTrailingZeros().toPlainString() + " COL";
|
||||
if (numCnf > 0) {
|
||||
qtaOrdLabel += " + ";
|
||||
}
|
||||
}
|
||||
if (numCnf > 0) {
|
||||
qtaOrdLabel += numCnf + " COL";
|
||||
}
|
||||
|
||||
// listModel.setRightSubDescription(x.getNumCnf().stripTrailingZeros().toPlainString() + " COL");
|
||||
listModel.setRightSubDescription(qtaOrdLabel);
|
||||
/*try {
|
||||
listModel.setRightSubDescription(UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
listModel.setOriginalModel(x);
|
||||
|
||||
@@ -164,4 +198,13 @@ public class ProdRientroMerceOrderListFragment extends Fragment {
|
||||
public RecyclerView getList() {
|
||||
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 rightDescription;
|
||||
private String rightSubDescription;
|
||||
private int progress;
|
||||
|
||||
private boolean hidden;
|
||||
|
||||
@@ -105,4 +106,13 @@ public class ProdRientroMerceOrderListModel implements Cloneable {
|
||||
START,
|
||||
SCHEDULED
|
||||
}
|
||||
|
||||
public int getProgress() {
|
||||
return progress;
|
||||
}
|
||||
|
||||
public ProdRientroMerceOrderListModel setProgress(int progress) {
|
||||
this.progress = progress;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package it.integry.integrywmsnative.gest.prod_versamento_materiale.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Date;
|
||||
|
||||
import it.integry.integrywmsnative.core.di.BindableFloat;
|
||||
@@ -50,6 +51,7 @@ public class OrdineLavorazioneDTO {
|
||||
|
||||
private String dataScad;
|
||||
|
||||
|
||||
private String partitaMagSuggested;
|
||||
|
||||
private String dataScadSuggested;
|
||||
@@ -90,6 +92,8 @@ public class OrdineLavorazioneDTO {
|
||||
|
||||
private String descCommessa;
|
||||
|
||||
private String dataConsCommessa;
|
||||
|
||||
private BigDecimal prodStd;
|
||||
|
||||
private Object mtbColtToEdit;
|
||||
@@ -135,6 +139,7 @@ public class OrdineLavorazioneDTO {
|
||||
public String getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public Date getDataOrdD() {
|
||||
return UtilityDate.recognizeDateWithExceptionHandler(dataOrd);
|
||||
}
|
||||
@@ -490,4 +495,32 @@ public class OrdineLavorazioneDTO {
|
||||
public OrdineLavorazioneStatoEnum getStatoEnum() {
|
||||
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.scanArtSpinner.setVisibility(articoli.size() > 0 ? View.GONE : View.VISIBLE);
|
||||
|
||||
if (articoli.isEmpty() && isOrderNewProdsForced()) {
|
||||
if (mOrdine.isOrderNewProducts() && articoli.isEmpty() && isOrderNewProdsForced()) {
|
||||
this.mViewModel.orderNewProducts();
|
||||
mOrdine.setOrderNewProducts(false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -163,6 +163,7 @@ public class PVOrdineAcquistoEditViewModel {
|
||||
articolo.setMerceDaRic(artGrid.getMerceDaRic());
|
||||
articolo.setNewNoPromo(artGrid.isNewNoPromo());
|
||||
articolo.setFlagQtaMultipla(artGrid.getFlagQtaMultipla());
|
||||
articolo.setSystemNote(artGrid.generateSystemNote());
|
||||
|
||||
onSuccess.run(articolo);
|
||||
} else {
|
||||
@@ -219,7 +220,6 @@ public class PVOrdineAcquistoEditViewModel {
|
||||
.isEmpty()
|
||||
) {
|
||||
ArticoloOrdine dto = articolo.convertToArticoloOrdine(mCurrentOrdine);
|
||||
dto.setQtaOrd(dto.getQtaCnf());
|
||||
articoliToSave.add(dto);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -28,6 +28,8 @@ public class ArtDTO {
|
||||
|
||||
private String dataScad;
|
||||
|
||||
private String systemNote;
|
||||
|
||||
public Integer getRigaOrd() {
|
||||
return rigaOrd;
|
||||
}
|
||||
@@ -63,6 +65,7 @@ public class ArtDTO {
|
||||
public String getDataIns() {
|
||||
return dataIns;
|
||||
}
|
||||
|
||||
public Date getDataInsD() {
|
||||
return UtilityDate.recognizeDateWithExceptionHandler(getDataIns());
|
||||
}
|
||||
@@ -70,6 +73,7 @@ public class ArtDTO {
|
||||
public void setDataIns(String dataIns) {
|
||||
this.dataIns = dataIns;
|
||||
}
|
||||
|
||||
public void setDataInsD(Date dataIns) {
|
||||
setDataIns(UtilityDate.formatDate(dataIns, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH));
|
||||
}
|
||||
@@ -122,6 +126,7 @@ public class ArtDTO {
|
||||
public void setDataScad(String dataScad) {
|
||||
this.dataScad = dataScad;
|
||||
}
|
||||
|
||||
public Date getDataScadD() {
|
||||
return UtilityDate.recognizeDateWithExceptionHandler(getDataScad());
|
||||
}
|
||||
@@ -130,5 +135,12 @@ public class ArtDTO {
|
||||
setDataScad(UtilityDate.formatDate(dataScad, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH));
|
||||
}
|
||||
|
||||
public String getSystemNote() {
|
||||
return systemNote;
|
||||
}
|
||||
|
||||
public ArtDTO setSystemNote(String systemNote) {
|
||||
this.systemNote = systemNote;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ public class OrdineAcquistoPvHelper {
|
||||
Ordine ordine = new Ordine();
|
||||
ordine.setDataIns(UtilityDate.getDateInstance());
|
||||
ordine.setIdGriglia(griglia.getGrigliaId());
|
||||
ordine.setOrderNewProducts(true);
|
||||
mOrdineRepository.insert(ordine, id -> {
|
||||
ordine.setOrdineId(id);
|
||||
onSuccess.run(ordine);
|
||||
|
||||
@@ -37,7 +37,6 @@ import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.interfaces.ILifecycleFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.IPoppableActivity;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
@@ -64,7 +63,7 @@ import it.integry.integrywmsnative.view.dialogs.choose_art_from_lista_arts.Dialo
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUView;
|
||||
import it.integry.integrywmsnative.view.dialogs.yes_no.DialogYesNo;
|
||||
import it.integry.integrywmsnative.view.dialogs.yes_no.DialogYesNoView;
|
||||
|
||||
public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFragment, ILifecycleFragment, RettificaGiacenzeViewModel.Listener, BottomSheetMtbColrEditView.Listener {
|
||||
|
||||
@@ -289,8 +288,8 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArtListLoaded(ArrayList<MtbAart> artList) {
|
||||
DialogChooseArtFromListaArts.make(getActivity(), artList, mtbAart -> mViewModel.dispatchArt(mtbAart, null)).show();
|
||||
public void onArtListLoaded(ArrayList<MtbAart> artList, RunnableArgs<MtbAart> onArtChoosed) {
|
||||
DialogChooseArtFromListaArts.make(getActivity(), artList, onArtChoosed).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -319,32 +318,31 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
this.currentMtbColtObs.set(null);
|
||||
thereIsAnOpenedUL.set(false);
|
||||
|
||||
|
||||
if (getActivity() != null) ((IPoppableActivity) getActivity()).pop();
|
||||
this.mViewModel.requestLU();
|
||||
/*if (getActivity() != null) ((IPoppableActivity) getActivity()).pop();*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete) {
|
||||
String text = getResources().getString(R.string.alert_delete_mtb_colr);
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text),
|
||||
null,
|
||||
() -> onComplete.run(true),
|
||||
() -> onComplete.run(false)
|
||||
)
|
||||
null,
|
||||
() -> onComplete.run(true),
|
||||
() -> onComplete.run(false)
|
||||
)
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
this.onLoadingEnded();
|
||||
BarcodeManager.enable();
|
||||
|
||||
if (ex instanceof InvalidPesoKGException) {
|
||||
UtilityToast.showToast(ex.getMessage());
|
||||
} else {
|
||||
UtilityExceptions.defaultException(requireActivity(), ex, mCurrentProgress);
|
||||
UtilityExceptions.defaultException(requireActivity(), ex);
|
||||
}
|
||||
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -354,6 +352,10 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
BigDecimal initialNumCnf,
|
||||
BigDecimal initialQtaCnf,
|
||||
BigDecimal initialQtaTot,
|
||||
BigDecimal totalQtaInWarehouse,
|
||||
BigDecimal totalNumCnfInWarehouse,
|
||||
BigDecimal totalQtaCommitted,
|
||||
BigDecimal totalNumCnfCommitted,
|
||||
BigDecimal totalQtaToBeTaken,
|
||||
BigDecimal totalNumCnfToBeTaken,
|
||||
BigDecimal qtaCnfToBeTaken,
|
||||
@@ -369,6 +371,10 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
.setInitialNumCnf(initialNumCnf)
|
||||
.setInitialQtaCnf(initialQtaCnf)
|
||||
.setInitialQtaTot(initialQtaTot)
|
||||
.setTotalQtaInWarehouse(totalQtaInWarehouse)
|
||||
.setTotalNumCnfInWarehouse(totalNumCnfInWarehouse)
|
||||
.setTotalQtaCommitted(totalQtaCommitted)
|
||||
.setTotalNumCnfCommitted(totalNumCnfCommitted)
|
||||
.setTotalQtaToBeTaken(totalQtaToBeTaken)
|
||||
.setTotalNumCnfToBeTaken(totalNumCnfToBeTaken)
|
||||
.setQtaCnfToBeTaken(qtaCnfToBeTaken)
|
||||
@@ -448,11 +454,11 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
@Override
|
||||
public void onLUPrintRequest(RunnableArgs<Boolean> onComplete) {
|
||||
DialogSimpleMessageView.makeInfoDialog(
|
||||
getActivity().getResources().getString(R.string.action_print_ul),
|
||||
new SpannableString(getActivity().getResources().getString(R.string.ask_print_message)),
|
||||
null,
|
||||
() -> onComplete.run(true),
|
||||
() -> onComplete.run(false))
|
||||
getActivity().getResources().getString(R.string.action_print_ul),
|
||||
new SpannableString(getActivity().getResources().getString(R.string.ask_print_message)),
|
||||
null,
|
||||
() -> onComplete.run(true),
|
||||
() -> onComplete.run(false))
|
||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
||||
;
|
||||
}
|
||||
@@ -460,17 +466,17 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
@Override
|
||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||
DialogSimpleMessageView.makeErrorDialog(
|
||||
new SpannableString(ex.getMessage()),
|
||||
null,
|
||||
null,
|
||||
R.string.button_ignore_print,
|
||||
onComplete)
|
||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
||||
new SpannableString(ex.getMessage()),
|
||||
null,
|
||||
null,
|
||||
R.string.button_ignore_print,
|
||||
onComplete)
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLUPositionChangeRequest(RunnableArgss<Boolean, MtbDepoPosizione> onComplete) {
|
||||
DialogYesNo.make(getActivity(), "Posiziona UL", "Vuoi cambiare la posizione della UL corrente?", result -> {
|
||||
new DialogYesNoView(null, "Vuoi cambiare la posizione della UL corrente?", result -> {
|
||||
switch (result) {
|
||||
case YES:
|
||||
DialogAskPositionOfLU.makeBase(getActivity(), false, (status, mtbDepoPosizione) -> {
|
||||
@@ -490,12 +496,16 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
onComplete.run(false, null);
|
||||
break;
|
||||
}
|
||||
}).show();
|
||||
}).show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreDestroy(Runnable onComplete) {
|
||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||
mViewModel.closeLU(false, onComplete);
|
||||
if(mViewModel.getCurrentMtbColt() != null)
|
||||
mViewModel.closeLU(false);
|
||||
else {
|
||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||
onComplete.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user