Release v1.0.1 (vc: 4)
This commit is contained in:
commit
db20f44bbf
46
.idea/assetWizardSettings.xml
generated
Normal file
46
.idea/assetWizardSettings.xml
generated
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="WizardSettings">
|
||||||
|
<option name="children">
|
||||||
|
<map>
|
||||||
|
<entry key="vectorWizard">
|
||||||
|
<value>
|
||||||
|
<PersistentState>
|
||||||
|
<option name="children">
|
||||||
|
<map>
|
||||||
|
<entry key="vectorAssetStep">
|
||||||
|
<value>
|
||||||
|
<PersistentState>
|
||||||
|
<option name="children">
|
||||||
|
<map>
|
||||||
|
<entry key="clipartAsset">
|
||||||
|
<value>
|
||||||
|
<PersistentState>
|
||||||
|
<option name="values">
|
||||||
|
<map>
|
||||||
|
<entry key="url" value="jar:file:/C:/Program%20Files/Android/Android%20Studio/plugins/android/lib/android.jar!/images/material_design_icons/content/ic_clear_black_24dp.xml" />
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</PersistentState>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
<option name="values">
|
||||||
|
<map>
|
||||||
|
<entry key="outputName" value="ic_clear_black_24dp" />
|
||||||
|
<entry key="sourceFile" value="C:\Users\Giuseppe" />
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</PersistentState>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</PersistentState>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
BIN
.idea/caches/build_file_checksums.ser
generated
Normal file
BIN
.idea/caches/build_file_checksums.ser
generated
Normal file
Binary file not shown.
29
.idea/codeStyles/Project.xml
generated
Normal file
29
.idea/codeStyles/Project.xml
generated
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<code_scheme name="Project" version="173">
|
||||||
|
<Objective-C-extensions>
|
||||||
|
<file>
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
|
||||||
|
</file>
|
||||||
|
<class>
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
|
||||||
|
</class>
|
||||||
|
<extensions>
|
||||||
|
<pair source="cpp" header="h" fileNamingConvention="NONE" />
|
||||||
|
<pair source="c" header="h" fileNamingConvention="NONE" />
|
||||||
|
</extensions>
|
||||||
|
</Objective-C-extensions>
|
||||||
|
</code_scheme>
|
||||||
|
</component>
|
||||||
22
.idea/compiler.xml
generated
22
.idea/compiler.xml
generated
@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="CompilerConfiguration">
|
|
||||||
<resourceExtensions />
|
|
||||||
<wildcardResourcePatterns>
|
|
||||||
<entry name="!?*.java" />
|
|
||||||
<entry name="!?*.form" />
|
|
||||||
<entry name="!?*.class" />
|
|
||||||
<entry name="!?*.groovy" />
|
|
||||||
<entry name="!?*.scala" />
|
|
||||||
<entry name="!?*.flex" />
|
|
||||||
<entry name="!?*.kt" />
|
|
||||||
<entry name="!?*.clj" />
|
|
||||||
<entry name="!?*.aj" />
|
|
||||||
</wildcardResourcePatterns>
|
|
||||||
<annotationProcessing>
|
|
||||||
<profile default="true" name="Default" enabled="false">
|
|
||||||
<processorPath useClasspath="true" />
|
|
||||||
</profile>
|
|
||||||
</annotationProcessing>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
3
.idea/copyright/profiles_settings.xml
generated
3
.idea/copyright/profiles_settings.xml
generated
@ -1,3 +0,0 @@
|
|||||||
<component name="CopyrightManager">
|
|
||||||
<settings default="" />
|
|
||||||
</component>
|
|
||||||
6
.idea/gradle.xml
generated
6
.idea/gradle.xml
generated
@ -3,13 +3,15 @@
|
|||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
<option name="distributionType" value="LOCAL" />
|
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
<option name="gradleHome" value="C:\Program Files\Android\Android Studio\gradle\gradle-4.1" />
|
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$" />
|
<option value="$PROJECT_DIR$" />
|
||||||
<option value="$PROJECT_DIR$/app" />
|
<option value="$PROJECT_DIR$/app" />
|
||||||
|
<option value="$PROJECT_DIR$/barcode_base_library" />
|
||||||
|
<option value="$PROJECT_DIR$/pointmobilescannerlibrary" />
|
||||||
|
<option value="$PROJECT_DIR$/waterfall_toolbar" />
|
||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
<option name="resolveModulePerSourceSet" value="false" />
|
<option name="resolveModulePerSourceSet" value="false" />
|
||||||
|
|||||||
15
.idea/misc.xml
generated
15
.idea/misc.xml
generated
@ -5,26 +5,31 @@
|
|||||||
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
||||||
<option name="myNullables">
|
<option name="myNullables">
|
||||||
<value>
|
<value>
|
||||||
<list size="4">
|
<list size="7">
|
||||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
||||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
||||||
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
|
||||||
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
|
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
||||||
|
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
|
||||||
|
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
|
||||||
|
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
|
||||||
</list>
|
</list>
|
||||||
</value>
|
</value>
|
||||||
</option>
|
</option>
|
||||||
<option name="myNotNulls">
|
<option name="myNotNulls">
|
||||||
<value>
|
<value>
|
||||||
<list size="4">
|
<list size="6">
|
||||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
|
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
|
||||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
|
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
|
||||||
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
|
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
|
||||||
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
|
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
|
||||||
|
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
|
||||||
|
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
|
||||||
</list>
|
</list>
|
||||||
</value>
|
</value>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|||||||
5
.idea/modules.xml
generated
5
.idea/modules.xml
generated
@ -2,8 +2,11 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectModuleManager">
|
<component name="ProjectModuleManager">
|
||||||
<modules>
|
<modules>
|
||||||
<module fileurl="file://$PROJECT_DIR$/IntegryWMSNative.iml" filepath="$PROJECT_DIR$/IntegryWMSNative.iml" />
|
<module fileurl="file://$PROJECT_DIR$/WMS.iml" filepath="$PROJECT_DIR$/WMS.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/barcode_base_library/barcode_base_library.iml" filepath="$PROJECT_DIR$/barcode_base_library/barcode_base_library.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/pointmobilescannerlibrary/pointmobilescannerlibrary.iml" filepath="$PROJECT_DIR$/pointmobilescannerlibrary/pointmobilescannerlibrary.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/waterfall_toolbar/waterfall_toolbar.iml" filepath="$PROJECT_DIR$/waterfall_toolbar/waterfall_toolbar.iml" />
|
||||||
</modules>
|
</modules>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
BIN
Integry.jks
Normal file
BIN
Integry.jks
Normal file
Binary file not shown.
1
app/.gitignore
vendored
1
app/.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
/build
|
/build
|
||||||
|
/release
|
||||||
@ -1,14 +1,16 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
apply plugin: 'kotlin-android'
|
||||||
|
apply plugin: 'kotlin-android-extensions'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 25
|
compileSdkVersion 28
|
||||||
buildToolsVersion "27.0.0"
|
buildToolsVersion '28.0.3'
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "it.integry.integrywmsnative"
|
applicationId "it.integry.integrywmsnative"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 25
|
targetSdkVersion 28
|
||||||
versionCode 1
|
versionCode 4
|
||||||
versionName "1.0"
|
versionName "1.0.1"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
@ -17,26 +19,69 @@ android {
|
|||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
dataBinding {
|
||||||
|
enabled = true
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
targetCompatibility 1.8
|
||||||
|
sourceCompatibility 1.8
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
|
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
|
||||||
exclude group: 'com.android.support', module: 'support-annotations'
|
exclude group: 'com.android.support', module: 'support-annotations'
|
||||||
})
|
})
|
||||||
compile 'com.android.support:appcompat-v7:25.3.1'
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
compile 'com.android.support:support-v4:25.3.1'
|
implementation 'com.orhanobut:logger:2.2.0'
|
||||||
compile 'com.android.support:design:25.3.1'
|
implementation 'com.android.support:appcompat-v7:28.0.0'
|
||||||
compile 'com.android.support.constraint:constraint-layout:1.0.2'
|
implementation 'com.android.support:support-v4:28.0.0'
|
||||||
compile 'com.android.support:cardview-v7:25.3.1'
|
implementation 'com.android.support:design:28.0.0'
|
||||||
compile 'com.android.support:recyclerview-v7:25.3.1'
|
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
||||||
|
implementation 'com.android.support:cardview-v7:28.0.0'
|
||||||
compile 'com.squareup.retrofit2:retrofit:2.3.0'
|
implementation 'com.android.support:recyclerview-v7:28.0.0'
|
||||||
compile 'com.squareup.retrofit2:converter-gson:2.0.0'
|
implementation 'com.android.support:preference-v7:28.0.0'
|
||||||
|
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
|
||||||
compile 'com.jakewharton:butterknife:8.8.1'
|
implementation 'com.squareup.retrofit2:converter-gson:2.0.0'
|
||||||
|
implementation 'org.parceler:parceler-api:1.1.10'
|
||||||
|
annotationProcessor 'org.parceler:parceler:1.1.10'
|
||||||
|
implementation 'com.annimon:stream:1.2.1'
|
||||||
|
//MVVM
|
||||||
|
implementation 'android.arch.lifecycle:extensions:1.1.1'
|
||||||
|
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
|
||||||
|
implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
|
||||||
|
implementation 'com.jakewharton.rxbinding2:rxbinding-support-v4:2.1.1'
|
||||||
|
implementation 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.1.1'
|
||||||
|
implementation 'com.jakewharton.rxbinding2:rxbinding-design:2.1.1'
|
||||||
|
implementation 'com.jakewharton.rxbinding2:rxbinding-recyclerview-v7:2.1.1'
|
||||||
|
implementation 'com.jakewharton:butterknife:8.8.1'
|
||||||
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
|
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
|
||||||
|
implementation 'br.com.zbra:android-linq:1.1.0'
|
||||||
|
//FAB
|
||||||
|
//implementation 'com.getbase:floatingactionbutton:1.10.1'
|
||||||
|
implementation 'com.github.clans:fab:1.6.4'
|
||||||
|
//CUSTOM VIEWS
|
||||||
|
implementation 'de.hdodenhof:circleimageview:2.2.0'
|
||||||
|
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
|
||||||
|
implementation 'com.github.frankiesardo:linearlistview:1.0.1@aar'
|
||||||
|
implementation 'com.github.andrefrsousa:SuperBottomSheet:1.2.1@aar'
|
||||||
|
implementation 'com.fede987:status-bar-alert:1.0.1'
|
||||||
|
implementation 'com.fxn769:stash:1.2'
|
||||||
|
testImplementation 'junit:junit:4.12'
|
||||||
|
implementation project(':waterfall_toolbar')
|
||||||
|
implementation 'com.mikhaellopez:lazydatepicker:1.0.0'
|
||||||
|
implementation 'com.github.demoNo:AutoScrollViewPager:v1.0.2'
|
||||||
|
|
||||||
|
//AppUpdate
|
||||||
|
implementation 'com.github.javiersantos:AppUpdater:2.7'
|
||||||
|
|
||||||
|
|
||||||
testCompile 'junit:junit:4.12'
|
//Barcode
|
||||||
|
implementation project(':pointmobilescannerlibrary')
|
||||||
|
implementation project(path: ':barcode_base_library')
|
||||||
|
}
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,8 +3,10 @@
|
|||||||
package="it.integry.integrywmsnative">
|
package="it.integry.integrywmsnative">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
|
android:name=".MainApplication"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
@ -15,7 +17,9 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
android:theme="@style/Light"
|
||||||
|
android:windowSoftInputMode="adjustPan"
|
||||||
|
android:screenOrientation="portrait">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
@ -24,7 +28,28 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".gest.accettazione_ordine_inevaso.AccettazioneOrdineInevasoActivity"
|
android:name=".gest.accettazione_ordine_inevaso.AccettazioneOrdineInevasoActivity"
|
||||||
android:theme="@style/AppTheme.NoActionBar"></activity>
|
android:theme="@style/Light"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:windowSoftInputMode="adjustNothing" />
|
||||||
|
<activity
|
||||||
|
android:name=".gest.vendita_ordine_inevaso.VenditaOrdineInevasoActivity"
|
||||||
|
android:theme="@style/Light"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:windowSoftInputMode="adjustNothing" />
|
||||||
|
<activity
|
||||||
|
android:name=".gest.login.LoginActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/Light" />
|
||||||
|
<activity
|
||||||
|
android:name=".gest.lista_bancali.ListaBancaliActivity"
|
||||||
|
android:label="@string/activity_lista_bancali_title"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/Light" />
|
||||||
|
<activity
|
||||||
|
android:name=".gest.contenuto_bancale.ContenutoBancaleActivity"
|
||||||
|
android:label="@string/activity_contenuto_bancale_title"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/Light" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@ -1,66 +1,103 @@
|
|||||||
package it.integry.integrywmsnative;
|
package it.integry.integrywmsnative;
|
||||||
|
|
||||||
import android.graphics.Color;
|
import android.content.Intent;
|
||||||
import android.graphics.ColorMatrixColorFilter;
|
import android.databinding.DataBindingUtil;
|
||||||
import android.graphics.PorterDuff;
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.ColorRes;
|
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.app.FragmentManager;
|
import android.support.v4.app.FragmentManager;
|
||||||
import android.support.design.widget.NavigationView;
|
import android.support.design.widget.NavigationView;
|
||||||
import android.support.v4.content.ContextCompat;
|
|
||||||
import android.support.v4.graphics.drawable.DrawableCompat;
|
|
||||||
import android.support.v4.view.GravityCompat;
|
import android.support.v4.view.GravityCompat;
|
||||||
import android.support.v4.widget.DrawerLayout;
|
import android.support.v4.widget.DrawerLayout;
|
||||||
import android.support.v7.app.ActionBarDrawerToggle;
|
import android.support.v7.app.ActionBarDrawerToggle;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.SearchView;
|
import android.support.v7.widget.SearchView;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.text.SpannableString;
|
import android.view.LayoutInflater;
|
||||||
import android.text.style.ForegroundColorSpan;
|
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
|
import it.integry.integrywmsnative.core.REST.watcher.ServerStatusChecker;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.IFilterableFragment;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.IRecyclerFragment;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.ISelectAllFragment;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.update.UpdatesManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilitySettings;
|
||||||
|
import it.integry.integrywmsnative.databinding.ActivityMainBinding;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneFragment;
|
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneFragment;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.core.interfaces.ITitledFragment;
|
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||||
|
import it.integry.integrywmsnative.gest.login.LoginActivity;
|
||||||
|
import it.integry.integrywmsnative.gest.main.MainFragment;
|
||||||
|
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeFragment;
|
||||||
|
import it.integry.integrywmsnative.gest.settings.MainSettingsFragment;
|
||||||
|
import it.integry.integrywmsnative.gest.vendita.MainVenditaFragment;
|
||||||
|
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceFragment;
|
||||||
|
import it.integry.plugins.waterfalltoolbar.WaterfallToolbar;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity
|
public class MainActivity extends AppCompatActivity
|
||||||
implements NavigationView.OnNavigationItemSelectedListener {
|
implements NavigationView.OnNavigationItemSelectedListener {
|
||||||
|
|
||||||
@BindView(R.id.main_search) SearchView mSearchView;
|
//@BindView(R.id.drawer_username) TextView mDrawerUsername;
|
||||||
|
//@BindView(R.id.drawer_logoAzienda) ImageView mDrawerLogo;
|
||||||
|
|
||||||
@BindView(R.id.nav_view) NavigationView mNavigationView;
|
private ActivityMainBinding mBinding;
|
||||||
|
|
||||||
|
private boolean firstCheckExecution = true;
|
||||||
|
private boolean mIsOnline = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
|
||||||
|
|
||||||
ButterKnife.bind(this);
|
if(SettingsManager.i().user.username == null && SettingsManager.i().user.password == null){
|
||||||
|
startLoginActivity();
|
||||||
|
} else {
|
||||||
|
mBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.activity_main, null, false);
|
||||||
|
setContentView(mBinding.getRoot());
|
||||||
|
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
UpdatesManager.init(this);
|
||||||
setSupportActionBar(toolbar);
|
|
||||||
|
|
||||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||||
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
|
setSupportActionBar(toolbar);
|
||||||
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
|
||||||
drawer.setDrawerListener(toggle);
|
|
||||||
toggle.syncState();
|
|
||||||
|
|
||||||
mNavigationView = (NavigationView) findViewById(R.id.nav_view);
|
|
||||||
mNavigationView.setNavigationItemSelectedListener(this);
|
|
||||||
|
|
||||||
mSearchView.setVisibility(View.GONE);
|
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
|
||||||
|
this, mBinding.drawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
||||||
|
mBinding.drawerLayout.setDrawerListener(toggle);
|
||||||
|
toggle.syncState();
|
||||||
|
|
||||||
|
|
||||||
|
mBinding.navView.setNavigationItemSelectedListener(this);
|
||||||
|
mBinding.appBarMain.mainSearch.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
changeContentFragment(MainFragment.newInstance());
|
||||||
|
|
||||||
|
init();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void startLoginActivity(){
|
||||||
|
Intent myIntent = new Intent(this, LoginActivity.class);
|
||||||
|
startActivity(myIntent);
|
||||||
|
this.finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
DrawerLayout drawer = findViewById(R.id.drawer_layout);
|
||||||
if (drawer.isDrawerOpen(GravityCompat.START)) {
|
if (drawer.isDrawerOpen(GravityCompat.START)) {
|
||||||
drawer.closeDrawer(GravityCompat.START);
|
drawer.closeDrawer(GravityCompat.START);
|
||||||
} else {
|
} else {
|
||||||
@ -93,69 +130,66 @@ public class MainActivity extends AppCompatActivity
|
|||||||
@SuppressWarnings("StatementWithEmptyBody")
|
@SuppressWarnings("StatementWithEmptyBody")
|
||||||
@Override
|
@Override
|
||||||
public boolean onNavigationItemSelected(MenuItem item) {
|
public boolean onNavigationItemSelected(MenuItem item) {
|
||||||
|
|
||||||
|
mBinding.appBarMain.waterfallToolbar.resetElevation();
|
||||||
|
mBinding.appBarMain.waterfallToolbar.setRecyclerView(null);
|
||||||
|
|
||||||
// Handle navigation view item clicks here.
|
// Handle navigation view item clicks here.
|
||||||
// resetAllMenuItemsTextColor(mNavigationView);
|
|
||||||
|
|
||||||
// int[] menuColorArray = this.getResources().getIntArray(R.array.menuColors);
|
|
||||||
|
|
||||||
|
|
||||||
Fragment fragment = null;
|
Fragment fragment = null;
|
||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
if (id == R.id.nav_accettazione) {
|
if (id == R.id.nav_accettazione) {
|
||||||
// setTextColorForMenuItem(item, menuColorArray[0]);
|
|
||||||
|
|
||||||
fragment = MainAccettazioneFragment.newInstance();
|
fragment = MainAccettazioneFragment.newInstance();
|
||||||
this.adaptViewToFragment(fragment);
|
this.adaptViewToFragment(fragment);
|
||||||
} else if (id == R.id.nav_gallery) {
|
} else if (id == R.id.nav_gallery) {
|
||||||
|
fragment = MainVenditaFragment.newInstance();
|
||||||
|
this.adaptViewToFragment(fragment);
|
||||||
} else if (id == R.id.nav_slideshow) {
|
} else if (id == R.id.nav_slideshow) {
|
||||||
|
fragment = RettificaGiacenzeFragment.newInstance();
|
||||||
|
this.adaptViewToFragment(fragment);
|
||||||
} else if (id == R.id.nav_manage) {
|
} else if (id == R.id.nav_manage) {
|
||||||
|
fragment = VersamentoMerceFragment.newInstance();
|
||||||
} else if (id == R.id.nav_share) {
|
this.adaptViewToFragment(fragment);
|
||||||
|
}
|
||||||
|
/*else if (id == R.id.nav_share) {
|
||||||
|
|
||||||
} else if (id == R.id.nav_send) {
|
} else if (id == R.id.nav_send) {
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
else if(id == R.id.nav_settings){
|
||||||
|
fragment = new MainSettingsFragment();
|
||||||
|
this.adaptViewToFragment(fragment);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fragment != null) {
|
else if(id == R.id.nav_logout){
|
||||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
UtilitySettings.logout();
|
||||||
fragmentManager.beginTransaction()
|
startLoginActivity();
|
||||||
.replace(R.id.frame_container, fragment).commit();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
changeContentFragment(fragment);
|
||||||
|
|
||||||
|
DrawerLayout drawer = findViewById(R.id.drawer_layout);
|
||||||
drawer.closeDrawer(GravityCompat.START);
|
drawer.closeDrawer(GravityCompat.START);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetAllMenuItemsTextColor(NavigationView navigationView) {
|
public void popToMain() {
|
||||||
for (int i = 0; i < navigationView.getMenu().size(); i++)
|
MainFragment mainFragment = MainFragment.newInstance();
|
||||||
setTextColorForMenuItem(navigationView.getMenu().getItem(i), R.color.colorPrimary);
|
|
||||||
|
adaptViewToFragment(mainFragment);
|
||||||
|
|
||||||
|
changeContentFragment(mainFragment);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setTextColorForMenuItem(MenuItem menuItem, int color) {
|
|
||||||
SpannableString spanString = new SpannableString(menuItem.getTitle().toString());
|
|
||||||
spanString.setSpan(new ForegroundColorSpan(color), 0, spanString.length(), 0);
|
|
||||||
menuItem.setTitle(spanString);
|
|
||||||
|
|
||||||
if(menuItem.getIcon() != null){
|
|
||||||
Drawable icon = menuItem.getIcon();
|
|
||||||
icon.mutate();
|
|
||||||
icon.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void adaptViewToFragment(Fragment fragment){
|
private void adaptViewToFragment(Fragment fragment){
|
||||||
if(fragment instanceof SearchView.OnQueryTextListener) {
|
if(fragment instanceof SearchView.OnQueryTextListener) {
|
||||||
mSearchView.setOnQueryTextListener((SearchView.OnQueryTextListener) fragment);
|
mBinding.appBarMain.mainSearch.setOnQueryTextListener((SearchView.OnQueryTextListener) fragment);
|
||||||
mSearchView.setVisibility(View.VISIBLE);
|
mBinding.appBarMain.mainSearch.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
mSearchView.setOnQueryTextListener(null);
|
mBinding.appBarMain.mainSearch.setOnQueryTextListener(null);
|
||||||
mSearchView.setVisibility(View.GONE);
|
mBinding.appBarMain.mainSearch.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -164,5 +198,82 @@ public class MainActivity extends AppCompatActivity
|
|||||||
} else {
|
} else {
|
||||||
getSupportActionBar().setTitle(R.string.app_name);
|
getSupportActionBar().setTitle(R.string.app_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(fragment instanceof IRecyclerFragment) {
|
||||||
|
((IRecyclerFragment) fragment).setWaterfallToolbar(mBinding.appBarMain.waterfallToolbar);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(fragment instanceof ISelectAllFragment && ((ISelectAllFragment)fragment).isEnabled()) {
|
||||||
|
mBinding.appBarMain.mainSelectAll.setVisibility(View.VISIBLE);
|
||||||
|
mBinding.appBarMain.mainSelectAll.setOnClickListener(v -> ((ISelectAllFragment)fragment).onSelectAll());
|
||||||
|
} else {
|
||||||
|
mBinding.appBarMain.mainSelectAll.setVisibility(View.GONE);
|
||||||
|
mBinding.appBarMain.mainSelectAll.setOnClickListener(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(fragment instanceof IFilterableFragment) {
|
||||||
|
mBinding.appBarMain.mainFilter.setVisibility(View.VISIBLE);
|
||||||
|
mBinding.appBarMain.mainFilter.setOnClickListener(v -> ((IFilterableFragment)fragment).onFilterClick());
|
||||||
|
} else {
|
||||||
|
mBinding.appBarMain.mainFilter.setVisibility(View.GONE);
|
||||||
|
mBinding.appBarMain.mainFilter.setOnClickListener(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void changeContentFragment(Fragment fragment){
|
||||||
|
if (fragment != null) {
|
||||||
|
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||||
|
fragmentManager.beginTransaction()
|
||||||
|
.replace(R.id.frame_container, fragment).commit();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void init(){
|
||||||
|
|
||||||
|
if(BarcodeManager.getCurrentBarcodeInterface() != null) {
|
||||||
|
// DialogSimpleMessageHelper.makeInfoDialog(this,
|
||||||
|
// "Lettore barcode",
|
||||||
|
// new SpannableString("Trovato adattatore " + BarcodeManager.getCurrentBarcodeInterface().getAdapterName() + " installato nel sistema"),
|
||||||
|
// null, null).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
ServerStatusChecker.getIstance().addCallback(value -> {
|
||||||
|
if(value && (!mIsOnline || firstCheckExecution)){
|
||||||
|
|
||||||
|
SettingsManager.reloadDBVariables(() -> {
|
||||||
|
mIsOnline = true;
|
||||||
|
firstCheckExecution = false;
|
||||||
|
|
||||||
|
onDBLoaded();
|
||||||
|
}, ex -> {
|
||||||
|
//mNoConnectionLayout.expand(true);
|
||||||
|
if(!mIsOnline) mIsOnline = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
} else if(!value && mIsOnline){
|
||||||
|
mIsOnline = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void onDBLoaded() {
|
||||||
|
LinearLayout headerLayout = (LinearLayout) mBinding.navView.getHeaderView(0);
|
||||||
|
|
||||||
|
((TextView) headerLayout.findViewById(R.id.drawer_username)).setText(SettingsManager.i().user.fullname);
|
||||||
|
((TextView) headerLayout.findViewById(R.id.drawer_deposito)).setText(SettingsManager.i().userSession.depo.getCodMdep() + " - " + SettingsManager.i().userSession.depo.getDescrizione());
|
||||||
|
|
||||||
|
if(SettingsManager.iDB().getDatiAzienda().isLogoAvailable()) {
|
||||||
|
((ImageView) headerLayout.findViewById(R.id.drawer_logoAzienda)).setImageBitmap(SettingsManager.iDB().getDatiAzienda().getLogo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,62 @@
|
|||||||
|
package it.integry.integrywmsnative;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
|
||||||
|
import com.orhanobut.logger.AndroidLogAdapter;
|
||||||
|
import com.orhanobut.logger.Logger;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.watcher.ServerStatusChecker;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.settings.Stash;
|
||||||
|
import it.integry.integrywmsnative.core.update.UpdatesManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
||||||
|
|
||||||
|
public class MainApplication extends Application {
|
||||||
|
|
||||||
|
public static Resources res;
|
||||||
|
public static Context Context;
|
||||||
|
|
||||||
|
// Called when the application is starting, before any other application objects have been created.
|
||||||
|
// Overriding this method is totally optional!
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
Stash.init(this);
|
||||||
|
|
||||||
|
SettingsManager.init(this);
|
||||||
|
ServerStatusChecker.init();
|
||||||
|
BarcodeManager.init(this);
|
||||||
|
|
||||||
|
// UtilityExceptions.init(this);
|
||||||
|
UtilityResources.init(this);
|
||||||
|
|
||||||
|
Logger.addLogAdapter(new AndroidLogAdapter());
|
||||||
|
|
||||||
|
res = getResources();
|
||||||
|
Context = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called by the system when the device configuration changes while your component is running.
|
||||||
|
// Overriding this method is totally optional!
|
||||||
|
@Override
|
||||||
|
public void onConfigurationChanged(Configuration newConfig) {
|
||||||
|
super.onConfigurationChanged(newConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is called when the overall system is running low on memory,
|
||||||
|
// and would like actively running processes to tighten their belts.
|
||||||
|
// Overriding this method is totally optional!
|
||||||
|
@Override
|
||||||
|
public void onLowMemory() {
|
||||||
|
super.onLowMemory();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
package it.integry.integrywmsnative.core;
|
||||||
|
|
||||||
|
public class CommonConst {
|
||||||
|
|
||||||
|
public static class Login {
|
||||||
|
|
||||||
|
public static class Azienda {
|
||||||
|
// public static String host = "192.168.2.13";
|
||||||
|
// public static int port = 8080;
|
||||||
|
|
||||||
|
public static String host = "www2.studioml.it";
|
||||||
|
public static int port = 80;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Config {
|
||||||
|
public static String COMMESSA_MAG = "MAG";
|
||||||
|
|
||||||
|
public static String DEFAULT_ANONYMOUS_UL_SERIE = "UL";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static class Mail {
|
||||||
|
|
||||||
|
public static String[] forErrors = {
|
||||||
|
// "syslogs@integry.it",
|
||||||
|
"g.scorrano@integry.it"
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,7 +1,16 @@
|
|||||||
package it.integry.integrywmsnative.core.REST;
|
package it.integry.integrywmsnative.core.REST;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import java.net.SocketException;
|
import java.net.SocketException;
|
||||||
import java.net.SocketTimeoutException;
|
import java.net.SocketTimeoutException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.EsitoType;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by GiuseppeS on 22/03/2018.
|
* Created by GiuseppeS on 22/03/2018.
|
||||||
@ -9,14 +18,17 @@ import java.net.SocketTimeoutException;
|
|||||||
|
|
||||||
public class CommonRESTException {
|
public class CommonRESTException {
|
||||||
|
|
||||||
|
|
||||||
public static String tryRecognizeThenGetMessage(Exception ex){
|
public static String tryRecognizeThenGetMessage(Exception ex){
|
||||||
|
|
||||||
if(ex instanceof SocketException){
|
if(ex instanceof SocketException){
|
||||||
return "Errore di comunicazione con il server remoto. Riprova.";
|
return "Errore di comunicazione con il server remoto. Riprova.";
|
||||||
} else if(ex instanceof SocketTimeoutException){
|
} else if(ex instanceof SocketTimeoutException){
|
||||||
return "Errore di timeout durante la comunicazione con il server remoto. Riprova.";
|
return "Errore di timeout durante la comunicazione con il server remoto. Riprova.";
|
||||||
|
} else if(ex.getMessage().startsWith("Printer not found")){
|
||||||
|
return "Stampante non trovata";
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return ex.getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import android.util.Base64;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import okhttp3.HttpUrl;
|
import okhttp3.HttpUrl;
|
||||||
import okhttp3.Interceptor;
|
import okhttp3.Interceptor;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
@ -15,12 +16,13 @@ import okhttp3.Response;
|
|||||||
|
|
||||||
public class HttpInterceptor implements Interceptor {
|
public class HttpInterceptor implements Interceptor {
|
||||||
|
|
||||||
private final String USERNAME = "magazzino";
|
|
||||||
private final String PASSWORD = "m";
|
|
||||||
private final String PROFILE_DB = "IME_TE";
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Response intercept(Chain chain) throws IOException {
|
public Response intercept(Chain chain) throws IOException {
|
||||||
|
|
||||||
|
final String PROFILE_DB = SettingsManager.i().userSession.profileDB;
|
||||||
|
final String USERNAME = SettingsManager.i().user.username;
|
||||||
|
final String PASSWORD = SettingsManager.i().user.password;
|
||||||
|
|
||||||
final Request request = chain.request();
|
final Request request = chain.request();
|
||||||
final HttpUrl url = request.url().newBuilder()
|
final HttpUrl url = request.url().newBuilder()
|
||||||
.addQueryParameter("profileDb", PROFILE_DB)
|
.addQueryParameter("profileDb", PROFILE_DB)
|
||||||
@ -32,8 +34,8 @@ public class HttpInterceptor implements Interceptor {
|
|||||||
.addHeader("Authorization", string)
|
.addHeader("Authorization", string)
|
||||||
.addHeader("Content-Type", "application/json")
|
.addHeader("Content-Type", "application/json")
|
||||||
.addHeader("Accept", "*/*")
|
.addHeader("Accept", "*/*")
|
||||||
.addHeader("username", USERNAME)
|
.addHeader("username", USERNAME != null ? USERNAME : "")
|
||||||
.addHeader("password", PASSWORD)
|
.addHeader("password", PASSWORD != null ? PASSWORD : "")
|
||||||
.url(url).build();
|
.url(url).build();
|
||||||
|
|
||||||
return chain.proceed(newRequest);
|
return chain.proceed(newRequest);
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
package it.integry.integrywmsnative.core.REST;
|
package it.integry.integrywmsnative.core.REST;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import retrofit2.Retrofit;
|
import retrofit2.Retrofit;
|
||||||
import retrofit2.converter.gson.GsonConverterFactory;
|
import retrofit2.converter.gson.GsonConverterFactory;
|
||||||
@ -11,11 +14,31 @@ import retrofit2.converter.gson.GsonConverterFactory;
|
|||||||
public class RESTBuilder {
|
public class RESTBuilder {
|
||||||
|
|
||||||
public static <T> T getService(final Class<T> service) {
|
public static <T> T getService(final Class<T> service) {
|
||||||
OkHttpClient client = new OkHttpClient.Builder().addInterceptor(new HttpInterceptor()).build();
|
// return getService(service, "192.168.2.13", 8080);
|
||||||
|
return getService(service, SettingsManager.i().server.host, SettingsManager.i().server.port, true);
|
||||||
|
|
||||||
|
}
|
||||||
|
public static <T> T getService(final Class<T> service, long timeout) {
|
||||||
|
// return getService(service, "192.168.2.13", 8080);
|
||||||
|
return getService(service, SettingsManager.i().server.host, SettingsManager.i().server.port, true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors){
|
||||||
|
OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder();
|
||||||
|
|
||||||
|
clientBuilder.connectTimeout(30, TimeUnit.SECONDS);
|
||||||
|
clientBuilder.readTimeout(30, TimeUnit.SECONDS);
|
||||||
|
clientBuilder.writeTimeout(30, TimeUnit.SECONDS);
|
||||||
|
|
||||||
|
if(addInterceptors) clientBuilder.addInterceptor(new HttpInterceptor());
|
||||||
|
|
||||||
|
OkHttpClient client = clientBuilder.build();
|
||||||
|
|
||||||
|
String endpoint = "http://" + host + ":" + port + "/ems-api/";
|
||||||
|
|
||||||
Retrofit retrofit = new Retrofit.Builder()
|
Retrofit retrofit = new Retrofit.Builder()
|
||||||
.baseUrl("http://192.168.2.13:8080/ems-api/")
|
.baseUrl(endpoint)
|
||||||
// .baseUrl("http://www2.studioml.it/ems-api/")
|
|
||||||
.client(client)
|
.client(client)
|
||||||
.addConverterFactory(GsonConverterFactory.create())
|
.addConverterFactory(GsonConverterFactory.create())
|
||||||
.build();
|
.build();
|
||||||
|
|||||||
@ -0,0 +1,60 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import com.annimon.stream.Collectors;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
public static void getByBarcodeProd(String barcodeProd, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||||
|
articoloRESTConsumerService.getByBarcodeProd(barcodeProd).enqueue(new Callback<ServiceRESTResponse<MtbAart>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||||
|
analyzeAnswer(response, "getByBarcodeProd", (m) -> {
|
||||||
|
onComplete.run(response.body().getEntityList());
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<MtbAart>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void getByCodMart(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
String joinedCods = Stream.of(codMartToFind)
|
||||||
|
.collect(Collectors.joining(","));
|
||||||
|
|
||||||
|
|
||||||
|
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||||
|
articoloRESTConsumer.getByCodMart(joinedCods).enqueue(new Callback<ServiceRESTResponse<MtbAart>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||||
|
analyzeAnswer(response, "getByCodMart", (m) -> {
|
||||||
|
onComplete.run(response.body().getEntityList());
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<MtbAart>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface ArticoloRESTConsumerService {
|
||||||
|
|
||||||
|
|
||||||
|
@POST("SM2getArticoloByBarcode")
|
||||||
|
Call<ServiceRESTResponse<MtbAart>> getByBarcodeProd(@Query("barcode") String barcodeProd);
|
||||||
|
|
||||||
|
@GET("SM2getArticoloByCodMart")
|
||||||
|
Call<ServiceRESTResponse<MtbAart>> getByCodMart(@Query("codMart") String barcodeProd);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.Ean128Model;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.plugins.barcode_base_library.model.BarcodeScanDTO;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public class BarcodeRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
public static void decodeEan128(BarcodeScanDTO barcodeObj, RunnableArgs<Ean128Model> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
String ean128 = barcodeObj.getStringValue().replaceAll("" + ((char) 29), "|");
|
||||||
|
|
||||||
|
BarcodeRESTConsumerService barcodeRESTConsumerService = RESTBuilder.getService(BarcodeRESTConsumerService.class);
|
||||||
|
barcodeRESTConsumerService.decodeEan128(ean128).enqueue(new Callback<ServiceRESTResponse<Ean128Model>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<Ean128Model>> call, Response<ServiceRESTResponse<Ean128Model>> response) {
|
||||||
|
analyzeAnswer(response, "DecodeEan128", onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<Ean128Model>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.DistribuzioneColloDTO;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.Ean128Model;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.Body;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface BarcodeRESTConsumerService {
|
||||||
|
|
||||||
|
@GET("decodeEan128")
|
||||||
|
Call<ServiceRESTResponse<Ean128Model>> decodeEan128(@Query("ean128") String ean128);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,349 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.CommonConst;
|
||||||
|
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.DistribuzioneColloDTO;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.plugins.barcode_base_library.model.BarcodeScanDTO;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
||||||
|
|
||||||
|
|
||||||
|
public static void getAvailablePosizioni(RunnableArgs<List<MtbDepoPosizione>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
String codMdep = SettingsManager.i().userSession.depo.getCodMdep();
|
||||||
|
|
||||||
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
|
colliMagazzinoRESTConsumerService.getAvailablePosizioni(codMdep).enqueue(new Callback<ServiceRESTResponse<List<MtbDepoPosizione>>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<MtbDepoPosizione>>> call, Response<ServiceRESTResponse<List<MtbDepoPosizione>>> response) {
|
||||||
|
analyzeAnswer(response, "getAvailablePosizioni", (m) -> {
|
||||||
|
onComplete.run(response.body().getDto());
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<MtbDepoPosizione>>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void saveCollo(MtbColt mtbColtToSave, final ISimpleOperationCallback<MtbColt> callback){
|
||||||
|
|
||||||
|
EntityRESTConsumer.processEntity(mtbColtToSave, callback, MtbColt.class);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void saveCollo(MtbColt mtbColtToSave, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed){
|
||||||
|
|
||||||
|
EntityRESTConsumer.processEntity(mtbColtToSave, new ISimpleOperationCallback<MtbColt>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(MtbColt value) {
|
||||||
|
if(onComplete != null) onComplete.run(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
}, MtbColt.class);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void createColloLavorazione(int segno, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
MtbColt mtbColtToCreate = new MtbColt()
|
||||||
|
.setSegno(segno)
|
||||||
|
.setGestione(GestioneEnum.LAVORAZIONE);
|
||||||
|
|
||||||
|
mtbColtToCreate
|
||||||
|
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
|
|
||||||
|
|
||||||
|
saveCollo(mtbColtToCreate, new ISimpleOperationCallback<MtbColt>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(MtbColt value) {
|
||||||
|
if(onComplete != null) onComplete.run(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void createColloFromEtichettaAnonima(BarcodeScanDTO barcodeScanDTO, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
createColloFromEtichettaAnonima(barcodeScanDTO.getStringValue(), gestione, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void createColloFromEtichettaAnonima(String barcode, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
MtbColt mtbColtToCreate = new MtbColt()
|
||||||
|
.setGestione(gestione);
|
||||||
|
|
||||||
|
Integer customNumCollo = UtilityBarcode.getNumColloFromULAnonima(barcode);
|
||||||
|
String customSerCollo = CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE;
|
||||||
|
|
||||||
|
if(customNumCollo != null) {
|
||||||
|
mtbColtToCreate.setNumCollo(customNumCollo);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!UtilityString.isNullOrEmpty(customSerCollo)) {
|
||||||
|
mtbColtToCreate.setSerCollo(customSerCollo);
|
||||||
|
}
|
||||||
|
|
||||||
|
mtbColtToCreate
|
||||||
|
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
|
|
||||||
|
saveCollo(mtbColtToCreate, new ISimpleOperationCallback<MtbColt>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(MtbColt value) {
|
||||||
|
if(onComplete != null) onComplete.run(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void deleteCollo(MtbColt mtbColtToDelete, Runnable onComplete, RunnableArgs<Exception> onFailed){
|
||||||
|
|
||||||
|
mtbColtToDelete.setOperation(CommonModelConsts.OPERATION.DELETE);
|
||||||
|
|
||||||
|
saveCollo(mtbColtToDelete, new ISimpleOperationCallback<MtbColt>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(MtbColt value) {
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void distribuisciCollo(MtbColt mtbColtToDistribute, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
DistribuzioneColloDTO distribuzioneColloDTO = new DistribuzioneColloDTO()
|
||||||
|
.setCriterioDistribuzione(DistribuzioneColloDTO.CriterioDistribuzione.UPDATE)
|
||||||
|
.setDataCollo(mtbColtToDistribute.getDataColloS())
|
||||||
|
.setNumCollo(mtbColtToDistribute.getNumCollo())
|
||||||
|
.setGestione(mtbColtToDistribute.getGestione())
|
||||||
|
.setSerCollo(mtbColtToDistribute.getSerCollo());
|
||||||
|
|
||||||
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
|
colliMagazzinoRESTConsumerService.distribuisciCollo(distribuzioneColloDTO)
|
||||||
|
.enqueue(new Callback<ServiceRESTResponse<JsonObject>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||||
|
analyzeAnswer(response, "DistribuzioneCollo", obj -> onComplete.run(), onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getBySSCC(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
|
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||||
|
analyzeAnswer(response, "GetBySSCC", mtbColt -> {
|
||||||
|
|
||||||
|
if(mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0){
|
||||||
|
List<String> codMarts = Stream.of(mtbColt.getMtbColr())
|
||||||
|
.map(MtbColr::getCodMart)
|
||||||
|
.withoutNulls()
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
ArticoloRESTConsumer.getByCodMart(codMarts, arts -> {
|
||||||
|
|
||||||
|
if(arts != null && arts.size() > 0) {
|
||||||
|
for (MtbColr mtbColr : mtbColt.getMtbColr()) {
|
||||||
|
|
||||||
|
MtbAart foundMtbAart = null;
|
||||||
|
|
||||||
|
List<MtbAart> mtbAartStream = Stream.of(arts)
|
||||||
|
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart())).toList();
|
||||||
|
|
||||||
|
if(mtbAartStream != null && mtbAartStream.size() > 0){
|
||||||
|
foundMtbAart = mtbAartStream.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
mtbColr.setMtbAart(foundMtbAart);
|
||||||
|
mtbColr.setGestione(mtbColt.getGestione());
|
||||||
|
mtbColr.setSerCollo(mtbColt.getSerCollo());
|
||||||
|
mtbColr.setNumCollo(mtbColt.getNumCollo());
|
||||||
|
mtbColr.setDataCollo(mtbColt.getDataColloS());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onComplete.run(mtbColt);
|
||||||
|
}
|
||||||
|
|
||||||
|
}, onFailed);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
onComplete.run(mtbColt);
|
||||||
|
}
|
||||||
|
|
||||||
|
}, onFailed);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void getByTestata(MtbColt testata, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
String ssccString = null;
|
||||||
|
|
||||||
|
if(testata.getSerCollo().equalsIgnoreCase(CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE)){
|
||||||
|
ssccString = "U";
|
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yy");
|
||||||
|
ssccString += sdf.format(testata.getDataColloD());
|
||||||
|
|
||||||
|
ssccString += String.format("%07d", testata.getNumCollo());
|
||||||
|
} else {
|
||||||
|
ssccString = "";
|
||||||
|
|
||||||
|
switch (testata.getGestioneEnum()) {
|
||||||
|
case ACQUISTO:
|
||||||
|
ssccString += "1";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LAVORAZIONE:
|
||||||
|
ssccString += "2";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VENDITA:
|
||||||
|
ssccString += "3";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yy");
|
||||||
|
ssccString += sdf.format(testata.getDataColloD());
|
||||||
|
|
||||||
|
ssccString += String.format("%05d", testata.getNumCollo());
|
||||||
|
ssccString += "0";
|
||||||
|
}
|
||||||
|
|
||||||
|
getBySSCC(ssccString, onlyResiduo, throwExcIfNull, onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void changePosizione(MtbColt testata, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
testata.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
||||||
|
|
||||||
|
if(posizione == null) testata.setPosizione(null);
|
||||||
|
else testata.setPosizione(posizione.getPosizione());
|
||||||
|
|
||||||
|
ColliMagazzinoRESTConsumer.saveCollo(testata, new ISimpleOperationCallback<MtbColt>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(MtbColt value) {
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void deleteRiga(MtbColr mtbColrToDelete, Runnable onComplete, RunnableArgs<Exception> onFailed){
|
||||||
|
MtbColr newMtbColr = new MtbColr();
|
||||||
|
|
||||||
|
newMtbColr.setNumCollo(mtbColrToDelete.getNumCollo());
|
||||||
|
newMtbColr.setDataCollo(mtbColrToDelete.getDataColloS());
|
||||||
|
newMtbColr.setSerCollo(mtbColrToDelete.getSerCollo());
|
||||||
|
newMtbColr.setGestione(mtbColrToDelete.getGestione());
|
||||||
|
newMtbColr.setRiga(mtbColrToDelete.getRiga());
|
||||||
|
|
||||||
|
|
||||||
|
newMtbColr.setOperation(CommonModelConsts.OPERATION.DELETE);
|
||||||
|
|
||||||
|
EntityRESTConsumer.processEntity(newMtbColr, new ISimpleOperationCallback<MtbColr>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(MtbColr value) {
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
}, MtbColr.class);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void updateRiga(MtbColr mtbColrToUpdate, Runnable onComplete, RunnableArgs<Exception> onFailed){
|
||||||
|
|
||||||
|
mtbColrToUpdate.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
||||||
|
|
||||||
|
EntityRESTConsumer.processEntity(mtbColrToUpdate, new ISimpleOperationCallback<MtbColr>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(MtbColr value) {
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
}, MtbColr.class);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.DistribuzioneColloDTO;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.Body;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface ColliMagazzinoRESTConsumerService {
|
||||||
|
|
||||||
|
@GET("getAvailablePosizioni")
|
||||||
|
Call<ServiceRESTResponse<List<MtbDepoPosizione>>> getAvailablePosizioni(@Query("codMdep") String codMdep);
|
||||||
|
|
||||||
|
@POST("SM2DistribuzioneRigheCollo")
|
||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbDepo;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
|
import it.integry.integrywmsnative.generated.callback.Runnable;
|
||||||
|
|
||||||
|
public class DepositoRESTConsumer {
|
||||||
|
|
||||||
|
public static void getDepoByCodMdep(String codMdep, RunnableArgs<MtbDepo> onComplete) {
|
||||||
|
|
||||||
|
MtbDepo mtbDepo = new MtbDepo();
|
||||||
|
mtbDepo.setCodMdep(codMdep);
|
||||||
|
mtbDepo.setOperation(CommonModelConsts.OPERATION.SELECT);
|
||||||
|
mtbDepo.setOnlyPkMaster(false);
|
||||||
|
|
||||||
|
EntityRESTConsumer.selectEntity(mtbDepo, new ISimpleOperationCallback<List<MtbDepo>>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<MtbDepo> value) {
|
||||||
|
if(value != null && value.size() > 0) {
|
||||||
|
onComplete.run(value.get(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
UtilityLogger.errorMe(ex);
|
||||||
|
}
|
||||||
|
}, MtbDepo.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,114 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.EsitoType;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.model.EntityBase;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public class EntityRESTConsumer {
|
||||||
|
|
||||||
|
public static <T extends EntityBase> void processEntity(T entityToSave, final ISimpleOperationCallback<T> callback, Class<T> type){
|
||||||
|
|
||||||
|
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
|
||||||
|
Call<ServiceRESTResponse<JsonObject>> request = service.processEntity(entityToSave);
|
||||||
|
request.enqueue(new Callback<ServiceRESTResponse<JsonObject>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||||
|
if(response.isSuccessful()) {
|
||||||
|
|
||||||
|
if(response.body() != null) {
|
||||||
|
if(response.body().getEsito() == EsitoType.OK) {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
T object = gson.fromJson(response.body().getEntity(), type);
|
||||||
|
|
||||||
|
callback.onSuccess(object);
|
||||||
|
} else {
|
||||||
|
Log.e("EntityRESTConsumer", response.body().getErrorMessage());
|
||||||
|
callback.onFailed(new Exception(response.body().getErrorMessage()));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.e("EntityRESTConsumer", response.message());
|
||||||
|
callback.onFailed(new Exception(response.message()));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.e("EntityRESTConsumer", "Status " + response.code() + ": " + response.message());
|
||||||
|
callback.onFailed(new Exception("Status " + response.code() + ": " + response.message()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
||||||
|
Log.e("EntityRESTConsumer", t.toString());
|
||||||
|
callback.onFailed(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static <T extends EntityBase> void selectEntity(T entityToSave, final ISimpleOperationCallback<List<T>> callback, Class type){
|
||||||
|
|
||||||
|
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
|
||||||
|
Call<ServiceRESTResponse<JsonObject>> request = service.processEntity(entityToSave);
|
||||||
|
request.enqueue(new Callback<ServiceRESTResponse<JsonObject>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||||
|
if(response.isSuccessful()) {
|
||||||
|
|
||||||
|
if(response.body() != null) {
|
||||||
|
if(response.body().getEsito() == EsitoType.OK) {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
List<JsonObject> jsons = response.body().getEntityList();
|
||||||
|
|
||||||
|
List<T> newList = new ArrayList<T>();
|
||||||
|
|
||||||
|
if(jsons != null) {
|
||||||
|
for (int i = 0; i < jsons.size(); i ++){
|
||||||
|
JsonObject jsonTmp = jsons.get(i);
|
||||||
|
|
||||||
|
newList.add((T) gson.fromJson(jsonTmp, type));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
callback.onSuccess(newList);
|
||||||
|
} else {
|
||||||
|
Log.e("EntityRESTConsumer", response.body().getErrorMessage());
|
||||||
|
callback.onFailed(new Exception(response.body().getErrorMessage()));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.e("EntityRESTConsumer", response.message());
|
||||||
|
callback.onFailed(new Exception(response.message()));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.e("EntityRESTConsumer", "Status " + response.code() + ": " + response.message());
|
||||||
|
callback.onFailed(new Exception("Status " + response.code() + ": " + response.message()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
||||||
|
Log.e("EntityRESTConsumer", t.toString());
|
||||||
|
callback.onFailed(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.model.EntityBase;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.Body;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
|
public interface EntityRESTConsumerService {
|
||||||
|
|
||||||
|
@POST("processEntity")
|
||||||
|
Call<ServiceRESTResponse<JsonObject>> processEntity(@Body Object entity);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.GestSetupDTO;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
|
import it.integry.integrywmsnative.generated.callback.Runnable;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
public static void getValue(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>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<GestSetupDTO>> call, Response<ServiceRESTResponse<GestSetupDTO>> response) {
|
||||||
|
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
|
||||||
|
Log.e("PrintCollo", t.toString());
|
||||||
|
UtilityLogger.errorMe(new Exception(t));
|
||||||
|
if(onFailed != null) onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static 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);
|
||||||
|
}, ex -> {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static 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
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<GestSetupDTO>> call, Response<ServiceRESTResponse<GestSetupDTO>> response) {
|
||||||
|
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
|
||||||
|
Log.e("PrintCollo", t.toString());
|
||||||
|
UtilityLogger.errorMe(new Exception(t));
|
||||||
|
if(onFailed != null) onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static 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);
|
||||||
|
}, ex -> {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.AvailableCodMdepsDTO;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.GestSetupDTO;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface GestSetupRESTConsumerService {
|
||||||
|
|
||||||
|
@GET("gestSetup")
|
||||||
|
Call<ServiceRESTResponse<GestSetupDTO>> getGestSetupValue(
|
||||||
|
@Query("gestName") String gestName,
|
||||||
|
@Query("section") String section,
|
||||||
|
@Query("keySection") String keySection);
|
||||||
|
|
||||||
|
@GET("gestSetup")
|
||||||
|
Call<ServiceRESTResponse<GestSetupDTO>> getGestSetupValue(
|
||||||
|
@Query("gestName") String gestName,
|
||||||
|
@Query("section") String section,
|
||||||
|
@Query("keySection") String keySection,
|
||||||
|
@Query("codMdep") String codMdep);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
public interface ISimpleOperationCallback<T> {
|
||||||
|
|
||||||
|
void onSuccess(T value);
|
||||||
|
|
||||||
|
void onFailed(Exception ex );
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
public interface ISingleOperationDoubleCallback<T, U> {
|
||||||
|
|
||||||
|
void onSuccess(T firstValue, U secondValue);
|
||||||
|
|
||||||
|
void onFailed(Exception ex );
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
public interface ISingleValueOperationCallback<T> {
|
||||||
|
|
||||||
|
void onResult(T value);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||||
|
|
||||||
|
public class PosizioneRESTonsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void getBancaliInPosizione(MtbDepoPosizione mtbDepoPosizione, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
|
||||||
|
String sql = "SELECT * FROM mtb_colt WHERE cod_mdep = " + UtilityDB.valueToString(mtbDepoPosizione.getCodMdep()) + " AND posizione = " + UtilityDB.valueToString(mtbDepoPosizione.getPosizione());
|
||||||
|
|
||||||
|
|
||||||
|
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {}.getType();
|
||||||
|
SystemRESTConsumer.processSql(sql, typeOfObjectsList, new ISimpleOperationCallback<List<MtbColt>>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<MtbColt> value) {
|
||||||
|
if(onComplete != null) onComplete.run(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,121 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.CommonRESTException;
|
||||||
|
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.EsitoType;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
import static br.com.zbra.androidlinq.Linq.stream;
|
||||||
|
|
||||||
|
public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
public enum Type {
|
||||||
|
PRIMARY,
|
||||||
|
SECONDARY
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void getAvailablePrinters(final ISimpleOperationCallback<List<String>> callback) {
|
||||||
|
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
|
printerService.getAvailablePrinters().enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
||||||
|
analyzeAnswer(response, "GetAvailablePrinters", callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, Throwable t) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void getAvailablePrinters(String codMdep, final ISimpleOperationCallback<List<String>> callback) {
|
||||||
|
|
||||||
|
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
|
printerService.getAvailablePrinters(codMdep).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
||||||
|
analyzeAnswer(response, "GetAvailablePrinters", new ISimpleOperationCallback<List<String>>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<String> value) {
|
||||||
|
callback.onSuccess(value != null ? stream(value).where(x -> x != null).toList() : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
callback.onFailed(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, Throwable t) {
|
||||||
|
Log.e("GetAvailablePrinters", t.toString());
|
||||||
|
UtilityLogger.errorMe(new Exception(t));
|
||||||
|
callback.onFailed(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void getAvailablePrinters(String codMdep, Type printerType, final ISimpleOperationCallback<List<String>> callback) {
|
||||||
|
|
||||||
|
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
|
printerService.getAvailablePrinters(codMdep, printerType.toString()).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
||||||
|
analyzeAnswer(response, "GetAvailablePrinters", callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, Throwable t) {
|
||||||
|
Log.e("GetAvailablePrinters", t.toString());
|
||||||
|
UtilityLogger.errorMe(new Exception(t));
|
||||||
|
callback.onFailed(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void printCollo(String printerName, MtbColt testataColloToPrint, int quantity, String reportName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
|
printerService.printCollo(
|
||||||
|
printerName,
|
||||||
|
testataColloToPrint.getDataColloS(),
|
||||||
|
testataColloToPrint.getGestione(),
|
||||||
|
testataColloToPrint.getSerCollo(),
|
||||||
|
testataColloToPrint.getNumCollo(),
|
||||||
|
quantity,
|
||||||
|
reportName)
|
||||||
|
|
||||||
|
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
|
analyzeAnswer(response, "PrintCollo", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.AvailableCodMdepsDTO;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.Field;
|
||||||
|
import retrofit2.http.FormUrlEncoded;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface PrinterRESTConsumerService {
|
||||||
|
|
||||||
|
@POST("getAvailablePrinters")
|
||||||
|
Call<ServiceRESTResponse<List<String>>> getAvailablePrinters();
|
||||||
|
|
||||||
|
@POST("getAvailablePrinters")
|
||||||
|
Call<ServiceRESTResponse<List<String>>> getAvailablePrinters(@Query("codMdep") String codMdep);
|
||||||
|
|
||||||
|
@POST("getAvailablePrinters")
|
||||||
|
Call<ServiceRESTResponse<List<String>>> getAvailablePrinters(@Query("codMdep") String codMdep, @Query("printerType") String printerType);
|
||||||
|
|
||||||
|
|
||||||
|
@POST("pkgPrintLabel")
|
||||||
|
@FormUrlEncoded
|
||||||
|
Call<ServiceRESTResponse<Object>> printCollo(
|
||||||
|
@Query("printerName") String printerName,
|
||||||
|
@Field("dataCollo") String dataCollo,
|
||||||
|
@Field("gestione") String gestione,
|
||||||
|
@Field("serCollo") String serCollo,
|
||||||
|
@Field("numCollo") int numCollo,
|
||||||
|
@Query("printQuantity") int printQuantity,
|
||||||
|
@Query("reportName") String reportName
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,176 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.Reader;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.CommonConst;
|
||||||
|
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.AvailableCodMdepsDTO;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.MailRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.NativeSqlRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.Azienda;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.generated.callback.Runnable;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
public static <T> void processSql(String nativeSql, final Type clazz, final ISimpleOperationCallback<T> callback) {
|
||||||
|
|
||||||
|
NativeSqlRequestDTO nativeSqlDTO = new NativeSqlRequestDTO();
|
||||||
|
nativeSqlDTO.nativeSql = nativeSql;
|
||||||
|
|
||||||
|
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||||
|
service.processSql(nativeSqlDTO).enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
|
analyzeAnswer(response, "ProcessSql", new ISimpleOperationCallback<Object>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Object value) {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
String json = gson.toJson(value);
|
||||||
|
|
||||||
|
InputStream ims = new ByteArrayInputStream(json.getBytes());
|
||||||
|
Reader reader = new InputStreamReader(ims);
|
||||||
|
T gsonObj = gson.fromJson(reader, clazz);
|
||||||
|
|
||||||
|
callback.onSuccess(gsonObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
callback.onFailed(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||||
|
Log.e("ProcessSql", t.toString());
|
||||||
|
callback.onFailed(new Exception(t));
|
||||||
|
UtilityLogger.errorMe(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void getAvailableProfiles(final ISimpleOperationCallback<List<String>> callback){
|
||||||
|
|
||||||
|
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||||
|
service.getAvailableProfiles(SettingsManager.i().user.username, SettingsManager.i().user.password).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
||||||
|
analyzeAnswer(response, "ProfilesAvailable", callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, final Throwable t) {
|
||||||
|
Log.e("ProfilesAvailable", t.toString());
|
||||||
|
callback.onFailed(new Exception(t));
|
||||||
|
UtilityLogger.errorMe(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void getAvailableCodMdeps(final ISimpleOperationCallback<List<AvailableCodMdepsDTO>> callback){
|
||||||
|
|
||||||
|
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||||
|
service.getAvailableCodMdeps().enqueue(new Callback<ServiceRESTResponse<List<AvailableCodMdepsDTO>>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> call, Response<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> response) {
|
||||||
|
analyzeAnswer(response, "CodMdepsAvailable", callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> call, final Throwable t) {
|
||||||
|
Log.e("CodMdepsAvailable", t.toString());
|
||||||
|
callback.onFailed(new Exception(t));
|
||||||
|
UtilityLogger.errorMe(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void sendErrorLogMail(String message) {
|
||||||
|
|
||||||
|
String currentAzienda = UtilityString.isNullOrEmpty(SettingsManager.i().userSession.profileDB) ? "" : " [" + SettingsManager.i().userSession.profileDB + "]";
|
||||||
|
|
||||||
|
|
||||||
|
MailRequestDTO mailDTO = new MailRequestDTO()
|
||||||
|
.setFrom("sender@integry.it")
|
||||||
|
.setFromName("WMS Android")
|
||||||
|
.setTo(TextUtils.join(";", CommonConst.Mail.forErrors))
|
||||||
|
.setSubject("Bug notification" + currentAzienda)
|
||||||
|
.setMsgText(message)
|
||||||
|
.setHtml(true);
|
||||||
|
|
||||||
|
sendMail(mailDTO, null, ex -> {
|
||||||
|
Log.e(SystemRESTConsumer.class.getName(), "", ex);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void sendMail(MailRequestDTO mailDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||||
|
service.sendMail(mailDTO).enqueue(new Callback<ServiceRESTResponse<String>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<String>> call, Response<ServiceRESTResponse<String>> response) {
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<String>> call, Throwable t) {
|
||||||
|
if(onFailed != null) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void getAzienda(RunnableArgs<Azienda> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
|
String sql = "SELECT TOP 1 * FROM azienda";
|
||||||
|
|
||||||
|
Type typeOfObjectsList = new TypeToken<ArrayList<Azienda>>() {}.getType();
|
||||||
|
SystemRESTConsumer.processSql(sql, typeOfObjectsList, new ISimpleOperationCallback<List<Azienda>>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<Azienda> value) {
|
||||||
|
if(onComplete != null) onComplete.run(value.get(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.AvailableCodMdepsDTO;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.MailRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.NativeSqlRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.Body;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface SystemRESTConsumerService {
|
||||||
|
|
||||||
|
@POST("processSql")
|
||||||
|
Call<ServiceRESTResponse<Object>> processSql(@Body NativeSqlRequestDTO nativeSqlDTO);
|
||||||
|
|
||||||
|
@GET("getAvailableProfiles")
|
||||||
|
Call<ServiceRESTResponse<List<String>>> getAvailableProfiles(@Query("username") String username, @Query("password") String password);
|
||||||
|
|
||||||
|
@GET("getAvailableCodMdepsForUser")
|
||||||
|
Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> getAvailableCodMdeps();
|
||||||
|
|
||||||
|
@POST("sendEmail")
|
||||||
|
Call<ServiceRESTResponse<String>> sendMail(@Body MailRequestDTO mailDto);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.EsitoType;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public class _BaseRESTConsumer {
|
||||||
|
|
||||||
|
|
||||||
|
public static <T> void analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle, final ISimpleOperationCallback<T> callback){
|
||||||
|
if(response.isSuccessful()) {
|
||||||
|
if(response.body() != null) {
|
||||||
|
if(response.body().getEsito() == EsitoType.OK) {
|
||||||
|
if(!UtilityString.isNullOrEmpty(response.body().getErrorMessage())){
|
||||||
|
callback.onFailed(new Exception(response.body().getErrorMessage()));
|
||||||
|
} else callback.onSuccess(response.body().getDto());
|
||||||
|
} else {
|
||||||
|
Log.e(logTitle, response.body().getErrorMessage());
|
||||||
|
callback.onFailed(new Exception(response.body().getErrorMessage()));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.e(logTitle, response.message());
|
||||||
|
callback.onFailed(new Exception(response.message()));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
||||||
|
callback.onFailed(new Exception("Status " + response.code() + ": " + response.message()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> void analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle, RunnableArgs<T> onComplete, RunnableArgs<Exception> onFailed){
|
||||||
|
analyzeAnswer(response, logTitle, new ISimpleOperationCallback<T>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(T value) {
|
||||||
|
onComplete.run(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.model;
|
||||||
|
|
||||||
|
public class AvailableCodMdepsDTO {
|
||||||
|
|
||||||
|
private String codMdep;
|
||||||
|
private String descrizione;
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if((obj) != null) {
|
||||||
|
return ((AvailableCodMdepsDTO) obj).codMdep.equalsIgnoreCase(codMdep);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,83 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
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,342 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.model;
|
||||||
|
|
||||||
|
|
||||||
|
public class Ean128Model {
|
||||||
|
|
||||||
|
///<summary>Numero sequenziale del collo </summary>
|
||||||
|
public String Sscc;
|
||||||
|
|
||||||
|
///<summary>Codice EAN/UCC unità logistica </summary>
|
||||||
|
public String Gtin;
|
||||||
|
|
||||||
|
///<summary>Codice EAN/UCC dei prodotti contenuti all'interno di unità log</summary>
|
||||||
|
public String Content;
|
||||||
|
|
||||||
|
///<summary>Numero del lotto di fabbricazione</summary>
|
||||||
|
public String BatchLot;
|
||||||
|
|
||||||
|
///<summary>Data di produzione (yymmdd) 0~50 (2000~2050) - 51~99 (1951~1999)</summary>
|
||||||
|
public String ProdString;
|
||||||
|
|
||||||
|
///<summary>Data di scadenza pagamento fattura</summary>
|
||||||
|
public String DueString;
|
||||||
|
|
||||||
|
///<summary>Data di confezionamento</summary>
|
||||||
|
public String PackString;
|
||||||
|
|
||||||
|
///<summary>Data minima di validità</summary>
|
||||||
|
public String BestBefore;
|
||||||
|
|
||||||
|
///<summary>Data massima di validità</summary>
|
||||||
|
public String Expiry;
|
||||||
|
|
||||||
|
///<summary>Variante di prodotto - uso interno aziendale</summary>
|
||||||
|
public String Variant;
|
||||||
|
|
||||||
|
///<summary>Numero di serie</summary>
|
||||||
|
public String Serial;
|
||||||
|
|
||||||
|
///<summary>Dati supplementari per prodotti farmaceutici</summary>
|
||||||
|
public String QtyStringBatch;
|
||||||
|
|
||||||
|
///<summary>Numedi di identificazione supplementare del prodotto</summary>
|
||||||
|
public String AdditionalID;
|
||||||
|
|
||||||
|
///<summary>Codice prodotto interno del cliente</summary>
|
||||||
|
public String CustPartNumber;
|
||||||
|
|
||||||
|
///<summary>Numero di serie secondario</summary>
|
||||||
|
public String SecondarySerial;
|
||||||
|
|
||||||
|
///<summary>Entità di origine o marca auricolare</summary>
|
||||||
|
public String RefToSource;
|
||||||
|
|
||||||
|
///<summary>Quantità variabile</summary>
|
||||||
|
public String VarCount;
|
||||||
|
|
||||||
|
///<summary>Peso netto in Kg</summary>
|
||||||
|
public Float NetWeightKg;
|
||||||
|
|
||||||
|
///<summary>Lunghezza o 1° dimensione, in mt, uso commerciale</summary>
|
||||||
|
public Float LengthM;
|
||||||
|
|
||||||
|
///<summary>Larghezza, diametro o 2° dimensione, in mt, uso commerciale</summary>
|
||||||
|
public Float WidthM;
|
||||||
|
|
||||||
|
///<summary>Profondità, spessore, altezza o 3° dimensione, in mt, uso commerciale</summary>
|
||||||
|
public Float HeightM;
|
||||||
|
|
||||||
|
///<summary>Superficie, in metriquadri, uso commerciale</summary>
|
||||||
|
public Float AreaM2;
|
||||||
|
|
||||||
|
///<summary>Volume, in litri, uso commerciale</summary>
|
||||||
|
public Float NetVolumeL;
|
||||||
|
|
||||||
|
///<summary>Volume, in metricubi, uso commerciale</summary>
|
||||||
|
public Float NetVolumeM3;
|
||||||
|
|
||||||
|
///<summary>Peso netto, in libbre, uso commerciale</summary>
|
||||||
|
public Float NetWeightLb;
|
||||||
|
|
||||||
|
///<summary>Lunghezza o 1° dimensione, in pollici, uso commerciale</summary>
|
||||||
|
public Float LengthI;
|
||||||
|
|
||||||
|
///<summary>Lunghezza o 1° dimensione, in piedi, uso commerciale</summary>
|
||||||
|
public Float LengthF;
|
||||||
|
|
||||||
|
///<summary>Lunghezza o 1° dimensione, in yards, uso commerciale</summary>
|
||||||
|
public Float LengthY;
|
||||||
|
|
||||||
|
///<summary>Larghezza, diametro o 2° dimensione, in pollici, uso commerciale</summary>
|
||||||
|
public Float WidthI;
|
||||||
|
|
||||||
|
///<summary>Larghezza, diametro o 2° dimensione, in piedi, uso commerciale</summary>
|
||||||
|
public Float WidthF;
|
||||||
|
|
||||||
|
///<summary>Larghezza, diametro o 2° dimensione, in yards, uso commerciale</summary>
|
||||||
|
public Float WidthY;
|
||||||
|
|
||||||
|
///<summary>Profondità, spessore, altezza o 3° dimensione, in pollici, uso commerciale</summary>
|
||||||
|
public Float HeightI;
|
||||||
|
|
||||||
|
///<summary>Profondità, spessore, altezza o 3° dimensione, in piedi, uso commerciale</summary>
|
||||||
|
public Float HeightF;
|
||||||
|
|
||||||
|
///<summary>Profondità, spessore, altezza o 3° dimensione, in yards, uso commerciale</summary>
|
||||||
|
public Float HeightY;
|
||||||
|
|
||||||
|
///<summary>Peso lordo, in Kg, uso logistico</summary>
|
||||||
|
public Float CrossweightKgLog;
|
||||||
|
|
||||||
|
///<summary>Peso lordo, in libbre, uso logistico</summary>
|
||||||
|
public Float CrossweightLbLog;
|
||||||
|
|
||||||
|
///<summary>Lunghezza o 1° dimensione, in metri, uso logistico</summary>
|
||||||
|
public Float LengthMLog;
|
||||||
|
|
||||||
|
///<summary>Larghezza, diametro o 2° dimensione, in metri, uso logistico</summary>
|
||||||
|
public Float WidthMLog;
|
||||||
|
|
||||||
|
///<summary>Profondità, spessore, altezza o 3° dimensione, in metri, uso logistico</summary>
|
||||||
|
public Float HeigthMLog;
|
||||||
|
|
||||||
|
///<summary>Superficie, in metriquadri, uso logistico</summary>
|
||||||
|
public Float AreaM2Log;
|
||||||
|
|
||||||
|
///<summary>Volume lordo, in litri, uso logistico</summary>
|
||||||
|
public Float VolumeLLog;
|
||||||
|
|
||||||
|
///<summary>Volume lordo, in metricubi, uso logistico</summary>
|
||||||
|
public Float VolumeM3Log;
|
||||||
|
|
||||||
|
///<summary>Lunghezza o 1° dimensione, in pollici, uso logistico</summary>
|
||||||
|
public Float LengthILog;
|
||||||
|
|
||||||
|
///<summary>Lunghezza o 1° dimensione, in piedi, uso logistico</summary>
|
||||||
|
public Float LengthFLog;
|
||||||
|
|
||||||
|
///<summary>Lunghezza o 1° dimensione, in yards, uso logistico</summary>
|
||||||
|
public Float LengthYLog;
|
||||||
|
|
||||||
|
///<summary>Larghezza, diametro o 2° dimensione, in pollici, uso logistico</summary>
|
||||||
|
public Float WidthILog;
|
||||||
|
|
||||||
|
///<summary>Larghezza, diametro o 2° dimensione, in piedi, uso logistico</summary>
|
||||||
|
public Float WidthFLog;
|
||||||
|
|
||||||
|
///<summary>Larghezza, diametro o 2° dimensione, in yards, uso logistico</summary>
|
||||||
|
public Float WidthYLog;
|
||||||
|
|
||||||
|
///<summary>Profondità, spessore, altezza o 3° dimensione, in pollici, uso logistico</summary>
|
||||||
|
public Float HeigthILog;
|
||||||
|
|
||||||
|
///<summary>Profondità, spessore, altezza o 3° dimensione, in piedi, uso logistico</summary>
|
||||||
|
public Float HeigthFLog;
|
||||||
|
|
||||||
|
///<summary>Profondità, spessore, altezza o 3° dimensione, in yards, uso logistico</summary>
|
||||||
|
public Float HeigthYLog;
|
||||||
|
|
||||||
|
///<summary>Superficie, in pollici quadrati, uso commerciale</summary>
|
||||||
|
public Float AreaI2;
|
||||||
|
|
||||||
|
///<summary>Superficie, in piedi quadrati, uso commerciale</summary>
|
||||||
|
public Float AreaF2;
|
||||||
|
|
||||||
|
///<summary>Superficie, in yards quadrati, uso commerciale</summary>
|
||||||
|
public Float AreaY2;
|
||||||
|
|
||||||
|
///<summary>Superficie, in pollici quadrati, uso logistico</summary>
|
||||||
|
public Float AreaI2Log;
|
||||||
|
|
||||||
|
///<summary>Superficie, in piedi quadrati, uso logistico</summary>
|
||||||
|
public Float AreaF2Log;
|
||||||
|
|
||||||
|
///<summary>Superficie, in yards quadrati, uso logistico</summary>
|
||||||
|
public Float AreaY2Log;
|
||||||
|
|
||||||
|
///<summary>Peso netto, in once troy, uso commerciale</summary>
|
||||||
|
public Float NetWeightT;
|
||||||
|
|
||||||
|
///<summary>Peso netto, in once (U.S.), uso commerciale</summary>
|
||||||
|
public Float NetVolumeOz;
|
||||||
|
|
||||||
|
///<summary>Peso netto, in quarti di gallone, uso commerciale</summary>
|
||||||
|
public Float NetVolumeLb;
|
||||||
|
|
||||||
|
///<summary>Peso netto, in galloni (U.S.), uso commerciale</summary>
|
||||||
|
public Float NetVolumeG;
|
||||||
|
|
||||||
|
///<summary>Volume lordo, in quarti di gallone, uso logistico</summary>
|
||||||
|
public Float VolumeQLog;
|
||||||
|
|
||||||
|
///<summary>Volume lordo, in galloni (U.S.), uso logistico</summary>
|
||||||
|
public Float VolumeGLog;
|
||||||
|
|
||||||
|
///<summary>Volume netto, in pollici cubi, uso commerciale</summary>
|
||||||
|
public Float NetVolumeI3;
|
||||||
|
|
||||||
|
///<summary>Volume netto, in piedi cubi, uso commerciale</summary>
|
||||||
|
public Float NetVolumeF3;
|
||||||
|
|
||||||
|
///<summary>Volume netto, in yards cubi, uso commerciale</summary>
|
||||||
|
public Float NetVolumeY3;
|
||||||
|
|
||||||
|
///<summary>Volume lordo, in pollici cubi, uso logistico</summary>
|
||||||
|
public Float VolumeI3Log;
|
||||||
|
|
||||||
|
///<summary>Volume lordo, in piedi cubi, uso logistico</summary>
|
||||||
|
public Float VolumeF3Log;
|
||||||
|
|
||||||
|
///<summary>Volume lordo, in yards cubi, uso logistico</summary>
|
||||||
|
public Float VolumeY3Log;
|
||||||
|
|
||||||
|
///<summary>Quantità prodotti contenuti in un'unità logistica</summary>
|
||||||
|
public Integer Count;
|
||||||
|
|
||||||
|
///<summary>Importo da pagare singola area monetaria</summary>
|
||||||
|
public Float Amount;
|
||||||
|
|
||||||
|
///<summary>Importo da pagare singola unità monetaria (prodotti a peso variabile)</summary>
|
||||||
|
public Float Price;
|
||||||
|
|
||||||
|
///<summary>Numero d'ordine d'acquisto cliente</summary>
|
||||||
|
public String OrderNumber;
|
||||||
|
|
||||||
|
///<summary>Numero di consegna</summary>
|
||||||
|
public String Consignment;
|
||||||
|
|
||||||
|
///<summary>Numero di spedizione</summary>
|
||||||
|
public String ShipmentNo;
|
||||||
|
|
||||||
|
///<summary>Codice di smistamento pacchi</summary>
|
||||||
|
public String Route;
|
||||||
|
|
||||||
|
///<summary>Codice di locazione EAN/UCC "Spedire a, Consegnare a"</summary>
|
||||||
|
public String ShipToLoc;
|
||||||
|
|
||||||
|
///<summary>Codice di locazione EAN/UCC "Fatturare a"</summary>
|
||||||
|
public String BillToLoc;
|
||||||
|
|
||||||
|
///<summary>Codice di locazione EAN/UCC "Acquistato da"</summary>
|
||||||
|
public String PurchaseFromLoc;
|
||||||
|
|
||||||
|
///<summary>Codice di locazione EAN/UCC "Sperdire per, Consegnare per, Inoltrare a"</summary>
|
||||||
|
public String ShipForLoc;
|
||||||
|
|
||||||
|
///<summary>Codice di locazione EAN/UCC: identificazione di una locazione fisica</summary>
|
||||||
|
public String LocationNumber;
|
||||||
|
|
||||||
|
///<summary>Codice di locazione EAN/UCC di chi emette la fattura</summary>
|
||||||
|
public String PayToLoc;
|
||||||
|
|
||||||
|
///<summary>Codice postale "Spedire a, Consegnare a" (nazionale)</summary>
|
||||||
|
public String ShipToPost;
|
||||||
|
|
||||||
|
///<summary>Paese di origine del prodotto</summary>
|
||||||
|
public String Origin;
|
||||||
|
|
||||||
|
///<summary>Paese di lavorazione con codice nazionale ISO</summary>
|
||||||
|
public String CountryProcess;
|
||||||
|
|
||||||
|
///<summary>Paese di scomposizione con codice nazionale ISO</summary>
|
||||||
|
public String CountryDisassembly;
|
||||||
|
|
||||||
|
///<summary>Paese di lavorazione completa con codice nazionale ISO</summary>
|
||||||
|
public String CountryFullProcess;
|
||||||
|
|
||||||
|
///<summary>Numero di stock NATO</summary>
|
||||||
|
public String NSN;
|
||||||
|
|
||||||
|
///<summary>Carcasse animali e classificazione dei tagli UN/ECE</summary>
|
||||||
|
public String MeatCut;
|
||||||
|
|
||||||
|
///<summary>Prodotti in rotoli - larghezza, lunghezza, diametro interno, senso di svolgimento e giunte</summary>
|
||||||
|
public String Dimensions;
|
||||||
|
|
||||||
|
///<summary>Numero sequenziale elettronico per applicazioni di telefonia cellulare</summary>
|
||||||
|
public String CmtNo;
|
||||||
|
|
||||||
|
///<summary>Numero di identificazione per beni a rendere,</summary>
|
||||||
|
public String Grai;
|
||||||
|
|
||||||
|
///<summary>Numero di identificazione globale per beni individuali</summary>
|
||||||
|
public String Giai;
|
||||||
|
|
||||||
|
///<summary>Prezzo per unità di misura</summary>
|
||||||
|
public String PricePerUnit;
|
||||||
|
|
||||||
|
///<summary>Identificazione dei componenti di un prodotto</summary>
|
||||||
|
public String Gctin;
|
||||||
|
|
||||||
|
///<summary>Numero di contocorrente bancario internazionale</summary>
|
||||||
|
public String Iban;
|
||||||
|
|
||||||
|
///<summary>Data e ora di produzione</summary>
|
||||||
|
public String ProdTime;
|
||||||
|
|
||||||
|
///<summary>Numedo Globale di Relazione di Servizio</summary>
|
||||||
|
public String Gsrn;
|
||||||
|
|
||||||
|
///<summary>Numero del bollettino di pagamento</summary>
|
||||||
|
public String RefNo;
|
||||||
|
|
||||||
|
///<summary>Codice esteso per i coupons, UCC</summary>
|
||||||
|
public String Coupon1;
|
||||||
|
|
||||||
|
///<summary>Codice esteso per i coupons, UCC</summary>
|
||||||
|
public String Coupon2;
|
||||||
|
|
||||||
|
///<summary>Codice esteso per i coupons, UCC</summary>
|
||||||
|
public String Coupon3;
|
||||||
|
|
||||||
|
///<summary>Informazioni concordate tra i partners commerciali</summary>
|
||||||
|
public String InternalPart;
|
||||||
|
|
||||||
|
///<summary>Informazioni interne</summary>
|
||||||
|
public String Internal1;
|
||||||
|
|
||||||
|
///<summary>Informazioni interne</summary>
|
||||||
|
public String Internal2;
|
||||||
|
|
||||||
|
///<summary>Informazioni interne</summary>
|
||||||
|
public String Internal3;
|
||||||
|
|
||||||
|
///<summary>Informazioni interne</summary>
|
||||||
|
public String Internal4;
|
||||||
|
|
||||||
|
///<summary>Informazioni interne</summary>
|
||||||
|
public String Internal5;
|
||||||
|
|
||||||
|
///<summary>Informazioni interne</summary>
|
||||||
|
public String Internal6;
|
||||||
|
|
||||||
|
///<summary>Informazioni interne</summary>
|
||||||
|
public String Internal7;
|
||||||
|
|
||||||
|
///<summary>Informazioni interne</summary>
|
||||||
|
public String Internal8;
|
||||||
|
|
||||||
|
///<summary>Informazioni interne</summary>
|
||||||
|
public String Internal9;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.model;
|
||||||
|
|
||||||
|
public class Ean13PesoModel {
|
||||||
|
|
||||||
|
private String precode;
|
||||||
|
private Float peso;
|
||||||
|
|
||||||
|
public String getPrecode() {
|
||||||
|
return precode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ean13PesoModel setPrecode(String precode) {
|
||||||
|
this.precode = precode;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Float getPeso() {
|
||||||
|
return peso;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ean13PesoModel setPeso(Float peso) {
|
||||||
|
this.peso = peso;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ean128Model toEan128() {
|
||||||
|
Ean128Model ean128Model = new Ean128Model();
|
||||||
|
ean128Model.NetWeightKg = getPeso();
|
||||||
|
|
||||||
|
return ean128Model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Ean13PesoModel fromBarcode(String barcode) throws Exception {
|
||||||
|
if(barcode == null || barcode.length() != 13) {
|
||||||
|
throw new Exception("Errore durante il parse del barcode (" + barcode + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
String precode = barcode.substring(1, 7);
|
||||||
|
String pesoString = barcode.substring(7, barcode.length() - 1);
|
||||||
|
|
||||||
|
Float pesoFloat = Integer.parseInt(pesoString) / (float) 1000;
|
||||||
|
|
||||||
|
return new Ean13PesoModel()
|
||||||
|
.setPrecode(precode)
|
||||||
|
.setPeso(pesoFloat);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.model;
|
||||||
|
|
||||||
|
public class GestSetupDTO {
|
||||||
|
|
||||||
|
public String value;
|
||||||
|
}
|
||||||
@ -0,0 +1,115 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.model;
|
||||||
|
|
||||||
|
public class MailRequestDTO {
|
||||||
|
|
||||||
|
private String from;
|
||||||
|
private String fromName;
|
||||||
|
private String to;
|
||||||
|
private String replyTo;
|
||||||
|
private String replyToName;
|
||||||
|
private String cc;
|
||||||
|
private String ccn;
|
||||||
|
private String subject;
|
||||||
|
private String msgText;
|
||||||
|
private boolean isHtml = false;
|
||||||
|
private boolean isDebug = false;
|
||||||
|
|
||||||
|
public String getFrom() {
|
||||||
|
return from;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MailRequestDTO setFrom(String from) {
|
||||||
|
this.from = from;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFromName() {
|
||||||
|
return fromName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MailRequestDTO setFromName(String fromName) {
|
||||||
|
this.fromName = fromName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTo() {
|
||||||
|
return to;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MailRequestDTO setTo(String to) {
|
||||||
|
this.to = to;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReplyTo() {
|
||||||
|
return replyTo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MailRequestDTO setReplyTo(String replyTo) {
|
||||||
|
this.replyTo = replyTo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReplyToName() {
|
||||||
|
return replyToName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MailRequestDTO setReplyToName(String replyToName) {
|
||||||
|
this.replyToName = replyToName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCc() {
|
||||||
|
return cc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MailRequestDTO setCc(String cc) {
|
||||||
|
this.cc = cc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCcn() {
|
||||||
|
return ccn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MailRequestDTO setCcn(String ccn) {
|
||||||
|
this.ccn = ccn;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubject() {
|
||||||
|
return subject;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MailRequestDTO setSubject(String subject) {
|
||||||
|
this.subject = subject;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsgText() {
|
||||||
|
return msgText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MailRequestDTO setMsgText(String msgText) {
|
||||||
|
this.msgText = msgText;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isHtml() {
|
||||||
|
return isHtml;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MailRequestDTO setHtml(boolean html) {
|
||||||
|
isHtml = html;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDebug() {
|
||||||
|
return isDebug;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MailRequestDTO setDebug(boolean debug) {
|
||||||
|
isDebug = debug;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.model;
|
||||||
|
|
||||||
|
public class NativeSqlRequestDTO {
|
||||||
|
|
||||||
|
public String nativeSql;
|
||||||
|
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.REST.model;
|
|||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by GiuseppeS on 06/03/2018.
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
@ -17,6 +18,7 @@ public class ServiceRESTResponse<T> {
|
|||||||
|
|
||||||
private T dto;
|
private T dto;
|
||||||
private T entity;
|
private T entity;
|
||||||
|
private List<T> entityList;
|
||||||
|
|
||||||
public EsitoType getEsito() {
|
public EsitoType getEsito() {
|
||||||
return EsitoType.fromIntValue(esito);
|
return EsitoType.fromIntValue(esito);
|
||||||
@ -25,7 +27,7 @@ public class ServiceRESTResponse<T> {
|
|||||||
public Date getExecDate() {
|
public Date getExecDate() {
|
||||||
try {
|
try {
|
||||||
return new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse(execDate);
|
return new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse(execDate);
|
||||||
} catch (ParseException e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -46,4 +48,8 @@ public class ServiceRESTResponse<T> {
|
|||||||
public T getEntity() {
|
public T getEntity() {
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<T> getEntityList() {
|
||||||
|
return entityList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,64 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.watcher;
|
||||||
|
|
||||||
|
import android.os.Handler;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.consumers.ISingleValueOperationCallback;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityServer;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
|
||||||
|
public class ServerStatusChecker {
|
||||||
|
|
||||||
|
private static ServerStatusChecker istance = new ServerStatusChecker();
|
||||||
|
|
||||||
|
private List<ISingleValueOperationCallback<Boolean>> mCallback = new ArrayList<>();
|
||||||
|
|
||||||
|
private ISingleValueOperationCallback<Boolean> mInternalCallback = value -> {
|
||||||
|
for (ISingleValueOperationCallback callback : mCallback) {
|
||||||
|
callback.onResult(value);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private boolean shouldExecute = true;
|
||||||
|
private final long MILLIS_DELAY = 5 * 1000;
|
||||||
|
|
||||||
|
|
||||||
|
private Handler handler = new Handler();
|
||||||
|
private Runnable runnableCode = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if(shouldExecute && !UtilityString.isNullOrEmpty(SettingsManager.i().server.host)) {
|
||||||
|
UtilityServer.isHostReachable(SettingsManager.i().server.host, SettingsManager.i().server.port, mInternalCallback);
|
||||||
|
handler.postDelayed(this, MILLIS_DELAY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public void addCallback(ISingleValueOperationCallback<Boolean> callback){
|
||||||
|
this.mCallback.add(callback);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeCallback(ISingleValueOperationCallback<Boolean> callback){
|
||||||
|
this.mCallback.remove(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void init(){
|
||||||
|
istance.shouldExecute = true;
|
||||||
|
|
||||||
|
istance.handler.post(istance.runnableCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void dispose() {
|
||||||
|
istance.shouldExecute = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ServerStatusChecker getIstance() {
|
||||||
|
return istance;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package it.integry.integrywmsnative.core.barcode_reader;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.plugins.barcode_base_library.model.BarcodeScanDTO;
|
||||||
|
|
||||||
|
public class BarcodeCallbackDTO {
|
||||||
|
|
||||||
|
private int ID = -1;
|
||||||
|
|
||||||
|
private RunnableArgs<BarcodeScanDTO> onScanSuccessfull;
|
||||||
|
private RunnableArgs<Exception> onScanFailed;
|
||||||
|
|
||||||
|
public int getID() {
|
||||||
|
return ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BarcodeCallbackDTO setID(int ID) {
|
||||||
|
this.ID = ID;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<BarcodeScanDTO> getOnScanSuccessfull() {
|
||||||
|
return onScanSuccessfull;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BarcodeCallbackDTO setOnScanSuccessfull(RunnableArgs<BarcodeScanDTO> onScanSuccessfull) {
|
||||||
|
this.onScanSuccessfull = onScanSuccessfull;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<Exception> getOnScanFailed() {
|
||||||
|
return onScanFailed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BarcodeCallbackDTO setOnScanFailed(RunnableArgs<Exception> onScanFailed) {
|
||||||
|
this.onScanFailed = onScanFailed;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,137 @@
|
|||||||
|
package it.integry.integrywmsnative.core.barcode_reader;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
|
||||||
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
||||||
|
import it.integry.plugins.barcode_base_library.exception.BarcodeAdapterNotFoundException;
|
||||||
|
import it.integry.plugins.barcode_base_library.interfaces.BarcodeReaderInterface;
|
||||||
|
import it.integry.pointmobilescannerlibrary.PointMobileBarcodeReader;
|
||||||
|
|
||||||
|
public class BarcodeManager {
|
||||||
|
|
||||||
|
private static Context context;
|
||||||
|
|
||||||
|
private static BarcodeReaderInterface mCurrentBarcodeInterface;
|
||||||
|
private static List<BarcodeCallbackDTO> mBarcodeCallbacksStacktrace = new ArrayList<>();
|
||||||
|
|
||||||
|
private static boolean mEnabled = true;
|
||||||
|
|
||||||
|
|
||||||
|
private static Class<? extends BarcodeReaderInterface>[] registeredBarcodeReaderInterfaces = new Class[]{
|
||||||
|
PointMobileBarcodeReader.class
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
public static void init(Context context) {
|
||||||
|
BarcodeManager.context = context;
|
||||||
|
|
||||||
|
initBarcodeReader();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initBarcodeReader() {
|
||||||
|
|
||||||
|
for (Class<? extends BarcodeReaderInterface> readerInterface : registeredBarcodeReaderInterfaces){
|
||||||
|
|
||||||
|
Constructor<?> cons = null;
|
||||||
|
try {
|
||||||
|
cons = Class.forName(readerInterface.getName()).getConstructors()[0];
|
||||||
|
BarcodeReaderInterface object = (BarcodeReaderInterface) cons.newInstance(context);
|
||||||
|
|
||||||
|
if(object.isRightAdapter()) {
|
||||||
|
mCurrentBarcodeInterface = object;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
UtilityLogger.errorMe(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mCurrentBarcodeInterface != null) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
mCurrentBarcodeInterface.init();
|
||||||
|
} catch (BarcodeAdapterNotFoundException ex) {
|
||||||
|
UtilityExceptions.defaultException(context, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
mCurrentBarcodeInterface.register(data -> {
|
||||||
|
BarcodeCallbackDTO callback = getValidCallback();
|
||||||
|
if(callback != null && mEnabled) {
|
||||||
|
callback.getOnScanSuccessfull().run(data);
|
||||||
|
}
|
||||||
|
}, ex -> {
|
||||||
|
BarcodeCallbackDTO callback = getValidCallback();
|
||||||
|
if(callback != null && mEnabled) {
|
||||||
|
callback.getOnScanFailed().run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static BarcodeCallbackDTO getValidCallback() {
|
||||||
|
|
||||||
|
if(mBarcodeCallbacksStacktrace.size() > 0) {
|
||||||
|
return mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() -1);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BarcodeReaderInterface getCurrentBarcodeInterface() {
|
||||||
|
return mCurrentBarcodeInterface;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int addCallback(BarcodeCallbackDTO barcodeCallbackDTO) {
|
||||||
|
|
||||||
|
int newID = -1;
|
||||||
|
|
||||||
|
if(mBarcodeCallbacksStacktrace.size() > 0) {
|
||||||
|
newID = mBarcodeCallbacksStacktrace.get(mBarcodeCallbacksStacktrace.size() -1).getID() + 1;
|
||||||
|
} else {
|
||||||
|
newID = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
barcodeCallbackDTO.setID(newID);
|
||||||
|
mBarcodeCallbacksStacktrace.add(barcodeCallbackDTO);
|
||||||
|
|
||||||
|
return newID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void removeCallback(int ID) {
|
||||||
|
boolean callbackObjFound = false;
|
||||||
|
|
||||||
|
//Rimuovo la callback con l'ID trovato e tutte quelle con >ID in modo che rimuovo tutte le call aggiunte successivamente
|
||||||
|
|
||||||
|
for (int i = 0; i < mBarcodeCallbacksStacktrace.size(); i++) {
|
||||||
|
if(mBarcodeCallbacksStacktrace.get(i).getID() == ID || callbackObjFound) {
|
||||||
|
mBarcodeCallbacksStacktrace.remove(i);
|
||||||
|
|
||||||
|
callbackObjFound = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void disable() {
|
||||||
|
mEnabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void enable() {
|
||||||
|
mEnabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,8 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.di;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by GiuseppeS on 06/03/2018.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class AppComponent {
|
|
||||||
}
|
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di;
|
||||||
|
|
||||||
|
import android.databinding.BaseObservable;
|
||||||
|
|
||||||
|
import org.parceler.Parcel;
|
||||||
|
|
||||||
|
@Parcel
|
||||||
|
public class BindableBoolean extends BaseObservable {
|
||||||
|
boolean mValue;
|
||||||
|
|
||||||
|
public BindableBoolean() {}
|
||||||
|
|
||||||
|
public BindableBoolean(boolean startValue) {
|
||||||
|
this.mValue = startValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean get() {
|
||||||
|
return mValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(boolean value) {
|
||||||
|
if (mValue != value) {
|
||||||
|
this.mValue = value;
|
||||||
|
notifyChange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di;
|
||||||
|
|
||||||
|
import android.databinding.BaseObservable;
|
||||||
|
|
||||||
|
import org.parceler.Parcel;
|
||||||
|
|
||||||
|
@Parcel
|
||||||
|
public class BindableFloat extends BaseObservable {
|
||||||
|
Float value;
|
||||||
|
|
||||||
|
public Float get() {
|
||||||
|
return get(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Float get(boolean defaultIfNull) {
|
||||||
|
|
||||||
|
if(value == null){
|
||||||
|
if(defaultIfNull) return 0f;
|
||||||
|
else return null;
|
||||||
|
} else return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(Float value) {
|
||||||
|
if (!Objects.equals(this.value, value)) {
|
||||||
|
this.value = value;
|
||||||
|
notifyChange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return value == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di;
|
||||||
|
|
||||||
|
import android.databinding.BaseObservable;
|
||||||
|
|
||||||
|
import org.parceler.Parcel;
|
||||||
|
|
||||||
|
@Parcel
|
||||||
|
public class BindableInteger extends BaseObservable {
|
||||||
|
Integer value;
|
||||||
|
|
||||||
|
public Integer get() {
|
||||||
|
return get(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer get(boolean defaultIfNull) {
|
||||||
|
|
||||||
|
if(value == null){
|
||||||
|
if(defaultIfNull) return 0;
|
||||||
|
else return null;
|
||||||
|
} else return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(Integer value) {
|
||||||
|
if (!Objects.equals(this.value, value)) {
|
||||||
|
this.value = value;
|
||||||
|
notifyChange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return value == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di;
|
||||||
|
|
||||||
|
import android.databinding.BaseObservable;
|
||||||
|
import android.databinding.Observable;
|
||||||
|
|
||||||
|
import org.parceler.Parcel;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
|
||||||
|
@Parcel
|
||||||
|
public class BindableString extends BaseObservable {
|
||||||
|
String value;
|
||||||
|
|
||||||
|
public String get() {
|
||||||
|
return value != null ? value : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(String value) {
|
||||||
|
if (!Objects.equals(this.value, value)) {
|
||||||
|
this.value = value;
|
||||||
|
notifyChange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return value == null || value.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void refresh() {
|
||||||
|
notifyChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void registerListener(BindableString bindableString, RunnableArgs<String> onValueChanged) {
|
||||||
|
bindableString.addOnPropertyChangedCallback(new OnPropertyChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||||
|
if(onValueChanged != null) onValueChanged.run(bindableString.get());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void resetListeners(BindableString bindableString){
|
||||||
|
String oldValue = bindableString.get();
|
||||||
|
bindableString = new BindableString();
|
||||||
|
bindableString.set(oldValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,180 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di;
|
||||||
|
|
||||||
|
import android.databinding.BindingAdapter;
|
||||||
|
import android.databinding.BindingConversion;
|
||||||
|
import android.support.constraint.Guideline;
|
||||||
|
import android.support.design.widget.TextInputEditText;
|
||||||
|
import android.support.v4.util.Pair;
|
||||||
|
import android.support.v7.widget.AppCompatCheckBox;
|
||||||
|
import android.support.v7.widget.AppCompatTextView;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.RadioButton;
|
||||||
|
import android.widget.RadioGroup;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.text.DecimalFormatSymbols;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
|
||||||
|
public class Converters {
|
||||||
|
|
||||||
|
@BindingConversion
|
||||||
|
public static String convertBindableToString(BindableString bindableString) {
|
||||||
|
return bindableString.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@BindingConversion
|
||||||
|
public static boolean convertBindableToBoolean(BindableBoolean bindableBoolean) {
|
||||||
|
return bindableBoolean.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@BindingAdapter("app:binding")
|
||||||
|
public static void bindEditText(EditText view, final BindableString bindableString) {
|
||||||
|
Pair<BindableString, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
|
if (pair == null || pair.first != bindableString) {
|
||||||
|
if (pair != null) {
|
||||||
|
view.removeTextChangedListener(pair.second);
|
||||||
|
}
|
||||||
|
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||||
|
@Override public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
bindableString.set(s.toString());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
view.setTag(R.id.bound_observable, new Pair<>(bindableString, watcher));
|
||||||
|
view.addTextChangedListener(watcher);
|
||||||
|
}
|
||||||
|
String newValue = bindableString.get();
|
||||||
|
if (!view.getText().toString().equals(newValue)) {
|
||||||
|
view.setText(newValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@BindingAdapter("app:binding")
|
||||||
|
public static void bindTextInputEditText(TextInputEditText view, final BindableString bindableString) {
|
||||||
|
Pair<BindableString, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
|
if (pair == null || pair.first != bindableString) {
|
||||||
|
if (pair != null) {
|
||||||
|
view.removeTextChangedListener(pair.second);
|
||||||
|
}
|
||||||
|
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||||
|
@Override public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
bindableString.set(s.toString());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
view.setTag(R.id.bound_observable, new Pair<>(bindableString, watcher));
|
||||||
|
view.addTextChangedListener(watcher);
|
||||||
|
}
|
||||||
|
String newValue = bindableString.get();
|
||||||
|
if (!view.getText().toString().equals(newValue)) {
|
||||||
|
view.setText(newValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@BindingAdapter("app:binding")
|
||||||
|
public static void bindTextView(AppCompatTextView view, final BindableString bindableString) {
|
||||||
|
Pair<BindableString, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
|
if (pair == null || pair.first != bindableString) {
|
||||||
|
if (pair != null) {
|
||||||
|
view.removeTextChangedListener(pair.second);
|
||||||
|
}
|
||||||
|
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||||
|
@Override public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
bindableString.set(s.toString());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
view.setTag(R.id.bound_observable, new Pair<>(bindableString, watcher));
|
||||||
|
view.addTextChangedListener(watcher);
|
||||||
|
}
|
||||||
|
String newValue = bindableString.get();
|
||||||
|
if (!view.getText().toString().equals(newValue)) {
|
||||||
|
view.setText(newValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@BindingAdapter("app:binding")
|
||||||
|
public static void bindTextInputEditText(TextInputEditText view, final BindableFloat bindableFloat) {
|
||||||
|
DecimalFormatSymbols otherSymbols = new DecimalFormatSymbols(Locale.getDefault());
|
||||||
|
otherSymbols.setDecimalSeparator('.');
|
||||||
|
otherSymbols.setGroupingSeparator(',');
|
||||||
|
|
||||||
|
|
||||||
|
final DecimalFormat decimalFormat = new DecimalFormat();
|
||||||
|
decimalFormat.setMaximumFractionDigits(2);
|
||||||
|
decimalFormat.setDecimalFormatSymbols(otherSymbols);
|
||||||
|
|
||||||
|
Pair<BindableFloat, TextWatcherAdapter> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
|
if (pair == null || pair.first != bindableFloat) {
|
||||||
|
if (pair != null) {
|
||||||
|
view.removeTextChangedListener(pair.second);
|
||||||
|
}
|
||||||
|
TextWatcherAdapter watcher = new TextWatcherAdapter() {
|
||||||
|
@Override public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
try {
|
||||||
|
if(s.toString().trim().isEmpty()){
|
||||||
|
bindableFloat.set(null);
|
||||||
|
} else bindableFloat.set(decimalFormat.parse(s.toString()).floatValue());
|
||||||
|
} catch (Exception ex){
|
||||||
|
Log.e("FloatFormat", ex.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
view.setTag(R.id.bound_observable, new Pair<>(bindableFloat, watcher));
|
||||||
|
view.addTextChangedListener(watcher);
|
||||||
|
}
|
||||||
|
|
||||||
|
Float newValue = bindableFloat.get();
|
||||||
|
if (!view.getText().toString().equals(decimalFormat.format(newValue))) {
|
||||||
|
|
||||||
|
view.setText(decimalFormat.format(newValue));
|
||||||
|
view.setSelection(view.getText().toString().length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@BindingAdapter("app:binding")
|
||||||
|
public static void bindRadioGroup(RadioGroup view, final BindableBoolean bindableBoolean) {
|
||||||
|
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||||
|
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||||
|
view.setOnCheckedChangeListener((group, checkedId) -> bindableBoolean.set(checkedId == group.getChildAt(1).getId()));
|
||||||
|
}
|
||||||
|
Boolean newValue = bindableBoolean.get();
|
||||||
|
((RadioButton) view.getChildAt(newValue ? 1 : 0)).setChecked(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@BindingAdapter("app:checked")
|
||||||
|
public static void bindCheckbox(AppCompatCheckBox view, final BindableBoolean bindableBoolean) {
|
||||||
|
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||||
|
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||||
|
view.setOnCheckedChangeListener((compoundButton, b) -> {
|
||||||
|
bindableBoolean.set(b);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Boolean newValue = bindableBoolean.get();
|
||||||
|
view.setChecked(newValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
@BindingAdapter("app:checked")
|
||||||
|
public static void bindCheckbox(CheckBox view, final BindableBoolean bindableBoolean) {
|
||||||
|
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||||
|
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||||
|
view.setOnCheckedChangeListener((compoundButton, b) -> bindableBoolean.set(b));
|
||||||
|
}
|
||||||
|
Boolean newValue = bindableBoolean.get();
|
||||||
|
view.setChecked(newValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
@BindingAdapter({"app:onClick"})
|
||||||
|
public static void bindOnClick(View view, final Runnable runnable) {
|
||||||
|
view.setOnClickListener(v -> runnable.run());
|
||||||
|
}
|
||||||
|
|
||||||
|
@BindingAdapter({"app:layout_constraintGuide_percent"})
|
||||||
|
public static void bindFloatPercetageOnGuideline(View view, final float percentage) {
|
||||||
|
((Guideline)view).setGuidelinePercent(percentage);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di;
|
||||||
|
|
||||||
|
public class Objects {
|
||||||
|
public static boolean equals(Object a, Object b) {
|
||||||
|
return (a == b) || (a != null && a.equals(b));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di;
|
||||||
|
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.text.TextWatcher;
|
||||||
|
|
||||||
|
public class TextWatcherAdapter implements TextWatcher
|
||||||
|
{
|
||||||
|
public void afterTextChanged(Editable editable)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di.binders;
|
||||||
|
|
||||||
|
import android.databinding.BindingAdapter;
|
||||||
|
import android.support.design.widget.TextInputEditText;
|
||||||
|
import android.support.v4.util.Pair;
|
||||||
|
|
||||||
|
import net.cachapa.expandablelayout.ExpandableLayout;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
|
||||||
|
public class ExpandableLayoutBinders {
|
||||||
|
|
||||||
|
@BindingAdapter("app:el_expanded_bind")
|
||||||
|
public static void bindExpandableLayout(final ExpandableLayout view, final BindableBoolean bindableBoolean) {
|
||||||
|
|
||||||
|
Pair<BindableBoolean, ExpandableLayout.OnExpansionUpdateListener> pair = (Pair) view.getTag(R.id.bound_observable);
|
||||||
|
if (pair == null || pair.first != bindableBoolean) {
|
||||||
|
if (pair != null) {
|
||||||
|
view.setOnExpansionUpdateListener(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
ExpandableLayout.OnExpansionUpdateListener watcher = new ExpandableLayout.OnExpansionUpdateListener() {
|
||||||
|
@Override
|
||||||
|
public void onExpansionUpdate(float expansionFraction, int state) {
|
||||||
|
if(view.isExpanded() == bindableBoolean.get()) return;
|
||||||
|
bindableBoolean.set(state == 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
view.setTag(R.id.bound_observable, new Pair<>(bindableBoolean, watcher));
|
||||||
|
view.setOnExpansionUpdateListener(watcher);
|
||||||
|
}
|
||||||
|
boolean newValue = bindableBoolean.get();
|
||||||
|
if (!view.isExpanded() == newValue) {
|
||||||
|
if(newValue) view.expand(true);
|
||||||
|
else view.collapse(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di.binders;
|
||||||
|
|
||||||
|
import android.databinding.BindingAdapter;
|
||||||
|
import android.databinding.ObservableArrayList;
|
||||||
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class RecyclerViewAdapterBinders {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// @BindingAdapter("app:adapter")
|
||||||
|
// public static void setItems(RecyclerView recyclerView, Class clazz) {
|
||||||
|
// setItems(recyclerView, null, clazz);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @BindingAdapter("app:items")
|
||||||
|
// public static <T> void setItems(RecyclerView recyclerView, ObservableArrayList<T> entries) {
|
||||||
|
// setItems(recyclerView, entries, null);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @BindingAdapter({"app:items", "app:adapter"})
|
||||||
|
// public static <T> void setItems(RecyclerView recyclerView,
|
||||||
|
// ObservableArrayList<T> entries, Class clazz) {
|
||||||
|
//
|
||||||
|
//// recyclerView.removeAllViews();
|
||||||
|
//// if (entries != null) {
|
||||||
|
//// LayoutInflater inflater = (LayoutInflater)
|
||||||
|
//// viewGroup.getContext()
|
||||||
|
//// .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
//// for (int i = 0; i < entries.size(); i++) {
|
||||||
|
//// T entry = entries.get(i);
|
||||||
|
//// ViewDataBinding bindings = DataBindingUtil
|
||||||
|
//// .inflate(inflater, layoutId, viewGroup, true);
|
||||||
|
//// bindings.setVariable(BR.data, entry);
|
||||||
|
//// }
|
||||||
|
//// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di.binders;
|
||||||
|
|
||||||
|
import android.databinding.BindingAdapter;
|
||||||
|
import android.support.design.widget.TextInputLayout;
|
||||||
|
|
||||||
|
public class TextInputLayoutBinders {
|
||||||
|
|
||||||
|
@BindingAdapter("app:errorText")
|
||||||
|
public static void setErrorMessage(TextInputLayout view, String errorMessage) {
|
||||||
|
view.setError(errorMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,216 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di.binders.recyclerview;
|
||||||
|
|
||||||
|
import android.databinding.DataBindingUtil;
|
||||||
|
import android.databinding.ObservableArrayList;
|
||||||
|
import android.databinding.ObservableList;
|
||||||
|
import android.databinding.ViewDataBinding;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
public class BindingRecyclerViewAdapter<T> extends RecyclerView.Adapter<BindingRecyclerViewAdapter.ViewHolder> implements View.OnClickListener, View.OnLongClickListener
|
||||||
|
{
|
||||||
|
private static final int ITEM_MODEL = -124;
|
||||||
|
private final WeakReferenceOnListChangedCallback onListChangedCallback;
|
||||||
|
private final ItemBinder<T> itemBinder;
|
||||||
|
private ObservableList<T> items;
|
||||||
|
private LayoutInflater inflater;
|
||||||
|
private ClickHandler<T> clickHandler;
|
||||||
|
private LongClickHandler<T> longClickHandler;
|
||||||
|
|
||||||
|
public BindingRecyclerViewAdapter(ItemBinder<T> itemBinder, @Nullable Collection<T> items)
|
||||||
|
{
|
||||||
|
this.itemBinder = itemBinder;
|
||||||
|
this.onListChangedCallback = new WeakReferenceOnListChangedCallback<>(this);
|
||||||
|
setItems(items);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableList<T> getItems()
|
||||||
|
{
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItems(@Nullable Collection<T> items)
|
||||||
|
{
|
||||||
|
if (this.items == items)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.items != null)
|
||||||
|
{
|
||||||
|
this.items.removeOnListChangedCallback(onListChangedCallback);
|
||||||
|
notifyItemRangeRemoved(0, this.items.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (items instanceof ObservableList)
|
||||||
|
{
|
||||||
|
this.items = (ObservableList<T>) items;
|
||||||
|
notifyItemRangeInserted(0, this.items.size());
|
||||||
|
this.items.addOnListChangedCallback(onListChangedCallback);
|
||||||
|
}
|
||||||
|
else if (items != null)
|
||||||
|
{
|
||||||
|
this.items = new ObservableArrayList<>();
|
||||||
|
this.items.addOnListChangedCallback(onListChangedCallback);
|
||||||
|
this.items.addAll(items);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.items = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDetachedFromRecyclerView(RecyclerView recyclerView)
|
||||||
|
{
|
||||||
|
if (items != null)
|
||||||
|
{
|
||||||
|
items.removeOnListChangedCallback(onListChangedCallback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int layoutId)
|
||||||
|
{
|
||||||
|
if (inflater == null)
|
||||||
|
{
|
||||||
|
inflater = LayoutInflater.from(viewGroup.getContext());
|
||||||
|
}
|
||||||
|
|
||||||
|
ViewDataBinding binding = DataBindingUtil.inflate(inflater, layoutId, viewGroup, false);
|
||||||
|
return new ViewHolder(binding);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(ViewHolder viewHolder, int position)
|
||||||
|
{
|
||||||
|
final T item = items.get(position);
|
||||||
|
viewHolder.binding.setVariable(itemBinder.getBindingVariable(item), item);
|
||||||
|
viewHolder.binding.getRoot().setTag(ITEM_MODEL, item);
|
||||||
|
viewHolder.binding.getRoot().setOnClickListener(this);
|
||||||
|
viewHolder.binding.getRoot().setOnLongClickListener(this);
|
||||||
|
viewHolder.binding.executePendingBindings();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemViewType(int position)
|
||||||
|
{
|
||||||
|
return itemBinder.getLayoutRes(items.get(position));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount()
|
||||||
|
{
|
||||||
|
return items == null ? 0 : items.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v)
|
||||||
|
{
|
||||||
|
if (clickHandler != null)
|
||||||
|
{
|
||||||
|
T item = (T) v.getTag(ITEM_MODEL);
|
||||||
|
clickHandler.onClick(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onLongClick(View v)
|
||||||
|
{
|
||||||
|
if (longClickHandler != null)
|
||||||
|
{
|
||||||
|
T item = (T) v.getTag(ITEM_MODEL);
|
||||||
|
longClickHandler.onLongClick(item);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ViewHolder extends RecyclerView.ViewHolder
|
||||||
|
{
|
||||||
|
final ViewDataBinding binding;
|
||||||
|
|
||||||
|
ViewHolder(ViewDataBinding binding)
|
||||||
|
{
|
||||||
|
super(binding.getRoot());
|
||||||
|
this.binding = binding;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class WeakReferenceOnListChangedCallback<T> extends ObservableList.OnListChangedCallback
|
||||||
|
{
|
||||||
|
|
||||||
|
private final WeakReference<BindingRecyclerViewAdapter<T>> adapterReference;
|
||||||
|
|
||||||
|
public WeakReferenceOnListChangedCallback(BindingRecyclerViewAdapter<T> bindingRecyclerViewAdapter)
|
||||||
|
{
|
||||||
|
this.adapterReference = new WeakReference<>(bindingRecyclerViewAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onChanged(ObservableList sender)
|
||||||
|
{
|
||||||
|
RecyclerView.Adapter adapter = adapterReference.get();
|
||||||
|
if (adapter != null)
|
||||||
|
{
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemRangeChanged(ObservableList sender, int positionStart, int itemCount)
|
||||||
|
{
|
||||||
|
RecyclerView.Adapter adapter = adapterReference.get();
|
||||||
|
if (adapter != null)
|
||||||
|
{
|
||||||
|
adapter.notifyItemRangeChanged(positionStart, itemCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemRangeInserted(ObservableList sender, int positionStart, int itemCount)
|
||||||
|
{
|
||||||
|
RecyclerView.Adapter adapter = adapterReference.get();
|
||||||
|
if (adapter != null)
|
||||||
|
{
|
||||||
|
adapter.notifyItemRangeInserted(positionStart, itemCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemRangeMoved(ObservableList sender, int fromPosition, int toPosition, int itemCount)
|
||||||
|
{
|
||||||
|
RecyclerView.Adapter adapter = adapterReference.get();
|
||||||
|
if (adapter != null)
|
||||||
|
{
|
||||||
|
adapter.notifyItemMoved(fromPosition, toPosition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemRangeRemoved(ObservableList sender, int positionStart, int itemCount)
|
||||||
|
{
|
||||||
|
RecyclerView.Adapter adapter = adapterReference.get();
|
||||||
|
if (adapter != null)
|
||||||
|
{
|
||||||
|
adapter.notifyItemRangeRemoved(positionStart, itemCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClickHandler(ClickHandler<T> clickHandler)
|
||||||
|
{
|
||||||
|
this.clickHandler = clickHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLongClickHandler(LongClickHandler<T> clickHandler)
|
||||||
|
{
|
||||||
|
this.longClickHandler = clickHandler;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di.binders.recyclerview;
|
||||||
|
|
||||||
|
public interface ClickHandler<T>
|
||||||
|
{
|
||||||
|
void onClick(T viewModel);
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di.binders.recyclerview;
|
||||||
|
|
||||||
|
public interface ItemBinder<T>
|
||||||
|
{
|
||||||
|
int getLayoutRes(T model);
|
||||||
|
int getBindingVariable(T model);
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di.binders.recyclerview;
|
||||||
|
|
||||||
|
public class ItemBinderBase<T> implements ItemBinder<T>
|
||||||
|
{
|
||||||
|
protected final int bindingVariable;
|
||||||
|
protected final int layoutId;
|
||||||
|
|
||||||
|
public ItemBinderBase(int bindingVariable, int layoutId)
|
||||||
|
{
|
||||||
|
this.bindingVariable = bindingVariable;
|
||||||
|
this.layoutId = layoutId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLayoutRes(T model)
|
||||||
|
{
|
||||||
|
return layoutId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBindingVariable(T model)
|
||||||
|
{
|
||||||
|
return bindingVariable;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di.binders.recyclerview;
|
||||||
|
|
||||||
|
public interface LongClickHandler<T>
|
||||||
|
{
|
||||||
|
void onLongClick(T viewModel);
|
||||||
|
}
|
||||||
@ -0,0 +1,73 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di.binders.recyclerview;
|
||||||
|
|
||||||
|
import android.databinding.BindingAdapter;
|
||||||
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
public class RecyclerViewBindings {
|
||||||
|
|
||||||
|
private static final int KEY_ITEMS = -123;
|
||||||
|
private static final int KEY_CLICK_HANDLER = -124;
|
||||||
|
private static final int KEY_LONG_CLICK_HANDLER = -125;
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@BindingAdapter("items")
|
||||||
|
public static <T> void setItems(RecyclerView recyclerView, Collection<T> items)
|
||||||
|
{
|
||||||
|
BindingRecyclerViewAdapter<T> adapter = (BindingRecyclerViewAdapter<T>) recyclerView.getAdapter();
|
||||||
|
if (adapter != null)
|
||||||
|
{
|
||||||
|
adapter.setItems(items);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
recyclerView.setTag(KEY_ITEMS, items);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@BindingAdapter("clickHandler")
|
||||||
|
public static <T> void setHandler(RecyclerView recyclerView, ClickHandler<T> handler)
|
||||||
|
{
|
||||||
|
BindingRecyclerViewAdapter<T> adapter = (BindingRecyclerViewAdapter<T>) recyclerView.getAdapter();
|
||||||
|
if (adapter != null)
|
||||||
|
{
|
||||||
|
adapter.setClickHandler(handler);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
recyclerView.setTag(KEY_CLICK_HANDLER, handler);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@BindingAdapter("longClickHandler")
|
||||||
|
public static <T> void setHandler(RecyclerView recyclerView, LongClickHandler<T> handler)
|
||||||
|
{
|
||||||
|
BindingRecyclerViewAdapter<T> adapter = (BindingRecyclerViewAdapter<T>) recyclerView.getAdapter();
|
||||||
|
if (adapter != null)
|
||||||
|
{
|
||||||
|
adapter.setLongClickHandler(handler);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
recyclerView.setTag(KEY_LONG_CLICK_HANDLER, handler);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@BindingAdapter("itemViewBinder")
|
||||||
|
public static <T> void setItemViewBinder(RecyclerView recyclerView, ItemBinder<T> itemViewMapper)
|
||||||
|
{
|
||||||
|
Collection<T> items = (Collection<T>) recyclerView.getTag(KEY_ITEMS);
|
||||||
|
ClickHandler<T> clickHandler = (ClickHandler<T>) recyclerView.getTag(KEY_CLICK_HANDLER);
|
||||||
|
BindingRecyclerViewAdapter<T> adapter = new BindingRecyclerViewAdapter<>(itemViewMapper, items);
|
||||||
|
if(clickHandler != null)
|
||||||
|
{
|
||||||
|
adapter.setClickHandler(clickHandler);
|
||||||
|
}
|
||||||
|
recyclerView.setAdapter(adapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,382 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.app.ActivityManager;
|
||||||
|
import android.app.ApplicationErrorReport;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.pm.ApplicationInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Debug;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.io.StringWriter;
|
||||||
|
|
||||||
|
public class ExceptionsHandler implements Thread.UncaughtExceptionHandler{
|
||||||
|
|
||||||
|
|
||||||
|
private ExceptionsHandler(Activity activity){
|
||||||
|
|
||||||
|
mPackageName = getPackageName(activity);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static ExceptionsHandler getINSTANCE(Activity activity){
|
||||||
|
|
||||||
|
if (mExceptionsHandler == null){
|
||||||
|
|
||||||
|
mExceptionsHandler = new ExceptionsHandler(activity);
|
||||||
|
}
|
||||||
|
|
||||||
|
return mExceptionsHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static String getPackageName(Context pContext){
|
||||||
|
|
||||||
|
String packageName = "";
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
ActivityManager activityManager = (ActivityManager) pContext
|
||||||
|
.getSystemService(Context.ACTIVITY_SERVICE);
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT > 20){
|
||||||
|
|
||||||
|
packageName = activityManager.getRunningAppProcesses().get(0).processName;
|
||||||
|
}else{
|
||||||
|
|
||||||
|
// <uses-permission android:name="android.permission.GET_TASKS" />
|
||||||
|
packageName = activityManager.getRunningTasks(1).get(0).topActivity
|
||||||
|
.getPackageName();
|
||||||
|
}
|
||||||
|
|
||||||
|
// There is a limit to the tag length of 23.
|
||||||
|
packageName = packageName
|
||||||
|
.substring(0, packageName.length() > 22 ? 22 : packageName.length());
|
||||||
|
|
||||||
|
}catch (Exception ex){
|
||||||
|
}
|
||||||
|
|
||||||
|
if (packageName.isEmpty()){
|
||||||
|
packageName = pContext.getPackageName();
|
||||||
|
}
|
||||||
|
|
||||||
|
return packageName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void toCatch(Activity activity){
|
||||||
|
|
||||||
|
Thread.setDefaultUncaughtExceptionHandler(getINSTANCE(activity));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void logError(String message){
|
||||||
|
|
||||||
|
if (message.isEmpty()){
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
logError(new Throwable(message.trim()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void logError(Throwable exception){
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
logCrash(exception);
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
Log.e(mPackageName, e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Return the last error message
|
||||||
|
public static String getErrorMessage(){
|
||||||
|
|
||||||
|
return mErrorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void setErrorMessage(String errMsg){
|
||||||
|
|
||||||
|
mErrorMessage = errMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Return the last crash information
|
||||||
|
public static ApplicationErrorReport.CrashInfo crashInfo(){
|
||||||
|
|
||||||
|
return mCrashInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static String getAppLabel(Context pContext){
|
||||||
|
|
||||||
|
PackageManager lPackageManager = pContext.getPackageManager();
|
||||||
|
|
||||||
|
ApplicationInfo lApplicationInfo = null;
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
lApplicationInfo = lPackageManager
|
||||||
|
.getApplicationInfo(pContext.getApplicationInfo().packageName, 0);
|
||||||
|
|
||||||
|
}catch (final PackageManager.NameNotFoundException e){
|
||||||
|
}
|
||||||
|
|
||||||
|
return (String) (lApplicationInfo != null ? lPackageManager
|
||||||
|
.getApplicationLabel(lApplicationInfo) : "Unknown");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static boolean inDebugger(){
|
||||||
|
|
||||||
|
// If in Debugger Environment
|
||||||
|
boolean debugging = Debug.isDebuggerConnected();
|
||||||
|
|
||||||
|
return debugging;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
private static String errorMsg(Throwable exception, String exceptError){
|
||||||
|
|
||||||
|
if (!exceptError.contains("error")){
|
||||||
|
|
||||||
|
mReportBuilder.append(reportError(exception));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!exceptError.contains("callstack")){
|
||||||
|
|
||||||
|
mReportBuilder.append(reportCallStack(exception));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!exceptError.contains("deviceinfo")){
|
||||||
|
|
||||||
|
mReportBuilder.append(reportDeviceInfo());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!exceptError.contains("firmware")){
|
||||||
|
|
||||||
|
mReportBuilder.append(reportFirmware());
|
||||||
|
}
|
||||||
|
|
||||||
|
return mReportBuilder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static String reportError(Throwable exception){
|
||||||
|
|
||||||
|
mCrashInfo = new ApplicationErrorReport.CrashInfo(exception);
|
||||||
|
|
||||||
|
if (mCrashInfo.exceptionMessage == null){
|
||||||
|
|
||||||
|
mErrorMessage = "<unknown error>";
|
||||||
|
}else{
|
||||||
|
|
||||||
|
mErrorMessage = mCrashInfo.exceptionMessage
|
||||||
|
.replace(": " + mCrashInfo.exceptionClassName, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
String throwFile = mCrashInfo.throwFileName == null ? "<unknown file>"
|
||||||
|
: mCrashInfo.throwFileName;
|
||||||
|
|
||||||
|
return "\n************ " + mCrashInfo.exceptionClassName + " ************\n"
|
||||||
|
+ mErrorMessage + LINE_SEPARATOR
|
||||||
|
+ "\n File: " + throwFile
|
||||||
|
+ "\n Method: " + mCrashInfo.throwMethodName + "()"
|
||||||
|
+ "\n Line No.: " + Integer.toString(mCrashInfo.throwLineNumber)
|
||||||
|
+ LINE_SEPARATOR;
|
||||||
|
// + "Class: " + crashInfo.throwClassName + LINE_SEPARATOR
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static String reportCallStack(Throwable exception){
|
||||||
|
|
||||||
|
StringWriter stackTrace = new StringWriter();
|
||||||
|
|
||||||
|
exception.printStackTrace(new PrintWriter(stackTrace));
|
||||||
|
|
||||||
|
String callStack = stackTrace.toString();
|
||||||
|
|
||||||
|
String errMsg = exception.toString();
|
||||||
|
|
||||||
|
return "\n************ CALLSTACK ************\n"
|
||||||
|
+ callStack.replace(errMsg, "")
|
||||||
|
+ LINE_SEPARATOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static String reportDeviceInfo(){
|
||||||
|
|
||||||
|
return "\n************ DEVICE INFORMATION ***********\n"
|
||||||
|
+ "Brand: "
|
||||||
|
+ Build.BRAND
|
||||||
|
+ LINE_SEPARATOR
|
||||||
|
+ "Device: "
|
||||||
|
+ Build.DEVICE
|
||||||
|
+ LINE_SEPARATOR
|
||||||
|
+ "Model: "
|
||||||
|
+ Build.MODEL
|
||||||
|
+ LINE_SEPARATOR
|
||||||
|
+ "Id: "
|
||||||
|
+ Build.ID
|
||||||
|
+ LINE_SEPARATOR
|
||||||
|
+ "Product: "
|
||||||
|
+ Build.PRODUCT
|
||||||
|
+ LINE_SEPARATOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static String reportFirmware(){
|
||||||
|
|
||||||
|
return "\n************ FIRMWARE ************\n"
|
||||||
|
+ "SDK: "
|
||||||
|
+ Build.VERSION.SDK_INT
|
||||||
|
+ LINE_SEPARATOR
|
||||||
|
+ "Release: "
|
||||||
|
+ Build.VERSION.RELEASE
|
||||||
|
+ LINE_SEPARATOR
|
||||||
|
+ "Incremental: "
|
||||||
|
+ Build.VERSION.INCREMENTAL
|
||||||
|
+ LINE_SEPARATOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Empty the report as it is begin re-populated.
|
||||||
|
private static void reportEmptied(){
|
||||||
|
|
||||||
|
// No need to empty
|
||||||
|
if (mReportBuilder.length() == 0){
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mReportBuilder.setLength(0);
|
||||||
|
|
||||||
|
mReportBuilder.trimToSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uncaughtException(Thread thread, Throwable exception){
|
||||||
|
|
||||||
|
// Don't re-enter -- avoid infinite loops if crash-reporting crashes.
|
||||||
|
if (mCrashing) return;
|
||||||
|
|
||||||
|
mCrashing = true;
|
||||||
|
|
||||||
|
catchException(thread, exception);
|
||||||
|
|
||||||
|
defaultExceptionHandler(thread, exception);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String catchException(Thread thread, Throwable exception){
|
||||||
|
|
||||||
|
String errorMsg = "";
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
errorMsg = logCrash(exception);
|
||||||
|
|
||||||
|
}catch (Exception ex){
|
||||||
|
|
||||||
|
Log.e(mPackageName, ex.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
return errorMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void defaultExceptionHandler(Thread thread, Throwable exception){
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
// Execute the old handler.
|
||||||
|
if (mOldHandler != null){
|
||||||
|
|
||||||
|
mOldHandler.uncaughtException(thread, exception);
|
||||||
|
}
|
||||||
|
|
||||||
|
}catch (Exception ex){
|
||||||
|
|
||||||
|
Log.e(mPackageName, ex.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static String logCrash(Throwable exception){
|
||||||
|
|
||||||
|
return errorMsg(exception, "deviceinfo firmware");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void onDestroy(){
|
||||||
|
|
||||||
|
mExceptionsHandler = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prevents infinite loops.
|
||||||
|
private static volatile boolean mCrashing = false;
|
||||||
|
|
||||||
|
private static final StringBuilder mReportBuilder = new StringBuilder();
|
||||||
|
|
||||||
|
private static final String LINE_SEPARATOR = "\n";
|
||||||
|
|
||||||
|
private static final Thread.UncaughtExceptionHandler mOldHandler = Thread
|
||||||
|
.getDefaultUncaughtExceptionHandler();
|
||||||
|
|
||||||
|
private static ExceptionsHandler mExceptionsHandler;
|
||||||
|
|
||||||
|
private static String mPackageName;
|
||||||
|
|
||||||
|
private static ApplicationErrorReport.CrashInfo mCrashInfo;
|
||||||
|
|
||||||
|
private static String mErrorMessage = "";
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
public interface RunnableArgs<T> {
|
||||||
|
|
||||||
|
void run(T data);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
public interface RunnableArgss<S, T> {
|
||||||
|
|
||||||
|
void run(S data1, T data2);
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.interfaces;
|
||||||
|
|
||||||
|
public interface IFilterableFragment {
|
||||||
|
|
||||||
|
void onFilterClick();
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package it.integry.integrywmsnative.core.interfaces;
|
||||||
|
|
||||||
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
|
||||||
|
import it.integry.plugins.waterfalltoolbar.WaterfallToolbar;
|
||||||
|
|
||||||
|
public interface IRecyclerFragment {
|
||||||
|
|
||||||
|
void setWaterfallToolbar(WaterfallToolbar waterfallToolbar);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package it.integry.integrywmsnative.core.interfaces;
|
||||||
|
|
||||||
|
public interface IRecyclerItemClicked<T> {
|
||||||
|
void onItemClick(T item, int position);
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package it.integry.integrywmsnative.core.interfaces;
|
||||||
|
|
||||||
|
public interface ISelectAllFragment {
|
||||||
|
|
||||||
|
boolean isEnabled();
|
||||||
|
|
||||||
|
void onSelectAll();
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package it.integry.integrywmsnative.gest.accettazione.core.interfaces;
|
package it.integry.integrywmsnative.core.interfaces;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
@ -0,0 +1,711 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.util.Base64;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
|
||||||
|
public class Azienda {
|
||||||
|
|
||||||
|
private String nomeDitta;
|
||||||
|
private String indirizzo;
|
||||||
|
private String cap;
|
||||||
|
private String citta;
|
||||||
|
private String prov;
|
||||||
|
private String partIva;
|
||||||
|
private String numTel;
|
||||||
|
private String numFax;
|
||||||
|
private String eMail;
|
||||||
|
private Integer annoContab;
|
||||||
|
private Integer annoMagaz;
|
||||||
|
private Integer annoAttuale;
|
||||||
|
private String ultDataGio;
|
||||||
|
private Integer ultNumGio;
|
||||||
|
private String ribaRSoc1;
|
||||||
|
private String ribaRSoc2;
|
||||||
|
private String ribaRSocBreve;
|
||||||
|
private String dataInizMsg;
|
||||||
|
private String dataFineMsg;
|
||||||
|
private String messaggioDoc;
|
||||||
|
private String liquidazioniIva;
|
||||||
|
private String lastUpgDb;
|
||||||
|
private String logoFile;
|
||||||
|
private String logoB64;
|
||||||
|
private BigDecimal ultDareAv;
|
||||||
|
private Integer sollTop;
|
||||||
|
private Integer sollLeft;
|
||||||
|
private Integer ggUtili;
|
||||||
|
private String codSia;
|
||||||
|
private String flagFattDiff;
|
||||||
|
private String sollHeadPersonal;
|
||||||
|
private String lastUpgSp;
|
||||||
|
private String sitoWeb;
|
||||||
|
private BigDecimal capitaleSoc;
|
||||||
|
private String cciaa;
|
||||||
|
private String iscRegImp;
|
||||||
|
private String ragSocMod;
|
||||||
|
private String prefissoEan;
|
||||||
|
private String codFiscale;
|
||||||
|
private String persFisicaCognome;
|
||||||
|
private String persFisicaNome;
|
||||||
|
private String persFisicaSesso;
|
||||||
|
private String persFisicaDataNascita;
|
||||||
|
private String persFisicaComuneNascita;
|
||||||
|
private String persFisicaProvNascita;
|
||||||
|
private String flagPersFisica;
|
||||||
|
private String persFisicaCodFisc;
|
||||||
|
private String rapprLegale;
|
||||||
|
private String rapprLegaleCodFisc;
|
||||||
|
private String sedeAmm;
|
||||||
|
private String flagSetIvaOmaggi;
|
||||||
|
private String applicationName;
|
||||||
|
private String flagTipoFatturazione;
|
||||||
|
private String tribunale;
|
||||||
|
private Integer settRitardoAnno;
|
||||||
|
private String dbDistributore;
|
||||||
|
private String coStringco;
|
||||||
|
private String lastUpgQc;
|
||||||
|
private String tipoAzienda;
|
||||||
|
private String nazione;
|
||||||
|
private String codDiviContab;
|
||||||
|
private String codIvaOmaggi;
|
||||||
|
private String codCconQuadra;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Regime Fiscale
|
||||||
|
*/
|
||||||
|
private String regFisc;
|
||||||
|
private String statoLiquidazione;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indirizzo PEC Sistema di Interscambio
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String emailSdi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indirizzo PEC di invio mail verso lo SDI
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String fromEmailSdi;
|
||||||
|
|
||||||
|
|
||||||
|
public String getNomeDitta() {
|
||||||
|
return nomeDitta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setNomeDitta(String nomeDitta) {
|
||||||
|
this.nomeDitta = nomeDitta;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIndirizzo() {
|
||||||
|
return indirizzo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setIndirizzo(String indirizzo) {
|
||||||
|
this.indirizzo = indirizzo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCap() {
|
||||||
|
return cap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setCap(String cap) {
|
||||||
|
this.cap = cap;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCitta() {
|
||||||
|
return citta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setCitta(String citta) {
|
||||||
|
this.citta = citta;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProv() {
|
||||||
|
return prov;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setProv(String prov) {
|
||||||
|
this.prov = prov;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPartIva() {
|
||||||
|
return partIva;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setPartIva(String partIva) {
|
||||||
|
this.partIva = partIva;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNumTel() {
|
||||||
|
return numTel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setNumTel(String numTel) {
|
||||||
|
this.numTel = numTel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNumFax() {
|
||||||
|
return numFax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setNumFax(String numFax) {
|
||||||
|
this.numFax = numFax;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String geteMail() {
|
||||||
|
return eMail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda seteMail(String eMail) {
|
||||||
|
this.eMail = eMail;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAnnoContab() {
|
||||||
|
return annoContab;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setAnnoContab(Integer annoContab) {
|
||||||
|
this.annoContab = annoContab;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAnnoMagaz() {
|
||||||
|
return annoMagaz;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setAnnoMagaz(Integer annoMagaz) {
|
||||||
|
this.annoMagaz = annoMagaz;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAnnoAttuale() {
|
||||||
|
return annoAttuale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setAnnoAttuale(Integer annoAttuale) {
|
||||||
|
this.annoAttuale = annoAttuale;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUltDataGio() {
|
||||||
|
return ultDataGio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setUltDataGio(String ultDataGio) {
|
||||||
|
this.ultDataGio = ultDataGio;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getUltNumGio() {
|
||||||
|
return ultNumGio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setUltNumGio(Integer ultNumGio) {
|
||||||
|
this.ultNumGio = ultNumGio;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRibaRSoc1() {
|
||||||
|
return ribaRSoc1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setRibaRSoc1(String ribaRSoc1) {
|
||||||
|
this.ribaRSoc1 = ribaRSoc1;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRibaRSoc2() {
|
||||||
|
return ribaRSoc2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setRibaRSoc2(String ribaRSoc2) {
|
||||||
|
this.ribaRSoc2 = ribaRSoc2;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRibaRSocBreve() {
|
||||||
|
return ribaRSocBreve;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setRibaRSocBreve(String ribaRSocBreve) {
|
||||||
|
this.ribaRSocBreve = ribaRSocBreve;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataInizMsg() {
|
||||||
|
return dataInizMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setDataInizMsg(String dataInizMsg) {
|
||||||
|
this.dataInizMsg = dataInizMsg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataFineMsg() {
|
||||||
|
return dataFineMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setDataFineMsg(String dataFineMsg) {
|
||||||
|
this.dataFineMsg = dataFineMsg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessaggioDoc() {
|
||||||
|
return messaggioDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setMessaggioDoc(String messaggioDoc) {
|
||||||
|
this.messaggioDoc = messaggioDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLiquidazioniIva() {
|
||||||
|
return liquidazioniIva;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setLiquidazioniIva(String liquidazioniIva) {
|
||||||
|
this.liquidazioniIva = liquidazioniIva;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLastUpgDb() {
|
||||||
|
return lastUpgDb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setLastUpgDb(String lastUpgDb) {
|
||||||
|
this.lastUpgDb = lastUpgDb;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLogoFile() {
|
||||||
|
return logoFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setLogoFile(String logoFile) {
|
||||||
|
this.logoFile = logoFile;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLogoB64() {
|
||||||
|
return logoB64;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isLogoAvailable() {
|
||||||
|
return !UtilityString.isNullOrEmpty(getLogoB64());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Bitmap getLogo() {
|
||||||
|
if(getLogoB64() != null) {
|
||||||
|
byte[] decodedString = Base64.decode(getLogoB64(), Base64.DEFAULT);
|
||||||
|
Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
|
||||||
|
return decodedByte;
|
||||||
|
} else return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setLogoB64(String logoB64) {
|
||||||
|
this.logoB64 = logoB64;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getUltDareAv() {
|
||||||
|
return ultDareAv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setUltDareAv(BigDecimal ultDareAv) {
|
||||||
|
this.ultDareAv = ultDareAv;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSollTop() {
|
||||||
|
return sollTop;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setSollTop(Integer sollTop) {
|
||||||
|
this.sollTop = sollTop;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSollLeft() {
|
||||||
|
return sollLeft;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setSollLeft(Integer sollLeft) {
|
||||||
|
this.sollLeft = sollLeft;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getGgUtili() {
|
||||||
|
return ggUtili;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setGgUtili(Integer ggUtili) {
|
||||||
|
this.ggUtili = ggUtili;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodSia() {
|
||||||
|
return codSia;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setCodSia(String codSia) {
|
||||||
|
this.codSia = codSia;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagFattDiff() {
|
||||||
|
return flagFattDiff;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setFlagFattDiff(String flagFattDiff) {
|
||||||
|
this.flagFattDiff = flagFattDiff;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSollHeadPersonal() {
|
||||||
|
return sollHeadPersonal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setSollHeadPersonal(String sollHeadPersonal) {
|
||||||
|
this.sollHeadPersonal = sollHeadPersonal;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLastUpgSp() {
|
||||||
|
return lastUpgSp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setLastUpgSp(String lastUpgSp) {
|
||||||
|
this.lastUpgSp = lastUpgSp;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSitoWeb() {
|
||||||
|
return sitoWeb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setSitoWeb(String sitoWeb) {
|
||||||
|
this.sitoWeb = sitoWeb;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCapitaleSoc() {
|
||||||
|
return capitaleSoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setCapitaleSoc(BigDecimal capitaleSoc) {
|
||||||
|
this.capitaleSoc = capitaleSoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCciaa() {
|
||||||
|
return cciaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setCciaa(String cciaa) {
|
||||||
|
this.cciaa = cciaa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIscRegImp() {
|
||||||
|
return iscRegImp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setIscRegImp(String iscRegImp) {
|
||||||
|
this.iscRegImp = iscRegImp;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRagSocMod() {
|
||||||
|
return ragSocMod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setRagSocMod(String ragSocMod) {
|
||||||
|
this.ragSocMod = ragSocMod;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPrefissoEan() {
|
||||||
|
return prefissoEan;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setPrefissoEan(String prefissoEan) {
|
||||||
|
this.prefissoEan = prefissoEan;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodFiscale() {
|
||||||
|
return codFiscale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setCodFiscale(String codFiscale) {
|
||||||
|
this.codFiscale = codFiscale;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPersFisicaCognome() {
|
||||||
|
return persFisicaCognome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setPersFisicaCognome(String persFisicaCognome) {
|
||||||
|
this.persFisicaCognome = persFisicaCognome;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPersFisicaNome() {
|
||||||
|
return persFisicaNome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setPersFisicaNome(String persFisicaNome) {
|
||||||
|
this.persFisicaNome = persFisicaNome;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPersFisicaSesso() {
|
||||||
|
return persFisicaSesso;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setPersFisicaSesso(String persFisicaSesso) {
|
||||||
|
this.persFisicaSesso = persFisicaSesso;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPersFisicaDataNascita() {
|
||||||
|
return persFisicaDataNascita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setPersFisicaDataNascita(String persFisicaDataNascita) {
|
||||||
|
this.persFisicaDataNascita = persFisicaDataNascita;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPersFisicaComuneNascita() {
|
||||||
|
return persFisicaComuneNascita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setPersFisicaComuneNascita(String persFisicaComuneNascita) {
|
||||||
|
this.persFisicaComuneNascita = persFisicaComuneNascita;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPersFisicaProvNascita() {
|
||||||
|
return persFisicaProvNascita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setPersFisicaProvNascita(String persFisicaProvNascita) {
|
||||||
|
this.persFisicaProvNascita = persFisicaProvNascita;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagPersFisica() {
|
||||||
|
return flagPersFisica;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setFlagPersFisica(String flagPersFisica) {
|
||||||
|
this.flagPersFisica = flagPersFisica;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPersFisicaCodFisc() {
|
||||||
|
return persFisicaCodFisc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setPersFisicaCodFisc(String persFisicaCodFisc) {
|
||||||
|
this.persFisicaCodFisc = persFisicaCodFisc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRapprLegale() {
|
||||||
|
return rapprLegale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setRapprLegale(String rapprLegale) {
|
||||||
|
this.rapprLegale = rapprLegale;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRapprLegaleCodFisc() {
|
||||||
|
return rapprLegaleCodFisc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setRapprLegaleCodFisc(String rapprLegaleCodFisc) {
|
||||||
|
this.rapprLegaleCodFisc = rapprLegaleCodFisc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSedeAmm() {
|
||||||
|
return sedeAmm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setSedeAmm(String sedeAmm) {
|
||||||
|
this.sedeAmm = sedeAmm;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagSetIvaOmaggi() {
|
||||||
|
return flagSetIvaOmaggi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setFlagSetIvaOmaggi(String flagSetIvaOmaggi) {
|
||||||
|
this.flagSetIvaOmaggi = flagSetIvaOmaggi;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApplicationName() {
|
||||||
|
return applicationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setApplicationName(String applicationName) {
|
||||||
|
this.applicationName = applicationName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagTipoFatturazione() {
|
||||||
|
return flagTipoFatturazione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setFlagTipoFatturazione(String flagTipoFatturazione) {
|
||||||
|
this.flagTipoFatturazione = flagTipoFatturazione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTribunale() {
|
||||||
|
return tribunale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setTribunale(String tribunale) {
|
||||||
|
this.tribunale = tribunale;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSettRitardoAnno() {
|
||||||
|
return settRitardoAnno;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setSettRitardoAnno(Integer settRitardoAnno) {
|
||||||
|
this.settRitardoAnno = settRitardoAnno;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDbDistributore() {
|
||||||
|
return dbDistributore;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setDbDistributore(String dbDistributore) {
|
||||||
|
this.dbDistributore = dbDistributore;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCoStringco() {
|
||||||
|
return coStringco;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setCoStringco(String coStringco) {
|
||||||
|
this.coStringco = coStringco;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLastUpgQc() {
|
||||||
|
return lastUpgQc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setLastUpgQc(String lastUpgQc) {
|
||||||
|
this.lastUpgQc = lastUpgQc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTipoAzienda() {
|
||||||
|
return tipoAzienda;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setTipoAzienda(String tipoAzienda) {
|
||||||
|
this.tipoAzienda = tipoAzienda;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNazione() {
|
||||||
|
return nazione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setNazione(String nazione) {
|
||||||
|
this.nazione = nazione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodDiviContab() {
|
||||||
|
return codDiviContab;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setCodDiviContab(String codDiviContab) {
|
||||||
|
this.codDiviContab = codDiviContab;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodIvaOmaggi() {
|
||||||
|
return codIvaOmaggi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setCodIvaOmaggi(String codIvaOmaggi) {
|
||||||
|
this.codIvaOmaggi = codIvaOmaggi;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodCconQuadra() {
|
||||||
|
return codCconQuadra;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setCodCconQuadra(String codCconQuadra) {
|
||||||
|
this.codCconQuadra = codCconQuadra;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRegFisc() {
|
||||||
|
return regFisc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setRegFisc(String regFisc) {
|
||||||
|
this.regFisc = regFisc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatoLiquidazione() {
|
||||||
|
return statoLiquidazione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setStatoLiquidazione(String statoLiquidazione) {
|
||||||
|
this.statoLiquidazione = statoLiquidazione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmailSdi() {
|
||||||
|
return emailSdi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setEmailSdi(String emailSdi) {
|
||||||
|
this.emailSdi = emailSdi;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFromEmailSdi() {
|
||||||
|
return fromEmailSdi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda setFromEmailSdi(String fromEmailSdi) {
|
||||||
|
this.fromEmailSdi = fromEmailSdi;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
|
||||||
|
public class CheckableMtbAart {
|
||||||
|
|
||||||
|
private MtbAart mtbAart;
|
||||||
|
private BindableBoolean checked = new BindableBoolean(false);
|
||||||
|
|
||||||
|
public CheckableMtbAart(MtbAart mtbAart) {
|
||||||
|
this.mtbAart = mtbAart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart getMtbAart() {
|
||||||
|
return mtbAart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CheckableMtbAart setMtbAart(MtbAart mtbAart) {
|
||||||
|
this.mtbAart = mtbAart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBoolean getChecked() {
|
||||||
|
return checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CheckableMtbAart setChecked(BindableBoolean checked) {
|
||||||
|
this.checked = checked;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void toggleCheck() {
|
||||||
|
this.checked.set(!this.checked.get());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
|
||||||
|
public class CheckableMtbColr {
|
||||||
|
|
||||||
|
|
||||||
|
private MtbColr mtbColr;
|
||||||
|
private BindableBoolean checked = new BindableBoolean(false);
|
||||||
|
|
||||||
|
public CheckableMtbColr(MtbColr mtbColr) {
|
||||||
|
this.mtbColr = mtbColr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr getMtbColr() {
|
||||||
|
return mtbColr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CheckableMtbColr setMtbColr(MtbColr mtbColr) {
|
||||||
|
this.mtbColr = mtbColr;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBoolean getChecked() {
|
||||||
|
return checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CheckableMtbColr setChecked(BindableBoolean checked) {
|
||||||
|
this.checked = checked;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void toggleCheck() {
|
||||||
|
this.checked.set(!this.checked.get());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
public class CommonModelConsts {
|
||||||
|
|
||||||
|
public static class OPERATION {
|
||||||
|
public static String INSERT_OR_UPDATE = "INSERT_OR_UPDATE";
|
||||||
|
public static String INSERT = "INSERT";
|
||||||
|
public static String UPDATE = "UPDATE";
|
||||||
|
public static String SELECT = "SELECT";
|
||||||
|
public static String SELECT_OBJECT = "SELECT_OBJECT";
|
||||||
|
public static String SUBSTITUTE = "SUBSTITUTE";
|
||||||
|
public static String DELETE = "DELETE";
|
||||||
|
public static String NO_OP = "NO_OP";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,41 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
public abstract class EntityBase implements Cloneable{
|
||||||
|
|
||||||
|
public String operation;
|
||||||
|
public String type;
|
||||||
|
public boolean onlyPkMaster = false;
|
||||||
|
|
||||||
|
public String getOperation() {
|
||||||
|
return operation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityBase setOperation(String operation) {
|
||||||
|
this.operation = operation;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isOnlyPkMaster() {
|
||||||
|
return onlyPkMaster;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityBase setOnlyPkMaster(boolean onlyPkMaster) {
|
||||||
|
this.onlyPkMaster = onlyPkMaster;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EntityBase clone(){
|
||||||
|
EntityBase clone = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
clone = (EntityBase) super.clone();
|
||||||
|
} catch (CloneNotSupportedException ex){
|
||||||
|
Log.e("CloneError", ex.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
return clone;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class FiltroOrdineDTO {
|
||||||
|
|
||||||
|
private String gestioneOrd;
|
||||||
|
private String dataOrd;
|
||||||
|
private int numOrd;
|
||||||
|
|
||||||
|
public String getGestioneOrd() {
|
||||||
|
return gestioneOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FiltroOrdineDTO setGestioneOrd(String gestioneOrd) {
|
||||||
|
this.gestioneOrd = gestioneOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataOrdS() {
|
||||||
|
return dataOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataOrdD() throws ParseException {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
return sdf.parse(getDataOrdS());
|
||||||
|
}
|
||||||
|
|
||||||
|
public FiltroOrdineDTO setDataOrd(String dataOrd) {
|
||||||
|
this.dataOrd = dataOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FiltroOrdineDTO setDataOrd(Date dataOrd) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
this.dataOrd = sdf.format(dataOrd);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNumOrd() {
|
||||||
|
return numOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FiltroOrdineDTO setNumOrd(int numOrd) {
|
||||||
|
this.numOrd = numOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -12,86 +12,96 @@ import java.util.Date;
|
|||||||
|
|
||||||
public class MtbAart implements Parcelable{
|
public class MtbAart implements Parcelable{
|
||||||
|
|
||||||
public String codMart;
|
private String codMart;
|
||||||
public String descrizione;
|
private String descrizione;
|
||||||
public String untMis;
|
private String untMis;
|
||||||
public String barCode;
|
private String barCode;
|
||||||
public BigDecimal pesoKg;
|
private BigDecimal pesoKg;
|
||||||
public BigDecimal qtaCnf;
|
private BigDecimal qtaCnf;
|
||||||
public String codAliq;
|
private String codAliq;
|
||||||
public String codScoArt;
|
private String codScoArt;
|
||||||
public String codTcolUi;
|
private String codTcolUi;
|
||||||
public String codTcolUl;
|
private String codTcolUl;
|
||||||
public String articoloComposto;
|
private String articoloComposto;
|
||||||
public String esposizioneComp;
|
private String esposizioneComp;
|
||||||
public String descrizioneEstesa;
|
private String descrizioneEstesa;
|
||||||
public String codUltForn;
|
private String codUltForn;
|
||||||
public String dataUltCar;
|
private String dataUltCar;
|
||||||
public BigDecimal valUltCar;
|
private BigDecimal valUltCar;
|
||||||
public String codUltClie;
|
private String codUltClie;
|
||||||
public String dataUltScar;
|
private String dataUltScar;
|
||||||
public BigDecimal valUltScar;
|
private BigDecimal valUltScar;
|
||||||
public String tipoCodice;
|
private String tipoCodice;
|
||||||
public String note;
|
private String note;
|
||||||
public String posizione;
|
private String posizione;
|
||||||
public BigDecimal colliPedana;
|
private BigDecimal colliPedana;
|
||||||
public String untMis2;
|
private String untMis2;
|
||||||
public BigDecimal rapConv2;
|
private BigDecimal rapConv2;
|
||||||
public String flagInclListino;
|
private String flagInclListino;
|
||||||
public String untMis3;
|
private String untMis3;
|
||||||
public BigDecimal rapConv3;
|
private BigDecimal rapConv3;
|
||||||
public String codMartStat;
|
private String codMartStat;
|
||||||
public String codMcon;
|
private String codMcon;
|
||||||
public String codMgrp;
|
private String codMgrp;
|
||||||
public String codMsfa;
|
private String codMsfa;
|
||||||
public String codMsgr;
|
private String codMsgr;
|
||||||
public String codMstp;
|
private String codMstp;
|
||||||
public String codMtip;
|
private String codMtip;
|
||||||
public String descrizioneStat;
|
private String descrizioneStat;
|
||||||
public String flagStato;
|
private String flagStato;
|
||||||
public BigDecimal cambioDiviCar;
|
private BigDecimal cambioDiviCar;
|
||||||
public BigDecimal cambioDiviScar;
|
private BigDecimal cambioDiviScar;
|
||||||
public Integer ggScadPartita;
|
private Integer ggScadPartita;
|
||||||
public BigDecimal volumeMc;
|
private BigDecimal volumeMc;
|
||||||
public String flagEsponiPrz;
|
private String flagEsponiPrz;
|
||||||
public String dataUltVar;
|
private String dataUltVar;
|
||||||
public BigDecimal percSfrido;
|
private BigDecimal percSfrido;
|
||||||
public String codBarreImb;
|
private String codBarreImb;
|
||||||
public String flagCalcPrz;
|
private String flagCalcPrz;
|
||||||
public String esposizioneCompAcq;
|
private String esposizioneCompAcq;
|
||||||
public String flagCalcPrzAcq;
|
private String flagCalcPrzAcq;
|
||||||
public String diacod;
|
private String diacod;
|
||||||
public String plu;
|
private String plu;
|
||||||
public String partIvaProd;
|
private String partIvaProd;
|
||||||
public String ragSocProd;
|
private String ragSocProd;
|
||||||
public String flagRapConvVariabile;
|
private String flagRapConvVariabile;
|
||||||
public String flagMovArtMag;
|
private String flagMovArtMag;
|
||||||
public String flagTracciabilita;
|
private String flagTracciabilita;
|
||||||
public BigDecimal taraKg;
|
private BigDecimal taraKg;
|
||||||
public BigDecimal colliStrato;
|
private BigDecimal colliStrato;
|
||||||
public String flagQtaCnfFissa;
|
private String flagQtaCnfFissa;
|
||||||
public String flagColliPedanaFisso;
|
private String flagColliPedanaFisso;
|
||||||
public String codCconCosti;
|
private String codCconCosti;
|
||||||
public String codCconRicavi;
|
private String codCconRicavi;
|
||||||
public String codDgrpArt;
|
private String codDgrpArt;
|
||||||
public String codDiviCar;
|
private String codDiviCar;
|
||||||
public String codDiviScar;
|
private String codDiviScar;
|
||||||
public String codEcrCat;
|
private String codEcrCat;
|
||||||
public String codEcrMcat;
|
private String codEcrMcat;
|
||||||
public String codEcrRep;
|
private String codEcrRep;
|
||||||
public String codEcrStipo;
|
private String codEcrStipo;
|
||||||
public String codEcrTipo;
|
private String codEcrTipo;
|
||||||
public String codGrpBolla;
|
private String codGrpBolla;
|
||||||
public String ingredienti;
|
private String ingredienti;
|
||||||
public String idArtEqui;
|
private String idArtEqui;
|
||||||
public String descrCassa;
|
private String descrCassa;
|
||||||
public String codNcIntracee;
|
private String codNcIntracee;
|
||||||
public String marchio;
|
private String marchio;
|
||||||
public Integer sezione;
|
private Integer sezione;
|
||||||
|
|
||||||
|
|
||||||
public MtbAart(){}
|
public MtbAart(){}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isFlagTracciabilita() {
|
||||||
|
return flagTracciabilita != null && flagTracciabilita.equalsIgnoreCase("S");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected MtbAart(Parcel in) {
|
protected MtbAart(Parcel in) {
|
||||||
codMart = in.readString();
|
codMart = in.readString();
|
||||||
descrizione = in.readString();
|
descrizione = in.readString();
|
||||||
@ -176,6 +186,690 @@ public class MtbAart implements Parcelable{
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCodMart() {
|
||||||
|
return codMart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodMart(String codMart) {
|
||||||
|
this.codMart = codMart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setDescrizione(String descrizione) {
|
||||||
|
this.descrizione = descrizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUntMis() {
|
||||||
|
return untMis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setUntMis(String untMis) {
|
||||||
|
this.untMis = untMis;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBarCode() {
|
||||||
|
return barCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setBarCode(String barCode) {
|
||||||
|
this.barCode = barCode;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPesoKg() {
|
||||||
|
return pesoKg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setPesoKg(BigDecimal pesoKg) {
|
||||||
|
this.pesoKg = pesoKg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaCnf() {
|
||||||
|
return qtaCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setQtaCnf(BigDecimal qtaCnf) {
|
||||||
|
this.qtaCnf = qtaCnf;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodAliq() {
|
||||||
|
return codAliq;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodAliq(String codAliq) {
|
||||||
|
this.codAliq = codAliq;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodScoArt() {
|
||||||
|
return codScoArt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodScoArt(String codScoArt) {
|
||||||
|
this.codScoArt = codScoArt;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodTcolUi() {
|
||||||
|
return codTcolUi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodTcolUi(String codTcolUi) {
|
||||||
|
this.codTcolUi = codTcolUi;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodTcolUl() {
|
||||||
|
return codTcolUl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodTcolUl(String codTcolUl) {
|
||||||
|
this.codTcolUl = codTcolUl;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getArticoloComposto() {
|
||||||
|
return articoloComposto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setArticoloComposto(String articoloComposto) {
|
||||||
|
this.articoloComposto = articoloComposto;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEsposizioneComp() {
|
||||||
|
return esposizioneComp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setEsposizioneComp(String esposizioneComp) {
|
||||||
|
this.esposizioneComp = esposizioneComp;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizioneEstesa() {
|
||||||
|
return descrizioneEstesa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setDescrizioneEstesa(String descrizioneEstesa) {
|
||||||
|
this.descrizioneEstesa = descrizioneEstesa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodUltForn() {
|
||||||
|
return codUltForn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodUltForn(String codUltForn) {
|
||||||
|
this.codUltForn = codUltForn;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataUltCar() {
|
||||||
|
return dataUltCar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setDataUltCar(String dataUltCar) {
|
||||||
|
this.dataUltCar = dataUltCar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getValUltCar() {
|
||||||
|
return valUltCar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setValUltCar(BigDecimal valUltCar) {
|
||||||
|
this.valUltCar = valUltCar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodUltClie() {
|
||||||
|
return codUltClie;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodUltClie(String codUltClie) {
|
||||||
|
this.codUltClie = codUltClie;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataUltScar() {
|
||||||
|
return dataUltScar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setDataUltScar(String dataUltScar) {
|
||||||
|
this.dataUltScar = dataUltScar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getValUltScar() {
|
||||||
|
return valUltScar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setValUltScar(BigDecimal valUltScar) {
|
||||||
|
this.valUltScar = valUltScar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTipoCodice() {
|
||||||
|
return tipoCodice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setTipoCodice(String tipoCodice) {
|
||||||
|
this.tipoCodice = tipoCodice;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNote() {
|
||||||
|
return note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setNote(String note) {
|
||||||
|
this.note = note;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPosizione() {
|
||||||
|
return posizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setPosizione(String posizione) {
|
||||||
|
this.posizione = posizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getColliPedana() {
|
||||||
|
return colliPedana;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setColliPedana(BigDecimal colliPedana) {
|
||||||
|
this.colliPedana = colliPedana;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUntMis2() {
|
||||||
|
return untMis2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setUntMis2(String untMis2) {
|
||||||
|
this.untMis2 = untMis2;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getRapConv2() {
|
||||||
|
return rapConv2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setRapConv2(BigDecimal rapConv2) {
|
||||||
|
this.rapConv2 = rapConv2;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagInclListino() {
|
||||||
|
return flagInclListino;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setFlagInclListino(String flagInclListino) {
|
||||||
|
this.flagInclListino = flagInclListino;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUntMis3() {
|
||||||
|
return untMis3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setUntMis3(String untMis3) {
|
||||||
|
this.untMis3 = untMis3;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getRapConv3() {
|
||||||
|
return rapConv3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setRapConv3(BigDecimal rapConv3) {
|
||||||
|
this.rapConv3 = rapConv3;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMartStat() {
|
||||||
|
return codMartStat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodMartStat(String codMartStat) {
|
||||||
|
this.codMartStat = codMartStat;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMcon() {
|
||||||
|
return codMcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodMcon(String codMcon) {
|
||||||
|
this.codMcon = codMcon;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMgrp() {
|
||||||
|
return codMgrp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodMgrp(String codMgrp) {
|
||||||
|
this.codMgrp = codMgrp;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMsfa() {
|
||||||
|
return codMsfa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodMsfa(String codMsfa) {
|
||||||
|
this.codMsfa = codMsfa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMsgr() {
|
||||||
|
return codMsgr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodMsgr(String codMsgr) {
|
||||||
|
this.codMsgr = codMsgr;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMstp() {
|
||||||
|
return codMstp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodMstp(String codMstp) {
|
||||||
|
this.codMstp = codMstp;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMtip() {
|
||||||
|
return codMtip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodMtip(String codMtip) {
|
||||||
|
this.codMtip = codMtip;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizioneStat() {
|
||||||
|
return descrizioneStat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setDescrizioneStat(String descrizioneStat) {
|
||||||
|
this.descrizioneStat = descrizioneStat;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagStato() {
|
||||||
|
return flagStato;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setFlagStato(String flagStato) {
|
||||||
|
this.flagStato = flagStato;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCambioDiviCar() {
|
||||||
|
return cambioDiviCar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCambioDiviCar(BigDecimal cambioDiviCar) {
|
||||||
|
this.cambioDiviCar = cambioDiviCar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCambioDiviScar() {
|
||||||
|
return cambioDiviScar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCambioDiviScar(BigDecimal cambioDiviScar) {
|
||||||
|
this.cambioDiviScar = cambioDiviScar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getGgScadPartita() {
|
||||||
|
return ggScadPartita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setGgScadPartita(Integer ggScadPartita) {
|
||||||
|
this.ggScadPartita = ggScadPartita;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getVolumeMc() {
|
||||||
|
return volumeMc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setVolumeMc(BigDecimal volumeMc) {
|
||||||
|
this.volumeMc = volumeMc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagEsponiPrz() {
|
||||||
|
return flagEsponiPrz;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setFlagEsponiPrz(String flagEsponiPrz) {
|
||||||
|
this.flagEsponiPrz = flagEsponiPrz;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataUltVar() {
|
||||||
|
return dataUltVar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setDataUltVar(String dataUltVar) {
|
||||||
|
this.dataUltVar = dataUltVar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPercSfrido() {
|
||||||
|
return percSfrido;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setPercSfrido(BigDecimal percSfrido) {
|
||||||
|
this.percSfrido = percSfrido;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodBarreImb() {
|
||||||
|
return codBarreImb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodBarreImb(String codBarreImb) {
|
||||||
|
this.codBarreImb = codBarreImb;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagCalcPrz() {
|
||||||
|
return flagCalcPrz;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setFlagCalcPrz(String flagCalcPrz) {
|
||||||
|
this.flagCalcPrz = flagCalcPrz;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEsposizioneCompAcq() {
|
||||||
|
return esposizioneCompAcq;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setEsposizioneCompAcq(String esposizioneCompAcq) {
|
||||||
|
this.esposizioneCompAcq = esposizioneCompAcq;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagCalcPrzAcq() {
|
||||||
|
return flagCalcPrzAcq;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setFlagCalcPrzAcq(String flagCalcPrzAcq) {
|
||||||
|
this.flagCalcPrzAcq = flagCalcPrzAcq;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDiacod() {
|
||||||
|
return diacod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setDiacod(String diacod) {
|
||||||
|
this.diacod = diacod;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPlu() {
|
||||||
|
return plu;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setPlu(String plu) {
|
||||||
|
this.plu = plu;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPartIvaProd() {
|
||||||
|
return partIvaProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setPartIvaProd(String partIvaProd) {
|
||||||
|
this.partIvaProd = partIvaProd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRagSocProd() {
|
||||||
|
return ragSocProd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setRagSocProd(String ragSocProd) {
|
||||||
|
this.ragSocProd = ragSocProd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagRapConvVariabile() {
|
||||||
|
return flagRapConvVariabile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setFlagRapConvVariabile(String flagRapConvVariabile) {
|
||||||
|
this.flagRapConvVariabile = flagRapConvVariabile;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagMovArtMag() {
|
||||||
|
return flagMovArtMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setFlagMovArtMag(String flagMovArtMag) {
|
||||||
|
this.flagMovArtMag = flagMovArtMag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagTracciabilita() {
|
||||||
|
return flagTracciabilita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setFlagTracciabilita(String flagTracciabilita) {
|
||||||
|
this.flagTracciabilita = flagTracciabilita;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getTaraKg() {
|
||||||
|
return taraKg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setTaraKg(BigDecimal taraKg) {
|
||||||
|
this.taraKg = taraKg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getColliStrato() {
|
||||||
|
return colliStrato;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setColliStrato(BigDecimal colliStrato) {
|
||||||
|
this.colliStrato = colliStrato;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagQtaCnfFissa() {
|
||||||
|
return flagQtaCnfFissa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setFlagQtaCnfFissa(String flagQtaCnfFissa) {
|
||||||
|
this.flagQtaCnfFissa = flagQtaCnfFissa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagColliPedanaFisso() {
|
||||||
|
return flagColliPedanaFisso;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setFlagColliPedanaFisso(String flagColliPedanaFisso) {
|
||||||
|
this.flagColliPedanaFisso = flagColliPedanaFisso;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodCconCosti() {
|
||||||
|
return codCconCosti;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodCconCosti(String codCconCosti) {
|
||||||
|
this.codCconCosti = codCconCosti;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodCconRicavi() {
|
||||||
|
return codCconRicavi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodCconRicavi(String codCconRicavi) {
|
||||||
|
this.codCconRicavi = codCconRicavi;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodDgrpArt() {
|
||||||
|
return codDgrpArt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodDgrpArt(String codDgrpArt) {
|
||||||
|
this.codDgrpArt = codDgrpArt;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodDiviCar() {
|
||||||
|
return codDiviCar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodDiviCar(String codDiviCar) {
|
||||||
|
this.codDiviCar = codDiviCar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodDiviScar() {
|
||||||
|
return codDiviScar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodDiviScar(String codDiviScar) {
|
||||||
|
this.codDiviScar = codDiviScar;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodEcrCat() {
|
||||||
|
return codEcrCat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodEcrCat(String codEcrCat) {
|
||||||
|
this.codEcrCat = codEcrCat;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodEcrMcat() {
|
||||||
|
return codEcrMcat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodEcrMcat(String codEcrMcat) {
|
||||||
|
this.codEcrMcat = codEcrMcat;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodEcrRep() {
|
||||||
|
return codEcrRep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodEcrRep(String codEcrRep) {
|
||||||
|
this.codEcrRep = codEcrRep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodEcrStipo() {
|
||||||
|
return codEcrStipo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodEcrStipo(String codEcrStipo) {
|
||||||
|
this.codEcrStipo = codEcrStipo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodEcrTipo() {
|
||||||
|
return codEcrTipo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodEcrTipo(String codEcrTipo) {
|
||||||
|
this.codEcrTipo = codEcrTipo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodGrpBolla() {
|
||||||
|
return codGrpBolla;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodGrpBolla(String codGrpBolla) {
|
||||||
|
this.codGrpBolla = codGrpBolla;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIngredienti() {
|
||||||
|
return ingredienti;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setIngredienti(String ingredienti) {
|
||||||
|
this.ingredienti = ingredienti;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIdArtEqui() {
|
||||||
|
return idArtEqui;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setIdArtEqui(String idArtEqui) {
|
||||||
|
this.idArtEqui = idArtEqui;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrCassa() {
|
||||||
|
return descrCassa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setDescrCassa(String descrCassa) {
|
||||||
|
this.descrCassa = descrCassa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodNcIntracee() {
|
||||||
|
return codNcIntracee;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setCodNcIntracee(String codNcIntracee) {
|
||||||
|
this.codNcIntracee = codNcIntracee;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMarchio() {
|
||||||
|
return marchio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setMarchio(String marchio) {
|
||||||
|
this.marchio = marchio;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSezione() {
|
||||||
|
return sezione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAart setSezione(Integer sezione) {
|
||||||
|
this.sezione = sezione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeToParcel(Parcel dest, int flags) {
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
dest.writeString(codMart);
|
dest.writeString(codMart);
|
||||||
@ -264,6 +958,10 @@ public class MtbAart implements Parcelable{
|
|||||||
dest.writeByte((byte) (0x01));
|
dest.writeByte((byte) (0x01));
|
||||||
dest.writeInt(sezione);
|
dest.writeInt(sezione);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
|
|||||||
@ -0,0 +1,15 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
public class MtbAartWithFornitore extends MtbAart {
|
||||||
|
|
||||||
|
private String codArtFor;
|
||||||
|
|
||||||
|
public String getCodArtFor() {
|
||||||
|
return codArtFor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbAartWithFornitore setCodArtFor(String codArtFor) {
|
||||||
|
this.codArtFor = codArtFor;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,588 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
|
|
||||||
|
public class MtbColr extends EntityBase implements Parcelable {
|
||||||
|
|
||||||
|
|
||||||
|
private String gestione;
|
||||||
|
private String serCollo;
|
||||||
|
private Integer numCollo;
|
||||||
|
private String dataCollo;
|
||||||
|
private Integer riga;
|
||||||
|
private Integer rigaOrd;
|
||||||
|
private String codMart;
|
||||||
|
private String codBarre;
|
||||||
|
private String codCol;
|
||||||
|
private String codTagl;
|
||||||
|
private String partitaMag;
|
||||||
|
private String gestioneRif;
|
||||||
|
private String serColloRif;
|
||||||
|
private String note;
|
||||||
|
private String dataOrd;
|
||||||
|
private String dataColloRif;
|
||||||
|
private BigDecimal qtaCnf;
|
||||||
|
private BigDecimal qtaCol;
|
||||||
|
private Integer numOrd;
|
||||||
|
private Integer numEtich;
|
||||||
|
private Integer numColloRif;
|
||||||
|
private String datetimeRow;
|
||||||
|
private String codJcom;
|
||||||
|
private BigDecimal numCnf;
|
||||||
|
private String insPartitaMag;
|
||||||
|
private String mtbPartitaMag_descrizione;
|
||||||
|
private String dataScadPartita;
|
||||||
|
private String descrizione;
|
||||||
|
private String untMis;
|
||||||
|
|
||||||
|
private MtbAart mtbAart;
|
||||||
|
|
||||||
|
public MtbColr() {
|
||||||
|
type = "mtb_colr";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected MtbColr(Parcel in) {
|
||||||
|
type = "mtb_colr";
|
||||||
|
gestione = in.readString();
|
||||||
|
serCollo = in.readString();
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
numCollo = null;
|
||||||
|
} else {
|
||||||
|
numCollo = in.readInt();
|
||||||
|
}
|
||||||
|
dataCollo = in.readString();
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
riga = null;
|
||||||
|
} else {
|
||||||
|
riga = in.readInt();
|
||||||
|
}
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
rigaOrd = null;
|
||||||
|
} else {
|
||||||
|
rigaOrd = in.readInt();
|
||||||
|
}
|
||||||
|
codMart = in.readString();
|
||||||
|
codBarre = in.readString();
|
||||||
|
codCol = in.readString();
|
||||||
|
codTagl = in.readString();
|
||||||
|
partitaMag = in.readString();
|
||||||
|
gestioneRif = in.readString();
|
||||||
|
serColloRif = in.readString();
|
||||||
|
note = in.readString();
|
||||||
|
dataOrd = in.readString();
|
||||||
|
dataColloRif = in.readString();
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
numOrd = null;
|
||||||
|
} else {
|
||||||
|
numOrd = in.readInt();
|
||||||
|
}
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
numEtich = null;
|
||||||
|
} else {
|
||||||
|
numEtich = in.readInt();
|
||||||
|
}
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
numColloRif = null;
|
||||||
|
} else {
|
||||||
|
numColloRif = in.readInt();
|
||||||
|
}
|
||||||
|
datetimeRow = in.readString();
|
||||||
|
codJcom = in.readString();
|
||||||
|
insPartitaMag = in.readString();
|
||||||
|
mtbPartitaMag_descrizione = in.readString();
|
||||||
|
dataScadPartita = in.readString();
|
||||||
|
descrizione = in.readString();
|
||||||
|
untMis = in.readString();
|
||||||
|
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
qtaCnf = null;
|
||||||
|
} else {
|
||||||
|
qtaCnf = new BigDecimal(in.readFloat());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
qtaCol = null;
|
||||||
|
} else {
|
||||||
|
qtaCol = new BigDecimal(in.readFloat());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
numCnf = null;
|
||||||
|
} else {
|
||||||
|
numCnf = new BigDecimal(in.readFloat());
|
||||||
|
}
|
||||||
|
|
||||||
|
in.readParcelable(MtbAart.class.getClassLoader());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(gestione);
|
||||||
|
dest.writeString(serCollo);
|
||||||
|
if (numCollo == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeInt(numCollo);
|
||||||
|
}
|
||||||
|
dest.writeString(dataCollo);
|
||||||
|
if (riga == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeInt(riga);
|
||||||
|
}
|
||||||
|
if (rigaOrd == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeInt(rigaOrd);
|
||||||
|
}
|
||||||
|
dest.writeString(codMart);
|
||||||
|
dest.writeString(codBarre);
|
||||||
|
dest.writeString(codCol);
|
||||||
|
dest.writeString(codTagl);
|
||||||
|
dest.writeString(partitaMag);
|
||||||
|
dest.writeString(gestioneRif);
|
||||||
|
dest.writeString(serColloRif);
|
||||||
|
dest.writeString(note);
|
||||||
|
dest.writeString(dataOrd);
|
||||||
|
dest.writeString(dataColloRif);
|
||||||
|
if (numOrd == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeInt(numOrd);
|
||||||
|
}
|
||||||
|
if (numEtich == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeInt(numEtich);
|
||||||
|
}
|
||||||
|
if (numColloRif == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeInt(numColloRif);
|
||||||
|
}
|
||||||
|
dest.writeString(datetimeRow);
|
||||||
|
dest.writeString(codJcom);
|
||||||
|
dest.writeString(insPartitaMag);
|
||||||
|
dest.writeString(mtbPartitaMag_descrizione);
|
||||||
|
dest.writeString(dataScadPartita);
|
||||||
|
dest.writeString(descrizione);
|
||||||
|
dest.writeString(untMis);
|
||||||
|
|
||||||
|
if (qtaCnf == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeFloat(qtaCnf.floatValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (qtaCol == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeFloat(qtaCol.floatValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (numCnf == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeFloat(numCnf.floatValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
dest.writeParcelable(mtbAart, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<MtbColr> CREATOR = new Creator<MtbColr>() {
|
||||||
|
@Override
|
||||||
|
public MtbColr createFromParcel(Parcel in) {
|
||||||
|
return new MtbColr(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MtbColr[] newArray(int size) {
|
||||||
|
return new MtbColr[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public String getGestione() {
|
||||||
|
return gestione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setGestione(String gestione) {
|
||||||
|
this.gestione = gestione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSerCollo() {
|
||||||
|
return serCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setSerCollo(String serCollo) {
|
||||||
|
this.serCollo = serCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumCollo() {
|
||||||
|
return numCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setNumCollo(Integer numCollo) {
|
||||||
|
this.numCollo = numCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataColloS() {
|
||||||
|
return dataCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataColloD() {
|
||||||
|
try{
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
return sdf.parse(getDataColloS());
|
||||||
|
} catch (ParseException pex){
|
||||||
|
UtilityLogger.errorMe(pex);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setDataCollo(String dataCollo) {
|
||||||
|
this.dataCollo = dataCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Integer getRiga() {
|
||||||
|
return riga;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setRiga(Integer riga) {
|
||||||
|
this.riga = riga;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRigaOrd() {
|
||||||
|
return rigaOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setRigaOrd(Integer rigaOrd) {
|
||||||
|
this.rigaOrd = rigaOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMart() {
|
||||||
|
return codMart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setCodMart(String codMart) {
|
||||||
|
this.codMart = codMart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodBarre() {
|
||||||
|
return codBarre;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setCodBarre(String codBarre) {
|
||||||
|
this.codBarre = codBarre;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodCol() {
|
||||||
|
return codCol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setCodCol(String codCol) {
|
||||||
|
this.codCol = codCol;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodTagl() {
|
||||||
|
return codTagl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setCodTagl(String codTagl) {
|
||||||
|
this.codTagl = codTagl;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPartitaMag() {
|
||||||
|
return partitaMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setPartitaMag(String partitaMag) {
|
||||||
|
this.partitaMag = partitaMag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGestioneRif() {
|
||||||
|
return gestioneRif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setGestioneRif(String gestioneRif) {
|
||||||
|
this.gestioneRif = gestioneRif;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSerColloRif() {
|
||||||
|
return serColloRif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setSerColloRif(String serColloRif) {
|
||||||
|
this.serColloRif = serColloRif;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNote() {
|
||||||
|
return note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setNote(String note) {
|
||||||
|
this.note = note;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataOrdS() {
|
||||||
|
return dataOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataOrdD() {
|
||||||
|
try{
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
return sdf.parse(getDataOrdS());
|
||||||
|
} catch (ParseException pex){
|
||||||
|
UtilityLogger.errorMe(pex);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setDataOrd(String dataOrd) {
|
||||||
|
this.dataOrd = dataOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setDataOrd(Date dataOrd) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
this.dataOrd = sdf.format(dataOrd);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataColloRifS() {
|
||||||
|
return dataColloRif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataColloRifD() {
|
||||||
|
try{
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
return sdf.parse(getDataColloRifS());
|
||||||
|
} catch (ParseException pex){
|
||||||
|
UtilityLogger.errorMe(pex);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setDataColloRif(String dataColloRif) {
|
||||||
|
this.dataColloRif = dataColloRif;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setDataColloRif(Date dataColloRif) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
this.dataColloRif = sdf.format(dataColloRif);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaCnf() {
|
||||||
|
return qtaCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setQtaCnf(BigDecimal qtaCnf) {
|
||||||
|
this.qtaCnf = qtaCnf;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaCol() {
|
||||||
|
return qtaCol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setQtaCol(BigDecimal qtaCol) {
|
||||||
|
this.qtaCol = qtaCol;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumOrd() {
|
||||||
|
return numOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setNumOrd(Integer numOrd) {
|
||||||
|
this.numOrd = numOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumEtich() {
|
||||||
|
return numEtich;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setNumEtich(Integer numEtich) {
|
||||||
|
this.numEtich = numEtich;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumColloRif() {
|
||||||
|
return numColloRif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setNumColloRif(Integer numColloRif) {
|
||||||
|
this.numColloRif = numColloRif;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getDatetimeRowS() {
|
||||||
|
return datetimeRow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDatetimeRowD() throws ParseException {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
return sdf.parse(getDatetimeRowS());
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setDatetimeRow(String datetimeRow) {
|
||||||
|
this.datetimeRow = datetimeRow;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setDatetimeRow(Date datetimeRow) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
this.datetimeRow = sdf.format(datetimeRow);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getCodJcom() {
|
||||||
|
return codJcom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setCodJcom(String codJcom) {
|
||||||
|
this.codJcom = codJcom;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getNumCnf() {
|
||||||
|
return numCnf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setNumCnf(BigDecimal numCnf) {
|
||||||
|
this.numCnf = numCnf;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInsPartitaMag() {
|
||||||
|
return insPartitaMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setInsPartitaMag(String insPartitaMag) {
|
||||||
|
this.insPartitaMag = insPartitaMag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMtbPartitaMag_descrizione() {
|
||||||
|
return mtbPartitaMag_descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setMtbPartitaMag_descrizione(String mtbPartitaMag_descrizione) {
|
||||||
|
this.mtbPartitaMag_descrizione = mtbPartitaMag_descrizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getDataScadPartitaS() {
|
||||||
|
return dataScadPartita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataScadPartitaD() {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
try {
|
||||||
|
return sdf.parse(getDataScadPartitaS());
|
||||||
|
} catch (Exception ex) {
|
||||||
|
UtilityLogger.errorMe(ex);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setDataScadPartita(String dataScadPartita) {
|
||||||
|
this.dataScadPartita = dataScadPartita;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setDataScadPartita(Date dataScadPartita) {
|
||||||
|
if(dataScadPartita != null) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
this.dataScadPartita = sdf.format(dataScadPartita);
|
||||||
|
} else this.dataScadPartita = null;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setDescrizione(String descrizione) {
|
||||||
|
this.descrizione = descrizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getUntMis() {
|
||||||
|
return untMis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setUntMis(String untMis) {
|
||||||
|
this.untMis = untMis;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public MtbAart getMtbAart() {
|
||||||
|
return mtbAart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColr setMtbAart(MtbAart mtbAart) {
|
||||||
|
this.mtbAart = mtbAart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,123 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
|
||||||
|
public class MtbCols extends EntityBase {
|
||||||
|
|
||||||
|
private String dataCollo;
|
||||||
|
private String gestione;
|
||||||
|
private Integer idRiga;
|
||||||
|
private Integer numCollo;
|
||||||
|
private String serCollo;
|
||||||
|
private String codMdep;
|
||||||
|
private String dataMove;
|
||||||
|
private String modificatoDa;
|
||||||
|
private String posizione;
|
||||||
|
private String causale;
|
||||||
|
|
||||||
|
public MtbCols() {
|
||||||
|
type = "mtb_cols";
|
||||||
|
setCodMdep(SettingsManager.i().userSession.depo.getCodMdep());
|
||||||
|
setModificatoDa(SettingsManager.i().user.fullname);
|
||||||
|
setDataMove(new Date());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataCollo() {
|
||||||
|
return dataCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setDataCollo(String dataCollo) {
|
||||||
|
this.dataCollo = dataCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGestione() {
|
||||||
|
return gestione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setGestione(String gestione) {
|
||||||
|
this.gestione = gestione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getIdRiga() {
|
||||||
|
return idRiga;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setIdRiga(Integer idRiga) {
|
||||||
|
this.idRiga = idRiga;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumCollo() {
|
||||||
|
return numCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setNumCollo(Integer numCollo) {
|
||||||
|
this.numCollo = numCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSerCollo() {
|
||||||
|
return serCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setSerCollo(String serCollo) {
|
||||||
|
this.serCollo = serCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataMove() {
|
||||||
|
return dataMove;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setDataMove(String dataMove) {
|
||||||
|
this.dataMove = dataMove;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setDataMove(Date dataMove) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
this.dataMove = sdf.format(dataMove);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getModificatoDa() {
|
||||||
|
return modificatoDa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setModificatoDa(String modificatoDa) {
|
||||||
|
this.modificatoDa = modificatoDa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPosizione() {
|
||||||
|
return posizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setPosizione(String posizione) {
|
||||||
|
this.posizione = posizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCausale() {
|
||||||
|
return causale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbCols setCausale(String causale) {
|
||||||
|
this.causale = causale;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,13 +1,28 @@
|
|||||||
package it.integry.integrywmsnative.core.model;
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import android.databinding.ObservableArrayList;
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by GiuseppeS on 06/03/2018.
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class MtbColt {
|
public class MtbColt extends EntityBase implements Parcelable {
|
||||||
private String gestione;
|
private String gestione;
|
||||||
private String dataCollo;
|
private String dataCollo;
|
||||||
private String serCollo;
|
private String serCollo;
|
||||||
@ -42,4 +57,644 @@ public class MtbColt {
|
|||||||
private BigDecimal larghezzaCm;
|
private BigDecimal larghezzaCm;
|
||||||
private BigDecimal altezzaCm;
|
private BigDecimal altezzaCm;
|
||||||
|
|
||||||
|
public List<MtbCols> mtbCols;
|
||||||
|
|
||||||
|
private Boolean disablePrint;
|
||||||
|
|
||||||
|
protected MtbColt(Parcel in) {
|
||||||
|
type = "mtb_colt";
|
||||||
|
gestione = in.readString();
|
||||||
|
dataCollo = in.readString();
|
||||||
|
serCollo = in.readString();
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
numCollo = null;
|
||||||
|
} else {
|
||||||
|
numCollo = in.readInt();
|
||||||
|
}
|
||||||
|
rifOrd = in.readString();
|
||||||
|
codAnag = in.readString();
|
||||||
|
codVdes = in.readString();
|
||||||
|
codMdep = in.readString();
|
||||||
|
codVlis = in.readString();
|
||||||
|
codDtip = in.readString();
|
||||||
|
codTcol = in.readString();
|
||||||
|
serDoc = in.readString();
|
||||||
|
filtroOrdini = in.readString();
|
||||||
|
preparatoDa = in.readString();
|
||||||
|
annotazioni = in.readString();
|
||||||
|
posizione = in.readString();
|
||||||
|
codDtipProvv = in.readString();
|
||||||
|
serDocProvv = in.readString();
|
||||||
|
codJfas = in.readString();
|
||||||
|
dataOrd = in.readString();
|
||||||
|
dataDoc = in.readString();
|
||||||
|
oraInizPrep = in.readString();
|
||||||
|
oraFinePrep = in.readString();
|
||||||
|
dataDocProvv = in.readString();
|
||||||
|
dataVers = in.readString();
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
segno = null;
|
||||||
|
} else {
|
||||||
|
segno = in.readInt();
|
||||||
|
}
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
numOrd = null;
|
||||||
|
} else {
|
||||||
|
numOrd = in.readInt();
|
||||||
|
}
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
numDoc = null;
|
||||||
|
} else {
|
||||||
|
numDoc = in.readInt();
|
||||||
|
}
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
numDocProvv = null;
|
||||||
|
} else {
|
||||||
|
numDocProvv = in.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
pesoKg = null;
|
||||||
|
} else {
|
||||||
|
pesoKg = new BigDecimal(in.readFloat());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
lunghezzaCm = null;
|
||||||
|
} else {
|
||||||
|
lunghezzaCm = new BigDecimal(in.readFloat());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
larghezzaCm = null;
|
||||||
|
} else {
|
||||||
|
larghezzaCm = new BigDecimal(in.readFloat());
|
||||||
|
}
|
||||||
|
if (in.readByte() == 0) {
|
||||||
|
altezzaCm = null;
|
||||||
|
} else {
|
||||||
|
altezzaCm = new BigDecimal(in.readFloat());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
in.readTypedList(mtbColr, MtbColr.CREATOR);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(gestione);
|
||||||
|
dest.writeString(dataCollo);
|
||||||
|
dest.writeString(serCollo);
|
||||||
|
if (numCollo == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeInt(numCollo);
|
||||||
|
}
|
||||||
|
dest.writeString(rifOrd);
|
||||||
|
dest.writeString(codAnag);
|
||||||
|
dest.writeString(codVdes);
|
||||||
|
dest.writeString(codMdep);
|
||||||
|
dest.writeString(codVlis);
|
||||||
|
dest.writeString(codDtip);
|
||||||
|
dest.writeString(codTcol);
|
||||||
|
dest.writeString(serDoc);
|
||||||
|
dest.writeString(filtroOrdini);
|
||||||
|
dest.writeString(preparatoDa);
|
||||||
|
dest.writeString(annotazioni);
|
||||||
|
dest.writeString(posizione);
|
||||||
|
dest.writeString(codDtipProvv);
|
||||||
|
dest.writeString(serDocProvv);
|
||||||
|
dest.writeString(codJfas);
|
||||||
|
dest.writeString(dataOrd);
|
||||||
|
dest.writeString(dataDoc);
|
||||||
|
dest.writeString(oraInizPrep);
|
||||||
|
dest.writeString(oraFinePrep);
|
||||||
|
dest.writeString(dataDocProvv);
|
||||||
|
dest.writeString(dataVers);
|
||||||
|
if (segno == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeInt(segno);
|
||||||
|
}
|
||||||
|
if (numOrd == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeInt(numOrd);
|
||||||
|
}
|
||||||
|
if (numDoc == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeInt(numDoc);
|
||||||
|
}
|
||||||
|
if (numDocProvv == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeInt(numDocProvv);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (pesoKg == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeFloat(pesoKg.floatValue());
|
||||||
|
}
|
||||||
|
if (lunghezzaCm == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeFloat(lunghezzaCm.floatValue());
|
||||||
|
}
|
||||||
|
if (larghezzaCm == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeFloat(larghezzaCm.floatValue());
|
||||||
|
}
|
||||||
|
if (altezzaCm == null) {
|
||||||
|
dest.writeByte((byte) 0);
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) 1);
|
||||||
|
dest.writeFloat(altezzaCm.floatValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
dest.writeTypedList(mtbColr);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<MtbColt> CREATOR = new Creator<MtbColt>() {
|
||||||
|
@Override
|
||||||
|
public MtbColt createFromParcel(Parcel in) {
|
||||||
|
return new MtbColt(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MtbColt[] newArray(int size) {
|
||||||
|
return new MtbColt[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public void generaFiltroOrdine() throws Exception {
|
||||||
|
|
||||||
|
if (this.gestione == null) {
|
||||||
|
throw new Exception("Impossibile creare il filtro dell'ordine se la gestione non è valorizzata");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.dataOrd == null) {
|
||||||
|
throw new Exception("Impossibile creare il filtro dell'ordine se la data dell'ordine non è valorizzata");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.numOrd == null) {
|
||||||
|
throw new Exception("Impossibile creare il filtro dell'ordine se il numero dell'ordine non è valorizzato");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Date dateOrd = UtilityDate.recognizeDate(this.dataOrd);
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
|
||||||
|
String dateYMD = sdf.format(dateOrd);
|
||||||
|
|
||||||
|
this.filtroOrdini = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ROOT><FILTER><DTB_ORDT><GESTIONE type=\"V\">" + this.gestione + "</GESTIONE><DATA_ORD type=\"D\">" + dateYMD + "</DATA_ORD><NUM_ORD type=\"N\">" + this.numOrd + "</NUM_ORD></DTB_ORDT></FILTER></ROOT>";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private ObservableArrayList<MtbColr> mtbColr = new ObservableArrayList<>();
|
||||||
|
|
||||||
|
public ObservableArrayList<MtbColr> getMtbColr() {
|
||||||
|
return mtbColr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setMtbColr(ObservableArrayList<MtbColr> mtbColr) {
|
||||||
|
this.mtbColr = mtbColr;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt(){
|
||||||
|
type = "mtb_colt";
|
||||||
|
setDataCollo(new Date());
|
||||||
|
setSerCollo("/");
|
||||||
|
setCodMdep(SettingsManager.i().userSession.depo.getCodMdep());
|
||||||
|
setPreparatoDa(SettingsManager.i().user.fullname);
|
||||||
|
setOraInizPrep(new Date());
|
||||||
|
setCodAnag(SettingsManager.iDB().getDefaultCodAnag());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getGestione() {
|
||||||
|
return gestione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GestioneEnum getGestioneEnum() {
|
||||||
|
return GestioneEnum.fromString(gestione);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setGestione(String gestione) {
|
||||||
|
this.gestione = gestione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setGestione(GestioneEnum gestione) {
|
||||||
|
this.gestione = gestione.getText();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataColloHumanLong() {
|
||||||
|
Date dataColloD = null;
|
||||||
|
try {
|
||||||
|
dataColloD = getDataColloD();
|
||||||
|
} catch (Exception ex){
|
||||||
|
UtilityLogger.errorMe(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(dataColloD != null){
|
||||||
|
return UtilityDate.formatDate(dataColloD, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN_LONG);
|
||||||
|
} else return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataColloS() {
|
||||||
|
return dataCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataColloD() {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
try {
|
||||||
|
return sdf.parse(getDataColloS());
|
||||||
|
} catch (ParseException e) {
|
||||||
|
UtilityLogger.errorMe(e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setDataCollo(String dataCollo) {
|
||||||
|
this.dataCollo = dataCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setDataCollo(Date dataCollo) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
this.dataCollo = sdf.format(dataCollo);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSerCollo() {
|
||||||
|
return serCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setSerCollo(String serCollo) {
|
||||||
|
this.serCollo = serCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumCollo() {
|
||||||
|
return numCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setNumCollo(Integer numCollo) {
|
||||||
|
this.numCollo = numCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRifOrd() {
|
||||||
|
return rifOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setRifOrd(String rifOrd) {
|
||||||
|
this.rifOrd = rifOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodAnag() {
|
||||||
|
return codAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodAnag(String codAnag) {
|
||||||
|
this.codAnag = codAnag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodVdes() {
|
||||||
|
return codVdes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodVdes(String codVdes) {
|
||||||
|
this.codVdes = codVdes;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodVlis() {
|
||||||
|
return codVlis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodVlis(String codVlis) {
|
||||||
|
this.codVlis = codVlis;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodDtip() {
|
||||||
|
return codDtip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodDtip(String codDtip) {
|
||||||
|
this.codDtip = codDtip;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodTcol() {
|
||||||
|
return codTcol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodTcol(String codTcol) {
|
||||||
|
this.codTcol = codTcol;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSerDoc() {
|
||||||
|
return serDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setSerDoc(String serDoc) {
|
||||||
|
this.serDoc = serDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFiltroOrdini() {
|
||||||
|
return filtroOrdini;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setFiltroOrdini(String filtroOrdini) {
|
||||||
|
this.filtroOrdini = filtroOrdini;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPreparatoDa() {
|
||||||
|
return preparatoDa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setPreparatoDa(String preparatoDa) {
|
||||||
|
this.preparatoDa = preparatoDa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAnnotazioni() {
|
||||||
|
return annotazioni;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setAnnotazioni(String annotazioni) {
|
||||||
|
this.annotazioni = annotazioni;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPosizione() {
|
||||||
|
return posizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setPosizione(String posizione) {
|
||||||
|
this.posizione = posizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodDtipProvv() {
|
||||||
|
return codDtipProvv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodDtipProvv(String codDtipProvv) {
|
||||||
|
this.codDtipProvv = codDtipProvv;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSerDocProvv() {
|
||||||
|
return serDocProvv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setSerDocProvv(String serDocProvv) {
|
||||||
|
this.serDocProvv = serDocProvv;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodJfas() {
|
||||||
|
return codJfas;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodJfas(String codJfas) {
|
||||||
|
this.codJfas = codJfas;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataOrd() {
|
||||||
|
return dataOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setDataOrd(String dataOrd) {
|
||||||
|
this.dataOrd = dataOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setDataOrdD(Date dataOrd) {
|
||||||
|
if(dataOrd != null) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
this.dataOrd = sdf.format(dataOrd);
|
||||||
|
} else this.dataOrd = null;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataDoc() {
|
||||||
|
return dataDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setDataDoc(String dataDoc) {
|
||||||
|
this.dataDoc = dataDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOraInizPrep() {
|
||||||
|
return oraInizPrep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setOraInizPrep(String oraInizPrep) {
|
||||||
|
this.oraInizPrep = oraInizPrep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setOraInizPrep(Date oraInizPrep) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
this.oraInizPrep = sdf.format(oraInizPrep);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOraFinePrep() {
|
||||||
|
return oraFinePrep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setOraFinePrep(String oraFinePrep) {
|
||||||
|
this.oraFinePrep = oraFinePrep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setOraFinePrep(Date oraFinePrep) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
this.oraFinePrep = sdf.format(oraFinePrep);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataDocProvv() {
|
||||||
|
return dataDocProvv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setDataDocProvv(String dataDocProvv) {
|
||||||
|
this.dataDocProvv = dataDocProvv;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataVers() {
|
||||||
|
return dataVers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setDataVers(String dataVers) {
|
||||||
|
this.dataVers = dataVers;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSegno() {
|
||||||
|
return segno;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setSegno(Integer segno) {
|
||||||
|
this.segno = segno;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumOrd() {
|
||||||
|
return numOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setNumOrd(Integer numOrd) {
|
||||||
|
this.numOrd = numOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumDoc() {
|
||||||
|
return numDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setNumDoc(Integer numDoc) {
|
||||||
|
this.numDoc = numDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumDocProvv() {
|
||||||
|
return numDocProvv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setNumDocProvv(Integer numDocProvv) {
|
||||||
|
this.numDocProvv = numDocProvv;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPesoKg() {
|
||||||
|
return pesoKg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setPesoKg(BigDecimal pesoKg) {
|
||||||
|
this.pesoKg = pesoKg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getLunghezzaCm() {
|
||||||
|
return lunghezzaCm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setLunghezzaCm(BigDecimal lunghezzaCm) {
|
||||||
|
this.lunghezzaCm = lunghezzaCm;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getLarghezzaCm() {
|
||||||
|
return larghezzaCm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setLarghezzaCm(BigDecimal larghezzaCm) {
|
||||||
|
this.larghezzaCm = larghezzaCm;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getAltezzaCm() {
|
||||||
|
return altezzaCm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setAltezzaCm(BigDecimal altezzaCm) {
|
||||||
|
this.altezzaCm = altezzaCm;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<MtbCols> getMtbCols() {
|
||||||
|
return mtbCols;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setMtbCols(List<MtbCols> mtbCols) {
|
||||||
|
this.mtbCols = mtbCols;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getDisablePrint() {
|
||||||
|
return disablePrint == null ? false : disablePrint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setDisablePrint(Boolean disablePrint) {
|
||||||
|
this.disablePrint = disablePrint;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void generaFiltroOrdineFromDTO(List<FiltroOrdineDTO> filtroOrdineDtos) {
|
||||||
|
|
||||||
|
String xmlPrefix = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ROOT><FILTER>";
|
||||||
|
String xmlSuffix = "</FILTER></ROOT>";
|
||||||
|
|
||||||
|
StringBuilder xmlContent = new StringBuilder();
|
||||||
|
|
||||||
|
if(filtroOrdineDtos != null && filtroOrdineDtos.size() > 0) {
|
||||||
|
|
||||||
|
for(int i = 0; i < filtroOrdineDtos.size(); i++){
|
||||||
|
FiltroOrdineDTO x = filtroOrdineDtos.get(i);
|
||||||
|
|
||||||
|
try {
|
||||||
|
xmlContent.append("<DTB_ORDT COND=\"OR\"><GESTIONE type=\"V\">" + x.getGestioneOrd() + "</GESTIONE><DATA_ORD type=\"D\">" + UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH) + "</DATA_ORD><NUM_ORD type=\"N\">" + x.getNumOrd() + "</NUM_ORD></DTB_ORDT>");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
this.filtroOrdini = xmlPrefix + xmlContent + xmlSuffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,360 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class MtbDepo extends EntityBase implements Parcelable {
|
||||||
|
|
||||||
|
|
||||||
|
private String codMdep;
|
||||||
|
private String descrizione;
|
||||||
|
private String flagVal;
|
||||||
|
private String codAnag;
|
||||||
|
private BigDecimal percDepo;
|
||||||
|
private BigDecimal valDepo;
|
||||||
|
private String indirizzo;
|
||||||
|
private String cap;
|
||||||
|
private String citta;
|
||||||
|
private String prov;
|
||||||
|
private String tel;
|
||||||
|
private String nazione;
|
||||||
|
private String fax;
|
||||||
|
private String eMail;
|
||||||
|
private String sitoWeb;
|
||||||
|
private String codVdes;
|
||||||
|
private String serie;
|
||||||
|
private String flagMovimentabile;
|
||||||
|
private String codJfas;
|
||||||
|
private String codVlis;
|
||||||
|
private String codCcau;
|
||||||
|
private String codCcon;
|
||||||
|
private String codDtip;
|
||||||
|
private String codDtipFat;
|
||||||
|
private String flagContoVendita;
|
||||||
|
private String flagTipoNegozio;
|
||||||
|
private String codMdepReso;
|
||||||
|
|
||||||
|
public MtbDepo() {
|
||||||
|
type = "mtb_depo";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected MtbDepo(Parcel in) {
|
||||||
|
type = "mtb_depo";
|
||||||
|
codMdep = in.readString();
|
||||||
|
descrizione = in.readString();
|
||||||
|
flagVal = in.readString();
|
||||||
|
codAnag = in.readString();
|
||||||
|
indirizzo = in.readString();
|
||||||
|
cap = in.readString();
|
||||||
|
citta = in.readString();
|
||||||
|
prov = in.readString();
|
||||||
|
tel = in.readString();
|
||||||
|
nazione = in.readString();
|
||||||
|
fax = in.readString();
|
||||||
|
eMail = in.readString();
|
||||||
|
sitoWeb = in.readString();
|
||||||
|
codVdes = in.readString();
|
||||||
|
serie = in.readString();
|
||||||
|
flagMovimentabile = in.readString();
|
||||||
|
codJfas = in.readString();
|
||||||
|
codVlis = in.readString();
|
||||||
|
codCcau = in.readString();
|
||||||
|
codCcon = in.readString();
|
||||||
|
codDtip = in.readString();
|
||||||
|
codDtipFat = in.readString();
|
||||||
|
flagContoVendita = in.readString();
|
||||||
|
flagTipoNegozio = in.readString();
|
||||||
|
codMdepReso = in.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(codMdep);
|
||||||
|
dest.writeString(descrizione);
|
||||||
|
dest.writeString(flagVal);
|
||||||
|
dest.writeString(codAnag);
|
||||||
|
dest.writeString(indirizzo);
|
||||||
|
dest.writeString(cap);
|
||||||
|
dest.writeString(citta);
|
||||||
|
dest.writeString(prov);
|
||||||
|
dest.writeString(tel);
|
||||||
|
dest.writeString(nazione);
|
||||||
|
dest.writeString(fax);
|
||||||
|
dest.writeString(eMail);
|
||||||
|
dest.writeString(sitoWeb);
|
||||||
|
dest.writeString(codVdes);
|
||||||
|
dest.writeString(serie);
|
||||||
|
dest.writeString(flagMovimentabile);
|
||||||
|
dest.writeString(codJfas);
|
||||||
|
dest.writeString(codVlis);
|
||||||
|
dest.writeString(codCcau);
|
||||||
|
dest.writeString(codCcon);
|
||||||
|
dest.writeString(codDtip);
|
||||||
|
dest.writeString(codDtipFat);
|
||||||
|
dest.writeString(flagContoVendita);
|
||||||
|
dest.writeString(flagTipoNegozio);
|
||||||
|
dest.writeString(codMdepReso);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<MtbDepo> CREATOR = new Creator<MtbDepo>() {
|
||||||
|
@Override
|
||||||
|
public MtbDepo createFromParcel(Parcel in) {
|
||||||
|
return new MtbDepo(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MtbDepo[] newArray(int size) {
|
||||||
|
return new MtbDepo[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setDescrizione(String descrizione) {
|
||||||
|
this.descrizione = descrizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagVal() {
|
||||||
|
return flagVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setFlagVal(String flagVal) {
|
||||||
|
this.flagVal = flagVal;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodAnag() {
|
||||||
|
return codAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setCodAnag(String codAnag) {
|
||||||
|
this.codAnag = codAnag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPercDepo() {
|
||||||
|
return percDepo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setPercDepo(BigDecimal percDepo) {
|
||||||
|
this.percDepo = percDepo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getValDepo() {
|
||||||
|
return valDepo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setValDepo(BigDecimal valDepo) {
|
||||||
|
this.valDepo = valDepo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIndirizzo() {
|
||||||
|
return indirizzo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setIndirizzo(String indirizzo) {
|
||||||
|
this.indirizzo = indirizzo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCap() {
|
||||||
|
return cap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setCap(String cap) {
|
||||||
|
this.cap = cap;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCitta() {
|
||||||
|
return citta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setCitta(String citta) {
|
||||||
|
this.citta = citta;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProv() {
|
||||||
|
return prov;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setProv(String prov) {
|
||||||
|
this.prov = prov;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTel() {
|
||||||
|
return tel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setTel(String tel) {
|
||||||
|
this.tel = tel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNazione() {
|
||||||
|
return nazione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setNazione(String nazione) {
|
||||||
|
this.nazione = nazione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFax() {
|
||||||
|
return fax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setFax(String fax) {
|
||||||
|
this.fax = fax;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String geteMail() {
|
||||||
|
return eMail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo seteMail(String eMail) {
|
||||||
|
this.eMail = eMail;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSitoWeb() {
|
||||||
|
return sitoWeb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setSitoWeb(String sitoWeb) {
|
||||||
|
this.sitoWeb = sitoWeb;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodVdes() {
|
||||||
|
return codVdes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setCodVdes(String codVdes) {
|
||||||
|
this.codVdes = codVdes;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSerie() {
|
||||||
|
return serie;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setSerie(String serie) {
|
||||||
|
this.serie = serie;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagMovimentabile() {
|
||||||
|
return flagMovimentabile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setFlagMovimentabile(String flagMovimentabile) {
|
||||||
|
this.flagMovimentabile = flagMovimentabile;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodJfas() {
|
||||||
|
return codJfas;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setCodJfas(String codJfas) {
|
||||||
|
this.codJfas = codJfas;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodVlis() {
|
||||||
|
return codVlis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setCodVlis(String codVlis) {
|
||||||
|
this.codVlis = codVlis;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodCcau() {
|
||||||
|
return codCcau;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setCodCcau(String codCcau) {
|
||||||
|
this.codCcau = codCcau;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodCcon() {
|
||||||
|
return codCcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setCodCcon(String codCcon) {
|
||||||
|
this.codCcon = codCcon;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodDtip() {
|
||||||
|
return codDtip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setCodDtip(String codDtip) {
|
||||||
|
this.codDtip = codDtip;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodDtipFat() {
|
||||||
|
return codDtipFat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setCodDtipFat(String codDtipFat) {
|
||||||
|
this.codDtipFat = codDtipFat;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagContoVendita() {
|
||||||
|
return flagContoVendita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setFlagContoVendita(String flagContoVendita) {
|
||||||
|
this.flagContoVendita = flagContoVendita;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagTipoNegozio() {
|
||||||
|
return flagTipoNegozio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setFlagTipoNegozio(String flagTipoNegozio) {
|
||||||
|
this.flagTipoNegozio = flagTipoNegozio;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMdepReso() {
|
||||||
|
return codMdepReso;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepo setCodMdepReso(String codMdepReso) {
|
||||||
|
this.codMdepReso = codMdepReso;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
public class MtbDepoPosizione {
|
||||||
|
|
||||||
|
private String codMdep;
|
||||||
|
private String posizione;
|
||||||
|
private String descrizione;
|
||||||
|
private String flagMonoCollo;
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepoPosizione setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPosizione() {
|
||||||
|
return posizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepoPosizione setPosizione(String posizione) {
|
||||||
|
this.posizione = posizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepoPosizione setDescrizione(String descrizione) {
|
||||||
|
this.descrizione = descrizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagMonoCollo() {
|
||||||
|
return flagMonoCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbDepoPosizione setFlagMonoCollo(String flagMonoCollo) {
|
||||||
|
this.flagMonoCollo = flagMonoCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFlagMonoCollo() {
|
||||||
|
return flagMonoCollo.equalsIgnoreCase("S");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model.secondary;
|
||||||
|
|
||||||
|
public enum GestioneEnum {
|
||||||
|
|
||||||
|
ACQUISTO("A"),
|
||||||
|
LAVORAZIONE("L"),
|
||||||
|
VENDITA("V");
|
||||||
|
|
||||||
|
private String text;
|
||||||
|
GestioneEnum(String text) {
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
public String getText() {
|
||||||
|
return this.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GestioneEnum fromString(String text) {
|
||||||
|
for (GestioneEnum b : GestioneEnum.values()) {
|
||||||
|
if (b.text.equalsIgnoreCase(text)) return b;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
package it.integry.integrywmsnative.core.report;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
|
import it.integry.integrywmsnative.generated.callback.Runnable;
|
||||||
|
|
||||||
|
public class ReportManager {
|
||||||
|
|
||||||
|
|
||||||
|
public static void getRightReportNameByMtbColt(MtbColt mtbColt, RunnableArgs<String> onComplete, RunnableArgs<Exception> onFailed) throws Exception{
|
||||||
|
|
||||||
|
if(mtbColt != null){
|
||||||
|
|
||||||
|
GestioneEnum gestione = GestioneEnum.fromString(mtbColt.getGestione());
|
||||||
|
|
||||||
|
switch (gestione) {
|
||||||
|
case ACQUISTO:
|
||||||
|
onComplete.run("EtichettaBancale");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LAVORAZIONE:
|
||||||
|
onComplete.run("EtichettaInventario");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VENDITA:
|
||||||
|
onComplete.run("EtichettaSpedizione");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
throw new Exception("mtbColt cannot be NULL");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,91 @@
|
|||||||
|
package it.integry.integrywmsnative.core.settings;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.AvailableCodMdepsDTO;
|
||||||
|
import it.integry.integrywmsnative.core.model.Azienda;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbDepo;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
|
|
||||||
|
public class DBSettingsModel {
|
||||||
|
|
||||||
|
private List<String> availableProfiles = null;
|
||||||
|
private List<AvailableCodMdepsDTO> availableCodMdep = null;
|
||||||
|
private List<MtbDepoPosizione> availablePosizioni = null;
|
||||||
|
|
||||||
|
private Azienda datiAzienda = null;
|
||||||
|
|
||||||
|
private boolean enableCheckPartitaMagCheckPickingV;
|
||||||
|
private boolean flagMultiClienteOrdV;
|
||||||
|
private String defaultCodAnag;
|
||||||
|
private String defaultCausaleRettificaGiacenze;
|
||||||
|
|
||||||
|
public List<String> getAvailableProfiles() {
|
||||||
|
return availableProfiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MtbDepoPosizione> getAvailablePosizioni() {
|
||||||
|
return availablePosizioni;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvailableProfiles(List<String> availableProfiles) {
|
||||||
|
this.availableProfiles = availableProfiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvailablePosizioni(List<MtbDepoPosizione> availablePosizioni) {
|
||||||
|
this.availablePosizioni = availablePosizioni;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Azienda getDatiAzienda() {
|
||||||
|
return datiAzienda;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setDatiAzienda(Azienda datiAzienda) {
|
||||||
|
this.datiAzienda = datiAzienda;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<AvailableCodMdepsDTO> getAvailableCodMdep() {
|
||||||
|
return availableCodMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvailableCodMdep(List<AvailableCodMdepsDTO> availableCodMdep) {
|
||||||
|
this.availableCodMdep = availableCodMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEnableCheckPartitaMagCheckPickingV() {
|
||||||
|
return enableCheckPartitaMagCheckPickingV;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setEnableCheckPartitaMagCheckPickingV(boolean enableCheckPartitaMagCheckPickingV) {
|
||||||
|
this.enableCheckPartitaMagCheckPickingV = enableCheckPartitaMagCheckPickingV;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFlagMultiClienteOrdV() {
|
||||||
|
return flagMultiClienteOrdV;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setFlagMultiClienteOrdV(boolean flagMultiClienteOrdV) {
|
||||||
|
this.flagMultiClienteOrdV = flagMultiClienteOrdV;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefaultCodAnag() {
|
||||||
|
return defaultCodAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setDefaultCodAnag(String defaultCodAnag) {
|
||||||
|
this.defaultCodAnag = defaultCodAnag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefaultCausaleRettificaGiacenze() {
|
||||||
|
return defaultCausaleRettificaGiacenze;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setDefaultCausaleRettificaGiacenze(String defaultCausaleRettificaGiacenze) {
|
||||||
|
this.defaultCausaleRettificaGiacenze = defaultCausaleRettificaGiacenze;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,186 @@
|
|||||||
|
package it.integry.integrywmsnative.core.settings;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.REST.consumers.ColliMagazzinoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.REST.consumers.GestSetupRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||||
|
import it.integry.integrywmsnative.core.REST.consumers.SystemRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.AvailableCodMdepsDTO;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
|
||||||
|
public class SettingsManager {
|
||||||
|
|
||||||
|
private static String TAG = "SETTINGS";
|
||||||
|
|
||||||
|
private static SettingsModel settingsModelIstance;
|
||||||
|
private static DBSettingsModel dbSettingsModelIstance;
|
||||||
|
|
||||||
|
private static boolean firstStart = false;
|
||||||
|
|
||||||
|
private static Context mContext;
|
||||||
|
|
||||||
|
public static void init(Context context){
|
||||||
|
mContext = context;
|
||||||
|
|
||||||
|
settingsModelIstance = (SettingsModel) Stash.getObject(TAG, SettingsModel.class);
|
||||||
|
|
||||||
|
if(settingsModelIstance == null) {
|
||||||
|
settingsModelIstance = new SettingsModel();
|
||||||
|
|
||||||
|
settingsModelIstance.server = new SettingsModel.Server();
|
||||||
|
settingsModelIstance.user = new SettingsModel.User();
|
||||||
|
settingsModelIstance.userSession = new SettingsModel.UserSession();
|
||||||
|
|
||||||
|
dbSettingsModelIstance = new DBSettingsModel();
|
||||||
|
|
||||||
|
firstStart = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
dbSettingsModelIstance = new DBSettingsModel();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SettingsModel i(){
|
||||||
|
return settingsModelIstance;
|
||||||
|
}
|
||||||
|
public static DBSettingsModel iDB(){
|
||||||
|
return dbSettingsModelIstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isFirstStart(){
|
||||||
|
return firstStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void update(){
|
||||||
|
Stash.put(TAG, settingsModelIstance);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void reloadDBVariables(Runnable onComplete, RunnableArgs<Exception> onFailed){
|
||||||
|
dbSettingsModelIstance = new DBSettingsModel();
|
||||||
|
|
||||||
|
loadDatiAzienda(() ->
|
||||||
|
loadAvailableProfiles(() ->
|
||||||
|
loadAvailableCodMdeps(() ->
|
||||||
|
loadAvailablePosizioni(() ->
|
||||||
|
loadGestSetupValues(onComplete, onFailed) ,onFailed), onFailed), onFailed), onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void loadDatiAzienda(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
SystemRESTConsumer.getAzienda(datiAzienda -> {
|
||||||
|
SettingsManager.iDB().setDatiAzienda(datiAzienda);
|
||||||
|
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void loadAvailableProfiles(Runnable onComplete, RunnableArgs<Exception> onFailed){
|
||||||
|
SystemRESTConsumer.getAvailableProfiles(new ISimpleOperationCallback<List<String>>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<String> availableProfiles) {
|
||||||
|
dbSettingsModelIstance.setAvailableProfiles(availableProfiles);
|
||||||
|
|
||||||
|
onComplete.run();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
//BOH
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void loadAvailableCodMdeps(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
SystemRESTConsumer.getAvailableCodMdeps(new ISimpleOperationCallback<List<AvailableCodMdepsDTO>>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<AvailableCodMdepsDTO> availableCodMdeps) {
|
||||||
|
dbSettingsModelIstance.setAvailableCodMdep(availableCodMdeps);
|
||||||
|
|
||||||
|
if(availableCodMdeps == null || availableCodMdeps.size() == 0) {
|
||||||
|
onFailed.run(new Exception(mContext.getText(R.string.no_codmdep_available).toString()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean codMdepExistsAnymore = false;
|
||||||
|
|
||||||
|
if(settingsModelIstance.userSession.depo != null){
|
||||||
|
for(AvailableCodMdepsDTO availableCodMdepDTO : availableCodMdeps){
|
||||||
|
//Controllo se il codMdep salvato esiste ancora
|
||||||
|
if(availableCodMdepDTO.getCodMdep().equalsIgnoreCase(settingsModelIstance.userSession.depo.getCodMdep())) {
|
||||||
|
codMdepExistsAnymore = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!codMdepExistsAnymore){
|
||||||
|
settingsModelIstance.userSession.depo = availableCodMdeps.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
//BOH
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static void loadAvailablePosizioni(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ColliMagazzinoRESTConsumer.getAvailablePosizioni(availablePosizioni -> {
|
||||||
|
dbSettingsModelIstance.setAvailablePosizioni(availablePosizioni);
|
||||||
|
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
|
}, ex -> {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static void loadGestSetupValues(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
GestSetupRESTConsumer.getValue("PICKING", "SETUP", "DEFAULT_CAUSALE_RETTIFICA_GIACENZE", valueDefaultCausaleRettificaGiacenze -> {
|
||||||
|
dbSettingsModelIstance.setDefaultCausaleRettificaGiacenze(valueDefaultCausaleRettificaGiacenze.value);
|
||||||
|
|
||||||
|
GestSetupRESTConsumer.getBooleanValue("PICKING", "SETUP", "ENABLE_CHECK_PARTITA_MAG_PICKING_V", valueEnableCheckPartitaMag -> {
|
||||||
|
dbSettingsModelIstance.setEnableCheckPartitaMagCheckPickingV(valueEnableCheckPartitaMag);
|
||||||
|
|
||||||
|
GestSetupRESTConsumer.getBooleanValue("PICKING", "SETUP", "FLAG_MULTI_CLIENTE_ORD_VENDITA", valueFlagMultiClienteOrdVendita -> {
|
||||||
|
dbSettingsModelIstance.setFlagMultiClienteOrdV(valueFlagMultiClienteOrdVendita);
|
||||||
|
|
||||||
|
GestSetupRESTConsumer.getValue("PICKING", "SETUP", "COD_ANAG_DEFAULT", valueCodAnagDefault -> {
|
||||||
|
dbSettingsModelIstance.setDefaultCodAnag(valueCodAnagDefault.value);
|
||||||
|
|
||||||
|
if(onComplete != null) onComplete.run();
|
||||||
|
}, ex -> {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
});
|
||||||
|
|
||||||
|
}, ex -> {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
});
|
||||||
|
|
||||||
|
}, ex -> {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
});
|
||||||
|
|
||||||
|
}, ex -> {
|
||||||
|
if(onFailed != null) onFailed.run(ex);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
package it.integry.integrywmsnative.core.settings;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.AvailableCodMdepsDTO;
|
||||||
|
|
||||||
|
public class SettingsModel {
|
||||||
|
|
||||||
|
public Server server;
|
||||||
|
public User user;
|
||||||
|
public UserSession userSession;
|
||||||
|
|
||||||
|
|
||||||
|
public static class Server {
|
||||||
|
public String codAzienda;
|
||||||
|
public String host;
|
||||||
|
public int port;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class User {
|
||||||
|
public String username;
|
||||||
|
public String password;
|
||||||
|
public String fullname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class UserSession {
|
||||||
|
public String profileDB;
|
||||||
|
public AvailableCodMdepsDTO depo;
|
||||||
|
// public String codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
package it.integry.integrywmsnative.core.settings;
|
||||||
|
|
||||||
|
public final class SharedPrefKeys {
|
||||||
|
|
||||||
|
|
||||||
|
public static final String ACCETTAZIONE_PRINTER = "accettazione_printer";
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,241 @@
|
|||||||
|
package it.integry.integrywmsnative.core.settings;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
|
|
||||||
|
import java.lang.reflect.ParameterizedType;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public class Stash {
|
||||||
|
|
||||||
|
private static Stash stash;
|
||||||
|
private SharedPreferences sp;
|
||||||
|
|
||||||
|
public static void init(Context context) {
|
||||||
|
stash = new Stash();
|
||||||
|
if (stash.sp == null) {
|
||||||
|
stash.sp = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void checkfornull() {
|
||||||
|
if (stash == null)
|
||||||
|
throw new NullPointerException("Call init() method in application class");
|
||||||
|
}
|
||||||
|
|
||||||
|
//putString
|
||||||
|
public static void put(String key, String value) {
|
||||||
|
checkfornull();
|
||||||
|
try {
|
||||||
|
stash.sp.edit().putString(key, value).apply();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//putStringSet
|
||||||
|
public static void put(String key, Set<String> value) {
|
||||||
|
checkfornull();
|
||||||
|
try {
|
||||||
|
stash.sp.edit().putStringSet(key, value).apply();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//putInt
|
||||||
|
public static void put(String key, int value) {
|
||||||
|
checkfornull();
|
||||||
|
try {
|
||||||
|
stash.sp.edit().putInt(key, value).apply();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//putLong
|
||||||
|
public static void put(String key, long value) {
|
||||||
|
checkfornull();
|
||||||
|
try {
|
||||||
|
stash.sp.edit().putLong(key, value).apply();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//putFloat
|
||||||
|
public static void put(String key, float value) {
|
||||||
|
checkfornull();
|
||||||
|
try {
|
||||||
|
stash.sp.edit().putFloat(key, value).apply();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//putBoolean
|
||||||
|
public static void put(String key, boolean value) {
|
||||||
|
checkfornull();
|
||||||
|
try {
|
||||||
|
stash.sp.edit().putBoolean(key, value).apply();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//putObject or arrayList
|
||||||
|
public static void put(String key, Object value) {
|
||||||
|
checkfornull();
|
||||||
|
try {
|
||||||
|
Gson gson = new GsonBuilder().create();
|
||||||
|
stash.sp.edit().putString(key, gson.toJson(value).toString()).apply();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//getString
|
||||||
|
public static String getString(String key, String defaultvalue) {
|
||||||
|
checkfornull();
|
||||||
|
try {
|
||||||
|
return stash.sp.getString(key, defaultvalue);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return defaultvalue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//getStringSet
|
||||||
|
public static Set<String> getStringSet(String key, Set<String> defaultvalue) {
|
||||||
|
checkfornull();
|
||||||
|
try {
|
||||||
|
return getStringSet(key, defaultvalue);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return defaultvalue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//getInt
|
||||||
|
public static int getInt(String key, int defaultvalue) {
|
||||||
|
checkfornull();
|
||||||
|
try {
|
||||||
|
return stash.sp.getInt(key, defaultvalue);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return defaultvalue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//getLong
|
||||||
|
public static long getLong(String key, long defaultvalue) {
|
||||||
|
checkfornull();
|
||||||
|
try {
|
||||||
|
return stash.sp.getLong(key, defaultvalue);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return defaultvalue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//getFloat
|
||||||
|
public static float getFloat(String key, float defaultvalue) {
|
||||||
|
checkfornull();
|
||||||
|
try {
|
||||||
|
return stash.sp.getFloat(key, defaultvalue);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return defaultvalue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//getBoolean
|
||||||
|
public static boolean getBoolean(String key, boolean defaultvalue) {
|
||||||
|
checkfornull();
|
||||||
|
try {
|
||||||
|
return stash.sp.getBoolean(key, defaultvalue);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return defaultvalue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//getObject
|
||||||
|
public static <T> Object getObject(String key, Class<?> tClass) {
|
||||||
|
checkfornull();
|
||||||
|
try {
|
||||||
|
Gson gson = new GsonBuilder().create();
|
||||||
|
return gson.fromJson(stash.sp.getString(key, ""), tClass);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e("gson", e.getMessage());
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//getArrayList
|
||||||
|
public static <T> ArrayList<T> getArrayList(String key, Class<?> tClass) {
|
||||||
|
Log.e("_+_++__+_+", "" + tClass.getName());
|
||||||
|
Gson gson = new Gson();
|
||||||
|
String data = stash.sp.getString(key, "");
|
||||||
|
if (!data.trim().isEmpty()) {
|
||||||
|
Type type = new GenericType(tClass);
|
||||||
|
return (ArrayList<T>) gson.fromJson(data, type);
|
||||||
|
}
|
||||||
|
return new ArrayList<T>();
|
||||||
|
}
|
||||||
|
|
||||||
|
//clear single value
|
||||||
|
public static void clear(String key) {
|
||||||
|
checkfornull();
|
||||||
|
try {
|
||||||
|
stash.sp.edit().remove(key).apply();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//clear all preference
|
||||||
|
public static void clearAll() {
|
||||||
|
checkfornull();
|
||||||
|
try {
|
||||||
|
stash.sp.edit().clear().apply();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class GenericType implements ParameterizedType {
|
||||||
|
|
||||||
|
private Type type;
|
||||||
|
|
||||||
|
GenericType(Type type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type[] getActualTypeArguments() {
|
||||||
|
return new Type[]{type};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type getRawType() {
|
||||||
|
return ArrayList.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type getOwnerType() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// implement equals method too! (as per javadoc)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
package it.integry.integrywmsnative.core.update;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.github.javiersantos.appupdater.AppUpdater;
|
||||||
|
import com.github.javiersantos.appupdater.enums.Display;
|
||||||
|
import com.github.javiersantos.appupdater.enums.UpdateFrom;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
|
||||||
|
public class UpdatesManager {
|
||||||
|
|
||||||
|
public static void init(Context context) {
|
||||||
|
AppUpdater appUpdater = new AppUpdater(context)
|
||||||
|
.setDisplay(Display.DIALOG)
|
||||||
|
.setUpdateFrom(UpdateFrom.JSON)
|
||||||
|
.setUpdateJSON("http://" + SettingsManager.i().server.host + ":" + SettingsManager.i().server.port + "/ems-api/wms/currentVersion");
|
||||||
|
appUpdater.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class UtilityArray {
|
||||||
|
|
||||||
|
public static<T> T[] listToArray(List<T> inputList, Class<T> c) {
|
||||||
|
|
||||||
|
T[] result = (T[]) Array.newInstance(c, inputList.size());
|
||||||
|
result = inputList.toArray(result);
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,88 @@
|
|||||||
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.plugins.barcode_base_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.plugins.barcode_base_library.model.BarcodeType;
|
||||||
|
|
||||||
|
public class UtilityBarcode {
|
||||||
|
|
||||||
|
public static boolean isEtichettaAnonima(BarcodeScanDTO barcodeScanDTO){
|
||||||
|
return barcodeScanDTO != null && barcodeScanDTO.getType() == BarcodeType.CODE128 && barcodeScanDTO.getStringValue().startsWith("U");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isEtichetta128(BarcodeScanDTO barcodeScanDTO){
|
||||||
|
return barcodeScanDTO != null && (barcodeScanDTO.getType() == BarcodeType.CODE128 || barcodeScanDTO.getType() == BarcodeType.EAN128);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isEtichettaPosizione(BarcodeScanDTO barcodeScanDTO) {
|
||||||
|
String barcode = barcodeScanDTO.getStringValue();
|
||||||
|
boolean isPosizione = false;
|
||||||
|
|
||||||
|
if(SettingsManager.iDB().getAvailablePosizioni() != null) {
|
||||||
|
Stream<MtbDepoPosizione> tmpStream = Stream.of(SettingsManager.iDB().getAvailablePosizioni())
|
||||||
|
.filter(x -> x.getPosizione().equalsIgnoreCase(barcode));
|
||||||
|
|
||||||
|
if(tmpStream.count() > 0){
|
||||||
|
isPosizione = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return barcodeScanDTO != null && isPosizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isEanPeso(BarcodeScanDTO barcodeScanDTO) {
|
||||||
|
return barcodeScanDTO != null && barcodeScanDTO.getType() == BarcodeType.EAN13 && barcodeScanDTO.getStringValue().startsWith("2");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static Integer getNumColloFromULAnonima(String barcode) {
|
||||||
|
if(barcode != null){
|
||||||
|
return Integer.parseInt(barcode.substring(3));
|
||||||
|
} else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static String convertITF14toEAN13(String barcodeITF14) {
|
||||||
|
String barcodeEAN13 = null;
|
||||||
|
|
||||||
|
if(barcodeITF14.length() == 14) {
|
||||||
|
barcodeEAN13 = barcodeITF14.substring(1, barcodeITF14.length() - 1).trim();
|
||||||
|
barcodeEAN13 += getEAN13CheckDigit(barcodeEAN13);
|
||||||
|
}
|
||||||
|
|
||||||
|
return barcodeEAN13;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String convertITF14toNeutral(String barcodeITF14) {
|
||||||
|
String barcodeNeutral = null;
|
||||||
|
|
||||||
|
if(barcodeITF14.length() == 14) {
|
||||||
|
barcodeNeutral = barcodeITF14.substring(1, barcodeITF14.length() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return barcodeNeutral;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static String getEAN13CheckDigit(String ean) {
|
||||||
|
|
||||||
|
if (ean.length() != 12) {
|
||||||
|
UtilityLogger.errorMe(new Exception("Please provide an input string of 12 chars. Current lenght: "+ean.length()));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
long tot = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i < 12; i++) {
|
||||||
|
tot = tot + (Long.parseLong(String.valueOf(ean.charAt(i))) * (i % 2 == 0 ? 1 : 3));
|
||||||
|
}
|
||||||
|
return tot % 10 == 0 ? "0" : "" +(10-(tot % 10));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class UtilityDB {
|
||||||
|
|
||||||
|
public static String valueToString(Object value) {
|
||||||
|
String valueString;
|
||||||
|
SimpleDateFormat dateFormatFile = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|
||||||
|
if (value == null) {
|
||||||
|
valueString = "NULL";
|
||||||
|
} else {
|
||||||
|
|
||||||
|
valueString = value.toString();
|
||||||
|
|
||||||
|
if(value instanceof String) {
|
||||||
|
if(UtilityString.isNullOrEmpty((String) value)){
|
||||||
|
valueString = "NULL";
|
||||||
|
} else {
|
||||||
|
valueString = "'" + valueString.replaceAll("'","''") + "'";
|
||||||
|
}
|
||||||
|
} else if (value instanceof Date){
|
||||||
|
valueString = "'" + dateFormatFile.format(value) + "'";
|
||||||
|
} else if (value instanceof Integer) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
valueString = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return valueString;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user