Finish v1.31.02(336)
This commit is contained in:
commit
094f9b68f6
6
.idea/kotlinc.xml
generated
Normal file
6
.idea/kotlinc.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="1.8.0" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="app_base" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
||||
<module name="WMS.app" />
|
||||
<configuration default="false" name="app" type="AndroidRunConfigurationType" factoryName="Android App">
|
||||
<module name="WMS.app.main" />
|
||||
<option name="DEPLOY" value="true" />
|
||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||
@ -8,13 +8,12 @@
|
||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||
<option name="ALL_USERS" value="false" />
|
||||
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS.dynamic_vgalimenti" />
|
||||
<option name="CLEAR_APP_STORAGE" value="false" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS.dynamic__base,WMS.dynamic_vgalimenti" />
|
||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||
<option name="MODE" value="default_activity" />
|
||||
<option name="CLEAR_LOGCAT" value="true" />
|
||||
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
|
||||
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
|
||||
<option name="FORCE_STOP_RUNNING_APP" value="true" />
|
||||
<option name="CLEAR_LOGCAT" value="false" />
|
||||
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
|
||||
<option name="INSPECTION_WITHOUT_ACTIVITY_RESTART" value="false" />
|
||||
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
|
||||
@ -46,7 +45,7 @@
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Callstack Sample" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Java/Kotlin Method Sample (legacy)" />
|
||||
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
|
||||
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
|
||||
</Profilers>
|
||||
61
.idea/runConfigurations/app_vglimenti.xml
generated
61
.idea/runConfigurations/app_vglimenti.xml
generated
@ -1,61 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="app_vglimenti" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
||||
<module name="WMS.app" />
|
||||
<option name="DEPLOY" value="true" />
|
||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||
<option name="ARTIFACT_NAME" value="" />
|
||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||
<option name="ALL_USERS" value="false" />
|
||||
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="WMS.dynamic__base" />
|
||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||
<option name="MODE" value="default_activity" />
|
||||
<option name="CLEAR_LOGCAT" value="true" />
|
||||
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" />
|
||||
<option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
|
||||
<option name="FORCE_STOP_RUNNING_APP" value="true" />
|
||||
<option name="INSPECTION_WITHOUT_ACTIVITY_RESTART" value="false" />
|
||||
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
|
||||
<option name="DEBUGGER_TYPE" value="Auto" />
|
||||
<Auto>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
</Auto>
|
||||
<Hybrid>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
</Hybrid>
|
||||
<Java />
|
||||
<Native>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
</Native>
|
||||
<Profilers>
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Callstack Sample" />
|
||||
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
|
||||
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
|
||||
</Profilers>
|
||||
<option name="DEEP_LINK" value="" />
|
||||
<option name="ACTIVITY_CLASS" value="" />
|
||||
<option name="SEARCH_ACTIVITY_IN_GLOBAL_SCOPE" value="false" />
|
||||
<option name="SKIP_ACTIVITY_VALIDATION" value="false" />
|
||||
<method v="2">
|
||||
<option name="Android.Gradle.BeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 330
|
||||
def appVersionName = '1.30.12'
|
||||
def appVersionCode = 336
|
||||
def appVersionName = '1.31.2'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@ -62,11 +62,12 @@ android {
|
||||
}
|
||||
|
||||
android.buildFeatures.dataBinding true
|
||||
android.buildFeatures.buildConfig true
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
//coreLibraryDesugaringEnabled true
|
||||
coreLibraryDesugaringEnabled true
|
||||
}
|
||||
|
||||
productFlavors {
|
||||
@ -85,9 +86,6 @@ android {
|
||||
options.compilerArgs << "-Xmaxerrs" << "10000"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
dynamicFeatures = [":dynamic__base", ":dynamic_vgalimenti"]
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
@ -97,6 +95,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.2'
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
@ -115,7 +114,7 @@ dependencies {
|
||||
implementation 'com.google.android.gms:play-services-basement:18.1.0'
|
||||
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.6.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.android.material:material:1.8.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
@ -188,7 +187,6 @@ dependencies {
|
||||
// RxJava is also required.
|
||||
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
|
||||
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"formatVersion": 1,
|
||||
"database": {
|
||||
"version": 13,
|
||||
"identityHash": "bc3841159bac7a7731fe39a5fa4f0f4e",
|
||||
"identityHash": "bef89b513f0a4d5ecd9c2111e2e614a4",
|
||||
"entities": [
|
||||
{
|
||||
"tableName": "articoli_griglia",
|
||||
@ -112,10 +112,10 @@
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"articolo_griglia_id"
|
||||
],
|
||||
"autoGenerate": true
|
||||
]
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
@ -172,10 +172,10 @@
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"griglia_id"
|
||||
],
|
||||
"autoGenerate": true
|
||||
]
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
@ -262,10 +262,10 @@
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"ordine_id"
|
||||
],
|
||||
"autoGenerate": true
|
||||
]
|
||||
},
|
||||
"indices": [],
|
||||
"foreignKeys": []
|
||||
@ -366,10 +366,10 @@
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"articolo_ordine_id"
|
||||
],
|
||||
"autoGenerate": true
|
||||
]
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
@ -580,10 +580,10 @@
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"autoGenerate": true
|
||||
]
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
@ -829,10 +829,10 @@
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"autoGenerate": true
|
||||
]
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
@ -874,7 +874,7 @@
|
||||
},
|
||||
{
|
||||
"tableName": "inventari",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `id_inventario` INTEGER, `cod_mdep` TEXT NOT NULL, `data_inventario` INTEGER, `data_reg` INTEGER, `data_ver` INTEGER, `filtro` TEXT, `flag_stato` TEXT, `flag_operazione` TEXT, `cod_anag` TEXT, `cod_dtip` TEXT, `inserito_da` TEXT, `registrato_da` TEXT, `verificato_da` TEXT, `data_ora_inizio` INTEGER, `data_ora_fine` INTEGER, `causale` TEXT, `zona` TEXT, `remote_sync_date` INTEGER)",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `id_inventario` INTEGER, `cod_mdep` TEXT NOT NULL, `data_inventario` INTEGER, `data_reg` INTEGER, `data_ver` INTEGER, `filtro` TEXT, `flag_stato` TEXT, `flag_operazione` TEXT, `cod_anag` TEXT, `cod_dtip` TEXT, `inserito_da` TEXT, `registrato_da` TEXT, `verificato_da` TEXT, `data_ora_inizio` INTEGER, `data_ora_fine` INTEGER, `causale` TEXT, `zona` TEXT, `new` INTEGER, `remote_sync_date` INTEGER)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
@ -984,6 +984,12 @@
|
||||
"affinity": "TEXT",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "isNew",
|
||||
"columnName": "new",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "remoteSyncDate",
|
||||
"columnName": "remote_sync_date",
|
||||
@ -992,10 +998,10 @@
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"_id"
|
||||
],
|
||||
"autoGenerate": true
|
||||
]
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
@ -1107,10 +1113,10 @@
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"_id"
|
||||
],
|
||||
"autoGenerate": true
|
||||
]
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
@ -1150,7 +1156,7 @@
|
||||
"views": [],
|
||||
"setupQueries": [
|
||||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'bc3841159bac7a7731fe39a5fa4f0f4e')"
|
||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'bef89b513f0a4d5ecd9c2111e2e614a4')"
|
||||
]
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -3,11 +3,13 @@ package it.integry.integrywmsnative;
|
||||
import android.app.Application;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.util.Log;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.context.AppContext;
|
||||
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
|
||||
|
||||
public class MainApplication extends Application {
|
||||
@ -19,6 +21,8 @@ public class MainApplication extends Application {
|
||||
public static MainApplicationModule appModule;
|
||||
public static RoomModule roomModule;
|
||||
|
||||
private Thread.UncaughtExceptionHandler defaultUncaughtExceptionHandler;
|
||||
|
||||
@Inject
|
||||
AppContext appContext;
|
||||
|
||||
@ -40,6 +44,9 @@ public class MainApplication extends Application {
|
||||
appComponent.inject(this);
|
||||
|
||||
res = getResources();
|
||||
|
||||
defaultUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
|
||||
Thread.setDefaultUncaughtExceptionHandler(_unCaughtExceptionHandler);
|
||||
}
|
||||
|
||||
// Called by the system when the device configuration changes while your component is running.
|
||||
@ -61,4 +68,22 @@ public class MainApplication extends Application {
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
|
||||
// handler listener
|
||||
private Thread.UncaughtExceptionHandler _unCaughtExceptionHandler =
|
||||
new Thread.UncaughtExceptionHandler() {
|
||||
@Override
|
||||
public void uncaughtException(Thread thread, Throwable ex) {
|
||||
try {
|
||||
UtilityLogger.error(new Exception(ex));
|
||||
} catch (Exception e) {
|
||||
Log.e("Uncaught error", "Exception Logger failed!", e);
|
||||
//MainApplication.exit();
|
||||
}
|
||||
|
||||
// re-throw critical exception further to the os (important)
|
||||
defaultUncaughtExceptionHandler.uncaughtException(thread, ex);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -74,6 +74,8 @@ import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigl
|
||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.dialogs.DialogScanGrigliaAcquistoComponent;
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeComponent;
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeModule;
|
||||
import it.integry.integrywmsnative.gest.settings.MainSettingsComponent;
|
||||
import it.integry.integrywmsnative.gest.settings.MainSettingsModule;
|
||||
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;
|
||||
@ -169,6 +171,7 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
BottomSheetInventarioRowActionsModule.class,
|
||||
BottomSheetMtbColrEditModalModule.class,
|
||||
DialogChooseArtsFromMtbAartListModule.class,
|
||||
MainSettingsModule.class,
|
||||
|
||||
})
|
||||
public interface MainApplicationComponent {
|
||||
@ -285,6 +288,8 @@ public interface MainApplicationComponent {
|
||||
|
||||
DialogChooseArtsFromMtbAartListComponent.Factory dialogDialogDialogChooseArtsFromMtbAartListViewComponent();
|
||||
|
||||
MainSettingsComponent.Factory mainSettingsFragmentComponent();
|
||||
|
||||
void inject(MainApplication mainApplication);
|
||||
|
||||
void inject(AppContext mainApplication);
|
||||
|
||||
@ -5,8 +5,9 @@ public class CommonConst {
|
||||
public static class Login {
|
||||
|
||||
public static class Azienda {
|
||||
public static String protocol = "https";
|
||||
public static String host = "www2.studioml.it";
|
||||
public static int port = 80;
|
||||
public static int port = 443;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.class_router;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityHashMap;
|
||||
|
||||
public class BaseCustomConfiguration implements ICustomConfiguration {
|
||||
|
||||
|
||||
public static class Keys {
|
||||
public static int FLAG_SHOW_COD_FORN_IN_SPEDIZIONE = 1;
|
||||
public static int CUSTOM_DYNAMIC_VERSION_PATH = 2;
|
||||
public static int FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC = 3;
|
||||
}
|
||||
|
||||
protected HashMap<Integer, Object> configurations = new HashMap<>() {{
|
||||
put(Keys.FLAG_SHOW_COD_FORN_IN_SPEDIZIONE, true);
|
||||
put(Keys.FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC, false);
|
||||
}};
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public <T> T getConfig(int key) {
|
||||
return UtilityHashMap.getValue(configurations, key);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,84 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.class_router;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ClassRouter {
|
||||
|
||||
public enum PATH {
|
||||
FILTRO_ORDINI_VENDITA,
|
||||
ORDINI_VENDITA,
|
||||
CUSTOM_CONFIGURATION,
|
||||
BARCODE_CUSTOMIZATION
|
||||
}
|
||||
|
||||
private static Context context;
|
||||
|
||||
private static List<Pair<PATH, Object>> mRouteClasses = new ArrayList<>();
|
||||
|
||||
public static void init() {
|
||||
// ClassRouter.context = context;
|
||||
}
|
||||
|
||||
private static boolean checkIClassExists(PATH path) {
|
||||
boolean methodAlreadyDeclared = false;
|
||||
|
||||
for(int i = 0; i < mRouteClasses.size() && !methodAlreadyDeclared; i++) {
|
||||
if(mRouteClasses.get(i).first == path) methodAlreadyDeclared = true;
|
||||
}
|
||||
|
||||
return methodAlreadyDeclared;
|
||||
}
|
||||
|
||||
|
||||
private static int getClassIndex(PATH path) {
|
||||
for(int i = 0; i < mRouteClasses.size(); i++) {
|
||||
if(mRouteClasses.get(i).first == path) return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static void registerPath(PATH path, Class clazz) {
|
||||
if(checkIClassExists(path)) {
|
||||
//throw new MethodPathAlreadyDeclaredException(path);
|
||||
}
|
||||
|
||||
try {
|
||||
mRouteClasses.add(new Pair<>(path, clazz.newInstance()));
|
||||
} catch (IllegalAccessException | InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void deregisterPath(PATH path) {
|
||||
if(checkIClassExists(path)) {
|
||||
mRouteClasses.remove(getClassIndex(path));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static <T> T getInstance(PATH path) {
|
||||
try {
|
||||
|
||||
if (!checkIClassExists(path)) {
|
||||
// throw new MethodPathNotRegisteredException(path);
|
||||
}
|
||||
|
||||
Object instance = mRouteClasses.get(getClassIndex(path)).second;
|
||||
|
||||
return (T)instance;
|
||||
|
||||
} catch (Exception ex) {
|
||||
// UtilityExceptions.defaultException(null, ex, true);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.class_router.exceptions;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||
|
||||
public class MethodPathNotRegisteredException extends Exception {
|
||||
|
||||
public MethodPathNotRegisteredException(ClassRouter.PATH path) {
|
||||
super(String.format("Path %s is not registered", path.toString()));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.class_router.interfaces;
|
||||
|
||||
public interface IBarcodeCustomization {
|
||||
|
||||
boolean shouldForceToEan13(String barcode);
|
||||
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.class_router.interfaces;
|
||||
|
||||
public interface ICustomConfiguration {
|
||||
|
||||
<T>T getConfig(int key);
|
||||
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.class_router.interfaces;
|
||||
|
||||
public interface IFiltroOrdiniVendita {
|
||||
|
||||
boolean shoudShowCodMdepFilter();
|
||||
|
||||
boolean shoudShowIdViaggioFilter();
|
||||
|
||||
boolean shoudShowAgenteFilter();
|
||||
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.class_router.interfaces;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||
|
||||
public interface OrdiniVenditaInterface {
|
||||
|
||||
boolean isTrasfOrder(List<OrdineUscitaInevasoDTO> testateOrdini);
|
||||
|
||||
}
|
||||
@ -34,6 +34,8 @@ public class AppContext {
|
||||
@Inject
|
||||
SettingsManager mSettingsManager;
|
||||
|
||||
private File logsFolder;
|
||||
|
||||
public AppContext(Context context) {
|
||||
this.mApplicationContext = context;
|
||||
|
||||
@ -53,6 +55,10 @@ public class AppContext {
|
||||
this.initLogger();
|
||||
}
|
||||
|
||||
public File getLogFilePath() {
|
||||
return logsFolder;
|
||||
}
|
||||
|
||||
|
||||
private void initSettings() {
|
||||
Stash.init(mApplicationContext);
|
||||
@ -82,10 +88,9 @@ public class AppContext {
|
||||
private void initLogger() {
|
||||
Logger.addLogAdapter(new AndroidLogAdapter());
|
||||
|
||||
File logsFolder = new File(mApplicationContext.getExternalFilesDir(null).getAbsolutePath());
|
||||
logsFolder = new File(mApplicationContext.getExternalFilesDir(null).getAbsolutePath());
|
||||
int maxBytesSize = 5 * 1024 * 1024;
|
||||
Logger.addLogAdapter(new DiskLogAdapter(logsFolder, maxBytesSize));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6,13 +6,11 @@ import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.SpannedString;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.ConnectException;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
||||
import it.integry.integrywmsnative.core.menu.MenuService;
|
||||
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
||||
@ -44,8 +42,7 @@ public class MainContext {
|
||||
|
||||
this.initDBData(() -> {
|
||||
this.initMenu(() -> {
|
||||
|
||||
this.initReflections();
|
||||
|
||||
if (mListener != null) mListener.onContextInitialized();
|
||||
});
|
||||
});
|
||||
@ -103,30 +100,6 @@ public class MainContext {
|
||||
});
|
||||
}
|
||||
|
||||
private void initReflections() {
|
||||
ClassRouter.init();
|
||||
|
||||
try {
|
||||
String initMethod = "init";
|
||||
|
||||
Class dynamicContextClass = Class.forName("it.integry.wms.dynamic_customization.DynamicContext");
|
||||
|
||||
Method[] methods = dynamicContextClass.getMethods();
|
||||
for (Method m : methods) {
|
||||
if (initMethod.equals(m.getName())) {
|
||||
// for static methods we can use null as instance of class
|
||||
final Object newInstance = dynamicContextClass.newInstance();
|
||||
|
||||
m.invoke(newInstance, applicationContext);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
// UtilityExceptions.defaultException(mContext, e, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public MainContext setListener(Listener listener) {
|
||||
this.mListener = listener;
|
||||
|
||||
@ -40,7 +40,7 @@ import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
InventarioRoomDTO.class,
|
||||
InventarioRowRoomDTO.class
|
||||
},
|
||||
version = 13,
|
||||
version = 14,
|
||||
exportSchema = true)
|
||||
@TypeConverters({
|
||||
DateConverter.class,
|
||||
@ -66,7 +66,8 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
AppDatabase.class, "integry_wms")
|
||||
.addMigrations(MIGRATION_10_11)
|
||||
.addMigrations(MIGRATION_11_12)
|
||||
.addMigrations(MIGRATION_12_13);
|
||||
.addMigrations(MIGRATION_12_13)
|
||||
.addMigrations(MIGRATION_13_14);
|
||||
|
||||
sInstance = builder.build();
|
||||
}
|
||||
@ -126,4 +127,12 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
database.execSQL("CREATE INDEX IF NOT EXISTS index_inventario_rows__parent_id ON inventario_rows (parent_id)");
|
||||
}
|
||||
};
|
||||
|
||||
static final Migration MIGRATION_13_14 = new Migration(13, 14) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
database.execSQL("ALTER TABLE inventari"
|
||||
+ " ADD COLUMN new INTEGER");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -184,7 +184,7 @@ public class RoomModule {
|
||||
InventarioLocalDataSource inventarioLocalDataSource,
|
||||
InventarioRESTConsumer inventarioRESTConsumer,
|
||||
InventarioMapper inventarioMapper) {
|
||||
return new InventarioRepository(inventarioLocalDataSource, inventarioRESTConsumer, inventarioMapper, handler);
|
||||
return new InventarioRepository(inventarioLocalDataSource, inventarioRESTConsumer, inventarioMapper, handler, executorService);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
|
||||
@ -35,6 +35,7 @@ public class InventarioRoomDTO extends BaseSyncDTO implements EntityModelInterfa
|
||||
public static final String DATA_ORA_FINE = "data_ora_fine";
|
||||
public static final String CAUSALE = "causale";
|
||||
public static final String ZONA = "zona";
|
||||
public static final String IS_NEW = "new";
|
||||
}
|
||||
|
||||
/** The unique ID of the cheese. */
|
||||
@ -95,6 +96,9 @@ public class InventarioRoomDTO extends BaseSyncDTO implements EntityModelInterfa
|
||||
@ColumnInfo(name = Columns.ZONA)
|
||||
private String zona;
|
||||
|
||||
@ColumnInfo(name = Columns.IS_NEW)
|
||||
private Boolean isNew;
|
||||
|
||||
@Ignore
|
||||
private List<InventarioRowRoomDTO> inventarioRowList;
|
||||
|
||||
@ -235,6 +239,14 @@ public class InventarioRoomDTO extends BaseSyncDTO implements EntityModelInterfa
|
||||
this.zona = zona;
|
||||
}
|
||||
|
||||
public Boolean isNew() {
|
||||
return isNew;
|
||||
}
|
||||
|
||||
public void setNew(Boolean aNew) {
|
||||
isNew = aNew;
|
||||
}
|
||||
|
||||
public List<InventarioRowRoomDTO> getInventarioRowList() {
|
||||
return inventarioRowList;
|
||||
}
|
||||
|
||||
@ -1,12 +1,16 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.respository_new;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@ -17,9 +21,12 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.mapper.InventarioMapper;
|
||||
import it.integry.integrywmsnative.core.model.MtbInvent;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.InventarioRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLiveData;
|
||||
|
||||
public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioRoomDTO, InventarioMapper, InventarioLocalDataSource, InventarioRESTConsumer> {
|
||||
|
||||
private final ExecutorService executorService;
|
||||
|
||||
private final Handler handler;
|
||||
|
||||
private final MutableLiveData<List<InventarioRoomDTO>> internalLiveData = new MutableLiveData<>();
|
||||
@ -28,22 +35,49 @@ public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioR
|
||||
public InventarioRepository(InventarioLocalDataSource localDataSource,
|
||||
InventarioRESTConsumer remoteDataSource,
|
||||
InventarioMapper dataMapper,
|
||||
Handler handler) {
|
||||
Handler handler,
|
||||
ExecutorService executorService) {
|
||||
super(dataMapper, localDataSource, remoteDataSource);
|
||||
this.handler = handler;
|
||||
this.executorService = executorService;
|
||||
}
|
||||
|
||||
|
||||
public LiveData<List<InventarioRoomDTO>> retrieve() {
|
||||
public LiveData<List<InventarioRoomDTO>> retrieve(Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
localDataSource.makeSynchronousRetrieveAllLive(false)
|
||||
.observeOn(Schedulers.io())
|
||||
.subscribe(internalLiveData::postValue);
|
||||
// refresh(onComplete, onError);
|
||||
|
||||
UtilityLiveData.observeOnce(internalLiveData, inventories -> {
|
||||
refresh(onComplete, onError);
|
||||
});
|
||||
|
||||
|
||||
return internalLiveData;
|
||||
}
|
||||
|
||||
|
||||
public void refresh(Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
var startRetrieve = new Date();
|
||||
var remoteData = remoteDataSource.makeSynchronousRetrieveRequest();
|
||||
Log.d("Timing [INVENTORIES RETRIEVE]", ((new Date().getTime() - startRetrieve.getTime()) / 1000) + " secs");
|
||||
|
||||
if (remoteData == null) remoteData = new ArrayList<>();
|
||||
|
||||
resolveFetch(remoteData, internalLiveData.getValue(),
|
||||
(remoteItem, localItem) -> Objects.equals(remoteItem.getIdInventario(), localItem.getIdInventario()),
|
||||
(remoteItem, localItem) -> {
|
||||
remoteItem.setNew(true);
|
||||
}, onComplete, onError);
|
||||
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void insert(InventarioRoomDTO inventarioDTO, Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
localDataSource.makeInsertRequest(inventarioDTO, localResult -> {
|
||||
if (onComplete != null) handler.post(onComplete);
|
||||
@ -60,7 +94,7 @@ public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioR
|
||||
}, onError);
|
||||
}
|
||||
|
||||
public void delete(InventarioRoomDTO inventarioDTO, Runnable onComplete, RunnableArgs<Exception> onError){
|
||||
public void delete(InventarioRoomDTO inventarioDTO, Runnable onComplete, RunnableArgs<Exception> onError) {
|
||||
localDataSource.makeDeleteRequest(inventarioDTO, onComplete, onError);
|
||||
}
|
||||
|
||||
|
||||
@ -1,74 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Environment;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.view.dialogs.exception.DialogException;
|
||||
|
||||
public class ExceptionsHandler implements Thread.UncaughtExceptionHandler {
|
||||
|
||||
private final static String TAG = ExceptionsHandler.class.getSimpleName();
|
||||
|
||||
private final Activity context;
|
||||
|
||||
public static void init(Activity context) {
|
||||
new ExceptionsHandler(context);
|
||||
}
|
||||
|
||||
private ExceptionsHandler(Activity context) {
|
||||
this.context = context;
|
||||
|
||||
//if (!BuildConfig.DEBUG) {
|
||||
Thread.setDefaultUncaughtExceptionHandler(this);
|
||||
|
||||
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uncaughtException(final Thread thread, final Throwable ex) {
|
||||
try {
|
||||
UtilityLogger.error(new Exception(ex));
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Exception Logger failed!", e);
|
||||
MainApplication.exit();
|
||||
}
|
||||
|
||||
appendToFile(new Exception(ex));
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
Looper.prepare();
|
||||
DialogException.make(context, context::finish).show();
|
||||
Looper.loop();
|
||||
}
|
||||
}.start();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void appendToFile(Exception e) {
|
||||
try {
|
||||
File yourFile = new File(Environment.getExternalStorageDirectory(), "log.txt");
|
||||
|
||||
FileWriter fstream = new FileWriter(yourFile.getPath(), true);
|
||||
BufferedWriter out = new BufferedWriter(fstream);
|
||||
PrintWriter pWriter = new PrintWriter(out, true);
|
||||
e.printStackTrace(pWriter);
|
||||
}
|
||||
catch (Exception ie) {
|
||||
throw new RuntimeException("Could not write Exception to file", ie);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -19,9 +19,7 @@ public class MenuRESTConsumer extends _BaseRESTConsumer {
|
||||
menuRESTConsumerService.retrieveMenuConfig(rootCodOpz).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<StbMenu>> call, Response<ServiceRESTResponse<StbMenu>> response) {
|
||||
analyzeAnswer(response, "retrieveMenu", (m) -> {
|
||||
onComplete.run(response.body().getEntity());
|
||||
}, onFailed);
|
||||
analyzeAnswer(response, "retrieveMenu", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -4,10 +4,16 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.deserializer.LocalDateDeserializer;
|
||||
import it.integry.integrywmsnative.core.rest.deserializer.LocalDateTimeDeserializer;
|
||||
import it.integry.integrywmsnative.core.rest.serializer.LocalDateSerializer;
|
||||
@ -26,25 +32,25 @@ public class RESTBuilder {
|
||||
private static final boolean ADD_LOGGER_INTERCEPTOR = false;
|
||||
|
||||
public static <T> T getService(final Class<T> service) {
|
||||
return getService(service, SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true);
|
||||
return getService(service, SettingsManager.i().getServer().getProtocol(), SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true);
|
||||
|
||||
}
|
||||
|
||||
public static <T> T getService(final Class<T> service, int timeout) {
|
||||
return getService(service, SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true, true, timeout);
|
||||
return getService(service, SettingsManager.i().getServer().getProtocol(), SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), true, true, timeout);
|
||||
|
||||
}
|
||||
|
||||
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors) {
|
||||
return getService(service, host, port, addInterceptors, true, 60);
|
||||
public static <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addInterceptors) {
|
||||
return getService(service, protocol, 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, 60);
|
||||
public static <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addInterceptors, boolean addEmsApi) {
|
||||
return getService(service, protocol, host, port, addInterceptors, addEmsApi, 60);
|
||||
}
|
||||
|
||||
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors, boolean addEmsApi, int timeout) {
|
||||
OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder();
|
||||
public static <T> T getService(final Class<T> service, String protocol, String host, int port, boolean addInterceptors, boolean addEmsApi, int timeout) {
|
||||
OkHttpClient.Builder clientBuilder = getDefaultHttpClient();
|
||||
|
||||
clientBuilder.connectTimeout(timeout, TimeUnit.SECONDS);
|
||||
clientBuilder.readTimeout(timeout, TimeUnit.SECONDS);
|
||||
@ -57,22 +63,19 @@ public class RESTBuilder {
|
||||
|
||||
OkHttpClient client = clientBuilder.build();
|
||||
|
||||
String endpoint = "http://" + host + ":" + port + "/" + (addEmsApi ? "ems-api/" : "");
|
||||
String endpoint = protocol + "://" + host + ":" + port + "/" + (addEmsApi ? "ems-api/" : "");
|
||||
|
||||
|
||||
Gson gson = new GsonBuilder()
|
||||
.setDateFormat("dd/MM/yyyy HH:mm:ss")
|
||||
.excludeFieldsWithModifiers(Modifier.TRANSIENT)
|
||||
.registerTypeAdapter(LocalDate.class, new LocalDateDeserializer())
|
||||
.registerTypeAdapter(LocalDate.class, new LocalDateSerializer())
|
||||
.registerTypeAdapter(LocalDateTime.class, new LocalDateTimeDeserializer())
|
||||
.registerTypeAdapter(LocalDateTime.class, new LocalDateTimeSerializer())
|
||||
.excludeFieldsWithModifiers(Modifier.TRANSIENT)
|
||||
.create();
|
||||
|
||||
Retrofit retrofit = new Retrofit.Builder()
|
||||
.addConverterFactory(GsonConverterFactory.create(gson))
|
||||
.baseUrl(endpoint)
|
||||
.client(client)
|
||||
.build();
|
||||
Retrofit retrofit = new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create(gson)).baseUrl(endpoint).client(client).build();
|
||||
|
||||
return retrofit.create(service);
|
||||
}
|
||||
@ -85,4 +88,39 @@ public class RESTBuilder {
|
||||
public static int getDefaultPort() {
|
||||
return SettingsManager.i().getServer().getPort();
|
||||
}
|
||||
|
||||
|
||||
public static OkHttpClient.Builder getDefaultHttpClient() {
|
||||
TrustManager[] trustAllCerts = new TrustManager[]{
|
||||
new X509TrustManager() {
|
||||
@Override
|
||||
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
|
||||
return new java.security.cert.X509Certificate[]{};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
SSLContext sslContext = null;
|
||||
try {
|
||||
sslContext = SSLContext.getInstance("SSL");
|
||||
sslContext.init(null, trustAllCerts, new java.security.SecureRandom());
|
||||
} catch (KeyManagementException | NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
|
||||
OkHttpClient.Builder client = new OkHttpClient.Builder()
|
||||
.sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustAllCerts[0])
|
||||
.hostnameVerifier((hostname, session) -> true);
|
||||
|
||||
return client;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,8 +3,6 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.IBarcodeCustomization;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||
@ -18,15 +16,6 @@ public class BarcodeRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public void decodeEan128(BarcodeScanDTO barcodeObj, RunnableArgs<Ean128Model> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
IBarcodeCustomization barcodeCustomization = ClassRouter.getInstance(ClassRouter.PATH.BARCODE_CUSTOMIZATION);
|
||||
|
||||
if (barcodeCustomization != null && barcodeCustomization.shouldForceToEan13(barcodeObj.getStringValue())) {
|
||||
Ean128Model ean128Model = new Ean128Model();
|
||||
ean128Model.Gtin = barcodeObj.getStringValue();
|
||||
onComplete.run(ean128Model);
|
||||
return;
|
||||
}
|
||||
|
||||
String ean128 = barcodeObj.getStringValue().replaceAll("" + ((char) 29), "|");
|
||||
|
||||
BarcodeRESTConsumerService barcodeRESTConsumerService = RESTBuilder.getService(BarcodeRESTConsumerService.class);
|
||||
|
||||
@ -1,12 +1,9 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
||||
@ -19,9 +16,6 @@ import retrofit2.http.Query;
|
||||
|
||||
public interface ColliMagazzinoRESTConsumerService {
|
||||
|
||||
@POST("wms/distribuzioneRigheCollo")
|
||||
Call<ServiceRESTResponse<JsonObject>> distribuisciCollo(@Body DistribuzioneColloDTO distribuzioneCollo);
|
||||
|
||||
@POST("getColloByBarcode")
|
||||
Call<ServiceRESTResponse<MtbColt>> getColloByBarcode(@Query("codBarreCollo") String sscc, @Query("onlyResiduo") boolean onlyResiduo, @Query("throwExcIfNull") boolean throwExcIfNull);
|
||||
|
||||
|
||||
@ -20,12 +20,10 @@ import retrofit2.Response;
|
||||
public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public void getValue(String gestName, String sectionName, String keySection, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
getValueStatic(gestName, sectionName, keySection, onComplete, onFailed);
|
||||
}
|
||||
|
||||
public static void getValueStatic(String gestName, String sectionName, String keySection, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
|
||||
service.getGestSetupValue(gestName, sectionName, keySection).enqueue(new Callback<ServiceRESTResponse<GestSetupDTO>>() {
|
||||
|
||||
service.getGestSetupValue(gestName, sectionName, keySection)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<GestSetupDTO>> call, Response<ServiceRESTResponse<GestSetupDTO>> response) {
|
||||
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
|
||||
@ -40,8 +38,8 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
public static void getBooleanValue(String gestName, String sectionName, String keySection, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
getValueStatic(gestName, sectionName, keySection, value -> {
|
||||
public void getBooleanValue(String gestName, String sectionName, String keySection, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
getValue(gestName, sectionName, keySection, value -> {
|
||||
if (value != null) {
|
||||
onComplete.run("S".equalsIgnoreCase(value.value));
|
||||
} else onComplete.run(false);
|
||||
@ -50,7 +48,7 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
public static void getValueStatic(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public void getValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
|
||||
service.getGestSetupValue(gestName, sectionName, keySection, codMdep).enqueue(new Callback<ServiceRESTResponse<GestSetupDTO>>() {
|
||||
@Override
|
||||
@ -67,8 +65,8 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
public static void getBooleanValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
getValueStatic(gestName, sectionName, keySection, codMdep, value -> {
|
||||
public void getBooleanValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
getValue(gestName, sectionName, keySection, codMdep, value -> {
|
||||
if (value != null) {
|
||||
onComplete.run("S".equalsIgnoreCase(value.value));
|
||||
} else onComplete.run(false);
|
||||
|
||||
@ -2,6 +2,8 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
@ -52,6 +54,16 @@ public class InventarioRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
public List<MtbInvent> makeSynchronousRetrieveRequest() throws Exception {
|
||||
var inventarioRESTConsumerService = RESTBuilder.getService(InventarioRESTConsumerService.class, 120);
|
||||
|
||||
var response = inventarioRESTConsumerService.retrieve()
|
||||
.execute();
|
||||
|
||||
var data = analyzeAnswer(response, "retrieveInventario");
|
||||
return data.getInventories();
|
||||
}
|
||||
|
||||
|
||||
public void makeInsertRequest(MtbInvent inventarioToInsert, final Runnable onComplete, final RunnableArgs<Exception> onFailed) {
|
||||
var request = new InsertInventarioRequestDTO()
|
||||
|
||||
@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.inventario.InsertInventarioRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.inventario.RetrieveInventariResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.inventario.RetrieveInventarioArtsResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.inventario.RetrieveInventarioResponseDTO;
|
||||
import retrofit2.Call;
|
||||
@ -12,6 +13,9 @@ import retrofit2.http.Path;
|
||||
|
||||
public interface InventarioRESTConsumerService {
|
||||
|
||||
@GET("wms/inventario/")
|
||||
Call<ServiceRESTResponse<RetrieveInventariResponseDTO>> retrieve();
|
||||
|
||||
@GET("wms/inventario/{inventoryId}")
|
||||
Call<ServiceRESTResponse<RetrieveInventarioResponseDTO>> retrieve(
|
||||
@Path("inventoryId") long inventoryId);
|
||||
|
||||
@ -101,12 +101,7 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
public static void sendErrorLogMail(String message) {
|
||||
sendErrorLogMail(message, null, null);
|
||||
}
|
||||
|
||||
|
||||
public static void sendErrorLogMail(String message, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public void sendErrorLogMail(String message, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
String currentAzienda = UtilityString.isNullOrEmpty(SettingsManager.i().getUserSession().getProfileDB()) ? "" : " [" + SettingsManager.i().getUserSession().getProfileDB() + "]";
|
||||
|
||||
@ -135,10 +130,10 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
public static void sendMail(MailRequestDTO mailDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public void sendMail(MailRequestDTO mailDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||
service.sendMail(mailDTO).enqueue(new Callback<ServiceRESTResponse<String>>() {
|
||||
service.sendMail(mailDTO).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<String>> call, Response<ServiceRESTResponse<String>> response) {
|
||||
if (onComplete != null) onComplete.run();
|
||||
|
||||
@ -15,41 +15,48 @@ import retrofit2.Response;
|
||||
|
||||
public abstract class _BaseRESTConsumer {
|
||||
|
||||
public static <T> void analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle, RunnableArgs<T> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public static <T> T analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle) throws Exception {
|
||||
if (response.isSuccessful()) {
|
||||
if (response.body() != null) {
|
||||
if (response.body().getEsito() == EsitoType.OK) {
|
||||
if (!UtilityString.isNullOrEmpty(response.body().getErrorMessage())) {
|
||||
onFailed.run(new Exception(response.body().getErrorMessage()));
|
||||
throw new Exception(response.body().getErrorMessage());
|
||||
} else {
|
||||
|
||||
T dataObj = response.body().getDto() != null ?
|
||||
response.body().getDto() :
|
||||
response.body().getEntity();
|
||||
|
||||
onComplete.run(dataObj);
|
||||
return dataObj;
|
||||
}
|
||||
} else {
|
||||
String errorMessage = UtilityString.isNull(response.body().getErrorMessage(), "Empty message");
|
||||
Log.e(logTitle, errorMessage);
|
||||
onFailed.run(CommonRESTException.tryRecognizeException(errorMessage));
|
||||
throw CommonRESTException.tryRecognizeException(errorMessage);
|
||||
}
|
||||
} else {
|
||||
Log.e(logTitle, response.message());
|
||||
onFailed.run(new Exception(response.message()));
|
||||
throw new Exception(response.message());
|
||||
}
|
||||
} else {
|
||||
if (response.code() == 404) {
|
||||
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url().toString() + ")");
|
||||
onFailed.run(new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")"));
|
||||
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url() + ")");
|
||||
throw new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")");
|
||||
} else if (response.code() == 550)
|
||||
onFailed.run(new InvalidLicenseException());
|
||||
throw new InvalidLicenseException();
|
||||
else {
|
||||
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
||||
onFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
|
||||
throw new Exception("Status " + response.code() + ": " + response.message());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static <T> void analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle, RunnableArgs<T> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
try {
|
||||
var data = analyzeAnswer(response, logTitle);
|
||||
onComplete.run(data);
|
||||
} catch (Exception e) {
|
||||
onFailed.run(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,84 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.rest.model;
|
||||
|
||||
public class DistribuzioneColloDTO {
|
||||
|
||||
private String gestione;
|
||||
private String dataCollo;
|
||||
private Integer numCollo;
|
||||
private String serCollo;
|
||||
private String criterioDistribuzione;
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
|
||||
public DistribuzioneColloDTO setGestione(String gestione) {
|
||||
this.gestione = gestione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDataCollo() {
|
||||
return dataCollo;
|
||||
}
|
||||
|
||||
public DistribuzioneColloDTO setDataCollo(String dataCollo) {
|
||||
this.dataCollo = dataCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumCollo() {
|
||||
return numCollo;
|
||||
}
|
||||
|
||||
public DistribuzioneColloDTO setNumCollo(Integer numCollo) {
|
||||
this.numCollo = numCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSerCollo() {
|
||||
return serCollo;
|
||||
}
|
||||
|
||||
public DistribuzioneColloDTO setSerCollo(String serCollo) {
|
||||
this.serCollo = serCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCriterioDistribuzione() {
|
||||
return criterioDistribuzione;
|
||||
}
|
||||
|
||||
public CriterioDistribuzione getCriterioDistribuzioneEnum() {
|
||||
return CriterioDistribuzione.fromString(criterioDistribuzione);
|
||||
}
|
||||
|
||||
public DistribuzioneColloDTO setCriterioDistribuzione(String criterioDistribuzione) {
|
||||
this.criterioDistribuzione = criterioDistribuzione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DistribuzioneColloDTO setCriterioDistribuzione(CriterioDistribuzione criterioDistribuzione) {
|
||||
this.criterioDistribuzione = criterioDistribuzione != null ? criterioDistribuzione.getText() : null;
|
||||
return this;
|
||||
}
|
||||
|
||||
public enum CriterioDistribuzione {
|
||||
UPDATE("U"), //UPDATE COLLO GIA' ESISTENTE
|
||||
SPLIT_ORDINE("O"); //UPDATE COLLO GIA' ESISTENTE
|
||||
|
||||
private String text;
|
||||
CriterioDistribuzione(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
public String getText() {
|
||||
return this.text;
|
||||
}
|
||||
|
||||
public static CriterioDistribuzione fromString(String text) {
|
||||
for (CriterioDistribuzione b : CriterioDistribuzione.values()) {
|
||||
if (b.text.equalsIgnoreCase(text)) return b;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package it.integry.integrywmsnative.core.rest.model;
|
||||
|
||||
public class MailAttachmentDTO {
|
||||
|
||||
private String fileName;
|
||||
private String fileb64Content;
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public MailAttachmentDTO setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFileb64Content() {
|
||||
return fileb64Content;
|
||||
}
|
||||
|
||||
public MailAttachmentDTO setFileb64Content(String fileb64Content) {
|
||||
this.fileb64Content = fileb64Content;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.rest.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MailRequestDTO {
|
||||
|
||||
private String from;
|
||||
@ -11,6 +13,7 @@ public class MailRequestDTO {
|
||||
private String ccn;
|
||||
private String subject;
|
||||
private String msgText;
|
||||
private List<MailAttachmentDTO> attachments;
|
||||
private boolean isHtml = false;
|
||||
private boolean isDebug = false;
|
||||
|
||||
@ -95,6 +98,15 @@ public class MailRequestDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MailAttachmentDTO> getAttachments() {
|
||||
return attachments;
|
||||
}
|
||||
|
||||
public MailRequestDTO setAttachments(List<MailAttachmentDTO> attachments) {
|
||||
this.attachments = attachments;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isHtml() {
|
||||
return isHtml;
|
||||
}
|
||||
|
||||
@ -1,10 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.rest.model;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
|
||||
/**
|
||||
* Created by GiuseppeS on 06/03/2018.
|
||||
*/
|
||||
@ -12,7 +9,6 @@ import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
public class ServiceRESTResponse<T> {
|
||||
|
||||
private int esito;
|
||||
private String execDate;
|
||||
private String profileDB;
|
||||
private String errorMessage;
|
||||
|
||||
@ -24,9 +20,6 @@ public class ServiceRESTResponse<T> {
|
||||
return EsitoType.fromIntValue(esito);
|
||||
}
|
||||
|
||||
public Date getExecDate() {
|
||||
return UtilityDate.recognizeDateWithExceptionHandler(execDate);
|
||||
}
|
||||
|
||||
public String getProfileDB() {
|
||||
return profileDB;
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.inventario;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbInvent;
|
||||
|
||||
public class RetrieveInventariResponseDTO {
|
||||
|
||||
private List<MtbInvent> inventories;
|
||||
|
||||
public List<MtbInvent> getInventories() {
|
||||
return inventories;
|
||||
}
|
||||
}
|
||||
@ -5,7 +5,6 @@ import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
public class CloseUDSRequestDTO {
|
||||
|
||||
private boolean printSSCC;
|
||||
private boolean enableTransferLogic;
|
||||
private String orderCodMdep;
|
||||
private MtbColt mtbColt;
|
||||
|
||||
@ -18,15 +17,6 @@ public class CloseUDSRequestDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isEnableTransferLogic() {
|
||||
return enableTransferLogic;
|
||||
}
|
||||
|
||||
public CloseUDSRequestDTO setEnableTransferLogic(boolean enableTransferLogic) {
|
||||
this.enableTransferLogic = enableTransferLogic;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getOrderCodMdep() {
|
||||
return orderCodMdep;
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@ public class ServerStatusChecker {
|
||||
public void run() {
|
||||
if (shouldExecute && !UtilityString.isNullOrEmpty(SettingsManager.i().getServer().getHost())) {
|
||||
UtilityServer.isEmsApiAvailable(
|
||||
SettingsManager.i().getServer().getProtocol(),
|
||||
SettingsManager.i().getServer().getHost(),
|
||||
SettingsManager.i().getServer().getPort(),
|
||||
() -> mInternalCallback.run(true),
|
||||
|
||||
@ -7,7 +7,6 @@ import it.integry.integrywmsnative.core.model.Azienda;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.model.dto.InternalCodAnagsDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
||||
|
||||
public class DBSettingsModel {
|
||||
|
||||
@ -22,7 +21,6 @@ public class DBSettingsModel {
|
||||
private boolean flagMultiClienteOrdV;
|
||||
private boolean flagUseCodAnagAziendale;
|
||||
private String defaultCausaleRettificaGiacenze;
|
||||
private DistribuzioneColloDTO.CriterioDistribuzione defaultCriterioDistribuzione;
|
||||
private boolean flagAskClienteInPickingLibero;
|
||||
private boolean flagPickLiberoAllowEmptyCliente;
|
||||
|
||||
@ -53,6 +51,9 @@ public class DBSettingsModel {
|
||||
private String codDtipOrdTrasfV;
|
||||
private boolean notifyLotStatus = false;
|
||||
|
||||
private boolean groupShippingByCommodityGroup = true;
|
||||
private boolean showCodFornSpedizione = true;
|
||||
|
||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||
return flagSpedizioneEnableFakeGiacenza;
|
||||
}
|
||||
@ -133,15 +134,6 @@ public class DBSettingsModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public DistribuzioneColloDTO.CriterioDistribuzione getDefaultCriterioDistribuzione() {
|
||||
return defaultCriterioDistribuzione;
|
||||
}
|
||||
|
||||
public DBSettingsModel setDefaultCriterioDistribuzione(String defaultCriterioDistribuzione) {
|
||||
this.defaultCriterioDistribuzione = DistribuzioneColloDTO.CriterioDistribuzione.fromString(defaultCriterioDistribuzione);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAskClienteInPickingLibero() {
|
||||
return flagAskClienteInPickingLibero;
|
||||
}
|
||||
@ -386,4 +378,22 @@ public class DBSettingsModel {
|
||||
this.notifyLotStatus = notifyLotStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isGroupShippingByCommodityGroup() {
|
||||
return groupShippingByCommodityGroup;
|
||||
}
|
||||
|
||||
public DBSettingsModel setGroupShippingByCommodityGroup(boolean groupShippingByCommodityGroup) {
|
||||
this.groupShippingByCommodityGroup = groupShippingByCommodityGroup;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isShowCodFornSpedizione() {
|
||||
return showCodFornSpedizione;
|
||||
}
|
||||
|
||||
public DBSettingsModel setShowCodFornSpedizione(boolean showCodFornSpedizione) {
|
||||
this.showCodFornSpedizione = showCodFornSpedizione;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@ -341,13 +341,20 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_NOTIFICA_STATO_PARTITA"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_SHOW_COD_FORN"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_GROUP_BY_GRP_MERC"));
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
|
||||
mGestSetupRESTConsumer.getValues(codMdep, stbGestSetupList, list -> {
|
||||
dbSettingsModelIstance.setEnableCheckPartitaMagCheckPickingV(getValueFromList(list, "SETUP", "ENABLE_CHECK_PARTITA_MAG_PICKING_V", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagMultiClienteOrdV(getValueFromList(list, "SETUP", "FLAG_MULTI_CLIENTE_ORD_VENDITA", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagUseCodAnagAziendale(getValueFromList(list, "SETUP", "FLAG_USE_COD_ANAG_AZIENDALE", Boolean.class));
|
||||
dbSettingsModelIstance.setDefaultCriterioDistribuzione(getValueFromList(list, "SETUP", "DEFAULT_CRITERIO_DISTRIBUZIONE", String.class));
|
||||
dbSettingsModelIstance.setFlagAskClienteInPickingLibero(getValueFromList(list, "PICKING_LIBERO", "FLAG_ASK_CLIENTE", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagPickLiberoAllowEmptyCliente(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_CLIENTE", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagCanAddExtraItemSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_ADD_EXTRA_ITEMS", Boolean.class));
|
||||
@ -372,6 +379,8 @@ public class SettingsManager {
|
||||
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));
|
||||
dbSettingsModelIstance.setShowCodFornSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_SHOW_COD_FORN", Boolean.class, Boolean.TRUE));
|
||||
dbSettingsModelIstance.setGroupShippingByCommodityGroup(getValueFromList(list, "SPEDIZIONE", "FLAG_GROUP_BY_GRP_MERC", Boolean.class, Boolean.FALSE));
|
||||
|
||||
String notePerdita = getValueFromList(list, "DOC_INTERNI", "NOTE_PERDITA", String.class);
|
||||
if (notePerdita != null)
|
||||
@ -392,6 +401,10 @@ public class SettingsManager {
|
||||
|
||||
|
||||
public static <T> T getValueFromList(List<StbGestSetup> stbGestSetupList, String section, String keySectionName, Class<T> clazz) {
|
||||
return getValueFromList(stbGestSetupList, section, keySectionName, clazz, null);
|
||||
}
|
||||
|
||||
public static <T> T getValueFromList(List<StbGestSetup> stbGestSetupList, String section, String keySectionName, Class<T> clazz, T defaultValue) {
|
||||
|
||||
StbGestSetup value = Stream.of(stbGestSetupList)
|
||||
.filter(x -> x.getSection().equalsIgnoreCase(section) && x.getKeySection().equalsIgnoreCase(keySectionName))
|
||||
@ -403,7 +416,7 @@ public class SettingsManager {
|
||||
return clazz.cast("S".equalsIgnoreCase(value.getValue()));
|
||||
} else if (clazz == Integer.class && value.getValue() != null) {
|
||||
return clazz.cast(Integer.parseInt(value.getValue()));
|
||||
} else return null;
|
||||
} else return defaultValue;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -20,6 +20,7 @@ public class SettingsModel {
|
||||
|
||||
public static class Server {
|
||||
private String codAzienda;
|
||||
private String protocol;
|
||||
private String host;
|
||||
private int port;
|
||||
|
||||
@ -32,6 +33,15 @@ public class SettingsModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getProtocol() {
|
||||
return protocol;
|
||||
}
|
||||
|
||||
public Server setProtocol(String protocol) {
|
||||
this.protocol = protocol;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
@ -15,9 +15,6 @@ import java.io.File;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.BaseCustomConfiguration;
|
||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.FileDownloader;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||
@ -30,19 +27,9 @@ public class UpdatesManager {
|
||||
public void init(AppCompatActivity activityContext) {
|
||||
this.mContext = activityContext;
|
||||
|
||||
String suffix;
|
||||
ICustomConfiguration customConfiguration = ClassRouter.getInstance(ClassRouter.PATH.CUSTOM_CONFIGURATION);
|
||||
try {
|
||||
suffix = customConfiguration.getConfig(BaseCustomConfiguration.Keys.CUSTOM_DYNAMIC_VERSION_PATH);
|
||||
if (suffix == null) {
|
||||
suffix = "";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
suffix = "";
|
||||
}
|
||||
|
||||
String currentVersionUrl = "http://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/currentVersion";
|
||||
String currentDownloadUrl = "http://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/android-release" + suffix + ".apk";
|
||||
String currentDownloadUrl = "http://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/android-release.apk";
|
||||
|
||||
|
||||
AppUpdater appUpdater = new AppUpdater(mContext)
|
||||
|
||||
@ -43,10 +43,10 @@ public class UtilityDate {
|
||||
public static final String DMY_HUMAN_LONG = "dd MMMM yyyy";
|
||||
}
|
||||
|
||||
public static Date recognizeDateWithExceptionHandler(String dateString) {
|
||||
try{
|
||||
public static Date recognizeDateWithExceptionHandler(String dateString) {
|
||||
try {
|
||||
return UtilityDate.recognizeDate(dateString);
|
||||
} catch (ParseException | DateNotRecognizedException | TimeNotRecognizedException pex){
|
||||
} catch (ParseException | DateNotRecognizedException | TimeNotRecognizedException pex) {
|
||||
UtilityLogger.error(pex);
|
||||
return null;
|
||||
}
|
||||
@ -64,9 +64,9 @@ public class UtilityDate {
|
||||
char dateSeparator;
|
||||
|
||||
String onlyDateSubstring = dateString.substring(0, 10);
|
||||
if(onlyDateSubstring.contains("/")) dateSeparator = '/';
|
||||
else if(onlyDateSubstring.contains("-")) dateSeparator = '-';
|
||||
else if(onlyDateSubstring.contains(".")) dateSeparator = '.';
|
||||
if (onlyDateSubstring.contains("/")) dateSeparator = '/';
|
||||
else if (onlyDateSubstring.contains("-")) dateSeparator = '-';
|
||||
else if (onlyDateSubstring.contains(".")) dateSeparator = '.';
|
||||
else throw new DateNotRecognizedException(dateString);
|
||||
|
||||
String dateFormatString = (dateString.charAt(2) == dateSeparator)
|
||||
@ -74,13 +74,13 @@ public class UtilityDate {
|
||||
: "yyyy" + dateSeparator + "MM" + dateSeparator + "dd";
|
||||
|
||||
|
||||
if(dateString.length() > 10){
|
||||
if (dateString.length() > 10) {
|
||||
|
||||
char timeSeparator;
|
||||
|
||||
String onlyTimeSubstring = dateString.substring(10, 14);
|
||||
if(onlyTimeSubstring.contains("-")) timeSeparator = '-';
|
||||
else if(onlyTimeSubstring.contains(":")) timeSeparator = ':';
|
||||
if (onlyTimeSubstring.contains("-")) timeSeparator = '-';
|
||||
else if (onlyTimeSubstring.contains(":")) timeSeparator = ':';
|
||||
else throw new TimeNotRecognizedException(dateString);
|
||||
|
||||
String timeFormatString = "HH" + timeSeparator + "mm" + timeSeparator + "ss";
|
||||
@ -99,12 +99,11 @@ public class UtilityDate {
|
||||
|
||||
|
||||
public static String formatDate(Date dateToFormat, String format) {
|
||||
if(dateToFormat != null) {
|
||||
if (dateToFormat != null) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(format);
|
||||
//sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
return sdf.format(dateToFormat);
|
||||
}
|
||||
else return null;
|
||||
} else return null;
|
||||
}
|
||||
|
||||
|
||||
@ -116,7 +115,7 @@ public class UtilityDate {
|
||||
public static Date getDateInstance(boolean removeTime) {
|
||||
var calendar = getCalendarInstance();
|
||||
|
||||
if(removeTime) {
|
||||
if (removeTime) {
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
@ -131,8 +130,6 @@ public class UtilityDate {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static String formatDate(LocalDate dateToFormat, String format) {
|
||||
if (dateToFormat != null) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format);
|
||||
@ -185,7 +182,6 @@ public class UtilityDate {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static LocalDate getNow() {
|
||||
return Instant.now()
|
||||
.atZone(currentZone)
|
||||
@ -197,6 +193,7 @@ public class UtilityDate {
|
||||
.atZone(currentZone)
|
||||
.toLocalDateTime();
|
||||
}
|
||||
|
||||
public static LocalDate timeToLocalDate(long time, @Nullable String timezone) {
|
||||
return Instant.ofEpochSecond(time)
|
||||
.atZone(timezone == null ? currentZone : ZoneId.of(timezone))
|
||||
@ -210,7 +207,6 @@ public class UtilityDate {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static long localDateTimeToTime(LocalDateTime localDateTime, @Nullable String timezone) {
|
||||
return localDateTime
|
||||
.atZone(timezone == null ? currentZone : ZoneId.of(timezone))
|
||||
|
||||
@ -7,8 +7,8 @@ import java.net.SocketAddress;
|
||||
|
||||
import it.integry.integrywmsnative.core.exception.InvalidLicenseException;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.gest.login.exception.ServerNotReachableException;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
@ -38,16 +38,18 @@ public class UtilityServer {
|
||||
}).start();
|
||||
}
|
||||
|
||||
public static void isEmsApiAvailable(final String serverAddress, final int serverTCPport, final Runnable onComplete, final RunnableArgs<Exception> onFailed) {
|
||||
public static void isEmsApiAvailable(final String protocol, final String serverAddress, final int serverTCPport, final Runnable onComplete, final RunnableArgs<Exception> onFailed) {
|
||||
new Thread(() -> {
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url(String.format("http://%s:%d/ems-api/system/ok", serverAddress, serverTCPport))
|
||||
.url(String.format("%s://%s:%d/ems-api/system/ok", protocol, serverAddress, serverTCPport))
|
||||
.build();
|
||||
|
||||
try {
|
||||
Response response = client.newCall(request).execute();
|
||||
Response response = RESTBuilder.getDefaultHttpClient().build()
|
||||
.newCall(request)
|
||||
.execute();
|
||||
response.close();
|
||||
|
||||
if (response.code() == 200) onComplete.run();
|
||||
@ -55,7 +57,8 @@ public class UtilityServer {
|
||||
onFailed.run(new ServerNotReachableException(serverAddress, serverTCPport, null));
|
||||
else if (response.code() == 550)
|
||||
onFailed.run(new InvalidLicenseException());
|
||||
else onFailed.run(new Exception("Errore non identificato (STATUS: " + response.code() + ")"));
|
||||
else
|
||||
onFailed.run(new Exception("Errore non identificato (STATUS: " + response.code() + ")"));
|
||||
} catch (IOException e) {
|
||||
onFailed.run(new ServerNotReachableException(serverAddress, serverTCPport, e));
|
||||
}
|
||||
|
||||
@ -335,13 +335,11 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle item selection
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_filter:
|
||||
showOrderByDialog();
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
if (item.getItemId() == R.id.action_filter) {
|
||||
showOrderByDialog();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
private void initVars() {
|
||||
@ -752,11 +750,11 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
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(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
|
||||
@ -70,6 +70,11 @@ public class ElencoInventariFragment extends BaseFragment implements ITitledFrag
|
||||
mBinding.setLifecycleOwner(this);
|
||||
mBinding.setViewmodel(mViewModel);
|
||||
|
||||
mBinding.swiperefresh.setRefreshing(true);
|
||||
mBinding.swiperefresh.setOnRefreshListener(() -> {
|
||||
mViewModel.loadData();
|
||||
});
|
||||
|
||||
mViewModel.loadData();
|
||||
this.initRecyclerView();
|
||||
|
||||
@ -143,6 +148,22 @@ public class ElencoInventariFragment extends BaseFragment implements ITitledFrag
|
||||
startPicking(inventarioRoomDTO, listaArts);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInventoriesLoadingStarted() {
|
||||
mBinding.swiperefresh.setRefreshing(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInventoriesLoadingEnded() {
|
||||
mBinding.swiperefresh.setRefreshing(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInventoriesLoadingError(Exception ex) {
|
||||
mBinding.swiperefresh.setRefreshing(false);
|
||||
this.onError(ex);
|
||||
}
|
||||
|
||||
|
||||
private void startPicking(InventarioRoomDTO inventarioRoomDTO, List<InventarioArtDTO> listArts) {
|
||||
PickingInventarioActivity.startActivity(requireContext(), inventarioRoomDTO, listArts);
|
||||
|
||||
@ -40,7 +40,10 @@ public class ElencoInventariViewModel {
|
||||
}
|
||||
|
||||
public void loadData() {
|
||||
inventarioList = inventarioRepository.retrieve();
|
||||
inventarioList = inventarioRepository.retrieve(
|
||||
this::sendOnInventoriesLoadingEnded,
|
||||
this::sendOnInventoriesLoadingError
|
||||
);
|
||||
}
|
||||
|
||||
public void destroyData() {
|
||||
@ -146,16 +149,34 @@ public class ElencoInventariViewModel {
|
||||
if (this.listener != null) listener.onLoadingEnded();
|
||||
}
|
||||
|
||||
private void sendOnInventoriesLoadingStarted() {
|
||||
if (this.listener != null) listener.onInventoriesLoadingStarted();
|
||||
}
|
||||
|
||||
private void sendOnInventoriesLoadingEnded() {
|
||||
if (this.listener != null) listener.onInventoriesLoadingEnded();
|
||||
}
|
||||
|
||||
private void sendOnError(Exception ex) {
|
||||
if (this.listener != null) listener.onError(ex);
|
||||
}
|
||||
|
||||
private void sendOnInventoriesLoadingError(Exception ex) {
|
||||
if (this.listener != null) listener.onInventoriesLoadingError(ex);
|
||||
}
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
|
||||
void onInventarioInfoRequest(RunnableArgss<Long, String> onComplete);
|
||||
|
||||
void onInventarioLoaded(InventarioRoomDTO inventarioRoomDTO, List<InventarioArtDTO> listaArts);
|
||||
|
||||
void onInventoriesLoadingStarted();
|
||||
|
||||
void onInventoriesLoadingEnded();
|
||||
|
||||
void onInventoriesLoadingError(Exception ex);
|
||||
|
||||
void onCreateInventarioRequest(long inventoryId, String zone);
|
||||
|
||||
void onError(Exception ex);
|
||||
|
||||
@ -98,14 +98,14 @@ public class LoginActivity extends BaseActivity implements LoginViewModel.Listen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoginCompleted(String host, int port, String fullName, List<String> availableProfiles) {
|
||||
public void onLoginCompleted(String protocol, String host, int port, String fullName, List<String> availableProfiles) {
|
||||
|
||||
this.onLoadingEnded();
|
||||
runOnUiThread(() -> DialogSimpleMessageView.makeSuccessDialog(
|
||||
"Benvenuto",
|
||||
Html.fromHtml("Ciao <b>" + fullName + "</b>, la Integry le augura di svolgere al meglio il suo lavoro"),
|
||||
null,
|
||||
() -> showProfileDBSelectionDialog(host, port, availableProfiles))
|
||||
() -> showProfileDBSelectionDialog(protocol, host, port, availableProfiles))
|
||||
.show(getSupportFragmentManager(), "tag"));
|
||||
|
||||
}
|
||||
@ -117,7 +117,7 @@ public class LoginActivity extends BaseActivity implements LoginViewModel.Listen
|
||||
loginButtonEnabled.set(true);
|
||||
}
|
||||
|
||||
private void showProfileDBSelectionDialog(final String host, final int port, final List<String> availableProfiles) {
|
||||
private void showProfileDBSelectionDialog(final String protocol, final String host, final int port, final List<String> availableProfiles) {
|
||||
Runnable onComplete = () -> {
|
||||
SettingsManager.update();
|
||||
|
||||
@ -129,7 +129,7 @@ public class LoginActivity extends BaseActivity implements LoginViewModel.Listen
|
||||
if (availableProfiles != null && availableProfiles.size() == 1) {
|
||||
SettingsManager.i().getUserSession().setProfileDB(availableProfiles.get(0));
|
||||
|
||||
mViewmodel.loadDepo(codAzienda.get(), host, port, username.get(), password.get(), onComplete);
|
||||
mViewmodel.loadDepo(codAzienda.get(), protocol, host, port, username.get(), password.get(), onComplete);
|
||||
} else {
|
||||
|
||||
// setup the alert builder
|
||||
@ -144,7 +144,7 @@ public class LoginActivity extends BaseActivity implements LoginViewModel.Listen
|
||||
builder.setItems(profiles, (dialog, which) -> {
|
||||
SettingsManager.i().getUserSession().setProfileDB(availableProfiles.get(which));
|
||||
|
||||
mViewmodel.loadDepo(codAzienda.get(), host, port, username.get(), password.get(), onComplete);
|
||||
mViewmodel.loadDepo(codAzienda.get(), protocol, host, port, username.get(), password.get(), onComplete);
|
||||
});
|
||||
|
||||
// create and show the alert dialog
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
package it.integry.integrywmsnative.gest.login.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LoginDTO {
|
||||
|
||||
private String full_name;
|
||||
private List<String> availableProfiles;
|
||||
|
||||
public String getFull_name() {
|
||||
return full_name;
|
||||
}
|
||||
|
||||
public LoginDTO setFull_name(String full_name) {
|
||||
this.full_name = full_name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getAvailableProfiles() {
|
||||
return availableProfiles;
|
||||
}
|
||||
|
||||
public LoginDTO setAvailableProfiles(List<String> availableProfiles) {
|
||||
this.availableProfiles = availableProfiles;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package it.integry.integrywmsnative.gest.login.dto;
|
||||
|
||||
public class LoginRequestDTO {
|
||||
|
||||
private String username;
|
||||
private String password;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public LoginRequestDTO setUsername(String username) {
|
||||
this.username = username;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public LoginRequestDTO setPassword(String password) {
|
||||
this.password = password;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package it.integry.integrywmsnative.gest.login.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LoginResponseDTO {
|
||||
|
||||
private String fullName;
|
||||
private List<String> availableProfiles;
|
||||
|
||||
|
||||
public String getFullName() {
|
||||
return fullName;
|
||||
}
|
||||
|
||||
public List<String> getAvailableProfiles() {
|
||||
return availableProfiles;
|
||||
}
|
||||
|
||||
}
|
||||
@ -10,7 +10,8 @@ import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.gest.login.dto.LoginAziendaDTO;
|
||||
import it.integry.integrywmsnative.gest.login.dto.LoginDTO;
|
||||
import it.integry.integrywmsnative.gest.login.dto.LoginResponseDTO;
|
||||
import it.integry.integrywmsnative.gest.login.dto.LoginRequestDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
@ -19,12 +20,13 @@ import retrofit2.Response;
|
||||
public class LoginRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
public void retrieveServerData(String codAzienda, RunnableArgs<LoginAziendaDTO> onComplete, RunnableArgs<Exception> onFailed){
|
||||
public void retrieveServerData(String codAzienda, RunnableArgs<LoginAziendaDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
String protocol = CommonConst.Login.Azienda.protocol;
|
||||
String host = CommonConst.Login.Azienda.host;
|
||||
int port = CommonConst.Login.Azienda.port;
|
||||
|
||||
LoginRESTConsumerService service = RESTBuilder.getService(LoginRESTConsumerService.class, host, port, false, true);
|
||||
LoginRESTConsumerService service = RESTBuilder.getService(LoginRESTConsumerService.class, protocol, host, port, false, true);
|
||||
service.loginAzienda(codAzienda).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<LoginAziendaDTO>> call, Response<ServiceRESTResponse<LoginAziendaDTO>> response) {
|
||||
@ -40,17 +42,22 @@ public class LoginRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
public void authenticate(String host, int port, String username, String password, RunnableArgs<LoginDTO> onComplete, RunnableArgs<Exception> onFailed){
|
||||
LoginRESTConsumerService service = RESTBuilder.getService(LoginRESTConsumerService.class, host, port, false);
|
||||
service.login(username, password).enqueue(new Callback<>() {
|
||||
public void authenticate(String protocol, String host, int port, String username, String password, RunnableArgs<LoginResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
LoginRESTConsumerService service = RESTBuilder.getService(LoginRESTConsumerService.class, protocol, host, port, false);
|
||||
|
||||
LoginRequestDTO loginRequestDTO = new LoginRequestDTO()
|
||||
.setUsername(username)
|
||||
.setPassword(password);
|
||||
|
||||
service.login(loginRequestDTO).enqueue(new Callback<>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<LoginDTO>> call, Response<ServiceRESTResponse<LoginDTO>> response) {
|
||||
public void onResponse(Call<ServiceRESTResponse<LoginResponseDTO>> call, Response<ServiceRESTResponse<LoginResponseDTO>> response) {
|
||||
analyzeAnswer(response, "Login", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<LoginDTO>> call, final Throwable t) {
|
||||
public void onFailure(Call<ServiceRESTResponse<LoginResponseDTO>> call, final Throwable t) {
|
||||
Log.e("Login", t.toString());
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
|
||||
@ -3,8 +3,10 @@ package it.integry.integrywmsnative.gest.login.rest;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.gest.login.dto.LoginAziendaDTO;
|
||||
import it.integry.integrywmsnative.gest.login.dto.LoginDTO;
|
||||
import it.integry.integrywmsnative.gest.login.dto.LoginResponseDTO;
|
||||
import it.integry.integrywmsnative.gest.login.dto.LoginRequestDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
@ -16,6 +18,6 @@ public interface LoginRESTConsumerService {
|
||||
Call<ServiceRESTResponse<LoginAziendaDTO>> loginAzienda(@Query("codHash") String codHash);
|
||||
|
||||
@POST("loginWeb")
|
||||
Call<ServiceRESTResponse<LoginDTO>> login(@Query("username") String username, @Query("password") String password);
|
||||
Call<ServiceRESTResponse<LoginResponseDTO>> login(@Body LoginRequestDTO loginRequestDTO);
|
||||
|
||||
}
|
||||
|
||||
@ -48,15 +48,16 @@ public class LoginViewModel {
|
||||
return;
|
||||
}
|
||||
|
||||
final String protocol = u.getProtocol();
|
||||
final String host = u.getHost();
|
||||
final int port = u.getPort();
|
||||
|
||||
UtilityServer.isEmsApiAvailable(host, port, () -> {
|
||||
UtilityServer.isEmsApiAvailable(protocol, host, port, () -> {
|
||||
|
||||
mLoginRESTConsumer.authenticate(host, port, username, password, loginDTO -> {
|
||||
mLoginRESTConsumer.authenticate(protocol, host, port, username, password, loginDTO -> {
|
||||
|
||||
SettingsManager.i().createUserSession();
|
||||
SettingsManager.i().getUser().setFullname(!UtilityString.isNullOrEmpty(loginDTO.getFull_name()) ? loginDTO.getFull_name() : username);
|
||||
SettingsManager.i().getUser().setFullname(!UtilityString.isNullOrEmpty(loginDTO.getFullName()) ? loginDTO.getFullName() : username);
|
||||
|
||||
List<String> availableProfiles = null;
|
||||
if(loginDTO.getAvailableProfiles() != null && !loginDTO.getAvailableProfiles().isEmpty()) {
|
||||
@ -65,7 +66,7 @@ public class LoginViewModel {
|
||||
.toList();
|
||||
}
|
||||
|
||||
this.sendOnLoginCompleted(host, port, loginDTO.getFull_name(), availableProfiles);
|
||||
this.sendOnLoginCompleted(protocol, host, port, loginDTO.getFullName(), availableProfiles);
|
||||
}, this::sendError);
|
||||
|
||||
|
||||
@ -76,9 +77,10 @@ public class LoginViewModel {
|
||||
}
|
||||
|
||||
|
||||
public void loadDepo(String codAzienda, String host, int port, String username, String password, Runnable onComplete) {
|
||||
public void loadDepo(String codAzienda, String protocol, String host, int port, String username, String password, Runnable onComplete) {
|
||||
|
||||
SettingsManager.i().getServer().setCodAzienda(codAzienda);
|
||||
SettingsManager.i().getServer().setProtocol(protocol);
|
||||
SettingsManager.i().getServer().setHost(host);
|
||||
SettingsManager.i().getServer().setPort(port);
|
||||
|
||||
@ -109,9 +111,9 @@ public class LoginViewModel {
|
||||
if (this.mListener != null) mListener.onLoadingEnded();
|
||||
}
|
||||
|
||||
private void sendOnLoginCompleted(String host, int port, String fullName, List<String> availableProfiles) {
|
||||
private void sendOnLoginCompleted(String protocol, String host, int port, String fullName, List<String> availableProfiles) {
|
||||
if (this.mListener != null)
|
||||
mListener.onLoginCompleted(host, port, fullName, availableProfiles);
|
||||
mListener.onLoginCompleted(protocol, host, port, fullName, availableProfiles);
|
||||
}
|
||||
|
||||
private void sendError(Exception ex) {
|
||||
@ -126,7 +128,7 @@ public class LoginViewModel {
|
||||
public interface Listener extends ILoadingListener {
|
||||
void onError(Exception ex);
|
||||
|
||||
void onLoginCompleted(String host, int port, String fullName, List<String> availableProfiles);
|
||||
void onLoginCompleted(String protocol, String host, int port, String fullName, List<String> availableProfiles);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -27,10 +27,8 @@ import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||
import it.integry.integrywmsnative.core.class_router.configs.BaseMenuConfiguration;
|
||||
import it.integry.integrywmsnative.core.class_router.configs.MenuConfiguration;
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
||||
import it.integry.integrywmsnative.core.context.MainContext;
|
||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||
@ -181,23 +179,16 @@ public class MainActivity extends BaseActivity
|
||||
fragment = menuItem.getFragmentFactory().run();
|
||||
this.adaptViewToFragment(fragment);
|
||||
} else {
|
||||
switch (id) {
|
||||
case R.id.nav_home:
|
||||
this.pop();
|
||||
break;
|
||||
|
||||
case R.id.nav_settings:
|
||||
fragment = new MainSettingsFragment();
|
||||
this.adaptViewToFragment(fragment);
|
||||
break;
|
||||
|
||||
case R.id.nav_logout:
|
||||
ServerStatusChecker.dispose();
|
||||
this.mainContext.logout(() -> {
|
||||
startLoginActivity();
|
||||
});
|
||||
|
||||
break;
|
||||
if (id == R.id.nav_home) {
|
||||
this.pop();
|
||||
} else if (id == R.id.nav_settings) {
|
||||
fragment = new MainSettingsFragment();
|
||||
this.adaptViewToFragment(fragment);
|
||||
} else if (id == R.id.nav_logout) {
|
||||
ServerStatusChecker.dispose();
|
||||
this.mainContext.logout(() -> {
|
||||
startLoginActivity();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -226,7 +217,7 @@ public class MainActivity extends BaseActivity
|
||||
|
||||
for (MenuConfiguration.MenuItem menuItem : menuGroup.getItems()) {
|
||||
|
||||
if(menuService.isItemEnabled(menuItem)) {
|
||||
if (menuService.isItemEnabled(menuItem)) {
|
||||
subMenu
|
||||
.add(menuGroup.getGroupId(), menuItem.getID(), 0, menuItem.getTitleText())
|
||||
.setIcon(menuItem.getDrawerIcon());
|
||||
@ -248,7 +239,6 @@ public class MainActivity extends BaseActivity
|
||||
}
|
||||
|
||||
private MenuConfiguration.MenuItem getMenuItem(@IdRes int menuId) {
|
||||
ICustomConfiguration customConfiguration = ClassRouter.getInstance(ClassRouter.PATH.CUSTOM_CONFIGURATION);
|
||||
BaseMenuConfiguration menuConfiguration = new MenuConfiguration();
|
||||
List<MenuConfiguration.MenuGroup> menuGroups = menuConfiguration.getGroups();
|
||||
|
||||
|
||||
@ -27,10 +27,8 @@ import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||
import it.integry.integrywmsnative.core.class_router.configs.BaseMenuConfiguration;
|
||||
import it.integry.integrywmsnative.core.class_router.configs.MenuConfiguration;
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.OrdiniVenditaInterface;
|
||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverDTO;
|
||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
@ -212,14 +210,10 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
||||
(recoveredMtbColt.getGestioneEnum() == GestioneEnum.VENDITA ||
|
||||
recoveredMtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE)) {
|
||||
|
||||
OrdiniVenditaInterface ordiniVendita = ClassRouter.getInstance(ClassRouter.PATH.ORDINI_VENDITA);
|
||||
boolean isTransferLogicEnabled = ordiniVendita != null && ordiniVendita.isTrasfOrder(recoveredMtbColtDto.getTestateOrdini());
|
||||
|
||||
var closeUDSRequestDto = new CloseUDSRequestDTO()
|
||||
.setMtbColt(recoveredMtbColt)
|
||||
//.setPrintSSCC(shouldPrint)
|
||||
.setOrderCodMdep(recoveredMtbColtDto.getTestateOrdini().get(0).getCodMdep())
|
||||
.setEnableTransferLogic(isTransferLogicEnabled);
|
||||
.setOrderCodMdep(recoveredMtbColtDto.getTestateOrdini().get(0).getCodMdep());
|
||||
|
||||
RunnableArgs<CloseUDSResponseDTO> onRequestComplete = closeUDSResponseDto -> {
|
||||
colliDataRecoverService.closeSession(recoveredMtbColtID);
|
||||
|
||||
@ -915,8 +915,6 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void initJtbComtCache(Runnable onComplete) {
|
||||
if (this.mViewModel.getOrderList().getValue() == null) {
|
||||
this.jtbComtCache = new ArrayList<>();
|
||||
@ -925,8 +923,15 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
}
|
||||
var jtbComts = Stream.of(Objects.requireNonNull(this.mViewModel.getOrderList().getValue()))
|
||||
.flatMap(x -> Stream.of(x.getCodJcom()))
|
||||
.distinct().withoutNulls()
|
||||
.toList();
|
||||
|
||||
if (jtbComts.isEmpty()) {
|
||||
this.jtbComtCache = new ArrayList<>();
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
this.mCommessaRESTConsumer.getJtbComts(jtbComts, jtbComtCache -> {
|
||||
this.jtbComtCache = jtbComtCache;
|
||||
onComplete.run();
|
||||
|
||||
@ -1,459 +0,0 @@
|
||||
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.dialogs;
|
||||
|
||||
import android.app.DatePickerDialog;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.MultiAutoCompleteTextView;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.IFiltroOrdiniVendita;
|
||||
import it.integry.integrywmsnative.core.di.BindableString;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.databinding.DialogVenditaFiltroAvanzatoBinding;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoDTO;
|
||||
|
||||
|
||||
public class DialogVenditaFiltroAvanzatoView {
|
||||
|
||||
|
||||
private final AlertDialog currentAlert;
|
||||
private final Context currentContext;
|
||||
|
||||
private final RunnableArgs<DialogVenditaFiltroAvanzatoViewModel> currentOnFilterDone;
|
||||
|
||||
|
||||
|
||||
public BindableString deposito = new BindableString();
|
||||
public BindableString idViaggio = new BindableString();
|
||||
public BindableString numOrds = new BindableString();
|
||||
public BindableString cliente = new BindableString();
|
||||
public BindableString dataConsegna = new BindableString();
|
||||
public BindableString terminiConsegna = new BindableString();
|
||||
public BindableString agente = new BindableString();
|
||||
public BindableString vettore = new BindableString();
|
||||
public BindableString automezzo = new BindableString();
|
||||
public BindableString paese = new BindableString();
|
||||
|
||||
public Date dataConsegnaDate;
|
||||
|
||||
private ArrayAdapter<String> arrayAdapterCodMdep;
|
||||
private ArrayAdapter<String> arrayAdapterIdViaggio;
|
||||
private ArrayAdapter<String> arrayAdapterNumOrds;
|
||||
private ArrayAdapter<String> arrayAdapterCliente;
|
||||
private ArrayAdapter<String> arrayAdapterTermCons;
|
||||
private ArrayAdapter<String> arrayAdapterVettore;
|
||||
private ArrayAdapter<String> arrayAdapterAgente;
|
||||
private ArrayAdapter<String> arrayAdapterAutomezzo;
|
||||
private ArrayAdapter<String> arrayAdapterPaese;
|
||||
|
||||
private final DialogVenditaFiltroAvanzatoViewModel viewModel;
|
||||
|
||||
public static AlertDialog make(final Context context,
|
||||
final List<OrdiniUscitaElencoDTO> ordersList,
|
||||
DialogVenditaFiltroAvanzatoViewModel baseViewModel,
|
||||
RunnableArgs<DialogVenditaFiltroAvanzatoViewModel> onDismiss) {
|
||||
return new DialogVenditaFiltroAvanzatoView(context, ordersList, baseViewModel, onDismiss).currentAlert;
|
||||
}
|
||||
|
||||
private DialogVenditaFiltroAvanzatoView(final Context context, final List<OrdiniUscitaElencoDTO> ordersList, DialogVenditaFiltroAvanzatoViewModel baseViewModel, RunnableArgs<DialogVenditaFiltroAvanzatoViewModel> onDismiss) {
|
||||
currentContext = context;
|
||||
currentOnFilterDone = onDismiss;
|
||||
|
||||
viewModel = baseViewModel != null ? baseViewModel : new DialogVenditaFiltroAvanzatoViewModel();
|
||||
viewModel.init(ordersList);
|
||||
|
||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
||||
|
||||
DialogVenditaFiltroAvanzatoBinding binding = DataBindingUtil.inflate(inflater, R.layout.dialog_vendita_filtro_avanzato, null, false);
|
||||
|
||||
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(context)
|
||||
.setView(binding.getRoot());
|
||||
|
||||
binding.setView(this);
|
||||
binding.setViewmodel(viewModel);
|
||||
initViewModel(viewModel);
|
||||
initView(binding);
|
||||
|
||||
currentAlert = alertDialog.create();
|
||||
currentAlert.setCanceledOnTouchOutside(false);
|
||||
|
||||
currentAlert.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
currentAlert.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
|
||||
binding.positiveBtn.setOnClickListener(view -> {
|
||||
currentAlert.dismiss();
|
||||
});
|
||||
|
||||
binding.neutralBtn.setOnClickListener(view -> {
|
||||
resetAll();
|
||||
});
|
||||
|
||||
|
||||
currentAlert.setOnDismissListener(dialogInterface -> {
|
||||
if(currentOnFilterDone != null) currentOnFilterDone.run(viewModel);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void initView(DialogVenditaFiltroAvanzatoBinding bindings) {
|
||||
IFiltroOrdiniVendita filtroOrdiniVendita = ClassRouter.getInstance(ClassRouter.PATH.FILTRO_ORDINI_VENDITA);
|
||||
|
||||
// bindings.filledExposedDropdownDataCons.setOnFocusChangeListener((v, hasFocus) -> {
|
||||
// bindings.filledExposedDropdownDataCons.callOnClick();
|
||||
// });
|
||||
|
||||
bindings.filledExposedDropdownDataCons.setOnClickListener(view -> {
|
||||
Calendar c = UtilityDate.getCalendarInstance();
|
||||
|
||||
if(dataConsegnaDate != null) {
|
||||
c.setTime(dataConsegnaDate);
|
||||
}
|
||||
|
||||
int mYear = c.get(Calendar.YEAR);
|
||||
int mMonth = c.get(Calendar.MONTH);
|
||||
int mDay = c.get(Calendar.DAY_OF_MONTH);
|
||||
|
||||
DatePickerDialog datePickerDialog = new DatePickerDialog(currentContext,
|
||||
(view2, year, month, day) -> {
|
||||
|
||||
dataConsegnaDate = new GregorianCalendar(year, month, day).getTime();
|
||||
dataConsegna.set(UtilityDate.formatDate(dataConsegnaDate, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||
|
||||
}, mYear, mMonth, mDay);
|
||||
datePickerDialog.show();
|
||||
});
|
||||
|
||||
|
||||
arrayAdapterCodMdep = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
|
||||
arrayAdapterCodMdep.addAll(getAvailableCodMdeps(false));
|
||||
bindings.inputCodMdepNew.setVisibility(filtroOrdiniVendita.shoudShowCodMdepFilter() ? View.VISIBLE : View.GONE);
|
||||
bindings.filledExposedDropdownCodMdep.setAdapter(arrayAdapterCodMdep);
|
||||
|
||||
arrayAdapterIdViaggio = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
|
||||
arrayAdapterIdViaggio.addAll(getAvailableIdViaggio(false));
|
||||
bindings.inputIdViaggio.setVisibility(filtroOrdiniVendita.shoudShowIdViaggioFilter() ? View.VISIBLE : View.GONE);
|
||||
bindings.filledExposedDropdownIdViaggio.setAdapter(arrayAdapterIdViaggio);
|
||||
|
||||
arrayAdapterAgente = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
|
||||
arrayAdapterAgente.addAll(getAvailableAgente(false));
|
||||
bindings.inputAgente.setVisibility(filtroOrdiniVendita.shoudShowAgenteFilter() ? View.VISIBLE : View.GONE);
|
||||
bindings.filledExposedDropdownAgente.setAdapter(arrayAdapterAgente);
|
||||
|
||||
arrayAdapterNumOrds = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
|
||||
arrayAdapterNumOrds.addAll(getAvailableNumOrds(false));
|
||||
bindings.filledExposedDropdownNumOrds.setAdapter(arrayAdapterNumOrds);
|
||||
bindings.filledExposedDropdownNumOrds.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
|
||||
|
||||
arrayAdapterCliente = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
|
||||
arrayAdapterCliente.addAll(getAvailableCliente(false));
|
||||
bindings.filledExposedDropdownCliente.setAdapter(arrayAdapterCliente);
|
||||
|
||||
arrayAdapterTermCons = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
|
||||
arrayAdapterTermCons.addAll(getAvailableTermCons(false));
|
||||
bindings.filledExposedDropdownTermCons.setAdapter(arrayAdapterTermCons);
|
||||
|
||||
arrayAdapterVettore = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
|
||||
arrayAdapterVettore.addAll(getAvailableVettori(false));
|
||||
bindings.filledExposedDropdownVettore.setAdapter(arrayAdapterVettore);
|
||||
|
||||
arrayAdapterAutomezzo = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
|
||||
arrayAdapterAutomezzo.addAll(getAvailableAutomezzi(false));
|
||||
bindings.filledExposedDropdownAutomezzo.setAdapter(arrayAdapterAutomezzo);
|
||||
|
||||
arrayAdapterPaese = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
|
||||
arrayAdapterPaese.addAll(getAvailablePaesi(false));
|
||||
bindings.filledExposedDropdownPaese.setAdapter(arrayAdapterPaese);
|
||||
|
||||
|
||||
refreshAll();
|
||||
}
|
||||
|
||||
private void initViewModel(DialogVenditaFiltroAvanzatoViewModel viewModel) {
|
||||
viewModel.applyAllTests();
|
||||
|
||||
BindableString.registerListener(idViaggio, value -> {
|
||||
viewModel.setIDViaggioFilter(value);
|
||||
viewModel.applyAllTests();
|
||||
|
||||
refreshArrayAdapter(arrayAdapterCodMdep, getAvailableCodMdeps(true));
|
||||
refreshArrayAdapter(arrayAdapterNumOrds, getAvailableNumOrds(true));
|
||||
refreshArrayAdapter(arrayAdapterCliente, getAvailableCliente(true));
|
||||
refreshArrayAdapter(arrayAdapterTermCons, getAvailableTermCons(true));
|
||||
refreshArrayAdapter(arrayAdapterVettore, getAvailableVettori(true));
|
||||
refreshArrayAdapter(arrayAdapterAutomezzo, getAvailableAutomezzi(true));
|
||||
refreshArrayAdapter(arrayAdapterAgente, getAvailableAgente(true));
|
||||
refreshArrayAdapter(arrayAdapterPaese, getAvailablePaesi(true));
|
||||
});
|
||||
|
||||
BindableString.registerListener(deposito, value -> {
|
||||
viewModel.setDepositoFilter(value);
|
||||
viewModel.applyAllTests();
|
||||
|
||||
refreshArrayAdapter(arrayAdapterNumOrds, getAvailableNumOrds(true));
|
||||
refreshArrayAdapter(arrayAdapterIdViaggio, getAvailableIdViaggio(true));
|
||||
refreshArrayAdapter(arrayAdapterCliente, getAvailableCliente(true));
|
||||
refreshArrayAdapter(arrayAdapterTermCons, getAvailableTermCons(true));
|
||||
refreshArrayAdapter(arrayAdapterVettore, getAvailableVettori(true));
|
||||
refreshArrayAdapter(arrayAdapterAutomezzo, getAvailableAutomezzi(true));
|
||||
refreshArrayAdapter(arrayAdapterAgente, getAvailableAgente(true));
|
||||
refreshArrayAdapter(arrayAdapterPaese, getAvailablePaesi(true));
|
||||
});
|
||||
|
||||
BindableString.registerListener(numOrds, value -> {
|
||||
viewModel.setNumOrdFilter(value);
|
||||
viewModel.applyAllTests();
|
||||
|
||||
refreshArrayAdapter(arrayAdapterCodMdep, getAvailableCodMdeps(true));
|
||||
refreshArrayAdapter(arrayAdapterIdViaggio, getAvailableIdViaggio(true));
|
||||
refreshArrayAdapter(arrayAdapterCliente, getAvailableCliente(true));
|
||||
refreshArrayAdapter(arrayAdapterTermCons, getAvailableTermCons(true));
|
||||
refreshArrayAdapter(arrayAdapterVettore, getAvailableVettori(true));
|
||||
refreshArrayAdapter(arrayAdapterAutomezzo, getAvailableAutomezzi(true));
|
||||
refreshArrayAdapter(arrayAdapterAgente, getAvailableAgente(true));
|
||||
refreshArrayAdapter(arrayAdapterPaese, getAvailablePaesi(true));
|
||||
});
|
||||
|
||||
BindableString.registerListener(cliente, value -> {
|
||||
viewModel.setClienteFilter(value);
|
||||
viewModel.applyAllTests();
|
||||
|
||||
refreshArrayAdapter(arrayAdapterCodMdep, getAvailableCodMdeps(true));
|
||||
refreshArrayAdapter(arrayAdapterIdViaggio, getAvailableIdViaggio(true));
|
||||
refreshArrayAdapter(arrayAdapterNumOrds, getAvailableNumOrds(true));
|
||||
refreshArrayAdapter(arrayAdapterTermCons, getAvailableTermCons(true));
|
||||
refreshArrayAdapter(arrayAdapterVettore, getAvailableVettori(true));
|
||||
refreshArrayAdapter(arrayAdapterAutomezzo, getAvailableAutomezzi(true));
|
||||
refreshArrayAdapter(arrayAdapterAgente, getAvailableAgente(true));
|
||||
refreshArrayAdapter(arrayAdapterPaese, getAvailablePaesi(true));
|
||||
});
|
||||
|
||||
BindableString.registerListener(terminiConsegna, value -> {
|
||||
viewModel.setTerminiConsegnaFilter(value);
|
||||
viewModel.applyAllTests();
|
||||
|
||||
refreshArrayAdapter(arrayAdapterCodMdep, getAvailableCodMdeps(true));
|
||||
refreshArrayAdapter(arrayAdapterIdViaggio, getAvailableIdViaggio(true));
|
||||
refreshArrayAdapter(arrayAdapterNumOrds, getAvailableNumOrds(true));
|
||||
refreshArrayAdapter(arrayAdapterCliente, getAvailableCliente(true));
|
||||
refreshArrayAdapter(arrayAdapterVettore, getAvailableVettori(true));
|
||||
refreshArrayAdapter(arrayAdapterAutomezzo, getAvailableAutomezzi(true));
|
||||
refreshArrayAdapter(arrayAdapterAgente, getAvailableAgente(true));
|
||||
refreshArrayAdapter(arrayAdapterPaese, getAvailablePaesi(true));
|
||||
});
|
||||
|
||||
BindableString.registerListener(vettore, value -> {
|
||||
viewModel.setVettoreFilter(value);
|
||||
viewModel.applyAllTests();
|
||||
|
||||
refreshArrayAdapter(arrayAdapterCodMdep, getAvailableCodMdeps(true));
|
||||
refreshArrayAdapter(arrayAdapterIdViaggio, getAvailableIdViaggio(true));
|
||||
refreshArrayAdapter(arrayAdapterNumOrds, getAvailableNumOrds(true));
|
||||
refreshArrayAdapter(arrayAdapterCliente, getAvailableCliente(true));
|
||||
refreshArrayAdapter(arrayAdapterTermCons, getAvailableTermCons(true));
|
||||
refreshArrayAdapter(arrayAdapterAutomezzo, getAvailableAutomezzi(true));
|
||||
refreshArrayAdapter(arrayAdapterAgente, getAvailableAgente(true));
|
||||
refreshArrayAdapter(arrayAdapterPaese, getAvailablePaesi(true));
|
||||
});
|
||||
|
||||
BindableString.registerListener(automezzo, value -> {
|
||||
viewModel.setAutomezzoFilter(value);
|
||||
viewModel.applyAllTests();
|
||||
|
||||
refreshArrayAdapter(arrayAdapterCodMdep, getAvailableCodMdeps(true));
|
||||
refreshArrayAdapter(arrayAdapterIdViaggio, getAvailableIdViaggio(true));
|
||||
refreshArrayAdapter(arrayAdapterNumOrds, getAvailableNumOrds(true));
|
||||
refreshArrayAdapter(arrayAdapterCliente, getAvailableCliente(true));
|
||||
refreshArrayAdapter(arrayAdapterTermCons, getAvailableTermCons(true));
|
||||
refreshArrayAdapter(arrayAdapterVettore, getAvailableVettori(true));
|
||||
refreshArrayAdapter(arrayAdapterAgente, getAvailableAgente(true));
|
||||
refreshArrayAdapter(arrayAdapterPaese, getAvailablePaesi(true));
|
||||
});
|
||||
|
||||
BindableString.resetListeners(dataConsegna);
|
||||
BindableString.registerListener(dataConsegna, value -> {
|
||||
viewModel.setDataConsegnaFilter(dataConsegnaDate);
|
||||
viewModel.applyAllTests();
|
||||
|
||||
refreshArrayAdapter(arrayAdapterCodMdep, getAvailableCodMdeps(true));
|
||||
refreshArrayAdapter(arrayAdapterIdViaggio, getAvailableIdViaggio(true));
|
||||
refreshArrayAdapter(arrayAdapterNumOrds, getAvailableNumOrds(true));
|
||||
refreshArrayAdapter(arrayAdapterCliente, getAvailableCliente(true));
|
||||
refreshArrayAdapter(arrayAdapterTermCons, getAvailableTermCons(true));
|
||||
refreshArrayAdapter(arrayAdapterVettore, getAvailableVettori(true));
|
||||
refreshArrayAdapter(arrayAdapterAgente, getAvailableAgente(true));
|
||||
refreshArrayAdapter(arrayAdapterPaese, getAvailablePaesi(true));
|
||||
refreshArrayAdapter(arrayAdapterAutomezzo, getAvailableAutomezzi(true));
|
||||
});
|
||||
|
||||
BindableString.resetListeners(agente);
|
||||
BindableString.registerListener(agente, value -> {
|
||||
viewModel.setAgenteFilter(value);
|
||||
viewModel.applyAllTests();
|
||||
|
||||
refreshArrayAdapter(arrayAdapterCodMdep, getAvailableCodMdeps(true));
|
||||
refreshArrayAdapter(arrayAdapterIdViaggio, getAvailableIdViaggio(true));
|
||||
refreshArrayAdapter(arrayAdapterNumOrds, getAvailableNumOrds(true));
|
||||
refreshArrayAdapter(arrayAdapterCliente, getAvailableCliente(true));
|
||||
refreshArrayAdapter(arrayAdapterTermCons, getAvailableTermCons(true));
|
||||
refreshArrayAdapter(arrayAdapterVettore, getAvailableVettori(true));
|
||||
refreshArrayAdapter(arrayAdapterPaese, getAvailablePaesi(true));
|
||||
refreshArrayAdapter(arrayAdapterAutomezzo, getAvailableAutomezzi(true));
|
||||
});
|
||||
|
||||
BindableString.resetListeners(paese);
|
||||
BindableString.registerListener(paese, value -> {
|
||||
viewModel.setPaeseFilter(value);
|
||||
viewModel.applyAllTests();
|
||||
|
||||
refreshArrayAdapter(arrayAdapterCodMdep, getAvailableCodMdeps(true));
|
||||
refreshArrayAdapter(arrayAdapterIdViaggio, getAvailableIdViaggio(true));
|
||||
refreshArrayAdapter(arrayAdapterNumOrds, getAvailableNumOrds(true));
|
||||
refreshArrayAdapter(arrayAdapterCliente, getAvailableCliente(true));
|
||||
refreshArrayAdapter(arrayAdapterTermCons, getAvailableTermCons(true));
|
||||
refreshArrayAdapter(arrayAdapterVettore, getAvailableVettori(true));
|
||||
refreshArrayAdapter(arrayAdapterAgente, getAvailableAgente(true));
|
||||
refreshArrayAdapter(arrayAdapterAutomezzo, getAvailableAutomezzi(true));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void refreshArrayAdapter(ArrayAdapter<String> arrayAdapter, List<String> inputList) {
|
||||
arrayAdapter.clear();
|
||||
arrayAdapter.addAll(inputList);
|
||||
arrayAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
private List<String> getAvailableIdViaggio(boolean skipRecalc) {
|
||||
return Stream
|
||||
.of(Objects.requireNonNull(viewModel.getMutableFilteredOrderList().getValue()))
|
||||
.filter(x -> x.getIdViaggio() != null)
|
||||
.sortBy(x -> -x.getIdViaggio())
|
||||
.map(x -> x.getIdViaggio() != null ? x.getIdViaggio().toString() : null)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
|
||||
private List<String> getAvailableAgente(boolean skipRecalc) {
|
||||
return Stream.of(Objects.requireNonNull(viewModel.getMutableFilteredOrderList().getValue()))
|
||||
.map(OrdiniUscitaElencoDTO::getNomeAgente)
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.sorted()
|
||||
.toList();
|
||||
}
|
||||
|
||||
private List<String> getAvailableCodMdeps(boolean skipRecalc) {
|
||||
return Stream.of(Objects.requireNonNull(viewModel.getMutableFilteredOrderList().getValue()))
|
||||
.map(OrdiniUscitaElencoDTO::getCodMdep)
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.sorted()
|
||||
.toList();
|
||||
}
|
||||
|
||||
private List<String> getAvailableCliente(boolean skipRecalc) {
|
||||
return Stream.of(Objects.requireNonNull(viewModel.getMutableFilteredOrderList().getValue()))
|
||||
.map(OrdiniUscitaElencoDTO::getRagSocOrd)
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.sorted()
|
||||
.toList();
|
||||
}
|
||||
|
||||
private List<String> getAvailableNumOrds(boolean skipRecalc) {
|
||||
return Stream.of(Objects.requireNonNull(viewModel.getMutableFilteredOrderList().getValue()))
|
||||
.map(x -> x.getNumOrd().toString())
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.sorted()
|
||||
.toList();
|
||||
}
|
||||
|
||||
private List<String> getAvailableTermCons(boolean skipRecalc) {
|
||||
return Stream.of(Objects.requireNonNull(viewModel.getMutableFilteredOrderList().getValue()))
|
||||
.map(OrdiniUscitaElencoDTO::getTermCons)
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.sorted()
|
||||
.toList();
|
||||
}
|
||||
|
||||
private List<String> getAvailableVettori(boolean skipRecalc) {
|
||||
return Stream.of(Objects.requireNonNull(viewModel.getMutableFilteredOrderList().getValue()))
|
||||
.filter(x -> x.getCodVvet() != null)
|
||||
.map(x -> x.getCodVvet() + " - " + x.getDescrizioneVettore())
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.sorted()
|
||||
.toList();
|
||||
}
|
||||
|
||||
private List<String> getAvailableAutomezzi(boolean skipRecalc) {
|
||||
return Stream.of(Objects.requireNonNull(viewModel.getMutableFilteredOrderList().getValue()))
|
||||
.map(OrdiniUscitaElencoDTO::getDescrizioneAuto)
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.sorted()
|
||||
.toList();
|
||||
}
|
||||
|
||||
private List<String> getAvailablePaesi(boolean skipRecalc) {
|
||||
return Stream.of(Objects.requireNonNull(viewModel.getMutableFilteredOrderList().getValue()))
|
||||
.map(OrdiniUscitaElencoDTO::getCitta)
|
||||
.withoutNulls()
|
||||
.distinct()
|
||||
.sorted()
|
||||
.toList();
|
||||
}
|
||||
|
||||
|
||||
public void refreshAll() {
|
||||
deposito.refresh();
|
||||
idViaggio.refresh();
|
||||
numOrds.refresh();
|
||||
cliente.refresh();
|
||||
terminiConsegna.refresh();
|
||||
vettore.refresh();
|
||||
automezzo.refresh();
|
||||
dataConsegna.refresh();
|
||||
agente.refresh();
|
||||
paese.refresh();
|
||||
}
|
||||
|
||||
|
||||
public void resetAll() {
|
||||
deposito.set(null);
|
||||
idViaggio.set(null);
|
||||
numOrds.set(null);
|
||||
cliente.set(null);
|
||||
dataConsegna.set(null);
|
||||
terminiConsegna.set(null);
|
||||
vettore.set(null);
|
||||
automezzo.set(null);
|
||||
agente.set(null);
|
||||
paese.set(null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,167 +0,0 @@
|
||||
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.dialogs;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.annimon.stream.function.Predicate;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoDTO;
|
||||
|
||||
public class DialogVenditaFiltroAvanzatoViewModel {
|
||||
|
||||
private Predicate<OrdiniUscitaElencoDTO> currentDepositoPredicate = null;
|
||||
private Predicate<OrdiniUscitaElencoDTO> currentIdViaggioPredicate = null;
|
||||
private Predicate<OrdiniUscitaElencoDTO> currentNumOrdsPredicate = null;
|
||||
private Predicate<OrdiniUscitaElencoDTO> currentClientePredicate = null;
|
||||
private Predicate<OrdiniUscitaElencoDTO> currentDataConsPredicate = null;
|
||||
private Predicate<OrdiniUscitaElencoDTO> currentTermConsPredicate = null;
|
||||
private Predicate<OrdiniUscitaElencoDTO> currentVettorePredicate = null;
|
||||
private Predicate<OrdiniUscitaElencoDTO> currentAgentePredicate = null;
|
||||
private Predicate<OrdiniUscitaElencoDTO> currentAutomezzoPredicate = null;
|
||||
private Predicate<OrdiniUscitaElencoDTO> currentPaesePredicate = null;
|
||||
|
||||
|
||||
private List<OrdiniUscitaElencoDTO> initialOrderList;
|
||||
private final MutableLiveData<List<OrdiniUscitaElencoDTO>> currentFilteredOrderList = new MutableLiveData<>();
|
||||
|
||||
public void init(List<OrdiniUscitaElencoDTO> initialList) {
|
||||
this.initialOrderList = initialList;
|
||||
this.currentFilteredOrderList.setValue(this.initialOrderList);
|
||||
}
|
||||
|
||||
public MutableLiveData<List<OrdiniUscitaElencoDTO>> getMutableFilteredOrderList() {
|
||||
return this.currentFilteredOrderList;
|
||||
}
|
||||
|
||||
public void setIDViaggioFilter(String idViaggio) {
|
||||
if(UtilityString.isNullOrEmpty(idViaggio)) currentIdViaggioPredicate = null;
|
||||
else {
|
||||
String[] idViaggiSplitted = idViaggio.split("[,\\ ]");
|
||||
|
||||
try{
|
||||
List<Integer> idViaggiInteger = Stream.of(idViaggiSplitted)
|
||||
.filter(x -> !UtilityString.isNullOrEmpty(x))
|
||||
.map(Integer::parseInt).toList();
|
||||
|
||||
currentIdViaggioPredicate = o -> idViaggiInteger.contains(o.getIdViaggio());
|
||||
} catch (NumberFormatException ex) {
|
||||
currentIdViaggioPredicate = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setDepositoFilter(String deposito) {
|
||||
if(UtilityString.isNullOrEmpty(deposito)) currentDepositoPredicate = null;
|
||||
else {
|
||||
currentDepositoPredicate = o -> o.getCodMdep().toLowerCase().equalsIgnoreCase(deposito);
|
||||
}
|
||||
}
|
||||
|
||||
public void setNumOrdFilter(String numOrds) {
|
||||
if(UtilityString.isNullOrEmpty(numOrds)) currentNumOrdsPredicate = null;
|
||||
else {
|
||||
String[] numOrdsSplitted = numOrds.split("[,\\ ]");
|
||||
|
||||
try{
|
||||
List<Integer> numOrdsInteger = Stream.of(numOrdsSplitted)
|
||||
.filter(x -> !UtilityString.isNullOrEmpty(x))
|
||||
.map(Integer::parseInt).toList();
|
||||
|
||||
currentNumOrdsPredicate = o -> numOrdsInteger.contains(o.getNumOrd());
|
||||
} catch (NumberFormatException ex) {
|
||||
currentNumOrdsPredicate = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setClienteFilter(String cliente) {
|
||||
if(UtilityString.isNullOrEmpty(cliente)) currentClientePredicate = null;
|
||||
else {
|
||||
currentClientePredicate = o -> o.getRagSocOrd().toLowerCase().contains(cliente.toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
public void setTerminiConsegnaFilter(String terminiConsegna) {
|
||||
if(UtilityString.isNullOrEmpty(terminiConsegna)) currentTermConsPredicate = null;
|
||||
else {
|
||||
currentTermConsPredicate = o -> !UtilityString.isNullOrEmpty(o.getTermCons()) && o.getTermCons().equalsIgnoreCase(terminiConsegna);
|
||||
}
|
||||
}
|
||||
|
||||
public void setVettoreFilter(String vettore) {
|
||||
if(UtilityString.isNullOrEmpty(vettore)) currentVettorePredicate = null;
|
||||
else {
|
||||
currentVettorePredicate = o -> (o.getCodVvet() + " - " + o.getDescrizioneVettore()).equalsIgnoreCase(vettore);
|
||||
}
|
||||
}
|
||||
|
||||
public void setAutomezzoFilter(String automezzo) {
|
||||
if(UtilityString.isNullOrEmpty(automezzo)) currentAutomezzoPredicate = null;
|
||||
else {
|
||||
currentAutomezzoPredicate = o -> !UtilityString.isNullOrEmpty(o.getDescrizioneAuto()) && (o.getDescrizioneAuto().toLowerCase().contains(automezzo) || o.getDescrizioneAuto().equalsIgnoreCase(automezzo));
|
||||
}
|
||||
}
|
||||
|
||||
public void setDataConsegnaFilter(Date dataConsegna) {
|
||||
if(dataConsegna == null) currentDataConsPredicate = null;
|
||||
else {
|
||||
currentDataConsPredicate = o -> o.getDataConsD().equals(dataConsegna);
|
||||
}
|
||||
}
|
||||
|
||||
public void setAgenteFilter(String agente) {
|
||||
if(UtilityString.isNullOrEmpty(agente)) currentAgentePredicate = null;
|
||||
else {
|
||||
currentAgentePredicate = o -> !UtilityString.isNullOrEmpty(o.getNomeAgente()) && (o.getNomeAgente().toLowerCase().contains(agente) || o.getNomeAgente().equalsIgnoreCase(agente));
|
||||
}
|
||||
}
|
||||
|
||||
public void setPaeseFilter(String paese) {
|
||||
if(UtilityString.isNullOrEmpty(paese)) currentPaesePredicate = null;
|
||||
else {
|
||||
currentPaesePredicate = o -> !UtilityString.isNullOrEmpty(o.getCitta()) && (o.getCitta().toLowerCase().contains(paese) || o.getCitta().equalsIgnoreCase(paese));
|
||||
}
|
||||
}
|
||||
|
||||
public void applyAllTests() {
|
||||
|
||||
List<OrdiniUscitaElencoDTO> returnList = null;
|
||||
|
||||
if (currentNumOrdsPredicate == null &&
|
||||
currentClientePredicate == null &&
|
||||
currentDataConsPredicate == null &&
|
||||
currentTermConsPredicate == null &&
|
||||
currentVettorePredicate == null &&
|
||||
currentAutomezzoPredicate == null &&
|
||||
currentDepositoPredicate == null &&
|
||||
currentIdViaggioPredicate == null &&
|
||||
currentAgentePredicate == null &&
|
||||
currentPaesePredicate == null
|
||||
) {
|
||||
returnList = this.initialOrderList;
|
||||
} else {
|
||||
Stream<OrdiniUscitaElencoDTO> tmpStream = Stream.of(this.initialOrderList)
|
||||
.filter(x ->
|
||||
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
||||
(currentClientePredicate == null || (currentClientePredicate.test(x))) &&
|
||||
(currentDataConsPredicate == null || (currentDataConsPredicate.test(x))) &&
|
||||
(currentTermConsPredicate == null || (currentTermConsPredicate.test(x))) &&
|
||||
(currentVettorePredicate == null || (currentVettorePredicate.test(x))) &&
|
||||
(currentAutomezzoPredicate == null || (currentAutomezzoPredicate.test(x))) &&
|
||||
(currentDepositoPredicate == null || (currentDepositoPredicate.test(x))) &&
|
||||
(currentIdViaggioPredicate == null || (currentIdViaggioPredicate.test(x))) &&
|
||||
(currentAgentePredicate == null || (currentAgentePredicate.test(x))) &&
|
||||
(currentPaesePredicate == null || (currentPaesePredicate.test(x)))
|
||||
);
|
||||
|
||||
returnList = tmpStream.toList();
|
||||
}
|
||||
|
||||
this.currentFilteredOrderList.setValue(returnList);
|
||||
}
|
||||
|
||||
}
|
||||
@ -316,7 +316,8 @@ public class ProdOrdineProduzioneElencoFragment extends BaseFragment implements
|
||||
.filter(y -> y.getBarcode().equals(x.getBarcode()))
|
||||
.map(y -> new MainListProdOrdineProduzioneElencoClienteListModel()
|
||||
.setPrimaryText(y.getRifOrd())
|
||||
.setRightText(y.getCodJcom()))
|
||||
.setRightText(y.getCodJcom())
|
||||
.setOriginalModel(y))
|
||||
.toList();
|
||||
|
||||
listModel.setClientiListModel(clienti);
|
||||
|
||||
@ -1,164 +0,0 @@
|
||||
package it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.MultiAutoCompleteTextView;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.di.BindableString;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.databinding.DialogOrdineProduzioneFiltroAvanzatoBinding;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||
|
||||
public class DialogOrdineProduzioneFiltroAvanzatoView {
|
||||
|
||||
|
||||
private AlertDialog currentAlert;
|
||||
private Context currentContext;
|
||||
|
||||
private RunnableArgs<DialogOrdineProduzioneFiltroAvanzatoViewModel> currentOnFilterDone;
|
||||
|
||||
public BindableString numOrds = new BindableString();
|
||||
public BindableString codJcoms = new BindableString();
|
||||
|
||||
private ArrayAdapter<String> arrayAdapterNumOrds;
|
||||
private ArrayAdapter<String> arrayAdapterCodJcoms;
|
||||
|
||||
private DialogOrdineProduzioneFiltroAvanzatoViewModel mViewModel;
|
||||
|
||||
|
||||
|
||||
public static AlertDialog make(final Context context,
|
||||
final List<OrdineAccettazioneInevasoDTO> ordersList,
|
||||
DialogOrdineProduzioneFiltroAvanzatoViewModel baseViewModel,
|
||||
RunnableArgs<DialogOrdineProduzioneFiltroAvanzatoViewModel> onDismiss) {
|
||||
return new DialogOrdineProduzioneFiltroAvanzatoView(context, ordersList, baseViewModel, onDismiss).currentAlert;
|
||||
}
|
||||
|
||||
|
||||
private DialogOrdineProduzioneFiltroAvanzatoView(final Context context, final List<OrdineAccettazioneInevasoDTO> ordersList, DialogOrdineProduzioneFiltroAvanzatoViewModel baseViewModel, RunnableArgs<DialogOrdineProduzioneFiltroAvanzatoViewModel> onDismiss) {
|
||||
currentContext = context;
|
||||
currentOnFilterDone = onDismiss;
|
||||
|
||||
mViewModel = baseViewModel != null ? baseViewModel : new DialogOrdineProduzioneFiltroAvanzatoViewModel();
|
||||
mViewModel.init(ordersList);
|
||||
|
||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
|
||||
DialogOrdineProduzioneFiltroAvanzatoBinding binding = DataBindingUtil.inflate(inflater, R.layout.dialog_ordine_produzione_filtro_avanzato, null, false);
|
||||
|
||||
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(context)
|
||||
.setView(binding.getRoot());
|
||||
|
||||
binding.setView(this);
|
||||
binding.setViewmodel(mViewModel);
|
||||
initViewModel(mViewModel);
|
||||
initView(binding);
|
||||
|
||||
currentAlert = alertDialog.create();
|
||||
currentAlert.setCanceledOnTouchOutside(false);
|
||||
|
||||
currentAlert.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
currentAlert.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
|
||||
binding.positiveBtn.setOnClickListener(view -> {
|
||||
currentAlert.dismiss();
|
||||
});
|
||||
|
||||
binding.neutralBtn.setOnClickListener(view -> {
|
||||
resetAll();
|
||||
});
|
||||
|
||||
|
||||
currentAlert.setOnDismissListener(dialogInterface -> {
|
||||
if(currentOnFilterDone != null) currentOnFilterDone.run(mViewModel);
|
||||
});
|
||||
}
|
||||
|
||||
private void initView(DialogOrdineProduzioneFiltroAvanzatoBinding bindings) {
|
||||
|
||||
arrayAdapterNumOrds = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
|
||||
arrayAdapterNumOrds.addAll(getAvailableNumOrds(false));
|
||||
bindings.filledExposedDropdownNumOrds.setAdapter(arrayAdapterNumOrds);
|
||||
bindings.filledExposedDropdownNumOrds.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
|
||||
|
||||
arrayAdapterCodJcoms = new ArrayAdapter(currentContext, R.layout.dialog_vendita_filtro_avanzato__single_item);
|
||||
arrayAdapterCodJcoms.addAll(getAvailableCodJcoms(false));
|
||||
bindings.filledExposedDropdownCodJcoms.setAdapter(arrayAdapterCodJcoms);
|
||||
bindings.filledExposedDropdownCodJcoms.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
|
||||
|
||||
|
||||
refreshAll();
|
||||
}
|
||||
|
||||
|
||||
private void initViewModel(DialogOrdineProduzioneFiltroAvanzatoViewModel viewModel) {
|
||||
viewModel.applyAllTests();
|
||||
|
||||
BindableString.registerListener(numOrds, value -> {
|
||||
viewModel.setNumOrdFilter(value);
|
||||
viewModel.applyAllTests();
|
||||
|
||||
refreshArrayAdapter(arrayAdapterCodJcoms, getAvailableCodJcoms(true));
|
||||
});
|
||||
|
||||
BindableString.registerListener(codJcoms, value -> {
|
||||
viewModel.setCodJcomFilter(value);
|
||||
viewModel.applyAllTests();
|
||||
|
||||
refreshArrayAdapter(arrayAdapterNumOrds, getAvailableNumOrds(true));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void refreshArrayAdapter(ArrayAdapter<String> arrayAdapter, List<String> inputList) {
|
||||
arrayAdapter.clear();
|
||||
arrayAdapter.addAll(inputList);
|
||||
arrayAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
private List<String> getAvailableNumOrds(boolean skipRecalc) {
|
||||
return Stream.of(Objects.requireNonNull(mViewModel.getMutableFilteredOrderList().getValue()))
|
||||
.map(x -> x.getNumero().toString())
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.sorted()
|
||||
.toList();
|
||||
}
|
||||
|
||||
|
||||
private List<String> getAvailableCodJcoms(boolean skipRecalc) {
|
||||
return Stream.of(Objects.requireNonNull(mViewModel.getMutableFilteredOrderList().getValue()))
|
||||
.map(OrdineAccettazioneInevasoDTO::getCodJcom)
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.sorted()
|
||||
.toList();
|
||||
}
|
||||
|
||||
|
||||
public void refreshAll() {
|
||||
numOrds.refresh();
|
||||
codJcoms.refresh();
|
||||
}
|
||||
|
||||
|
||||
public void resetAll() {
|
||||
numOrds.set(null);
|
||||
codJcoms.set(null);
|
||||
}
|
||||
}
|
||||
@ -1,76 +0,0 @@
|
||||
package it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.dialog;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.annimon.stream.function.Predicate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||
|
||||
public class DialogOrdineProduzioneFiltroAvanzatoViewModel {
|
||||
|
||||
|
||||
private Predicate<OrdineAccettazioneInevasoDTO> currentNumOrdsPredicate = null;
|
||||
private Predicate<OrdineAccettazioneInevasoDTO> currentCodJcomsPredicate = null;
|
||||
|
||||
private List<OrdineAccettazioneInevasoDTO> initialOrderList;
|
||||
private final MutableLiveData<List<OrdineAccettazioneInevasoDTO>> currentFilteredOrderList = new MutableLiveData<>();
|
||||
|
||||
public void init(List<OrdineAccettazioneInevasoDTO> initialList) {
|
||||
this.initialOrderList = initialList;
|
||||
this.currentFilteredOrderList.setValue(this.initialOrderList);
|
||||
}
|
||||
|
||||
public MutableLiveData<List<OrdineAccettazioneInevasoDTO>> getMutableFilteredOrderList() {
|
||||
return this.currentFilteredOrderList;
|
||||
}
|
||||
|
||||
public void setNumOrdFilter(String numOrds) {
|
||||
if(UtilityString.isNullOrEmpty(numOrds)) currentNumOrdsPredicate = null;
|
||||
else {
|
||||
String[] numOrdsSplitted = numOrds.split("[,\\ ]");
|
||||
|
||||
try{
|
||||
List<Integer> numOrdsInteger = Stream.of(numOrdsSplitted)
|
||||
.filter(x -> !UtilityString.isNullOrEmpty(x))
|
||||
.map(Integer::parseInt).toList();
|
||||
|
||||
currentNumOrdsPredicate = o -> numOrdsInteger.contains(o.getNumero());
|
||||
} catch (NumberFormatException ex) {
|
||||
currentNumOrdsPredicate = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setCodJcomFilter(String codJcom) {
|
||||
if(UtilityString.isNullOrEmpty(codJcom)) currentCodJcomsPredicate = null;
|
||||
else {
|
||||
currentCodJcomsPredicate = o -> o.getCodJcom().toLowerCase().equalsIgnoreCase(codJcom);
|
||||
}
|
||||
}
|
||||
|
||||
public void applyAllTests() {
|
||||
|
||||
List<OrdineAccettazioneInevasoDTO> returnList = null;
|
||||
|
||||
if (currentNumOrdsPredicate == null &&
|
||||
currentCodJcomsPredicate == null
|
||||
) {
|
||||
returnList = this.initialOrderList;
|
||||
} else {
|
||||
Stream<OrdineAccettazioneInevasoDTO> tmpStream = Stream.of(this.initialOrderList)
|
||||
.filter(x ->
|
||||
(currentNumOrdsPredicate == null || (currentNumOrdsPredicate.test(x))) &&
|
||||
(currentCodJcomsPredicate == null || (currentCodJcomsPredicate.test(x)))
|
||||
);
|
||||
|
||||
returnList = tmpStream.toList();
|
||||
}
|
||||
|
||||
this.currentFilteredOrderList.setValue(returnList);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,9 +1,13 @@
|
||||
package it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ui;
|
||||
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||
|
||||
public class MainListProdOrdineProduzioneElencoClienteListModel {
|
||||
private String primaryText;
|
||||
private String rightText;
|
||||
|
||||
private OrdineAccettazioneInevasoDTO originalModel;
|
||||
|
||||
|
||||
public String getPrimaryText() {
|
||||
return primaryText;
|
||||
@ -22,4 +26,13 @@ public class MainListProdOrdineProduzioneElencoClienteListModel {
|
||||
this.rightText = rightText;
|
||||
return this;
|
||||
}
|
||||
|
||||
public OrdineAccettazioneInevasoDTO getOriginalModel() {
|
||||
return originalModel;
|
||||
}
|
||||
|
||||
public MainListProdOrdineProduzioneElencoClienteListModel setOriginalModel(OrdineAccettazioneInevasoDTO originalModel) {
|
||||
this.originalModel = originalModel;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
package it.integry.integrywmsnative.gest.settings;
|
||||
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface MainSettingsComponent {
|
||||
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
|
||||
MainSettingsComponent create();
|
||||
}
|
||||
|
||||
void inject(MainSettingsFragment mainSettingsFragment);
|
||||
|
||||
}
|
||||
@ -3,9 +3,14 @@ package it.integry.integrywmsnative.gest.settings;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
import android.util.Base64;
|
||||
import android.util.Base64OutputStream;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.preference.EditTextPreference;
|
||||
import androidx.preference.ListPreference;
|
||||
@ -15,25 +20,58 @@ import androidx.preference.PreferenceFragmentCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.harrysoft.androidbluetoothserial.BluetoothManager;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeSetting;
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.context.AppContext;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.MailAttachmentDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.MailRequestDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
import it.integry.integrywmsnative.view.dialogs.yes_no.DialogYesNoView;
|
||||
|
||||
public class MainSettingsFragment extends PreferenceFragmentCompat implements ITitledFragment, Preference.OnPreferenceChangeListener {
|
||||
|
||||
@Inject
|
||||
public AppContext appContext;
|
||||
@Inject
|
||||
public SystemRESTConsumer systemRESTConsumer;
|
||||
@Inject
|
||||
public DialogProgressView mCurrentProgress;
|
||||
private boolean progressOpened;
|
||||
|
||||
private final ArrayList<Runnable> onPreDestroyList = new ArrayList<>();
|
||||
|
||||
public static final String KEY_PALLET_BT_DEVICE = "pallet_scale_bt_device";
|
||||
public static final String KEY_TRIGGER_SCAN_MODE = "TRIG_SCAN_MODE";
|
||||
public static final String KEY_TRIGGER_SCAN_DELAY = "TRIG_SCAN_DELAY";
|
||||
public static final String KEY_BUTTON_EXPORT_LOG = "EXPORT_LOG";
|
||||
|
||||
private Collection<BluetoothDevice> btPairedDevices;
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
MainApplication
|
||||
.appComponent
|
||||
.mainSettingsFragmentComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||
titleText.setText(context.getText(R.string.settings_category).toString());
|
||||
@ -55,6 +93,13 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
|
||||
loadScanModePreferences();
|
||||
triggerScanModeListPref.setOnPreferenceChangeListener(this);
|
||||
triggerScanModeListPref.setSummary(triggerScanModeListPref.getValue());
|
||||
|
||||
Preference button = findPreference(KEY_BUTTON_EXPORT_LOG);
|
||||
button.setOnPreferenceClickListener(preference -> {
|
||||
exportLog();
|
||||
return true;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -164,4 +209,74 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
|
||||
listPref.setSummary(btDeviceName);
|
||||
}
|
||||
|
||||
|
||||
private void exportLog() {
|
||||
DialogYesNoView.newInstance("Esportazione log", "Vuoi inviare il log degli eventi al supporto?", result -> {
|
||||
this.openProgress();
|
||||
|
||||
File yourFile = appContext.getLogFilePath();
|
||||
var files = yourFile.listFiles();
|
||||
|
||||
var fileToShare = Stream.of(files)
|
||||
.sortBy(x -> -1 * x.lastModified())
|
||||
.findFirstOrElse(null);
|
||||
try {
|
||||
FileInputStream fis = new FileInputStream(fileToShare);
|
||||
|
||||
byte[] buffer = new byte[fis.available()];//specify the size to allow
|
||||
int bytesRead;
|
||||
ByteArrayOutputStream output = new ByteArrayOutputStream();
|
||||
Base64OutputStream output64 = new Base64OutputStream(output, Base64.DEFAULT);
|
||||
|
||||
while ((bytesRead = fis.read(buffer)) != -1) {
|
||||
output64.write(buffer, 0, bytesRead);
|
||||
}
|
||||
|
||||
output64.close();
|
||||
|
||||
var attachment = new MailAttachmentDTO()
|
||||
.setFileName("wms_log.log")
|
||||
.setFileb64Content(output.toString());
|
||||
|
||||
var mailRequest = new MailRequestDTO()
|
||||
.setTo("developer@integry.it")
|
||||
.setMsgText("Questo è una mail che contiene il log del WMS")
|
||||
.setSubject("U vuemmeess")
|
||||
.setAttachments(new ArrayList<>());
|
||||
|
||||
mailRequest.getAttachments().add(attachment);
|
||||
|
||||
systemRESTConsumer.sendMail(mailRequest, this::closeProgress, ex -> {
|
||||
this.closeProgress();
|
||||
DialogSimpleMessageView
|
||||
.makeErrorDialog(new SpannableString(Html.fromHtml(ex.getMessage())), null, null)
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
});
|
||||
} catch (Exception ex) {
|
||||
DialogSimpleMessageView
|
||||
.makeErrorDialog(new SpannableString(Html.fromHtml(ex.getMessage())), null, null)
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
})
|
||||
.show(getParentFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
|
||||
private void openProgress() {
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||
this.progressOpened = true;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
package it.integry.integrywmsnative.gest.settings;
|
||||
|
||||
import dagger.Module;
|
||||
|
||||
@Module(subcomponents = MainSettingsComponent.class)
|
||||
public class MainSettingsModule {
|
||||
|
||||
}
|
||||
@ -29,9 +29,6 @@ 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.class_router.BaseCustomConfiguration;
|
||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.AtomicBigDecimal;
|
||||
@ -178,10 +175,9 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
setSupportActionBar(mBindings.toolbar);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
ICustomConfiguration customConfiguration = ClassRouter.getInstance(ClassRouter.PATH.CUSTOM_CONFIGURATION);
|
||||
mFlagShowCodForn = customConfiguration != null ? customConfiguration.getConfig(BaseCustomConfiguration.Keys.FLAG_SHOW_COD_FORN_IN_SPEDIZIONE) : true;
|
||||
mDivideByGrpMerc = customConfiguration != null ? customConfiguration.getConfig(BaseCustomConfiguration.Keys.FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC) : false;
|
||||
|
||||
mFlagShowCodForn = SettingsManager.iDB().isShowCodFornSpedizione();
|
||||
mDivideByGrpMerc = SettingsManager.iDB().isGroupShippingByCommodityGroup();
|
||||
|
||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
mEnableQuantityReset = sharedPreferences.getBoolean("picking_uscita_enable_quantity_reset", true);
|
||||
|
||||
@ -13,14 +13,11 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.OrdiniVenditaInterface;
|
||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
||||
import it.integry.integrywmsnative.core.exception.EmptyLUException;
|
||||
import it.integry.integrywmsnative.core.exception.InvalidLUException;
|
||||
@ -590,7 +587,7 @@ public class SpedizioneViewModel {
|
||||
|
||||
private void executeMagazzinoAutomatico(MtbDepoPosizione mtbDepoPosizione, Runnable onComplete) {
|
||||
var magazzinoAutomaticoPickableArts = Stream.of(Objects.requireNonNull(this.mPickingList.getValue()))
|
||||
.filter(x -> Stream.of(x.getMtbColts()).anyMatch(y -> y.getPosizione().equalsIgnoreCase(mtbDepoPosizione.getPosizione())))
|
||||
.filter(x -> Stream.of(x.getMtbColts()).anyMatch(y -> y.getPosizione() != null && y.getPosizione().equalsIgnoreCase(mtbDepoPosizione.getPosizione())))
|
||||
.toList();
|
||||
|
||||
var mtbAarts = Stream.of(magazzinoAutomaticoPickableArts)
|
||||
@ -1515,8 +1512,7 @@ public class SpedizioneViewModel {
|
||||
var closeUDSRequestDto = new CloseUDSRequestDTO()
|
||||
.setMtbColt(this.mCurrentMtbColt)
|
||||
//.setPrintSSCC(shouldPrint)
|
||||
.setOrderCodMdep(mTestateOrdini.get(0).getCodMdep())
|
||||
.setEnableTransferLogic(isTrasfOrderLogicEnabled());
|
||||
.setOrderCodMdep(mTestateOrdini.get(0).getCodMdep());
|
||||
|
||||
|
||||
this.mColliSpedizioneRESTConsumer.closeUDS(closeUDSRequestDto, closeResponse -> {
|
||||
@ -1549,11 +1545,6 @@ public class SpedizioneViewModel {
|
||||
onComplete, this::sendError);
|
||||
}
|
||||
|
||||
private boolean isTrasfOrderLogicEnabled() {
|
||||
OrdiniVenditaInterface ordiniVendita = ClassRouter.getInstance(ClassRouter.PATH.ORDINI_VENDITA);
|
||||
return ordiniVendita != null && ordiniVendita.isTrasfOrder(mTestateOrdini);
|
||||
}
|
||||
|
||||
private void askPeso(Runnable onComplete) {
|
||||
|
||||
if (mDefaultSegnoCol != -1 || !mShouldAskPesoLU) {
|
||||
|
||||
@ -19,8 +19,6 @@ import android.view.animation.Interpolator;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
|
||||
public class ExpandableLayout extends FrameLayout {
|
||||
public interface State {
|
||||
int COLLAPSED = 0;
|
||||
@ -56,11 +54,11 @@ public class ExpandableLayout extends FrameLayout {
|
||||
super(context, attrs);
|
||||
|
||||
if (attrs != null) {
|
||||
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.ExpandableLayout);
|
||||
duration = a.getInt(R.styleable.ExpandableLayout_el_duration, DEFAULT_DURATION);
|
||||
expansion = a.getBoolean(R.styleable.ExpandableLayout_el_expanded, false) ? 1 : 0;
|
||||
orientation = a.getInt(R.styleable.ExpandableLayout_android_orientation, VERTICAL);
|
||||
parallax = a.getFloat(R.styleable.ExpandableLayout_el_parallax, 1);
|
||||
TypedArray a = getContext().obtainStyledAttributes(attrs, net.cachapa.expandablelayout.R.styleable.ExpandableLayout);
|
||||
duration = a.getInt(net.cachapa.expandablelayout.R.styleable.ExpandableLayout_el_duration, DEFAULT_DURATION);
|
||||
expansion = a.getBoolean(net.cachapa.expandablelayout.R.styleable.ExpandableLayout_el_expanded, false) ? 1 : 0;
|
||||
orientation = a.getInt(net.cachapa.expandablelayout.R.styleable.ExpandableLayout_android_orientation, VERTICAL);
|
||||
parallax = a.getFloat(net.cachapa.expandablelayout.R.styleable.ExpandableLayout_el_parallax, 1);
|
||||
a.recycle();
|
||||
|
||||
state = expansion == 0 ? COLLAPSED : EXPANDED;
|
||||
|
||||
@ -217,15 +217,15 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
switch (statoPartitaMag) {
|
||||
case SCADUTO:
|
||||
this.mBindings.inputDataScadLayout.setEndIconDrawable(R.drawable.ic_baseline_warning_24);
|
||||
this.mBindings.inputDataScadLayout.setEndIconTintList(ColorStateList.valueOf(ContextCompat.getColor(requireContext(), R.color.warn_color)));
|
||||
this.mBindings.inputDataScadLayout.setEndIconTintList(ColorStateList.valueOf(ContextCompat.getColor(requireContext(), com.tfb.fbtoast.R.color.warn_color)));
|
||||
break;
|
||||
case IN_SCADENZA:
|
||||
this.mBindings.inputDataScadLayout.setEndIconDrawable(R.drawable.ic_baseline_warning_24);
|
||||
this.mBindings.inputDataScadLayout.setEndIconTintList(ColorStateList.valueOf(ContextCompat.getColor(requireContext(), R.color.error_color)));
|
||||
this.mBindings.inputDataScadLayout.setEndIconTintList(ColorStateList.valueOf(ContextCompat.getColor(requireContext(), com.tfb.fbtoast.R.color.error_color)));
|
||||
break;
|
||||
default:
|
||||
this.mBindings.inputDataScadLayout.setEndIconDrawable(R.drawable.ic_check_white_24dp);
|
||||
this.mBindings.inputDataScadLayout.setEndIconTintList(ColorStateList.valueOf(ContextCompat.getColor(requireContext(), R.color.success_color)));
|
||||
this.mBindings.inputDataScadLayout.setEndIconTintList(ColorStateList.valueOf(ContextCompat.getColor(requireContext(), com.tfb.fbtoast.R.color.success_color)));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,6 @@ import androidx.fragment.app.DialogFragment;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.DialogYesNoBinding;
|
||||
@ -42,13 +41,13 @@ public class DialogYesNoView extends DialogFragment {
|
||||
var binding = DialogYesNoBinding.inflate(LayoutInflater.from(requireContext()));
|
||||
binding.executePendingBindings();
|
||||
|
||||
if(UtilityString.isNullOrEmpty(title)) {
|
||||
if (UtilityString.isNullOrEmpty(title)) {
|
||||
binding.titleText.setVisibility(View.GONE);
|
||||
binding.descriptionText.setTextAppearance(requireContext(), R.style.TextAppearance_Material3_BodyLarge);
|
||||
binding.descriptionText.setTextAppearance(requireContext(), com.google.android.material.R.style.TextAppearance_Material3_BodyLarge);
|
||||
} else {
|
||||
binding.titleText.setText(title);
|
||||
binding.titleText.setVisibility(View.VISIBLE);
|
||||
binding.descriptionText.setTextAppearance(requireContext(), R.style.TextAppearance_Material3_BodyMedium);
|
||||
binding.descriptionText.setTextAppearance(requireContext(), com.google.android.material.R.style.TextAppearance_Material3_BodyMedium);
|
||||
}
|
||||
|
||||
binding.descriptionText.setText(description);
|
||||
|
||||
@ -85,7 +85,6 @@
|
||||
android:ellipsize="end"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:nextFocusForward="@id/filled_exposed_dropdown_vettore"
|
||||
android:singleLine="true"
|
||||
app:binding="@{view.codTcol}" />
|
||||
|
||||
|
||||
@ -1,146 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="viewmodel"
|
||||
type="it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.dialog.DialogOrdineProduzioneFiltroAvanzatoViewModel" />
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.dialog.DialogOrdineProduzioneFiltroAvanzatoView" />
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/title_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
||||
android:text="@string/dialog_vendita_filtro_avanzato"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginBottom="12dp"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_num_ords"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/num_ords">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatMultiAutoCompleteTextView
|
||||
android:id="@+id/filled_exposed_dropdown_num_ords"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="number|text"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
app:binding="@{view.numOrds}"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_cod_jcoms"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/order_cod_jcoms">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatMultiAutoCompleteTextView
|
||||
android:id="@+id/filled_exposed_dropdown_cod_jcoms"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="text"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
app:binding="@{view.codJcoms}"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/buttons_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5"/>
|
||||
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/neutral_btn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryOutline"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/buttons_guideline"
|
||||
app:strokeColor="@color/colorPrimary"
|
||||
android:text="@string/reset"/>
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/positive_btn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/buttons_guideline"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:text="@string/confirm"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
||||
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
|
||||
</layout>
|
||||
@ -1,314 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="viewmodel"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.dialogs.DialogVenditaFiltroAvanzatoViewModel" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.dialogs.DialogVenditaFiltroAvanzatoView" />
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/title_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
||||
android:text="@string/dialog_vendita_filtro_avanzato"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginBottom="12dp"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_cod_mdep_new"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:imeOptions="actionNext"
|
||||
android:nextFocusDown="@id/input_id_viaggio"
|
||||
android:hint="@string/deposit">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||
android:id="@+id/filled_exposed_dropdown_cod_mdep"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:imeOptions="actionNext"
|
||||
android:nextFocusDown="@id/input_id_viaggio"
|
||||
app:binding="@{view.deposito}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_id_viaggio"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/travel_id">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||
android:id="@+id/filled_exposed_dropdown_id_viaggio"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:imeOptions="actionNext"
|
||||
android:nextFocusForward="@id/filled_exposed_dropdown_num_ords"
|
||||
app:binding="@{view.idViaggio}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_num_ords"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/num_ords">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatMultiAutoCompleteTextView
|
||||
android:id="@+id/filled_exposed_dropdown_num_ords"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="number|text"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:imeOptions="actionNext"
|
||||
android:nextFocusForward="@id/filled_exposed_dropdown_cliente"
|
||||
app:binding="@{view.numOrds}"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_cliente"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/customer">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||
android:id="@+id/filled_exposed_dropdown_cliente"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:imeOptions="actionNext"
|
||||
android:nextFocusForward="@id/filled_exposed_dropdown_vettore"
|
||||
app:binding="@{view.cliente}"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_vettore"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/carrier">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||
android:id="@+id/filled_exposed_dropdown_vettore"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:imeOptions="actionNext"
|
||||
android:nextFocusForward="@id/filled_exposed_dropdown_automezzo"
|
||||
app:binding="@{view.vettore}"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_automezzo"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/vehicle">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||
android:id="@+id/filled_exposed_dropdown_automezzo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:imeOptions="actionNext"
|
||||
android:nextFocusForward="@id/filled_exposed_dropdown_paese"
|
||||
app:binding="@{view.automezzo}"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_paese"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/city">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||
android:id="@+id/filled_exposed_dropdown_paese"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:imeOptions="actionNext"
|
||||
android:nextFocusForward="@id/filled_exposed_dropdown_agente"
|
||||
app:binding="@{view.paese}"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_agente"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/agent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||
android:id="@+id/filled_exposed_dropdown_agente"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:imeOptions="actionNext"
|
||||
android:nextFocusForward="@id/filled_exposed_dropdown_term_cons"
|
||||
app:binding="@{view.agente}"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_data_cons"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/ship_date">
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/filled_exposed_dropdown_data_cons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:focusable="false"
|
||||
android:singleLine="true"
|
||||
app:binding="@{view.dataConsegna}"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_term_cons"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/terms_of_delivery">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
|
||||
android:id="@+id/filled_exposed_dropdown_term_cons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textNoSuggestions"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:imeOptions="actionDone"
|
||||
app:binding="@{view.terminiConsegna}"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/buttons_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5"/>
|
||||
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/neutral_btn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryOutline"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/buttons_guideline"
|
||||
app:strokeColor="@color/colorPrimary"
|
||||
android:text="@string/reset"/>
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/positive_btn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/buttons_guideline"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:text="@string/confirm"/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
||||
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
|
||||
</layout>
|
||||
@ -70,28 +70,34 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/inventario_list"
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swiperefresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fadeScrollbars="true"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:itemCount="8"
|
||||
tools:listitem="@layout/fragment_elenco_inventario_list_single_item" />
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/inventario_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fadeScrollbars="true"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:itemCount="8"
|
||||
tools:listitem="@layout/fragment_elenco_inventario_list_single_item" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
style="?attr/floatingActionButtonPrimaryStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="16dp"
|
||||
app:srcCompat="@drawable/ic_add_24dp"
|
||||
app:singleClick="@{() -> viewmodel.openInventario()}"
|
||||
style="?attr/floatingActionButtonPrimaryStyle" />
|
||||
app:srcCompat="@drawable/ic_add_24dp" />
|
||||
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
@ -53,7 +53,7 @@
|
||||
android:layout_toEndOf="@+id/badge1"
|
||||
android:text="@string/new_item"
|
||||
android:textColor="@android:color/white"
|
||||
android:visibility="gone"
|
||||
android:visibility="@{item.isNew() ? View.VISIBLE : View.GONE}"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
|
||||
@ -421,6 +421,9 @@
|
||||
<string name="action_print_shipping_SSCC">Stampa etichetta spedizione</string>
|
||||
<string name="action_print_production_SSCC">Stampa etichetta lavorazione</string>
|
||||
<string name="scanner_settings">Impostazioni scanner</string>
|
||||
<string name="developer_settings">Svilupppo</string>
|
||||
<string name="developer_settings_title">Esporta log</string>
|
||||
<string name="developer_settings_summary">Esporta il log degli eventi</string>
|
||||
<string name="scanner_settings_scanner_delay_title">Ritardo scansione</string>
|
||||
<string name="scanner_settings_scanner_delay_summary">Imposta un ritardo di lettura per la scansione</string>
|
||||
<string name="scanner_settings_trigger_scan_mode_title">Modalità scansione</string>
|
||||
|
||||
@ -427,6 +427,9 @@
|
||||
<string name="action_print_shipping_SSCC">Print shipping label</string>
|
||||
<string name="action_print_production_SSCC">Print production label</string>
|
||||
<string name="scanner_settings">Scanner settings</string>
|
||||
<string name="developer_settings">Developer settings</string>
|
||||
<string name="developer_settings_title">Esporta log</string>
|
||||
<string name="developer_settings_summary">Esporta il log degli eventi</string>
|
||||
<string name="scanner_settings_scanner_delay_title">Scan delay</string>
|
||||
<string name="scanner_settings_scanner_delay_summary">Set reading scanner delay</string>
|
||||
<string name="scanner_settings_trigger_scan_mode_title">Modalità scansione</string>
|
||||
|
||||
@ -62,6 +62,19 @@
|
||||
app:title="@string/scanner_settings_scanner_delay_title" />
|
||||
|
||||
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory
|
||||
app:title="@string/developer_settings"
|
||||
app:iconSpaceReserved="false">
|
||||
|
||||
<Preference
|
||||
android:title="@string/developer_settings_title"
|
||||
android:key="EXPORT_LOG"
|
||||
android:summary="@string/developer_settings_summary"
|
||||
app:iconSpaceReserved="false"
|
||||
/>
|
||||
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
</androidx.preference.PreferenceScreen>
|
||||
127
build.gradle
127
build.gradle
@ -3,6 +3,7 @@
|
||||
buildscript {
|
||||
ext {
|
||||
kotlin_version = '1.8.0'
|
||||
agp_version = '8.1.0-alpha05'
|
||||
}
|
||||
|
||||
repositories {
|
||||
@ -10,7 +11,7 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.4.1'
|
||||
classpath "com.android.tools.build:gradle:$agp_version"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.google.gms:google-services:4.3.15'
|
||||
|
||||
@ -43,128 +44,4 @@ task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
||||
task buildBase() {
|
||||
doFirst {
|
||||
copy {
|
||||
from 'dynamic__base/src/main/java/it/integry'
|
||||
into 'app/src/main/java/it/integry'
|
||||
}
|
||||
}
|
||||
|
||||
dependsOn "app:build"
|
||||
|
||||
doLast {
|
||||
copy {
|
||||
from 'app/build/outputs/apk/release'
|
||||
into 'dist/release/_base'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task buildFrudis() {
|
||||
doFirst {
|
||||
copy {
|
||||
from 'dynamic_frudis/src/main/java/it/integry'
|
||||
into 'app/src/main/java/it/integry'
|
||||
}
|
||||
}
|
||||
|
||||
dependsOn "app:build"
|
||||
|
||||
doLast {
|
||||
copy {
|
||||
from 'app/build/outputs/apk/release'
|
||||
into 'dist/release/frudis'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task buildGramm() {
|
||||
doFirst {
|
||||
copy {
|
||||
from 'dynamic_gramm/src/main/java/it/integry'
|
||||
into 'app/src/main/java/it/integry'
|
||||
}
|
||||
}
|
||||
|
||||
dependsOn "app:build"
|
||||
|
||||
doLast {
|
||||
copy {
|
||||
from 'app/build/outputs/apk/release'
|
||||
into 'dist/release/gramm'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task buildIme() {
|
||||
doFirst {
|
||||
copy {
|
||||
from 'dynamic_ime/src/main/java/it/integry'
|
||||
into 'app/src/main/java/it/integry'
|
||||
}
|
||||
}
|
||||
|
||||
dependsOn "app:build"
|
||||
|
||||
doLast {
|
||||
copy {
|
||||
from 'app/build/outputs/apk/release'
|
||||
into 'dist/release/ime'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task buildSaporiVeriPV() {
|
||||
doFirst {
|
||||
copy {
|
||||
from 'dynamic_saporiveri_pv/src/main/java/it/integry'
|
||||
into 'app/src/main/java/it/integry'
|
||||
}
|
||||
}
|
||||
|
||||
dependsOn "app:build"
|
||||
|
||||
doLast {
|
||||
copy {
|
||||
from 'app/build/outputs/apk/release'
|
||||
into 'dist/release/saporiveri_pv'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task buildSaporiVeri() {
|
||||
doFirst {
|
||||
copy {
|
||||
from 'dynamic_saporiveri/src/main/java/it/integry'
|
||||
into 'app/src/main/java/it/integry'
|
||||
}
|
||||
}
|
||||
|
||||
dependsOn "app:build"
|
||||
|
||||
doLast {
|
||||
copy {
|
||||
from 'app/build/outputs/apk/release'
|
||||
into 'dist/release/saporiveri'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task buildVGAlimenti() {
|
||||
doFirst {
|
||||
copy {
|
||||
from 'dynamic_vgalimenti/src/main/java/it/integry'
|
||||
into 'app/src/main/java/it/integry'
|
||||
}
|
||||
}
|
||||
|
||||
dependsOn "app:build"
|
||||
|
||||
doLast {
|
||||
copy {
|
||||
from 'app/build/outputs/apk/release'
|
||||
into 'dist/release/vgalimenti'
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,2 +0,0 @@
|
||||
call build_azienda.bat _base
|
||||
call build_azienda.bat vgalimenti
|
||||
@ -1,15 +0,0 @@
|
||||
@echo off
|
||||
|
||||
SET nome_azienda=%1
|
||||
|
||||
XCOPY dynamic_%nome_azienda%\src\main\java\it\integry app\src\main\java\it\integry\ /E /Y
|
||||
CALL gradlew app:build --stacktrace
|
||||
|
||||
RMDIR app\src\main\java\it\integry\wms\ /S /Q
|
||||
|
||||
MKDIR dist
|
||||
MKDIR dist\release
|
||||
MKDIR dist\release\%nome_azienda%
|
||||
|
||||
MOVE app\build\outputs\apk\release\*.apk dist\release\%nome_azienda%\
|
||||
MOVE app\build\outputs\apk\release\*.txt dist\release\%nome_azienda%\
|
||||
1
dynamic__base/.gitignore
vendored
1
dynamic__base/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
||||
@ -1,26 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.dynamic-feature'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 33
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 21
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
namespace 'it.integry.wms.dynamic__base'
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation project(':app')
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:dist="http://schemas.android.com/apk/distribution">
|
||||
|
||||
<dist:module
|
||||
dist:instant="false"
|
||||
dist:onDemand="false"
|
||||
dist:title="@string/title_dynamic__base">
|
||||
<dist:fusing dist:include="true" />
|
||||
</dist:module>
|
||||
</manifest>
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
package it.integry.wms.dynamic_customization;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.wms.dynamic_customization.extensions.CustomConfiguration;
|
||||
import it.integry.wms.dynamic_customization.extensions.FiltroOrdiniVendita;
|
||||
import it.integry.wms.dynamic_customization.extensions.OrdiniVendita;
|
||||
|
||||
public class DynamicContext {
|
||||
|
||||
public void init(Context context) {
|
||||
Log.d("DynamicContext", "Caricamento personalizzazioni per Azienda BASE");
|
||||
|
||||
try {
|
||||
ClassRouter.registerPath(ClassRouter.PATH.FILTRO_ORDINI_VENDITA, FiltroOrdiniVendita.class);
|
||||
ClassRouter.registerPath(ClassRouter.PATH.ORDINI_VENDITA, OrdiniVendita.class);
|
||||
ClassRouter.registerPath(ClassRouter.PATH.CUSTOM_CONFIGURATION, CustomConfiguration.class);
|
||||
} catch (Exception ex) {
|
||||
UtilityExceptions.defaultException(context, ex);
|
||||
}
|
||||
|
||||
Log.d("DynamicContext", "Caricamento personalizzazioni per Azienda BASE COMPLETATO");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
package it.integry.wms.dynamic_customization.extensions;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.BaseCustomConfiguration;
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
||||
|
||||
public class CustomConfiguration extends BaseCustomConfiguration implements ICustomConfiguration {
|
||||
|
||||
public CustomConfiguration() {
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
package it.integry.wms.dynamic_customization.extensions;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.IFiltroOrdiniVendita;
|
||||
|
||||
public class FiltroOrdiniVendita implements IFiltroOrdiniVendita {
|
||||
|
||||
@Override
|
||||
public boolean shoudShowCodMdepFilter() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shoudShowIdViaggioFilter() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shoudShowAgenteFilter() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
package it.integry.wms.dynamic_customization.extensions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.OrdiniVenditaInterface;
|
||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||
|
||||
public class OrdiniVendita implements OrdiniVenditaInterface {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isTrasfOrder(List<OrdineUscitaInevasoDTO> testateOrdini) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
1
dynamic_vgalimenti/.gitignore
vendored
1
dynamic_vgalimenti/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
||||
Binary file not shown.
@ -1,23 +0,0 @@
|
||||
plugins {
|
||||
id 'com.android.dynamic-feature'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
defaultConfig {
|
||||
minSdkVersion 21
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
namespace 'it.integry.wms.dynamic_customization'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation project(':app')
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.6.0'
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:dist="http://schemas.android.com/apk/distribution">
|
||||
|
||||
<dist:module
|
||||
dist:instant="false"
|
||||
dist:onDemand="false"
|
||||
dist:title="@string/title_dynamic_vgalimenti">
|
||||
<dist:fusing dist:include="true" />
|
||||
</dist:module>
|
||||
</manifest>
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
package it.integry.wms.dynamic_customization;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.wms.dynamic_customization.extensions.CustomConfiguration;
|
||||
import it.integry.wms.dynamic_customization.extensions.FiltroOrdiniVendita;
|
||||
import it.integry.wms.dynamic_customization.extensions.OrdiniVendita;
|
||||
|
||||
public class DynamicContext {
|
||||
|
||||
public void init(Context context) {
|
||||
Log.d("DynamicContext", "Caricamento personalizzazioni per VGAlimenti");
|
||||
|
||||
try {
|
||||
ClassRouter.registerPath(ClassRouter.PATH.FILTRO_ORDINI_VENDITA, FiltroOrdiniVendita.class);
|
||||
ClassRouter.registerPath(ClassRouter.PATH.ORDINI_VENDITA, OrdiniVendita.class);
|
||||
ClassRouter.registerPath(ClassRouter.PATH.CUSTOM_CONFIGURATION, CustomConfiguration.class);
|
||||
} catch (Exception ex) {
|
||||
UtilityExceptions.defaultException(context, ex);
|
||||
}
|
||||
|
||||
Log.d("DynamicContext", "Caricamento personalizzazioni per VGAlimenti COMPLETATO");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
package it.integry.wms.dynamic_customization.extensions;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.BaseCustomConfiguration;
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
||||
|
||||
public class CustomConfiguration extends BaseCustomConfiguration implements ICustomConfiguration {
|
||||
|
||||
public CustomConfiguration() {
|
||||
configurations.put(Keys.FLAG_SHOW_COD_FORN_IN_SPEDIZIONE, false);
|
||||
configurations.put(Keys.FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC, true);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
package it.integry.wms.dynamic_customization.extensions;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.IFiltroOrdiniVendita;
|
||||
|
||||
public class FiltroOrdiniVendita implements IFiltroOrdiniVendita {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shoudShowCodMdepFilter() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shoudShowIdViaggioFilter() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shoudShowAgenteFilter() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
package it.integry.wms.dynamic_customization.extensions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.OrdiniVenditaInterface;
|
||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
|
||||
public class OrdiniVendita implements OrdiniVenditaInterface {
|
||||
|
||||
@Override
|
||||
public boolean isTrasfOrder(List<OrdineUscitaInevasoDTO> testateOrdini) {
|
||||
// Se il deposito del collo è diverso dal deposito dell'utente allora sto "evadendo"
|
||||
// la merce per una vendita presente su un altro deposito
|
||||
|
||||
String codMdepOrder = testateOrdini.get(0).getCodMdep();
|
||||
return !UtilityString.isNullOrEmpty(codMdepOrder) &&
|
||||
!codMdepOrder.equalsIgnoreCase(SettingsManager.i().getUserSession().getDepo().getCodMdep());
|
||||
}
|
||||
}
|
||||
6
gradle/wrapper/gradle-wrapper.properties
vendored
6
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
||||
#Wed Oct 14 10:44:19 CEST 2020
|
||||
#Mon Feb 13 15:14:43 CET 2023
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
include ':app', ':pointmobilescannerlibrary', ':dynamic_vgalimenti', ':dynamic__base', ':zebrascannerlibrary', ':honeywellsdk', ':honeywellscannerlibrary', ':keyobardemulatorscannerlibrary', ':barcode_base_android_library'
|
||||
include ':app', ':pointmobilescannerlibrary', ':zebrascannerlibrary', ':honeywellsdk', ':honeywellscannerlibrary', ':keyobardemulatorscannerlibrary', ':barcode_base_android_library'
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user